diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:57:26 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:57:26 +0000 |
commit | 30883c26bdceb9eaf32c8d4a1b0c1bce223b5226 (patch) | |
tree | 39a02e2aeb21ab5b7923c6f5757d66d55b708912 /wp-includes/js/dist/components.js | |
parent | Adding upstream version 6.4.3+dfsg1. (diff) | |
download | wordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.tar.xz wordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.zip |
Adding upstream version 6.5+dfsg1.upstream/6.5+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wp-includes/js/dist/components.js')
-rw-r--r-- | wp-includes/js/dist/components.js | 29786 |
1 files changed, 10980 insertions, 18806 deletions
diff --git a/wp-includes/js/dist/components.js b/wp-includes/js/dist/components.js index 00e9b8a..2ca3181 100644 --- a/wp-includes/js/dist/components.js +++ b/wp-includes/js/dist/components.js @@ -1,8 +1,8 @@ -/******/ (function() { // webpackBootstrap +/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ -/***/ 4403: -/***/ (function(module, exports) { +/***/ 5755: +/***/ ((module, exports) => { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! Copyright (c) 2018 Jed Watson. @@ -67,8 +67,8 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! /***/ }), -/***/ 1919: -/***/ (function(module) { +/***/ 66: +/***/ ((module) => { "use strict"; @@ -208,13 +208,13 @@ module.exports = deepmerge_1; /***/ }), -/***/ 1345: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 1637: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var util = __webpack_require__(5022); +var util = __webpack_require__(3062); function scrollIntoView(elem, container, config) { config = config || {}; @@ -344,18 +344,18 @@ module.exports = scrollIntoView; /***/ }), -/***/ 5425: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 5428: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -module.exports = __webpack_require__(1345); +module.exports = __webpack_require__(1637); /***/ }), -/***/ 5022: -/***/ (function(module) { +/***/ 3062: +/***/ ((module) => { "use strict"; @@ -800,8 +800,8 @@ module.exports = _extends({ /***/ }), -/***/ 9214: -/***/ (function(__unused_webpack_module, exports) { +/***/ 2287: +/***/ ((__unused_webpack_module, exports) => { "use strict"; var __webpack_unused_export__; @@ -823,21 +823,21 @@ __webpack_unused_export__=y; /***/ }), -/***/ 2797: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 1915: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (true) { - /* unused reexport */ __webpack_require__(9214); + /* unused reexport */ __webpack_require__(2287); } else {} /***/ }), -/***/ 5619: -/***/ (function(module) { +/***/ 7734: +/***/ ((module) => { "use strict"; @@ -916,8 +916,8 @@ module.exports = function equal(a, b) { /***/ }), -/***/ 7115: -/***/ (function(__unused_webpack_module, exports) { +/***/ 8924: +/***/ ((__unused_webpack_module, exports) => { // Copyright (c) 2014 Rafael Caricio. All rights reserved. // Use of this source code is governed by a BSD-style license that can be @@ -1262,8 +1262,8 @@ exports.parse = (GradientParser || {}).parse; /***/ }), -/***/ 3138: -/***/ (function(module) { +/***/ 9664: +/***/ ((module) => { module.exports = /******/ (function(modules) { // webpackBootstrap @@ -1524,13 +1524,13 @@ module.exports = /***/ }), -/***/ 1281: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 1880: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var reactIs = __webpack_require__(338); +var reactIs = __webpack_require__(1178); /** * Copyright 2015, Yahoo! Inc. @@ -1635,8 +1635,44 @@ module.exports = hoistNonReactStatics; /***/ }), -/***/ 5372: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 2950: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +/** @license React v16.13.1 + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b? +Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119; +function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d; +exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t}; +exports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p}; +exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z; + + +/***/ }), + +/***/ 1178: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +if (true) { + module.exports = __webpack_require__(2950); +} else {} + + +/***/ }), + +/***/ 628: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /** @@ -1648,7 +1684,7 @@ module.exports = hoistNonReactStatics; -var ReactPropTypesSecret = __webpack_require__(9567); +var ReactPropTypesSecret = __webpack_require__(4067); function emptyFunction() {} function emptyFunctionWithReset() {} @@ -1708,8 +1744,8 @@ module.exports = function() { /***/ }), -/***/ 2652: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 5826: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Copyright (c) 2013-present, Facebook, Inc. @@ -1721,14 +1757,14 @@ module.exports = function() { if (false) { var throwOnDirectAccess, ReactIs; } else { // By explicitly using `prop-types` you are opting into new production behavior. // http://fb.me/prop-types-in-prod - module.exports = __webpack_require__(5372)(); + module.exports = __webpack_require__(628)(); } /***/ }), -/***/ 9567: -/***/ (function(module) { +/***/ 4067: +/***/ ((module) => { "use strict"; /** @@ -1747,44 +1783,8 @@ module.exports = ReactPropTypesSecret; /***/ }), -/***/ 4821: -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; -/** @license React v16.13.1 - * react-is.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b? -Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119; -function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d; -exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t}; -exports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p}; -exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z; - - -/***/ }), - -/***/ 338: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -"use strict"; - - -if (true) { - module.exports = __webpack_require__(4821); -} else {} - - -/***/ }), - -/***/ 2455: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ 3394: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** @@ -1796,27 +1796,27 @@ if (true) { * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ -var f=__webpack_require__(9196),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0}; +var f=__webpack_require__(1609),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0}; function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q; /***/ }), -/***/ 7557: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 4922: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (true) { - module.exports = __webpack_require__(2455); + module.exports = __webpack_require__(3394); } else {} /***/ }), -/***/ 4793: -/***/ (function(module) { +/***/ 9681: +/***/ ((module) => { var characterMap = { "À": "A", @@ -2303,8 +2303,8 @@ module.exports.remove = removeAccents; /***/ }), -/***/ 7755: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { +/***/ 8477: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** @@ -2316,27 +2316,27 @@ module.exports.remove = removeAccents; * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ -var e=__webpack_require__(9196);function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k="function"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c})},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c})})},[a]);p(d);return d} +var e=__webpack_require__(1609);function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k="function"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c})},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c})})},[a]);p(d);return d} function r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return!k(a,d)}catch(f){return!0}}function t(a,b){return b()}var u="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?t:q;exports.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u; /***/ }), -/***/ 635: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { +/***/ 422: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (true) { - module.exports = __webpack_require__(7755); + module.exports = __webpack_require__(8477); } else {} /***/ }), -/***/ 9196: -/***/ (function(module) { +/***/ 1609: +/***/ ((module) => { "use strict"; module.exports = window["React"]; @@ -2371,20 +2371,20 @@ module.exports = window["React"]; /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ -/******/ !function() { +/******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { +/******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? -/******/ function() { return module['default']; } : -/******/ function() { return module; }; +/******/ () => (module['default']) : +/******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; -/******/ }(); +/******/ })(); /******/ /******/ /* webpack/runtime/create fake namespace object */ -/******/ !function() { -/******/ var getProto = Object.getPrototypeOf ? function(obj) { return Object.getPrototypeOf(obj); } : function(obj) { return obj.__proto__; }; +/******/ (() => { +/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); /******/ var leafPrototypes; /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it @@ -2404,2765 +2404,292 @@ module.exports = window["React"]; /******/ var def = {}; /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; /******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { -/******/ Object.getOwnPropertyNames(current).forEach(function(key) { def[key] = function() { return value[key]; }; }); +/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key]))); /******/ } -/******/ def['default'] = function() { return value; }; +/******/ def['default'] = () => (value); /******/ __webpack_require__.d(ns, def); /******/ return ns; /******/ }; -/******/ }(); +/******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ -/******/ !function() { +/******/ (() => { /******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = function(exports, definition) { +/******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; -/******/ }(); +/******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ !function() { -/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } -/******/ }(); +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ -/******/ !function() { +/******/ (() => { /******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { +/******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; -/******/ }(); +/******/ })(); /******/ /******/ /* webpack/runtime/nonce */ -/******/ !function() { +/******/ (() => { /******/ __webpack_require__.nc = undefined; -/******/ }(); +/******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be in strict mode. -!function() { +(() => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { - AnglePickerControl: function() { return /* reexport */ angle_picker_control; }, - Animate: function() { return /* reexport */ animate; }, - Autocomplete: function() { return /* reexport */ Autocomplete; }, - BaseControl: function() { return /* reexport */ base_control; }, - BlockQuotation: function() { return /* reexport */ external_wp_primitives_namespaceObject.BlockQuotation; }, - Button: function() { return /* reexport */ build_module_button; }, - ButtonGroup: function() { return /* reexport */ button_group; }, - Card: function() { return /* reexport */ card_component; }, - CardBody: function() { return /* reexport */ card_body_component; }, - CardDivider: function() { return /* reexport */ card_divider_component; }, - CardFooter: function() { return /* reexport */ card_footer_component; }, - CardHeader: function() { return /* reexport */ card_header_component; }, - CardMedia: function() { return /* reexport */ card_media_component; }, - CheckboxControl: function() { return /* reexport */ checkbox_control; }, - Circle: function() { return /* reexport */ external_wp_primitives_namespaceObject.Circle; }, - ClipboardButton: function() { return /* reexport */ ClipboardButton; }, - ColorIndicator: function() { return /* reexport */ color_indicator; }, - ColorPalette: function() { return /* reexport */ color_palette; }, - ColorPicker: function() { return /* reexport */ LegacyAdapter; }, - ComboboxControl: function() { return /* reexport */ combobox_control; }, - CustomGradientPicker: function() { return /* reexport */ custom_gradient_picker; }, - CustomSelectControl: function() { return /* reexport */ StableCustomSelectControl; }, - Dashicon: function() { return /* reexport */ dashicon; }, - DatePicker: function() { return /* reexport */ date; }, - DateTimePicker: function() { return /* reexport */ build_module_date_time; }, - Disabled: function() { return /* reexport */ disabled; }, - Draggable: function() { return /* reexport */ draggable; }, - DropZone: function() { return /* reexport */ drop_zone; }, - DropZoneProvider: function() { return /* reexport */ DropZoneProvider; }, - Dropdown: function() { return /* reexport */ dropdown; }, - DropdownMenu: function() { return /* reexport */ dropdown_menu; }, - DuotonePicker: function() { return /* reexport */ duotone_picker; }, - DuotoneSwatch: function() { return /* reexport */ duotone_swatch; }, - ExternalLink: function() { return /* reexport */ external_link; }, - Fill: function() { return /* reexport */ slot_fill_Fill; }, - Flex: function() { return /* reexport */ flex_component; }, - FlexBlock: function() { return /* reexport */ flex_block_component; }, - FlexItem: function() { return /* reexport */ flex_item_component; }, - FocalPointPicker: function() { return /* reexport */ focal_point_picker; }, - FocusReturnProvider: function() { return /* reexport */ with_focus_return_Provider; }, - FocusableIframe: function() { return /* reexport */ FocusableIframe; }, - FontSizePicker: function() { return /* reexport */ font_size_picker; }, - FormFileUpload: function() { return /* reexport */ form_file_upload; }, - FormToggle: function() { return /* reexport */ form_toggle; }, - FormTokenField: function() { return /* reexport */ form_token_field; }, - G: function() { return /* reexport */ external_wp_primitives_namespaceObject.G; }, - GradientPicker: function() { return /* reexport */ gradient_picker; }, - Guide: function() { return /* reexport */ guide; }, - GuidePage: function() { return /* reexport */ GuidePage; }, - HorizontalRule: function() { return /* reexport */ external_wp_primitives_namespaceObject.HorizontalRule; }, - Icon: function() { return /* reexport */ build_module_icon; }, - IconButton: function() { return /* reexport */ deprecated; }, - IsolatedEventContainer: function() { return /* reexport */ isolated_event_container; }, - KeyboardShortcuts: function() { return /* reexport */ keyboard_shortcuts; }, - Line: function() { return /* reexport */ external_wp_primitives_namespaceObject.Line; }, - MenuGroup: function() { return /* reexport */ menu_group; }, - MenuItem: function() { return /* reexport */ menu_item; }, - MenuItemsChoice: function() { return /* reexport */ menu_items_choice; }, - Modal: function() { return /* reexport */ modal; }, - NavigableMenu: function() { return /* reexport */ navigable_container_menu; }, - Notice: function() { return /* reexport */ build_module_notice; }, - NoticeList: function() { return /* reexport */ list; }, - Panel: function() { return /* reexport */ panel; }, - PanelBody: function() { return /* reexport */ body; }, - PanelHeader: function() { return /* reexport */ panel_header; }, - PanelRow: function() { return /* reexport */ row; }, - Path: function() { return /* reexport */ external_wp_primitives_namespaceObject.Path; }, - Placeholder: function() { return /* reexport */ placeholder; }, - Polygon: function() { return /* reexport */ external_wp_primitives_namespaceObject.Polygon; }, - Popover: function() { return /* reexport */ popover; }, - QueryControls: function() { return /* reexport */ query_controls; }, - RadioControl: function() { return /* reexport */ radio_control; }, - RangeControl: function() { return /* reexport */ range_control; }, - Rect: function() { return /* reexport */ external_wp_primitives_namespaceObject.Rect; }, - ResizableBox: function() { return /* reexport */ resizable_box; }, - ResponsiveWrapper: function() { return /* reexport */ responsive_wrapper; }, - SVG: function() { return /* reexport */ external_wp_primitives_namespaceObject.SVG; }, - SandBox: function() { return /* reexport */ sandbox; }, - ScrollLock: function() { return /* reexport */ scroll_lock; }, - SearchControl: function() { return /* reexport */ search_control; }, - SelectControl: function() { return /* reexport */ select_control; }, - Slot: function() { return /* reexport */ slot_fill_Slot; }, - SlotFillProvider: function() { return /* reexport */ Provider; }, - Snackbar: function() { return /* reexport */ snackbar; }, - SnackbarList: function() { return /* reexport */ snackbar_list; }, - Spinner: function() { return /* reexport */ spinner; }, - TabPanel: function() { return /* reexport */ tab_panel; }, - TabbableContainer: function() { return /* reexport */ tabbable; }, - TextControl: function() { return /* reexport */ text_control; }, - TextHighlight: function() { return /* reexport */ text_highlight; }, - TextareaControl: function() { return /* reexport */ textarea_control; }, - TimePicker: function() { return /* reexport */ time; }, - Tip: function() { return /* reexport */ build_module_tip; }, - ToggleControl: function() { return /* reexport */ toggle_control; }, - Toolbar: function() { return /* reexport */ toolbar; }, - ToolbarButton: function() { return /* reexport */ toolbar_button; }, - ToolbarDropdownMenu: function() { return /* reexport */ toolbar_dropdown_menu; }, - ToolbarGroup: function() { return /* reexport */ toolbar_group; }, - ToolbarItem: function() { return /* reexport */ toolbar_item; }, - Tooltip: function() { return /* reexport */ tooltip; }, - TreeSelect: function() { return /* reexport */ tree_select; }, - VisuallyHidden: function() { return /* reexport */ visually_hidden_component; }, - __experimentalAlignmentMatrixControl: function() { return /* reexport */ alignment_matrix_control; }, - __experimentalApplyValueToSides: function() { return /* reexport */ applyValueToSides; }, - __experimentalBorderBoxControl: function() { return /* reexport */ border_box_control_component; }, - __experimentalBorderControl: function() { return /* reexport */ border_control_component; }, - __experimentalBoxControl: function() { return /* reexport */ box_control; }, - __experimentalConfirmDialog: function() { return /* reexport */ confirm_dialog_component; }, - __experimentalDimensionControl: function() { return /* reexport */ dimension_control; }, - __experimentalDivider: function() { return /* reexport */ divider_component; }, - __experimentalDropdownContentWrapper: function() { return /* reexport */ dropdown_content_wrapper; }, - __experimentalElevation: function() { return /* reexport */ elevation_component; }, - __experimentalGrid: function() { return /* reexport */ grid_component; }, - __experimentalHStack: function() { return /* reexport */ h_stack_component; }, - __experimentalHasSplitBorders: function() { return /* reexport */ hasSplitBorders; }, - __experimentalHeading: function() { return /* reexport */ heading_component; }, - __experimentalInputControl: function() { return /* reexport */ input_control; }, - __experimentalInputControlPrefixWrapper: function() { return /* reexport */ input_prefix_wrapper; }, - __experimentalInputControlSuffixWrapper: function() { return /* reexport */ input_suffix_wrapper; }, - __experimentalIsDefinedBorder: function() { return /* reexport */ isDefinedBorder; }, - __experimentalIsEmptyBorder: function() { return /* reexport */ isEmptyBorder; }, - __experimentalItem: function() { return /* reexport */ item_component; }, - __experimentalItemGroup: function() { return /* reexport */ item_group_component; }, - __experimentalNavigation: function() { return /* reexport */ navigation; }, - __experimentalNavigationBackButton: function() { return /* reexport */ back_button; }, - __experimentalNavigationGroup: function() { return /* reexport */ group; }, - __experimentalNavigationItem: function() { return /* reexport */ navigation_item; }, - __experimentalNavigationMenu: function() { return /* reexport */ navigation_menu; }, - __experimentalNavigatorBackButton: function() { return /* reexport */ navigator_back_button_component; }, - __experimentalNavigatorButton: function() { return /* reexport */ navigator_button_component; }, - __experimentalNavigatorProvider: function() { return /* reexport */ navigator_provider_component; }, - __experimentalNavigatorScreen: function() { return /* reexport */ navigator_screen_component; }, - __experimentalNavigatorToParentButton: function() { return /* reexport */ navigator_to_parent_button_component; }, - __experimentalNumberControl: function() { return /* reexport */ number_control; }, - __experimentalPaletteEdit: function() { return /* reexport */ palette_edit; }, - __experimentalParseQuantityAndUnitFromRawValue: function() { return /* reexport */ parseQuantityAndUnitFromRawValue; }, - __experimentalRadio: function() { return /* reexport */ radio_group_radio; }, - __experimentalRadioGroup: function() { return /* reexport */ radio_group; }, - __experimentalScrollable: function() { return /* reexport */ scrollable_component; }, - __experimentalSpacer: function() { return /* reexport */ spacer_component; }, - __experimentalStyleProvider: function() { return /* reexport */ style_provider; }, - __experimentalSurface: function() { return /* reexport */ surface_component; }, - __experimentalText: function() { return /* reexport */ text_component; }, - __experimentalToggleGroupControl: function() { return /* reexport */ toggle_group_control_component; }, - __experimentalToggleGroupControlOption: function() { return /* reexport */ toggle_group_control_option_component; }, - __experimentalToggleGroupControlOptionIcon: function() { return /* reexport */ toggle_group_control_option_icon_component; }, - __experimentalToolbarContext: function() { return /* reexport */ toolbar_context; }, - __experimentalToolsPanel: function() { return /* reexport */ tools_panel_component; }, - __experimentalToolsPanelContext: function() { return /* reexport */ ToolsPanelContext; }, - __experimentalToolsPanelItem: function() { return /* reexport */ tools_panel_item_component; }, - __experimentalTreeGrid: function() { return /* reexport */ tree_grid; }, - __experimentalTreeGridCell: function() { return /* reexport */ cell; }, - __experimentalTreeGridItem: function() { return /* reexport */ tree_grid_item; }, - __experimentalTreeGridRow: function() { return /* reexport */ tree_grid_row; }, - __experimentalTruncate: function() { return /* reexport */ truncate_component; }, - __experimentalUnitControl: function() { return /* reexport */ unit_control; }, - __experimentalUseCustomUnits: function() { return /* reexport */ useCustomUnits; }, - __experimentalUseNavigator: function() { return /* reexport */ use_navigator; }, - __experimentalUseSlot: function() { return /* reexport */ useSlot; }, - __experimentalUseSlotFills: function() { return /* reexport */ useSlotFills; }, - __experimentalVStack: function() { return /* reexport */ v_stack_component; }, - __experimentalView: function() { return /* reexport */ component; }, - __experimentalZStack: function() { return /* reexport */ z_stack_component; }, - __unstableAnimatePresence: function() { return /* reexport */ AnimatePresence; }, - __unstableComposite: function() { return /* reexport */ Composite; }, - __unstableCompositeGroup: function() { return /* reexport */ CompositeGroup; }, - __unstableCompositeItem: function() { return /* reexport */ CompositeItem; }, - __unstableDisclosureContent: function() { return /* reexport */ DisclosureContent_DisclosureContent; }, - __unstableGetAnimateClassName: function() { return /* reexport */ getAnimateClassName; }, - __unstableMotion: function() { return /* reexport */ motion; }, - __unstableMotionContext: function() { return /* reexport */ MotionContext; }, - __unstableUseAutocompleteProps: function() { return /* reexport */ useAutocompleteProps; }, - __unstableUseCompositeState: function() { return /* reexport */ useCompositeState; }, - __unstableUseNavigateRegions: function() { return /* reexport */ useNavigateRegions; }, - createSlotFill: function() { return /* reexport */ createSlotFill; }, - navigateRegions: function() { return /* reexport */ navigate_regions; }, - privateApis: function() { return /* reexport */ privateApis; }, - useBaseControlProps: function() { return /* reexport */ useBaseControlProps; }, - withConstrainedTabbing: function() { return /* reexport */ with_constrained_tabbing; }, - withFallbackStyles: function() { return /* reexport */ with_fallback_styles; }, - withFilters: function() { return /* reexport */ withFilters; }, - withFocusOutside: function() { return /* reexport */ with_focus_outside; }, - withFocusReturn: function() { return /* reexport */ with_focus_return; }, - withNotices: function() { return /* reexport */ with_notices; }, - withSpokenMessages: function() { return /* reexport */ with_spoken_messages; } + AnglePickerControl: () => (/* reexport */ angle_picker_control), + Animate: () => (/* reexport */ animate), + Autocomplete: () => (/* reexport */ Autocomplete), + BaseControl: () => (/* reexport */ base_control), + BlockQuotation: () => (/* reexport */ external_wp_primitives_namespaceObject.BlockQuotation), + Button: () => (/* reexport */ build_module_button), + ButtonGroup: () => (/* reexport */ button_group), + Card: () => (/* reexport */ card_component), + CardBody: () => (/* reexport */ card_body_component), + CardDivider: () => (/* reexport */ card_divider_component), + CardFooter: () => (/* reexport */ card_footer_component), + CardHeader: () => (/* reexport */ card_header_component), + CardMedia: () => (/* reexport */ card_media_component), + CheckboxControl: () => (/* reexport */ checkbox_control), + Circle: () => (/* reexport */ external_wp_primitives_namespaceObject.Circle), + ClipboardButton: () => (/* reexport */ ClipboardButton), + ColorIndicator: () => (/* reexport */ color_indicator), + ColorPalette: () => (/* reexport */ color_palette), + ColorPicker: () => (/* reexport */ LegacyAdapter), + ComboboxControl: () => (/* reexport */ combobox_control), + CustomGradientPicker: () => (/* reexport */ custom_gradient_picker), + CustomSelectControl: () => (/* reexport */ StableCustomSelectControl), + Dashicon: () => (/* reexport */ dashicon), + DatePicker: () => (/* reexport */ date), + DateTimePicker: () => (/* reexport */ build_module_date_time), + Disabled: () => (/* reexport */ disabled), + Draggable: () => (/* reexport */ draggable), + DropZone: () => (/* reexport */ drop_zone), + DropZoneProvider: () => (/* reexport */ DropZoneProvider), + Dropdown: () => (/* reexport */ dropdown), + DropdownMenu: () => (/* reexport */ dropdown_menu), + DuotonePicker: () => (/* reexport */ duotone_picker), + DuotoneSwatch: () => (/* reexport */ duotone_swatch), + ExternalLink: () => (/* reexport */ external_link), + Fill: () => (/* reexport */ slot_fill_Fill), + Flex: () => (/* reexport */ flex_component), + FlexBlock: () => (/* reexport */ flex_block_component), + FlexItem: () => (/* reexport */ flex_item_component), + FocalPointPicker: () => (/* reexport */ focal_point_picker), + FocusReturnProvider: () => (/* reexport */ with_focus_return_Provider), + FocusableIframe: () => (/* reexport */ FocusableIframe), + FontSizePicker: () => (/* reexport */ font_size_picker), + FormFileUpload: () => (/* reexport */ form_file_upload), + FormToggle: () => (/* reexport */ form_toggle), + FormTokenField: () => (/* reexport */ form_token_field), + G: () => (/* reexport */ external_wp_primitives_namespaceObject.G), + GradientPicker: () => (/* reexport */ gradient_picker), + Guide: () => (/* reexport */ guide), + GuidePage: () => (/* reexport */ GuidePage), + HorizontalRule: () => (/* reexport */ external_wp_primitives_namespaceObject.HorizontalRule), + Icon: () => (/* reexport */ build_module_icon), + IconButton: () => (/* reexport */ deprecated), + IsolatedEventContainer: () => (/* reexport */ isolated_event_container), + KeyboardShortcuts: () => (/* reexport */ keyboard_shortcuts), + Line: () => (/* reexport */ external_wp_primitives_namespaceObject.Line), + MenuGroup: () => (/* reexport */ menu_group), + MenuItem: () => (/* reexport */ menu_item), + MenuItemsChoice: () => (/* reexport */ menu_items_choice), + Modal: () => (/* reexport */ modal), + NavigableMenu: () => (/* reexport */ navigable_container_menu), + Notice: () => (/* reexport */ build_module_notice), + NoticeList: () => (/* reexport */ list), + Panel: () => (/* reexport */ panel), + PanelBody: () => (/* reexport */ body), + PanelHeader: () => (/* reexport */ panel_header), + PanelRow: () => (/* reexport */ row), + Path: () => (/* reexport */ external_wp_primitives_namespaceObject.Path), + Placeholder: () => (/* reexport */ placeholder), + Polygon: () => (/* reexport */ external_wp_primitives_namespaceObject.Polygon), + Popover: () => (/* reexport */ popover), + QueryControls: () => (/* reexport */ query_controls), + RadioControl: () => (/* reexport */ radio_control), + RangeControl: () => (/* reexport */ range_control), + Rect: () => (/* reexport */ external_wp_primitives_namespaceObject.Rect), + ResizableBox: () => (/* reexport */ resizable_box), + ResponsiveWrapper: () => (/* reexport */ responsive_wrapper), + SVG: () => (/* reexport */ external_wp_primitives_namespaceObject.SVG), + SandBox: () => (/* reexport */ sandbox), + ScrollLock: () => (/* reexport */ scroll_lock), + SearchControl: () => (/* reexport */ search_control), + SelectControl: () => (/* reexport */ select_control), + Slot: () => (/* reexport */ slot_fill_Slot), + SlotFillProvider: () => (/* reexport */ Provider), + Snackbar: () => (/* reexport */ snackbar), + SnackbarList: () => (/* reexport */ snackbar_list), + Spinner: () => (/* reexport */ spinner), + TabPanel: () => (/* reexport */ tab_panel), + TabbableContainer: () => (/* reexport */ tabbable), + TextControl: () => (/* reexport */ text_control), + TextHighlight: () => (/* reexport */ text_highlight), + TextareaControl: () => (/* reexport */ textarea_control), + TimePicker: () => (/* reexport */ time), + Tip: () => (/* reexport */ build_module_tip), + ToggleControl: () => (/* reexport */ toggle_control), + Toolbar: () => (/* reexport */ toolbar), + ToolbarButton: () => (/* reexport */ toolbar_button), + ToolbarDropdownMenu: () => (/* reexport */ toolbar_dropdown_menu), + ToolbarGroup: () => (/* reexport */ toolbar_group), + ToolbarItem: () => (/* reexport */ toolbar_item), + Tooltip: () => (/* reexport */ tooltip), + TreeSelect: () => (/* reexport */ tree_select), + VisuallyHidden: () => (/* reexport */ visually_hidden_component), + __experimentalAlignmentMatrixControl: () => (/* reexport */ alignment_matrix_control), + __experimentalApplyValueToSides: () => (/* reexport */ applyValueToSides), + __experimentalBorderBoxControl: () => (/* reexport */ border_box_control_component), + __experimentalBorderControl: () => (/* reexport */ border_control_component), + __experimentalBoxControl: () => (/* reexport */ box_control), + __experimentalConfirmDialog: () => (/* reexport */ confirm_dialog_component), + __experimentalDimensionControl: () => (/* reexport */ dimension_control), + __experimentalDivider: () => (/* reexport */ divider_component), + __experimentalDropdownContentWrapper: () => (/* reexport */ dropdown_content_wrapper), + __experimentalElevation: () => (/* reexport */ elevation_component), + __experimentalGrid: () => (/* reexport */ grid_component), + __experimentalHStack: () => (/* reexport */ h_stack_component), + __experimentalHasSplitBorders: () => (/* reexport */ hasSplitBorders), + __experimentalHeading: () => (/* reexport */ heading_component), + __experimentalInputControl: () => (/* reexport */ input_control), + __experimentalInputControlPrefixWrapper: () => (/* reexport */ input_prefix_wrapper), + __experimentalInputControlSuffixWrapper: () => (/* reexport */ input_suffix_wrapper), + __experimentalIsDefinedBorder: () => (/* reexport */ isDefinedBorder), + __experimentalIsEmptyBorder: () => (/* reexport */ isEmptyBorder), + __experimentalItem: () => (/* reexport */ item_component), + __experimentalItemGroup: () => (/* reexport */ item_group_component), + __experimentalNavigation: () => (/* reexport */ navigation), + __experimentalNavigationBackButton: () => (/* reexport */ back_button), + __experimentalNavigationGroup: () => (/* reexport */ group), + __experimentalNavigationItem: () => (/* reexport */ navigation_item), + __experimentalNavigationMenu: () => (/* reexport */ navigation_menu), + __experimentalNavigatorBackButton: () => (/* reexport */ navigator_back_button_component), + __experimentalNavigatorButton: () => (/* reexport */ navigator_button_component), + __experimentalNavigatorProvider: () => (/* reexport */ navigator_provider_component), + __experimentalNavigatorScreen: () => (/* reexport */ navigator_screen_component), + __experimentalNavigatorToParentButton: () => (/* reexport */ navigator_to_parent_button_component), + __experimentalNumberControl: () => (/* reexport */ number_control), + __experimentalPaletteEdit: () => (/* reexport */ palette_edit), + __experimentalParseQuantityAndUnitFromRawValue: () => (/* reexport */ parseQuantityAndUnitFromRawValue), + __experimentalRadio: () => (/* reexport */ radio_group_radio), + __experimentalRadioGroup: () => (/* reexport */ radio_group), + __experimentalScrollable: () => (/* reexport */ scrollable_component), + __experimentalSpacer: () => (/* reexport */ spacer_component), + __experimentalStyleProvider: () => (/* reexport */ style_provider), + __experimentalSurface: () => (/* reexport */ surface_component), + __experimentalText: () => (/* reexport */ text_component), + __experimentalToggleGroupControl: () => (/* reexport */ toggle_group_control_component), + __experimentalToggleGroupControlOption: () => (/* reexport */ toggle_group_control_option_component), + __experimentalToggleGroupControlOptionIcon: () => (/* reexport */ toggle_group_control_option_icon_component), + __experimentalToolbarContext: () => (/* reexport */ toolbar_context), + __experimentalToolsPanel: () => (/* reexport */ tools_panel_component), + __experimentalToolsPanelContext: () => (/* reexport */ ToolsPanelContext), + __experimentalToolsPanelItem: () => (/* reexport */ tools_panel_item_component), + __experimentalTreeGrid: () => (/* reexport */ tree_grid), + __experimentalTreeGridCell: () => (/* reexport */ cell), + __experimentalTreeGridItem: () => (/* reexport */ tree_grid_item), + __experimentalTreeGridRow: () => (/* reexport */ tree_grid_row), + __experimentalTruncate: () => (/* reexport */ truncate_component), + __experimentalUnitControl: () => (/* reexport */ unit_control), + __experimentalUseCustomUnits: () => (/* reexport */ useCustomUnits), + __experimentalUseNavigator: () => (/* reexport */ use_navigator), + __experimentalUseSlot: () => (/* reexport */ useSlot), + __experimentalUseSlotFills: () => (/* reexport */ useSlotFills), + __experimentalVStack: () => (/* reexport */ v_stack_component), + __experimentalView: () => (/* reexport */ component), + __experimentalZStack: () => (/* reexport */ z_stack_component), + __unstableAnimatePresence: () => (/* reexport */ AnimatePresence), + __unstableComposite: () => (/* reexport */ legacy_Composite), + __unstableCompositeGroup: () => (/* reexport */ legacy_CompositeGroup), + __unstableCompositeItem: () => (/* reexport */ legacy_CompositeItem), + __unstableDisclosureContent: () => (/* reexport */ disclosure_DisclosureContent), + __unstableGetAnimateClassName: () => (/* reexport */ getAnimateClassName), + __unstableMotion: () => (/* reexport */ motion), + __unstableMotionContext: () => (/* reexport */ MotionContext), + __unstableUseAutocompleteProps: () => (/* reexport */ useAutocompleteProps), + __unstableUseCompositeState: () => (/* reexport */ useCompositeState), + __unstableUseNavigateRegions: () => (/* reexport */ useNavigateRegions), + createSlotFill: () => (/* reexport */ createSlotFill), + navigateRegions: () => (/* reexport */ navigate_regions), + privateApis: () => (/* reexport */ privateApis), + useBaseControlProps: () => (/* reexport */ useBaseControlProps), + withConstrainedTabbing: () => (/* reexport */ with_constrained_tabbing), + withFallbackStyles: () => (/* reexport */ with_fallback_styles), + withFilters: () => (/* reexport */ withFilters), + withFocusOutside: () => (/* reexport */ with_focus_outside), + withFocusReturn: () => (/* reexport */ with_focus_return), + withNotices: () => (/* reexport */ with_notices), + withSpokenMessages: () => (/* reexport */ with_spoken_messages) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/components/build-module/text/styles.js var text_styles_namespaceObject = {}; __webpack_require__.r(text_styles_namespaceObject); __webpack_require__.d(text_styles_namespaceObject, { - Text: function() { return Text; }, - block: function() { return styles_block; }, - destructive: function() { return destructive; }, - highlighterText: function() { return highlighterText; }, - muted: function() { return muted; }, - positive: function() { return positive; }, - upperCase: function() { return upperCase; } -}); - -// NAMESPACE OBJECT: ./node_modules/@wordpress/components/build-module/ui/tooltip/styles.js -var tooltip_styles_namespaceObject = {}; -__webpack_require__.r(tooltip_styles_namespaceObject); -__webpack_require__.d(tooltip_styles_namespaceObject, { - _v: function() { return TooltipContent; }, - TooltipPopoverView: function() { return TooltipPopoverView; }, - lr: function() { return TooltipShortcut; } + Text: () => (Text), + block: () => (styles_block), + destructive: () => (destructive), + highlighterText: () => (highlighterText), + muted: () => (muted), + positive: () => (positive), + upperCase: () => (upperCase) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option-base/styles.js var toggle_group_control_option_base_styles_namespaceObject = {}; __webpack_require__.r(toggle_group_control_option_base_styles_namespaceObject); __webpack_require__.d(toggle_group_control_option_base_styles_namespaceObject, { - ButtonContentView: function() { return ButtonContentView; }, - LabelView: function() { return LabelView; }, - Uz: function() { return backdropView; }, - Ji: function() { return buttonView; }, - IA: function() { return labelBlock; } + ButtonContentView: () => (ButtonContentView), + LabelView: () => (LabelView), + ou: () => (backdropView), + uG: () => (buttonView), + eh: () => (labelBlock) }); ;// CONCATENATED MODULE: external ["wp","primitives"] -var external_wp_primitives_namespaceObject = window["wp"]["primitives"]; -;// CONCATENATED MODULE: external ["wp","element"] -var external_wp_element_namespaceObject = window["wp"]["element"]; +const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; +// EXTERNAL MODULE: external "React" +var external_React_ = __webpack_require__(1609); +var external_React_namespaceObject = /*#__PURE__*/__webpack_require__.t(external_React_, 2); +var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_); // EXTERNAL MODULE: ./node_modules/classnames/index.js -var classnames = __webpack_require__(4403); +var classnames = __webpack_require__(5755); var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); ;// CONCATENATED MODULE: external ["wp","i18n"] -var external_wp_i18n_namespaceObject = window["wp"]["i18n"]; +const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; ;// CONCATENATED MODULE: external ["wp","compose"] -var external_wp_compose_namespaceObject = window["wp"]["compose"]; -;// CONCATENATED MODULE: ./node_modules/reakit/es/_rollupPluginBabelHelpers-1f0bf8c2.js -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -} - -function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - if (enumerableOnly) symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); - keys.push.apply(keys, symbols); - } - - return keys; -} - -function _objectSpread2(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - - if (i % 2) { - ownKeys(Object(source), true).forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - } - - return target; -} - -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; - } - - return target; -} - -function _unsupportedIterableToArray(o, minLen) { - if (!o) return; - if (typeof o === "string") return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); -} - -function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - - for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; - - return arr2; -} - -function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - it = o[Symbol.iterator](); - return it.next.bind(it); -} - - - -// EXTERNAL MODULE: external "React" -var external_React_ = __webpack_require__(9196); -var external_React_namespaceObject = /*#__PURE__*/__webpack_require__.t(external_React_, 2); -var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_); -;// CONCATENATED MODULE: ./node_modules/reakit-system/es/_rollupPluginBabelHelpers-0c84a174.js -function _rollupPluginBabelHelpers_0c84a174_defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -} - -function _rollupPluginBabelHelpers_0c84a174_ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - if (enumerableOnly) symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); - keys.push.apply(keys, symbols); - } - - return keys; -} - -function _rollupPluginBabelHelpers_0c84a174_objectSpread2(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - - if (i % 2) { - _rollupPluginBabelHelpers_0c84a174_ownKeys(Object(source), true).forEach(function (key) { - _rollupPluginBabelHelpers_0c84a174_defineProperty(target, key, source[key]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - _rollupPluginBabelHelpers_0c84a174_ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - } - - return target; -} - -function _rollupPluginBabelHelpers_0c84a174_objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; - } - - return target; -} - -function _rollupPluginBabelHelpers_0c84a174_unsupportedIterableToArray(o, minLen) { - if (!o) return; - if (typeof o === "string") return _rollupPluginBabelHelpers_0c84a174_arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _rollupPluginBabelHelpers_0c84a174_arrayLikeToArray(o, minLen); -} - -function _rollupPluginBabelHelpers_0c84a174_arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - - for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; - - return arr2; -} - -function _rollupPluginBabelHelpers_0c84a174_createForOfIteratorHelperLoose(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _rollupPluginBabelHelpers_0c84a174_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - it = o[Symbol.iterator](); - return it.next.bind(it); -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-system/es/SystemContext.js - - -var SystemContext = /*#__PURE__*/(0,external_React_.createContext)({}); - - - -;// CONCATENATED MODULE: ./node_modules/reakit-system/es/useCreateElement.js - - - - -function isRenderProp(children) { - return typeof children === "function"; -} - -/** - * Custom hook that will call `children` if it's a function. If - * `useCreateElement` has been passed to the context, it'll be used instead. - * - * @example - * import React from "react"; - * import { SystemProvider, useCreateElement } from "reakit-system"; - * - * const system = { - * useCreateElement(type, props, children = props.children) { - * // very similar to what `useCreateElement` does already - * if (typeof children === "function") { - * const { children: _, ...rest } = props; - * return children(rest); - * } - * return React.createElement(type, props, children); - * }, - * }; - * - * function Component(props) { - * return useCreateElement("div", props); - * } - * - * function App() { - * return ( - * <SystemProvider unstable_system={system}> - * <Component url="url">{({ url }) => <a href={url}>link</a>}</Component> - * </SystemProvider> - * ); - * } - */ - -var useCreateElement = function useCreateElement(type, props, children) { - if (children === void 0) { - children = props.children; - } - - var context = (0,external_React_.useContext)(SystemContext); - - if (context.useCreateElement) { - return context.useCreateElement(type, props, children); - } - - if (typeof type === "string" && isRenderProp(children)) { - var _ = props.children, - rest = _rollupPluginBabelHelpers_0c84a174_objectWithoutPropertiesLoose(props, ["children"]); - - return children(rest); - } - - return /*#__PURE__*/(0,external_React_.createElement)(type, props, children); -}; - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/_rollupPluginBabelHelpers-1f0bf8c2.js -function _rollupPluginBabelHelpers_1f0bf8c2_defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -} - -function _rollupPluginBabelHelpers_1f0bf8c2_ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - if (enumerableOnly) symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); - keys.push.apply(keys, symbols); - } - - return keys; -} - -function _rollupPluginBabelHelpers_1f0bf8c2_objectSpread2(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - - if (i % 2) { - _rollupPluginBabelHelpers_1f0bf8c2_ownKeys(Object(source), true).forEach(function (key) { - _rollupPluginBabelHelpers_1f0bf8c2_defineProperty(target, key, source[key]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - _rollupPluginBabelHelpers_1f0bf8c2_ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - } - - return target; -} - -function _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; - } - - return target; -} - -function _rollupPluginBabelHelpers_1f0bf8c2_unsupportedIterableToArray(o, minLen) { - if (!o) return; - if (typeof o === "string") return _rollupPluginBabelHelpers_1f0bf8c2_arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _rollupPluginBabelHelpers_1f0bf8c2_arrayLikeToArray(o, minLen); -} - -function _rollupPluginBabelHelpers_1f0bf8c2_arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - - for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; - - return arr2; -} - -function _rollupPluginBabelHelpers_1f0bf8c2_createForOfIteratorHelperLoose(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _rollupPluginBabelHelpers_1f0bf8c2_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - it = o[Symbol.iterator](); - return it.next.bind(it); -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/isObject.js -/** - * Checks whether `arg` is an object or not. - * - * @returns {boolean} - */ -function isObject_isObject(arg) { - return typeof arg === "object" && arg != null; -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/isPlainObject.js - - -/** - * Checks whether `arg` is a plain object or not. - * - * @returns {boolean} - */ - -function isPlainObject(arg) { - var _proto$constructor; - - if (!isObject_isObject(arg)) return false; - var proto = Object.getPrototypeOf(arg); - if (proto == null) return true; - return ((_proto$constructor = proto.constructor) === null || _proto$constructor === void 0 ? void 0 : _proto$constructor.toString()) === Object.toString(); -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/splitProps.js - - - - -/** - * Splits an object (`props`) into a tuple where the first item is an object - * with the passed `keys`, and the second item is an object with these keys - * omitted. - * - * @deprecated will be removed in version 2 - * - * @example - * import { splitProps } from "reakit-utils"; - * - * splitProps({ a: "a", b: "b" }, ["a"]); // [{ a: "a" }, { b: "b" }] - */ - -function __deprecatedSplitProps(props, keys) { - var propsKeys = Object.keys(props); - var picked = {}; - var omitted = {}; - - for (var _i = 0, _propsKeys = propsKeys; _i < _propsKeys.length; _i++) { - var key = _propsKeys[_i]; - - if (keys.indexOf(key) >= 0) { - picked[key] = props[key]; - } else { - omitted[key] = props[key]; - } - } - - return [picked, omitted]; -} -/** - * Splits an object (`props`) into a tuple where the first item - * is the `state` property, and the second item is the rest of the properties. - * - * It is also backward compatible with version 1. If `keys` are passed then - * splits an object (`props`) into a tuple where the first item is an object - * with the passed `keys`, and the second item is an object with these keys - * omitted. - * - * @example - * import { splitProps } from "reakit-utils"; - * - * splitProps({ a: "a", b: "b" }, ["a"]); // [{ a: "a" }, { b: "b" }] - * - * @example - * import { splitProps } from "reakit-utils"; - * - * splitProps({ state: { a: "a" }, b: "b" }); // [{ a: "a" }, { b: "b" }] - */ - - -function splitProps(props, keys) { - if (keys === void 0) { - keys = []; - } - - if (!isPlainObject(props.state)) { - return __deprecatedSplitProps(props, keys); - } - - var _deprecatedSplitProp = __deprecatedSplitProps(props, [].concat(keys, ["state"])), - picked = _deprecatedSplitProp[0], - omitted = _deprecatedSplitProp[1]; - - var state = picked.state, - restPicked = _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(picked, ["state"]); - - return [_rollupPluginBabelHelpers_1f0bf8c2_objectSpread2(_rollupPluginBabelHelpers_1f0bf8c2_objectSpread2({}, state), restPicked), omitted]; -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/shallowEqual.js -/** - * Compares two objects. - * - * @example - * import { shallowEqual } from "reakit-utils"; - * - * shallowEqual({ a: "a" }, {}); // false - * shallowEqual({ a: "a" }, { b: "b" }); // false - * shallowEqual({ a: "a" }, { a: "a" }); // true - * shallowEqual({ a: "a" }, { a: "a", b: "b" }); // false - */ -function shallowEqual(objA, objB) { - if (objA === objB) return true; - if (!objA) return false; - if (!objB) return false; - if (typeof objA !== "object") return false; - if (typeof objB !== "object") return false; - var aKeys = Object.keys(objA); - var bKeys = Object.keys(objB); - var length = aKeys.length; - if (bKeys.length !== length) return false; - - for (var _i = 0, _aKeys = aKeys; _i < _aKeys.length; _i++) { - var key = _aKeys[_i]; - - if (objA[key] !== objB[key]) { - return false; - } - } - - return true; -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/normalizePropsAreEqual.js - - - - -/** - * This higher order functions take `propsAreEqual` function and - * returns a new function which normalizes the props. - * - * Normalizing in our case is making sure the `propsAreEqual` works with - * both version 1 (object spreading) and version 2 (state object) state passing. - * - * To achieve this, the returned function in case of a state object - * will spread the state object in both `prev` and `next props. - * - * Other case it just returns the function as is which makes sure - * that we are still backward compatible - */ -function normalizePropsAreEqual(propsAreEqual) { - if (propsAreEqual.name === "normalizePropsAreEqualInner") { - return propsAreEqual; - } - - return function normalizePropsAreEqualInner(prev, next) { - if (!isPlainObject(prev.state) || !isPlainObject(next.state)) { - return propsAreEqual(prev, next); - } - - return propsAreEqual(_rollupPluginBabelHelpers_1f0bf8c2_objectSpread2(_rollupPluginBabelHelpers_1f0bf8c2_objectSpread2({}, prev.state), prev), _rollupPluginBabelHelpers_1f0bf8c2_objectSpread2(_rollupPluginBabelHelpers_1f0bf8c2_objectSpread2({}, next.state), next)); - }; -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-system/es/createComponent.js - - - - - - - - -function createComponent_forwardRef(component) { - return /*#__PURE__*/(0,external_React_.forwardRef)(component); -} +const external_wp_compose_namespaceObject = window["wp"]["compose"]; +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/SHA3WOPI.js +"use client"; -function memo(component, propsAreEqual) { - return /*#__PURE__*/(0,external_React_.memo)(component, propsAreEqual); -} - -/** - * Creates a React component. - * - * @example - * import { createComponent } from "reakit-system"; - * - * const A = createComponent({ as: "a" }); - * - * @param options - */ -function createComponent(_ref) { - var type = _ref.as, - useHook = _ref.useHook, - shouldMemo = _ref.memo, - _ref$propsAreEqual = _ref.propsAreEqual, - propsAreEqual = _ref$propsAreEqual === void 0 ? useHook === null || useHook === void 0 ? void 0 : useHook.unstable_propsAreEqual : _ref$propsAreEqual, - _ref$keys = _ref.keys, - keys = _ref$keys === void 0 ? (useHook === null || useHook === void 0 ? void 0 : useHook.__keys) || [] : _ref$keys, - _ref$useCreateElement = _ref.useCreateElement, - useCreateElement$1 = _ref$useCreateElement === void 0 ? useCreateElement : _ref$useCreateElement; - - var Comp = function Comp(_ref2, ref) { - var _ref2$as = _ref2.as, - as = _ref2$as === void 0 ? type : _ref2$as, - props = _rollupPluginBabelHelpers_0c84a174_objectWithoutPropertiesLoose(_ref2, ["as"]); - - if (useHook) { - var _as$render; - - var _splitProps = splitProps(props, keys), - _options = _splitProps[0], - htmlProps = _splitProps[1]; - - var _useHook = useHook(_options, _rollupPluginBabelHelpers_0c84a174_objectSpread2({ - ref: ref - }, htmlProps)), - wrapElement = _useHook.wrapElement, - elementProps = _rollupPluginBabelHelpers_0c84a174_objectWithoutPropertiesLoose(_useHook, ["wrapElement"]); // @ts-ignore - - - var asKeys = ((_as$render = as.render) === null || _as$render === void 0 ? void 0 : _as$render.__keys) || as.__keys; - var asOptions = asKeys && splitProps(props, asKeys)[0]; - var allProps = asOptions ? _rollupPluginBabelHelpers_0c84a174_objectSpread2(_rollupPluginBabelHelpers_0c84a174_objectSpread2({}, elementProps), asOptions) : elementProps; - - var _element = useCreateElement$1(as, allProps); - - if (wrapElement) { - return wrapElement(_element); - } - - return _element; - } - - return useCreateElement$1(as, _rollupPluginBabelHelpers_0c84a174_objectSpread2({ - ref: ref - }, props)); - }; - - if (false) {} - - Comp = createComponent_forwardRef(Comp); - - if (shouldMemo) { - Comp = memo(Comp, propsAreEqual && normalizePropsAreEqual(propsAreEqual)); - } - - Comp.__keys = keys; - Comp.unstable_propsAreEqual = normalizePropsAreEqual(propsAreEqual || shallowEqual); - return Comp; -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-system/es/useToken.js - - - -/** - * React custom hook that returns the value of any token defined in the - * SystemContext. It's mainly used internally in [`useOptions`](#useoptions) - * and [`useProps`](#useprops). - * - * @example - * import { SystemProvider, useToken } from "reakit-system"; - * - * const system = { - * token: "value", - * }; - * - * function Component(props) { - * const token = useToken("token", "default value"); - * return <div {...props}>{token}</div>; - * } - * - * function App() { - * return ( - * <SystemProvider unstable_system={system}> - * <Component /> - * </SystemProvider> - * ); - * } - */ - -function useToken(token, defaultValue) { - (0,external_React_.useDebugValue)(token); - var context = (0,external_React_.useContext)(SystemContext); - return context[token] != null ? context[token] : defaultValue; -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-system/es/useProps.js - - - - -/** - * React custom hook that returns the props returned by a given - * `use${name}Props` in the SystemContext. - * - * @example - * import { SystemProvider, useProps } from "reakit-system"; - * - * const system = { - * useAProps(options, htmlProps) { - * return { - * ...htmlProps, - * href: options.url, - * }; - * }, - * }; - * - * function A({ url, ...htmlProps }) { - * const props = useProps("A", { url }, htmlProps); - * return <a {...props} />; - * } - * - * function App() { - * return ( - * <SystemProvider unstable_system={system}> - * <A url="url">It will convert url into href in useAProps</A> - * </SystemProvider> - * ); - * } - */ - -function useProps(name, options, htmlProps) { - if (options === void 0) { - options = {}; - } - - if (htmlProps === void 0) { - htmlProps = {}; - } - - var hookName = "use" + name + "Props"; - (0,external_React_.useDebugValue)(hookName); - var useHook = useToken(hookName); - - if (useHook) { - return useHook(options, htmlProps); - } - - return htmlProps; -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-system/es/useOptions.js - - - - - -/** - * React custom hook that returns the options returned by a given - * `use${name}Options` in the SystemContext. - * - * @example - * import React from "react"; - * import { SystemProvider, useOptions } from "reakit-system"; - * - * const system = { - * useAOptions(options, htmlProps) { - * return { - * ...options, - * url: htmlProps.href, - * }; - * }, - * }; - * - * function A({ url, ...htmlProps }) { - * const options = useOptions("A", { url }, htmlProps); - * return <a href={options.url} {...htmlProps} />; - * } - * - * function App() { - * return ( - * <SystemProvider unstable_system={system}> - * <A href="url"> - * It will convert href into url in useAOptions and then url into href in A - * </A> - * </SystemProvider> - * ); - * } - */ - -function useOptions(name, options, htmlProps) { - if (options === void 0) { - options = {}; - } - - if (htmlProps === void 0) { - htmlProps = {}; - } - - var hookName = "use" + name + "Options"; - (0,external_React_.useDebugValue)(hookName); - var useHook = useToken(hookName); - - if (useHook) { - return _rollupPluginBabelHelpers_0c84a174_objectSpread2(_rollupPluginBabelHelpers_0c84a174_objectSpread2({}, options), useHook(options, htmlProps)); - } - - return options; -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/toArray.js -/** - * Transforms `arg` into an array if it's not already. - * - * @example - * import { toArray } from "reakit-utils"; - * - * toArray("a"); // ["a"] - * toArray(["a"]); // ["a"] - */ -function toArray(arg) { - if (Array.isArray(arg)) { - return arg; - } - - return typeof arg !== "undefined" ? [arg] : []; -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-system/es/createHook.js - - - - - - - - - -/** - * Creates a React custom hook that will return component props. - * - * @example - * import { createHook } from "reakit-system"; - * - * const useA = createHook({ - * name: "A", - * keys: ["url"], // custom props/options keys - * useProps(options, htmlProps) { - * return { - * ...htmlProps, - * href: options.url, - * }; - * }, - * }); - * - * function A({ url, ...htmlProps }) { - * const props = useA({ url }, htmlProps); - * return <a {...props} />; - * } - * - * @param options - */ -function createHook(options) { - var _options$useState, _composedHooks$; - - var composedHooks = toArray(options.compose); - - var __useOptions = function __useOptions(hookOptions, htmlProps) { - // Call the current hook's useOptions first - if (options.useOptions) { - hookOptions = options.useOptions(hookOptions, htmlProps); - } // If there's name, call useOptions from the system context - - - if (options.name) { - hookOptions = useOptions(options.name, hookOptions, htmlProps); - } // Run composed hooks useOptions - - - if (options.compose) { - for (var _iterator = _rollupPluginBabelHelpers_0c84a174_createForOfIteratorHelperLoose(composedHooks), _step; !(_step = _iterator()).done;) { - var hook = _step.value; - hookOptions = hook.__useOptions(hookOptions, htmlProps); - } - } - - return hookOptions; - }; - - var useHook = function useHook(hookOptions, htmlProps, unstable_ignoreUseOptions) { - if (hookOptions === void 0) { - hookOptions = {}; - } - - if (htmlProps === void 0) { - htmlProps = {}; - } - - if (unstable_ignoreUseOptions === void 0) { - unstable_ignoreUseOptions = false; - } - - // This won't execute when useHook was called from within another useHook - if (!unstable_ignoreUseOptions) { - hookOptions = __useOptions(hookOptions, htmlProps); - } // Call the current hook's useProps - - - if (options.useProps) { - htmlProps = options.useProps(hookOptions, htmlProps); - } // If there's name, call useProps from the system context - - - if (options.name) { - htmlProps = useProps(options.name, hookOptions, htmlProps); - } - - if (options.compose) { - if (options.useComposeOptions) { - hookOptions = options.useComposeOptions(hookOptions, htmlProps); - } - - if (options.useComposeProps) { - htmlProps = options.useComposeProps(hookOptions, htmlProps); - } else { - for (var _iterator2 = _rollupPluginBabelHelpers_0c84a174_createForOfIteratorHelperLoose(composedHooks), _step2; !(_step2 = _iterator2()).done;) { - var hook = _step2.value; - htmlProps = hook(hookOptions, htmlProps, true); - } - } - } // Remove undefined values from htmlProps - - - var finalHTMLProps = {}; - var definedHTMLProps = htmlProps || {}; - - for (var prop in definedHTMLProps) { - if (definedHTMLProps[prop] !== undefined) { - finalHTMLProps[prop] = definedHTMLProps[prop]; - } - } - - return finalHTMLProps; - }; - - useHook.__useOptions = __useOptions; - var composedKeys = composedHooks.reduce(function (keys, hook) { - keys.push.apply(keys, hook.__keys || []); - return keys; - }, []); // It's used by createComponent to split option props (keys) and html props - - useHook.__keys = [].concat(composedKeys, ((_options$useState = options.useState) === null || _options$useState === void 0 ? void 0 : _options$useState.__keys) || [], options.keys || []); - useHook.unstable_propsAreEqual = options.propsAreEqual || ((_composedHooks$ = composedHooks[0]) === null || _composedHooks$ === void 0 ? void 0 : _composedHooks$.unstable_propsAreEqual) || shallowEqual; - - if (false) {} - - return useHook; -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/useForkRef.js - - -// https://github.com/mui-org/material-ui/blob/2bcc874cf07b81202968f769cb9c2398c7c11311/packages/material-ui/src/utils/useForkRef.js - -function setRef(ref, value) { - if (value === void 0) { - value = null; - } - - if (!ref) return; - - if (typeof ref === "function") { - ref(value); - } else { - ref.current = value; - } -} -/** - * Merges up to two React Refs into a single memoized function React Ref so you - * can pass it to an element. - * - * @example - * import React from "react"; - * import { useForkRef } from "reakit-utils"; - * - * const Component = React.forwardRef((props, ref) => { - * const internalRef = React.useRef(); - * return <div {...props} ref={useForkRef(internalRef, ref)} />; - * }); - */ - - -function useForkRef(refA, refB) { - return (0,external_React_.useMemo)(function () { - if (refA == null && refB == null) { - return null; - } - - return function (value) { - setRef(refA, value); - setRef(refB, value); - }; - }, [refA, refB]); -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-warning/es/useWarning.js - - - - - -function isRefObject(ref) { - return isObject(ref) && "current" in ref; -} -/** - * Logs `messages` to the console using `console.warn` based on a `condition`. - * This should be used inside components. - */ - - -function useWarning(condition) { - for (var _len = arguments.length, messages = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - messages[_key - 1] = arguments[_key]; - } - - if (false) {} -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-warning/es/index.js - - - - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/getDocument.js -/** - * Returns `element.ownerDocument || document`. - */ -function getDocument_getDocument(element) { - return element ? element.ownerDocument || element : document; -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/getWindow.js - - -// Thanks to Fluent UI for doing the [research on IE11 memory leak](https://github.com/microsoft/fluentui/pull/9010#issuecomment-490768427) - -var _window; // Note: Accessing "window" in IE11 is somewhat expensive, and calling "typeof window" -// hits a memory leak, whereas aliasing it and calling "typeof _window" does not. -// Caching the window value at the file scope lets us minimize the impact. - - -try { - _window = window; -} catch (e) { - /* no-op */ -} -/** - * Returns `element.ownerDocument.defaultView || window`. - */ - - -function getWindow(element) { - if (!element) { - return _window; - } - - return getDocument_getDocument(element).defaultView || _window; -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/canUseDOM.js - - - -function checkIsBrowser() { - var _window = getWindow(); - - return Boolean(typeof _window !== "undefined" && _window.document && _window.document.createElement); -} -/** - * It's `true` if it is running in a browser environment or `false` if it is not (SSR). - * - * @example - * import { canUseDOM } from "reakit-utils"; - * - * const title = canUseDOM ? document.title : ""; - */ - - -var canUseDOM = checkIsBrowser(); - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/useIsomorphicEffect.js - - - - - -/** - * `React.useLayoutEffect` that fallbacks to `React.useEffect` on server side - * rendering. - */ - -var useIsomorphicEffect = !canUseDOM ? external_React_.useEffect : external_React_.useLayoutEffect; - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/useLiveRef.js - - - - - - -/** - * A `React.Ref` that keeps track of the passed `value`. - */ - -function useLiveRef(value) { - var ref = (0,external_React_.useRef)(value); - useIsomorphicEffect(function () { - ref.current = value; - }); - return ref; -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/isSelfTarget.js -/** - * Returns `true` if `event.target` and `event.currentTarget` are the same. - */ -function isSelfTarget(event) { - return event.target === event.currentTarget; -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/getActiveElement.js - - -/** - * Returns `element.ownerDocument.activeElement`. - */ - -function getActiveElement_getActiveElement(element) { - var _getDocument = getDocument_getDocument(element), - activeElement = _getDocument.activeElement; - - if (!(activeElement !== null && activeElement !== void 0 && activeElement.nodeName)) { - // In IE11, activeElement might be an empty object if we're interacting - // with elements inside of an iframe. - return null; - } - - return activeElement; -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/contains.js -/** - * Similar to `Element.prototype.contains`, but a little bit faster when - * `element` is the same as `child`. - * - * @example - * import { contains } from "reakit-utils"; - * - * contains(document.getElementById("parent"), document.getElementById("child")); - */ -function contains(parent, child) { - return parent === child || parent.contains(child); -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/hasFocusWithin.js - - - - -/** - * Checks if `element` has focus within. Elements that are referenced by - * `aria-activedescendant` are also considered. - * - * @example - * import { hasFocusWithin } from "reakit-utils"; - * - * hasFocusWithin(document.getElementById("id")); - */ - -function hasFocusWithin(element) { - var activeElement = getActiveElement_getActiveElement(element); - if (!activeElement) return false; - if (contains(element, activeElement)) return true; - var activeDescendant = activeElement.getAttribute("aria-activedescendant"); - if (!activeDescendant) return false; - if (activeDescendant === element.id) return true; - return !!element.querySelector("#" + activeDescendant); -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/isPortalEvent.js - - -/** - * Returns `true` if `event` has been fired within a React Portal element. - */ - -function isPortalEvent(event) { - return !contains(event.currentTarget, event.target); -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/isButton.js -var buttonInputTypes = ["button", "color", "file", "image", "reset", "submit"]; -/** - * Checks whether `element` is a native HTML button element. - * - * @example - * import { isButton } from "reakit-utils"; - * - * isButton(document.querySelector("button")); // true - * isButton(document.querySelector("input[type='button']")); // true - * isButton(document.querySelector("div")); // false - * isButton(document.querySelector("input[type='text']")); // false - * isButton(document.querySelector("div[role='button']")); // false - * - * @returns {boolean} - */ - -function isButton(element) { - if (element.tagName === "BUTTON") return true; - - if (element.tagName === "INPUT") { - var input = element; - return buttonInputTypes.indexOf(input.type) !== -1; - } - - return false; -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/dom.js - - - - -/** - * Checks if a given string exists in the user agent string. - */ - -function isUA(string) { - if (!canUseDOM) return false; - return window.navigator.userAgent.indexOf(string) !== -1; -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/matches.js -/** - * Ponyfill for `Element.prototype.matches` - * - * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/matches - */ -function matches(element, selectors) { - if ("matches" in element) { - return element.matches(selectors); - } - - if ("msMatchesSelector" in element) { - return element.msMatchesSelector(selectors); - } - - return element.webkitMatchesSelector(selectors); -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/tabbable.js - - - - - -/** @module tabbable */ -var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), " + "textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], " + "iframe, object, embed, area[href], audio[controls], video[controls], " + "[contenteditable]:not([contenteditable='false'])"; - -function isVisible(element) { - var htmlElement = element; - return htmlElement.offsetWidth > 0 || htmlElement.offsetHeight > 0 || element.getClientRects().length > 0; -} - -function hasNegativeTabIndex(element) { - var tabIndex = parseInt(element.getAttribute("tabindex") || "0", 10); - return tabIndex < 0; -} -/** - * Checks whether `element` is focusable or not. - * - * @memberof tabbable - * - * @example - * import { isFocusable } from "reakit-utils"; - * - * isFocusable(document.querySelector("input")); // true - * isFocusable(document.querySelector("input[tabindex='-1']")); // true - * isFocusable(document.querySelector("input[hidden]")); // false - * isFocusable(document.querySelector("input:disabled")); // false - */ - - -function isFocusable(element) { - return matches(element, selector) && isVisible(element); -} -/** - * Checks whether `element` is tabbable or not. - * - * @memberof tabbable - * - * @example - * import { isTabbable } from "reakit-utils"; - * - * isTabbable(document.querySelector("input")); // true - * isTabbable(document.querySelector("input[tabindex='-1']")); // false - * isTabbable(document.querySelector("input[hidden]")); // false - * isTabbable(document.querySelector("input:disabled")); // false - */ - -function isTabbable(element) { - return isFocusable(element) && !hasNegativeTabIndex(element); -} -/** - * Returns all the focusable elements in `container`. - * - * @memberof tabbable - * - * @param {Element} container - * - * @returns {Element[]} - */ - -function getAllFocusableIn(container) { - var allFocusable = Array.from(container.querySelectorAll(selector)); - allFocusable.unshift(container); - return allFocusable.filter(isFocusable); -} -/** - * Returns the first focusable element in `container`. - * - * @memberof tabbable - * - * @param {Element} container - * - * @returns {Element|null} - */ - -function getFirstFocusableIn(container) { - var _getAllFocusableIn = getAllFocusableIn(container), - first = _getAllFocusableIn[0]; - - return first || null; -} -/** - * Returns all the tabbable elements in `container`, including the container - * itself. - * - * @memberof tabbable - * - * @param {Element} container - * @param fallbackToFocusable If `true`, it'll return focusable elements if there are no tabbable ones. - * - * @returns {Element[]} - */ - -function getAllTabbableIn(container, fallbackToFocusable) { - var allFocusable = Array.from(container.querySelectorAll(selector)); - var allTabbable = allFocusable.filter(isTabbable); - - if (isTabbable(container)) { - allTabbable.unshift(container); - } - - if (!allTabbable.length && fallbackToFocusable) { - return allFocusable; - } - - return allTabbable; -} -/** - * Returns the first tabbable element in `container`, including the container - * itself if it's tabbable. - * - * @memberof tabbable - * - * @param {Element} container - * @param fallbackToFocusable If `true`, it'll return the first focusable element if there are no tabbable ones. - * - * @returns {Element|null} - */ - -function getFirstTabbableIn(container, fallbackToFocusable) { - var _getAllTabbableIn = getAllTabbableIn(container, fallbackToFocusable), - first = _getAllTabbableIn[0]; - - return first || null; -} -/** - * Returns the last tabbable element in `container`, including the container - * itself if it's tabbable. - * - * @memberof tabbable - * - * @param {Element} container - * @param fallbackToFocusable If `true`, it'll return the last focusable element if there are no tabbable ones. - * - * @returns {Element|null} - */ - -function getLastTabbableIn(container, fallbackToFocusable) { - var allTabbable = getAllTabbableIn(container, fallbackToFocusable); - return allTabbable[allTabbable.length - 1] || null; -} -/** - * Returns the next tabbable element in `container`. - * - * @memberof tabbable - * - * @param {Element} container - * @param fallbackToFocusable If `true`, it'll return the next focusable element if there are no tabbable ones. - * - * @returns {Element|null} - */ - -function getNextTabbableIn(container, fallbackToFocusable) { - var activeElement = getActiveElement(container); - var allFocusable = getAllFocusableIn(container); - var index = allFocusable.indexOf(activeElement); - var slice = allFocusable.slice(index + 1); - return slice.find(isTabbable) || allFocusable.find(isTabbable) || (fallbackToFocusable ? slice[0] : null); -} -/** - * Returns the previous tabbable element in `container`. - * - * @memberof tabbable - * - * @param {Element} container - * @param fallbackToFocusable If `true`, it'll return the previous focusable element if there are no tabbable ones. - * - * @returns {Element|null} - */ - -function getPreviousTabbableIn(container, fallbackToFocusable) { - var activeElement = getActiveElement(container); - var allFocusable = getAllFocusableIn(container).reverse(); - var index = allFocusable.indexOf(activeElement); - var slice = allFocusable.slice(index + 1); - return slice.find(isTabbable) || allFocusable.find(isTabbable) || (fallbackToFocusable ? slice[0] : null); -} -/** - * Returns the closest focusable element. - * - * @memberof tabbable - * - * @param {Element} container - * - * @returns {Element|null} - */ - -function getClosestFocusable(element) { - while (element && !isFocusable(element)) { - element = closest(element, selector); - } - - return element; -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/Role/Role.js - - - - - -// Automatically generated -var ROLE_KEYS = ["unstable_system"]; - -var useRole = createHook({ - name: "Role", - keys: ROLE_KEYS, - propsAreEqual: function propsAreEqual(prev, next) { - var prevSystem = prev.unstable_system, - prevProps = _objectWithoutPropertiesLoose(prev, ["unstable_system"]); - - var nextSystem = next.unstable_system, - nextProps = _objectWithoutPropertiesLoose(next, ["unstable_system"]); - - if (prevSystem !== nextSystem && !shallowEqual(prevSystem, nextSystem)) { - return false; - } - - return shallowEqual(prevProps, nextProps); - } -}); -var Role = createComponent({ - as: "div", - useHook: useRole -}); - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/Tabbable/Tabbable.js - - - - - - - - - - - - - - - - -// Automatically generated -var TABBABLE_KEYS = ["disabled", "focusable"]; - -var isSafariOrFirefoxOnMac = isUA("Mac") && !isUA("Chrome") && (isUA("Safari") || isUA("Firefox")); - -function focusIfNeeded(element) { - if (!hasFocusWithin(element) && isFocusable(element)) { - element.focus(); - } -} - -function isNativeTabbable(element) { - return ["BUTTON", "INPUT", "SELECT", "TEXTAREA", "A"].includes(element.tagName); -} - -function supportsDisabledAttribute(element) { - return ["BUTTON", "INPUT", "SELECT", "TEXTAREA"].includes(element.tagName); -} - -function getTabIndex(trulyDisabled, nativeTabbable, supportsDisabled, htmlTabIndex) { - if (trulyDisabled) { - if (nativeTabbable && !supportsDisabled) { - // Anchor, audio and video tags don't support the `disabled` attribute. - // We must pass tabIndex={-1} so they don't receive focus on tab. - return -1; - } // Elements that support the `disabled` attribute don't need tabIndex. - - - return undefined; - } - - if (nativeTabbable) { - // If the element is enabled and it's natively tabbable, we don't need to - // specify a tabIndex attribute unless it's explicitly set by the user. - return htmlTabIndex; - } // If the element is enabled and is not natively tabbable, we have to - // fallback tabIndex={0}. - - - return htmlTabIndex || 0; -} - -function useDisableEvent(htmlEventRef, disabled) { - return (0,external_React_.useCallback)(function (event) { - var _htmlEventRef$current; - - (_htmlEventRef$current = htmlEventRef.current) === null || _htmlEventRef$current === void 0 ? void 0 : _htmlEventRef$current.call(htmlEventRef, event); - if (event.defaultPrevented) return; - - if (disabled) { - event.stopPropagation(); - event.preventDefault(); - } - }, [htmlEventRef, disabled]); -} - -var useTabbable = createHook({ - name: "Tabbable", - compose: useRole, - keys: TABBABLE_KEYS, - useOptions: function useOptions(options, _ref) { - var disabled = _ref.disabled; - return _objectSpread2({ - disabled: disabled - }, options); - }, - useProps: function useProps(options, _ref2) { - var htmlRef = _ref2.ref, - htmlTabIndex = _ref2.tabIndex, - htmlOnClickCapture = _ref2.onClickCapture, - htmlOnMouseDownCapture = _ref2.onMouseDownCapture, - htmlOnMouseDown = _ref2.onMouseDown, - htmlOnKeyPressCapture = _ref2.onKeyPressCapture, - htmlStyle = _ref2.style, - htmlProps = _objectWithoutPropertiesLoose(_ref2, ["ref", "tabIndex", "onClickCapture", "onMouseDownCapture", "onMouseDown", "onKeyPressCapture", "style"]); - - var ref = (0,external_React_.useRef)(null); - var onClickCaptureRef = useLiveRef(htmlOnClickCapture); - var onMouseDownCaptureRef = useLiveRef(htmlOnMouseDownCapture); - var onMouseDownRef = useLiveRef(htmlOnMouseDown); - var onKeyPressCaptureRef = useLiveRef(htmlOnKeyPressCapture); - var trulyDisabled = !!options.disabled && !options.focusable; - - var _React$useState = (0,external_React_.useState)(true), - nativeTabbable = _React$useState[0], - setNativeTabbable = _React$useState[1]; - - var _React$useState2 = (0,external_React_.useState)(true), - supportsDisabled = _React$useState2[0], - setSupportsDisabled = _React$useState2[1]; - - var style = options.disabled ? _objectSpread2({ - pointerEvents: "none" - }, htmlStyle) : htmlStyle; - useIsomorphicEffect(function () { - var tabbable = ref.current; - - if (!tabbable) { - false ? 0 : void 0; - return; - } - - if (!isNativeTabbable(tabbable)) { - setNativeTabbable(false); - } - - if (!supportsDisabledAttribute(tabbable)) { - setSupportsDisabled(false); - } - }, []); - var onClickCapture = useDisableEvent(onClickCaptureRef, options.disabled); - var onMouseDownCapture = useDisableEvent(onMouseDownCaptureRef, options.disabled); - var onKeyPressCapture = useDisableEvent(onKeyPressCaptureRef, options.disabled); - var onMouseDown = (0,external_React_.useCallback)(function (event) { - var _onMouseDownRef$curre; - - (_onMouseDownRef$curre = onMouseDownRef.current) === null || _onMouseDownRef$curre === void 0 ? void 0 : _onMouseDownRef$curre.call(onMouseDownRef, event); - var element = event.currentTarget; - if (event.defaultPrevented) return; // Safari and Firefox on MacOS don't focus on buttons on mouse down - // like other browsers/platforms. Instead, they focus on the closest - // focusable ancestor element, which is ultimately the body element. So - // we make sure to give focus to the tabbable element on mouse down so - // it works consistently across browsers. - - if (!isSafariOrFirefoxOnMac) return; - if (isPortalEvent(event)) return; - if (!isButton(element)) return; // We can't focus right away after on mouse down, otherwise it would - // prevent drag events from happening. So we schedule the focus to the - // next animation frame. - - var raf = requestAnimationFrame(function () { - element.removeEventListener("mouseup", focusImmediately, true); - focusIfNeeded(element); - }); // If mouseUp happens before the next animation frame (which is common - // on touch screens or by just tapping the trackpad on MacBook's), we - // cancel the animation frame and immediately focus on the element. - - var focusImmediately = function focusImmediately() { - cancelAnimationFrame(raf); - focusIfNeeded(element); - }; // By listening to the event in the capture phase, we make sure the - // focus event is fired before the onMouseUp and onMouseUpCapture React - // events, which is aligned with the default browser behavior. - - - element.addEventListener("mouseup", focusImmediately, { - once: true, - capture: true - }); - }, []); - return _objectSpread2({ - ref: useForkRef(ref, htmlRef), - style: style, - tabIndex: getTabIndex(trulyDisabled, nativeTabbable, supportsDisabled, htmlTabIndex), - disabled: trulyDisabled && supportsDisabled ? true : undefined, - "aria-disabled": options.disabled ? true : undefined, - onClickCapture: onClickCapture, - onMouseDownCapture: onMouseDownCapture, - onMouseDown: onMouseDown, - onKeyPressCapture: onKeyPressCapture - }, htmlProps); - } -}); -var Tabbable = createComponent({ - as: "div", - useHook: useTabbable -}); - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/Clickable/Clickable.js - - - - - - - - - - - - - - - - - - -// Automatically generated -var CLICKABLE_KEYS = ["unstable_clickOnEnter", "unstable_clickOnSpace"]; - -function isNativeClick(event) { - var element = event.currentTarget; - if (!event.isTrusted) return false; // istanbul ignore next: can't test trusted events yet - - return isButton(element) || element.tagName === "INPUT" || element.tagName === "TEXTAREA" || element.tagName === "A" || element.tagName === "SELECT"; -} - -var useClickable = createHook({ - name: "Clickable", - compose: useTabbable, - keys: CLICKABLE_KEYS, - useOptions: function useOptions(_ref) { - var _ref$unstable_clickOn = _ref.unstable_clickOnEnter, - unstable_clickOnEnter = _ref$unstable_clickOn === void 0 ? true : _ref$unstable_clickOn, - _ref$unstable_clickOn2 = _ref.unstable_clickOnSpace, - unstable_clickOnSpace = _ref$unstable_clickOn2 === void 0 ? true : _ref$unstable_clickOn2, - options = _objectWithoutPropertiesLoose(_ref, ["unstable_clickOnEnter", "unstable_clickOnSpace"]); - - return _objectSpread2({ - unstable_clickOnEnter: unstable_clickOnEnter, - unstable_clickOnSpace: unstable_clickOnSpace - }, options); - }, - useProps: function useProps(options, _ref2) { - var htmlOnKeyDown = _ref2.onKeyDown, - htmlOnKeyUp = _ref2.onKeyUp, - htmlProps = _objectWithoutPropertiesLoose(_ref2, ["onKeyDown", "onKeyUp"]); - - var _React$useState = (0,external_React_.useState)(false), - active = _React$useState[0], - setActive = _React$useState[1]; - - var onKeyDownRef = useLiveRef(htmlOnKeyDown); - var onKeyUpRef = useLiveRef(htmlOnKeyUp); - var onKeyDown = (0,external_React_.useCallback)(function (event) { - var _onKeyDownRef$current; - - (_onKeyDownRef$current = onKeyDownRef.current) === null || _onKeyDownRef$current === void 0 ? void 0 : _onKeyDownRef$current.call(onKeyDownRef, event); - if (event.defaultPrevented) return; - if (options.disabled) return; - if (event.metaKey) return; - if (!isSelfTarget(event)) return; - var isEnter = options.unstable_clickOnEnter && event.key === "Enter"; - var isSpace = options.unstable_clickOnSpace && event.key === " "; - - if (isEnter || isSpace) { - if (isNativeClick(event)) return; - event.preventDefault(); - - if (isEnter) { - event.currentTarget.click(); - } else if (isSpace) { - setActive(true); - } - } - }, [options.disabled, options.unstable_clickOnEnter, options.unstable_clickOnSpace]); - var onKeyUp = (0,external_React_.useCallback)(function (event) { - var _onKeyUpRef$current; - - (_onKeyUpRef$current = onKeyUpRef.current) === null || _onKeyUpRef$current === void 0 ? void 0 : _onKeyUpRef$current.call(onKeyUpRef, event); - if (event.defaultPrevented) return; - if (options.disabled) return; - if (event.metaKey) return; - var isSpace = options.unstable_clickOnSpace && event.key === " "; - - if (active && isSpace) { - setActive(false); - event.currentTarget.click(); - } - }, [options.disabled, options.unstable_clickOnSpace, active]); - return _objectSpread2({ - "data-active": active || undefined, - onKeyDown: onKeyDown, - onKeyUp: onKeyUp - }, htmlProps); - } -}); -var Clickable = createComponent({ - as: "button", - memo: true, - useHook: useClickable -}); - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/getCurrentId-5aa9849e.js -function findFirstEnabledItem(items, excludeId) { - if (excludeId) { - return items.find(function (item) { - return !item.disabled && item.id !== excludeId; - }); - } - - return items.find(function (item) { - return !item.disabled; - }); -} - -function getCurrentId(options, passedId) { - var _findFirstEnabledItem; - - if (passedId || passedId === null) { - return passedId; - } - - if (options.currentId || options.currentId === null) { - return options.currentId; - } - - return (_findFirstEnabledItem = findFirstEnabledItem(options.items || [])) === null || _findFirstEnabledItem === void 0 ? void 0 : _findFirstEnabledItem.id; -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/__keys-6742f591.js -// Automatically generated -var COMPOSITE_STATE_KEYS = ["baseId", "unstable_idCountRef", "setBaseId", "unstable_virtual", "rtl", "orientation", "items", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "registerItem", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget"]; -var COMPOSITE_KEYS = COMPOSITE_STATE_KEYS; -var COMPOSITE_GROUP_KEYS = COMPOSITE_KEYS; -var COMPOSITE_ITEM_KEYS = COMPOSITE_GROUP_KEYS; -var COMPOSITE_ITEM_WIDGET_KEYS = (/* unused pure expression or super */ null && (COMPOSITE_ITEM_KEYS)); - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/userFocus-e16425e3.js -function userFocus(element) { - element.userFocus = true; - element.focus(); - element.userFocus = false; -} -function hasUserFocus(element) { - return !!element.userFocus; -} -function setUserFocus(element, value) { - element.userFocus = value; -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/isTextField.js -/** - * Check whether the given element is a text field, where text field is defined - * by the ability to select within the input, or that it is contenteditable. - * - * @example - * import { isTextField } from "reakit-utils"; - * - * isTextField(document.querySelector("div")); // false - * isTextField(document.querySelector("input")); // true - * isTextField(document.querySelector("input[type='button']")); // false - * isTextField(document.querySelector("textarea")); // true - * isTextField(document.querySelector("div[contenteditable='true']")); // true - */ -function isTextField_isTextField(element) { - try { - var isTextInput = element instanceof HTMLInputElement && element.selectionStart !== null; - var isTextArea = element.tagName === "TEXTAREA"; - var isContentEditable = element.contentEditable === "true"; - return isTextInput || isTextArea || isContentEditable || false; - } catch (error) { - // Safari throws an exception when trying to get `selectionStart` - // on non-text <input> elements (which, understandably, don't - // have the text selection API). We catch this via a try/catch - // block, as opposed to a more explicit check of the element's - // input types, because of Safari's non-standard behavior. This - // also means we don't have to worry about the list of input - // types that support `selectionStart` changing as the HTML spec - // evolves over time. - return false; - } -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/hasFocus.js - - - -/** - * Checks if `element` has focus. Elements that are referenced by - * `aria-activedescendant` are also considered. - * - * @example - * import { hasFocus } from "reakit-utils"; - * - * hasFocus(document.getElementById("id")); - */ - -function hasFocus(element) { - var activeElement = getActiveElement_getActiveElement(element); - if (!activeElement) return false; - if (activeElement === element) return true; - var activeDescendant = activeElement.getAttribute("aria-activedescendant"); - if (!activeDescendant) return false; - return activeDescendant === element.id; -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/ensureFocus.js - - - - -/** - * Ensures `element` will receive focus if it's not already. - * - * @example - * import { ensureFocus } from "reakit-utils"; - * - * ensureFocus(document.activeElement); // does nothing - * - * const element = document.querySelector("input"); - * - * ensureFocus(element); // focuses element - * ensureFocus(element, { preventScroll: true }); // focuses element preventing scroll jump - * - * function isActive(el) { - * return el.dataset.active === "true"; - * } - * - * ensureFocus(document.querySelector("[data-active='true']"), { isActive }); // does nothing - * - * @returns {number} `requestAnimationFrame` call ID so it can be passed to `cancelAnimationFrame` if needed. - */ -function ensureFocus(element, _temp) { - var _ref = _temp === void 0 ? {} : _temp, - preventScroll = _ref.preventScroll, - _ref$isActive = _ref.isActive, - isActive = _ref$isActive === void 0 ? hasFocus : _ref$isActive; - - if (isActive(element)) return -1; - element.focus({ - preventScroll: preventScroll - }); - if (isActive(element)) return -1; - return requestAnimationFrame(function () { - element.focus({ - preventScroll: preventScroll - }); - }); -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/Id/IdProvider.js - - -var defaultPrefix = "id"; -function generateRandomString(prefix) { - if (prefix === void 0) { - prefix = defaultPrefix; - } - - return "" + (prefix ? prefix + "-" : "") + Math.random().toString(32).substr(2, 6); -} - -var unstable_IdContext = /*#__PURE__*/(0,external_React_.createContext)(generateRandomString); -function unstable_IdProvider(_ref) { - var children = _ref.children, - _ref$prefix = _ref.prefix, - prefix = _ref$prefix === void 0 ? defaultPrefix : _ref$prefix; - var count = useRef(0); - var generateId = useCallback(function (localPrefix) { - if (localPrefix === void 0) { - localPrefix = prefix; - } - - return "" + (localPrefix ? localPrefix + "-" : "") + ++count.current; - }, [prefix]); - return /*#__PURE__*/createElement(unstable_IdContext.Provider, { - value: generateId - }, children); -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/Id/Id.js - - - - - - -// Automatically generated -var ID_STATE_KEYS = ["baseId", "unstable_idCountRef", "setBaseId"]; -var ID_KEYS = [].concat(ID_STATE_KEYS, ["id"]); - -var unstable_useId = createHook({ - keys: ID_KEYS, - useOptions: function useOptions(options, htmlProps) { - var generateId = (0,external_React_.useContext)(unstable_IdContext); - - var _React$useState = (0,external_React_.useState)(function () { - // This comes from useIdState - if (options.unstable_idCountRef) { - options.unstable_idCountRef.current += 1; - return "-" + options.unstable_idCountRef.current; - } // If there's no useIdState, we check if `baseId` was passed (as a prop, - // not from useIdState). - - - if (options.baseId) { - return "-" + generateId(""); - } - - return ""; - }), - suffix = _React$useState[0]; // `baseId` will be the prop passed directly as a prop or via useIdState. - // If there's neither, then it'll fallback to Context's generateId. - // This generateId can result in a sequential ID (if there's a Provider) - // or a random string (without Provider). - - - var baseId = (0,external_React_.useMemo)(function () { - return options.baseId || generateId(); - }, [options.baseId, generateId]); - var id = htmlProps.id || options.id || "" + baseId + suffix; - return _objectSpread2(_objectSpread2({}, options), {}, { - id: id - }); - }, - useProps: function useProps(options, htmlProps) { - return _objectSpread2({ - id: options.id - }, htmlProps); - } -}); -var unstable_Id = createComponent({ - as: "div", - useHook: unstable_useId -}); - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/createEvent.js - - -/** - * Creates an `Event` in a way that also works on IE 11. - * - * @example - * import { createEvent } from "reakit-utils"; - * - * const el = document.getElementById("id"); - * el.dispatchEvent(createEvent(el, "blur", { bubbles: false })); - */ - -function createEvent(element, type, eventInit) { - if (typeof Event === "function") { - return new Event(type, eventInit); - } // IE 11 doesn't support Event constructors - - - var event = getDocument_getDocument(element).createEvent("Event"); - event.initEvent(type, eventInit === null || eventInit === void 0 ? void 0 : eventInit.bubbles, eventInit === null || eventInit === void 0 ? void 0 : eventInit.cancelable); - return event; -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/fireEvent.js - - - -/** - * Creates and dispatches `Event` in a way that also works on IE 11. - * - * @example - * import { fireEvent } from "reakit-utils"; - * - * fireEvent(document.getElementById("id"), "blur", { - * bubbles: true, - * cancelable: true, - * }); - */ - -function fireEvent(element, type, eventInit) { - return element.dispatchEvent(createEvent(element, type, eventInit)); -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/setTextFieldValue-0a221f4e.js - - -function setTextFieldValue(element, value) { - if (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement) { - var _Object$getOwnPropert; - - var proto = Object.getPrototypeOf(element); - var setValue = (_Object$getOwnPropert = Object.getOwnPropertyDescriptor(proto, "value")) === null || _Object$getOwnPropert === void 0 ? void 0 : _Object$getOwnPropert.set; - - if (setValue) { - setValue.call(element, value); - fireEvent(element, "input", { - bubbles: true - }); - } - } -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/Composite/CompositeItem.js - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -function getWidget(itemElement) { - return itemElement.querySelector("[data-composite-item-widget]"); -} - -function useItem(options) { - return (0,external_React_.useMemo)(function () { - var _options$items; - - return (_options$items = options.items) === null || _options$items === void 0 ? void 0 : _options$items.find(function (item) { - return options.id && item.id === options.id; - }); - }, [options.items, options.id]); -} - -function targetIsAnotherItem(event, items) { - if (isSelfTarget(event)) return false; - - for (var _iterator = _createForOfIteratorHelperLoose(items), _step; !(_step = _iterator()).done;) { - var item = _step.value; - - if (item.ref.current === event.target) { - return true; - } - } - - return false; -} - -var useCompositeItem = createHook({ - name: "CompositeItem", - compose: [useClickable, unstable_useId], - keys: COMPOSITE_ITEM_KEYS, - propsAreEqual: function propsAreEqual(prev, next) { - if (!next.id || prev.id !== next.id) { - return useClickable.unstable_propsAreEqual(prev, next); - } - - var prevCurrentId = prev.currentId, - prevMoves = prev.unstable_moves, - prevProps = _objectWithoutPropertiesLoose(prev, ["currentId", "unstable_moves"]); - - var nextCurrentId = next.currentId, - nextMoves = next.unstable_moves, - nextProps = _objectWithoutPropertiesLoose(next, ["currentId", "unstable_moves"]); - - if (nextCurrentId !== prevCurrentId) { - if (next.id === nextCurrentId || next.id === prevCurrentId) { - return false; - } - } else if (prevMoves !== nextMoves) { - return false; - } - - return useClickable.unstable_propsAreEqual(prevProps, nextProps); - }, - useOptions: function useOptions(options) { - return _objectSpread2(_objectSpread2({}, options), {}, { - id: options.id, - currentId: getCurrentId(options), - unstable_clickOnSpace: options.unstable_hasActiveWidget ? false : options.unstable_clickOnSpace - }); - }, - useProps: function useProps(options, _ref) { - var _options$items2; - - var htmlRef = _ref.ref, - _ref$tabIndex = _ref.tabIndex, - htmlTabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex, - htmlOnMouseDown = _ref.onMouseDown, - htmlOnFocus = _ref.onFocus, - htmlOnBlurCapture = _ref.onBlurCapture, - htmlOnKeyDown = _ref.onKeyDown, - htmlOnClick = _ref.onClick, - htmlProps = _objectWithoutPropertiesLoose(_ref, ["ref", "tabIndex", "onMouseDown", "onFocus", "onBlurCapture", "onKeyDown", "onClick"]); - - var ref = (0,external_React_.useRef)(null); - var id = options.id; - var trulyDisabled = options.disabled && !options.focusable; - var isCurrentItem = options.currentId === id; - var isCurrentItemRef = useLiveRef(isCurrentItem); - var hasFocusedComposite = (0,external_React_.useRef)(false); - var item = useItem(options); - var onMouseDownRef = useLiveRef(htmlOnMouseDown); - var onFocusRef = useLiveRef(htmlOnFocus); - var onBlurCaptureRef = useLiveRef(htmlOnBlurCapture); - var onKeyDownRef = useLiveRef(htmlOnKeyDown); - var onClickRef = useLiveRef(htmlOnClick); - var shouldTabIndex = !options.unstable_virtual && !options.unstable_hasActiveWidget && isCurrentItem || // We don't want to set tabIndex="-1" when using CompositeItem as a - // standalone component, without state props. - !((_options$items2 = options.items) !== null && _options$items2 !== void 0 && _options$items2.length); - (0,external_React_.useEffect)(function () { - var _options$registerItem; - - if (!id) return undefined; - (_options$registerItem = options.registerItem) === null || _options$registerItem === void 0 ? void 0 : _options$registerItem.call(options, { - id: id, - ref: ref, - disabled: !!trulyDisabled - }); - return function () { - var _options$unregisterIt; - - (_options$unregisterIt = options.unregisterItem) === null || _options$unregisterIt === void 0 ? void 0 : _options$unregisterIt.call(options, id); - }; - }, [id, trulyDisabled, options.registerItem, options.unregisterItem]); - (0,external_React_.useEffect)(function () { - var element = ref.current; - - if (!element) { - false ? 0 : void 0; - return; - } // `moves` will be incremented whenever next, previous, up, down, first, - // last or move have been called. This means that the composite item will - // be focused whenever some of these functions are called. We're using - // isCurrentItemRef instead of isCurrentItem because we don't want to - // focus the item if isCurrentItem changes (and options.moves doesn't). - - - if (options.unstable_moves && isCurrentItemRef.current) { - userFocus(element); - } - }, [options.unstable_moves]); - var onMouseDown = (0,external_React_.useCallback)(function (event) { - var _onMouseDownRef$curre; - - (_onMouseDownRef$curre = onMouseDownRef.current) === null || _onMouseDownRef$curre === void 0 ? void 0 : _onMouseDownRef$curre.call(onMouseDownRef, event); - setUserFocus(event.currentTarget, true); - }, []); - var onFocus = (0,external_React_.useCallback)(function (event) { - var _onFocusRef$current, _options$setCurrentId; - - var shouldFocusComposite = hasUserFocus(event.currentTarget); - setUserFocus(event.currentTarget, false); - (_onFocusRef$current = onFocusRef.current) === null || _onFocusRef$current === void 0 ? void 0 : _onFocusRef$current.call(onFocusRef, event); - if (event.defaultPrevented) return; - if (isPortalEvent(event)) return; - if (!id) return; - if (targetIsAnotherItem(event, options.items)) return; - (_options$setCurrentId = options.setCurrentId) === null || _options$setCurrentId === void 0 ? void 0 : _options$setCurrentId.call(options, id); // When using aria-activedescendant, we want to make sure that the - // composite container receives focus, not the composite item. - // But we don't want to do this if the target is another focusable - // element inside the composite item, such as CompositeItemWidget. - - if (shouldFocusComposite && options.unstable_virtual && options.baseId && isSelfTarget(event)) { - var target = event.target; - var composite = getDocument_getDocument(target).getElementById(options.baseId); - - if (composite) { - hasFocusedComposite.current = true; - ensureFocus(composite); - } - } - }, [id, options.items, options.setCurrentId, options.unstable_virtual, options.baseId]); - var onBlurCapture = (0,external_React_.useCallback)(function (event) { - var _onBlurCaptureRef$cur; - - (_onBlurCaptureRef$cur = onBlurCaptureRef.current) === null || _onBlurCaptureRef$cur === void 0 ? void 0 : _onBlurCaptureRef$cur.call(onBlurCaptureRef, event); - if (event.defaultPrevented) return; - - if (options.unstable_virtual && hasFocusedComposite.current) { - // When hasFocusedComposite is true, composite has been focused right - // after focusing this item. This is an intermediate blur event, so - // we ignore it. - hasFocusedComposite.current = false; - event.preventDefault(); - event.stopPropagation(); - } - }, [options.unstable_virtual]); - var onKeyDown = (0,external_React_.useCallback)(function (event) { - var _onKeyDownRef$current; - - if (!isSelfTarget(event)) return; - var isVertical = options.orientation !== "horizontal"; - var isHorizontal = options.orientation !== "vertical"; - var isGrid = !!(item !== null && item !== void 0 && item.groupId); - var keyMap = { - ArrowUp: (isGrid || isVertical) && options.up, - ArrowRight: (isGrid || isHorizontal) && options.next, - ArrowDown: (isGrid || isVertical) && options.down, - ArrowLeft: (isGrid || isHorizontal) && options.previous, - Home: function Home() { - if (!isGrid || event.ctrlKey) { - var _options$first; - - (_options$first = options.first) === null || _options$first === void 0 ? void 0 : _options$first.call(options); - } else { - var _options$previous; - - (_options$previous = options.previous) === null || _options$previous === void 0 ? void 0 : _options$previous.call(options, true); - } - }, - End: function End() { - if (!isGrid || event.ctrlKey) { - var _options$last; - - (_options$last = options.last) === null || _options$last === void 0 ? void 0 : _options$last.call(options); - } else { - var _options$next; - - (_options$next = options.next) === null || _options$next === void 0 ? void 0 : _options$next.call(options, true); - } - }, - PageUp: function PageUp() { - if (isGrid) { - var _options$up; - - (_options$up = options.up) === null || _options$up === void 0 ? void 0 : _options$up.call(options, true); - } else { - var _options$first2; - - (_options$first2 = options.first) === null || _options$first2 === void 0 ? void 0 : _options$first2.call(options); - } - }, - PageDown: function PageDown() { - if (isGrid) { - var _options$down; - - (_options$down = options.down) === null || _options$down === void 0 ? void 0 : _options$down.call(options, true); - } else { - var _options$last2; - - (_options$last2 = options.last) === null || _options$last2 === void 0 ? void 0 : _options$last2.call(options); - } - } - }; - var action = keyMap[event.key]; - - if (action) { - event.preventDefault(); - action(); - return; - } - - (_onKeyDownRef$current = onKeyDownRef.current) === null || _onKeyDownRef$current === void 0 ? void 0 : _onKeyDownRef$current.call(onKeyDownRef, event); - if (event.defaultPrevented) return; - - if (event.key.length === 1 && event.key !== " ") { - var widget = getWidget(event.currentTarget); - - if (widget && isTextField_isTextField(widget)) { - widget.focus(); - setTextFieldValue(widget, ""); - } - } else if (event.key === "Delete" || event.key === "Backspace") { - var _widget = getWidget(event.currentTarget); +// src/focusable/focusable-context.ts - if (_widget && isTextField_isTextField(_widget)) { - event.preventDefault(); - setTextFieldValue(_widget, ""); - } - } - }, [options.orientation, item, options.up, options.next, options.down, options.previous, options.first, options.last]); - var onClick = (0,external_React_.useCallback)(function (event) { - var _onClickRef$current; - - (_onClickRef$current = onClickRef.current) === null || _onClickRef$current === void 0 ? void 0 : _onClickRef$current.call(onClickRef, event); - if (event.defaultPrevented) return; - var element = event.currentTarget; - var widget = getWidget(element); - - if (widget && !hasFocusWithin(widget)) { - // If there's a widget inside the composite item, we make sure it's - // focused when pressing enter, space or clicking on the composite item. - widget.focus(); - } - }, []); - return _objectSpread2({ - ref: useForkRef(ref, htmlRef), - id: id, - tabIndex: shouldTabIndex ? htmlTabIndex : -1, - "aria-selected": options.unstable_virtual && isCurrentItem ? true : undefined, - onMouseDown: onMouseDown, - onFocus: onFocus, - onBlurCapture: onBlurCapture, - onKeyDown: onKeyDown, - onClick: onClick - }, htmlProps); - } -}); -var CompositeItem = createComponent({ - as: "button", - memo: true, - useHook: useCompositeItem -}); +var FocusableContext = (0,external_React_.createContext)(true); -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/PNRLI7OV.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/4R3V3JGP.js +"use client"; var __defProp = Object.defineProperty; var __defProps = Object.defineProperties; var __getOwnPropDescs = Object.getOwnPropertyDescriptors; @@ -5170,7 +2697,7 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; -var PNRLI7OV_spreadValues = (a, b) => { +var _4R3V3JGP_spreadValues = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]); @@ -5181,7 +2708,7 @@ var PNRLI7OV_spreadValues = (a, b) => { } return a; }; -var PNRLI7OV_spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); +var _4R3V3JGP_spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); var __objRest = (source, exclude) => { var target = {}; for (var prop in source) @@ -5197,34 +2724,35 @@ var __objRest = (source, exclude) => { -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/PNRLI7OV.js -var PNRLI7OV_defProp = Object.defineProperty; -var PNRLI7OV_defProps = Object.defineProperties; -var PNRLI7OV_getOwnPropDescs = Object.getOwnPropertyDescriptors; -var PNRLI7OV_getOwnPropSymbols = Object.getOwnPropertySymbols; -var PNRLI7OV_hasOwnProp = Object.prototype.hasOwnProperty; -var PNRLI7OV_propIsEnum = Object.prototype.propertyIsEnumerable; -var PNRLI7OV_defNormalProp = (obj, key, value) => key in obj ? PNRLI7OV_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; -var _chunks_PNRLI7OV_spreadValues = (a, b) => { +;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/4R3V3JGP.js +"use client"; +var _4R3V3JGP_defProp = Object.defineProperty; +var _4R3V3JGP_defProps = Object.defineProperties; +var _4R3V3JGP_getOwnPropDescs = Object.getOwnPropertyDescriptors; +var _4R3V3JGP_getOwnPropSymbols = Object.getOwnPropertySymbols; +var _4R3V3JGP_hasOwnProp = Object.prototype.hasOwnProperty; +var _4R3V3JGP_propIsEnum = Object.prototype.propertyIsEnumerable; +var _4R3V3JGP_defNormalProp = (obj, key, value) => key in obj ? _4R3V3JGP_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var _chunks_4R3V3JGP_spreadValues = (a, b) => { for (var prop in b || (b = {})) - if (PNRLI7OV_hasOwnProp.call(b, prop)) - PNRLI7OV_defNormalProp(a, prop, b[prop]); - if (PNRLI7OV_getOwnPropSymbols) - for (var prop of PNRLI7OV_getOwnPropSymbols(b)) { - if (PNRLI7OV_propIsEnum.call(b, prop)) - PNRLI7OV_defNormalProp(a, prop, b[prop]); + if (_4R3V3JGP_hasOwnProp.call(b, prop)) + _4R3V3JGP_defNormalProp(a, prop, b[prop]); + if (_4R3V3JGP_getOwnPropSymbols) + for (var prop of _4R3V3JGP_getOwnPropSymbols(b)) { + if (_4R3V3JGP_propIsEnum.call(b, prop)) + _4R3V3JGP_defNormalProp(a, prop, b[prop]); } return a; }; -var _chunks_PNRLI7OV_spreadProps = (a, b) => PNRLI7OV_defProps(a, PNRLI7OV_getOwnPropDescs(b)); -var PNRLI7OV_objRest = (source, exclude) => { +var _chunks_4R3V3JGP_spreadProps = (a, b) => _4R3V3JGP_defProps(a, _4R3V3JGP_getOwnPropDescs(b)); +var _4R3V3JGP_objRest = (source, exclude) => { var target = {}; for (var prop in source) - if (PNRLI7OV_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) + if (_4R3V3JGP_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; - if (source != null && PNRLI7OV_getOwnPropSymbols) - for (var prop of PNRLI7OV_getOwnPropSymbols(source)) { - if (exclude.indexOf(prop) < 0 && PNRLI7OV_propIsEnum.call(source, prop)) + if (source != null && _4R3V3JGP_getOwnPropSymbols) + for (var prop of _4R3V3JGP_getOwnPropSymbols(source)) { + if (exclude.indexOf(prop) < 0 && _4R3V3JGP_propIsEnum.call(source, prop)) target[prop] = source[prop]; } return target; @@ -5232,13 +2760,14 @@ var PNRLI7OV_objRest = (source, exclude) => { -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/WVTCK5PV.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/Y3OOHFCN.js +"use client"; // src/utils/misc.ts function noop(..._) { } -function WVTCK5PV_shallowEqual(a, b) { +function shallowEqual(a, b) { if (a === b) return true; if (!a) @@ -5261,7 +2790,7 @@ function WVTCK5PV_shallowEqual(a, b) { } return true; } -function WVTCK5PV_applyState(argument, currentValue) { +function Y3OOHFCN_applyState(argument, currentValue) { if (isUpdater(argument)) { const value = isLazyValue(currentValue) ? currentValue() : currentValue; return argument(value); @@ -5274,13 +2803,13 @@ function isUpdater(argument) { function isLazyValue(value) { return typeof value === "function"; } -function WVTCK5PV_isObject(arg) { +function isObject(arg) { return typeof arg === "object" && arg != null; } function isEmpty(arg) { if (Array.isArray(arg)) return !arg.length; - if (WVTCK5PV_isObject(arg)) + if (isObject(arg)) return !Object.keys(arg).length; if (arg == null) return true; @@ -5294,7 +2823,10 @@ function isInteger(arg) { } return String(Math.floor(Number(arg))) === arg; } -function WVTCK5PV_hasOwnProperty(object, prop) { +function Y3OOHFCN_hasOwnProperty(object, prop) { + if (typeof Object.hasOwn === "function") { + return Object.hasOwn(object, prop); + } return Object.prototype.hasOwnProperty.call(object, prop); } function chain(...fns) { @@ -5313,9 +2845,9 @@ function normalizeString(str) { return str.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); } function omit(object, keys) { - const result = _chunks_PNRLI7OV_spreadValues({}, object); + const result = _chunks_4R3V3JGP_spreadValues({}, object); for (const key of keys) { - if (WVTCK5PV_hasOwnProperty(result, key)) { + if (Y3OOHFCN_hasOwnProperty(result, key)) { delete result[key]; } } @@ -5324,7 +2856,7 @@ function omit(object, keys) { function pick(object, paths) { const result = {}; for (const key of paths) { - if (WVTCK5PV_hasOwnProperty(object, key)) { + if (Y3OOHFCN_hasOwnProperty(object, key)) { result[key] = object[key]; } } @@ -5359,6 +2891,9 @@ function isFalsyBooleanCallback(booleanOrCallback, ...args) { return false; return !result; } +function disabledFromProps(props) { + return props.disabled || props["aria-disabled"] === true || props["aria-disabled"] === "true"; +} function defaultValue(...values) { for (const value of values) { if (value !== void 0) @@ -5369,13 +2904,14 @@ function defaultValue(...values) { -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/CP3U4HPL.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/XM66DUTO.js +"use client"; // src/utils/misc.ts -function CP3U4HPL_setRef(ref, value) { +function setRef(ref, value) { if (typeof ref === "function") { ref(value); } else if (ref) { @@ -5397,9 +2933,9 @@ function getRefProperty(element) { return element.ref; } function mergeProps(base, overrides) { - const props = PNRLI7OV_spreadValues({}, base); + const props = _4R3V3JGP_spreadValues({}, base); for (const key in overrides) { - if (!WVTCK5PV_hasOwnProperty(overrides, key)) + if (!Y3OOHFCN_hasOwnProperty(overrides, key)) continue; if (key === "className") { const prop = "className"; @@ -5408,7 +2944,7 @@ function mergeProps(base, overrides) { } if (key === "style") { const prop = "style"; - props[prop] = base[prop] ? PNRLI7OV_spreadValues(PNRLI7OV_spreadValues({}, base[prop]), overrides[prop]) : overrides[prop]; + props[prop] = base[prop] ? _4R3V3JGP_spreadValues(_4R3V3JGP_spreadValues({}, base[prop]), overrides[prop]) : overrides[prop]; continue; } const overrideValue = overrides[key]; @@ -5429,26 +2965,28 @@ function mergeProps(base, overrides) { -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/O35LWD4W.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/DLOEKDPY.js +"use client"; + // src/utils/dom.ts -var O35LWD4W_canUseDOM = O35LWD4W_checkIsBrowser(); -function O35LWD4W_checkIsBrowser() { +var canUseDOM = checkIsBrowser(); +function checkIsBrowser() { var _a; return typeof window !== "undefined" && !!((_a = window.document) == null ? void 0 : _a.createElement); } -function O35LWD4W_getDocument(node) { +function DLOEKDPY_getDocument(node) { return node ? node.ownerDocument || node : document; } -function O35LWD4W_getWindow(node) { - return O35LWD4W_getDocument(node).defaultView || window; +function getWindow(node) { + return DLOEKDPY_getDocument(node).defaultView || window; } -function O35LWD4W_getActiveElement(node, activeDescendant = false) { - const { activeElement } = O35LWD4W_getDocument(node); +function getActiveElement(node, activeDescendant = false) { + const { activeElement } = DLOEKDPY_getDocument(node); if (!(activeElement == null ? void 0 : activeElement.nodeName)) { return null; } if (isFrame(activeElement) && activeElement.contentDocument) { - return O35LWD4W_getActiveElement( + return getActiveElement( activeElement.contentDocument.body, activeDescendant ); @@ -5456,7 +2994,7 @@ function O35LWD4W_getActiveElement(node, activeDescendant = false) { if (activeDescendant) { const id = activeElement.getAttribute("aria-activedescendant"); if (id) { - const element = O35LWD4W_getDocument(activeElement).getElementById(id); + const element = DLOEKDPY_getDocument(activeElement).getElementById(id); if (element) { return element; } @@ -5464,22 +3002,22 @@ function O35LWD4W_getActiveElement(node, activeDescendant = false) { } return activeElement; } -function O35LWD4W_contains(parent, child) { +function contains(parent, child) { return parent === child || parent.contains(child); } function isFrame(element) { return element.tagName === "IFRAME"; } -function O35LWD4W_isButton(element) { +function isButton(element) { const tagName = element.tagName.toLowerCase(); if (tagName === "button") return true; if (tagName === "input" && element.type) { - return O35LWD4W_buttonInputTypes.indexOf(element.type) !== -1; + return buttonInputTypes.indexOf(element.type) !== -1; } return false; } -var O35LWD4W_buttonInputTypes = [ +var buttonInputTypes = [ "button", "color", "file", @@ -5487,7 +3025,7 @@ var O35LWD4W_buttonInputTypes = [ "reset", "submit" ]; -function O35LWD4W_matches(element, selectors) { +function matches(element, selectors) { if ("matches" in element) { return element.matches(selectors); } @@ -5496,21 +3034,21 @@ function O35LWD4W_matches(element, selectors) { } return element.webkitMatchesSelector(selectors); } -function O35LWD4W_isVisible(element) { +function isVisible(element) { const htmlElement = element; return htmlElement.offsetWidth > 0 || htmlElement.offsetHeight > 0 || element.getClientRects().length > 0; } -function O35LWD4W_closest(element, selectors) { +function DLOEKDPY_closest(element, selectors) { if ("closest" in element) return element.closest(selectors); do { - if (O35LWD4W_matches(element, selectors)) + if (matches(element, selectors)) return element; element = element.parentElement || element.parentNode; } while (element !== null && element.nodeType === 1); return null; } -function O35LWD4W_isTextField(element) { +function DLOEKDPY_isTextField(element) { try { const isTextInput = element instanceof HTMLInputElement && element.selectionStart !== null; const isTextArea = element.tagName === "TEXTAREA"; @@ -5544,12 +3082,12 @@ function getPopupItemRole(element, fallback) { function getTextboxSelection(element) { let start = 0; let end = 0; - if (O35LWD4W_isTextField(element)) { + if (DLOEKDPY_isTextField(element)) { start = element.selectionStart || 0; end = element.selectionEnd || 0; } else if (element.isContentEditable) { - const selection = O35LWD4W_getDocument(element).getSelection(); - if ((selection == null ? void 0 : selection.rangeCount) && selection.anchorNode && O35LWD4W_contains(element, selection.anchorNode) && selection.focusNode && O35LWD4W_contains(element, selection.focusNode)) { + const selection = DLOEKDPY_getDocument(element).getSelection(); + if ((selection == null ? void 0 : selection.rangeCount) && selection.anchorNode && contains(element, selection.anchorNode) && selection.focusNode && contains(element, selection.focusNode)) { const range = selection.getRangeAt(0); const nextRange = range.cloneRange(); nextRange.selectNodeContents(element); @@ -5599,21 +3137,52 @@ function isPartiallyHidden(element) { const right = elementRect.right > scrollerRight; return top || left || bottom || right; } +function setSelectionRange(element, ...args) { + if (/text|search|password|tel|url/i.test(element.type)) { + element.setSelectionRange(...args); + } +} + + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/MHPO2BXA.js +"use client"; + + +// src/utils/platform.ts +function isTouchDevice() { + return canUseDOM && !!navigator.maxTouchPoints; +} +function isApple() { + if (!canUseDOM) + return false; + return /mac|iphone|ipad|ipod/i.test(navigator.platform); +} +function isSafari() { + return canUseDOM && isApple() && /apple/i.test(navigator.vendor); +} +function isFirefox() { + return canUseDOM && /firefox\//i.test(navigator.userAgent); +} +function isMac() { + return canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice(); +} ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/utils/events.js +"use client"; // src/utils/events.ts -function events_isPortalEvent(event) { +function isPortalEvent(event) { return Boolean( - event.currentTarget && !O35LWD4W_contains(event.currentTarget, event.target) + event.currentTarget && !contains(event.currentTarget, event.target) ); } -function events_isSelfTarget(event) { +function isSelfTarget(event) { return event.target === event.currentTarget; } function isOpeningInNewTab(event) { @@ -5649,21 +3218,21 @@ function isDownloading(event) { return true; return false; } -function events_fireEvent(element, type, eventInit) { +function fireEvent(element, type, eventInit) { const event = new Event(type, eventInit); return element.dispatchEvent(event); } function fireBlurEvent(element, eventInit) { const event = new FocusEvent("blur", eventInit); const defaultAllowed = element.dispatchEvent(event); - const bubbleInit = _chunks_PNRLI7OV_spreadProps(_chunks_PNRLI7OV_spreadValues({}, eventInit), { bubbles: true }); + const bubbleInit = _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, eventInit), { bubbles: true }); element.dispatchEvent(new FocusEvent("focusout", bubbleInit)); return defaultAllowed; } function fireFocusEvent(element, eventInit) { const event = new FocusEvent("focus", eventInit); const defaultAllowed = element.dispatchEvent(event); - const bubbleInit = _chunks_PNRLI7OV_spreadProps(_chunks_PNRLI7OV_spreadValues({}, eventInit), { bubbles: true }); + const bubbleInit = __spreadProps(__spreadValues({}, eventInit), { bubbles: true }); element.dispatchEvent(new FocusEvent("focusin", bubbleInit)); return defaultAllowed; } @@ -5678,7 +3247,7 @@ function fireClickEvent(element, eventInit) { function isFocusEventOutside(event, container) { const containerElement = container || event.currentTarget; const relatedTarget = event.relatedTarget; - return !relatedTarget || !O35LWD4W_contains(containerElement, relatedTarget); + return !relatedTarget || !contains(containerElement, relatedTarget); } function queueBeforeEvent(element, type, callback) { const raf = requestAnimationFrame(() => { @@ -5696,32 +3265,27 @@ function queueBeforeEvent(element, type, callback) { return raf; } function addGlobalEventListener(type, listener, options, scope = window) { - var _a; + const children = []; try { scope.document.addEventListener(type, listener, options); - } catch (e) { - } - const listeners = []; - for (let i = 0; i < ((_a = scope.frames) == null ? void 0 : _a.length); i += 1) { - const frameWindow = scope.frames[i]; - if (frameWindow) { - listeners.push( - addGlobalEventListener(type, listener, options, frameWindow) - ); + for (const frame of Array.from(scope.frames)) { + children.push(addGlobalEventListener(type, listener, options, frame)); } + } catch (e) { } const removeEventListener = () => { try { scope.document.removeEventListener(type, listener, options); } catch (e) { } - listeners.forEach((listener2) => listener2()); + children.forEach((remove) => remove()); }; return removeEventListener; } -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/J7Q2EO23.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/6O5OEQGF.js +"use client"; @@ -5731,23 +3295,23 @@ function addGlobalEventListener(type, listener, options, scope = window) { -var _React = PNRLI7OV_spreadValues({}, external_React_namespaceObject); +var _React = _4R3V3JGP_spreadValues({}, external_React_namespaceObject); var useReactId = _React.useId; var useReactDeferredValue = _React.useDeferredValue; var useReactInsertionEffect = _React.useInsertionEffect; -var useSafeLayoutEffect = O35LWD4W_canUseDOM ? external_React_.useLayoutEffect : external_React_.useEffect; +var useSafeLayoutEffect = canUseDOM ? external_React_.useLayoutEffect : external_React_.useEffect; function useInitialValue(value) { - const [initialValue] = useState(value); + const [initialValue] = (0,external_React_.useState)(value); return initialValue; } function useLazyValue(init) { - const ref = (0,external_React_.useRef)(); + const ref = useRef(); if (ref.current === void 0) { ref.current = init(); } return ref.current; } -function J7Q2EO23_useLiveRef(value) { +function useLiveRef(value) { const ref = (0,external_React_.useRef)(value); useSafeLayoutEffect(() => { ref.current = value; @@ -5782,7 +3346,7 @@ function useMergeRefs(...refs) { if (!refs.some(Boolean)) return; return (value) => { - refs.forEach((ref) => CP3U4HPL_setRef(ref, value)); + refs.forEach((ref) => setRef(ref, value)); }; }, refs); } @@ -5846,14 +3410,14 @@ function useAttribute(refOrElement, attributeName, defaultValue) { return attribute; } function useUpdateEffect(effect, deps) { - const mounted = useRef(false); - useEffect(() => { + const mounted = (0,external_React_.useRef)(false); + (0,external_React_.useEffect)(() => { if (mounted.current) { return effect(); } mounted.current = true; }, deps); - useEffect( + (0,external_React_.useEffect)( () => () => { mounted.current = false; }, @@ -5878,9 +3442,9 @@ function useUpdateLayoutEffect(effect, deps) { function useControlledState(defaultState, state, setState) { const [localState, setLocalState] = useState(defaultState); const nextState = state !== void 0 ? state : localState; - const stateRef = J7Q2EO23_useLiveRef(state); - const setStateRef = J7Q2EO23_useLiveRef(setState); - const nextStateRef = J7Q2EO23_useLiveRef(nextState); + const stateRef = useLiveRef(state); + const setStateRef = useLiveRef(setState); + const nextStateRef = useLiveRef(nextState); const setNextState = useCallback((prevValue) => { const setStateProp = setStateRef.current; if (setStateProp) { @@ -5926,7 +3490,7 @@ function useWrapElement(props, callback, deps = []) { }, [...deps, props.wrapElement] ); - return PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({}, props), { wrapElement }); + return _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { wrapElement }); } function usePortalRef(portalProp = false, portalRefProp) { const [portalNode, setPortalNode] = (0,external_React_.useState)(null); @@ -5934,6 +3498,14 @@ function usePortalRef(portalProp = false, portalRefProp) { const domReady = !portalProp || portalNode; return { portalRef, portalNode, domReady }; } +function useMetadataProps(props, key, value) { + const parent = props.onLoadedMetadataCapture; + const onLoadedMetadataCapture = (0,external_React_.useMemo)(() => { + return Object.assign(() => { + }, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, parent), { [key]: value })); + }, [parent, key, value]); + return [parent == null ? void 0 : parent[key], { onLoadedMetadataCapture }]; +} function useIsMouseMoving() { (0,external_React_.useEffect)(() => { addGlobalEventListener("mousemove", setMouseMoving, true); @@ -5966,548 +3538,10 @@ function resetMouseMoving() { -// EXTERNAL MODULE: ./node_modules/use-sync-external-store/shim/index.js -var shim = __webpack_require__(635); -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/FHQZ2KRN.js - - - -// src/utils/store.tsx - - - -var noopSubscribe = () => () => { -}; -function useStoreState(store, keyOrSelector = identity) { - const getSnapshot = () => { - if (!store) - return; - const state = store.getState(); - const selector = typeof keyOrSelector === "function" ? keyOrSelector : null; - const key = typeof keyOrSelector === "string" ? keyOrSelector : null; - if (selector) - return selector(state); - if (!key) - return; - if (!WVTCK5PV_hasOwnProperty(state, key)) - return; - return state[key]; - }; - return (0,shim.useSyncExternalStore)( - (store == null ? void 0 : store.subscribe) || noopSubscribe, - getSnapshot, - getSnapshot - ); -} -function useStoreProps(store, props, key, setKey) { - const value = WVTCK5PV_hasOwnProperty(props, key) ? props[key] : void 0; - const propsRef = J7Q2EO23_useLiveRef({ - value, - setValue: setKey ? props[setKey] : void 0 - }); - useSafeLayoutEffect(() => { - return store.sync( - (state, prev) => { - const { value: value2, setValue } = propsRef.current; - if (!setValue) - return; - if (state[key] === prev[key]) - return; - if (state[key] === value2) - return; - setValue(state[key]); - }, - [key] - ); - }, [store, key]); - useSafeLayoutEffect(() => { - return store.sync(() => { - if (value === void 0) - return; - store.setState(key, value); - }, [key]); - }, [store, key, value]); -} -function FHQZ2KRN_useStore(createStore) { - const store = useLazyValue(createStore); - useSafeLayoutEffect(() => store.init(), [store]); - const useState = (0,external_React_.useCallback)( - (keyOrSelector) => useStoreState(store, keyOrSelector), - [store] - ); - return (0,external_React_.useMemo)(() => PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({}, store), { useState }), [store, useState]); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/FQL4TRMX.js - - - -// src/utils/store.ts -function createStore(initialState, ...stores) { - let state = initialState; - let prevStateBatch = state; - let lastUpdate = Symbol(); - let initialized = false; - const updatedKeys = /* @__PURE__ */ new Set(); - const setups = /* @__PURE__ */ new Set(); - const listeners = /* @__PURE__ */ new Set(); - const listenersBatch = /* @__PURE__ */ new Set(); - const disposables = /* @__PURE__ */ new WeakMap(); - const listenerKeys = /* @__PURE__ */ new WeakMap(); - const setup = (callback) => { - setups.add(callback); - return () => setups.delete(callback); - }; - const init = () => { - if (initialized) - return noop; - if (!stores.length) - return noop; - initialized = true; - const desyncs = getKeys(state).map( - (key) => chain( - ...stores.map((store) => { - var _a, _b; - const storeState = (_a = store == null ? void 0 : store.getState) == null ? void 0 : _a.call(store); - if (!storeState) - return; - if (!WVTCK5PV_hasOwnProperty(storeState, key)) - return; - return (_b = store == null ? void 0 : store.sync) == null ? void 0 : _b.call(store, (state2) => setState(key, state2[key]), [key]); - }) - ) - ); - const teardowns = []; - setups.forEach((setup2) => teardowns.push(setup2())); - const cleanups = stores.map((store) => { - var _a; - return (_a = store == null ? void 0 : store.init) == null ? void 0 : _a.call(store); - }); - return chain(...desyncs, ...teardowns, ...cleanups, () => { - initialized = false; - }); - }; - const sub = (listener, keys, batch = false) => { - const set = batch ? listenersBatch : listeners; - set.add(listener); - listenerKeys.set(listener, keys); - return () => { - var _a; - (_a = disposables.get(listener)) == null ? void 0 : _a(); - disposables.delete(listener); - listenerKeys.delete(listener); - set.delete(listener); - }; - }; - const subscribe = (listener, keys) => sub(listener, keys); - const sync = (listener, keys) => { - disposables.set(listener, listener(state, state)); - return sub(listener, keys); - }; - const syncBatch = (listener, keys) => { - disposables.set(listener, listener(state, prevStateBatch)); - return sub(listener, keys, true); - }; - const getState = () => state; - const setState = (key, value) => { - if (!WVTCK5PV_hasOwnProperty(state, key)) - return; - const nextValue = WVTCK5PV_applyState(value, state[key]); - if (nextValue === state[key]) - return; - stores.forEach((store) => { - var _a; - (_a = store == null ? void 0 : store.setState) == null ? void 0 : _a.call(store, key, nextValue); - }); - const prevState = state; - state = _chunks_PNRLI7OV_spreadProps(_chunks_PNRLI7OV_spreadValues({}, state), { [key]: nextValue }); - const thisUpdate = Symbol(); - lastUpdate = thisUpdate; - updatedKeys.add(key); - const run = (listener, prev, uKeys) => { - var _a; - const keys = listenerKeys.get(listener); - const updated = (k) => uKeys ? uKeys.has(k) : k === key; - if (!keys || keys.some(updated)) { - (_a = disposables.get(listener)) == null ? void 0 : _a(); - disposables.set(listener, listener(state, prev)); - } - }; - listeners.forEach((listener) => run(listener, prevState)); - queueMicrotask(() => { - if (lastUpdate !== thisUpdate) - return; - const snapshot = state; - listenersBatch.forEach((listener) => { - run(listener, prevStateBatch, updatedKeys); - }); - prevStateBatch = snapshot; - updatedKeys.clear(); - }); - }; - const pick2 = (...keys) => createStore(pick(state, keys), finalStore); - const omit2 = (...keys) => createStore(omit(state, keys), finalStore); - const finalStore = { - setup, - init, - subscribe, - sync, - syncBatch, - getState, - setState, - pick: pick2, - omit: omit2 - }; - return finalStore; -} -function mergeStore(...stores) { - const initialState = stores.reduce((state, store2) => { - var _a; - const nextState = (_a = store2 == null ? void 0 : store2.getState) == null ? void 0 : _a.call(store2); - if (!nextState) - return state; - return _chunks_PNRLI7OV_spreadValues(_chunks_PNRLI7OV_spreadValues({}, state), nextState); - }, {}); - const store = createStore(initialState, ...stores); - return store; -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/L5RO76KW.js - - - - -// src/disclosure/disclosure-store.ts -function createDisclosureStore(props = {}) { - var _a; - const store = mergeStore( - props.store, - (_a = props.disclosure) == null ? void 0 : _a.omit("contentElement", "disclosureElement") - ); - const syncState = store == null ? void 0 : store.getState(); - const open = defaultValue( - props.open, - syncState == null ? void 0 : syncState.open, - props.defaultOpen, - false - ); - const animated = defaultValue(props.animated, syncState == null ? void 0 : syncState.animated, false); - const initialState = { - open, - animated, - animating: !!animated && open, - mounted: open, - contentElement: defaultValue(syncState == null ? void 0 : syncState.contentElement, null), - disclosureElement: defaultValue(syncState == null ? void 0 : syncState.disclosureElement, null) - }; - const disclosure = createStore(initialState, store); - disclosure.setup( - () => disclosure.sync( - (state) => { - if (state.animated) - return; - disclosure.setState("animating", false); - }, - ["animated", "animating"] - ) - ); - disclosure.setup( - () => disclosure.sync( - (state, prev) => { - if (!state.animated) - return; - const mounting = state === prev; - const animating = mounting ? state.open : state.open !== prev.open; - disclosure.setState("animating", animating); - }, - ["open", "animated"] - ) - ); - disclosure.setup( - () => disclosure.sync( - (state) => { - disclosure.setState("mounted", state.open || state.animating); - }, - ["open", "animating"] - ) - ); - return _chunks_PNRLI7OV_spreadProps(_chunks_PNRLI7OV_spreadValues({}, disclosure), { - setOpen: (value) => disclosure.setState("open", value), - show: () => disclosure.setState("open", true), - hide: () => disclosure.setState("open", false), - toggle: () => disclosure.setState("open", (open2) => !open2), - stopAnimation: () => disclosure.setState("animating", false), - setContentElement: (value) => disclosure.setState("contentElement", value), - setDisclosureElement: (value) => disclosure.setState("disclosureElement", value) - }); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/54LBRJ55.js - - - -// src/disclosure/disclosure-store.ts - -function useDisclosureStoreOptions(_props) { - return {}; -} -function useDisclosureStoreProps(store, props) { - useStoreProps(store, props, "open", "setOpen"); - useStoreProps(store, props, "animated"); - return store; -} -function useDisclosureStore(props = {}) { - const options = useDisclosureStoreOptions(props); - const store = FHQZ2KRN_useStore( - () => createDisclosureStore(PNRLI7OV_spreadValues(PNRLI7OV_spreadValues({}, props), options)) - ); - return useDisclosureStoreProps(store, props); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/TALTYI5G.js - - - - -// src/dialog/dialog-store.ts - -function useDialogStoreOptions(props) { - return useDisclosureStoreOptions(props); -} -function useDialogStoreProps(store, props) { - return useDisclosureStoreProps(store, props); -} -function useDialogStore(props = {}) { - const options = useDialogStoreOptions(props); - const store = useStore( - () => Core.createDialogStore(__spreadValues(__spreadValues({}, props), options)) - ); - return useDialogStoreProps(store, props); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/5QJYOWLQ.js - - - - -// src/popover/popover-store.ts - -function usePopoverStoreOptions(props) { - return useDialogStoreOptions(props); -} -function usePopoverStoreProps(store, props) { - store = useDialogStoreProps(store, props); - useStoreProps(store, props, "placement"); - return store; -} -function usePopoverStore(props = {}) { - const options = usePopoverStoreOptions(props); - const store = useStore( - () => Core.createPopoverStore(__spreadValues(__spreadValues({}, props), options)) - ); - return usePopoverStoreProps(store, props); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/JFHRFFJJ.js - - - - -// src/hovercard/hovercard-store.ts - -function useHovercardStoreOptions(props) { - return usePopoverStoreOptions(props); -} -function useHovercardStoreProps(store, props) { - store = usePopoverStoreProps(store, props); - useStoreProps(store, props, "timeout"); - useStoreProps(store, props, "showTimeout"); - useStoreProps(store, props, "hideTimeout"); - return store; -} -function useHovercardStore(props = {}) { - const options = useHovercardStoreOptions(props); - const store = useStore( - () => Core.createHovercardStore(__spreadValues(__spreadValues({}, props), options)) - ); - return useHovercardStoreProps(store, props); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/UWW2ZP3K.js - - -// src/dialog/dialog-store.ts -function createDialogStore(props = {}) { - return createDisclosureStore(props); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/LM4QG55U.js - - - - - -// src/popover/popover-store.ts -function createPopoverStore(_a = {}) { - var _b = _a, { - popover: otherPopover - } = _b, props = PNRLI7OV_objRest(_b, [ - "popover" - ]); - const store = mergeStore( - props.store, - otherPopover == null ? void 0 : otherPopover.omit( - "arrowElement", - "anchorElement", - "contentElement", - "popoverElement", - "disclosureElement" - ) - ); - const syncState = store == null ? void 0 : store.getState(); - const dialog = createDialogStore(_chunks_PNRLI7OV_spreadProps(_chunks_PNRLI7OV_spreadValues({}, props), { store })); - const placement = defaultValue( - props.placement, - syncState == null ? void 0 : syncState.placement, - "bottom" - ); - const initialState = _chunks_PNRLI7OV_spreadProps(_chunks_PNRLI7OV_spreadValues({}, dialog.getState()), { - placement, - currentPlacement: placement, - anchorElement: defaultValue(syncState == null ? void 0 : syncState.anchorElement, null), - popoverElement: defaultValue(syncState == null ? void 0 : syncState.popoverElement, null), - arrowElement: defaultValue(syncState == null ? void 0 : syncState.arrowElement, null), - rendered: Symbol("rendered") - }); - const popover = createStore(initialState, dialog, store); - return _chunks_PNRLI7OV_spreadProps(_chunks_PNRLI7OV_spreadValues(_chunks_PNRLI7OV_spreadValues({}, dialog), popover), { - setAnchorElement: (element) => popover.setState("anchorElement", element), - setPopoverElement: (element) => popover.setState("popoverElement", element), - setArrowElement: (element) => popover.setState("arrowElement", element), - render: () => popover.setState("rendered", Symbol("rendered")) - }); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/XJGRXN57.js - - - - - -// src/hovercard/hovercard-store.ts -function createHovercardStore(props = {}) { - var _a; - const syncState = (_a = props.store) == null ? void 0 : _a.getState(); - const popover = createPopoverStore(_chunks_PNRLI7OV_spreadProps(_chunks_PNRLI7OV_spreadValues({}, props), { - placement: defaultValue( - props.placement, - syncState == null ? void 0 : syncState.placement, - "bottom" - ) - })); - const timeout = defaultValue(props.timeout, syncState == null ? void 0 : syncState.timeout, 500); - const initialState = _chunks_PNRLI7OV_spreadProps(_chunks_PNRLI7OV_spreadValues({}, popover.getState()), { - timeout, - showTimeout: defaultValue(props.showTimeout, syncState == null ? void 0 : syncState.showTimeout), - hideTimeout: defaultValue(props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout), - autoFocusOnShow: defaultValue(syncState == null ? void 0 : syncState.autoFocusOnShow, false) - }); - const hovercard = createStore(initialState, popover, props.store); - return _chunks_PNRLI7OV_spreadProps(_chunks_PNRLI7OV_spreadValues(_chunks_PNRLI7OV_spreadValues({}, popover), hovercard), { - setAutoFocusOnShow: (value) => hovercard.setState("autoFocusOnShow", value) - }); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/tooltip/tooltip-store.js - - - - - - - - -// src/tooltip/tooltip-store.ts -function createTooltipStore(props = {}) { - var _a; - const syncState = (_a = props.store) == null ? void 0 : _a.getState(); - const hovercard = createHovercardStore(_chunks_PNRLI7OV_spreadProps(_chunks_PNRLI7OV_spreadValues({}, props), { - placement: defaultValue( - props.placement, - syncState == null ? void 0 : syncState.placement, - "top" - ), - hideTimeout: defaultValue(props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout, 0) - })); - const initialState = _chunks_PNRLI7OV_spreadProps(_chunks_PNRLI7OV_spreadValues({}, hovercard.getState()), { - type: defaultValue(props.type, syncState == null ? void 0 : syncState.type, "description"), - skipTimeout: defaultValue(props.skipTimeout, syncState == null ? void 0 : syncState.skipTimeout, 300) - }); - const tooltip = createStore(initialState, hovercard, props.store); - return _chunks_PNRLI7OV_spreadValues(_chunks_PNRLI7OV_spreadValues({}, hovercard), tooltip); -} - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/tooltip/tooltip-store.js - - - - - - - - - -// src/tooltip/tooltip-store.ts - -function useTooltipStoreOptions(props) { - return useHovercardStoreOptions(props); -} -function useTooltipStoreProps(store, props) { - store = useHovercardStoreProps(store, props); - useStoreProps(store, props, "type"); - useStoreProps(store, props, "skipTimeout"); - return store; -} -function useTooltipStore(props = {}) { - const options = useTooltipStoreOptions(props); - const store = FHQZ2KRN_useStore( - () => createTooltipStore(PNRLI7OV_spreadValues(PNRLI7OV_spreadValues({}, props), options)) - ); - return useTooltipStoreProps(store, props); -} - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/BMLNRUFQ.js -// src/focusable/focusable-context.ts - -var FocusableContext = (0,external_React_.createContext)(true); - - - // EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js -var jsx_runtime = __webpack_require__(7557); -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/NQJBHION.js +var jsx_runtime = __webpack_require__(4922); +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/3ORBWXWF.js +"use client"; @@ -6516,7 +3550,7 @@ var jsx_runtime = __webpack_require__(7557); -function NQJBHION_isRenderProp(children) { +function isRenderProp(children) { return typeof children === "function"; } function forwardRef2(render) { @@ -6529,44 +3563,46 @@ function memo2(Component, propsAreEqual) { Role.displayName = Component.displayName || Component.name; return Role; } -function NQJBHION_createComponent(render) { - const Role = (props, ref) => render(PNRLI7OV_spreadValues({ ref }, props)); +function createComponent(render) { + const Role = (props, ref) => render(_4R3V3JGP_spreadValues({ ref }, props)); return external_React_.forwardRef(Role); } function createMemoComponent(render) { - const Role = NQJBHION_createComponent(render); + const Role = createComponent(render); return external_React_.memo(Role); } -function NQJBHION_createElement(Type, props) { +function _3ORBWXWF_createElement(Type, props) { const _a = props, { as: As, wrapElement, render } = _a, rest = __objRest(_a, ["as", "wrapElement", "render"]); let element; const mergedRef = useMergeRefs(props.ref, getRefProperty(render)); + if (false) {} if (As && typeof As !== "string") { - element = /* @__PURE__ */ (0,jsx_runtime.jsx)(As, PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({}, rest), { render })); + element = /* @__PURE__ */ (0,jsx_runtime.jsx)(As, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, rest), { render })); } else if (external_React_.isValidElement(render)) { - const renderProps = PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({}, render.props), { ref: mergedRef }); + const renderProps = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, render.props), { ref: mergedRef }); element = external_React_.cloneElement(render, mergeProps(rest, renderProps)); } else if (render) { element = render(rest); - } else if (NQJBHION_isRenderProp(props.children)) { + } else if (isRenderProp(props.children)) { + if (false) {} const _b = rest, { children } = _b, otherProps = __objRest(_b, ["children"]); element = props.children(otherProps); } else if (As) { - element = /* @__PURE__ */ (0,jsx_runtime.jsx)(As, PNRLI7OV_spreadValues({}, rest)); + element = /* @__PURE__ */ (0,jsx_runtime.jsx)(As, _4R3V3JGP_spreadValues({}, rest)); } else { - element = /* @__PURE__ */ (0,jsx_runtime.jsx)(Type, PNRLI7OV_spreadValues({}, rest)); + element = /* @__PURE__ */ (0,jsx_runtime.jsx)(Type, _4R3V3JGP_spreadValues({}, rest)); } if (wrapElement) { return wrapElement(element); } return element; } -function NQJBHION_createHook(useProps) { +function createHook(useProps) { const useRole = (props = {}) => { const htmlProps = useProps(props); const copy = {}; for (const prop in htmlProps) { - if (WVTCK5PV_hasOwnProperty(htmlProps, prop) && htmlProps[prop] !== void 0) { + if (Y3OOHFCN_hasOwnProperty(htmlProps, prop) && htmlProps[prop] !== void 0) { copy[prop] = htmlProps[prop]; } } @@ -6574,32 +3610,73 @@ function NQJBHION_createHook(useProps) { }; return useRole; } +function createStoreContext(providers = [], scopedProviders = []) { + const context = external_React_.createContext(void 0); + const scopedContext = external_React_.createContext(void 0); + const useContext2 = () => external_React_.useContext(context); + const useScopedContext = (onlyScoped = false) => { + const scoped = external_React_.useContext(scopedContext); + const store = useContext2(); + if (onlyScoped) + return scoped; + return scoped || store; + }; + const useProviderContext = () => { + const scoped = external_React_.useContext(scopedContext); + const store = useContext2(); + if (scoped && scoped === store) + return; + return store; + }; + const ContextProvider = (props) => { + return providers.reduceRight( + (children, Provider) => /* @__PURE__ */ (0,jsx_runtime.jsx)(Provider, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { children })), + /* @__PURE__ */ (0,jsx_runtime.jsx)(context.Provider, _4R3V3JGP_spreadValues({}, props)) + ); + }; + const ScopedContextProvider = (props) => { + return /* @__PURE__ */ (0,jsx_runtime.jsx)(ContextProvider, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { children: scopedProviders.reduceRight( + (children, Provider) => /* @__PURE__ */ (0,jsx_runtime.jsx)(Provider, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { children })), + /* @__PURE__ */ (0,jsx_runtime.jsx)(scopedContext.Provider, _4R3V3JGP_spreadValues({}, props)) + ) })); + }; + return { + context, + scopedContext, + useContext: useContext2, + useScopedContext, + useProviderContext, + ContextProvider, + ScopedContextProvider + }; +} ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/utils/focus.js +"use client"; // src/utils/focus.ts -var focus_selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])"; -function focus_hasNegativeTabIndex(element) { +var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])"; +function hasNegativeTabIndex(element) { const tabIndex = parseInt(element.getAttribute("tabindex") || "0", 10); return tabIndex < 0; } -function focus_isFocusable(element) { - if (!O35LWD4W_matches(element, focus_selector)) +function isFocusable(element) { + if (!matches(element, selector)) return false; - if (!O35LWD4W_isVisible(element)) + if (!isVisible(element)) return false; - if (O35LWD4W_closest(element, "[inert]")) + if (DLOEKDPY_closest(element, "[inert]")) return false; return true; } -function focus_isTabbable(element) { - if (!focus_isFocusable(element)) +function isTabbable(element) { + if (!isFocusable(element)) return false; - if (focus_hasNegativeTabIndex(element)) + if (hasNegativeTabIndex(element)) return false; if (!("form" in element)) return true; @@ -6614,7 +3691,7 @@ function focus_isTabbable(element) { return true; if (!("length" in radioGroup)) return true; - const activeElement = O35LWD4W_getActiveElement(element); + const activeElement = getActiveElement(element); if (!activeElement) return true; if (activeElement === element) @@ -6627,44 +3704,44 @@ function focus_isTabbable(element) { return true; return false; } -function focus_getAllFocusableIn(container, includeContainer) { +function getAllFocusableIn(container, includeContainer) { const elements = Array.from( - container.querySelectorAll(focus_selector) + container.querySelectorAll(selector) ); if (includeContainer) { elements.unshift(container); } - const focusableElements = elements.filter(focus_isFocusable); + const focusableElements = elements.filter(isFocusable); focusableElements.forEach((element, i) => { if (isFrame(element) && element.contentDocument) { const frameBody = element.contentDocument.body; - focusableElements.splice(i, 1, ...focus_getAllFocusableIn(frameBody)); + focusableElements.splice(i, 1, ...getAllFocusableIn(frameBody)); } }); return focusableElements; } function getAllFocusable(includeBody) { - return focus_getAllFocusableIn(document.body, includeBody); + return getAllFocusableIn(document.body, includeBody); } -function focus_getFirstFocusableIn(container, includeContainer) { - const [first] = focus_getAllFocusableIn(container, includeContainer); +function getFirstFocusableIn(container, includeContainer) { + const [first] = getAllFocusableIn(container, includeContainer); return first || null; } function getFirstFocusable(includeBody) { - return focus_getFirstFocusableIn(document.body, includeBody); + return getFirstFocusableIn(document.body, includeBody); } -function focus_getAllTabbableIn(container, includeContainer, fallbackToFocusable) { +function getAllTabbableIn(container, includeContainer, fallbackToFocusable) { const elements = Array.from( - container.querySelectorAll(focus_selector) + container.querySelectorAll(selector) ); - const tabbableElements = elements.filter(focus_isTabbable); - if (includeContainer && focus_isTabbable(container)) { + const tabbableElements = elements.filter(isTabbable); + if (includeContainer && isTabbable(container)) { tabbableElements.unshift(container); } tabbableElements.forEach((element, i) => { if (isFrame(element) && element.contentDocument) { const frameBody = element.contentDocument.body; - const allFrameTabbable = focus_getAllTabbableIn( + const allFrameTabbable = getAllTabbableIn( frameBody, false, fallbackToFocusable @@ -6678,10 +3755,10 @@ function focus_getAllTabbableIn(container, includeContainer, fallbackToFocusable return tabbableElements; } function getAllTabbable(fallbackToFocusable) { - return focus_getAllTabbableIn(document.body, false, fallbackToFocusable); + return getAllTabbableIn(document.body, false, fallbackToFocusable); } -function focus_getFirstTabbableIn(container, includeContainer, fallbackToFocusable) { - const [first] = focus_getAllTabbableIn( +function getFirstTabbableIn(container, includeContainer, fallbackToFocusable) { + const [first] = getAllTabbableIn( container, includeContainer, fallbackToFocusable @@ -6689,10 +3766,10 @@ function focus_getFirstTabbableIn(container, includeContainer, fallbackToFocusab return first || null; } function getFirstTabbable(fallbackToFocusable) { - return focus_getFirstTabbableIn(document.body, false, fallbackToFocusable); + return getFirstTabbableIn(document.body, false, fallbackToFocusable); } -function focus_getLastTabbableIn(container, includeContainer, fallbackToFocusable) { - const allTabbable = focus_getAllTabbableIn( +function getLastTabbableIn(container, includeContainer, fallbackToFocusable) { + const allTabbable = getAllTabbableIn( container, includeContainer, fallbackToFocusable @@ -6700,46 +3777,46 @@ function focus_getLastTabbableIn(container, includeContainer, fallbackToFocusabl return allTabbable[allTabbable.length - 1] || null; } function getLastTabbable(fallbackToFocusable) { - return focus_getLastTabbableIn(document.body, false, fallbackToFocusable); + return getLastTabbableIn(document.body, false, fallbackToFocusable); } -function focus_getNextTabbableIn(container, includeContainer, fallbackToFirst, fallbackToFocusable) { - const activeElement = O35LWD4W_getActiveElement(container); - const allFocusable = focus_getAllFocusableIn(container, includeContainer); +function getNextTabbableIn(container, includeContainer, fallbackToFirst, fallbackToFocusable) { + const activeElement = getActiveElement(container); + const allFocusable = getAllFocusableIn(container, includeContainer); const activeIndex = allFocusable.indexOf(activeElement); const nextFocusableElements = allFocusable.slice(activeIndex + 1); - return nextFocusableElements.find(focus_isTabbable) || (fallbackToFirst ? allFocusable.find(focus_isTabbable) : null) || (fallbackToFocusable ? nextFocusableElements[0] : null) || null; + return nextFocusableElements.find(isTabbable) || (fallbackToFirst ? allFocusable.find(isTabbable) : null) || (fallbackToFocusable ? nextFocusableElements[0] : null) || null; } function getNextTabbable(fallbackToFirst, fallbackToFocusable) { - return focus_getNextTabbableIn( + return getNextTabbableIn( document.body, false, fallbackToFirst, fallbackToFocusable ); } -function focus_getPreviousTabbableIn(container, includeContainer, fallbackToLast, fallbackToFocusable) { - const activeElement = O35LWD4W_getActiveElement(container); - const allFocusable = focus_getAllFocusableIn(container, includeContainer).reverse(); +function getPreviousTabbableIn(container, includeContainer, fallbackToLast, fallbackToFocusable) { + const activeElement = getActiveElement(container); + const allFocusable = getAllFocusableIn(container, includeContainer).reverse(); const activeIndex = allFocusable.indexOf(activeElement); const previousFocusableElements = allFocusable.slice(activeIndex + 1); - return previousFocusableElements.find(focus_isTabbable) || (fallbackToLast ? allFocusable.find(focus_isTabbable) : null) || (fallbackToFocusable ? previousFocusableElements[0] : null) || null; + return previousFocusableElements.find(isTabbable) || (fallbackToLast ? allFocusable.find(isTabbable) : null) || (fallbackToFocusable ? previousFocusableElements[0] : null) || null; } function getPreviousTabbable(fallbackToFirst, fallbackToFocusable) { - return focus_getPreviousTabbableIn( + return getPreviousTabbableIn( document.body, false, fallbackToFirst, fallbackToFocusable ); } -function focus_getClosestFocusable(element) { - while (element && !focus_isFocusable(element)) { - element = closest(element, focus_selector); +function getClosestFocusable(element) { + while (element && !isFocusable(element)) { + element = closest(element, selector); } return element || null; } -function focus_hasFocus(element) { - const activeElement = O35LWD4W_getActiveElement(element); +function hasFocus(element) { + const activeElement = getActiveElement(element); if (!activeElement) return false; if (activeElement === element) @@ -6749,11 +3826,11 @@ function focus_hasFocus(element) { return false; return activeDescendant === element.id; } -function focus_hasFocusWithin(element) { - const activeElement = O35LWD4W_getActiveElement(element); +function hasFocusWithin(element) { + const activeElement = getActiveElement(element); if (!activeElement) return false; - if (O35LWD4W_contains(element, activeElement)) + if (contains(element, activeElement)) return true; const activeDescendant = activeElement.getAttribute("aria-activedescendant"); if (!activeDescendant) @@ -6764,8 +3841,8 @@ function focus_hasFocusWithin(element) { return true; return !!element.querySelector(`#${CSS.escape(activeDescendant)}`); } -function focus_focusIfNeeded(element) { - if (!focus_hasFocusWithin(element) && focus_isFocusable(element)) { +function focusIfNeeded(element) { + if (!hasFocusWithin(element) && isFocusable(element)) { element.focus(); } } @@ -6776,7 +3853,7 @@ function disableFocus(element) { element.setAttribute("tabindex", "-1"); } function disableFocusIn(container, includeContainer) { - const tabbableElements = focus_getAllTabbableIn(container, includeContainer); + const tabbableElements = getAllTabbableIn(container, includeContainer); tabbableElements.forEach(disableFocus); } function restoreFocusIn(container) { @@ -6800,36 +3877,13 @@ function focusIntoView(element, options) { element.focus(); } else { element.focus({ preventScroll: true }); - element.scrollIntoView(_chunks_PNRLI7OV_spreadValues({ block: "nearest", inline: "nearest" }, options)); + element.scrollIntoView(_chunks_4R3V3JGP_spreadValues({ block: "nearest", inline: "nearest" }, options)); } } -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/UCFCIHEU.js - - -// src/utils/platform.ts -function isTouchDevice() { - return O35LWD4W_canUseDOM && !!navigator.maxTouchPoints; -} -function UCFCIHEU_isApple() { - if (!O35LWD4W_canUseDOM) - return false; - return /mac|iphone|ipad|ipod/i.test(navigator.platform); -} -function isSafari() { - return O35LWD4W_canUseDOM && UCFCIHEU_isApple() && /apple/i.test(navigator.vendor); -} -function isFirefox() { - return O35LWD4W_canUseDOM && /firefox\//i.test(navigator.userAgent); -} -function isMac() { - return O35LWD4W_canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice(); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/MYID4V27.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/KK7H3W2B.js +"use client"; @@ -6841,6 +3895,7 @@ function isMac() { + var isSafariBrowser = isSafari(); var alwaysFocusVisibleInputTypes = [ "text", @@ -6889,17 +3944,17 @@ function isNativeCheckboxOrRadio(element) { } return false; } -function MYID4V27_isNativeTabbable(tagName) { +function isNativeTabbable(tagName) { if (!tagName) return true; return tagName === "button" || tagName === "input" || tagName === "select" || tagName === "textarea" || tagName === "a"; } -function MYID4V27_supportsDisabledAttribute(tagName) { +function supportsDisabledAttribute(tagName) { if (!tagName) return true; return tagName === "button" || tagName === "input" || tagName === "select" || tagName === "textarea"; } -function MYID4V27_getTabIndex(focusable, trulyDisabled, nativeTabbable, supportsDisabled, tabIndexProp) { +function getTabIndex(focusable, trulyDisabled, nativeTabbable, supportsDisabled, tabIndexProp) { if (!focusable) { return tabIndexProp; } @@ -6914,7 +3969,7 @@ function MYID4V27_getTabIndex(focusable, trulyDisabled, nativeTabbable, supports } return tabIndexProp || 0; } -function MYID4V27_useDisableEvent(onEvent, disabled) { +function useDisableEvent(onEvent, disabled) { return useEvent((event) => { onEvent == null ? void 0 : onEvent(event); if (event.defaultPrevented) @@ -6943,7 +3998,7 @@ function onGlobalKeyDown(event) { return; isKeyboardModality = true; } -var useFocusable = NQJBHION_createHook( +var useFocusable = createHook( (_a) => { var _b = _a, { focusable = true, @@ -6984,7 +4039,7 @@ var useFocusable = NQJBHION_createHook( }; }, [focusable]); } - const disabled = focusable && props.disabled; + const disabled = focusable && disabledFromProps(props); const trulyDisabled = !!disabled && !accessibleWhenDisabled; const [focusVisible, setFocusVisible] = (0,external_React_.useState)(false); (0,external_React_.useEffect)(() => { @@ -7005,22 +4060,22 @@ var useFocusable = NQJBHION_createHook( if (typeof IntersectionObserver === "undefined") return; const observer = new IntersectionObserver(() => { - if (!focus_isFocusable(element)) { + if (!isFocusable(element)) { setFocusVisible(false); } }); observer.observe(element); return () => observer.disconnect(); }, [focusable, focusVisible]); - const onKeyPressCapture = MYID4V27_useDisableEvent( + const onKeyPressCapture = useDisableEvent( props.onKeyPressCapture, disabled ); - const onMouseDownCapture = MYID4V27_useDisableEvent( + const onMouseDownCapture = useDisableEvent( props.onMouseDownCapture, disabled ); - const onClickCapture = MYID4V27_useDisableEvent(props.onClickCapture, disabled); + const onClickCapture = useDisableEvent(props.onClickCapture, disabled); const onMouseDownProp = props.onMouseDown; const onMouseDown = useEvent((event) => { onMouseDownProp == null ? void 0 : onMouseDownProp(event); @@ -7031,9 +4086,9 @@ var useFocusable = NQJBHION_createHook( const element = event.currentTarget; if (!isSafariBrowser) return; - if (events_isPortalEvent(event)) + if (isPortalEvent(event)) return; - if (!O35LWD4W_isButton(element) && !isNativeCheckboxOrRadio(element)) + if (!isButton(element) && !isNativeCheckboxOrRadio(element)) return; let receivedFocus = false; const onFocus = () => { @@ -7045,22 +4100,22 @@ var useFocusable = NQJBHION_createHook( element.removeEventListener("focusin", onFocus, true); if (receivedFocus) return; - focus_focusIfNeeded(element); + focusIfNeeded(element); }); }); const handleFocusVisible = (event, currentTarget) => { if (currentTarget) { event.currentTarget = currentTarget; } - onFocusVisible == null ? void 0 : onFocusVisible(event); - if (event.defaultPrevented) - return; if (!focusable) return; const element = event.currentTarget; if (!element) return; - if (!focus_hasFocus(element)) + if (!hasFocus(element)) + return; + onFocusVisible == null ? void 0 : onFocusVisible(event); + if (event.defaultPrevented) return; setFocusVisible(true); }; @@ -7080,7 +4135,7 @@ var useFocusable = NQJBHION_createHook( return; if (event.ctrlKey) return; - if (!events_isSelfTarget(event)) + if (!isSelfTarget(event)) return; const element = event.currentTarget; queueMicrotask(() => handleFocusVisible(event, element)); @@ -7093,7 +4148,7 @@ var useFocusable = NQJBHION_createHook( return; if (!focusable) return; - if (!events_isSelfTarget(event)) { + if (!isSelfTarget(event)) { setFocusVisible(false); return; } @@ -7127,25 +4182,25 @@ var useFocusable = NQJBHION_createHook( if (!autoFocusOnShow) return; queueMicrotask(() => { - if (focus_hasFocus(element)) + if (hasFocus(element)) return; - if (!focus_isFocusable(element)) + if (!isFocusable(element)) return; element.focus(); }); }); const tagName = useTagName(ref, props.as); - const nativeTabbable = focusable && MYID4V27_isNativeTabbable(tagName); - const supportsDisabled = focusable && MYID4V27_supportsDisabledAttribute(tagName); - const style = trulyDisabled ? PNRLI7OV_spreadValues({ pointerEvents: "none" }, props.style) : props.style; - props = PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({ + const nativeTabbable = focusable && isNativeTabbable(tagName); + const supportsDisabled = focusable && supportsDisabledAttribute(tagName); + const style = trulyDisabled ? _4R3V3JGP_spreadValues({ pointerEvents: "none" }, props.style) : props.style; + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ "data-focus-visible": focusable && focusVisible ? "" : void 0, "data-autofocus": autoFocus ? true : void 0, "aria-disabled": disabled ? true : void 0 }, props), { ref: useMergeRefs(ref, autoFocusRef, props.ref), style, - tabIndex: MYID4V27_getTabIndex( + tabIndex: getTabIndex( focusable, trulyDisabled, nativeTabbable, @@ -7166,15 +4221,1428 @@ var useFocusable = NQJBHION_createHook( return props; } ); -var Focusable = NQJBHION_createComponent((props) => { +var Focusable = createComponent((props) => { props = useFocusable(props); - return NQJBHION_createElement("div", props); + return _3ORBWXWF_createElement("div", props); +}); +if (false) {} + + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/NWCBQ4CV.js +"use client"; + + + + + +// src/command/command.ts + + + + + +function isNativeClick(event) { + if (!event.isTrusted) + return false; + const element = event.currentTarget; + if (event.key === "Enter") { + return isButton(element) || element.tagName === "SUMMARY" || element.tagName === "A"; + } + if (event.key === " ") { + return isButton(element) || element.tagName === "SUMMARY" || element.tagName === "INPUT" || element.tagName === "SELECT"; + } + return false; +} +var symbol = Symbol("command"); +var useCommand = createHook( + (_a) => { + var _b = _a, { clickOnEnter = true, clickOnSpace = true } = _b, props = __objRest(_b, ["clickOnEnter", "clickOnSpace"]); + const ref = (0,external_React_.useRef)(null); + const tagName = useTagName(ref, props.as); + const type = props.type; + const [isNativeButton, setIsNativeButton] = (0,external_React_.useState)( + () => !!tagName && isButton({ tagName, type }) + ); + (0,external_React_.useEffect)(() => { + if (!ref.current) + return; + setIsNativeButton(isButton(ref.current)); + }, []); + const [active, setActive] = (0,external_React_.useState)(false); + const activeRef = (0,external_React_.useRef)(false); + const disabled = disabledFromProps(props); + const [isDuplicate, metadataProps] = useMetadataProps(props, symbol, true); + const onKeyDownProp = props.onKeyDown; + const onKeyDown = useEvent((event) => { + onKeyDownProp == null ? void 0 : onKeyDownProp(event); + const element = event.currentTarget; + if (event.defaultPrevented) + return; + if (isDuplicate) + return; + if (disabled) + return; + if (!isSelfTarget(event)) + return; + if (DLOEKDPY_isTextField(element)) + return; + if (element.isContentEditable) + return; + const isEnter = clickOnEnter && event.key === "Enter"; + const isSpace = clickOnSpace && event.key === " "; + const shouldPreventEnter = event.key === "Enter" && !clickOnEnter; + const shouldPreventSpace = event.key === " " && !clickOnSpace; + if (shouldPreventEnter || shouldPreventSpace) { + event.preventDefault(); + return; + } + if (isEnter || isSpace) { + const nativeClick = isNativeClick(event); + if (isEnter) { + if (!nativeClick) { + event.preventDefault(); + const _a2 = event, { view } = _a2, eventInit = __objRest(_a2, ["view"]); + const click = () => fireClickEvent(element, eventInit); + if (isFirefox()) { + queueBeforeEvent(element, "keyup", click); + } else { + queueMicrotask(click); + } + } + } else if (isSpace) { + activeRef.current = true; + if (!nativeClick) { + event.preventDefault(); + setActive(true); + } + } + } + }); + const onKeyUpProp = props.onKeyUp; + const onKeyUp = useEvent((event) => { + onKeyUpProp == null ? void 0 : onKeyUpProp(event); + if (event.defaultPrevented) + return; + if (isDuplicate) + return; + if (disabled) + return; + if (event.metaKey) + return; + const isSpace = clickOnSpace && event.key === " "; + if (activeRef.current && isSpace) { + activeRef.current = false; + if (!isNativeClick(event)) { + event.preventDefault(); + setActive(false); + const element = event.currentTarget; + const _a2 = event, { view } = _a2, eventInit = __objRest(_a2, ["view"]); + queueMicrotask(() => fireClickEvent(element, eventInit)); + } + } + }); + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues(_4R3V3JGP_spreadValues({ + "data-active": active ? "" : void 0, + type: isNativeButton ? "button" : void 0 + }, metadataProps), props), { + ref: useMergeRefs(ref, props.ref), + onKeyDown, + onKeyUp + }); + props = useFocusable(props); + return props; + } +); +var Command = createComponent((props) => { + props = useCommand(props); + return _3ORBWXWF_createElement("button", props); +}); +if (false) {} + + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/4UUKJZ4V.js +"use client"; + + +// src/collection/collection-context.tsx +var ctx = createStoreContext(); +var useCollectionContext = ctx.useContext; +var useCollectionScopedContext = ctx.useScopedContext; +var useCollectionProviderContext = ctx.useProviderContext; +var CollectionContextProvider = ctx.ContextProvider; +var CollectionScopedContextProvider = ctx.ScopedContextProvider; + + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/UH3I23HL.js +"use client"; + + + + + +// src/collection/collection-item.ts + + +var useCollectionItem = createHook( + (_a) => { + var _b = _a, { + store, + shouldRegisterItem = true, + getItem = identity, + element: element + } = _b, props = __objRest(_b, [ + "store", + "shouldRegisterItem", + "getItem", + // @ts-expect-error This prop may come from a collection renderer. + "element" + ]); + const context = useCollectionContext(); + store = store || context; + const id = useId(props.id); + const ref = (0,external_React_.useRef)(element); + (0,external_React_.useEffect)(() => { + const element2 = ref.current; + if (!id) + return; + if (!element2) + return; + if (!shouldRegisterItem) + return; + const item = getItem({ id, element: element2 }); + return store == null ? void 0 : store.renderItem(item); + }, [id, shouldRegisterItem, getItem, store]); + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { + ref: useMergeRefs(ref, props.ref) + }); + return props; + } +); +var CollectionItem = createComponent( + (props) => { + const htmlProps = useCollectionItem(props); + return _3ORBWXWF_createElement("div", htmlProps); + } +); +if (false) {} + + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/3IEDWLST.js +"use client"; + +// src/composite/utils.ts + +var NULL_ITEM = { id: null }; +function flipItems(items, activeId, shouldInsertNullItem = false) { + const index = items.findIndex((item) => item.id === activeId); + return [ + ...items.slice(index + 1), + ...shouldInsertNullItem ? [NULL_ITEM] : [], + ...items.slice(0, index) + ]; +} +function findFirstEnabledItem(items, excludeId) { + return items.find((item) => { + if (excludeId) { + return !item.disabled && item.id !== excludeId; + } + return !item.disabled; + }); +} +function getEnabledItem(store, id) { + if (!id) + return null; + return store.item(id) || null; +} +function groupItemsByRows(items) { + const rows = []; + for (const item of items) { + const row = rows.find((currentRow) => { + var _a; + return ((_a = currentRow[0]) == null ? void 0 : _a.rowId) === item.rowId; + }); + if (row) { + row.push(item); + } else { + rows.push([item]); + } + } + return rows; +} +function selectTextField(element, collapseToEnd = false) { + if (isTextField(element)) { + element.setSelectionRange( + collapseToEnd ? element.value.length : 0, + element.value.length + ); + } else if (element.isContentEditable) { + const selection = getDocument(element).getSelection(); + selection == null ? void 0 : selection.selectAllChildren(element); + if (collapseToEnd) { + selection == null ? void 0 : selection.collapseToEnd(); + } + } +} +var FOCUS_SILENTLY = Symbol("FOCUS_SILENTLY"); +function focusSilently(element) { + element[FOCUS_SILENTLY] = true; + element.focus({ preventScroll: true }); +} +function silentlyFocused(element) { + const isSilentlyFocused = element[FOCUS_SILENTLY]; + delete element[FOCUS_SILENTLY]; + return isSilentlyFocused; +} +function isItem(store, element, exclude) { + if (!element) + return false; + if (element === exclude) + return false; + const item = store.item(element.id); + if (!item) + return false; + if (exclude && item.element === exclude) + return false; + return true; +} + + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/IB7YUKH5.js +"use client"; + + + +// src/composite/composite-context.tsx + +var IB7YUKH5_ctx = createStoreContext( + [CollectionContextProvider], + [CollectionScopedContextProvider] +); +var useCompositeContext = IB7YUKH5_ctx.useContext; +var useCompositeScopedContext = IB7YUKH5_ctx.useScopedContext; +var useCompositeProviderContext = IB7YUKH5_ctx.useProviderContext; +var CompositeContextProvider = IB7YUKH5_ctx.ContextProvider; +var CompositeScopedContextProvider = IB7YUKH5_ctx.ScopedContextProvider; +var CompositeItemContext = (0,external_React_.createContext)( + void 0 +); +var CompositeRowContext = (0,external_React_.createContext)( + void 0 +); + + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/EAHJFCU4.js +"use client"; + + + +// src/utils/store.ts +function getInternal(store, key) { + const internals = store.__unstableInternals; + invariant(internals, "Invalid store"); + return internals[key]; +} +function createStore(initialState, ...stores) { + let state = initialState; + let prevStateBatch = state; + let lastUpdate = Symbol(); + let destroy = noop; + const instances = /* @__PURE__ */ new Set(); + const updatedKeys = /* @__PURE__ */ new Set(); + const setups = /* @__PURE__ */ new Set(); + const listeners = /* @__PURE__ */ new Set(); + const batchListeners = /* @__PURE__ */ new Set(); + const disposables = /* @__PURE__ */ new WeakMap(); + const listenerKeys = /* @__PURE__ */ new WeakMap(); + const storeSetup = (callback) => { + setups.add(callback); + return () => setups.delete(callback); + }; + const storeInit = () => { + const initialized = instances.size; + const instance = Symbol(); + instances.add(instance); + const maybeDestroy = () => { + instances.delete(instance); + if (instances.size) + return; + destroy(); + }; + if (initialized) + return maybeDestroy; + const desyncs = getKeys(state).map( + (key) => chain( + ...stores.map((store) => { + var _a; + const storeState = (_a = store == null ? void 0 : store.getState) == null ? void 0 : _a.call(store); + if (!storeState) + return; + if (!Y3OOHFCN_hasOwnProperty(storeState, key)) + return; + return sync(store, [key], (state2) => { + setState( + key, + state2[key], + // @ts-expect-error - Not public API. This is just to prevent + // infinite loops. + true + ); + }); + }) + ) + ); + const teardowns = []; + setups.forEach((setup2) => teardowns.push(setup2())); + const cleanups = stores.map(init); + destroy = chain(...desyncs, ...teardowns, ...cleanups); + return maybeDestroy; + }; + const sub = (keys, listener, set = listeners) => { + set.add(listener); + listenerKeys.set(listener, keys); + return () => { + var _a; + (_a = disposables.get(listener)) == null ? void 0 : _a(); + disposables.delete(listener); + listenerKeys.delete(listener); + set.delete(listener); + }; + }; + const storeSubscribe = (keys, listener) => sub(keys, listener); + const storeSync = (keys, listener) => { + disposables.set(listener, listener(state, state)); + return sub(keys, listener); + }; + const storeBatch = (keys, listener) => { + disposables.set(listener, listener(state, prevStateBatch)); + return sub(keys, listener, batchListeners); + }; + const storePick = (keys) => createStore(pick(state, keys), finalStore); + const storeOmit = (keys) => createStore(omit(state, keys), finalStore); + const getState = () => state; + const setState = (key, value, fromStores = false) => { + if (!Y3OOHFCN_hasOwnProperty(state, key)) + return; + const nextValue = Y3OOHFCN_applyState(value, state[key]); + if (nextValue === state[key]) + return; + if (!fromStores) { + stores.forEach((store) => { + var _a; + (_a = store == null ? void 0 : store.setState) == null ? void 0 : _a.call(store, key, nextValue); + }); + } + const prevState = state; + state = _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, state), { [key]: nextValue }); + const thisUpdate = Symbol(); + lastUpdate = thisUpdate; + updatedKeys.add(key); + const run = (listener, prev, uKeys) => { + var _a; + const keys = listenerKeys.get(listener); + const updated = (k) => uKeys ? uKeys.has(k) : k === key; + if (!keys || keys.some(updated)) { + (_a = disposables.get(listener)) == null ? void 0 : _a(); + disposables.set(listener, listener(state, prev)); + } + }; + listeners.forEach((listener) => { + run(listener, prevState); + }); + queueMicrotask(() => { + if (lastUpdate !== thisUpdate) + return; + const snapshot = state; + batchListeners.forEach((listener) => { + run(listener, prevStateBatch, updatedKeys); + }); + prevStateBatch = snapshot; + updatedKeys.clear(); + }); + }; + const finalStore = { + getState, + setState, + __unstableInternals: { + setup: storeSetup, + init: storeInit, + subscribe: storeSubscribe, + sync: storeSync, + batch: storeBatch, + pick: storePick, + omit: storeOmit + } + }; + return finalStore; +} +function setup(store, ...args) { + if (!store) + return; + return getInternal(store, "setup")(...args); +} +function init(store, ...args) { + if (!store) + return; + return getInternal(store, "init")(...args); +} +function EAHJFCU4_subscribe(store, ...args) { + if (!store) + return; + return getInternal(store, "subscribe")(...args); +} +function sync(store, ...args) { + if (!store) + return; + return getInternal(store, "sync")(...args); +} +function batch(store, ...args) { + if (!store) + return; + return getInternal(store, "batch")(...args); +} +function omit2(store, ...args) { + if (!store) + return; + return getInternal(store, "omit")(...args); +} +function pick2(store, ...args) { + if (!store) + return; + return getInternal(store, "pick")(...args); +} +function mergeStore(...stores) { + const initialState = stores.reduce((state, store2) => { + var _a; + const nextState = (_a = store2 == null ? void 0 : store2.getState) == null ? void 0 : _a.call(store2); + if (!nextState) + return state; + return _chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, state), nextState); + }, {}); + const store = createStore(initialState, ...stores); + return store; +} +function throwOnConflictingProps(props, store) { + if (true) + return; + if (!store) + return; + const defaultKeys = Object.entries(props).filter(([key, value]) => key.startsWith("default") && value !== void 0).map(([key]) => { + var _a; + const stateKey = key.replace("default", ""); + return `${((_a = stateKey[0]) == null ? void 0 : _a.toLowerCase()) || ""}${stateKey.slice(1)}`; + }); + if (!defaultKeys.length) + return; + const storeState = store.getState(); + const conflictingProps = defaultKeys.filter( + (key) => Y3OOHFCN_hasOwnProperty(storeState, key) + ); + if (!conflictingProps.length) + return; + throw new Error( + `Passing a store prop in conjunction with a default state is not supported. + +const store = useSelectStore(); +<SelectProvider store={store} defaultValue="Apple" /> + ^ ^ + +Instead, pass the default state to the topmost store: + +const store = useSelectStore({ defaultValue: "Apple" }); +<SelectProvider store={store} /> + +See https://github.com/ariakit/ariakit/pull/2745 for more details. + +If there's a particular need for this, please submit a feature request at https://github.com/ariakit/ariakit +` + ); +} + + + +// EXTERNAL MODULE: ./node_modules/use-sync-external-store/shim/index.js +var shim = __webpack_require__(422); +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/EKQEJRUF.js +"use client"; + + + +// src/utils/store.tsx + + + + +var { useSyncExternalStore } = shim; +var noopSubscribe = () => () => { +}; +function useStoreState(store, keyOrSelector = identity) { + const storeSubscribe = external_React_.useCallback( + (callback) => { + if (!store) + return noopSubscribe(); + return EAHJFCU4_subscribe(store, null, callback); + }, + [store] + ); + const getSnapshot = () => { + const key = typeof keyOrSelector === "string" ? keyOrSelector : null; + const selector = typeof keyOrSelector === "function" ? keyOrSelector : null; + const state = store == null ? void 0 : store.getState(); + if (selector) + return selector(state); + if (!state) + return; + if (!key) + return; + if (!Y3OOHFCN_hasOwnProperty(state, key)) + return; + return state[key]; + }; + return useSyncExternalStore(storeSubscribe, getSnapshot, getSnapshot); +} +function useStoreProps(store, props, key, setKey) { + const value = Y3OOHFCN_hasOwnProperty(props, key) ? props[key] : void 0; + const setValue = setKey ? props[setKey] : void 0; + const propsRef = useLiveRef({ value, setValue }); + useSafeLayoutEffect(() => { + return sync(store, [key], (state, prev) => { + const { value: value2, setValue: setValue2 } = propsRef.current; + if (!setValue2) + return; + if (state[key] === prev[key]) + return; + if (state[key] === value2) + return; + setValue2(state[key]); + }); + }, [store, key]); + useSafeLayoutEffect(() => { + if (value === void 0) + return; + store.setState(key, value); + return batch(store, [key], () => { + if (value === void 0) + return; + store.setState(key, value); + }); + }); +} +function EKQEJRUF_useStore(createStore, props) { + const [store, setStore] = external_React_.useState(() => createStore(props)); + useSafeLayoutEffect(() => init(store), [store]); + const useState2 = external_React_.useCallback( + (keyOrSelector) => useStoreState(store, keyOrSelector), + [store] + ); + const memoizedStore = external_React_.useMemo( + () => _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, store), { useState: useState2 }), + [store, useState2] + ); + const updateStore = useEvent(() => { + setStore((store2) => createStore(_4R3V3JGP_spreadValues(_4R3V3JGP_spreadValues({}, props), store2.getState()))); + }); + return [memoizedStore, updateStore]; +} + + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/QZLXIDNP.js +"use client"; + + + + + + + + + +// src/composite/composite-item.tsx + + + + + +function isEditableElement(element) { + if (element.isContentEditable) + return true; + if (DLOEKDPY_isTextField(element)) + return true; + return element.tagName === "INPUT" && !isButton(element); +} +function getNextPageOffset(scrollingElement, pageUp = false) { + const height = scrollingElement.clientHeight; + const { top } = scrollingElement.getBoundingClientRect(); + const pageSize = Math.max(height * 0.875, height - 40) * 1.5; + const pageOffset = pageUp ? height - pageSize + top : pageSize + top; + if (scrollingElement.tagName === "HTML") { + return pageOffset + scrollingElement.scrollTop; + } + return pageOffset; +} +function getItemOffset(itemElement, pageUp = false) { + const { top } = itemElement.getBoundingClientRect(); + if (pageUp) { + return top + itemElement.clientHeight; + } + return top; +} +function findNextPageItemId(element, store, next, pageUp = false) { + var _a; + if (!store) + return; + if (!next) + return; + const { renderedItems } = store.getState(); + const scrollingElement = getScrollingElement(element); + if (!scrollingElement) + return; + const nextPageOffset = getNextPageOffset(scrollingElement, pageUp); + let id; + let prevDifference; + for (let i = 0; i < renderedItems.length; i += 1) { + const previousId = id; + id = next(i); + if (!id) + break; + if (id === previousId) + continue; + const itemElement = (_a = getEnabledItem(store, id)) == null ? void 0 : _a.element; + if (!itemElement) + continue; + const itemOffset = getItemOffset(itemElement, pageUp); + const difference = itemOffset - nextPageOffset; + const absDifference = Math.abs(difference); + if (pageUp && difference <= 0 || !pageUp && difference >= 0) { + if (prevDifference !== void 0 && prevDifference < absDifference) { + id = previousId; + } + break; + } + prevDifference = absDifference; + } + return id; +} +function targetIsAnotherItem(event, store) { + if (isSelfTarget(event)) + return false; + return isItem(store, event.target); +} +function useRole(ref, props) { + const roleProp = props.role; + const [role, setRole] = (0,external_React_.useState)(roleProp); + useSafeLayoutEffect(() => { + const element = ref.current; + if (!element) + return; + setRole(element.getAttribute("role") || roleProp); + }, [roleProp]); + return role; +} +function requiresAriaSelected(role) { + return role === "option" || role === "treeitem"; +} +function supportsAriaSelected(role) { + if (role === "option") + return true; + if (role === "tab") + return true; + if (role === "treeitem") + return true; + if (role === "gridcell") + return true; + if (role === "row") + return true; + if (role === "columnheader") + return true; + if (role === "rowheader") + return true; + return false; +} +var useCompositeItem = createHook( + (_a) => { + var _b = _a, { + store, + rowId: rowIdProp, + preventScrollOnKeyDown = false, + moveOnKeyPress = true, + tabbable = false, + getItem: getItemProp, + "aria-setsize": ariaSetSizeProp, + "aria-posinset": ariaPosInSetProp + } = _b, props = __objRest(_b, [ + "store", + "rowId", + "preventScrollOnKeyDown", + "moveOnKeyPress", + "tabbable", + "getItem", + "aria-setsize", + "aria-posinset" + ]); + const context = useCompositeContext(); + store = store || context; + const id = useId(props.id); + const ref = (0,external_React_.useRef)(null); + const row = (0,external_React_.useContext)(CompositeRowContext); + const rowId = useStoreState(store, (state) => { + if (rowIdProp) + return rowIdProp; + if (!state) + return; + if (!(row == null ? void 0 : row.baseElement)) + return; + if (row.baseElement !== state.baseElement) + return; + return row.id; + }); + const disabled = disabledFromProps(props); + const trulyDisabled = disabled && !props.accessibleWhenDisabled; + const getItem = (0,external_React_.useCallback)( + (item) => { + const nextItem = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, item), { + id: id || item.id, + rowId, + disabled: !!trulyDisabled + }); + if (getItemProp) { + return getItemProp(nextItem); + } + return nextItem; + }, + [id, rowId, trulyDisabled, getItemProp] + ); + const onFocusProp = props.onFocus; + const hasFocusedComposite = (0,external_React_.useRef)(false); + const onFocus = useEvent((event) => { + onFocusProp == null ? void 0 : onFocusProp(event); + if (event.defaultPrevented) + return; + if (isPortalEvent(event)) + return; + if (!id) + return; + if (!store) + return; + const { activeId, virtualFocus: virtualFocus2, baseElement: baseElement2 } = store.getState(); + if (targetIsAnotherItem(event, store)) + return; + if (activeId !== id) { + store.setActiveId(id); + } + if (!virtualFocus2) + return; + if (!isSelfTarget(event)) + return; + if (isEditableElement(event.currentTarget)) + return; + if (!(baseElement2 == null ? void 0 : baseElement2.isConnected)) + return; + hasFocusedComposite.current = true; + const fromComposite = event.relatedTarget === baseElement2 || isItem(store, event.relatedTarget); + if (fromComposite) { + focusSilently(baseElement2); + } else { + baseElement2.focus(); + } + }); + const onBlurCaptureProp = props.onBlurCapture; + const onBlurCapture = useEvent((event) => { + onBlurCaptureProp == null ? void 0 : onBlurCaptureProp(event); + if (event.defaultPrevented) + return; + const state = store == null ? void 0 : store.getState(); + if ((state == null ? void 0 : state.virtualFocus) && hasFocusedComposite.current) { + hasFocusedComposite.current = false; + event.preventDefault(); + event.stopPropagation(); + } + }); + const onKeyDownProp = props.onKeyDown; + const preventScrollOnKeyDownProp = useBooleanEvent(preventScrollOnKeyDown); + const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress); + const onKeyDown = useEvent((event) => { + onKeyDownProp == null ? void 0 : onKeyDownProp(event); + if (event.defaultPrevented) + return; + if (!isSelfTarget(event)) + return; + if (!store) + return; + const { currentTarget } = event; + const state = store.getState(); + const item = store.item(id); + const isGrid = !!(item == null ? void 0 : item.rowId); + const isVertical = state.orientation !== "horizontal"; + const isHorizontal = state.orientation !== "vertical"; + const canHomeEnd = () => { + if (isGrid) + return true; + if (isHorizontal) + return true; + if (!state.baseElement) + return true; + if (!DLOEKDPY_isTextField(state.baseElement)) + return true; + return false; + }; + const keyMap = { + ArrowUp: (isGrid || isVertical) && store.up, + ArrowRight: (isGrid || isHorizontal) && store.next, + ArrowDown: (isGrid || isVertical) && store.down, + ArrowLeft: (isGrid || isHorizontal) && store.previous, + Home: () => { + if (!canHomeEnd()) + return; + if (!isGrid || event.ctrlKey) { + return store == null ? void 0 : store.first(); + } + return store == null ? void 0 : store.previous(-1); + }, + End: () => { + if (!canHomeEnd()) + return; + if (!isGrid || event.ctrlKey) { + return store == null ? void 0 : store.last(); + } + return store == null ? void 0 : store.next(-1); + }, + PageUp: () => { + return findNextPageItemId(currentTarget, store, store == null ? void 0 : store.up, true); + }, + PageDown: () => { + return findNextPageItemId(currentTarget, store, store == null ? void 0 : store.down); + } + }; + const action = keyMap[event.key]; + if (action) { + const nextId = action(); + if (preventScrollOnKeyDownProp(event) || nextId !== void 0) { + if (!moveOnKeyPressProp(event)) + return; + event.preventDefault(); + store.move(nextId); + } + } + }); + const baseElement = useStoreState( + store, + (state) => (state == null ? void 0 : state.baseElement) || void 0 + ); + const providerValue = (0,external_React_.useMemo)( + () => ({ id, baseElement }), + [id, baseElement] + ); + props = useWrapElement( + props, + (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(CompositeItemContext.Provider, { value: providerValue, children: element }), + [providerValue] + ); + const isActiveItem = useStoreState( + store, + (state) => !!state && state.activeId === id + ); + const virtualFocus = useStoreState(store, "virtualFocus"); + const role = useRole(ref, props); + let ariaSelected; + if (isActiveItem) { + if (requiresAriaSelected(role)) { + ariaSelected = true; + } else if (virtualFocus && supportsAriaSelected(role)) { + ariaSelected = true; + } + } + const ariaSetSize = useStoreState(store, (state) => { + if (ariaSetSizeProp != null) + return ariaSetSizeProp; + if (!state) + return; + if (!(row == null ? void 0 : row.ariaSetSize)) + return; + if (row.baseElement !== state.baseElement) + return; + return row.ariaSetSize; + }); + const ariaPosInSet = useStoreState(store, (state) => { + if (ariaPosInSetProp != null) + return ariaPosInSetProp; + if (!state) + return; + if (!(row == null ? void 0 : row.ariaPosInSet)) + return; + if (row.baseElement !== state.baseElement) + return; + const itemsInRow = state.renderedItems.filter( + (item) => item.rowId === rowId + ); + return row.ariaPosInSet + itemsInRow.findIndex((item) => item.id === id); + }); + const isTabbable = useStoreState(store, (state) => { + if (!(state == null ? void 0 : state.renderedItems.length)) + return true; + if (state.virtualFocus) + return false; + if (tabbable) + return true; + return state.activeId === id; + }); + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ + id, + "aria-selected": ariaSelected, + "data-active-item": isActiveItem ? "" : void 0 + }, props), { + ref: useMergeRefs(ref, props.ref), + tabIndex: isTabbable ? props.tabIndex : -1, + onFocus, + onBlurCapture, + onKeyDown + }); + props = useCommand(props); + props = useCollectionItem(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ + store + }, props), { + getItem, + shouldRegisterItem: !!id ? props.shouldRegisterItem : false + })); + return _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { + "aria-setsize": ariaSetSize, + "aria-posinset": ariaPosInSet + }); + } +); +var CompositeItem = createMemoComponent( + (props) => { + const htmlProps = useCompositeItem(props); + return _3ORBWXWF_createElement("button", htmlProps); + } +); +if (false) {} + + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/Z5IGYIPT.js +"use client"; + + + + +// src/disclosure/disclosure-store.ts +function createDisclosureStore(props = {}) { + const store = mergeStore( + props.store, + omit2(props.disclosure, ["contentElement", "disclosureElement"]) + ); + throwOnConflictingProps(props, store); + const syncState = store == null ? void 0 : store.getState(); + const open = defaultValue( + props.open, + syncState == null ? void 0 : syncState.open, + props.defaultOpen, + false + ); + const animated = defaultValue(props.animated, syncState == null ? void 0 : syncState.animated, false); + const initialState = { + open, + animated, + animating: !!animated && open, + mounted: open, + contentElement: defaultValue(syncState == null ? void 0 : syncState.contentElement, null), + disclosureElement: defaultValue(syncState == null ? void 0 : syncState.disclosureElement, null) + }; + const disclosure = createStore(initialState, store); + setup( + disclosure, + () => sync(disclosure, ["animated", "animating"], (state) => { + if (state.animated) + return; + disclosure.setState("animating", false); + }) + ); + setup( + disclosure, + () => EAHJFCU4_subscribe(disclosure, ["open"], () => { + if (!disclosure.getState().animated) + return; + disclosure.setState("animating", true); + }) + ); + setup( + disclosure, + () => sync(disclosure, ["open", "animating"], (state) => { + disclosure.setState("mounted", state.open || state.animating); + }) + ); + return _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, disclosure), { + setOpen: (value) => disclosure.setState("open", value), + show: () => disclosure.setState("open", true), + hide: () => disclosure.setState("open", false), + toggle: () => disclosure.setState("open", (open2) => !open2), + stopAnimation: () => disclosure.setState("animating", false), + setContentElement: (value) => disclosure.setState("contentElement", value), + setDisclosureElement: (value) => disclosure.setState("disclosureElement", value) + }); +} + + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/SFCBA2JZ.js +"use client"; + + + +// src/disclosure/disclosure-store.ts + +function useDisclosureStoreProps(store, update, props) { + useUpdateEffect(update, [props.store, props.disclosure]); + useStoreProps(store, props, "open", "setOpen"); + useStoreProps(store, props, "mounted", "setMounted"); + useStoreProps(store, props, "animated"); + return store; +} +function useDisclosureStore(props = {}) { + const [store, update] = EKQEJRUF_useStore(createDisclosureStore, props); + return useDisclosureStoreProps(store, update, props); +} + + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/SX2XFD6A.js +"use client"; + + +// src/dialog/dialog-store.ts +function createDialogStore(props = {}) { + return createDisclosureStore(props); +} + + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/ZSELSBRM.js +"use client"; + + + +// src/dialog/dialog-store.ts + +function useDialogStoreProps(store, update, props) { + return useDisclosureStoreProps(store, update, props); +} +function useDialogStore(props = {}) { + const [store, update] = EKQEJRUF_useStore(createDialogStore, props); + return useDialogStoreProps(store, update, props); +} + + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/MG4P3223.js +"use client"; + + + + +// src/popover/popover-store.ts + +function usePopoverStoreProps(store, update, props) { + useUpdateEffect(update, [props.popover]); + store = useDialogStoreProps(store, update, props); + useStoreProps(store, props, "placement"); + return store; +} +function usePopoverStore(props = {}) { + const [store, update] = useStore(Core.createPopoverStore, props); + return usePopoverStoreProps(store, update, props); +} + + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/ZU7LQC5V.js +"use client"; + + + +// src/hovercard/hovercard-store.ts + +function useHovercardStoreProps(store, update, props) { + store = usePopoverStoreProps(store, update, props); + useStoreProps(store, props, "timeout"); + useStoreProps(store, props, "showTimeout"); + useStoreProps(store, props, "hideTimeout"); + return store; +} +function useHovercardStore(props = {}) { + const [store, update] = useStore(Core.createHovercardStore, props); + return useHovercardStoreProps(store, update, props); +} + + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/AF6IUUFN.js +"use client"; + + + + + +// src/popover/popover-store.ts +function createPopoverStore(_a = {}) { + var _b = _a, { + popover: otherPopover + } = _b, props = _4R3V3JGP_objRest(_b, [ + "popover" + ]); + const store = mergeStore( + props.store, + omit2(otherPopover, [ + "arrowElement", + "anchorElement", + "contentElement", + "popoverElement", + "disclosureElement" + ]) + ); + throwOnConflictingProps(props, store); + const syncState = store == null ? void 0 : store.getState(); + const dialog = createDialogStore(_chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, props), { store })); + const placement = defaultValue( + props.placement, + syncState == null ? void 0 : syncState.placement, + "bottom" + ); + const initialState = _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, dialog.getState()), { + placement, + currentPlacement: placement, + anchorElement: defaultValue(syncState == null ? void 0 : syncState.anchorElement, null), + popoverElement: defaultValue(syncState == null ? void 0 : syncState.popoverElement, null), + arrowElement: defaultValue(syncState == null ? void 0 : syncState.arrowElement, null), + rendered: Symbol("rendered") + }); + const popover = createStore(initialState, dialog, store); + return _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, dialog), popover), { + setAnchorElement: (element) => popover.setState("anchorElement", element), + setPopoverElement: (element) => popover.setState("popoverElement", element), + setArrowElement: (element) => popover.setState("arrowElement", element), + render: () => popover.setState("rendered", Symbol("rendered")) + }); +} + + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/SOLWE6E5.js +"use client"; + + + + + +// src/hovercard/hovercard-store.ts +function createHovercardStore(props = {}) { + var _a; + const syncState = (_a = props.store) == null ? void 0 : _a.getState(); + const popover = createPopoverStore(_chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, props), { + placement: defaultValue( + props.placement, + syncState == null ? void 0 : syncState.placement, + "bottom" + ) + })); + const timeout = defaultValue(props.timeout, syncState == null ? void 0 : syncState.timeout, 500); + const initialState = _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, popover.getState()), { + timeout, + showTimeout: defaultValue(props.showTimeout, syncState == null ? void 0 : syncState.showTimeout), + hideTimeout: defaultValue(props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout), + autoFocusOnShow: defaultValue(syncState == null ? void 0 : syncState.autoFocusOnShow, false) + }); + const hovercard = createStore(initialState, popover, props.store); + return _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, popover), hovercard), { + setAutoFocusOnShow: (value) => hovercard.setState("autoFocusOnShow", value) + }); +} + + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/tooltip/tooltip-store.js +"use client"; + + + + + + + + +// src/tooltip/tooltip-store.ts +function createTooltipStore(props = {}) { + var _a; + const syncState = (_a = props.store) == null ? void 0 : _a.getState(); + const hovercard = createHovercardStore(_chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, props), { + placement: defaultValue( + props.placement, + syncState == null ? void 0 : syncState.placement, + "top" + ), + hideTimeout: defaultValue(props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout, 0) + })); + const initialState = _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, hovercard.getState()), { + type: defaultValue(props.type, syncState == null ? void 0 : syncState.type, "description"), + skipTimeout: defaultValue(props.skipTimeout, syncState == null ? void 0 : syncState.skipTimeout, 300) + }); + const tooltip = createStore(initialState, hovercard, props.store); + return _chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, hovercard), tooltip); +} + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/2QMN5E6B.js +"use client"; + + + +// src/tooltip/tooltip-store.ts + +function useTooltipStoreProps(store, update, props) { + store = useHovercardStoreProps(store, update, props); + useStoreProps(store, props, "type"); + useStoreProps(store, props, "skipTimeout"); + return store; +} +function useTooltipStore(props = {}) { + const [store, update] = EKQEJRUF_useStore(createTooltipStore, props); + return useTooltipStoreProps(store, update, props); +} + + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/FSFPRQFR.js +"use client"; + + +// src/role/role.ts +var FSFPRQFR_elements = [ + "a", + "button", + "details", + "dialog", + "div", + "form", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "header", + "img", + "input", + "label", + "li", + "nav", + "ol", + "p", + "section", + "select", + "span", + "textarea", + "ul", + "svg" +]; +var FSFPRQFR_useRole = createHook((props) => { + return props; +}); +var Role = createComponent((props) => { + return _3ORBWXWF_createElement("div", props); }); if (false) {} +Object.assign( + Role, + FSFPRQFR_elements.reduce((acc, element) => { + acc[element] = createComponent((props) => { + return _3ORBWXWF_createElement(element, props); + }); + return acc; + }, {}) +); + + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/OAYFXAQ2.js +"use client"; + + +// src/disclosure/disclosure-context.tsx +var OAYFXAQ2_ctx = createStoreContext(); +var useDisclosureContext = OAYFXAQ2_ctx.useContext; +var useDisclosureScopedContext = OAYFXAQ2_ctx.useScopedContext; +var useDisclosureProviderContext = OAYFXAQ2_ctx.useProviderContext; +var DisclosureContextProvider = OAYFXAQ2_ctx.ContextProvider; +var DisclosureScopedContextProvider = OAYFXAQ2_ctx.ScopedContextProvider; + + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/G6BJYYBK.js +"use client"; + + + +// src/dialog/dialog-context.tsx + +var G6BJYYBK_ctx = createStoreContext( + [DisclosureContextProvider], + [DisclosureScopedContextProvider] +); +var useDialogContext = G6BJYYBK_ctx.useContext; +var useDialogScopedContext = G6BJYYBK_ctx.useScopedContext; +var useDialogProviderContext = G6BJYYBK_ctx.useProviderContext; +var DialogContextProvider = G6BJYYBK_ctx.ContextProvider; +var DialogScopedContextProvider = G6BJYYBK_ctx.ScopedContextProvider; +var DialogHeadingContext = (0,external_React_.createContext)(void 0); +var DialogDescriptionContext = (0,external_React_.createContext)(void 0); + + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/7H5KSHHF.js +"use client"; + + + +// src/popover/popover-context.tsx +var _7H5KSHHF_ctx = createStoreContext( + [DialogContextProvider], + [DialogScopedContextProvider] +); +var usePopoverContext = _7H5KSHHF_ctx.useContext; +var usePopoverScopedContext = _7H5KSHHF_ctx.useScopedContext; +var usePopoverProviderContext = _7H5KSHHF_ctx.useProviderContext; +var PopoverContextProvider = _7H5KSHHF_ctx.ContextProvider; +var PopoverScopedContextProvider = _7H5KSHHF_ctx.ScopedContextProvider; + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/TI7CMBHW.js +"use client"; -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/I3PXTXPI.js + +// src/hovercard/hovercard-context.tsx +var TI7CMBHW_ctx = createStoreContext( + [PopoverContextProvider], + [PopoverScopedContextProvider] +); +var useHovercardContext = TI7CMBHW_ctx.useContext; +var useHovercardScopedContext = TI7CMBHW_ctx.useScopedContext; +var useHovercardProviderContext = TI7CMBHW_ctx.useProviderContext; +var HovercardContextProvider = TI7CMBHW_ctx.ContextProvider; +var HovercardScopedContextProvider = TI7CMBHW_ctx.ScopedContextProvider; + + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/7X4DYKYU.js +"use client"; + @@ -7183,14 +5651,23 @@ if (false) {} // src/hovercard/hovercard-anchor.ts -var useHovercardAnchor = NQJBHION_createHook( + +var useHovercardAnchor = createHook( (_a) => { var _b = _a, { store, showOnHover = true } = _b, props = __objRest(_b, ["store", "showOnHover"]); - const disabled = props.disabled || props["aria-disabled"] === true || props["aria-disabled"] === "true"; + const context = useHovercardProviderContext(); + store = store || context; + invariant( + store, + false && 0 + ); + const disabled = disabledFromProps(props); const showTimeoutRef = (0,external_React_.useRef)(0); (0,external_React_.useEffect)(() => () => window.clearTimeout(showTimeoutRef.current), []); (0,external_React_.useEffect)(() => { const onMouseLeave = (event) => { + if (!store) + return; const { anchorElement } = store.getState(); if (!anchorElement) return; @@ -7206,10 +5683,11 @@ var useHovercardAnchor = NQJBHION_createHook( const isMouseMoving = useIsMouseMoving(); const onMouseMove = useEvent( (event) => { - store.setAnchorElement(event.currentTarget); onMouseMoveProp == null ? void 0 : onMouseMoveProp(event); if (disabled) return; + if (!store) + return; if (event.defaultPrevented) return; if (showTimeoutRef.current) @@ -7218,34 +5696,82 @@ var useHovercardAnchor = NQJBHION_createHook( return; if (!showOnHoverProp(event)) return; + const element = event.currentTarget; + store.setAnchorElement(element); + store.setDisclosureElement(element); const { showTimeout, timeout } = store.getState(); - showTimeoutRef.current = window.setTimeout(() => { + const showHovercard = () => { showTimeoutRef.current = 0; if (!isMouseMoving()) return; - store.show(); - }, showTimeout != null ? showTimeout : timeout); + store == null ? void 0 : store.setAnchorElement(element); + store == null ? void 0 : store.show(); + queueMicrotask(() => { + store == null ? void 0 : store.setDisclosureElement(element); + }); + }; + const timeoutMs = showTimeout != null ? showTimeout : timeout; + if (timeoutMs === 0) { + showHovercard(); + } else { + showTimeoutRef.current = window.setTimeout(showHovercard, timeoutMs); + } } ); - props = PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({}, props), { - ref: useMergeRefs(store.setAnchorElement, props.ref), + const ref = (0,external_React_.useCallback)( + (element) => { + if (!store) + return; + const { anchorElement } = store.getState(); + if (anchorElement == null ? void 0 : anchorElement.isConnected) + return; + store.setAnchorElement(element); + }, + [store] + ); + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { + ref: useMergeRefs(ref, props.ref), onMouseMove }); props = useFocusable(props); return props; } ); -var HovercardAnchor = NQJBHION_createComponent( +var HovercardAnchor = createComponent( (props) => { const htmlProps = useHovercardAnchor(props); - return NQJBHION_createElement("a", htmlProps); + return _3ORBWXWF_createElement("a", htmlProps); } ); if (false) {} +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/MNFF5YOJ.js +"use client"; + + + +// src/tooltip/tooltip-context.tsx +var MNFF5YOJ_ctx = createStoreContext( + [HovercardContextProvider], + [HovercardScopedContextProvider] +); +var useTooltipContext = MNFF5YOJ_ctx.useContext; +var useTooltipScopedContext = MNFF5YOJ_ctx.useScopedContext; +var useTooltipProviderContext = MNFF5YOJ_ctx.useProviderContext; +var TooltipContextProvider = MNFF5YOJ_ctx.ContextProvider; +var TooltipScopedContextProvider = MNFF5YOJ_ctx.ScopedContextProvider; + + + ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/tooltip/tooltip-anchor.js +"use client"; + + + + + @@ -7261,37 +5787,55 @@ if (false) {} var globalStore = createStore({ activeStore: null }); -var useTooltipAnchor = NQJBHION_createHook( +var useTooltipAnchor = createHook( (_a) => { var _b = _a, { store, showOnHover = true } = _b, props = __objRest(_b, ["store", "showOnHover"]); + const context = useTooltipProviderContext(); + store = store || context; + invariant( + store, + false && 0 + ); + const canShowOnHoverRef = (0,external_React_.useRef)(false); (0,external_React_.useEffect)(() => { - return store.sync( - (state) => { - if (state.mounted) { - const { activeStore } = globalStore.getState(); - if (activeStore !== store) { - activeStore == null ? void 0 : activeStore.hide(); - } - return globalStore.setState("activeStore", store); + return sync(store, ["mounted"], (state) => { + if (state.mounted) + return; + canShowOnHoverRef.current = false; + }); + }, [store]); + (0,external_React_.useEffect)(() => { + return sync(store, ["mounted", "skipTimeout"], (state) => { + if (!store) + return; + if (state.mounted) { + const { activeStore } = globalStore.getState(); + if (activeStore !== store) { + activeStore == null ? void 0 : activeStore.hide(); } - const id = setTimeout(() => { - const { activeStore } = globalStore.getState(); - if (activeStore !== store) - return; - globalStore.setState("activeStore", null); - }, state.skipTimeout); - return () => clearTimeout(id); - }, - ["mounted", "skipTimeout"] - ); + return globalStore.setState("activeStore", store); + } + const id = setTimeout(() => { + const { activeStore } = globalStore.getState(); + if (activeStore !== store) + return; + globalStore.setState("activeStore", null); + }, state.skipTimeout); + return () => clearTimeout(id); + }); }, [store]); + const onMouseEnterProp = props.onMouseEnter; + const onMouseEnter = useEvent((event) => { + onMouseEnterProp == null ? void 0 : onMouseEnterProp(event); + canShowOnHoverRef.current = true; + }); const onFocusVisibleProp = props.onFocusVisible; const onFocusVisible = useEvent((event) => { onFocusVisibleProp == null ? void 0 : onFocusVisibleProp(event); if (event.defaultPrevented) return; - store.setAnchorElement(event.currentTarget); - store.show(); + store == null ? void 0 : store.setAnchorElement(event.currentTarget); + store == null ? void 0 : store.show(); }); const onBlurProp = props.onBlur; const onBlur = useEvent((event) => { @@ -7308,36 +5852,41 @@ var useTooltipAnchor = NQJBHION_createHook( var _a2; return (_a2 = state.contentElement) == null ? void 0 : _a2.id; }); - props = PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({ + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ "aria-labelledby": type === "label" ? contentId : void 0, "aria-describedby": type === "description" ? contentId : void 0 }, props), { + onMouseEnter, onFocusVisible, onBlur }); - props = useHovercardAnchor(PNRLI7OV_spreadValues({ + props = useHovercardAnchor(_4R3V3JGP_spreadValues({ store, showOnHover: (event) => { + if (!canShowOnHoverRef.current) + return false; if (isFalsyBooleanCallback(showOnHover, event)) return false; const { activeStore } = globalStore.getState(); if (!activeStore) return true; - store.show(); + store == null ? void 0 : store.show(); return false; } }, props)); return props; } ); -var TooltipAnchor = NQJBHION_createComponent((props) => { +var TooltipAnchor = createComponent((props) => { const htmlProps = useTooltipAnchor(props); - return NQJBHION_createElement("div", htmlProps); + return _3ORBWXWF_createElement("div", htmlProps); }); if (false) {} -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/X7FKJQME.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/YMV43K4F.js +"use client"; + // src/hovercard/utils/polygon.ts function getEventPoint(event) { return [event.clientX, event.clientY]; @@ -7422,9 +5971,11 @@ function getElementPolygon(element, enterPoint) { -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/IXXFVVA2.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/MKDDWKFK.js +"use client"; + // src/dialog/utils/is-backdrop.ts -function isBackdrop(element, ...ids) { +function MKDDWKFK_isBackdrop(element, ...ids) { if (!element) return false; const backdrop = element.getAttribute("data-backdrop"); @@ -7441,7 +5992,9 @@ function isBackdrop(element, ...ids) { -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/FW6QFGFT.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/X6WIMZJE.js +"use client"; + // src/dialog/utils/orchestrate.ts var cleanups = /* @__PURE__ */ new WeakMap(); function orchestrate(element, key, setup) { @@ -7535,18 +6088,42 @@ function setCSSProperty(element, property, value) { -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/FV23EKJL.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/72E5EPFF.js +"use client"; + + // src/dialog/utils/walk-tree-outside.ts + var ignoreTags = ["SCRIPT", "STYLE"]; -function isValidElement(element, ignoredElements) { +function getSnapshotPropertyName(id) { + return `__ariakit-dialog-snapshot-${id}`; +} +function inSnapshot(id, element) { + const doc = DLOEKDPY_getDocument(element); + const propertyName = getSnapshotPropertyName(id); + if (!doc.body[propertyName]) + return true; + do { + if (element === doc.body) + return false; + if (!!element[propertyName]) + return true; + if (!element.parentElement) + return false; + element = element.parentElement; + } while (true); +} +function isValidElement(id, element, ignoredElements) { if (ignoreTags.includes(element.tagName)) return false; + if (!inSnapshot(id, element)) + return false; return !ignoredElements.some( - (enabledElement) => enabledElement && O35LWD4W_contains(element, enabledElement) + (enabledElement) => enabledElement && contains(element, enabledElement) ); } -function walkTreeOutside(elements, callback, ancestorCallback) { +function _72E5EPFF_walkTreeOutside(id, elements, callback, ancestorCallback) { for (let element of elements) { if (!(element == null ? void 0 : element.isConnected)) continue; @@ -7557,13 +6134,14 @@ function walkTreeOutside(elements, callback, ancestorCallback) { return false; return maybeAncestor.contains(element); }); - const doc = O35LWD4W_getDocument(element); + const doc = DLOEKDPY_getDocument(element); + const originalElement = element; while (element.parentElement && element !== doc.body) { - ancestorCallback == null ? void 0 : ancestorCallback(element.parentElement); + ancestorCallback == null ? void 0 : ancestorCallback(element.parentElement, originalElement); if (!hasAncestorAlready) { for (const child of element.parentElement.children) { - if (isValidElement(child, elements)) { - callback(child); + if (isValidElement(id, child, elements)) { + callback(child, originalElement); } } } @@ -7571,10 +6149,23 @@ function walkTreeOutside(elements, callback, ancestorCallback) { } } } +function createWalkTreeSnapshot(id, elements) { + const { body } = DLOEKDPY_getDocument(elements[0]); + const cleanups = []; + const markElement = (element) => { + cleanups.push(setProperty(element, getSnapshotPropertyName(id), true)); + }; + _72E5EPFF_walkTreeOutside(id, elements, markElement); + return chain( + setProperty(body, getSnapshotPropertyName(id), true), + () => cleanups.forEach((fn) => fn()) + ); +} -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/HCZMY53N.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/TL67WVI6.js +"use client"; @@ -7609,17 +6200,23 @@ function isElementMarked(element, id) { element = element.parentElement; } while (true); } -function markTreeOutside(dialogId, ...elements) { +function markTreeOutside(id, elements) { const cleanups = []; const ids = elements.map((el) => el == null ? void 0 : el.id); - walkTreeOutside( + _72E5EPFF_walkTreeOutside( + id, elements, (element) => { - if (isBackdrop(element, ...ids)) + if (MKDDWKFK_isBackdrop(element, ...ids)) return; - cleanups.unshift(markElement(element, dialogId)); + cleanups.unshift(markElement(element, id)); }, - (ancestor) => cleanups.unshift(markAncestor(ancestor, dialogId)) + (ancestor, element) => { + const isAnotherDialogAncestor = element.hasAttribute("data-dialog") && element.id !== id; + if (isAnotherDialogAncestor) + return; + cleanups.unshift(markAncestor(ancestor, id)); + } ); const restoreAccessibilityTree = () => { cleanups.forEach((fn) => fn()); @@ -7629,32 +6226,24 @@ function markTreeOutside(dialogId, ...elements) { -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/4PKIGBPJ.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/CLE7NTOY.js +"use client"; -// src/role/role.ts -var _4PKIGBPJ_useRole = NQJBHION_createHook((props) => { - return props; -}); -var _4PKIGBPJ_Role = NQJBHION_createComponent((props) => { - return NQJBHION_createElement("div", props); -}); -if (false) {} -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/WHEEIXMF.js +// src/disclosure/disclosure-content.tsx -// src/disclosure/disclosure-content.ts function afterTimeout(timeoutMs, cb) { const timeoutId = setTimeout(cb, timeoutMs); return () => clearTimeout(timeoutId); } -function WHEEIXMF_afterPaint(cb) { +function CLE7NTOY_afterPaint(cb) { let raf = requestAnimationFrame(() => { raf = requestAnimationFrame(cb); }); @@ -7671,9 +6260,15 @@ function parseCSSTime(...times) { function isHidden(mounted, hidden, alwaysVisible) { return !alwaysVisible && hidden !== false && (!mounted || !!hidden); } -var useDisclosureContent = NQJBHION_createHook( +var useDisclosureContent = createHook( (_a) => { var _b = _a, { store, alwaysVisible } = _b, props = __objRest(_b, ["store", "alwaysVisible"]); + const context = useDisclosureProviderContext(); + store = store || context; + invariant( + store, + false && 0 + ); const id = useId(props.id); const [transition, setTransition] = (0,external_React_.useState)(null); const open = store.useState("open"); @@ -7687,11 +6282,13 @@ var useDisclosureContent = NQJBHION_createHook( setTransition(null); return; } - return WHEEIXMF_afterPaint(() => { + return CLE7NTOY_afterPaint(() => { setTransition(open ? "enter" : "leave"); }); }, [animated, contentElement, open]); useSafeLayoutEffect(() => { + if (!store) + return; if (!animated) return; if (!contentElement) @@ -7718,10 +6315,15 @@ var useDisclosureContent = NQJBHION_createHook( if (!timeoutMs) return; return afterTimeout(timeoutMs, store.stopAnimation); - }, [animated, contentElement, open, transition]); + }, [store, animated, contentElement, open, transition]); + props = useWrapElement( + props, + (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(DialogScopedContextProvider, { value: store, children: element }), + [store] + ); const hidden = isHidden(mounted, props.hidden, alwaysVisible); - const style = hidden ? PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({}, props.style), { display: "none" }) : props.style; - props = PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({ + const style = hidden ? _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props.style), { display: "none" }) : props.style; + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ id, "data-enter": transition === "enter" ? "" : void 0, "data-leave": transition === "leave" ? "" : void 0, @@ -7733,17 +6335,32 @@ var useDisclosureContent = NQJBHION_createHook( return props; } ); -var DisclosureContent = NQJBHION_createComponent( +var DisclosureContentImpl = createComponent( (props) => { const htmlProps = useDisclosureContent(props); - return NQJBHION_createElement("div", htmlProps); + return _3ORBWXWF_createElement("div", htmlProps); + } +); +var DisclosureContent = createComponent( + (_a) => { + var _b = _a, { unmountOnHide } = _b, props = __objRest(_b, ["unmountOnHide"]); + const context = useDisclosureProviderContext(); + const store = props.store || context; + const mounted = useStoreState( + store, + (state) => !unmountOnHide || (state == null ? void 0 : state.mounted) + ); + if (mounted === false) + return null; + return /* @__PURE__ */ (0,jsx_runtime.jsx)(DisclosureContentImpl, _4R3V3JGP_spreadValues({}, props)); } ); if (false) {} -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/53MSBYTF.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/LWHPHW7Q.js +"use client"; @@ -7783,16 +6400,16 @@ function DialogBackdrop({ return markAncestor(backdrop2, id); }, [contentElement]); if (hidden != null) { - backdropProps = PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({}, backdropProps), { hidden }); + backdropProps = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, backdropProps), { hidden }); } - const props = useDisclosureContent(PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({ + const props = useDisclosureContent(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ store: disclosure, role: "presentation", "data-backdrop": (contentElement == null ? void 0 : contentElement.id) || "", alwaysVisible }, backdropProps), { ref: useMergeRefs(backdropProps == null ? void 0 : backdropProps.ref, ref), - style: PNRLI7OV_spreadValues({ + style: _4R3V3JGP_spreadValues({ position: "fixed", top: 0, right: 0, @@ -7803,15 +6420,16 @@ function DialogBackdrop({ if (!backdrop) return null; if ((0,external_React_.isValidElement)(backdrop)) { - return /* @__PURE__ */ (0,jsx_runtime.jsx)(_4PKIGBPJ_Role, PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({}, props), { render: backdrop })); + return /* @__PURE__ */ (0,jsx_runtime.jsx)(Role, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { render: backdrop })); } const Component = typeof backdrop !== "boolean" ? backdrop : "div"; - return /* @__PURE__ */ (0,jsx_runtime.jsx)(_4PKIGBPJ_Role, PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({}, props), { render: /* @__PURE__ */ (0,jsx_runtime.jsx)(Component, {}) })); + return /* @__PURE__ */ (0,jsx_runtime.jsx)(Role, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { render: /* @__PURE__ */ (0,jsx_runtime.jsx)(Component, {}) })); } -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/CYJJUQU3.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/BULCTPRV.js +"use client"; @@ -7820,10 +6438,10 @@ function DialogBackdrop({ function hideElementFromAccessibilityTree(element) { return setAttribute(element, "aria-hidden", "true"); } -function disableAccessibilityTreeOutside(...elements) { +function disableAccessibilityTreeOutside(id, elements) { const cleanups = []; const ids = elements.map((el) => el == null ? void 0 : el.id); - walkTreeOutside(elements, (element) => { + walkTreeOutside(id, elements, (element) => { if (isBackdrop(element, ...ids)) return; cleanups.unshift(hideElementFromAccessibilityTree(element)); @@ -7836,7 +6454,9 @@ function disableAccessibilityTreeOutside(...elements) { -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/KOVUJERF.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/677M2CI3.js +"use client"; + // src/dialog/utils/supports-inert.ts function supportsInert() { return "inert" in HTMLElement.prototype; @@ -7844,24 +6464,32 @@ function supportsInert() { -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/AR6DTI3S.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/TQYOGOE2.js +"use client"; -// src/dialog/utils/disable-tree-outside.ts +// src/dialog/utils/disable-tree.ts -function disableElement(element) { +function disableTree(element, ignoredElements) { if (!("style" in element)) return noop; if (supportsInert()) { return setProperty(element, "inert", true); } + const tabbableElements = getAllTabbableIn(element, true); + const enableElements = tabbableElements.map((element2) => { + if (ignoredElements == null ? void 0 : ignoredElements.some((el) => el && contains(el, element2))) + return noop; + return setAttribute(element2, "tabindex", "-1"); + }); return chain( + ...enableElements, hideElementFromAccessibilityTree(element), assignStyle(element, { pointerEvents: "none", @@ -7870,20 +6498,13 @@ function disableElement(element) { }) ); } -function disableTreeOutside(...elements) { +function disableTreeOutside(id, elements) { const cleanups = []; const ids = elements.map((el) => el == null ? void 0 : el.id); - if (!supportsInert()) { - getAllTabbable().forEach((element) => { - if (elements.some((el) => el && O35LWD4W_contains(el, element))) - return; - cleanups.unshift(setAttribute(element, "tabindex", "-1")); - }); - } - walkTreeOutside(elements, (element) => { - if (isBackdrop(element, ...ids)) + _72E5EPFF_walkTreeOutside(id, elements, (element) => { + if (MKDDWKFK_isBackdrop(element, ...ids)) return; - cleanups.unshift(disableElement(element)); + cleanups.unshift(disableTree(element, elements)); }); const restoreTreeOutside = () => { cleanups.forEach((fn) => fn()); @@ -7894,9 +6515,9 @@ function disableTreeOutside(...elements) { ;// CONCATENATED MODULE: external "ReactDOM" -var external_ReactDOM_namespaceObject = window["ReactDOM"]; -var external_ReactDOM_default = /*#__PURE__*/__webpack_require__.n(external_ReactDOM_namespaceObject); -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/CJI67A3R.js +const external_ReactDOM_namespaceObject = window["ReactDOM"]; +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/CS347UVZ.js +"use client"; // src/dialog/utils/use-root-dialog.ts @@ -7915,7 +6536,7 @@ function useRootDialog({ return false; if (!contentElement) return false; - const { body } = O35LWD4W_getDocument(contentElement); + const { body } = DLOEKDPY_getDocument(contentElement); const id = body.getAttribute(attribute); return !id || id === contentId; }, [updated, enabled, contentElement, attribute, contentId]); @@ -7926,7 +6547,7 @@ function useRootDialog({ return; if (!contentElement) return; - const { body } = O35LWD4W_getDocument(contentElement); + const { body } = DLOEKDPY_getDocument(contentElement); if (isRootDialog()) { body.setAttribute(attribute, contentId); return () => body.removeAttribute(attribute); @@ -7940,7 +6561,8 @@ function useRootDialog({ -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/3LAWLNOX.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/6BJGLK2C.js +"use client"; @@ -7966,8 +6588,8 @@ function usePreventBodyScroll(contentElement, contentId, enabled) { return; if (!contentElement) return; - const doc = O35LWD4W_getDocument(contentElement); - const win = O35LWD4W_getWindow(contentElement); + const doc = DLOEKDPY_getDocument(contentElement); + const win = getWindow(contentElement); const { documentElement, body } = doc; const cssScrollbarWidth = documentElement.style.getPropertyValue("--scrollbar-width"); const scrollbarWidth = cssScrollbarWidth ? parseInt(cssScrollbarWidth) : win.innerWidth - documentElement.clientWidth; @@ -8001,7 +6623,7 @@ function usePreventBodyScroll(contentElement, contentId, enabled) { } }; }; - const isIOS = UCFCIHEU_isApple() && !isMac(); + const isIOS = isApple() && !isMac(); return chain( setScrollbarWidthProperty(), isIOS ? setIOSStyle() : setStyle() @@ -8011,13 +6633,15 @@ function usePreventBodyScroll(contentElement, contentId, enabled) { -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/OEA63YXU.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/IUB2BTEK.js +"use client"; // src/dialog/utils/use-nested-dialogs.tsx + var NestedDialogsContext = (0,external_React_.createContext)({}); function useNestedDialogs(store) { const context = (0,external_React_.useContext)(NestedDialogsContext); @@ -8033,29 +6657,15 @@ function useNestedDialogs(store) { [context] ); useSafeLayoutEffect(() => { - return store.sync( - (state) => { - var _a; - if (!state.open) - return; - if (!state.contentElement) - return; - return (_a = context.add) == null ? void 0 : _a.call(context, store); - }, - ["open", "contentElement"] - ); + return sync(store, ["open", "contentElement"], (state) => { + var _a; + if (!state.open) + return; + if (!state.contentElement) + return; + return (_a = context.add) == null ? void 0 : _a.call(context, store); + }); }, [store, context]); - useSafeLayoutEffect(() => { - var _a; - return (_a = context.store) == null ? void 0 : _a.sync( - (state) => { - if (state.open) - return; - store.hide(); - }, - ["open"] - ); - }, [context, store]); const providerValue = (0,external_React_.useMemo)(() => ({ store, add }), [store, add]); const wrapElement = (0,external_React_.useCallback)( (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(NestedDialogsContext.Provider, { value: providerValue, children: element }), @@ -8066,7 +6676,9 @@ function useNestedDialogs(store) { -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/7JNF6I52.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/OOBDFMJL.js +"use client"; + // src/dialog/utils/use-previous-mouse-down-ref.ts @@ -8087,7 +6699,8 @@ function usePreviousMouseDownRef(enabled) { -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/4XWTU3WN.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/XHJGS6Z5.js +"use client"; @@ -8100,18 +6713,18 @@ function usePreviousMouseDownRef(enabled) { function isInDocument(target) { if (target.tagName === "HTML") return true; - return O35LWD4W_contains(O35LWD4W_getDocument(target).body, target); + return contains(DLOEKDPY_getDocument(target).body, target); } function isDisclosure(disclosure, target) { if (!disclosure) return false; - if (O35LWD4W_contains(disclosure, target)) + if (contains(disclosure, target)) return true; const activeId = target.getAttribute("aria-activedescendant"); if (activeId) { - const activeElement = O35LWD4W_getDocument(disclosure).getElementById(activeId); + const activeElement = DLOEKDPY_getDocument(disclosure).getElementById(activeId); if (activeElement) { - return O35LWD4W_contains(disclosure, activeElement); + return contains(disclosure, activeElement); } } return false; @@ -8128,10 +6741,26 @@ function useEventOutside({ store, type, listener, - capture + capture, + domReady }) { const callListener = useEvent(listener); const open = store.useState("open"); + const focusedRef = (0,external_React_.useRef)(false); + useSafeLayoutEffect(() => { + if (!open) + return; + if (!domReady) + return; + const { contentElement } = store.getState(); + if (!contentElement) + return; + const onFocus = () => { + focusedRef.current = true; + }; + contentElement.addEventListener("focusin", onFocus, true); + return () => contentElement.removeEventListener("focusin", onFocus, true); + }, [store, open, domReady]); (0,external_React_.useEffect)(() => { if (!open) return; @@ -8144,7 +6773,7 @@ function useEventOutside({ return; if (!isInDocument(target)) return; - if (O35LWD4W_contains(contentElement, target)) + if (contains(contentElement, target)) return; if (isDisclosure(disclosureElement, target)) return; @@ -8152,7 +6781,8 @@ function useEventOutside({ return; if (isMouseEventOnDialog(event, contentElement)) return; - if (!isElementMarked(target, contentElement.id)) + const focused = focusedRef.current; + if (focused && !isElementMarked(target, contentElement.id)) return; callListener(event); }; @@ -8165,18 +6795,18 @@ function shouldHideOnInteractOutside(hideOnInteractOutside, event) { } return !!hideOnInteractOutside; } -function useHideOnInteractOutside(store, hideOnInteractOutside) { +function useHideOnInteractOutside(store, hideOnInteractOutside, domReady) { const open = store.useState("open"); const previousMouseDownRef = usePreviousMouseDownRef(open); - const props = { store, capture: true }; - useEventOutside(PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({}, props), { + const props = { store, domReady, capture: true }; + useEventOutside(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { type: "click", listener: (event) => { const { contentElement } = store.getState(); const previousMouseDown = previousMouseDownRef.current; if (!previousMouseDown) return; - if (!O35LWD4W_isVisible(previousMouseDown)) + if (!isVisible(previousMouseDown)) return; if (!isElementMarked(previousMouseDown, contentElement == null ? void 0 : contentElement.id)) return; @@ -8185,20 +6815,20 @@ function useHideOnInteractOutside(store, hideOnInteractOutside) { store.hide(); } })); - useEventOutside(PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({}, props), { + useEventOutside(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { type: "focusin", listener: (event) => { const { contentElement } = store.getState(); if (!contentElement) return; - if (event.target === O35LWD4W_getDocument(contentElement)) + if (event.target === DLOEKDPY_getDocument(contentElement)) return; if (!shouldHideOnInteractOutside(hideOnInteractOutside, event)) return; store.hide(); } })); - useEventOutside(PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({}, props), { + useEventOutside(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { type: "contextmenu", listener: (event) => { if (!shouldHideOnInteractOutside(hideOnInteractOutside, event)) @@ -8210,11 +6840,13 @@ function useHideOnInteractOutside(store, hideOnInteractOutside) { -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/62DFK33R.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/6GXEOXGT.js +"use client"; + // src/dialog/utils/prepend-hidden-dismiss.ts function prependHiddenDismiss(container, onClick) { - const document = O35LWD4W_getDocument(container); + const document = DLOEKDPY_getDocument(container); const button = document.createElement("button"); button.type = "button"; button.tabIndex = -1; @@ -8241,7 +6873,8 @@ function prependHiddenDismiss(container, onClick) { -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/IYNN2ZO5.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/HPP6CWMY.js +"use client"; @@ -8249,7 +6882,7 @@ function prependHiddenDismiss(container, onClick) { // src/focusable/focusable-container.tsx -var useFocusableContainer = NQJBHION_createHook( +var useFocusableContainer = createHook( (_a) => { var _b = _a, { autoFocusOnShow = true } = _b, props = __objRest(_b, ["autoFocusOnShow"]); props = useWrapElement( @@ -8260,24 +6893,27 @@ var useFocusableContainer = NQJBHION_createHook( return props; } ); -var FocusableContainer = NQJBHION_createComponent( +var FocusableContainer = createComponent( (props) => { const htmlProps = useFocusableContainer(props); - return NQJBHION_createElement("div", htmlProps); + return _3ORBWXWF_createElement("div", htmlProps); } ); if (false) {} -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/COQHFAEN.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/XPF5GU3Q.js +"use client"; + // src/heading/heading-context.ts var HeadingContext = (0,external_React_.createContext)(0); -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/6OMX4H3W.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/UYRJLDVS.js +"use client"; // src/heading/heading-level.tsx @@ -8294,14 +6930,15 @@ function HeadingLevel({ level, children }) { -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/FL2AU7YJ.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/BG6HZDS7.js +"use client"; // src/visually-hidden/visually-hidden.ts -var useVisuallyHidden = NQJBHION_createHook((props) => { - props = PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({}, props), { - style: PNRLI7OV_spreadValues({ +var useVisuallyHidden = createHook((props) => { + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { + style: _4R3V3JGP_spreadValues({ border: 0, clip: "rect(0 0 0 0)", height: "1px", @@ -8315,29 +6952,30 @@ var useVisuallyHidden = NQJBHION_createHook((props) => { }); return props; }); -var VisuallyHidden = NQJBHION_createComponent( +var VisuallyHidden = createComponent( (props) => { const htmlProps = useVisuallyHidden(props); - return NQJBHION_createElement("span", htmlProps); + return _3ORBWXWF_createElement("span", htmlProps); } ); if (false) {} -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/EJ3GIT5B.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/CHKJ74UC.js +"use client"; // src/focus-trap/focus-trap.ts -var useFocusTrap = NQJBHION_createHook((props) => { - props = PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({ +var useFocusTrap = createHook((props) => { + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ "data-focus-trap": "", tabIndex: 0, "aria-hidden": true }, props), { - style: PNRLI7OV_spreadValues({ + style: _4R3V3JGP_spreadValues({ // Prevents unintended scroll jumps. position: "fixed", top: 0, @@ -8347,22 +6985,25 @@ var useFocusTrap = NQJBHION_createHook((props) => { props = useVisuallyHidden(props); return props; }); -var FocusTrap = NQJBHION_createComponent((props) => { +var FocusTrap = createComponent((props) => { const htmlProps = useFocusTrap(props); - return NQJBHION_createElement("span", htmlProps); + return _3ORBWXWF_createElement("span", htmlProps); }); if (false) {} -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/LDDPB3PY.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/7452U3HH.js +"use client"; + // src/portal/portal-context.ts var PortalContext = (0,external_React_.createContext)(null); -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/LL3AE4N4.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/JPXNJYSO.js +"use client"; @@ -8378,11 +7019,11 @@ var PortalContext = (0,external_React_.createContext)(null); function getRootElement(element) { - return O35LWD4W_getDocument(element).body; + return DLOEKDPY_getDocument(element).body; } function getPortalElement(element, portalElement) { if (!portalElement) { - return O35LWD4W_getDocument(element).createElement("div"); + return DLOEKDPY_getDocument(element).createElement("div"); } if (typeof portalElement === "function") { return portalElement(element); @@ -8397,13 +7038,26 @@ function queueFocus(element) { element == null ? void 0 : element.focus(); }); } -var usePortal = NQJBHION_createHook( +var usePortal = createHook( (_a) => { - var _b = _a, { preserveTabOrder, portalElement, portalRef, portal = true } = _b, props = __objRest(_b, ["preserveTabOrder", "portalElement", "portalRef", "portal"]); + var _b = _a, { + preserveTabOrder, + preserveTabOrderAnchor, + portalElement, + portalRef, + portal = true + } = _b, props = __objRest(_b, [ + "preserveTabOrder", + "preserveTabOrderAnchor", + "portalElement", + "portalRef", + "portal" + ]); const ref = (0,external_React_.useRef)(null); const refProp = useMergeRefs(ref, props.ref); const context = (0,external_React_.useContext)(PortalContext); const [portalNode, setPortalNode] = (0,external_React_.useState)(null); + const [anchorPortalNode, setAnchorPortalNode] = (0,external_React_.useState)(null); const outerBeforeRef = (0,external_React_.useRef)(null); const innerBeforeRef = (0,external_React_.useRef)(null); const innerAfterRef = (0,external_React_.useRef)(null); @@ -8428,14 +7082,29 @@ var usePortal = NQJBHION_createHook( portalEl.id = element.id ? `portal/${element.id}` : getRandomId(); } setPortalNode(portalEl); - CP3U4HPL_setRef(portalRef, portalEl); + setRef(portalRef, portalEl); if (isPortalInDocument) return; return () => { portalEl.remove(); - CP3U4HPL_setRef(portalRef, null); + setRef(portalRef, null); }; }, [portal, portalElement, context, portalRef]); + useSafeLayoutEffect(() => { + if (!preserveTabOrder) + return; + if (!preserveTabOrderAnchor) + return; + const doc = DLOEKDPY_getDocument(preserveTabOrderAnchor); + const element = doc.createElement("span"); + element.style.position = "fixed"; + preserveTabOrderAnchor.insertAdjacentElement("afterend", element); + setAnchorPortalNode(element); + return () => { + element.remove(); + setAnchorPortalNode(null); + }; + }, [preserveTabOrder, preserveTabOrderAnchor]); (0,external_React_.useEffect)(() => { if (!portalNode) return; @@ -8446,9 +7115,10 @@ var usePortal = NQJBHION_createHook( if (!isFocusEventOutside(event)) return; const focusing = event.type === "focusin"; - if (focusing) - return restoreFocusIn(portalNode); cancelAnimationFrame(raf); + if (focusing) { + return restoreFocusIn(portalNode); + } raf = requestAnimationFrame(() => { disableFocusIn(portalNode, true); }); @@ -8456,6 +7126,7 @@ var usePortal = NQJBHION_createHook( portalNode.addEventListener("focusin", onFocus, true); portalNode.addEventListener("focusout", onFocus, true); return () => { + cancelAnimationFrame(raf); portalNode.removeEventListener("focusin", onFocus, true); portalNode.removeEventListener("focusout", onFocus, true); }; @@ -8514,7 +7185,7 @@ var usePortal = NQJBHION_createHook( if (portalNode) { element = (0,external_ReactDOM_namespaceObject.createPortal)(element, portalNode); } - element = /* @__PURE__ */ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ + let preserveTabOrderElement = /* @__PURE__ */ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ preserveTabOrder && portalNode && /* @__PURE__ */ (0,jsx_runtime.jsx)( FocusTrap, { @@ -8533,7 +7204,6 @@ var usePortal = NQJBHION_createHook( preserveTabOrder && // We're using position: fixed here so that the browser doesn't // add margin to the element when setting gap on a parent element. /* @__PURE__ */ (0,jsx_runtime.jsx)("span", { "aria-owns": portalNode == null ? void 0 : portalNode.id, style: { position: "fixed" } }), - element, preserveTabOrder && portalNode && /* @__PURE__ */ (0,jsx_runtime.jsx)( FocusTrap, { @@ -8557,34 +7227,44 @@ var usePortal = NQJBHION_createHook( } ) ] }); - return element; + if (anchorPortalNode && preserveTabOrder) { + preserveTabOrderElement = (0,external_ReactDOM_namespaceObject.createPortal)( + preserveTabOrderElement, + anchorPortalNode + ); + } + return /* @__PURE__ */ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ + preserveTabOrderElement, + element + ] }); }, - [portalNode, context, portal, props.id, preserveTabOrder] + [ + portalNode, + context, + portal, + props.id, + preserveTabOrder, + anchorPortalNode + ] ); - props = PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({}, props), { + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { ref: refProp }); return props; } ); -var Portal = NQJBHION_createComponent((props) => { +var Portal = createComponent((props) => { const htmlProps = usePortal(props); - return NQJBHION_createElement("div", htmlProps); + return _3ORBWXWF_createElement("div", htmlProps); }); if (false) {} -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/LNHZLQEK.js -// src/dialog/dialog-context.ts - -var DialogContext = (0,external_React_.createContext)(void 0); -var DialogHeadingContext = (0,external_React_.createContext)(void 0); -var DialogDescriptionContext = (0,external_React_.createContext)(void 0); - +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/NERBASET.js +"use client"; -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/DTAO6DRL.js @@ -8611,14 +7291,14 @@ var DialogDescriptionContext = (0,external_React_.createContext)(void 0); -var DTAO6DRL_isSafariBrowser = isSafari(); +var NERBASET_isSafariBrowser = isSafari(); function isAlreadyFocusingAnotherElement(dialog) { - const activeElement = O35LWD4W_getActiveElement(); + const activeElement = getActiveElement(); if (!activeElement) return false; - if (dialog && O35LWD4W_contains(dialog, activeElement)) + if (dialog && contains(dialog, activeElement)) return false; - if (focus_isFocusable(activeElement)) + if (isFocusable(activeElement)) return true; return false; } @@ -8629,13 +7309,15 @@ function getElementFromProp(prop, focusable = false) { if (!element) return null; if (focusable) - return focus_isFocusable(element) ? element : null; + return isFocusable(element) ? element : null; return element; } -var useDialog = NQJBHION_createHook( +var useDialog = createHook( (_a) => { var _b = _a, { - store, + store: storeProp, + open: openProp, + onClose, focusable = true, modal = true, portal = !!modal, @@ -8648,9 +7330,12 @@ var useDialog = NQJBHION_createHook( autoFocusOnShow = true, autoFocusOnHide = true, initialFocus, - finalFocus + finalFocus, + unmountOnHide } = _b, props = __objRest(_b, [ "store", + "open", + "onClose", "focusable", "modal", "portal", @@ -8663,9 +7348,30 @@ var useDialog = NQJBHION_createHook( "autoFocusOnShow", "autoFocusOnHide", "initialFocus", - "finalFocus" + "finalFocus", + "unmountOnHide" ]); + const context = useDialogProviderContext(); const ref = (0,external_React_.useRef)(null); + const store = useDialogStore({ + store: storeProp || context, + open: openProp, + setOpen(open2) { + if (open2) + return; + const dialog = ref.current; + if (!dialog) + return; + const event = new Event("close", { bubbles: false, cancelable: true }); + if (onClose) { + dialog.addEventListener("close", onClose, { once: true }); + } + dialog.dispatchEvent(event); + if (!event.defaultPrevented) + return; + store.setOpen(true); + } + }); const { portalRef, domReady } = usePortalRef(portal, props.portalRef); const preserveTabOrderProp = props.preserveTabOrder; const preserveTabOrder = store.useState( @@ -8677,30 +7383,31 @@ var useDialog = NQJBHION_createHook( const contentElement = store.useState("contentElement"); const hidden = isHidden(mounted, props.hidden, props.alwaysVisible); usePreventBodyScroll(contentElement, id, preventBodyScroll && !hidden); - useHideOnInteractOutside(store, hideOnInteractOutside); + useHideOnInteractOutside(store, hideOnInteractOutside, domReady); const { wrapElement, nestedDialogs } = useNestedDialogs(store); props = useWrapElement(props, wrapElement, [wrapElement]); + if (false) {} useSafeLayoutEffect(() => { if (!open) return; const dialog = ref.current; - const activeElement = O35LWD4W_getActiveElement(dialog, true); + const activeElement = getActiveElement(dialog, true); if (!activeElement) return; if (activeElement.tagName === "BODY") return; - if (dialog && O35LWD4W_contains(dialog, activeElement)) + if (dialog && contains(dialog, activeElement)) return; store.setDisclosureElement(activeElement); - }, [open]); - if (DTAO6DRL_isSafariBrowser) { + }, [store, open]); + if (NERBASET_isSafariBrowser) { (0,external_React_.useEffect)(() => { if (!mounted) return; const { disclosureElement } = store.getState(); if (!disclosureElement) return; - if (!O35LWD4W_isButton(disclosureElement)) + if (!isButton(disclosureElement)) return; const onMouseDown = () => { let receivedFocus = false; @@ -8713,22 +7420,18 @@ var useDialog = NQJBHION_createHook( disclosureElement.removeEventListener("focusin", onFocus, true); if (receivedFocus) return; - focus_focusIfNeeded(disclosureElement); + focusIfNeeded(disclosureElement); }); }; disclosureElement.addEventListener("mousedown", onMouseDown); return () => { disclosureElement.removeEventListener("mousedown", onMouseDown); }; - }, [mounted]); - } - const shouldDisableAccessibilityTree = modal || // Usually, we only want to disable the accessibility tree outside if the - // dialog is a modal. But the Portal component can't preserve the tab - // order on Safari/VoiceOver. By allowing only the dialog/portal to be - // accessible, we provide a similar tab order flow. We don't need to - // disable pointer events because it's just for screen readers. - portal && preserveTabOrder && isSafari(); + }, [store, mounted]); + } (0,external_React_.useEffect)(() => { + if (!modal) + return; if (!mounted) return; if (!domReady) @@ -8736,20 +7439,37 @@ var useDialog = NQJBHION_createHook( const dialog = ref.current; if (!dialog) return; - if (!shouldDisableAccessibilityTree) - return; const existingDismiss = dialog.querySelector("[data-dialog-dismiss]"); if (existingDismiss) return; return prependHiddenDismiss(dialog, store.hide); - }, [mounted, domReady, shouldDisableAccessibilityTree]); - const getPersistentElementsProp = useEvent(getPersistentElements); + }, [store, modal, mounted, domReady]); useSafeLayoutEffect(() => { + if (open) + return; + if (!mounted) + return; if (!domReady) return; + const dialog = ref.current; + if (!dialog) + return; + return disableTree(dialog); + }, [open, mounted, domReady]); + const canTakeTreeSnapshot = open && domReady; + useSafeLayoutEffect(() => { if (!id) return; - if (!open) + if (!canTakeTreeSnapshot) + return; + const dialog = ref.current; + return createWalkTreeSnapshot(id, [dialog]); + }, [id, canTakeTreeSnapshot]); + const getPersistentElementsProp = useEvent(getPersistentElements); + useSafeLayoutEffect(() => { + if (!id) + return; + if (!canTakeTreeSnapshot) return; const { disclosureElement } = store.getState(); const dialog = ref.current; @@ -8759,27 +7479,19 @@ var useDialog = NQJBHION_createHook( ...persistentElements, ...nestedDialogs.map((dialog2) => dialog2.getState().contentElement) ]; - if (!shouldDisableAccessibilityTree) { - return markTreeOutside(id, disclosureElement, ...allElements); - } if (modal) { return chain( - markTreeOutside(id, ...allElements), - disableTreeOutside(...allElements) + markTreeOutside(id, allElements), + disableTreeOutside(id, allElements) ); } - return chain( - markTreeOutside(id, disclosureElement, ...allElements), - disableAccessibilityTreeOutside(...allElements) - ); + return markTreeOutside(id, [disclosureElement, ...allElements]); }, [ - domReady, id, - open, store, + canTakeTreeSnapshot, getPersistentElementsProp, nestedDialogs, - shouldDisableAccessibilityTree, modal ]); const mayAutoFocusOnShow = !!autoFocusOnShow; @@ -8804,15 +7516,15 @@ var useDialog = NQJBHION_createHook( // dialogs with preserveTabOrder set to true will not receive focus // properly because the elements aren't tabbable until the dialog // receives focus. - focus_getFirstTabbableIn(contentElement, true, portal && preserveTabOrder) || // Finally, we fallback to the dialog element itself. + getFirstTabbableIn(contentElement, true, portal && preserveTabOrder) || // Finally, we fallback to the dialog element itself. contentElement; - const isElementFocusable = focus_isFocusable(element); + const isElementFocusable = isFocusable(element); if (!autoFocusOnShowProp(isElementFocusable ? element : null)) return; setAutoFocusEnabled(true); queueMicrotask(() => { element.focus(); - if (!DTAO6DRL_isSafariBrowser) + if (!NERBASET_isSafariBrowser) return; element.scrollIntoView({ block: "nearest", inline: "nearest" }); }); @@ -8835,29 +7547,24 @@ var useDialog = NQJBHION_createHook( setHasOpened(true); return () => setHasOpened(false); }, [open]); - useSafeLayoutEffect(() => { - if (!hasOpened) - return; - if (!mayAutoFocusOnHide) - return; - const dialog = ref.current; - const focusOnHide = (retry = true) => { + const focusOnHide = (0,external_React_.useCallback)( + (dialog, retry = true) => { + const { disclosureElement } = store.getState(); if (isAlreadyFocusingAnotherElement(dialog)) return; - const { disclosureElement } = store.getState(); let element = getElementFromProp(finalFocus) || disclosureElement; if (element == null ? void 0 : element.id) { - const doc = O35LWD4W_getDocument(element); + const doc = DLOEKDPY_getDocument(element); const selector = `[aria-activedescendant="${element.id}"]`; const composite = doc.querySelector(selector); if (composite) { element = composite; } } - if (element && !focus_isFocusable(element)) { - const maybeParentDialog = O35LWD4W_closest(element, "[data-dialog]"); + if (element && !isFocusable(element)) { + const maybeParentDialog = DLOEKDPY_closest(element, "[data-dialog]"); if (maybeParentDialog && maybeParentDialog.id) { - const doc = O35LWD4W_getDocument(maybeParentDialog); + const doc = DLOEKDPY_getDocument(maybeParentDialog); const selector = `[aria-controls~="${maybeParentDialog.id}"]`; const control = doc.querySelector(selector); if (control) { @@ -8865,9 +7572,9 @@ var useDialog = NQJBHION_createHook( } } } - const isElementFocusable = element && focus_isFocusable(element); + const isElementFocusable = element && isFocusable(element); if (!isElementFocusable && retry) { - requestAnimationFrame(() => focusOnHide(false)); + requestAnimationFrame(() => focusOnHide(dialog, false)); return; } if (!autoFocusOnHideProp(isElementFocusable ? element : null)) @@ -8875,12 +7582,27 @@ var useDialog = NQJBHION_createHook( if (!isElementFocusable) return; element == null ? void 0 : element.focus(); - }; - if (!open) { - return focusOnHide(); - } - return focusOnHide; - }, [hasOpened, open, mayAutoFocusOnHide, finalFocus, autoFocusOnHideProp]); + }, + [store, finalFocus, autoFocusOnHideProp] + ); + useSafeLayoutEffect(() => { + if (open) + return; + if (!hasOpened) + return; + if (!mayAutoFocusOnHide) + return; + const dialog = ref.current; + focusOnHide(dialog); + }, [open, hasOpened, domReady, mayAutoFocusOnHide, focusOnHide]); + (0,external_React_.useEffect)(() => { + if (!hasOpened) + return; + if (!mayAutoFocusOnHide) + return; + const dialog = ref.current; + return () => focusOnHide(dialog); + }, [hasOpened, mayAutoFocusOnHide, focusOnHide]); const hideOnEscapeProp = useBooleanEvent(hideOnEscape); (0,external_React_.useEffect)(() => { if (!domReady) @@ -8904,11 +7626,11 @@ var useDialog = NQJBHION_createHook( const isValidTarget = () => { if (target.tagName === "BODY") return true; - if (O35LWD4W_contains(dialog, target)) + if (contains(dialog, target)) return true; if (!disclosureElement) - return false; - if (O35LWD4W_contains(disclosureElement, target)) + return true; + if (contains(disclosureElement, target)) return true; return false; }; @@ -8918,8 +7640,8 @@ var useDialog = NQJBHION_createHook( return; store.hide(); }; - return addGlobalEventListener("keydown", onKeyDown); - }, [mounted, domReady, hideOnEscapeProp]); + return addGlobalEventListener("keydown", onKeyDown, true); + }, [store, domReady, mounted, hideOnEscapeProp]); props = useWrapElement( props, (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(HeadingLevel, { level: modal ? 1 : void 0, children: element }), @@ -8952,10 +7674,10 @@ var useDialog = NQJBHION_createHook( const [descriptionId, setDescriptionId] = (0,external_React_.useState)(); props = useWrapElement( props, - (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(DialogContext.Provider, { value: store, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(DialogHeadingContext.Provider, { value: setHeadingId, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(DialogDescriptionContext.Provider, { value: setDescriptionId, children: element }) }) }), + (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(DialogScopedContextProvider, { value: store, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(DialogHeadingContext.Provider, { value: setHeadingId, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(DialogDescriptionContext.Provider, { value: setDescriptionId, children: element }) }) }), [store] ); - props = PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({ + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ id, "data-dialog": "", role: "dialog", @@ -8965,29 +7687,36 @@ var useDialog = NQJBHION_createHook( }, props), { ref: useMergeRefs(ref, props.ref) }); - props = useFocusableContainer(PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({}, props), { + props = useFocusableContainer(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { autoFocusOnShow: autoFocusEnabled })); - props = useDisclosureContent(PNRLI7OV_spreadValues({ store }, props)); - props = useFocusable(PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({}, props), { focusable })); - props = usePortal(PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({ portal }, props), { portalRef, preserveTabOrder })); + props = useDisclosureContent(_4R3V3JGP_spreadValues({ store }, props)); + props = useFocusable(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { focusable })); + props = usePortal(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ portal }, props), { portalRef, preserveTabOrder })); return props; } ); -var Dialog = NQJBHION_createComponent((props) => { - const htmlProps = useDialog(props); - return NQJBHION_createElement("div", htmlProps); -}); -if (false) {} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/6GS36SYX.js -// src/popover/popover-context.ts - -var PopoverContext = (0,external_React_.createContext)( - void 0 +function createDialogComponent(Component, useProviderContext = useDialogProviderContext) { + return createComponent((props) => { + const context = useProviderContext(); + const store = props.store || context; + const mounted = useStoreState( + store, + (state) => !props.unmountOnHide || (state == null ? void 0 : state.mounted) || !!props.open + ); + if (!mounted) + return null; + return /* @__PURE__ */ (0,jsx_runtime.jsx)(Component, _4R3V3JGP_spreadValues({}, props)); + }); +} +var Dialog = createDialogComponent( + createComponent((props) => { + const htmlProps = useDialog(props); + return _3ORBWXWF_createElement("div", htmlProps); + }), + useDialogProviderContext ); +if (false) {} @@ -9523,7 +8252,7 @@ const autoPlacement = function (options) { * clipping boundary. Alternative to `autoPlacement`. * @see https://floating-ui.com/docs/flip */ -const floating_ui_core_flip = function (options) { +const flip = function (options) { if (options === void 0) { options = {}; } @@ -9909,7 +8638,7 @@ const offset = function (options) { * keep it in view when it will overflow the clipping boundary. * @see https://floating-ui.com/docs/shift */ -const floating_ui_core_shift = function (options) { +const shift = function (options) { if (options === void 0) { options = {}; } @@ -10130,7 +8859,138 @@ const size = function (options) { -;// CONCATENATED MODULE: ./node_modules/@floating-ui/utils/dom/dist/floating-ui.utils.dom.mjs +;// CONCATENATED MODULE: ./node_modules/@floating-ui/dom/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs +/** + * Custom positioning reference element. + * @see https://floating-ui.com/docs/virtual-elements + */ + +const dist_floating_ui_utils_sides = (/* unused pure expression or super */ null && (['top', 'right', 'bottom', 'left'])); +const floating_ui_utils_alignments = (/* unused pure expression or super */ null && (['start', 'end'])); +const dist_floating_ui_utils_placements = /*#__PURE__*/(/* unused pure expression or super */ null && (dist_floating_ui_utils_sides.reduce((acc, side) => acc.concat(side, side + "-" + floating_ui_utils_alignments[0], side + "-" + floating_ui_utils_alignments[1]), []))); +const dist_floating_ui_utils_min = Math.min; +const dist_floating_ui_utils_max = Math.max; +const floating_ui_utils_round = Math.round; +const floating_ui_utils_floor = Math.floor; +const floating_ui_utils_createCoords = v => ({ + x: v, + y: v +}); +const floating_ui_utils_oppositeSideMap = { + left: 'right', + right: 'left', + bottom: 'top', + top: 'bottom' +}; +const floating_ui_utils_oppositeAlignmentMap = { + start: 'end', + end: 'start' +}; +function floating_ui_utils_clamp(start, value, end) { + return dist_floating_ui_utils_max(start, dist_floating_ui_utils_min(value, end)); +} +function dist_floating_ui_utils_evaluate(value, param) { + return typeof value === 'function' ? value(param) : value; +} +function dist_floating_ui_utils_getSide(placement) { + return placement.split('-')[0]; +} +function dist_floating_ui_utils_getAlignment(placement) { + return placement.split('-')[1]; +} +function floating_ui_utils_getOppositeAxis(axis) { + return axis === 'x' ? 'y' : 'x'; +} +function floating_ui_utils_getAxisLength(axis) { + return axis === 'y' ? 'height' : 'width'; +} +function dist_floating_ui_utils_getSideAxis(placement) { + return ['top', 'bottom'].includes(dist_floating_ui_utils_getSide(placement)) ? 'y' : 'x'; +} +function floating_ui_utils_getAlignmentAxis(placement) { + return floating_ui_utils_getOppositeAxis(dist_floating_ui_utils_getSideAxis(placement)); +} +function dist_floating_ui_utils_getAlignmentSides(placement, rects, rtl) { + if (rtl === void 0) { + rtl = false; + } + const alignment = dist_floating_ui_utils_getAlignment(placement); + const alignmentAxis = floating_ui_utils_getAlignmentAxis(placement); + const length = floating_ui_utils_getAxisLength(alignmentAxis); + let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top'; + if (rects.reference[length] > rects.floating[length]) { + mainAlignmentSide = floating_ui_utils_getOppositePlacement(mainAlignmentSide); + } + return [mainAlignmentSide, floating_ui_utils_getOppositePlacement(mainAlignmentSide)]; +} +function floating_ui_utils_getExpandedPlacements(placement) { + const oppositePlacement = floating_ui_utils_getOppositePlacement(placement); + return [dist_floating_ui_utils_getOppositeAlignmentPlacement(placement), oppositePlacement, dist_floating_ui_utils_getOppositeAlignmentPlacement(oppositePlacement)]; +} +function dist_floating_ui_utils_getOppositeAlignmentPlacement(placement) { + return placement.replace(/start|end/g, alignment => floating_ui_utils_oppositeAlignmentMap[alignment]); +} +function floating_ui_utils_getSideList(side, isStart, rtl) { + const lr = ['left', 'right']; + const rl = ['right', 'left']; + const tb = ['top', 'bottom']; + const bt = ['bottom', 'top']; + switch (side) { + case 'top': + case 'bottom': + if (rtl) return isStart ? rl : lr; + return isStart ? lr : rl; + case 'left': + case 'right': + return isStart ? tb : bt; + default: + return []; + } +} +function floating_ui_utils_getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { + const alignment = dist_floating_ui_utils_getAlignment(placement); + let list = floating_ui_utils_getSideList(dist_floating_ui_utils_getSide(placement), direction === 'start', rtl); + if (alignment) { + list = list.map(side => side + "-" + alignment); + if (flipAlignment) { + list = list.concat(list.map(dist_floating_ui_utils_getOppositeAlignmentPlacement)); + } + } + return list; +} +function floating_ui_utils_getOppositePlacement(placement) { + return placement.replace(/left|right|bottom|top/g, side => floating_ui_utils_oppositeSideMap[side]); +} +function floating_ui_utils_expandPaddingObject(padding) { + return { + top: 0, + right: 0, + bottom: 0, + left: 0, + ...padding + }; +} +function dist_floating_ui_utils_getPaddingObject(padding) { + return typeof padding !== 'number' ? floating_ui_utils_expandPaddingObject(padding) : { + top: padding, + right: padding, + bottom: padding, + left: padding + }; +} +function dist_floating_ui_utils_rectToClientRect(rect) { + return { + ...rect, + top: rect.y, + left: rect.x, + right: rect.x + rect.width, + bottom: rect.y + rect.height + }; +} + + + +;// CONCATENATED MODULE: ./node_modules/@floating-ui/dom/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs function getNodeName(node) { if (isNode(node)) { return (node.nodeName || '').toLowerCase(); @@ -10142,7 +9002,7 @@ function getNodeName(node) { } function floating_ui_utils_dom_getWindow(node) { var _node$ownerDocument; - return (node == null ? void 0 : (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; + return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; } function getDocumentElement(node) { var _ref; @@ -10276,7 +9136,7 @@ function getCssDimensions(element) { const hasOffset = isHTMLElement(element); const offsetWidth = hasOffset ? element.offsetWidth : width; const offsetHeight = hasOffset ? element.offsetHeight : height; - const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; + const shouldFallback = floating_ui_utils_round(width) !== offsetWidth || floating_ui_utils_round(height) !== offsetHeight; if (shouldFallback) { width = offsetWidth; height = offsetHeight; @@ -10295,7 +9155,7 @@ function unwrapElement(element) { function getScale(element) { const domElement = unwrapElement(element); if (!isHTMLElement(domElement)) { - return createCoords(1); + return floating_ui_utils_createCoords(1); } const rect = domElement.getBoundingClientRect(); const { @@ -10303,8 +9163,8 @@ function getScale(element) { height, $ } = getCssDimensions(domElement); - let x = ($ ? round(rect.width) : rect.width) / width; - let y = ($ ? round(rect.height) : rect.height) / height; + let x = ($ ? floating_ui_utils_round(rect.width) : rect.width) / width; + let y = ($ ? floating_ui_utils_round(rect.height) : rect.height) / height; // 0, NaN, or Infinity should always fallback to 1. @@ -10320,7 +9180,7 @@ function getScale(element) { }; } -const noOffsets = /*#__PURE__*/createCoords(0); +const noOffsets = /*#__PURE__*/floating_ui_utils_createCoords(0); function getVisualOffsets(element) { const win = floating_ui_utils_dom_getWindow(element); if (!isWebKit() || !win.visualViewport) { @@ -10350,7 +9210,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar } const clientRect = element.getBoundingClientRect(); const domElement = unwrapElement(element); - let scale = createCoords(1); + let scale = floating_ui_utils_createCoords(1); if (includeScale) { if (offsetParent) { if (isElement(offsetParent)) { @@ -10360,7 +9220,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar scale = getScale(element); } } - const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0); + const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : floating_ui_utils_createCoords(0); let x = (clientRect.left + visualOffsets.x) / scale.x; let y = (clientRect.top + visualOffsets.y) / scale.y; let width = clientRect.width / scale.x; @@ -10368,8 +9228,9 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar if (domElement) { const win = floating_ui_utils_dom_getWindow(domElement); const offsetWin = offsetParent && isElement(offsetParent) ? floating_ui_utils_dom_getWindow(offsetParent) : offsetParent; - let currentIFrame = win.frameElement; - while (currentIFrame && offsetParent && offsetWin !== win) { + let currentWin = win; + let currentIFrame = currentWin.frameElement; + while (currentIFrame && offsetParent && offsetWin !== currentWin) { const iframeScale = getScale(currentIFrame); const iframeRect = currentIFrame.getBoundingClientRect(); const css = floating_ui_utils_dom_getComputedStyle(currentIFrame); @@ -10381,7 +9242,8 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar height *= iframeScale.y; x += left; y += top; - currentIFrame = floating_ui_utils_dom_getWindow(currentIFrame).frameElement; + currentWin = floating_ui_utils_dom_getWindow(currentIFrame); + currentIFrame = currentWin.frameElement; } } return floating_ui_utils_rectToClientRect({ @@ -10392,24 +9254,38 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar }); } +const topLayerSelectors = [':popover-open', ':modal']; +function isTopLayer(floating) { + return topLayerSelectors.some(selector => { + try { + return floating.matches(selector); + } catch (e) { + return false; + } + }); +} + function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { let { + elements, rect, offsetParent, strategy } = _ref; - const isOffsetParentAnElement = isHTMLElement(offsetParent); + const isFixed = strategy === 'fixed'; const documentElement = getDocumentElement(offsetParent); - if (offsetParent === documentElement) { + const topLayer = elements ? isTopLayer(elements.floating) : false; + if (offsetParent === documentElement || topLayer && isFixed) { return rect; } let scroll = { scrollLeft: 0, scrollTop: 0 }; - let scale = createCoords(1); - const offsets = createCoords(0); - if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') { + let scale = floating_ui_utils_createCoords(1); + const offsets = floating_ui_utils_createCoords(0); + const isOffsetParentAnElement = isHTMLElement(offsetParent); + if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { scroll = getNodeScroll(offsetParent); } @@ -10444,12 +9320,12 @@ function getDocumentRect(element) { const html = getDocumentElement(element); const scroll = getNodeScroll(element); const body = element.ownerDocument.body; - const width = floating_ui_utils_max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); - const height = floating_ui_utils_max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); + const width = dist_floating_ui_utils_max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); + const height = dist_floating_ui_utils_max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); let x = -scroll.scrollLeft + getWindowScrollBarX(element); const y = -scroll.scrollTop; if (floating_ui_utils_dom_getComputedStyle(body).direction === 'rtl') { - x += floating_ui_utils_max(html.clientWidth, body.clientWidth) - width; + x += dist_floating_ui_utils_max(html.clientWidth, body.clientWidth) - width; } return { width, @@ -10489,7 +9365,7 @@ function getInnerBoundingClientRect(element, strategy) { const clientRect = getBoundingClientRect(element, true, strategy === 'fixed'); const top = clientRect.top + element.clientTop; const left = clientRect.left + element.clientLeft; - const scale = isHTMLElement(element) ? getScale(element) : createCoords(1); + const scale = isHTMLElement(element) ? getScale(element) : floating_ui_utils_createCoords(1); const width = element.clientWidth * scale.x; const height = element.clientHeight * scale.y; const x = left * scale.x; @@ -10575,10 +9451,10 @@ function getClippingRect(_ref) { const firstClippingAncestor = clippingAncestors[0]; const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => { const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy); - accRect.top = floating_ui_utils_max(rect.top, accRect.top); - accRect.right = floating_ui_utils_min(rect.right, accRect.right); - accRect.bottom = floating_ui_utils_min(rect.bottom, accRect.bottom); - accRect.left = floating_ui_utils_max(rect.left, accRect.left); + accRect.top = dist_floating_ui_utils_max(rect.top, accRect.top); + accRect.right = dist_floating_ui_utils_min(rect.right, accRect.right); + accRect.bottom = dist_floating_ui_utils_min(rect.bottom, accRect.bottom); + accRect.left = dist_floating_ui_utils_max(rect.left, accRect.left); return accRect; }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy)); return { @@ -10590,7 +9466,14 @@ function getClippingRect(_ref) { } function getDimensions(element) { - return getCssDimensions(element); + const { + width, + height + } = getCssDimensions(element); + return { + width, + height + }; } function getRectRelativeToOffsetParent(element, offsetParent, strategy) { @@ -10602,7 +9485,7 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) { scrollLeft: 0, scrollTop: 0 }; - const offsets = createCoords(0); + const offsets = floating_ui_utils_createCoords(0); if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { scroll = getNodeScroll(offsetParent); @@ -10615,9 +9498,11 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) { offsets.x = getWindowScrollBarX(documentElement); } } + const x = rect.left + scroll.scrollLeft - offsets.x; + const y = rect.top + scroll.scrollTop - offsets.y; return { - x: rect.left + scroll.scrollLeft - offsets.x, - y: rect.top + scroll.scrollTop - offsets.y, + x, + y, width: rect.width, height: rect.height }; @@ -10637,7 +9522,7 @@ function getTrueOffsetParent(element, polyfill) { // such as table ancestors and cross browser bugs. function getOffsetParent(element, polyfill) { const window = floating_ui_utils_dom_getWindow(element); - if (!isHTMLElement(element)) { + if (!isHTMLElement(element) || isTopLayer(element)) { return window; } let offsetParent = getTrueOffsetParent(element, polyfill); @@ -10650,20 +9535,15 @@ function getOffsetParent(element, polyfill) { return offsetParent || getContainingBlock(element) || window; } -const getElementRects = async function (_ref) { - let { - reference, - floating, - strategy - } = _ref; +const getElementRects = async function (data) { const getOffsetParentFn = this.getOffsetParent || getOffsetParent; const getDimensionsFn = this.getDimensions; return { - reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy), + reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy), floating: { x: 0, y: 0, - ...(await getDimensionsFn(floating)) + ...(await getDimensionsFn(data.floating)) } }; }; @@ -10691,8 +9571,9 @@ function observeMove(element, onMove) { let timeoutId; const root = getDocumentElement(element); function cleanup() { + var _io; clearTimeout(timeoutId); - io && io.disconnect(); + (_io = io) == null || _io.disconnect(); io = null; } function refresh(skip, threshold) { @@ -10715,14 +9596,14 @@ function observeMove(element, onMove) { if (!width || !height) { return; } - const insetTop = floor(top); - const insetRight = floor(root.clientWidth - (left + width)); - const insetBottom = floor(root.clientHeight - (top + height)); - const insetLeft = floor(left); + const insetTop = floating_ui_utils_floor(top); + const insetRight = floating_ui_utils_floor(root.clientWidth - (left + width)); + const insetBottom = floating_ui_utils_floor(root.clientHeight - (top + height)); + const insetLeft = floating_ui_utils_floor(left); const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; const options = { rootMargin, - threshold: floating_ui_utils_max(0, floating_ui_utils_min(1, threshold)) || 1 + threshold: dist_floating_ui_utils_max(0, dist_floating_ui_utils_min(1, threshold)) || 1 }; let isFirstUpdate = true; function handleObserve(entries) { @@ -10798,7 +9679,8 @@ function autoUpdate(reference, floating, update, options) { resizeObserver.unobserve(floating); cancelAnimationFrame(reobserveFrame); reobserveFrame = requestAnimationFrame(() => { - resizeObserver && resizeObserver.observe(floating); + var _resizeObserver; + (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating); }); } update(); @@ -10823,12 +9705,13 @@ function autoUpdate(reference, floating, update, options) { } update(); return () => { + var _resizeObserver2; ancestors.forEach(ancestor => { ancestorScroll && ancestor.removeEventListener('scroll', update); ancestorResize && ancestor.removeEventListener('resize', update); }); - cleanupIo && cleanupIo(); - resizeObserver && resizeObserver.disconnect(); + cleanupIo == null || cleanupIo(); + (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect(); resizeObserver = null; if (animationFrame) { cancelAnimationFrame(frameId); @@ -10837,9 +9720,65 @@ function autoUpdate(reference, floating, update, options) { } /** + * Optimizes the visibility of the floating element by choosing the placement + * that has the most space available automatically, without needing to specify a + * preferred placement. Alternative to `flip`. + * @see https://floating-ui.com/docs/autoPlacement + */ +const floating_ui_dom_autoPlacement = (/* unused pure expression or super */ null && (autoPlacement$1)); + +/** + * Optimizes the visibility of the floating element by shifting it in order to + * keep it in view when it will overflow the clipping boundary. + * @see https://floating-ui.com/docs/shift + */ +const floating_ui_dom_shift = shift; + +/** + * Optimizes the visibility of the floating element by flipping the `placement` + * in order to keep it in view when the preferred placement(s) will overflow the + * clipping boundary. Alternative to `autoPlacement`. + * @see https://floating-ui.com/docs/flip + */ +const floating_ui_dom_flip = flip; + +/** + * Provides data that allows you to change the size of the floating element — + * for instance, prevent it from overflowing the clipping boundary or match the + * width of the reference element. + * @see https://floating-ui.com/docs/size + */ +const floating_ui_dom_size = size; + +/** + * Provides data to hide the floating element in applicable situations, such as + * when it is not in the same clipping context as the reference element. + * @see https://floating-ui.com/docs/hide + */ +const floating_ui_dom_hide = (/* unused pure expression or super */ null && (hide$1)); + +/** + * Provides data to position an inner element of the floating element so that it + * appears centered to the reference element. + * @see https://floating-ui.com/docs/arrow + */ +const floating_ui_dom_arrow = arrow; + +/** + * Provides improved positioning for inline reference elements that can span + * over multiple lines, such as hyperlinks or range selections. + * @see https://floating-ui.com/docs/inline + */ +const floating_ui_dom_inline = (/* unused pure expression or super */ null && (inline$1)); + +/** + * Built-in `limiter` that will stop `shift()` at a certain point. + */ +const floating_ui_dom_limitShift = limitShift; + +/** * Computes the `x` and `y` coordinates that will place the floating element - * next to a reference element when it is given a certain CSS positioning - * strategy. + * next to a given reference element. */ const floating_ui_dom_computePosition = (reference, floating, options) => { // This caches the expensive `getClippingElementAncestors` function so that @@ -10862,7 +9801,8 @@ const floating_ui_dom_computePosition = (reference, floating, options) => { -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/SAES3ZFU.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/IRX7SFUJ.js +"use client"; @@ -10888,7 +9828,7 @@ function createDOMRect(x = 0, y = 0, width = 0, height = 0) { bottom: y + height, left: x }; - return PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({}, rect), { toJSON: () => rect }); + return _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, rect), { toJSON: () => rect }); } function getDOMRect(anchorRect) { if (!anchorRect) @@ -10938,7 +9878,7 @@ function getFlipMiddleware(props) { !fallbackPlacements || fallbackPlacements.every(isValidPlacement), false && 0 ); - return floating_ui_core_flip({ + return floating_ui_dom_flip({ padding: props.overflowPadding, fallbackPlacements }); @@ -10946,14 +9886,15 @@ function getFlipMiddleware(props) { function getShiftMiddleware(props) { if (!props.slide && !props.overlap) return; - return floating_ui_core_shift({ + return floating_ui_dom_shift({ mainAxis: props.slide, crossAxis: props.overlap, - padding: props.overflowPadding + padding: props.overflowPadding, + limiter: floating_ui_dom_limitShift() }); } function getSizeMiddleware(props) { - return size({ + return floating_ui_dom_size({ padding: props.overflowPadding, apply({ elements, availableWidth, availableHeight, rects }) { const wrapper = elements.floating; @@ -10985,12 +9926,12 @@ function getSizeMiddleware(props) { function getArrowMiddleware(arrowElement, props) { if (!arrowElement) return; - return arrow({ + return floating_ui_dom_arrow({ element: arrowElement, padding: props.arrowPadding }); } -var usePopover = NQJBHION_createHook( +var usePopover = createHook( (_a) => { var _b = _a, { store, @@ -11031,8 +9972,15 @@ var usePopover = NQJBHION_createHook( "getAnchorRect", "updatePosition" ]); + const context = usePopoverProviderContext(); + store = store || context; + invariant( + store, + false && 0 + ); const arrowElement = store.useState("arrowElement"); const anchorElement = store.useState("anchorElement"); + const disclosureElement = store.useState("disclosureElement"); const popoverElement = store.useState("popoverElement"); const contentElement = store.useState("contentElement"); const placement = store.useState("placement"); @@ -11057,7 +10005,7 @@ var usePopover = NQJBHION_createHook( const middleware = [ getOffsetMiddleware(arrowElement, { gutter, shift: shift2 }), getFlipMiddleware({ flip: flip2, overflowPadding }), - getShiftMiddleware({ slide, overlap, overflowPadding }), + getShiftMiddleware({ slide, shift: shift2, overlap, overflowPadding }), getArrowMiddleware(arrowElement, { arrowPadding }), getSizeMiddleware({ sameWidth, @@ -11070,7 +10018,7 @@ var usePopover = NQJBHION_createHook( strategy: fixed ? "fixed" : "absolute", middleware }); - store.setState("currentPlacement", pos.placement); + store == null ? void 0 : store.setState("currentPlacement", pos.placement); setPositioned(true); const x = roundByDPR(pos.x); const y = roundByDPR(pos.y); @@ -11152,17 +10100,17 @@ var usePopover = NQJBHION_createHook( props, (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)( "div", - PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({ + _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ role: "presentation" }, wrapperProps), { - style: PNRLI7OV_spreadValues({ + style: _4R3V3JGP_spreadValues({ // https://floating-ui.com/docs/computeposition#initial-layout position, top: 0, left: 0, width: "max-content" }, wrapperProps == null ? void 0 : wrapperProps.style), - ref: store.setPopoverElement, + ref: store == null ? void 0 : store.setPopoverElement, children: element }) ), @@ -11170,25 +10118,26 @@ var usePopover = NQJBHION_createHook( ); props = useWrapElement( props, - (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(PopoverContext.Provider, { value: store, children: element }), + (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(PopoverScopedContextProvider, { value: store, children: element }), [store] ); - props = PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({ + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ // data-placing is not part of the public API. We're setting this here so // we can wait for the popover to be positioned before other components // move focus into it. For example, this attribute is observed by the // Combobox component with the autoSelect behavior. "data-placing": !positioned ? "" : void 0 }, props), { - style: PNRLI7OV_spreadValues({ + style: _4R3V3JGP_spreadValues({ position: "relative" }, props.style) }); - props = useDialog(PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({ + props = useDialog(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ store, modal, - preserveTabOrder, portal, + preserveTabOrder, + preserveTabOrderAnchor: disclosureElement || anchorElement, autoFocusOnShow: positioned && autoFocusOnShow }, props), { portalRef @@ -11196,15 +10145,21 @@ var usePopover = NQJBHION_createHook( return props; } ); -var Popover = NQJBHION_createComponent((props) => { - const htmlProps = usePopover(props); - return NQJBHION_createElement("div", htmlProps); -}); +var Popover = createDialogComponent( + createComponent((props) => { + const htmlProps = usePopover(props); + return _3ORBWXWF_createElement("div", htmlProps); + }), + usePopoverProviderContext +); if (false) {} -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/BB7NHN6A.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/QWSZGSIG.js +"use client"; + + @@ -11218,45 +10173,27 @@ if (false) {} + function isMovingOnHovercard(target, card, anchor, nested) { - if (focus_hasFocusWithin(card)) + if (hasFocusWithin(card)) return true; if (!target) return false; - if (O35LWD4W_contains(card, target)) + if (contains(card, target)) return true; - if (anchor && O35LWD4W_contains(anchor, target)) + if (anchor && contains(anchor, target)) return true; if (nested == null ? void 0 : nested.some((card2) => isMovingOnHovercard(target, card2, anchor))) { return true; } return false; } -function useAutoFocusOnShow(_a) { - var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); - const open = store.useState("open"); - const openRef = J7Q2EO23_useLiveRef(open); - (0,external_React_.useEffect)(() => { - if (!open) { - store.setAutoFocusOnShow(false); - } - }, [open, store]); - (0,external_React_.useEffect)( - () => () => { - if (!openRef.current) { - store.setAutoFocusOnShow(false); - } - }, - [store] - ); - const modal = !!props.modal; - const autoFocusOnShow = store.useState( - (state) => modal || state.autoFocusOnShow - ); - return PNRLI7OV_spreadValues({ autoFocusOnShow }, props); -} function useAutoFocusOnHide(_a) { - var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); + var _b = _a, { + store + } = _b, props = __objRest(_b, [ + "store" + ]); const [autoFocusOnHide, setAutoFocusOnHide] = (0,external_React_.useState)(false); const mounted = store.useState("mounted"); (0,external_React_.useEffect)(() => { @@ -11273,14 +10210,11 @@ function useAutoFocusOnHide(_a) { }); const finalFocusRef = (0,external_React_.useRef)(null); (0,external_React_.useEffect)(() => { - return store.sync( - (state) => { - finalFocusRef.current = state.anchorElement; - }, - ["anchorElement"] - ); + return sync(store, ["anchorElement"], (state) => { + finalFocusRef.current = state.anchorElement; + }); }, []); - props = PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({ + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ autoFocusOnHide, finalFocus: finalFocusRef }, props), { @@ -11289,7 +10223,7 @@ function useAutoFocusOnHide(_a) { return props; } var NestedHovercardContext = (0,external_React_.createContext)(null); -var useHovercard = NQJBHION_createHook( +var useHovercard = createHook( (_a) => { var _b = _a, { store, @@ -11306,6 +10240,12 @@ var useHovercard = NQJBHION_createHook( "hideOnHoverOutside", "disablePointerEventsOnApproach" ]); + const context = useHovercardProviderContext(); + store = store || context; + invariant( + store, + false && 0 + ); const ref = (0,external_React_.useRef)(null); const [nestedHovercards, setNestedHovercards] = (0,external_React_.useState)([]); const hideTimeoutRef = (0,external_React_.useRef)(0); @@ -11317,6 +10257,7 @@ var useHovercard = NQJBHION_createHook( const disablePointerEventsProp = useBooleanEvent( disablePointerEventsOnApproach ); + const open = store.useState("open"); const mounted = store.useState("mounted"); (0,external_React_.useEffect)(() => { if (!domReady) @@ -11329,12 +10270,14 @@ var useHovercard = NQJBHION_createHook( if (!element) return; const onMouseMove = (event) => { + if (!store) + return; const { anchorElement, hideTimeout, timeout } = store.getState(); const enterPoint = enterPointRef.current; - const target = event.target; + const [target] = event.composedPath(); const anchor = anchorElement; if (isMovingOnHovercard(target, element, anchor, nestedHovercards)) { - enterPointRef.current = target && anchor && O35LWD4W_contains(anchor, target) ? getEventPoint(event) : null; + enterPointRef.current = target && anchor && contains(anchor, target) ? getEventPoint(event) : null; window.clearTimeout(hideTimeoutRef.current); hideTimeoutRef.current = 0; return; @@ -11357,7 +10300,7 @@ var useHovercard = NQJBHION_createHook( return; hideTimeoutRef.current = window.setTimeout(() => { hideTimeoutRef.current = 0; - store.hide(); + store == null ? void 0 : store.hide(); }, hideTimeout != null ? hideTimeout : timeout); }; return chain( @@ -11404,6 +10347,23 @@ var useHovercard = NQJBHION_createHook( addGlobalEventListener("mouseleave", disableEvent, true) ); }, [domReady, mounted, mayDisablePointerEvents, disablePointerEventsProp]); + (0,external_React_.useEffect)(() => { + if (!domReady) + return; + if (open) + return; + store == null ? void 0 : store.setAutoFocusOnShow(false); + }, [store, domReady, open]); + const openRef = useLiveRef(open); + (0,external_React_.useEffect)(() => { + if (!domReady) + return; + return () => { + if (!openRef.current) { + store == null ? void 0 : store.setAutoFocusOnShow(false); + } + }; + }, [store, domReady]); const registerOnParent = (0,external_React_.useContext)(NestedHovercardContext); useSafeLayoutEffect(() => { if (modal) @@ -11434,48 +10394,53 @@ var useHovercard = NQJBHION_createHook( ); props = useWrapElement( props, - (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(NestedHovercardContext.Provider, { value: registerNestedHovercard, children: element }), - [registerNestedHovercard] + (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(HovercardScopedContextProvider, { value: store, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(NestedHovercardContext.Provider, { value: registerNestedHovercard, children: element }) }), + [store, registerNestedHovercard] ); - props = PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({}, props), { + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { ref: useMergeRefs(ref, props.ref) }); - props = useAutoFocusOnHide(PNRLI7OV_spreadValues({ store }, props)); - props = useAutoFocusOnShow(PNRLI7OV_spreadValues({ store, modal }, props)); - props = usePopover(PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({ + props = useAutoFocusOnHide(_4R3V3JGP_spreadValues({ store }, props)); + const autoFocusOnShow = store.useState( + (state) => modal || state.autoFocusOnShow + ); + props = usePopover(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ store, modal, - portal + portal, + autoFocusOnShow }, props), { portalRef, hideOnEscape(event) { if (isFalsyBooleanCallback(hideOnEscape, event)) return false; - requestAnimationFrame(() => requestAnimationFrame(store.hide)); + requestAnimationFrame(() => { + requestAnimationFrame(() => { + store == null ? void 0 : store.hide(); + }); + }); return true; } })); return props; } ); -var Hovercard = NQJBHION_createComponent((props) => { - const htmlProps = useHovercard(props); - return NQJBHION_createElement("div", htmlProps); -}); +var Hovercard = createDialogComponent( + createComponent((props) => { + const htmlProps = useHovercard(props); + return _3ORBWXWF_createElement("div", htmlProps); + }), + useHovercardProviderContext +); if (false) {} -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/Z5BJMNGY.js -// src/tooltip/tooltip-context.ts - -var TooltipContext = (0,external_React_.createContext)( - void 0 -); +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/tooltip/tooltip.js +"use client"; -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/tooltip/tooltip.js @@ -11519,7 +10484,7 @@ var TooltipContext = (0,external_React_.createContext)( -var useTooltip = NQJBHION_createHook( +var useTooltip = createHook( (_a) => { var _b = _a, { store, @@ -11536,16 +10501,22 @@ var useTooltip = NQJBHION_createHook( "hideOnHoverOutside", "hideOnInteractOutside" ]); + const context = useTooltipProviderContext(); + store = store || context; + invariant( + store, + false && 0 + ); props = useWrapElement( props, - (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(TooltipContext.Provider, { value: store, children: element }), + (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(TooltipScopedContextProvider, { value: store, children: element }), [store] ); const role = store.useState( (state) => state.type === "description" ? "tooltip" : "none" ); - props = PNRLI7OV_spreadValues({ role }, props); - props = useHovercard(PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({}, props), { + props = _4R3V3JGP_spreadValues({ role }, props); + props = useHovercard(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { store, portal, gutter, @@ -11553,7 +10524,7 @@ var useTooltip = NQJBHION_createHook( hideOnHoverOutside: (event) => { if (isFalsyBooleanCallback(hideOnHoverOutside, event)) return false; - const { anchorElement } = store.getState(); + const anchorElement = store == null ? void 0 : store.getState().anchorElement; if (!anchorElement) return true; if ("focusVisible" in anchorElement.dataset) @@ -11563,10 +10534,10 @@ var useTooltip = NQJBHION_createHook( hideOnInteractOutside: (event) => { if (isFalsyBooleanCallback(hideOnInteractOutside, event)) return false; - const { anchorElement } = store.getState(); + const anchorElement = store == null ? void 0 : store.getState().anchorElement; if (!anchorElement) return true; - if (O35LWD4W_contains(anchorElement, event.target)) + if (contains(anchorElement, event.target)) return false; return true; } @@ -11574,15 +10545,20 @@ var useTooltip = NQJBHION_createHook( return props; } ); -var Tooltip = NQJBHION_createComponent((props) => { - const htmlProps = useTooltip(props); - return NQJBHION_createElement("div", htmlProps); -}); +var Tooltip = createDialogComponent( + createComponent((props) => { + const htmlProps = useTooltip(props); + return _3ORBWXWF_createElement("div", htmlProps); + }), + useTooltipProviderContext +); if (false) {} +;// CONCATENATED MODULE: external ["wp","element"] +const external_wp_element_namespaceObject = window["wp"]["element"]; ;// CONCATENATED MODULE: external ["wp","deprecated"] -var external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; +const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/shortcut/index.js @@ -11620,12 +10596,12 @@ function Shortcut(props) { displayText = shortcut.display; ariaLabel = shortcut.ariaLabel; } - return (0,external_wp_element_namespaceObject.createElement)("span", { + return (0,external_React_.createElement)("span", { className: className, "aria-label": ariaLabel }, displayText); } -/* harmony default export */ var build_module_shortcut = (Shortcut); +/* harmony default export */ const build_module_shortcut = (Shortcut); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/utils.js /** @@ -11882,6 +10858,7 @@ const computePopoverPosition = c => c === null || Number.isNaN(c) ? undefined : /** * External dependencies */ +// eslint-disable-next-line no-restricted-imports /** @@ -11897,12 +10874,18 @@ const computePopoverPosition = c => c === null || Number.isNaN(c) ? undefined : +const TooltipInternalContext = (0,external_wp_element_namespaceObject.createContext)({ + isNestedInTooltip: false +}); /** * Time over anchor to wait before showing tooltip */ const TOOLTIP_DELAY = 700; -function tooltip_Tooltip(props) { +const CONTEXT_VALUE = { + isNestedInTooltip: true +}; +function UnforwardedTooltip(props, ref) { const { children, delay = TOOLTIP_DELAY, @@ -11910,8 +10893,12 @@ function tooltip_Tooltip(props) { placement, position, shortcut, - text + text, + ...restProps } = props; + const { + isNestedInTooltip + } = (0,external_wp_element_namespaceObject.useContext)(TooltipInternalContext); const baseId = (0,external_wp_compose_namespaceObject.useInstanceId)(tooltip_Tooltip, 'tooltip'); const describedById = text || shortcut ? baseId : undefined; const isOnlyChild = external_wp_element_namespaceObject.Children.count(children) === 1; @@ -11935,37 +10922,51 @@ function tooltip_Tooltip(props) { }); } computedPlacement = computedPlacement || 'bottom'; - const tooltipStore = useTooltipStore({ + + // Removing the `Ariakit` namespace from the hook name allows ESLint to + // properly identify the hook, and apply the correct linting rules. + const useAriakitTooltipStore = useTooltipStore; + const tooltipStore = useAriakitTooltipStore({ placement: computedPlacement, - timeout: delay + showTimeout: delay }); - const isTooltipOpen = tooltipStore.useState('open'); - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(TooltipAnchor, { - onBlur: tooltipStore.hide, + if (isNestedInTooltip) { + return isOnlyChild ? (0,external_React_.createElement)(Role, { + ...restProps, + render: children + }) : children; + } + return (0,external_React_.createElement)(TooltipInternalContext.Provider, { + value: CONTEXT_VALUE + }, (0,external_React_.createElement)(TooltipAnchor, { onClick: hideOnClick ? tooltipStore.hide : undefined, store: tooltipStore, - render: isOnlyChild ? children : undefined - }, isOnlyChild ? undefined : children), isOnlyChild && (text || shortcut) && isTooltipOpen && (0,external_wp_element_namespaceObject.createElement)(Tooltip, { + render: isOnlyChild ? children : undefined, + ref: ref + }, isOnlyChild ? undefined : children), isOnlyChild && (text || shortcut) && (0,external_React_.createElement)(Tooltip, { + ...restProps, className: "components-tooltip", + unmountOnHide: true, gutter: 4, id: describedById, overflowPadding: 0.5, store: tooltipStore - }, text, shortcut && (0,external_wp_element_namespaceObject.createElement)(build_module_shortcut, { + }, text, shortcut && (0,external_React_.createElement)(build_module_shortcut, { className: text ? 'components-tooltip__shortcut' : '', shortcut: shortcut }))); } -/* harmony default export */ var tooltip = (tooltip_Tooltip); +const tooltip_Tooltip = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTooltip); +/* harmony default export */ const tooltip = (tooltip_Tooltip); ;// CONCATENATED MODULE: external ["wp","warning"] -var external_wp_warning_namespaceObject = window["wp"]["warning"]; +const external_wp_warning_namespaceObject = window["wp"]["warning"]; var external_wp_warning_default = /*#__PURE__*/__webpack_require__.n(external_wp_warning_namespaceObject); // EXTERNAL MODULE: ./node_modules/deepmerge/dist/cjs.js -var cjs = __webpack_require__(1919); +var cjs = __webpack_require__(66); var cjs_default = /*#__PURE__*/__webpack_require__.n(cjs); // EXTERNAL MODULE: ./node_modules/fast-deep-equal/es6/index.js -var es6 = __webpack_require__(5619); +var es6 = __webpack_require__(7734); var es6_default = /*#__PURE__*/__webpack_require__.n(es6); ;// CONCATENATED MODULE: ./node_modules/is-plain-object/dist/is-plain-object.mjs /*! @@ -11979,7 +10980,7 @@ function is_plain_object_isObject(o) { return Object.prototype.toString.call(o) === '[object Object]'; } -function is_plain_object_isPlainObject(o) { +function isPlainObject(o) { var ctor,prot; if (is_plain_object_isObject(o) === false) return false; @@ -12012,7 +11013,7 @@ function is_plain_object_isPlainObject(o) { /** * A `React.useEffect` that will not run on the first render. * Source: - * https://github.com/reakit/reakit/blob/HEAD/packages/reakit-utils/src/useUpdateEffect.ts + * https://github.com/ariakit/ariakit/blob/reakit/packages/reakit-utils/src/useUpdateEffect.ts * * @param {import('react').EffectCallback} effect * @param {import('react').DependencyList} deps @@ -12032,9 +11033,9 @@ function use_update_effect_useUpdateEffect(effect, deps) { // eslint-disable-next-line react-hooks/exhaustive-deps }, deps); } -/* harmony default export */ var use_update_effect = (use_update_effect_useUpdateEffect); +/* harmony default export */ const use_update_effect = (use_update_effect_useUpdateEffect); -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/context/context-system-provider.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/context/context-system-provider.js /** * External dependencies @@ -12095,7 +11096,7 @@ function useContextSystemBridge({ const config = (0,external_wp_element_namespaceObject.useMemo)(() => { // Deep clone `parentContext` to avoid mutating it later. return cjs_default()(parentContext !== null && parentContext !== void 0 ? parentContext : {}, value !== null && value !== void 0 ? value : {}, { - isMergeableObject: is_plain_object_isPlainObject + isMergeableObject: isPlainObject }); }, [parentContext, value]); return config; @@ -12125,13 +11126,13 @@ const BaseContextSystemProvider = ({ const contextValue = useContextSystemBridge({ value }); - return (0,external_wp_element_namespaceObject.createElement)(ComponentsContext.Provider, { + return (0,external_React_.createElement)(ComponentsContext.Provider, { value: contextValue }, children); }; const ContextSystemProvider = (0,external_wp_element_namespaceObject.memo)(BaseContextSystemProvider); -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/context/constants.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/context/constants.js const COMPONENT_NAMESPACE = 'data-wp-component'; const CONNECTED_NAMESPACE = 'data-wp-c16t'; @@ -12141,7 +11142,7 @@ const CONNECTED_NAMESPACE = 'data-wp-c16t'; */ const CONNECT_STATIC_NAMESPACE = '__contextSystemKey__'; -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/context/utils.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/context/utils.js /** * Internal dependencies */ @@ -12524,7 +11525,7 @@ function __disposeResources(env) { return next(); } -/* harmony default export */ var tslib_es6 = ({ +/* harmony default export */ const tslib_es6 = ({ __extends, __assign, __rest, @@ -12813,7 +11814,7 @@ function memize(fn, options) { -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/context/get-styled-class-name-from-key.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/context/get-styled-class-name-from-key.js /** * External dependencies */ @@ -14254,7 +13255,7 @@ var createCache = function createCache(options) { return cache; }; -/* harmony default export */ var emotion_cache_browser_esm = (createCache); +/* harmony default export */ const emotion_cache_browser_esm = (createCache); ;// CONCATENATED MODULE: ./node_modules/@emotion/hash/dist/emotion-hash.esm.js /* eslint-disable */ @@ -14311,7 +13312,7 @@ function murmur2(str) { return ((h ^ h >>> 15) >>> 0).toString(36); } -/* harmony default export */ var emotion_hash_esm = (murmur2); +/* harmony default export */ const emotion_hash_esm = (murmur2); ;// CONCATENATED MODULE: ./node_modules/@emotion/unitless/dist/emotion-unitless.esm.js var unitlessKeys = { @@ -14363,7 +13364,7 @@ var unitlessKeys = { strokeWidth: 1 }; -/* harmony default export */ var emotion_unitless_esm = (unitlessKeys); +/* harmony default export */ const emotion_unitless_esm = (unitlessKeys); ;// CONCATENATED MODULE: ./node_modules/@emotion/serialize/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js function memoize(fn) { @@ -15041,7 +14042,7 @@ var emotion_css_create_instance_esm_classnames = function classnames(args) { return cls; }; -/* harmony default export */ var emotion_css_create_instance_esm = (createEmotion); +/* harmony default export */ const emotion_css_create_instance_esm = (createEmotion); ;// CONCATENATED MODULE: ./node_modules/@emotion/css/dist/emotion-css.esm.js @@ -15121,7 +14122,7 @@ const useCx = () => { return cx; }; -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/context/use-context-system.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/context/use-context-system.js /** * WordPress dependencies */ @@ -15194,7 +14195,7 @@ function useContextSystem(props, namespace) { return finalComponentProps; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/context/context-connect.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/context/context-connect.js /** * External dependencies */ @@ -15259,7 +14260,7 @@ function _contextConnect(Component, namespace, options) { } // @ts-expect-error We can't rely on inferred types here because of the - // `as` prop polymorphism we're handling in https://github.com/WordPress/gutenberg/blob/9620bae6fef4fde7cc2b7833f416e240207cda29/packages/components/src/ui/context/wordpress-component.ts#L32-L33 + // `as` prop polymorphism we're handling in https://github.com/WordPress/gutenberg/blob/4f3a11243c365f94892e479bff0b922ccc4ccda3/packages/components/src/context/wordpress-component.ts#L32-L33 return Object.assign(WrappedComponent, { [CONNECT_STATIC_NAMESPACE]: [...new Set(mergedNamespace)], displayName: namespace, @@ -15537,7 +14538,7 @@ var createStyled = function createStyled(tag, options) { }; }; -/* harmony default export */ var emotion_styled_base_browser_esm = (createStyled); +/* harmony default export */ const emotion_styled_base_browser_esm = (createStyled); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/view/component.js @@ -15566,7 +14567,7 @@ const View = emotion_styled_base_browser_esm("div", true ? { } : 0)( true ? "" : 0); View.selector = '.components-view'; View.displayName = 'View'; -/* harmony default export */ var component = (View); +/* harmony default export */ const component = (View); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/visually-hidden/component.js @@ -15586,7 +14587,7 @@ function UnconnectedVisuallyHidden(props, forwardedRef) { style: styleProp, ...contextProps } = useContextSystem(props, 'VisuallyHidden'); - return (0,external_wp_element_namespaceObject.createElement)(component, { + return (0,external_React_.createElement)(component, { ref: forwardedRef, ...contextProps, style: { @@ -15613,13 +14614,14 @@ function UnconnectedVisuallyHidden(props, forwardedRef) { * ``` */ const component_VisuallyHidden = contextConnect(UnconnectedVisuallyHidden, 'VisuallyHidden'); -/* harmony default export */ var visually_hidden_component = (component_VisuallyHidden); +/* harmony default export */ const visually_hidden_component = (component_VisuallyHidden); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/utils.js /** * WordPress dependencies */ + /** * Internal dependencies */ @@ -15644,15 +14646,20 @@ const ALIGNMENT_LABEL = { const ALIGNMENTS = GRID.flat(); /** - * Parses and transforms an incoming value to better match the alignment values + * Normalizes and transforms an incoming value to better match the alignment values * * @param value An alignment value to parse. * * @return The parsed value. */ -function transformValue(value) { - const nextValue = value === 'center' ? 'center center' : value; - return nextValue.replace('-', ' '); +function normalize(value) { + const normalized = value === 'center' ? 'center center' : value; + + // Strictly speaking, this could be `string | null | undefined`, + // but will be validated shortly, so we're typecasting to an + // `AlignmentMatrixControlValue` to keep TypeScript happy. + const transformed = normalized?.replace('-', ' '); + return ALIGNMENTS.includes(transformed) ? transformed : undefined; } /** @@ -15664,8 +14671,22 @@ function transformValue(value) { * @return The item id. */ function getItemId(prefixId, value) { - const valueId = transformValue(value).replace(' ', '-'); - return `${prefixId}-${valueId}`; + const normalized = normalize(value); + if (!normalized) return; + const id = normalized.replace(' ', '-'); + return `${prefixId}-${id}`; +} + +/** + * Extracts an item value from its ID + * + * @param prefixId An ID prefix to remove + * @param id An item ID + * @return The item value + */ +function getItemValue(prefixId, id) { + const value = id?.replace(prefixId + '-', ''); + return normalize(value); } /** @@ -15676,13 +14697,14 @@ function getItemId(prefixId, value) { * @return The index of a matching alignment. */ function getAlignmentIndex(alignment = 'center') { - const item = transformValue(alignment); - const index = ALIGNMENTS.indexOf(item); + const normalized = normalize(alignment); + if (!normalized) return undefined; + const index = ALIGNMENTS.indexOf(normalized); return index > -1 ? index : undefined; } // EXTERNAL MODULE: ./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js -var hoist_non_react_statics_cjs = __webpack_require__(1281); +var hoist_non_react_statics_cjs = __webpack_require__(1880); ;// CONCATENATED MODULE: ./node_modules/@emotion/react/dist/emotion-react.browser.esm.js @@ -16050,40 +15072,10 @@ if (false) { var globalKey, globalContext, isTestEnv, emotion_react_browser_esm_ -;// CONCATENATED MODULE: ./node_modules/colord/index.mjs -var r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},colord_n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},colord_e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},colord_a=function(r){return{r:colord_e(r.r,0,255),g:colord_e(r.g,0,255),b:colord_e(r.b,0,255),a:colord_e(r.a)}},colord_o=function(r){return{r:colord_n(r.r),g:colord_n(r.g),b:colord_n(r.b),a:colord_n(r.a,3)}},i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:colord_e(r.s,0,100),l:colord_e(r.l,0,100),a:colord_e(r.a)}},d=function(r){return{h:colord_n(r.h),s:colord_n(r.s),l:colord_n(r.l),a:colord_n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y={string:[[function(r){var t=i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?colord_n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?colord_n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:colord_a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(t){var n=l.exec(t)||p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u="deg"),Number(e)*(r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},"hsl"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?colord_a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},"rgb"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},"hsl"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:colord_e(r.s,0,100),v:colord_e(r.v,0,100),a:colord_e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},"hsv"]]},N=function(r,t){for(var n=0;n<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return"string"==typeof r?N(r.trim(),y.string):"object"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:colord_e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:colord_e(n.l+100*t,0,100),a:n.a}},j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return colord_n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.5},r.prototype.toHex=function(){return r=colord_o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(colord_n(255*a)):"","#"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return colord_o(this.rgba)},r.prototype.toRgbString=function(){return r=colord_o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?"rgba("+t+", "+n+", "+e+", "+u+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:colord_n(r.h),s:colord_n(r.s),v:colord_n(r.v),a:colord_n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return"number"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):colord_n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return"number"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):colord_n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof j?r:new j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(j,y),S.push(r))})},E=function(){return new j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})}; - -;// CONCATENATED MODULE: ./node_modules/colord/plugins/names.mjs -/* harmony default export */ function names(e,f){var a={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var d in a)r[a[d]]=d;var l={};e.prototype.toName=function(f){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var d,i,n=r[this.toHex()];if(n)return n;if(null==f?void 0:f.closest){var o=this.toRgb(),t=1/0,b="black";if(!l.length)for(var c in a)l[c]=new e(a[c]).toRgb();for(var g in a){var u=(d=o,i=l[g],Math.pow(d.r-i.r,2)+Math.pow(d.g-i.g,2)+Math.pow(d.b-i.b,2));u<t&&(t=u,b=g)}return b}};f.string.push([function(f){var r=f.toLowerCase(),d="transparent"===r?"#0000":a[r];return d?new e(d).toRgb():null},"name"])} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/colors.js -/** - * External dependencies - */ - - -k([names]); - -/** - * Generating a CSS compliant rgba() color value. - * - * @param {string} hexValue The hex value to convert to rgba(). - * @param {number} alpha The alpha value for opacity. - * @return {string} The converted rgba() color value. - * - * @example - * rgba( '#000000', 0.5 ) - * // rgba(0, 0, 0, 0.5) - */ -function rgba(hexValue = '', alpha = 1) { - return w(hexValue).alpha(alpha).toRgbString(); -} - ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/colors-values.js /** * Internal dependencies */ - const white = '#fff'; // Matches the grays in @wordpress/base-styles @@ -16110,39 +15102,63 @@ const ALERT = { green: '#4ab866' }; -// Matches the Modern admin scheme in @wordpress/base-styles -const ADMIN = { - theme: 'var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9))', - themeDark10: 'var(--wp-components-color-accent-darker-10, var(--wp-admin-theme-color-darker-10, #2145e6))' +// Should match packages/components/src/utils/theme-variables.scss +const THEME = { + accent: `var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9))`, + accentDarker10: `var(--wp-components-color-accent-darker-10, var(--wp-admin-theme-color-darker-10, #2145e6))`, + accentDarker20: `var(--wp-components-color-accent-darker-20, var(--wp-admin-theme-color-darker-20, #183ad6))`, + /** Used when placing text on the accent color. */ + accentInverted: `var(--wp-components-color-accent-inverted, ${white})`, + background: `var(--wp-components-color-background, ${white})`, + foreground: `var(--wp-components-color-foreground, ${GRAY[900]})`, + /** Used when placing text on the foreground color. */ + foregroundInverted: `var(--wp-components-color-foreground-inverted, ${white})`, + gray: { + /** @deprecated Use `COLORS.theme.foreground` instead. */ + 900: `var(--wp-components-color-foreground, ${GRAY[900]})`, + 800: `var(--wp-components-color-gray-800, ${GRAY[800]})`, + 700: `var(--wp-components-color-gray-700, ${GRAY[700]})`, + 600: `var(--wp-components-color-gray-600, ${GRAY[600]})`, + 400: `var(--wp-components-color-gray-400, ${GRAY[400]})`, + 300: `var(--wp-components-color-gray-300, ${GRAY[300]})`, + 200: `var(--wp-components-color-gray-200, ${GRAY[200]})`, + 100: `var(--wp-components-color-gray-100, ${GRAY[100]})` + } }; const UI = { - background: white, - backgroundDisabled: GRAY[100], - border: GRAY[600], - borderHover: GRAY[700], - borderFocus: ADMIN.theme, - borderDisabled: GRAY[400], - textDisabled: GRAY[600], - textDark: white, + background: THEME.background, + backgroundDisabled: THEME.gray[100], + border: THEME.gray[600], + borderHover: THEME.gray[700], + borderFocus: THEME.accent, + borderDisabled: THEME.gray[400], + textDisabled: THEME.gray[600], // Matches @wordpress/base-styles - darkGrayPlaceholder: rgba(GRAY[900], 0.62), - lightGrayPlaceholder: rgba(white, 0.65) -}; -const THEME = { - accent: ADMIN.theme, - accentDarker10: ADMIN.themeDark10 + darkGrayPlaceholder: `color-mix(in srgb, ${THEME.foreground}, transparent 38%)`, + lightGrayPlaceholder: `color-mix(in srgb, ${THEME.background}, transparent 35%)` }; const COLORS = Object.freeze({ /** * The main gray color object. + * + * @deprecated Use semantic aliases in `COLORS.ui` or theme-ready variables in `COLORS.theme.gray`. */ gray: GRAY, + // TODO: Stop exporting this when everything is migrated to `theme` or `ui` white, alert: ALERT, + /** + * Theme-ready variables with fallbacks. + * + * Prefer semantic aliases in `COLORS.ui` when applicable. + */ theme: THEME, + /** + * Semantic aliases (prefer these over raw variables when applicable). + */ ui: UI }); -/* harmony default export */ var colors_values = ((/* unused pure expression or super */ null && (COLORS))); +/* harmony default export */ const colors_values = ((/* unused pure expression or super */ null && (COLORS))); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/reduce-motion.js /** @@ -16243,1215 +15259,578 @@ const Cell = emotion_styled_base_browser_esm("span", true ? { function cell_Cell({ + id, isActive = false, value, ...props }) { const tooltipText = ALIGNMENT_LABEL[value]; - return (0,external_wp_element_namespaceObject.createElement)(tooltip, { + return (0,external_React_.createElement)(tooltip, { text: tooltipText - }, (0,external_wp_element_namespaceObject.createElement)(CompositeItem, { - as: Cell, - role: "gridcell", - ...props - }, (0,external_wp_element_namespaceObject.createElement)(visually_hidden_component, null, value), (0,external_wp_element_namespaceObject.createElement)(Point, { + }, (0,external_React_.createElement)(CompositeItem, { + id: id, + render: (0,external_React_.createElement)(Cell, { + ...props, + role: "gridcell" + }) + }, (0,external_React_.createElement)(visually_hidden_component, null, value), (0,external_React_.createElement)(Point, { isActive: isActive, role: "presentation" }))); } -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/useSealedState.js - - -/** - * React custom hook that returns the very first value passed to `initialState`, - * even if it changes between re-renders. - */ -function useSealedState(initialState) { - var _React$useState = (0,external_React_.useState)(initialState), - sealed = _React$useState[0]; - - return sealed; -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/reverse-30eaa122.js - - -function groupItems(items) { - var groups = [[]]; - - var _loop = function _loop() { - var item = _step.value; - var group = groups.find(function (g) { - return !g[0] || g[0].groupId === item.groupId; - }); - - if (group) { - group.push(item); - } else { - groups.push([item]); - } - }; - - for (var _iterator = _createForOfIteratorHelperLoose(items), _step; !(_step = _iterator()).done;) { - _loop(); - } - - return groups; -} - -function flatten(grid) { - var flattened = []; - - for (var _iterator = _createForOfIteratorHelperLoose(grid), _step; !(_step = _iterator()).done;) { - var row = _step.value; - flattened.push.apply(flattened, row); - } - - return flattened; -} - -function reverse(array) { - return array.slice().reverse(); -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/findEnabledItemById-8ddca752.js -function findEnabledItemById(items, id) { - if (!id) return undefined; - return items === null || items === void 0 ? void 0 : items.find(function (item) { - return item.id === id && !item.disabled; - }); -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/applyState.js -function applyState_isUpdater(argument) { - return typeof argument === "function"; -} -/** - * Receives a `setState` argument and calls it with `currentValue` if it's a - * function. Otherwise return the argument as the new value. - * - * @example - * import { applyState } from "reakit-utils"; - * - * applyState((value) => value + 1, 1); // 2 - * applyState(2, 1); // 2 - */ - - -function applyState_applyState(argument, currentValue) { - if (applyState_isUpdater(argument)) { - return argument(currentValue); - } - - return argument; -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/Id/IdState.js - - - - -function unstable_useIdState(initialState) { - if (initialState === void 0) { - initialState = {}; - } +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/Y6GYTNQ2.js +"use client"; - var _useSealedState = useSealedState(initialState), - initialBaseId = _useSealedState.baseId; - var generateId = (0,external_React_.useContext)(unstable_IdContext); - var idCountRef = (0,external_React_.useRef)(0); - var _React$useState = (0,external_React_.useState)(function () { - return initialBaseId || generateId(); - }), - baseId = _React$useState[0], - setBaseId = _React$useState[1]; - - return { - baseId: baseId, - setBaseId: setBaseId, - unstable_idCountRef: idCountRef - }; -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/Composite/CompositeState.js - - - - - - - - - - - - -function isElementPreceding(element1, element2) { - return Boolean(element2.compareDocumentPosition(element1) & Node.DOCUMENT_POSITION_PRECEDING); -} - -function findDOMIndex(items, item) { - return items.findIndex(function (currentItem) { - if (!currentItem.ref.current || !item.ref.current) { - return false; - } - - return isElementPreceding(item.ref.current, currentItem.ref.current); - }); -} - -function getMaxLength(rows) { - var maxLength = 0; - - for (var _iterator = _createForOfIteratorHelperLoose(rows), _step; !(_step = _iterator()).done;) { - var length = _step.value.length; - - if (length > maxLength) { - maxLength = length; - } - } - - return maxLength; -} - -/** - * Turns [row1, row1, row2, row2] into [row1, row2, row1, row2] - */ - -function verticalizeItems(items) { - var groups = groupItems(items); - var maxLength = getMaxLength(groups); - var verticalized = []; - - for (var i = 0; i < maxLength; i += 1) { - for (var _iterator = _createForOfIteratorHelperLoose(groups), _step; !(_step = _iterator()).done;) { - var group = _step.value; - - if (group[i]) { - verticalized.push(_objectSpread2(_objectSpread2({}, group[i]), {}, { - // If there's no groupId, it means that it's not a grid composite, - // but a single row instead. So, instead of verticalizing it, that - // is, assigning a different groupId based on the column index, we - // keep it undefined so they will be part of the same group. - // It's useful when using up/down on one-dimensional composites. - groupId: group[i].groupId ? "" + i : undefined - })); - } - } - } +// src/collection/collection-store.ts - return verticalized; +function useCollectionStoreProps(store, update, props) { + useUpdateEffect(update, [props.store]); + useStoreProps(store, props, "items", "setItems"); + return store; } - -function createEmptyItem(groupId) { - return { - id: "__EMPTY_ITEM__", - disabled: true, - ref: { - current: null - }, - groupId: groupId - }; +function useCollectionStore(props = {}) { + const [store, update] = useStore(Core.createCollectionStore, props); + return useCollectionStoreProps(store, update, props); } -/** - * Turns [[row1, row1], [row2]] into [[row1, row1], [row2, row2]] - */ - - -function fillGroups(groups, currentId, shift) { - var maxLength = getMaxLength(groups); - for (var _iterator = _createForOfIteratorHelperLoose(groups), _step; !(_step = _iterator()).done;) { - var group = _step.value; - for (var i = 0; i < maxLength; i += 1) { - var item = group[i]; - - if (!item || shift && item.disabled) { - var isFrist = i === 0; - var previousItem = isFrist && shift ? findFirstEnabledItem(group) : group[i - 1]; - group[i] = previousItem && currentId !== (previousItem === null || previousItem === void 0 ? void 0 : previousItem.id) && shift ? previousItem : createEmptyItem(previousItem === null || previousItem === void 0 ? void 0 : previousItem.groupId); - } - } - } - return groups; -} +;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/22K762VQ.js +"use client"; -var nullItem = { - id: null, - ref: { - current: null - } -}; -function placeItemsAfter(items, id, shouldInsertNullItem) { - var index = items.findIndex(function (item) { - return item.id === id; - }); - return [].concat(items.slice(index + 1), shouldInsertNullItem ? [nullItem] : [], items.slice(0, index)); -} -function getItemsInGroup(items, groupId) { - return items.filter(function (item) { - return item.groupId === groupId; - }); -} -var map = { - horizontal: "vertical", - vertical: "horizontal" -}; -function getOppositeOrientation(orientation) { - return orientation && map[orientation]; -} -function addItemAtIndex(array, item, index) { - if (!(index in array)) { - return [].concat(array, [item]); - } - return [].concat(array.slice(0, index), [item], array.slice(index)); +// src/collection/collection-store.ts +function isElementPreceding(a, b) { + return Boolean( + b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING + ); } - function sortBasedOnDOMPosition(items) { - var pairs = items.map(function (item, index) { - return [index, item]; - }); - var isOrderDifferent = false; - pairs.sort(function (_ref, _ref2) { - var indexA = _ref[0], - a = _ref[1]; - var indexB = _ref2[0], - b = _ref2[1]; - var elementA = a.ref.current; - var elementB = b.ref.current; - if (!elementA || !elementB) return 0; // a before b - + const pairs = items.map((item, index) => [index, item]); + let isOrderDifferent = false; + pairs.sort(([indexA, a], [indexB, b]) => { + const elementA = a.element; + const elementB = b.element; + if (elementA === elementB) + return 0; + if (!elementA || !elementB) + return 0; if (isElementPreceding(elementA, elementB)) { if (indexA > indexB) { isOrderDifferent = true; } - return -1; - } // a after b - - + } if (indexA < indexB) { isOrderDifferent = true; } - return 1; }); - if (isOrderDifferent) { - return pairs.map(function (_ref3) { - var _ = _ref3[0], - item = _ref3[1]; - return item; - }); + return pairs.map(([_, item]) => item); } - return items; } - -function setItemsBasedOnDOMPosition(items, setItems) { - var sortedItems = sortBasedOnDOMPosition(items); - - if (items !== sortedItems) { - setItems(sortedItems); - } -} - function getCommonParent(items) { - var _firstItem$ref$curren; - - var firstItem = items[0], - nextItems = items.slice(1); - var parentElement = firstItem === null || firstItem === void 0 ? void 0 : (_firstItem$ref$curren = firstItem.ref.current) === null || _firstItem$ref$curren === void 0 ? void 0 : _firstItem$ref$curren.parentElement; - - var _loop = function _loop() { - var parent = parentElement; - - if (nextItems.every(function (item) { - return parent.contains(item.ref.current); - })) { - return { - v: parentElement - }; + var _a; + const firstItem = items.find((item) => !!item.element); + const lastItem = [...items].reverse().find((item) => !!item.element); + let parentElement = (_a = firstItem == null ? void 0 : firstItem.element) == null ? void 0 : _a.parentElement; + while (parentElement && (lastItem == null ? void 0 : lastItem.element)) { + const parent = parentElement; + if (lastItem && parent.contains(lastItem.element)) { + return parentElement; } - parentElement = parentElement.parentElement; - }; - - while (parentElement) { - var _ret = _loop(); - - if (typeof _ret === "object") return _ret.v; } - - return getDocument_getDocument(parentElement).body; -} // istanbul ignore next: JSDOM doesn't support IntersectionObverser -// See https://github.com/jsdom/jsdom/issues/2032 - - -function useIntersectionObserver(items, setItems) { - var previousItems = (0,external_React_.useRef)([]); - (0,external_React_.useEffect)(function () { - var callback = function callback() { - var hasPreviousItems = !!previousItems.current.length; // We don't want to sort items if items have been just registered. - - if (hasPreviousItems) { - setItemsBasedOnDOMPosition(items, setItems); - } - - previousItems.current = items; - }; - - var root = getCommonParent(items); - var observer = new IntersectionObserver(callback, { - root: root - }); - - for (var _iterator = _createForOfIteratorHelperLoose(items), _step; !(_step = _iterator()).done;) { - var item = _step.value; - - if (item.ref.current) { - observer.observe(item.ref.current); - } - } - - return function () { - observer.disconnect(); - }; - }, [items]); + return DLOEKDPY_getDocument(parentElement).body; } - -function useTimeoutObserver(items, setItems) { - (0,external_React_.useEffect)(function () { - var callback = function callback() { - return setItemsBasedOnDOMPosition(items, setItems); - }; - - var timeout = setTimeout(callback, 250); - return function () { - return clearTimeout(timeout); - }; - }); +function getPrivateStore(store) { + return store == null ? void 0 : store.__unstablePrivateStore; } - -function useSortBasedOnDOMPosition(items, setItems) { - if (typeof IntersectionObserver === "function") { - useIntersectionObserver(items, setItems); - } else { - useTimeoutObserver(items, setItems); - } -} - -function reducer(state, action) { - var virtual = state.unstable_virtual, - rtl = state.rtl, - orientation = state.orientation, - items = state.items, - groups = state.groups, - currentId = state.currentId, - loop = state.loop, - wrap = state.wrap, - pastIds = state.pastIds, - shift = state.shift, - moves = state.unstable_moves, - includesBaseElement = state.unstable_includesBaseElement, - initialVirtual = state.initialVirtual, - initialRTL = state.initialRTL, - initialOrientation = state.initialOrientation, - initialCurrentId = state.initialCurrentId, - initialLoop = state.initialLoop, - initialWrap = state.initialWrap, - initialShift = state.initialShift, - hasSetCurrentId = state.hasSetCurrentId; - - switch (action.type) { - case "registerGroup": - { - var _group = action.group; // If there are no groups yet, just add it as the first one - - if (groups.length === 0) { - return _objectSpread2(_objectSpread2({}, state), {}, { - groups: [_group] - }); - } // Finds the group index based on DOM position - - - var index = findDOMIndex(groups, _group); - return _objectSpread2(_objectSpread2({}, state), {}, { - groups: addItemAtIndex(groups, _group, index) - }); - } - - case "unregisterGroup": - { - var _id = action.id; - var nextGroups = groups.filter(function (group) { - return group.id !== _id; - }); // The group isn't registered, so do nothing - - if (nextGroups.length === groups.length) { - return state; - } - - return _objectSpread2(_objectSpread2({}, state), {}, { - groups: nextGroups - }); - } - - case "registerItem": - { - var _item = action.item; // Finds the item group based on the DOM hierarchy - - var _group2 = groups.find(function (r) { - var _r$ref$current; - - return (_r$ref$current = r.ref.current) === null || _r$ref$current === void 0 ? void 0 : _r$ref$current.contains(_item.ref.current); - }); // Group will be null if it's a one-dimensional composite - - - var nextItem = _objectSpread2({ - groupId: _group2 === null || _group2 === void 0 ? void 0 : _group2.id - }, _item); - - var _index = findDOMIndex(items, nextItem); - - var nextState = _objectSpread2(_objectSpread2({}, state), {}, { - items: addItemAtIndex(items, nextItem, _index) - }); - - if (!hasSetCurrentId && !moves && initialCurrentId === undefined) { - var _findFirstEnabledItem; - - // Sets currentId to the first enabled item. This runs whenever an item - // is registered because the first enabled item may be registered - // asynchronously. - return _objectSpread2(_objectSpread2({}, nextState), {}, { - currentId: (_findFirstEnabledItem = findFirstEnabledItem(nextState.items)) === null || _findFirstEnabledItem === void 0 ? void 0 : _findFirstEnabledItem.id - }); - } - - return nextState; +function createCollectionStore(props = {}) { + var _a; + throwOnConflictingProps(props, props.store); + const syncState = (_a = props.store) == null ? void 0 : _a.getState(); + const items = defaultValue( + props.items, + syncState == null ? void 0 : syncState.items, + props.defaultItems, + [] + ); + const itemsMap = new Map(items.map((item) => [item.id, item])); + const initialState = { + items, + renderedItems: defaultValue(syncState == null ? void 0 : syncState.renderedItems, []) + }; + const syncPrivateStore = getPrivateStore(props.store); + const privateStore = createStore( + { items, renderedItems: initialState.renderedItems }, + syncPrivateStore + ); + const collection = createStore(initialState, props.store); + const sortItems = (renderedItems) => { + const sortedItems = sortBasedOnDOMPosition(renderedItems); + privateStore.setState("renderedItems", sortedItems); + collection.setState("renderedItems", sortedItems); + }; + setup(collection, () => init(privateStore)); + setup(privateStore, () => { + return batch(privateStore, ["items"], (state) => { + collection.setState("items", state.items); + }); + }); + setup(privateStore, () => { + return batch(privateStore, ["renderedItems"], (state) => { + let firstRun = true; + let raf = requestAnimationFrame(() => { + const { renderedItems } = collection.getState(); + if (state.renderedItems === renderedItems) + return; + sortItems(state.renderedItems); + }); + if (typeof IntersectionObserver !== "function") { + return () => cancelAnimationFrame(raf); } - - case "unregisterItem": - { - var _id2 = action.id; - var nextItems = items.filter(function (item) { - return item.id !== _id2; - }); // The item isn't registered, so do nothing - - if (nextItems.length === items.length) { - return state; - } // Filters out the item that is being removed from the pastIds list - - - var nextPastIds = pastIds.filter(function (pastId) { - return pastId !== _id2; - }); - - var _nextState = _objectSpread2(_objectSpread2({}, state), {}, { - pastIds: nextPastIds, - items: nextItems - }); // If the current item is the item that is being removed, focus pastId - - - if (currentId && currentId === _id2) { - var nextId = includesBaseElement ? null : getCurrentId(_objectSpread2(_objectSpread2({}, _nextState), {}, { - currentId: nextPastIds[0] - })); - return _objectSpread2(_objectSpread2({}, _nextState), {}, { - currentId: nextId - }); + const ioCallback = () => { + if (firstRun) { + firstRun = false; + return; } - - return _nextState; + cancelAnimationFrame(raf); + raf = requestAnimationFrame(() => sortItems(state.renderedItems)); + }; + const root = getCommonParent(state.renderedItems); + const observer = new IntersectionObserver(ioCallback, { root }); + for (const item of state.renderedItems) { + if (!item.element) + continue; + observer.observe(item.element); } - - case "move": - { - var _id3 = action.id; // move() does nothing - - if (_id3 === undefined) { - return state; - } // Removes the current item and the item that is receiving focus from the - // pastIds list - - - var filteredPastIds = pastIds.filter(function (pastId) { - return pastId !== currentId && pastId !== _id3; - }); // If there's a currentId, add it to the pastIds list so it can be focused - // if the new item gets removed or disabled - - var _nextPastIds = currentId ? [currentId].concat(filteredPastIds) : filteredPastIds; - - var _nextState2 = _objectSpread2(_objectSpread2({}, state), {}, { - pastIds: _nextPastIds - }); // move(null) will focus the composite element itself, not an item - - - if (_id3 === null) { - return _objectSpread2(_objectSpread2({}, _nextState2), {}, { - unstable_moves: moves + 1, - currentId: getCurrentId(_nextState2, _id3) - }); - } - - var _item2 = findEnabledItemById(items, _id3); - - return _objectSpread2(_objectSpread2({}, _nextState2), {}, { - unstable_moves: _item2 ? moves + 1 : moves, - currentId: getCurrentId(_nextState2, _item2 === null || _item2 === void 0 ? void 0 : _item2.id) - }); + return () => { + cancelAnimationFrame(raf); + observer.disconnect(); + }; + }); + }); + const mergeItem = (item, setItems, canDeleteFromMap = false) => { + let prevItem; + setItems((items2) => { + const index = items2.findIndex(({ id }) => id === item.id); + const nextItems = items2.slice(); + if (index !== -1) { + prevItem = items2[index]; + const nextItem = _chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, prevItem), item); + nextItems[index] = nextItem; + itemsMap.set(item.id, nextItem); + } else { + nextItems.push(item); + itemsMap.set(item.id, item); } - - case "next": - { - // If there's no item focused, we just move the first one - if (currentId == null) { - return reducer(state, _objectSpread2(_objectSpread2({}, action), {}, { - type: "first" - })); - } // RTL doesn't make sense on vertical navigation - - - var isHorizontal = orientation !== "vertical"; - var isRTL = rtl && isHorizontal; - var allItems = isRTL ? reverse(items) : items; - var currentItem = allItems.find(function (item) { - return item.id === currentId; - }); // If there's no item focused, we just move the first one - - if (!currentItem) { - return reducer(state, _objectSpread2(_objectSpread2({}, action), {}, { - type: "first" - })); - } - - var isGrid = !!currentItem.groupId; - var currentIndex = allItems.indexOf(currentItem); - - var _nextItems = allItems.slice(currentIndex + 1); - - var nextItemsInGroup = getItemsInGroup(_nextItems, currentItem.groupId); // Home, End - - if (action.allTheWay) { - // We reverse so we can get the last enabled item in the group. If it's - // RTL, nextItems and nextItemsInGroup are already reversed and don't - // have the items before the current one anymore. So we have to get - // items in group again with allItems. - var _nextItem2 = findFirstEnabledItem(isRTL ? getItemsInGroup(allItems, currentItem.groupId) : reverse(nextItemsInGroup)); - - return reducer(state, _objectSpread2(_objectSpread2({}, action), {}, { - type: "move", - id: _nextItem2 === null || _nextItem2 === void 0 ? void 0 : _nextItem2.id - })); - } - - var oppositeOrientation = getOppositeOrientation( // If it's a grid and orientation is not set, it's a next/previous - // call, which is inherently horizontal. up/down will call next with - // orientation set to vertical by default (see below on up/down cases). - isGrid ? orientation || "horizontal" : orientation); - var canLoop = loop && loop !== oppositeOrientation; - var canWrap = isGrid && wrap && wrap !== oppositeOrientation; - var hasNullItem = // `previous` and `up` will set action.hasNullItem, but when calling - // next directly, hasNullItem will only be true if it's not a grid and - // loop is set to true, which means that pressing right or down keys on - // grids will never focus the composite element. On one-dimensional - // composites that don't loop, pressing right or down keys also doesn't - // focus the composite element. - action.hasNullItem || !isGrid && canLoop && includesBaseElement; - - if (canLoop) { - var loopItems = canWrap && !hasNullItem ? allItems : getItemsInGroup(allItems, currentItem.groupId); // Turns [0, 1, current, 3, 4] into [3, 4, 0, 1] - - var sortedItems = placeItemsAfter(loopItems, currentId, hasNullItem); - - var _nextItem3 = findFirstEnabledItem(sortedItems, currentId); - - return reducer(state, _objectSpread2(_objectSpread2({}, action), {}, { - type: "move", - id: _nextItem3 === null || _nextItem3 === void 0 ? void 0 : _nextItem3.id - })); - } - - if (canWrap) { - var _nextItem4 = findFirstEnabledItem( // We can use nextItems, which contains all the next items, including - // items from other groups, to wrap between groups. However, if there - // is a null item (the composite element), we'll only use the next - // items in the group. So moving next from the last item will focus - // the composite element (null). On grid composites, horizontal - // navigation never focuses the composite element, only vertical. - hasNullItem ? nextItemsInGroup : _nextItems, currentId); - - var _nextId = hasNullItem ? (_nextItem4 === null || _nextItem4 === void 0 ? void 0 : _nextItem4.id) || null : _nextItem4 === null || _nextItem4 === void 0 ? void 0 : _nextItem4.id; - - return reducer(state, _objectSpread2(_objectSpread2({}, action), {}, { - type: "move", - id: _nextId - })); - } - - var _nextItem = findFirstEnabledItem(nextItemsInGroup, currentId); - - if (!_nextItem && hasNullItem) { - return reducer(state, _objectSpread2(_objectSpread2({}, action), {}, { - type: "move", - id: null - })); + return nextItems; + }); + const unmergeItem = () => { + setItems((items2) => { + if (!prevItem) { + if (canDeleteFromMap) { + itemsMap.delete(item.id); + } + return items2.filter(({ id }) => id !== item.id); } - - return reducer(state, _objectSpread2(_objectSpread2({}, action), {}, { - type: "move", - id: _nextItem === null || _nextItem === void 0 ? void 0 : _nextItem.id - })); - } - - case "previous": - { - // If currentId is initially set to null, the composite element will be - // focusable while navigating with arrow keys. But, if it's a grid, we - // don't want to focus the composite element with horizontal navigation. - var _isGrid = !!groups.length; - - var _hasNullItem = !_isGrid && includesBaseElement; - - var _nextState3 = reducer(_objectSpread2(_objectSpread2({}, state), {}, { - items: reverse(items) - }), _objectSpread2(_objectSpread2({}, action), {}, { - type: "next", - hasNullItem: _hasNullItem - })); - - return _objectSpread2(_objectSpread2({}, _nextState3), {}, { - items: items - }); - } - - case "down": - { - var shouldShift = shift && !action.allTheWay; // First, we make sure groups have the same number of items by filling it - // with disabled fake items. Then, we reorganize the items list so - // [1-1, 1-2, 2-1, 2-2] becomes [1-1, 2-1, 1-2, 2-2]. - - var verticalItems = verticalizeItems(flatten(fillGroups(groupItems(items), currentId, shouldShift))); - - var _canLoop = loop && loop !== "horizontal"; // Pressing down arrow key will only focus the composite element if loop - // is true or vertical. - - - var _hasNullItem2 = _canLoop && includesBaseElement; - - var _nextState4 = reducer(_objectSpread2(_objectSpread2({}, state), {}, { - orientation: "vertical", - items: verticalItems - }), _objectSpread2(_objectSpread2({}, action), {}, { - type: "next", - hasNullItem: _hasNullItem2 - })); - - return _objectSpread2(_objectSpread2({}, _nextState4), {}, { - orientation: orientation, - items: items - }); - } - - case "up": - { - var _shouldShift = shift && !action.allTheWay; - - var _verticalItems = verticalizeItems(reverse(flatten(fillGroups(groupItems(items), currentId, _shouldShift)))); // If currentId is initially set to null, we'll always focus the - // composite element when the up arrow key is pressed in the first row. - - - var _hasNullItem3 = includesBaseElement; - - var _nextState5 = reducer(_objectSpread2(_objectSpread2({}, state), {}, { - orientation: "vertical", - items: _verticalItems - }), _objectSpread2(_objectSpread2({}, action), {}, { - type: "next", - hasNullItem: _hasNullItem3 - })); - - return _objectSpread2(_objectSpread2({}, _nextState5), {}, { - orientation: orientation, - items: items - }); - } - - case "first": - { - var firstItem = findFirstEnabledItem(items); - return reducer(state, _objectSpread2(_objectSpread2({}, action), {}, { - type: "move", - id: firstItem === null || firstItem === void 0 ? void 0 : firstItem.id - })); - } - - case "last": - { - var _nextState6 = reducer(_objectSpread2(_objectSpread2({}, state), {}, { - items: reverse(items) - }), _objectSpread2(_objectSpread2({}, action), {}, { - type: "first" - })); - - return _objectSpread2(_objectSpread2({}, _nextState6), {}, { - items: items - }); - } - - case "sort": - { - return _objectSpread2(_objectSpread2({}, state), {}, { - items: sortBasedOnDOMPosition(items), - groups: sortBasedOnDOMPosition(groups) - }); - } - - case "setVirtual": - return _objectSpread2(_objectSpread2({}, state), {}, { - unstable_virtual: applyState_applyState(action.virtual, virtual) - }); - - case "setRTL": - return _objectSpread2(_objectSpread2({}, state), {}, { - rtl: applyState_applyState(action.rtl, rtl) - }); - - case "setOrientation": - return _objectSpread2(_objectSpread2({}, state), {}, { - orientation: applyState_applyState(action.orientation, orientation) + const index = items2.findIndex(({ id }) => id === item.id); + if (index === -1) + return items2; + const nextItems = items2.slice(); + nextItems[index] = prevItem; + itemsMap.set(item.id, prevItem); + return nextItems; }); - - case "setCurrentId": - { - var nextCurrentId = getCurrentId(_objectSpread2(_objectSpread2({}, state), {}, { - currentId: applyState_applyState(action.currentId, currentId) - })); - return _objectSpread2(_objectSpread2({}, state), {}, { - currentId: nextCurrentId, - hasSetCurrentId: true - }); + }; + return unmergeItem; + }; + const registerItem = (item) => mergeItem( + item, + (getItems) => privateStore.setState("items", getItems), + true + ); + return _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, collection), { + registerItem, + renderItem: (item) => chain( + registerItem(item), + mergeItem( + item, + (getItems) => privateStore.setState("renderedItems", getItems) + ) + ), + item: (id) => { + if (!id) + return null; + let item = itemsMap.get(id); + if (!item) { + const { items: items2 } = collection.getState(); + item = items2.find((item2) => item2.id === id); + if (item) { + itemsMap.set(id, item); + } } + return item || null; + }, + // @ts-expect-error Internal + __unstablePrivateStore: privateStore + }); +} - case "setLoop": - return _objectSpread2(_objectSpread2({}, state), {}, { - loop: applyState_applyState(action.loop, loop) - }); - - case "setWrap": - return _objectSpread2(_objectSpread2({}, state), {}, { - wrap: applyState_applyState(action.wrap, wrap) - }); - - case "setShift": - return _objectSpread2(_objectSpread2({}, state), {}, { - shift: applyState_applyState(action.shift, shift) - }); - - case "setIncludesBaseElement": - { - return _objectSpread2(_objectSpread2({}, state), {}, { - unstable_includesBaseElement: applyState_applyState(action.includesBaseElement, includesBaseElement) - }); - } - case "reset": - return _objectSpread2(_objectSpread2({}, state), {}, { - unstable_virtual: initialVirtual, - rtl: initialRTL, - orientation: initialOrientation, - currentId: getCurrentId(_objectSpread2(_objectSpread2({}, state), {}, { - currentId: initialCurrentId - })), - loop: initialLoop, - wrap: initialWrap, - shift: initialShift, - unstable_moves: 0, - pastIds: [] - }); - case "setItems": - { - return _objectSpread2(_objectSpread2({}, state), {}, { - items: action.items - }); - } +;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/7PRQYBBV.js +"use client"; - default: - throw new Error(); +// src/utils/array.ts +function toArray(arg) { + if (Array.isArray(arg)) { + return arg; } + return typeof arg !== "undefined" ? [arg] : []; } - -function useAction(fn) { - return (0,external_React_.useCallback)(fn, []); +function addItemToArray(array, item, index = -1) { + if (!(index in array)) { + return [...array, item]; + } + return [...array.slice(0, index), item, ...array.slice(index)]; } - -function useIsUnmountedRef() { - var isUnmountedRef = (0,external_React_.useRef)(false); - useIsomorphicEffect(function () { - return function () { - isUnmountedRef.current = true; - }; - }, []); - return isUnmountedRef; -} - -function useCompositeState(initialState) { - if (initialState === void 0) { - initialState = {}; - } - - var _useSealedState = useSealedState(initialState), - _useSealedState$unsta = _useSealedState.unstable_virtual, - virtual = _useSealedState$unsta === void 0 ? false : _useSealedState$unsta, - _useSealedState$rtl = _useSealedState.rtl, - rtl = _useSealedState$rtl === void 0 ? false : _useSealedState$rtl, - orientation = _useSealedState.orientation, - currentId = _useSealedState.currentId, - _useSealedState$loop = _useSealedState.loop, - loop = _useSealedState$loop === void 0 ? false : _useSealedState$loop, - _useSealedState$wrap = _useSealedState.wrap, - wrap = _useSealedState$wrap === void 0 ? false : _useSealedState$wrap, - _useSealedState$shift = _useSealedState.shift, - shift = _useSealedState$shift === void 0 ? false : _useSealedState$shift, - unstable_includesBaseElement = _useSealedState.unstable_includesBaseElement, - sealed = _objectWithoutPropertiesLoose(_useSealedState, ["unstable_virtual", "rtl", "orientation", "currentId", "loop", "wrap", "shift", "unstable_includesBaseElement"]); - - var idState = unstable_useIdState(sealed); - - var _React$useReducer = (0,external_React_.useReducer)(reducer, { - unstable_virtual: virtual, - rtl: rtl, - orientation: orientation, - items: [], - groups: [], - currentId: currentId, - loop: loop, - wrap: wrap, - shift: shift, - unstable_moves: 0, - pastIds: [], - unstable_includesBaseElement: unstable_includesBaseElement != null ? unstable_includesBaseElement : currentId === null, - initialVirtual: virtual, - initialRTL: rtl, - initialOrientation: orientation, - initialCurrentId: currentId, - initialLoop: loop, - initialWrap: wrap, - initialShift: shift - }), - _React$useReducer$ = _React$useReducer[0], - pastIds = _React$useReducer$.pastIds, - initialVirtual = _React$useReducer$.initialVirtual, - initialRTL = _React$useReducer$.initialRTL, - initialOrientation = _React$useReducer$.initialOrientation, - initialCurrentId = _React$useReducer$.initialCurrentId, - initialLoop = _React$useReducer$.initialLoop, - initialWrap = _React$useReducer$.initialWrap, - initialShift = _React$useReducer$.initialShift, - hasSetCurrentId = _React$useReducer$.hasSetCurrentId, - state = _objectWithoutPropertiesLoose(_React$useReducer$, ["pastIds", "initialVirtual", "initialRTL", "initialOrientation", "initialCurrentId", "initialLoop", "initialWrap", "initialShift", "hasSetCurrentId"]), - dispatch = _React$useReducer[1]; - - var _React$useState = (0,external_React_.useState)(false), - hasActiveWidget = _React$useState[0], - setHasActiveWidget = _React$useState[1]; // register/unregister may be called when this component is unmounted. We - // store the unmounted state here so we don't update the state if it's true. - // This only happens in a very specific situation. - // See https://github.com/reakit/reakit/issues/650 - - - var isUnmountedRef = useIsUnmountedRef(); - var setItems = (0,external_React_.useCallback)(function (items) { - return dispatch({ - type: "setItems", - items: items - }); - }, []); - useSortBasedOnDOMPosition(state.items, setItems); - return _objectSpread2(_objectSpread2(_objectSpread2({}, idState), state), {}, { - unstable_hasActiveWidget: hasActiveWidget, - unstable_setHasActiveWidget: setHasActiveWidget, - registerItem: useAction(function (item) { - if (isUnmountedRef.current) return; - dispatch({ - type: "registerItem", - item: item - }); - }), - unregisterItem: useAction(function (id) { - if (isUnmountedRef.current) return; - dispatch({ - type: "unregisterItem", - id: id - }); - }), - registerGroup: useAction(function (group) { - if (isUnmountedRef.current) return; - dispatch({ - type: "registerGroup", - group: group - }); - }), - unregisterGroup: useAction(function (id) { - if (isUnmountedRef.current) return; - dispatch({ - type: "unregisterGroup", - id: id - }); - }), - move: useAction(function (id) { - return dispatch({ - type: "move", - id: id - }); - }), - next: useAction(function (allTheWay) { - return dispatch({ - type: "next", - allTheWay: allTheWay - }); - }), - previous: useAction(function (allTheWay) { - return dispatch({ - type: "previous", - allTheWay: allTheWay - }); - }), - up: useAction(function (allTheWay) { - return dispatch({ - type: "up", - allTheWay: allTheWay - }); - }), - down: useAction(function (allTheWay) { - return dispatch({ - type: "down", - allTheWay: allTheWay - }); - }), - first: useAction(function () { - return dispatch({ - type: "first" - }); - }), - last: useAction(function () { - return dispatch({ - type: "last" - }); - }), - sort: useAction(function () { - return dispatch({ - type: "sort" - }); - }), - unstable_setVirtual: useAction(function (value) { - return dispatch({ - type: "setVirtual", - virtual: value - }); - }), - setRTL: useAction(function (value) { - return dispatch({ - type: "setRTL", - rtl: value - }); - }), - setOrientation: useAction(function (value) { - return dispatch({ - type: "setOrientation", - orientation: value - }); - }), - setCurrentId: useAction(function (value) { - return dispatch({ - type: "setCurrentId", - currentId: value - }); - }), - setLoop: useAction(function (value) { - return dispatch({ - type: "setLoop", - loop: value - }); - }), - setWrap: useAction(function (value) { - return dispatch({ - type: "setWrap", - wrap: value - }); - }), - setShift: useAction(function (value) { - return dispatch({ - type: "setShift", - shift: value - }); - }), - unstable_setIncludesBaseElement: useAction(function (value) { - return dispatch({ - type: "setIncludesBaseElement", - includesBaseElement: value - }); - }), - reset: useAction(function () { - return dispatch({ - type: "reset" - }); - }) - }); +function flatten2DArray(array) { + const flattened = []; + for (const row of array) { + flattened.push(...row); + } + return flattened; +} +function reverseArray(array) { + return array.slice().reverse(); } -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/fireBlurEvent.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/IERTEJ3A.js +"use client"; -function createFocusEvent(element, type, eventInit) { - if (eventInit === void 0) { - eventInit = {}; - } - if (typeof FocusEvent === "function") { - return new FocusEvent(type, eventInit); - } - return createEvent(element, type, eventInit); +// src/composite/composite-store.ts +var IERTEJ3A_NULL_ITEM = { id: null }; +function IERTEJ3A_findFirstEnabledItem(items, excludeId) { + return items.find((item) => { + if (excludeId) { + return !item.disabled && item.id !== excludeId; + } + return !item.disabled; + }); } -/** - * Creates and dispatches a blur event in a way that also works on IE 11. - * - * @example - * import { fireBlurEvent } from "reakit-utils"; - * - * fireBlurEvent(document.getElementById("id")); - */ - - -function fireBlurEvent_fireBlurEvent(element, eventInit) { - var event = createFocusEvent(element, "blur", eventInit); - var defaultAllowed = element.dispatchEvent(event); - - var bubbleInit = _rollupPluginBabelHelpers_1f0bf8c2_objectSpread2(_rollupPluginBabelHelpers_1f0bf8c2_objectSpread2({}, eventInit), {}, { - bubbles: true +function getEnabledItems(items, excludeId) { + return items.filter((item) => { + if (excludeId) { + return !item.disabled && item.id !== excludeId; + } + return !item.disabled; }); - - element.dispatchEvent(createFocusEvent(element, "focusout", bubbleInit)); - return defaultAllowed; } - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/fireKeyboardEvent.js - - - -function createKeyboardEvent(element, type, eventInit) { - if (eventInit === void 0) { - eventInit = {}; +function getOppositeOrientation(orientation) { + if (orientation === "vertical") + return "horizontal"; + if (orientation === "horizontal") + return "vertical"; + return; +} +function getItemsInRow(items, rowId) { + return items.filter((item) => item.rowId === rowId); +} +function IERTEJ3A_flipItems(items, activeId, shouldInsertNullItem = false) { + const index = items.findIndex((item) => item.id === activeId); + return [ + ...items.slice(index + 1), + ...shouldInsertNullItem ? [IERTEJ3A_NULL_ITEM] : [], + ...items.slice(0, index) + ]; +} +function IERTEJ3A_groupItemsByRows(items) { + const rows = []; + for (const item of items) { + const row = rows.find((currentRow) => { + var _a; + return ((_a = currentRow[0]) == null ? void 0 : _a.rowId) === item.rowId; + }); + if (row) { + row.push(item); + } else { + rows.push([item]); + } } - - if (typeof KeyboardEvent === "function") { - return new KeyboardEvent(type, eventInit); - } // IE 11 doesn't support Event constructors - - - var event = getDocument_getDocument(element).createEvent("KeyboardEvent"); - event.initKeyboardEvent(type, eventInit.bubbles, eventInit.cancelable, getWindow(element), eventInit.key, eventInit.location, eventInit.ctrlKey, eventInit.altKey, eventInit.shiftKey, eventInit.metaKey); - return event; + return rows; } -/** - * Creates and dispatches `KeyboardEvent` in a way that also works on IE 11. - * - * @example - * import { fireKeyboardEvent } from "reakit-utils"; - * - * fireKeyboardEvent(document.getElementById("id"), "keydown", { - * key: "ArrowDown", - * shiftKey: true, - * }); - */ - - -function fireKeyboardEvent_fireKeyboardEvent(element, type, eventInit) { - return element.dispatchEvent(createKeyboardEvent(element, type, eventInit)); +function getMaxRowLength(array) { + let maxLength = 0; + for (const { length } of array) { + if (length > maxLength) { + maxLength = length; + } + } + return maxLength; } - - - -;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/getNextActiveElementOnBlur.js - - - - - -var isIE11 = canUseDOM && "msCrypto" in window; -/** - * Cross-browser method that returns the next active element (the element that - * is receiving focus) after a blur event is dispatched. It receives the blur - * event object as the argument. - * - * @example - * import { getNextActiveElementOnBlur } from "reakit-utils"; - * - * const element = document.getElementById("id"); - * element.addEventListener("blur", (event) => { - * const nextActiveElement = getNextActiveElementOnBlur(event); - * }); - */ - -function getNextActiveElementOnBlur(event) { - // IE 11 doesn't support event.relatedTarget on blur. - // document.activeElement points the the next active element. - // On modern browsers, document.activeElement points to the current target. - if (isIE11) { - var activeElement = getActiveElement_getActiveElement(event.currentTarget); - return activeElement; +function createEmptyItem(rowId) { + return { + id: "__EMPTY_ITEM__", + disabled: true, + rowId + }; +} +function normalizeRows(rows, activeId, focusShift) { + const maxLength = getMaxRowLength(rows); + for (const row of rows) { + for (let i = 0; i < maxLength; i += 1) { + const item = row[i]; + if (!item || focusShift && item.disabled) { + const isFirst = i === 0; + const previousItem = isFirst && focusShift ? IERTEJ3A_findFirstEnabledItem(row) : row[i - 1]; + row[i] = previousItem && activeId !== previousItem.id && focusShift ? previousItem : createEmptyItem(previousItem == null ? void 0 : previousItem.rowId); + } + } } - - return event.relatedTarget; + return rows; +} +function verticalizeItems(items) { + const rows = IERTEJ3A_groupItemsByRows(items); + const maxLength = getMaxRowLength(rows); + const verticalized = []; + for (let i = 0; i < maxLength; i += 1) { + for (const row of rows) { + const item = row[i]; + if (item) { + verticalized.push(_chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, item), { + // If there's no rowId, it means that it's not a grid composite, but + // a single row instead. So, instead of verticalizing it, that is, + // assigning a different rowId based on the column index, we keep it + // undefined so they will be part of the same row. This is useful + // when using up/down on one-dimensional composites. + rowId: item.rowId ? `${i}` : void 0 + })); + } + } + } + return verticalized; +} +function createCompositeStore(props = {}) { + var _a; + const syncState = (_a = props.store) == null ? void 0 : _a.getState(); + const collection = createCollectionStore(props); + const activeId = defaultValue( + props.activeId, + syncState == null ? void 0 : syncState.activeId, + props.defaultActiveId + ); + const initialState = _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, collection.getState()), { + activeId, + baseElement: defaultValue(syncState == null ? void 0 : syncState.baseElement, null), + includesBaseElement: defaultValue( + props.includesBaseElement, + syncState == null ? void 0 : syncState.includesBaseElement, + activeId === null + ), + moves: defaultValue(syncState == null ? void 0 : syncState.moves, 0), + orientation: defaultValue( + props.orientation, + syncState == null ? void 0 : syncState.orientation, + "both" + ), + rtl: defaultValue(props.rtl, syncState == null ? void 0 : syncState.rtl, false), + virtualFocus: defaultValue( + props.virtualFocus, + syncState == null ? void 0 : syncState.virtualFocus, + false + ), + focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, false), + focusWrap: defaultValue(props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false), + focusShift: defaultValue(props.focusShift, syncState == null ? void 0 : syncState.focusShift, false) + }); + const composite = createStore(initialState, collection, props.store); + setup( + composite, + () => sync(composite, ["renderedItems", "activeId"], (state) => { + composite.setState("activeId", (activeId2) => { + var _a2; + if (activeId2 !== void 0) + return activeId2; + return (_a2 = IERTEJ3A_findFirstEnabledItem(state.renderedItems)) == null ? void 0 : _a2.id; + }); + }) + ); + const getNextId = (items, orientation, hasNullItem, skip) => { + var _a2, _b; + const { activeId: activeId2, rtl, focusLoop, focusWrap, includesBaseElement } = composite.getState(); + const isHorizontal = orientation !== "vertical"; + const isRTL = rtl && isHorizontal; + const allItems = isRTL ? reverseArray(items) : items; + if (activeId2 == null) { + return (_a2 = IERTEJ3A_findFirstEnabledItem(allItems)) == null ? void 0 : _a2.id; + } + const activeItem = allItems.find((item) => item.id === activeId2); + if (!activeItem) { + return (_b = IERTEJ3A_findFirstEnabledItem(allItems)) == null ? void 0 : _b.id; + } + const isGrid = !!activeItem.rowId; + const activeIndex = allItems.indexOf(activeItem); + const nextItems = allItems.slice(activeIndex + 1); + const nextItemsInRow = getItemsInRow(nextItems, activeItem.rowId); + if (skip !== void 0) { + const nextEnabledItemsInRow = getEnabledItems(nextItemsInRow, activeId2); + const nextItem2 = nextEnabledItemsInRow.slice(skip)[0] || // If we can't find an item, just return the last one. + nextEnabledItemsInRow[nextEnabledItemsInRow.length - 1]; + return nextItem2 == null ? void 0 : nextItem2.id; + } + const oppositeOrientation = getOppositeOrientation( + // If it's a grid and orientation is not set, it's a next/previous call, + // which is inherently horizontal. up/down will call next with orientation + // set to vertical by default (see below on up/down methods). + isGrid ? orientation || "horizontal" : orientation + ); + const canLoop = focusLoop && focusLoop !== oppositeOrientation; + const canWrap = isGrid && focusWrap && focusWrap !== oppositeOrientation; + hasNullItem = hasNullItem || !isGrid && canLoop && includesBaseElement; + if (canLoop) { + const loopItems = canWrap && !hasNullItem ? allItems : getItemsInRow(allItems, activeItem.rowId); + const sortedItems = IERTEJ3A_flipItems(loopItems, activeId2, hasNullItem); + const nextItem2 = IERTEJ3A_findFirstEnabledItem(sortedItems, activeId2); + return nextItem2 == null ? void 0 : nextItem2.id; + } + if (canWrap) { + const nextItem2 = IERTEJ3A_findFirstEnabledItem( + // We can use nextItems, which contains all the next items, including + // items from other rows, to wrap between rows. However, if there is a + // null item (the composite container), we'll only use the next items in + // the row. So moving next from the last item will focus on the + // composite container. On grid composites, horizontal navigation never + // focuses on the composite container, only vertical. + hasNullItem ? nextItemsInRow : nextItems, + activeId2 + ); + const nextId = hasNullItem ? (nextItem2 == null ? void 0 : nextItem2.id) || null : nextItem2 == null ? void 0 : nextItem2.id; + return nextId; + } + const nextItem = IERTEJ3A_findFirstEnabledItem(nextItemsInRow, activeId2); + if (!nextItem && hasNullItem) { + return null; + } + return nextItem == null ? void 0 : nextItem.id; + }; + return _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, collection), composite), { + setBaseElement: (element) => composite.setState("baseElement", element), + setActiveId: (id) => composite.setState("activeId", id), + move: (id) => { + if (id === void 0) + return; + composite.setState("activeId", id); + composite.setState("moves", (moves) => moves + 1); + }, + first: () => { + var _a2; + return (_a2 = IERTEJ3A_findFirstEnabledItem(composite.getState().renderedItems)) == null ? void 0 : _a2.id; + }, + last: () => { + var _a2; + return (_a2 = IERTEJ3A_findFirstEnabledItem(reverseArray(composite.getState().renderedItems))) == null ? void 0 : _a2.id; + }, + next: (skip) => { + const { renderedItems, orientation } = composite.getState(); + return getNextId(renderedItems, orientation, false, skip); + }, + previous: (skip) => { + var _a2; + const { renderedItems, orientation, includesBaseElement } = composite.getState(); + const isGrid = !!((_a2 = IERTEJ3A_findFirstEnabledItem(renderedItems)) == null ? void 0 : _a2.rowId); + const hasNullItem = !isGrid && includesBaseElement; + return getNextId( + reverseArray(renderedItems), + orientation, + hasNullItem, + skip + ); + }, + down: (skip) => { + const { + activeId: activeId2, + renderedItems, + focusShift, + focusLoop, + includesBaseElement + } = composite.getState(); + const shouldShift = focusShift && !skip; + const verticalItems = verticalizeItems( + flatten2DArray( + normalizeRows(IERTEJ3A_groupItemsByRows(renderedItems), activeId2, shouldShift) + ) + ); + const canLoop = focusLoop && focusLoop !== "horizontal"; + const hasNullItem = canLoop && includesBaseElement; + return getNextId(verticalItems, "vertical", hasNullItem, skip); + }, + up: (skip) => { + const { activeId: activeId2, renderedItems, focusShift, includesBaseElement } = composite.getState(); + const shouldShift = focusShift && !skip; + const verticalItems = verticalizeItems( + reverseArray( + flatten2DArray( + normalizeRows( + IERTEJ3A_groupItemsByRows(renderedItems), + activeId2, + shouldShift + ) + ) + ) + ); + const hasNullItem = includesBaseElement; + return getNextId(verticalItems, "vertical", hasNullItem, skip); + } + }); } -;// CONCATENATED MODULE: ./node_modules/reakit/es/Composite/Composite.js - - - - - - - - - +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/7GBW5FLS.js +"use client"; +// src/composite/composite-store.ts +function useCompositeStoreProps(store, update, props) { + store = useCollectionStoreProps(store, update, props); + useStoreProps(store, props, "activeId", "setActiveId"); + useStoreProps(store, props, "includesBaseElement"); + useStoreProps(store, props, "virtualFocus"); + useStoreProps(store, props, "orientation"); + useStoreProps(store, props, "rtl"); + useStoreProps(store, props, "focusLoop"); + useStoreProps(store, props, "focusWrap"); + useStoreProps(store, props, "focusShift"); + return store; +} +function useCompositeStore(props = {}) { + const [store, update] = EKQEJRUF_useStore(createCompositeStore, props); + return useCompositeStoreProps(store, update, props); +} +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/7QTPYGNZ.js +"use client"; @@ -17459,444 +15838,379 @@ function getNextActiveElementOnBlur(event) { +// src/composite/composite.tsx -var Composite_isIE11 = canUseDOM && "msCrypto" in window; -function canProxyKeyboardEvent(event) { - if (!isSelfTarget(event)) return false; - if (event.metaKey) return false; - if (event.key === "Tab") return false; - return true; +function isGrid(items) { + return items.some((item) => !!item.rowId); } - -function useKeyboardEventProxy(virtual, currentItem, htmlEventHandler) { - var eventHandlerRef = useLiveRef(htmlEventHandler); - return (0,external_React_.useCallback)(function (event) { - var _eventHandlerRef$curr; - - (_eventHandlerRef$curr = eventHandlerRef.current) === null || _eventHandlerRef$curr === void 0 ? void 0 : _eventHandlerRef$curr.call(eventHandlerRef, event); - if (event.defaultPrevented) return; - - if (virtual && canProxyKeyboardEvent(event)) { - var currentElement = currentItem === null || currentItem === void 0 ? void 0 : currentItem.ref.current; - - if (currentElement) { - if (!fireKeyboardEvent_fireKeyboardEvent(currentElement, event.type, event)) { - event.preventDefault(); - } // The event will be triggered on the composite item and then - // propagated up to this composite element again, so we can pretend - // that it wasn't called on this component in the first place. - - - if (event.currentTarget.contains(currentElement)) { - event.stopPropagation(); - } - } - } - }, [virtual, currentItem]); -} // istanbul ignore next - - -function useActiveElementRef(elementRef) { - var activeElementRef = (0,external_React_.useRef)(null); - (0,external_React_.useEffect)(function () { - var document = getDocument_getDocument(elementRef.current); - - var onFocus = function onFocus(event) { - var target = event.target; - activeElementRef.current = target; - }; - - document.addEventListener("focus", onFocus, true); - return function () { - document.removeEventListener("focus", onFocus, true); - }; - }, []); - return activeElementRef; +function isPrintableKey(event) { + const target = event.target; + if (target && !DLOEKDPY_isTextField(target)) + return false; + return event.key.length === 1 && !event.ctrlKey && !event.metaKey; } - -function findFirstEnabledItemInTheLastRow(items) { - return findFirstEnabledItem(flatten(reverse(groupItems(items)))); +function isModifierKey(event) { + return event.key === "Shift" || event.key === "Control" || event.key === "Alt" || event.key === "Meta"; } - -function isItem(items, element) { - return items === null || items === void 0 ? void 0 : items.some(function (item) { - return !!element && item.ref.current === element; +function useKeyboardEventProxy(store, onKeyboardEvent, previousElementRef) { + return useEvent((event) => { + var _a; + onKeyboardEvent == null ? void 0 : onKeyboardEvent(event); + if (event.defaultPrevented) + return; + if (event.isPropagationStopped()) + return; + if (!isSelfTarget(event)) + return; + if (isModifierKey(event)) + return; + if (isPrintableKey(event)) + return; + const state = store.getState(); + const activeElement = (_a = getEnabledItem(store, state.activeId)) == null ? void 0 : _a.element; + if (!activeElement) + return; + const _b = event, { view } = _b, eventInit = __objRest(_b, ["view"]); + const previousElement = previousElementRef == null ? void 0 : previousElementRef.current; + if (activeElement !== previousElement) { + activeElement.focus(); + } + if (!fireKeyboardEvent(activeElement, event.type, eventInit)) { + event.preventDefault(); + } + if (event.currentTarget.contains(activeElement)) { + event.stopPropagation(); + } }); } - -function useScheduleUserFocus(currentItem) { - var currentItemRef = useLiveRef(currentItem); - - var _React$useReducer = (0,external_React_.useReducer)(function (n) { - return n + 1; - }, 0), - scheduled = _React$useReducer[0], - schedule = _React$useReducer[1]; - - (0,external_React_.useEffect)(function () { - var _currentItemRef$curre; - - var currentElement = (_currentItemRef$curre = currentItemRef.current) === null || _currentItemRef$curre === void 0 ? void 0 : _currentItemRef$curre.ref.current; - - if (scheduled && currentElement) { - userFocus(currentElement); - } - }, [scheduled]); +function findFirstEnabledItemInTheLastRow(items) { + return findFirstEnabledItem( + flatten2DArray(reverseArray(groupItemsByRows(items))) + ); +} +function useScheduleFocus(store) { + const [scheduled, setScheduled] = (0,external_React_.useState)(false); + const schedule = (0,external_React_.useCallback)(() => setScheduled(true), []); + const activeItem = store.useState( + (state) => getEnabledItem(store, state.activeId) + ); + (0,external_React_.useEffect)(() => { + const activeElement = activeItem == null ? void 0 : activeItem.element; + if (!scheduled) + return; + if (!activeElement) + return; + setScheduled(false); + activeElement.focus({ preventScroll: true }); + }, [activeItem, scheduled]); return schedule; } - -var useComposite = createHook({ - name: "Composite", - compose: [useTabbable], - keys: COMPOSITE_KEYS, - useOptions: function useOptions(options) { - return _objectSpread2(_objectSpread2({}, options), {}, { - currentId: getCurrentId(options) - }); - }, - useProps: function useProps(options, _ref) { - var htmlRef = _ref.ref, - htmlOnFocusCapture = _ref.onFocusCapture, - htmlOnFocus = _ref.onFocus, - htmlOnBlurCapture = _ref.onBlurCapture, - htmlOnKeyDown = _ref.onKeyDown, - htmlOnKeyDownCapture = _ref.onKeyDownCapture, - htmlOnKeyUpCapture = _ref.onKeyUpCapture, - htmlProps = _objectWithoutPropertiesLoose(_ref, ["ref", "onFocusCapture", "onFocus", "onBlurCapture", "onKeyDown", "onKeyDownCapture", "onKeyUpCapture"]); - - var ref = (0,external_React_.useRef)(null); - var currentItem = findEnabledItemById(options.items, options.currentId); - var previousElementRef = (0,external_React_.useRef)(null); - var onFocusCaptureRef = useLiveRef(htmlOnFocusCapture); - var onFocusRef = useLiveRef(htmlOnFocus); - var onBlurCaptureRef = useLiveRef(htmlOnBlurCapture); - var onKeyDownRef = useLiveRef(htmlOnKeyDown); - var scheduleUserFocus = useScheduleUserFocus(currentItem); // IE 11 doesn't support event.relatedTarget, so we use the active element - // ref instead. - - var activeElementRef = Composite_isIE11 ? useActiveElementRef(ref) : undefined; - (0,external_React_.useEffect)(function () { - var element = ref.current; - - if (options.unstable_moves && !currentItem) { - false ? 0 : void 0; // If composite.move(null) has been called, the composite container - // will receive focus. - - element === null || element === void 0 ? void 0 : element.focus(); +var useComposite = createHook( + (_a) => { + var _b = _a, { + store, + composite = true, + focusOnMove = composite, + moveOnKeyPress = true + } = _b, props = __objRest(_b, [ + "store", + "composite", + "focusOnMove", + "moveOnKeyPress" + ]); + const context = useCompositeProviderContext(); + store = store || context; + invariant( + store, + false && 0 + ); + const previousElementRef = (0,external_React_.useRef)(null); + const scheduleFocus = useScheduleFocus(store); + const moves = store.useState("moves"); + (0,external_React_.useEffect)(() => { + var _a2; + if (!store) + return; + if (!moves) + return; + if (!composite) + return; + if (!focusOnMove) + return; + const { activeId: activeId2 } = store.getState(); + const itemElement = (_a2 = getEnabledItem(store, activeId2)) == null ? void 0 : _a2.element; + if (!itemElement) + return; + focusIntoView(itemElement); + }, [store, moves, composite, focusOnMove]); + useSafeLayoutEffect(() => { + if (!store) + return; + if (!moves) + return; + if (!composite) + return; + const { baseElement, activeId: activeId2 } = store.getState(); + const isSelfAcive = activeId2 === null; + if (!isSelfAcive) + return; + if (!baseElement) + return; + const previousElement = previousElementRef.current; + previousElementRef.current = null; + if (previousElement) { + fireBlurEvent(previousElement, { relatedTarget: baseElement }); } - }, [options.unstable_moves, currentItem]); - var onKeyDownCapture = useKeyboardEventProxy(options.unstable_virtual, currentItem, htmlOnKeyDownCapture); - var onKeyUpCapture = useKeyboardEventProxy(options.unstable_virtual, currentItem, htmlOnKeyUpCapture); - var onFocusCapture = (0,external_React_.useCallback)(function (event) { - var _onFocusCaptureRef$cu; - - (_onFocusCaptureRef$cu = onFocusCaptureRef.current) === null || _onFocusCaptureRef$cu === void 0 ? void 0 : _onFocusCaptureRef$cu.call(onFocusCaptureRef, event); - if (event.defaultPrevented) return; - if (!options.unstable_virtual) return; // IE11 doesn't support event.relatedTarget, so we use the active - // element ref instead. - - var previousActiveElement = (activeElementRef === null || activeElementRef === void 0 ? void 0 : activeElementRef.current) || event.relatedTarget; - var previousActiveElementWasItem = isItem(options.items, previousActiveElement); - - if (isSelfTarget(event) && previousActiveElementWasItem) { - // Composite has been focused as a result of an item receiving focus. - // The composite item will move focus back to the composite - // container. In this case, we don't want to propagate this - // additional event nor call the onFocus handler passed to - // <Composite onFocus={...} />. - event.stopPropagation(); // We keep track of the previous active item element so we can - // manually fire a blur event on it later when the focus is moved to - // another item on the onBlurCapture event below. - + if (!hasFocus(baseElement)) { + baseElement.focus(); + } + }, [store, moves, composite]); + const activeId = store.useState("activeId"); + const virtualFocus = store.useState("virtualFocus"); + useSafeLayoutEffect(() => { + var _a2; + if (!store) + return; + if (!composite) + return; + if (!virtualFocus) + return; + const previousElement = previousElementRef.current; + previousElementRef.current = null; + if (!previousElement) + return; + const activeElement = (_a2 = getEnabledItem(store, activeId)) == null ? void 0 : _a2.element; + const relatedTarget = activeElement || getActiveElement(previousElement); + if (relatedTarget === previousElement) + return; + fireBlurEvent(previousElement, { relatedTarget }); + }, [store, activeId, virtualFocus, composite]); + const onKeyDownCapture = useKeyboardEventProxy( + store, + props.onKeyDownCapture, + previousElementRef + ); + const onKeyUpCapture = useKeyboardEventProxy( + store, + props.onKeyUpCapture, + previousElementRef + ); + const onFocusCaptureProp = props.onFocusCapture; + const onFocusCapture = useEvent((event) => { + onFocusCaptureProp == null ? void 0 : onFocusCaptureProp(event); + if (event.defaultPrevented) + return; + if (!store) + return; + const { virtualFocus: virtualFocus2 } = store.getState(); + if (!virtualFocus2) + return; + const previousActiveElement = event.relatedTarget; + const isSilentlyFocused = silentlyFocused(event.currentTarget); + if (isSelfTarget(event) && isSilentlyFocused) { + event.stopPropagation(); previousElementRef.current = previousActiveElement; } - }, [options.unstable_virtual, options.items]); - var onFocus = (0,external_React_.useCallback)(function (event) { - var _onFocusRef$current; - - (_onFocusRef$current = onFocusRef.current) === null || _onFocusRef$current === void 0 ? void 0 : _onFocusRef$current.call(onFocusRef, event); - if (event.defaultPrevented) return; - - if (options.unstable_virtual) { - if (isSelfTarget(event)) { - // This means that the composite element has been focused while the - // composite item has not. For example, by clicking on the - // composite element without touching any item, or by tabbing into - // the composite element. In this case, we want to trigger focus on - // the item, just like it would happen with roving tabindex. - // When it receives focus, the composite item will put focus back - // on the composite element, in which case hasItemWithFocus will be - // true. - scheduleUserFocus(); + }); + const onFocusProp = props.onFocus; + const onFocus = useEvent((event) => { + onFocusProp == null ? void 0 : onFocusProp(event); + if (event.defaultPrevented) + return; + if (!composite) + return; + if (!store) + return; + const { relatedTarget } = event; + const { virtualFocus: virtualFocus2 } = store.getState(); + if (virtualFocus2) { + if (isSelfTarget(event) && !isItem(store, relatedTarget)) { + queueMicrotask(scheduleFocus); } } else if (isSelfTarget(event)) { - var _options$setCurrentId; - - // When the roving tabindex composite gets intentionally focused (for - // example, by clicking directly on it, and not on an item), we make - // sure to set the current id to null (which means the composite - // itself is focused). - (_options$setCurrentId = options.setCurrentId) === null || _options$setCurrentId === void 0 ? void 0 : _options$setCurrentId.call(options, null); + store.setActiveId(null); } - }, [options.unstable_virtual, options.setCurrentId]); - var onBlurCapture = (0,external_React_.useCallback)(function (event) { - var _onBlurCaptureRef$cur; - - (_onBlurCaptureRef$cur = onBlurCaptureRef.current) === null || _onBlurCaptureRef$cur === void 0 ? void 0 : _onBlurCaptureRef$cur.call(onBlurCaptureRef, event); - if (event.defaultPrevented) return; - if (!options.unstable_virtual) return; // When virtual is set to true, we move focus from the composite - // container (this component) to the composite item that is being - // selected. Then we move focus back to the composite container. This - // is so we can provide the same API as the roving tabindex method, - // which means people can attach onFocus/onBlur handlers on the - // CompositeItem component regardless of whether it's virtual or not. - // This sequence of blurring and focusing items and composite may be - // confusing, so we ignore intermediate focus and blurs by stopping its - // propagation and not calling the passed onBlur handler (htmlOnBlur). - - var currentElement = (currentItem === null || currentItem === void 0 ? void 0 : currentItem.ref.current) || null; - var nextActiveElement = getNextActiveElementOnBlur(event); - var nextActiveElementIsItem = isItem(options.items, nextActiveElement); - + }); + const onBlurCaptureProp = props.onBlurCapture; + const onBlurCapture = useEvent((event) => { + var _a2; + onBlurCaptureProp == null ? void 0 : onBlurCaptureProp(event); + if (event.defaultPrevented) + return; + if (!store) + return; + const { virtualFocus: virtualFocus2, activeId: activeId2 } = store.getState(); + if (!virtualFocus2) + return; + const activeElement = (_a2 = getEnabledItem(store, activeId2)) == null ? void 0 : _a2.element; + const nextActiveElement = event.relatedTarget; + const nextActiveElementIsItem = isItem(store, nextActiveElement); + const previousElement = previousElementRef.current; + previousElementRef.current = null; if (isSelfTarget(event) && nextActiveElementIsItem) { - // This is an intermediate blur event: blurring the composite - // container to focus an item (nextActiveElement). - if (nextActiveElement === currentElement) { - // The next active element will be the same as the current item in - // the state in two scenarios: - // - Moving focus with keyboard: the state is updated before the - // blur event is triggered, so here the current item is already - // pointing to the next active element. - // - Clicking on the current active item with a pointer: this - // will trigger blur on the composite element and then the next - // active element will be the same as the current item. Clicking on - // an item other than the current one doesn't end up here as the - // currentItem state will be updated only after it. - if (previousElementRef.current && previousElementRef.current !== nextActiveElement) { - // If there's a previous active item and it's not a click action, - // then we fire a blur event on it so it will work just like if - // it had DOM focus before (like when using roving tabindex). - fireBlurEvent_fireBlurEvent(previousElementRef.current, event); + if (nextActiveElement === activeElement) { + if (previousElement && previousElement !== nextActiveElement) { + fireBlurEvent(previousElement, event); } - } else if (currentElement) { - // This will be true when the next active element is not the - // current element, but there's a current item. This will only - // happen when clicking with a pointer on a different item, when - // there's already an item selected, in which case currentElement - // is the item that is getting blurred, and nextActiveElement is - // the item that is being clicked. - fireBlurEvent_fireBlurEvent(currentElement, event); - } // We want to ignore intermediate blur events, so we stop its - // propagation and return early so onFocus will not be called. - - + } else if (activeElement) { + fireBlurEvent(activeElement, event); + } else if (previousElement) { + fireBlurEvent(previousElement, event); + } event.stopPropagation(); } else { - var targetIsItem = isItem(options.items, event.target); - - if (!targetIsItem && currentElement) { - // If target is not a composite item, it may be the composite - // element itself (isSelfTarget) or a tabbable element inside the - // composite widget. This may be triggered by clicking outside the - // composite widget or by tabbing out of it. In either cases we - // want to fire a blur event on the current item. - fireBlurEvent_fireBlurEvent(currentElement, event); + const targetIsItem = isItem(store, event.target); + if (!targetIsItem && activeElement) { + fireBlurEvent(activeElement, event); } } - }, [options.unstable_virtual, options.items, currentItem]); - var onKeyDown = (0,external_React_.useCallback)(function (event) { - var _onKeyDownRef$current, _options$groups; - - (_onKeyDownRef$current = onKeyDownRef.current) === null || _onKeyDownRef$current === void 0 ? void 0 : _onKeyDownRef$current.call(onKeyDownRef, event); - if (event.defaultPrevented) return; - if (options.currentId !== null) return; - if (!isSelfTarget(event)) return; - var isVertical = options.orientation !== "horizontal"; - var isHorizontal = options.orientation !== "vertical"; - var isGrid = !!((_options$groups = options.groups) !== null && _options$groups !== void 0 && _options$groups.length); - - var up = function up() { - if (isGrid) { - var item = findFirstEnabledItemInTheLastRow(options.items); - - if (item !== null && item !== void 0 && item.id) { - var _options$move; - - (_options$move = options.move) === null || _options$move === void 0 ? void 0 : _options$move.call(options, item.id); - } - } else { - var _options$last; - - (_options$last = options.last) === null || _options$last === void 0 ? void 0 : _options$last.call(options); + }); + const onKeyDownProp = props.onKeyDown; + const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress); + const onKeyDown = useEvent((event) => { + var _a2; + onKeyDownProp == null ? void 0 : onKeyDownProp(event); + if (event.defaultPrevented) + return; + if (!store) + return; + if (!isSelfTarget(event)) + return; + const { orientation, items, renderedItems, activeId: activeId2 } = store.getState(); + const activeItem = getEnabledItem(store, activeId2); + if ((_a2 = activeItem == null ? void 0 : activeItem.element) == null ? void 0 : _a2.isConnected) + return; + const isVertical = orientation !== "horizontal"; + const isHorizontal = orientation !== "vertical"; + const grid = isGrid(renderedItems); + const isHorizontalKey = event.key === "ArrowLeft" || event.key === "ArrowRight" || event.key === "Home" || event.key === "End"; + if (isHorizontalKey && DLOEKDPY_isTextField(event.currentTarget)) + return; + const up = () => { + if (grid) { + const item = items && findFirstEnabledItemInTheLastRow(items); + return item == null ? void 0 : item.id; } + return store == null ? void 0 : store.last(); }; - - var keyMap = { - ArrowUp: (isGrid || isVertical) && up, - ArrowRight: (isGrid || isHorizontal) && options.first, - ArrowDown: (isGrid || isVertical) && options.first, - ArrowLeft: (isGrid || isHorizontal) && options.last, - Home: options.first, - End: options.last, - PageUp: options.first, - PageDown: options.last + const keyMap = { + ArrowUp: (grid || isVertical) && up, + ArrowRight: (grid || isHorizontal) && store.first, + ArrowDown: (grid || isVertical) && store.first, + ArrowLeft: (grid || isHorizontal) && store.last, + Home: store.first, + End: store.last, + PageUp: store.first, + PageDown: store.last }; - var action = keyMap[event.key]; - + const action = keyMap[event.key]; if (action) { - event.preventDefault(); - action(); + const id = action(); + if (id !== void 0) { + if (!moveOnKeyPressProp(event)) + return; + event.preventDefault(); + store.move(id); + } } - }, [options.currentId, options.orientation, options.groups, options.items, options.move, options.last, options.first]); - return _objectSpread2({ - ref: useForkRef(ref, htmlRef), - id: options.baseId, - onFocus: onFocus, - onFocusCapture: onFocusCapture, - onBlurCapture: onBlurCapture, - onKeyDownCapture: onKeyDownCapture, - onKeyDown: onKeyDown, - onKeyUpCapture: onKeyUpCapture, - "aria-activedescendant": options.unstable_virtual ? (currentItem === null || currentItem === void 0 ? void 0 : currentItem.id) || undefined : undefined - }, htmlProps); - }, - useComposeProps: function useComposeProps(options, htmlProps) { - htmlProps = useRole(options, htmlProps, true); - var tabbableHTMLProps = useTabbable(options, htmlProps, true); - - if (options.unstable_virtual || options.currentId === null) { - // Composite will only be tabbable by default if the focus is managed - // using aria-activedescendant, which requires DOM focus on the container - // element (the composite) - return _objectSpread2({ - tabIndex: 0 - }, tabbableHTMLProps); - } - - return _objectSpread2(_objectSpread2({}, htmlProps), {}, { - ref: tabbableHTMLProps.ref }); + props = useWrapElement( + props, + (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(CompositeContextProvider, { value: store, children: element }), + [store] + ); + const activeDescendant = store.useState((state) => { + var _a2; + if (!store) + return; + if (!composite) + return; + if (!state.virtualFocus) + return; + return (_a2 = getEnabledItem(store, state.activeId)) == null ? void 0 : _a2.id; + }); + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ + "aria-activedescendant": activeDescendant + }, props), { + ref: useMergeRefs(composite ? store.setBaseElement : null, props.ref), + onKeyDownCapture, + onKeyUpCapture, + onFocusCapture, + onFocus, + onBlurCapture, + onKeyDown + }); + const focusable = store.useState( + (state) => composite && (state.virtualFocus || state.activeId === null) + ); + props = useFocusable(_4R3V3JGP_spreadValues({ focusable }, props)); + return props; } +); +var Composite = createComponent((props) => { + const htmlProps = useComposite(props); + return _3ORBWXWF_createElement("div", htmlProps); }); -var Composite = createComponent({ - as: "div", - useHook: useComposite, - useCreateElement: function useCreateElement$1(type, props, children) { - false ? 0 : void 0; - return useCreateElement(type, props, children); - } -}); - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/Group/Group.js - - - - - - -// Automatically generated -var GROUP_KEYS = []; - -var useGroup = createHook({ - name: "Group", - compose: useRole, - keys: GROUP_KEYS, - useProps: function useProps(_, htmlProps) { - return _objectSpread2({ - role: "group" - }, htmlProps); - } -}); -var Group = createComponent({ - as: "div", - useHook: useGroup -}); - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/Composite/CompositeGroup.js - - - - - - - - - - - +if (false) {} -var useCompositeGroup = createHook({ - name: "CompositeGroup", - compose: [useGroup, unstable_useId], - keys: COMPOSITE_GROUP_KEYS, - propsAreEqual: function propsAreEqual(prev, next) { - if (!next.id || prev.id !== next.id) { - return useGroup.unstable_propsAreEqual(prev, next); - } +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/BNUFNEVY.js +"use client"; - var prevCurrentId = prev.currentId, - prevMoves = prev.unstable_moves, - prevProps = _objectWithoutPropertiesLoose(prev, ["currentId", "unstable_moves"]); - var nextCurrentId = next.currentId, - nextMoves = next.unstable_moves, - nextProps = _objectWithoutPropertiesLoose(next, ["currentId", "unstable_moves"]); - if (prev.items && next.items) { - var prevCurrentItem = findEnabledItemById(prev.items, prevCurrentId); - var nextCurrentItem = findEnabledItemById(next.items, nextCurrentId); - var prevGroupId = prevCurrentItem === null || prevCurrentItem === void 0 ? void 0 : prevCurrentItem.groupId; - var nextGroupId = nextCurrentItem === null || nextCurrentItem === void 0 ? void 0 : nextCurrentItem.groupId; - if (next.id === nextGroupId || next.id === prevGroupId) { - return false; - } - } - return useGroup.unstable_propsAreEqual(prevProps, nextProps); - }, - useProps: function useProps(options, _ref) { - var htmlRef = _ref.ref, - htmlProps = _objectWithoutPropertiesLoose(_ref, ["ref"]); +// src/composite/composite-row.tsx - var ref = (0,external_React_.useRef)(null); - var id = options.id; // We need this to be called before CompositeItems' register - useIsomorphicEffect(function () { - var _options$registerGrou; - if (!id) return undefined; - (_options$registerGrou = options.registerGroup) === null || _options$registerGrou === void 0 ? void 0 : _options$registerGrou.call(options, { - id: id, - ref: ref - }); - return function () { - var _options$unregisterGr; - - (_options$unregisterGr = options.unregisterGroup) === null || _options$unregisterGr === void 0 ? void 0 : _options$unregisterGr.call(options, id); - }; - }, [id, options.registerGroup, options.unregisterGroup]); - return _objectSpread2({ - ref: useForkRef(ref, htmlRef) - }, htmlProps); +var useCompositeRow = createHook( + (_a) => { + var _b = _a, { + store, + "aria-setsize": ariaSetSize, + "aria-posinset": ariaPosInSet + } = _b, props = __objRest(_b, [ + "store", + "aria-setsize", + "aria-posinset" + ]); + const context = useCompositeContext(); + store = store || context; + invariant( + store, + false && 0 + ); + const id = useId(props.id); + const baseElement = store.useState( + (state) => state.baseElement || void 0 + ); + const providerValue = (0,external_React_.useMemo)( + () => ({ id, baseElement, ariaSetSize, ariaPosInSet }), + [id, baseElement, ariaSetSize, ariaPosInSet] + ); + props = useWrapElement( + props, + (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(CompositeRowContext.Provider, { value: providerValue, children: element }), + [providerValue] + ); + props = _4R3V3JGP_spreadValues({ id }, props); + return props; } +); +var CompositeRow = createComponent((props) => { + const htmlProps = useCompositeRow(props); + return _3ORBWXWF_createElement("div", htmlProps); }); -var CompositeGroup = createComponent({ - as: "div", - useHook: useCompositeGroup -}); +if (false) {} @@ -17978,7 +16292,7 @@ function AlignmentMatrixControlIcon({ ...style, transform: `scale(${scale})` }; - return (0,external_wp_element_namespaceObject.createElement)(alignment_matrix_control_icon_styles_Root, { + return (0,external_React_.createElement)(alignment_matrix_control_icon_styles_Root, { ...props, className: classes, disablePointerEvents: disablePointerEvents, @@ -17986,14 +16300,14 @@ function AlignmentMatrixControlIcon({ style: styles }, ALIGNMENTS.map((align, index) => { const isActive = alignIndex === index; - return (0,external_wp_element_namespaceObject.createElement)(alignment_matrix_control_icon_styles_Cell, { + return (0,external_React_.createElement)(alignment_matrix_control_icon_styles_Cell, { key: align - }, (0,external_wp_element_namespaceObject.createElement)(alignment_matrix_control_icon_styles_Point, { + }, (0,external_React_.createElement)(alignment_matrix_control_icon_styles_Point, { isActive: isActive })); })); } -/* harmony default export */ var icon = (AlignmentMatrixControlIcon); +/* harmony default export */ const icon = (AlignmentMatrixControlIcon); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/index.js @@ -18008,7 +16322,6 @@ function AlignmentMatrixControlIcon({ - /** * Internal dependencies */ @@ -18017,12 +16330,6 @@ function AlignmentMatrixControlIcon({ -const alignment_matrix_control_noop = () => {}; -function useBaseId(id) { - const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(AlignmentMatrixControl, 'alignment-matrix-control'); - return id || instanceId; -} - /** * * AlignmentMatrixControl components enable adjustments to horizontal and vertical alignments for UI. @@ -18049,59 +16356,50 @@ function AlignmentMatrixControl({ label = (0,external_wp_i18n_namespaceObject.__)('Alignment Matrix Control'), defaultValue = 'center center', value, - onChange = alignment_matrix_control_noop, + onChange, width = 92, ...props }) { - const [immutableDefaultValue] = (0,external_wp_element_namespaceObject.useState)(value !== null && value !== void 0 ? value : defaultValue); - const baseId = useBaseId(id); - const initialCurrentId = getItemId(baseId, immutableDefaultValue); - const composite = useCompositeState({ - baseId, - currentId: initialCurrentId, + const baseId = (0,external_wp_compose_namespaceObject.useInstanceId)(AlignmentMatrixControl, 'alignment-matrix-control', id); + const compositeStore = useCompositeStore({ + defaultActiveId: getItemId(baseId, defaultValue), + activeId: getItemId(baseId, value), + setActiveId: nextActiveId => { + const nextValue = getItemValue(baseId, nextActiveId); + if (nextValue) onChange?.(nextValue); + }, rtl: (0,external_wp_i18n_namespaceObject.isRTL)() }); - const handleOnChange = nextValue => { - onChange(nextValue); - }; - const { - setCurrentId - } = composite; - (0,external_wp_element_namespaceObject.useEffect)(() => { - if (typeof value !== 'undefined') { - setCurrentId(getItemId(baseId, value)); - } - }, [value, setCurrentId, baseId]); + const activeId = compositeStore.useState('activeId'); const classes = classnames_default()('component-alignment-matrix-control', className); - return (0,external_wp_element_namespaceObject.createElement)(Composite, { - ...props, - ...composite, - "aria-label": label, - as: Root, - className: classes, - role: "grid", - size: width - }, GRID.map((cells, index) => (0,external_wp_element_namespaceObject.createElement)(CompositeGroup, { - ...composite, - as: Row, - role: "row", + return (0,external_React_.createElement)(Composite, { + store: compositeStore, + render: (0,external_React_.createElement)(Root, { + ...props, + "aria-label": label, + className: classes, + id: baseId, + role: "grid", + size: width + }) + }, GRID.map((cells, index) => (0,external_React_.createElement)(CompositeRow, { + render: (0,external_React_.createElement)(Row, { + role: "row" + }), key: index }, cells.map(cell => { const cellId = getItemId(baseId, cell); - const isActive = composite.currentId === cellId; - return (0,external_wp_element_namespaceObject.createElement)(cell_Cell, { - ...composite, + const isActive = cellId === activeId; + return (0,external_React_.createElement)(cell_Cell, { id: cellId, isActive: isActive, key: cell, - value: cell, - onFocus: () => handleOnChange(cell), - tabIndex: isActive ? 0 : -1 + value: cell }); })))); } AlignmentMatrixControl.Icon = icon; -/* harmony default export */ var alignment_matrix_control = (AlignmentMatrixControl); +/* harmony default export */ const alignment_matrix_control = (AlignmentMatrixControl); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/animate/index.js /** @@ -18176,7 +16474,7 @@ function Animate({ }) }); } -/* harmony default export */ var animate = (Animate); +/* harmony default export */ const animate = (Animate); ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs @@ -18307,7 +16605,7 @@ function useVisualElement(Component, visualState, props, createVisualElement) { ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/is-ref-object.mjs -function is_ref_object_isRefObject(ref) { +function isRefObject(ref) { return (typeof ref === "object" && Object.prototype.hasOwnProperty.call(ref, "current")); } @@ -18334,7 +16632,7 @@ function useMotionRef(visualState, visualElement, externalRef) { if (typeof externalRef === "function") { externalRef(instance); } - else if (is_ref_object_isRefObject(externalRef)) { + else if (isRefObject(externalRef)) { externalRef.current = instance; } } @@ -20783,7 +19081,7 @@ const rgbUnit = { ...number, transform: (v) => Math.round(clampRgbUnit(v)), }; -const rgba_rgba = { +const rgba = { test: isColorString("rgb", "red"), parse: splitColor("red", "green", "blue"), transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => "rgba(" + @@ -20836,7 +19134,7 @@ function parseHex(v) { const hex = { test: isColorString("#"), parse: parseHex, - transform: rgba_rgba.transform, + transform: rgba.transform, }; @@ -20872,10 +19170,10 @@ const hsla = { const color = { - test: (v) => rgba_rgba.test(v) || hex.test(v) || hsla.test(v), + test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v), parse: (v) => { - if (rgba_rgba.test(v)) { - return rgba_rgba.parse(v); + if (rgba.test(v)) { + return rgba.parse(v); } else if (hsla.test(v)) { return hsla.parse(v); @@ -20888,7 +19186,7 @@ const color = { return isString(v) ? v : v.hasOwnProperty("red") - ? rgba_rgba.transform(v) + ? rgba.transform(v) : hsla.transform(v); }, }; @@ -20980,7 +19278,7 @@ const mixLinearColor = (from, to, v) => { const fromExpo = from * from; return Math.sqrt(Math.max(0, v * (to * to - fromExpo) + fromExpo)); }; -const colorTypes = [hex, rgba_rgba, hsla]; +const colorTypes = [hex, rgba, hsla]; const getColorType = (v) => colorTypes.find((type) => type.test(v)); function asRGBA(color) { const type = getColorType(color); @@ -21001,7 +19299,7 @@ const mixColor = (from, to) => { blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v); blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v); blended.alpha = mix(fromRGBA.alpha, toRGBA.alpha, v); - return rgba_rgba.transform(blended); + return rgba.transform(blended); }; }; @@ -22044,7 +20342,7 @@ function animateValue({ autoplay = true, delay = 0, driver = frameloopDriver, ke ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/memo.mjs -function memo_memo(callback) { +function memo(callback) { let result; return () => { if (result === undefined) @@ -22065,7 +20363,7 @@ function memo_memo(callback) { -const supportsWaapi = memo_memo(() => Object.hasOwnProperty.call(Element.prototype, "animate")); +const supportsWaapi = memo(() => Object.hasOwnProperty.call(Element.prototype, "animate")); /** * A list of values that can be hardware-accelerated. */ @@ -24562,7 +22860,7 @@ class VisualElementDragControls { const { dragConstraints, dragElastic } = this.getProps(); const { layout } = this.visualElement.projection || {}; const prevConstraints = this.constraints; - if (dragConstraints && is_ref_object_isRefObject(dragConstraints)) { + if (dragConstraints && isRefObject(dragConstraints)) { if (!this.constraints) { this.constraints = this.resolveRefConstraints(); } @@ -24593,7 +22891,7 @@ class VisualElementDragControls { } resolveRefConstraints() { const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps(); - if (!constraints || !is_ref_object_isRefObject(constraints)) + if (!constraints || !isRefObject(constraints)) return false; const constraintsElement = constraints.current; errors_invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop."); @@ -24698,7 +22996,7 @@ class VisualElementDragControls { return; const { drag, dragConstraints } = this.getProps(); const { projection } = this.visualElement; - if (!is_ref_object_isRefObject(dragConstraints) || !projection || !this.constraints) + if (!isRefObject(dragConstraints) || !projection || !this.constraints) return; /** * Stop current animations as there can be visual glitching if we try to do @@ -24756,7 +23054,7 @@ class VisualElementDragControls { }); const measureDragConstraints = () => { const { dragConstraints } = this.getProps(); - if (is_ref_object_isRefObject(dragConstraints)) { + if (isRefObject(dragConstraints)) { this.constraints = this.resolveRefConstraints(); } }; @@ -27890,7 +26188,7 @@ class VisualElement { layoutId, layout, alwaysMeasureLayout: Boolean(drag) || - (dragConstraints && is_ref_object_isRefObject(dragConstraints)), + (dragConstraints && isRefObject(dragConstraints)), visualElement: this, scheduleRender: () => this.scheduleRender(), /** @@ -28705,15 +27003,97 @@ const AnimatePresence = ({ children, custom, initial = true, onExitComplete, exi -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/context.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/use-responsive-value.js /** * WordPress dependencies */ -const FlexContext = (0,external_wp_element_namespaceObject.createContext)({ - flexItemDisplay: undefined -}); -const useFlexContext = () => (0,external_wp_element_namespaceObject.useContext)(FlexContext); +const breakpoints = ['40em', '52em', '64em']; +const useBreakpointIndex = (options = {}) => { + const { + defaultIndex = 0 + } = options; + if (typeof defaultIndex !== 'number') { + throw new TypeError(`Default breakpoint index should be a number. Got: ${defaultIndex}, ${typeof defaultIndex}`); + } else if (defaultIndex < 0 || defaultIndex > breakpoints.length - 1) { + throw new RangeError(`Default breakpoint index out of range. Theme has ${breakpoints.length} breakpoints, got index ${defaultIndex}`); + } + const [value, setValue] = (0,external_wp_element_namespaceObject.useState)(defaultIndex); + (0,external_wp_element_namespaceObject.useEffect)(() => { + const getIndex = () => breakpoints.filter(bp => { + return typeof window !== 'undefined' ? window.matchMedia(`screen and (min-width: ${bp})`).matches : false; + }).length; + const onResize = () => { + const newValue = getIndex(); + if (value !== newValue) { + setValue(newValue); + } + }; + onResize(); + if (typeof window !== 'undefined') { + window.addEventListener('resize', onResize); + } + return () => { + if (typeof window !== 'undefined') { + window.removeEventListener('resize', onResize); + } + }; + }, [value]); + return value; +}; +function useResponsiveValue(values, options = {}) { + const index = useBreakpointIndex(options); + + // Allow calling the function with a "normal" value without having to check on the outside. + if (!Array.isArray(values) && typeof values !== 'function') return values; + const array = values || []; + + /* eslint-disable jsdoc/no-undefined-types */ + return /** @type {T[]} */array[/* eslint-enable jsdoc/no-undefined-types */ + index >= array.length ? array.length - 1 : index]; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/space.js +/** + * The argument value for the `space()` utility function. + * + * When this is a number or a numeric string, it will be interpreted as a + * multiplier for the grid base value (4px). For example, `space( 2 )` will be 8px. + * + * Otherwise, it will be interpreted as a literal CSS length value. For example, + * `space( 'auto' )` will be 'auto', and `space( '2px' )` will be 2px. + */ + +const GRID_BASE = '4px'; + +/** + * A function that handles numbers, numeric strings, and unit values. + * + * When given a number or a numeric string, it will return the grid-based + * value as a factor of GRID_BASE, defined above. + * + * When given a unit value or one of the named CSS values like `auto`, + * it will simply return the value back. + * + * @param value A number, numeric string, or a unit value. + */ +function space(value) { + if (typeof value === 'undefined') { + return undefined; + } + + // Handle empty strings, if it's the number 0 this still works. + if (!value) { + return '0'; + } + const asInt = typeof value === 'number' ? value : Number(value); + + // Test if the input has a unit, was NaN, or was one of the named CSS values (like `auto`), in which case just use that value. + if (typeof window !== 'undefined' && window.CSS?.supports?.('margin', value.toString()) || Number.isNaN(asInt)) { + return value.toString(); + } + return `calc(${GRID_BASE} * ${value})`; +} ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/styles.js function styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } @@ -28755,6 +27135,146 @@ const ItemsRow = true ? { styles: ">*{min-width:0;}" } : 0; +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex/hook.js +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + + + +function useDeprecatedProps(props) { + const { + isReversed, + ...otherProps + } = props; + if (typeof isReversed !== 'undefined') { + external_wp_deprecated_default()('Flex isReversed', { + alternative: 'Flex direction="row-reverse" or "column-reverse"', + since: '5.9' + }); + return { + ...otherProps, + direction: isReversed ? 'row-reverse' : 'row' + }; + } + return otherProps; +} +function useFlex(props) { + const { + align, + className, + direction: directionProp = 'row', + expanded = true, + gap = 2, + justify = 'space-between', + wrap = false, + ...otherProps + } = useContextSystem(useDeprecatedProps(props), 'Flex'); + const directionAsArray = Array.isArray(directionProp) ? directionProp : [directionProp]; + const direction = useResponsiveValue(directionAsArray); + const isColumn = typeof direction === 'string' && !!direction.includes('column'); + const cx = useCx(); + const classes = (0,external_wp_element_namespaceObject.useMemo)(() => { + const base = /*#__PURE__*/emotion_react_browser_esm_css({ + alignItems: align !== null && align !== void 0 ? align : isColumn ? 'normal' : 'center', + flexDirection: direction, + flexWrap: wrap ? 'wrap' : undefined, + gap: space(gap), + justifyContent: justify, + height: isColumn && expanded ? '100%' : undefined, + width: !isColumn && expanded ? '100%' : undefined + }, true ? "" : 0, true ? "" : 0); + return cx(Flex, base, isColumn ? ItemsColumn : ItemsRow, className); + }, [align, className, cx, direction, expanded, gap, isColumn, justify, wrap]); + return { + ...otherProps, + className: classes, + isColumn + }; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/context.js +/** + * WordPress dependencies + */ + +const FlexContext = (0,external_wp_element_namespaceObject.createContext)({ + flexItemDisplay: undefined +}); +const useFlexContext = () => (0,external_wp_element_namespaceObject.useContext)(FlexContext); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex/component.js + +/** + * External dependencies + */ + +/** + * Internal dependencies + */ + + + + + +function UnconnectedFlex(props, forwardedRef) { + const { + children, + isColumn, + ...otherProps + } = useFlex(props); + return (0,external_React_.createElement)(FlexContext.Provider, { + value: { + flexItemDisplay: isColumn ? 'block' : undefined + } + }, (0,external_React_.createElement)(component, { + ...otherProps, + ref: forwardedRef + }, children)); +} + +/** + * `Flex` is a primitive layout component that adaptively aligns child content + * horizontally or vertically. `Flex` powers components like `HStack` and + * `VStack`. + * + * `Flex` is used with any of its two sub-components, `FlexItem` and + * `FlexBlock`. + * + * ```jsx + * import { Flex, FlexBlock, FlexItem } from '@wordpress/components'; + * + * function Example() { + * return ( + * <Flex> + * <FlexItem> + * <p>Code</p> + * </FlexItem> + * <FlexBlock> + * <p>Poetry</p> + * </FlexBlock> + * </Flex> + * ); + * } + * ``` + */ +const component_Flex = contextConnect(UnconnectedFlex, 'Flex'); +/* harmony default export */ const flex_component = (component_Flex); + ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex-item/hook.js /** * External dependencies @@ -28821,7 +27341,7 @@ function useFlexBlock(props) { function UnconnectedFlexBlock(props, forwardedRef) { const flexBlockProps = useFlexBlock(props); - return (0,external_wp_element_namespaceObject.createElement)(component, { + return (0,external_React_.createElement)(component, { ...flexBlockProps, ref: forwardedRef }); @@ -28844,49 +27364,7 @@ function UnconnectedFlexBlock(props, forwardedRef) { * ``` */ const FlexBlock = contextConnect(UnconnectedFlexBlock, 'FlexBlock'); -/* harmony default export */ var flex_block_component = (FlexBlock); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/utils/space.js -/** - * The argument value for the `space()` utility function. - * - * When this is a number or a numeric string, it will be interpreted as a - * multiplier for the grid base value (4px). For example, `space( 2 )` will be 8px. - * - * Otherwise, it will be interpreted as a literal CSS length value. For example, - * `space( 'auto' )` will be 'auto', and `space( '2px' )` will be 2px. - */ - -const GRID_BASE = '4px'; - -/** - * A function that handles numbers, numeric strings, and unit values. - * - * When given a number or a numeric string, it will return the grid-based - * value as a factor of GRID_BASE, defined above. - * - * When given a unit value or one of the named CSS values like `auto`, - * it will simply return the value back. - * - * @param value A number, numeric string, or a unit value. - */ -function space(value) { - if (typeof value === 'undefined') { - return undefined; - } - - // Handle empty strings, if it's the number 0 this still works. - if (!value) { - return '0'; - } - const asInt = typeof value === 'number' ? value : Number(value); - - // Test if the input has a unit, was NaN, or was one of the named CSS values (like `auto`), in which case just use that value. - if (typeof window !== 'undefined' && window.CSS?.supports?.('margin', value.toString()) || Number.isNaN(asInt)) { - return value.toString(); - } - return `calc(${GRID_BASE} * ${value})`; -} +/* harmony default export */ const flex_block_component = (FlexBlock); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/rtl.js /** @@ -29041,7 +27519,7 @@ function useSpacer(props) { function UnconnectedSpacer(props, forwardedRef) { const spacerProps = useSpacer(props); - return (0,external_wp_element_namespaceObject.createElement)(component, { + return (0,external_React_.createElement)(component, { ...spacerProps, ref: forwardedRef }); @@ -29072,7 +27550,7 @@ function UnconnectedSpacer(props, forwardedRef) { * ``` */ const Spacer = contextConnect(UnconnectedSpacer, 'Spacer'); -/* harmony default export */ var spacer_component = (Spacer); +/* harmony default export */ const spacer_component = (Spacer); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plus.js @@ -29080,13 +27558,13 @@ const Spacer = contextConnect(UnconnectedSpacer, 'Spacer'); * WordPress dependencies */ -const plus = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const plus = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { - d: "M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z" +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" })); -/* harmony default export */ var library_plus = (plus); +/* harmony default export */ const library_plus = (plus); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/reset.js @@ -29094,194 +27572,13 @@ const plus = (0,external_wp_element_namespaceObject.createElement)(external_wp_p * WordPress dependencies */ -const reset_reset = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const reset_reset = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M7 11.5h10V13H7z" })); -/* harmony default export */ var library_reset = (reset_reset); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/utils/use-responsive-value.js -/** - * WordPress dependencies - */ - -const breakpoints = ['40em', '52em', '64em']; -const useBreakpointIndex = (options = {}) => { - const { - defaultIndex = 0 - } = options; - if (typeof defaultIndex !== 'number') { - throw new TypeError(`Default breakpoint index should be a number. Got: ${defaultIndex}, ${typeof defaultIndex}`); - } else if (defaultIndex < 0 || defaultIndex > breakpoints.length - 1) { - throw new RangeError(`Default breakpoint index out of range. Theme has ${breakpoints.length} breakpoints, got index ${defaultIndex}`); - } - const [value, setValue] = (0,external_wp_element_namespaceObject.useState)(defaultIndex); - (0,external_wp_element_namespaceObject.useEffect)(() => { - const getIndex = () => breakpoints.filter(bp => { - return typeof window !== 'undefined' ? window.matchMedia(`screen and (min-width: ${bp})`).matches : false; - }).length; - const onResize = () => { - const newValue = getIndex(); - if (value !== newValue) { - setValue(newValue); - } - }; - onResize(); - if (typeof window !== 'undefined') { - window.addEventListener('resize', onResize); - } - return () => { - if (typeof window !== 'undefined') { - window.removeEventListener('resize', onResize); - } - }; - }, [value]); - return value; -}; -function useResponsiveValue(values, options = {}) { - const index = useBreakpointIndex(options); - - // Allow calling the function with a "normal" value without having to check on the outside. - if (!Array.isArray(values) && typeof values !== 'function') return values; - const array = values || []; - - /* eslint-disable jsdoc/no-undefined-types */ - return (/** @type {T[]} */array[/* eslint-enable jsdoc/no-undefined-types */ - index >= array.length ? array.length - 1 : index] - ); -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex/hook.js -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - - - -function useDeprecatedProps(props) { - const { - isReversed, - ...otherProps - } = props; - if (typeof isReversed !== 'undefined') { - external_wp_deprecated_default()('Flex isReversed', { - alternative: 'Flex direction="row-reverse" or "column-reverse"', - since: '5.9' - }); - return { - ...otherProps, - direction: isReversed ? 'row-reverse' : 'row' - }; - } - return otherProps; -} -function useFlex(props) { - const { - align, - className, - direction: directionProp = 'row', - expanded = true, - gap = 2, - justify = 'space-between', - wrap = false, - ...otherProps - } = useContextSystem(useDeprecatedProps(props), 'Flex'); - const directionAsArray = Array.isArray(directionProp) ? directionProp : [directionProp]; - const direction = useResponsiveValue(directionAsArray); - const isColumn = typeof direction === 'string' && !!direction.includes('column'); - const cx = useCx(); - const classes = (0,external_wp_element_namespaceObject.useMemo)(() => { - const base = /*#__PURE__*/emotion_react_browser_esm_css({ - alignItems: align !== null && align !== void 0 ? align : isColumn ? 'normal' : 'center', - flexDirection: direction, - flexWrap: wrap ? 'wrap' : undefined, - gap: space(gap), - justifyContent: justify, - height: isColumn && expanded ? '100%' : undefined, - width: !isColumn && expanded ? '100%' : undefined - }, true ? "" : 0, true ? "" : 0); - return cx(Flex, base, isColumn ? ItemsColumn : ItemsRow, className); - }, [align, className, cx, direction, expanded, gap, isColumn, justify, wrap]); - return { - ...otherProps, - className: classes, - isColumn - }; -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex/component.js - -/** - * External dependencies - */ - -/** - * Internal dependencies - */ - - - - - -function UnconnectedFlex(props, forwardedRef) { - const { - children, - isColumn, - ...otherProps - } = useFlex(props); - return (0,external_wp_element_namespaceObject.createElement)(FlexContext.Provider, { - value: { - flexItemDisplay: isColumn ? 'block' : undefined - } - }, (0,external_wp_element_namespaceObject.createElement)(component, { - ...otherProps, - ref: forwardedRef - }, children)); -} - -/** - * `Flex` is a primitive layout component that adaptively aligns child content - * horizontally or vertically. `Flex` powers components like `HStack` and - * `VStack`. - * - * `Flex` is used with any of its two sub-components, `FlexItem` and - * `FlexBlock`. - * - * ```jsx - * import { Flex, FlexBlock, FlexItem } from '@wordpress/components'; - * - * function Example() { - * return ( - * <Flex> - * <FlexItem> - * <p>Code</p> - * </FlexItem> - * <FlexBlock> - * <p>Poetry</p> - * </FlexBlock> - * </Flex> - * ); - * } - * ``` - */ -const component_Flex = contextConnect(UnconnectedFlex, 'Flex'); -/* harmony default export */ var flex_component = (component_Flex); +/* harmony default export */ const library_reset = (reset_reset); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex-item/component.js @@ -29298,7 +27595,7 @@ const component_Flex = contextConnect(UnconnectedFlex, 'Flex'); function UnconnectedFlexItem(props, forwardedRef) { const flexItemProps = useFlexItem(props); - return (0,external_wp_element_namespaceObject.createElement)(component, { + return (0,external_React_.createElement)(component, { ...flexItemProps, ref: forwardedRef }); @@ -29321,7 +27618,7 @@ function UnconnectedFlexItem(props, forwardedRef) { * ``` */ const FlexItem = contextConnect(UnconnectedFlexItem, 'FlexItem'); -/* harmony default export */ var flex_item_component = (FlexItem); +/* harmony default export */ const flex_item_component = (FlexItem); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/truncate/styles.js function truncate_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } @@ -29501,13 +27798,19 @@ function useTruncate(props) { ...otherProps } = useContextSystem(props, 'Truncate'); const cx = useCx(); - const truncatedContent = truncateContent(typeof children === 'string' ? children : '', { + let childrenAsText; + if (typeof children === 'string') { + childrenAsText = children; + } else if (typeof children === 'number') { + childrenAsText = children.toString(); + } + const truncatedContent = childrenAsText ? truncateContent(childrenAsText, { ellipsis, ellipsizeMode, limit, numberOfLines - }); - const shouldTruncate = ellipsizeMode === TRUNCATE_TYPE.auto; + }) : children; + const shouldTruncate = !!childrenAsText && ellipsizeMode === TRUNCATE_TYPE.auto; const classes = (0,external_wp_element_namespaceObject.useMemo)(() => { const truncateLines = /*#__PURE__*/emotion_react_browser_esm_css("-webkit-box-orient:vertical;-webkit-line-clamp:", numberOfLines, ";display:-webkit-box;overflow:hidden;" + ( true ? "" : 0), true ? "" : 0); return cx(shouldTruncate && !numberOfLines && Truncate, shouldTruncate && !!numberOfLines && truncateLines, className); @@ -29519,7 +27822,13 @@ function useTruncate(props) { }; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/utils/colors.js +;// CONCATENATED MODULE: ./node_modules/colord/index.mjs +var r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},colord_n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},colord_e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},colord_a=function(r){return{r:colord_e(r.r,0,255),g:colord_e(r.g,0,255),b:colord_e(r.b,0,255),a:colord_e(r.a)}},colord_o=function(r){return{r:colord_n(r.r),g:colord_n(r.g),b:colord_n(r.b),a:colord_n(r.a,3)}},i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:colord_e(r.s,0,100),l:colord_e(r.l,0,100),a:colord_e(r.a)}},d=function(r){return{h:colord_n(r.h),s:colord_n(r.s),l:colord_n(r.l),a:colord_n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y={string:[[function(r){var t=i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?colord_n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?colord_n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:colord_a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(t){var n=l.exec(t)||p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u="deg"),Number(e)*(r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},"hsl"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?colord_a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},"rgb"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},"hsl"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:colord_e(r.s,0,100),v:colord_e(r.v,0,100),a:colord_e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},"hsv"]]},N=function(r,t){for(var n=0;n<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return"string"==typeof r?N(r.trim(),y.string):"object"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:colord_e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:colord_e(n.l+100*t,0,100),a:n.a}},j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return colord_n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.5},r.prototype.toHex=function(){return r=colord_o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(colord_n(255*a)):"","#"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return colord_o(this.rgba)},r.prototype.toRgbString=function(){return r=colord_o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?"rgba("+t+", "+n+", "+e+", "+u+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:colord_n(r.h),s:colord_n(r.s),v:colord_n(r.v),a:colord_n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return"number"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):colord_n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return"number"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):colord_n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof j?r:new j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(j,y),S.push(r))})},E=function(){return new j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})}; + +;// CONCATENATED MODULE: ./node_modules/colord/plugins/names.mjs +/* harmony default export */ function names(e,f){var a={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var d in a)r[a[d]]=d;var l={};e.prototype.toName=function(f){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var d,i,n=r[this.toHex()];if(n)return n;if(null==f?void 0:f.closest){var o=this.toRgb(),t=1/0,b="black";if(!l.length)for(var c in a)l[c]=new e(a[c]).toRgb();for(var g in a){var u=(d=o,i=l[g],Math.pow(d.r-i.r,2)+Math.pow(d.g-i.g,2)+Math.pow(d.b-i.b,2));u<t&&(t=u,b=g)}return b}};f.string.push([function(f){var r=f.toLowerCase(),d="transparent"===r?"#0000":a[r];return d?new e(d).toRgb():null},"name"])} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/colors.js /** * External dependencies */ @@ -29532,6 +27841,21 @@ let colorComputationNode; k([names]); /** + * Generating a CSS compliant rgba() color value. + * + * @param {string} hexValue The hex value to convert to rgba(). + * @param {number} alpha The alpha value for opacity. + * @return {string} The converted rgba() color value. + * + * @example + * rgba( '#000000', 0.5 ) + * // rgba(0, 0, 0, 0.5) + */ +function colors_rgba(hexValue = '', alpha = 1) { + return colord(hexValue).alpha(alpha).toRgbString(); +} + +/** * @return {HTMLDivElement | undefined} The HTML element for color computation. */ function getColorComputationNode() { @@ -29643,7 +27967,7 @@ const TOGGLE_GROUP_CONTROL_PROPS = { // Using Object.assign to avoid creating circular references when emitting // TypeScript type declarations. -/* harmony default export */ var config_values = (Object.assign({}, CONTROL_PROPS, TOGGLE_GROUP_CONTROL_PROPS, { +/* harmony default export */ const config_values = (Object.assign({}, CONTROL_PROPS, TOGGLE_GROUP_CONTROL_PROPS, { colorDivider: 'rgba(0, 0, 0, 0.1)', colorScrollbarThumb: 'rgba(0, 0, 0, 0.2)', colorScrollbarThumbHover: 'rgba(0, 0, 0, 0.5)', @@ -29717,7 +28041,7 @@ const upperCase = true ? { } : 0; // EXTERNAL MODULE: ./node_modules/highlight-words-core/dist/index.js -var dist = __webpack_require__(3138); +var dist = __webpack_require__(9664); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/utils.js /** * External dependencies @@ -29735,7 +28059,6 @@ var dist = __webpack_require__(3138); * https://github.com/bvaughn/react-highlight-words/blob/HEAD/src/Highlighter.js */ -/* eslint-disable jsdoc/valid-types */ /** * @typedef Options * @property {string} [activeClassName=''] Classname for active highlighted areas. @@ -29757,13 +28080,10 @@ var dist = __webpack_require__(3138); /** * Maps props to lowercase names. * - * @template {Record<string, unknown>} T - * @param {T} object Props to map. - * @return {{[K in keyof T as Lowercase<string & K>]: T[K]}} The mapped props. + * @param object Props to map. + * @return The mapped props. */ -/* eslint-enable jsdoc/valid-types */ const lowercaseProps = object => { - /** @type {any} */ const mapped = {}; for (const key in object) { mapped[key.toLowerCase()] = object[key]; @@ -29773,8 +28093,21 @@ const lowercaseProps = object => { const memoizedLowercaseProps = memize(lowercaseProps); /** - * - * @param {Options} options + * @param options + * @param options.activeClassName + * @param options.activeIndex + * @param options.activeStyle + * @param options.autoEscape + * @param options.caseSensitive + * @param options.children + * @param options.findChunks + * @param options.highlightClassName + * @param options.highlightStyle + * @param options.highlightTag + * @param options.sanitize + * @param options.searchWords + * @param options.unhighlightClassName + * @param options.unhighlightStyle */ function createHighlighterText({ activeClassName = '', @@ -29825,8 +28158,6 @@ function createHighlighterText({ const isActive = highlightIndex === +activeIndex; highlightClassNames = `${highlightClass} ${isActive ? activeClassName : ''}`; highlightStyles = isActive === true && activeStyle !== null ? Object.assign({}, highlightStyle, activeStyle) : highlightStyle; - - /** @type {Record<string, any>} */ const props = { children: text, className: highlightClassNames, @@ -29851,7 +28182,7 @@ function createHighlighterText({ return textContent; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/utils/font-size.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/font-size.js /** * External dependencies */ @@ -29928,6 +28259,7 @@ function hook_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to strin */ + /** * WordPress dependencies */ @@ -29946,13 +28278,13 @@ function hook_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to strin -/** - * @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'span'>} props - */ var hook_ref = true ? { name: "50zrmy", styles: "text-transform:uppercase" } : 0; +/** + * @param {import('../context').WordPressComponentProps<import('./types').Props, 'span'>} props + */ function useText(props) { const { adjustLineHeightForInnerControls, @@ -29978,8 +28310,6 @@ function useText(props) { weight = config_values.fontWeight, ...otherProps } = useContextSystem(props, 'Text'); - - /** @type {import('react').ReactNode} */ let content = children; const isHighlighter = Array.isArray(highlightWords); const isCaption = size === 'caption'; @@ -29989,9 +28319,7 @@ function useText(props) { } content = createHighlighterText({ autoEscape: highlightEscape, - // Disable reason: We need to disable this otherwise it erases the cast - // eslint-disable-next-line object-shorthand - children: /** @type {string} */children, + children, caseSensitive: highlightCaseSensitive, searchWords: highlightWords, sanitize: highlightSanitize @@ -30005,10 +28333,7 @@ function useText(props) { color, display, fontSize: getFontSize(size), - /* eslint-disable jsdoc/valid-types */ - fontWeight: /** @type {import('react').CSSProperties['fontWeight']} */ - weight, - /* eslint-enable jsdoc/valid-types */ + fontWeight: weight, lineHeight, letterSpacing, textAlign: align @@ -30025,8 +28350,6 @@ function useText(props) { } return cx(Text, sx.Base, sx.optimalTextColor, isDestructive && destructive, !!isHighlighter && highlighterText, isBlock && styles_block, isCaption && muted, variant && text_styles_namespaceObject[variant], upperCase && sx.upperCase, className); }, [adjustLineHeightForInnerControls, align, className, color, cx, display, isBlock, isCaption, isDestructive, isHighlighter, letterSpacing, lineHeightProp, optimizeReadabilityFor, size, upperCase, variant, weight]); - - /** @type {undefined | 'auto' | 'none'} */ let finalEllipsizeMode; if (truncate === true) { finalEllipsizeMode = 'auto'; @@ -30075,12 +28398,12 @@ function useText(props) { /** - * @param {import('../ui/context').WordPressComponentProps<import('./types').Props, 'span'>} props - * @param {import('react').ForwardedRef<any>} forwardedRef + * @param props + * @param forwardedRef */ -function component_Text(props, forwardedRef) { +function UnconnectedText(props, forwardedRef) { const textProps = useText(props); - return (0,external_wp_element_namespaceObject.createElement)(component, { + return (0,external_React_.createElement)(component, { as: "span", ...textProps, ref: forwardedRef @@ -30103,8 +28426,8 @@ function component_Text(props, forwardedRef) { * } * ``` */ -const ConnectedText = contextConnect(component_Text, 'Text'); -/* harmony default export */ var text_component = (ConnectedText); +const component_Text = contextConnect(UnconnectedText, 'Text'); +/* harmony default export */ const text_component = (component_Text); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/base-label.js function base_label_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } @@ -30190,6 +28513,7 @@ const fontSizeStyles = ({ const sizes = { default: '13px', small: '11px', + compact: '13px', '__unstable-large': '13px' }; const fontSize = sizes[size] || sizes.default; @@ -30199,14 +28523,14 @@ const fontSizeStyles = ({ }; const getSizeConfig = ({ inputSize: size, - __next36pxDefaultSize + __next40pxDefaultSize }) => { // Paddings may be overridden by the custom paddings props. const sizes = { default: { - height: 36, + height: 40, lineHeight: 1, - minHeight: 36, + minHeight: 40, paddingLeft: space(4), paddingRight: space(4) }, @@ -30217,6 +28541,13 @@ const getSizeConfig = ({ paddingLeft: space(2), paddingRight: space(2) }, + compact: { + height: 32, + lineHeight: 1, + minHeight: 32, + paddingLeft: space(2), + paddingRight: space(2) + }, '__unstable-large': { height: 40, lineHeight: 1, @@ -30225,14 +28556,8 @@ const getSizeConfig = ({ paddingRight: space(4) } }; - if (!__next36pxDefaultSize) { - sizes.default = { - height: 30, - lineHeight: 1, - minHeight: 30, - paddingLeft: space(2), - paddingRight: space(2) - }; + if (!__next40pxDefaultSize) { + sizes.default = sizes.compact; } return sizes[size] || sizes.default; }; @@ -30268,11 +28593,11 @@ const dragStyles = ({ const Input = emotion_styled_base_browser_esm("input", true ? { target: "em5sgkm5" -} : 0)("&&&{background-color:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:", COLORS.gray[900], ";display:block;font-family:inherit;margin:0;outline:none;width:100%;", dragStyles, " ", disabledStyles, " ", fontSizeStyles, " ", sizeStyles, " ", customPaddings, " &::-webkit-input-placeholder{line-height:normal;}}" + ( true ? "" : 0)); +} : 0)("&&&{background-color:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:", COLORS.theme.foreground, ";display:block;font-family:inherit;margin:0;outline:none;width:100%;", dragStyles, " ", disabledStyles, " ", fontSizeStyles, " ", sizeStyles, " ", customPaddings, " &::-webkit-input-placeholder{line-height:normal;}}" + ( true ? "" : 0)); const BaseLabel = /*#__PURE__*/emotion_styled_base_browser_esm(text_component, true ? { target: "em5sgkm4" } : 0)("&&&{", baseLabelTypography, ";box-sizing:border-box;display:block;padding-top:0;padding-bottom:0;max-width:100%;z-index:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}" + ( true ? "" : 0)); -const Label = props => (0,external_wp_element_namespaceObject.createElement)(BaseLabel, { +const Label = props => (0,external_React_.createElement)(BaseLabel, { ...props, as: "label" }); @@ -30284,20 +28609,22 @@ const LabelWrapper = /*#__PURE__*/emotion_styled_base_browser_esm(flex_item_comp } : 0); const backdropFocusedStyles = ({ disabled, + isBorderless, isFocused }) => { - let borderColor = isFocused ? COLORS.ui.borderFocus : COLORS.ui.border; + let borderColor = isBorderless ? 'transparent' : COLORS.ui.border; let boxShadow; let outline; let outlineOffset; if (isFocused) { + borderColor = COLORS.ui.borderFocus; boxShadow = config_values.controlBoxShadowFocus; // Windows High Contrast mode will show this outline, but not the box-shadow. outline = `2px solid transparent`; outlineOffset = `-2px`; } if (disabled) { - borderColor = COLORS.ui.borderDisabled; + borderColor = isBorderless ? 'transparent' : COLORS.ui.borderDisabled; } return /*#__PURE__*/emotion_react_browser_esm_css({ boxShadow, @@ -30338,17 +28665,19 @@ const Suffix = emotion_styled_base_browser_esm("span", true ? { function Backdrop({ disabled = false, + isBorderless = false, isFocused = false }) { - return (0,external_wp_element_namespaceObject.createElement)(BackdropUI, { + return (0,external_React_.createElement)(BackdropUI, { "aria-hidden": "true", className: "components-input-control__backdrop", disabled: disabled, + isBorderless: isBorderless, isFocused: isFocused }); } const MemoizedBackdrop = (0,external_wp_element_namespaceObject.memo)(Backdrop); -/* harmony default export */ var backdrop = (MemoizedBackdrop); +/* harmony default export */ const backdrop = (MemoizedBackdrop); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/label.js @@ -30365,17 +28694,30 @@ function label_Label({ }) { if (!children) return null; if (hideLabelFromVision) { - return (0,external_wp_element_namespaceObject.createElement)(visually_hidden_component, { + return (0,external_React_.createElement)(visually_hidden_component, { as: "label", htmlFor: htmlFor }, children); } - return (0,external_wp_element_namespaceObject.createElement)(LabelWrapper, null, (0,external_wp_element_namespaceObject.createElement)(Label, { + return (0,external_React_.createElement)(LabelWrapper, null, (0,external_React_.createElement)(Label, { htmlFor: htmlFor, ...props }, children)); } +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/use-deprecated-props.js +function useDeprecated36pxDefaultSizeProp(props) { + const { + __next36pxDefaultSize, + __next40pxDefaultSize, + ...otherProps + } = props; + return { + ...otherProps, + __next40pxDefaultSize: __next40pxDefaultSize !== null && __next40pxDefaultSize !== void 0 ? __next40pxDefaultSize : __next36pxDefaultSize + }; +} + ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/input-base.js /** @@ -30395,6 +28737,7 @@ function label_Label({ + function useUniqueId(idProp) { const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(InputBase); const id = `input-base-control-${instanceId}`; @@ -30421,22 +28764,24 @@ function getUIFlexProps(labelPosition) { } return props; } -function InputBase({ - __next36pxDefaultSize, - __unstableInputWidth, - children, - className, - disabled = false, - hideLabelFromVision = false, - labelPosition, - id: idProp, - isFocused = false, - label, - prefix, - size = 'default', - suffix, - ...props -}, ref) { +function InputBase(props, ref) { + const { + __next40pxDefaultSize, + __unstableInputWidth, + children, + className, + disabled = false, + hideLabelFromVision = false, + labelPosition, + id: idProp, + isBorderless = false, + isFocused = false, + label, + prefix, + size = 'default', + suffix, + ...restProps + } = useDeprecated36pxDefaultSizeProp(useContextSystem(props, 'InputBase')); const id = useUniqueId(idProp); const hideLabel = hideLabelFromVision || !label; const { @@ -30444,7 +28789,7 @@ function InputBase({ paddingRight } = getSizeConfig({ inputSize: size, - __next36pxDefaultSize + __next40pxDefaultSize }); const prefixSuffixContextValue = (0,external_wp_element_namespaceObject.useMemo)(() => { return { @@ -30458,38 +28803,39 @@ function InputBase({ }, [paddingLeft, paddingRight]); return ( // @ts-expect-error The `direction` prop from Flex (FlexDirection) conflicts with legacy SVGAttributes `direction` (string) that come from React intrinsic prop definitions. - (0,external_wp_element_namespaceObject.createElement)(input_control_styles_Root, { - ...props, + (0,external_React_.createElement)(input_control_styles_Root, { + ...restProps, ...getUIFlexProps(labelPosition), className: className, gap: 2, isFocused: isFocused, labelPosition: labelPosition, ref: ref - }, (0,external_wp_element_namespaceObject.createElement)(label_Label, { + }, (0,external_React_.createElement)(label_Label, { className: "components-input-control__label", hideLabelFromVision: hideLabelFromVision, labelPosition: labelPosition, htmlFor: id - }, label), (0,external_wp_element_namespaceObject.createElement)(Container, { + }, label), (0,external_React_.createElement)(Container, { __unstableInputWidth: __unstableInputWidth, className: "components-input-control__container", disabled: disabled, hideLabel: hideLabel, labelPosition: labelPosition - }, (0,external_wp_element_namespaceObject.createElement)(ContextSystemProvider, { + }, (0,external_React_.createElement)(ContextSystemProvider, { value: prefixSuffixContextValue - }, prefix && (0,external_wp_element_namespaceObject.createElement)(Prefix, { + }, prefix && (0,external_React_.createElement)(Prefix, { className: "components-input-control__prefix" - }, prefix), children, suffix && (0,external_wp_element_namespaceObject.createElement)(Suffix, { + }, prefix), children, suffix && (0,external_React_.createElement)(Suffix, { className: "components-input-control__suffix" - }, suffix)), (0,external_wp_element_namespaceObject.createElement)(backdrop, { + }, suffix)), (0,external_React_.createElement)(backdrop, { disabled: disabled, + isBorderless: isBorderless, isFocused: isFocused }))) ); } -/* harmony default export */ var input_base = ((0,external_wp_element_namespaceObject.forwardRef)(InputBase)); +/* harmony default export */ const input_base = (contextConnect(InputBase, 'InputBase')); ;// CONCATENATED MODULE: ./node_modules/@use-gesture/core/dist/maths-0ab39ae9.esm.js function maths_0ab39ae9_esm_clamp(v, min, max) { @@ -30551,7 +28897,7 @@ function _toPropertyKey(arg) { return typeof key === "symbol" ? key : String(key); } -function actions_b1cc53c2_esm_defineProperty(obj, key, value) { +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { @@ -30566,7 +28912,7 @@ function actions_b1cc53c2_esm_defineProperty(obj, key, value) { return obj; } -function actions_b1cc53c2_esm_ownKeys(object, enumerableOnly) { +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); @@ -30576,12 +28922,12 @@ function actions_b1cc53c2_esm_ownKeys(object, enumerableOnly) { } return keys; } -function actions_b1cc53c2_esm_objectSpread2(target) { +function _objectSpread2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; - i % 2 ? actions_b1cc53c2_esm_ownKeys(Object(source), !0).forEach(function (key) { - actions_b1cc53c2_esm_defineProperty(target, key, source[key]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : actions_b1cc53c2_esm_ownKeys(Object(source)).forEach(function (key) { + i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { + _defineProperty(target, key, source[key]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } @@ -30942,7 +29288,7 @@ class Engine { const config = this.config; if (!state._active) this.clean(); if ((state._blocked || !state.intentional) && !state._force && !config.triggerAllEvents) return; - const memo = this.handler(actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_esm_objectSpread2({}, shared), state), {}, { + const memo = this.handler(_objectSpread2(_objectSpread2(_objectSpread2({}, shared), state), {}, { [this.aliasKey]: state.values })); if (memo !== undefined) state.memo = memo; @@ -30967,7 +29313,7 @@ function selectAxis([dx, dy], threshold) { class CoordinatesEngine extends Engine { constructor(...args) { super(...args); - actions_b1cc53c2_esm_defineProperty(this, "aliasKey", 'xy'); + _defineProperty(this, "aliasKey", 'xy'); } reset() { super.reset(); @@ -31013,7 +29359,7 @@ const commonConfigResolver = { return value; }, eventOptions(value, _k, config) { - return actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_esm_objectSpread2({}, config.shared.eventOptions), value); + return _objectSpread2(_objectSpread2({}, config.shared.eventOptions), value); }, preventDefault(value = false) { return value; @@ -31048,7 +29394,7 @@ const commonConfigResolver = { if (false) {} const DEFAULT_AXIS_THRESHOLD = 0; -const coordinatesConfigResolver = actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_esm_objectSpread2({}, commonConfigResolver), {}, { +const coordinatesConfigResolver = _objectSpread2(_objectSpread2({}, commonConfigResolver), {}, { axis(_v, _k, { axis }) { @@ -31087,7 +29433,7 @@ const KEYS_DELTA_MAP = { class DragEngine extends CoordinatesEngine { constructor(...args) { super(...args); - actions_b1cc53c2_esm_defineProperty(this, "ingKey", 'dragging'); + _defineProperty(this, "ingKey", 'dragging'); } reset() { super.reset(); @@ -31377,7 +29723,7 @@ const DEFAULT_DRAG_AXIS_THRESHOLD = { touch: 0, pen: 8 }; -const dragConfigResolver = actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_esm_objectSpread2({}, coordinatesConfigResolver), {}, { +const dragConfigResolver = _objectSpread2(_objectSpread2({}, coordinatesConfigResolver), {}, { device(_v, _k, { pointer: { touch = false, @@ -31443,7 +29789,7 @@ const dragConfigResolver = actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_e }, axisThreshold(value) { if (!value) return DEFAULT_DRAG_AXIS_THRESHOLD; - return actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_esm_objectSpread2({}, DEFAULT_DRAG_AXIS_THRESHOLD), value); + return _objectSpread2(_objectSpread2({}, DEFAULT_DRAG_AXIS_THRESHOLD), value); }, keyboardDisplacement(value = DEFAULT_KEYBOARD_DISPLACEMENT) { return value; @@ -31468,8 +29814,8 @@ const PINCH_WHEEL_RATIO = 100; class PinchEngine extends Engine { constructor(...args) { super(...args); - actions_b1cc53c2_esm_defineProperty(this, "ingKey", 'pinching'); - actions_b1cc53c2_esm_defineProperty(this, "aliasKey", 'da'); + _defineProperty(this, "ingKey", 'pinching'); + _defineProperty(this, "aliasKey", 'da'); } init() { this.state.offset = [1, 0]; @@ -31693,7 +30039,7 @@ class PinchEngine extends Engine { } } -const pinchConfigResolver = actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_esm_objectSpread2({}, commonConfigResolver), {}, { +const pinchConfigResolver = _objectSpread2(_objectSpread2({}, commonConfigResolver), {}, { device(_v, _k, { shared, pointer: { @@ -31746,7 +30092,7 @@ const pinchConfigResolver = actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_ class MoveEngine extends CoordinatesEngine { constructor(...args) { super(...args); - actions_b1cc53c2_esm_defineProperty(this, "ingKey", 'moving'); + _defineProperty(this, "ingKey", 'moving'); } move(event) { if (this.config.mouseOnly && event.pointerType !== 'mouse') return; @@ -31782,14 +30128,14 @@ class MoveEngine extends CoordinatesEngine { } } -const moveConfigResolver = actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_esm_objectSpread2({}, coordinatesConfigResolver), {}, { +const moveConfigResolver = _objectSpread2(_objectSpread2({}, coordinatesConfigResolver), {}, { mouseOnly: (value = true) => value }); class ScrollEngine extends CoordinatesEngine { constructor(...args) { super(...args); - actions_b1cc53c2_esm_defineProperty(this, "ingKey", 'scrolling'); + _defineProperty(this, "ingKey", 'scrolling'); } scroll(event) { if (!this.state._active) this.start(event); @@ -31822,7 +30168,7 @@ const scrollConfigResolver = coordinatesConfigResolver; class WheelEngine extends CoordinatesEngine { constructor(...args) { super(...args); - actions_b1cc53c2_esm_defineProperty(this, "ingKey", 'wheeling'); + _defineProperty(this, "ingKey", 'wheeling'); } wheel(event) { if (!this.state._active) this.start(event); @@ -31853,7 +30199,7 @@ const wheelConfigResolver = coordinatesConfigResolver; class HoverEngine extends CoordinatesEngine { constructor(...args) { super(...args); - actions_b1cc53c2_esm_defineProperty(this, "ingKey", 'hovering'); + _defineProperty(this, "ingKey", 'hovering'); } enter(event) { if (this.config.mouseOnly && event.pointerType !== 'mouse') return; @@ -31880,7 +30226,7 @@ class HoverEngine extends CoordinatesEngine { } } -const hoverConfigResolver = actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_esm_objectSpread2({}, coordinatesConfigResolver), {}, { +const hoverConfigResolver = _objectSpread2(_objectSpread2({}, coordinatesConfigResolver), {}, { mouseOnly: (value = true) => value }); @@ -31927,7 +30273,7 @@ const actions_b1cc53c2_esm_wheelAction = { -function use_gesture_core_esm_objectWithoutPropertiesLoose(source, excluded) { +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); @@ -31942,7 +30288,7 @@ function use_gesture_core_esm_objectWithoutPropertiesLoose(source, excluded) { function _objectWithoutProperties(source, excluded) { if (source == null) return {}; - var target = use_gesture_core_esm_objectWithoutPropertiesLoose(source, excluded); + var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); @@ -32022,14 +30368,14 @@ function use_gesture_core_esm_parse(newConfig, gestureKey, _config = {}) { }, sharedConfigResolver); if (gestureKey) { const resolver = ConfigResolverMap.get(gestureKey); - _config[gestureKey] = resolveWith(actions_b1cc53c2_esm_objectSpread2({ + _config[gestureKey] = resolveWith(_objectSpread2({ shared: _config.shared }, rest), resolver); } else { for (const key in rest) { const resolver = ConfigResolverMap.get(key); if (resolver) { - _config[key] = resolveWith(actions_b1cc53c2_esm_objectSpread2({ + _config[key] = resolveWith(_objectSpread2({ shared: _config.shared }, rest[key]), resolver); } else if (false) {} @@ -32040,7 +30386,7 @@ function use_gesture_core_esm_parse(newConfig, gestureKey, _config = {}) { class EventStore { constructor(ctrl, gestureKey) { - actions_b1cc53c2_esm_defineProperty(this, "_listeners", new Set()); + _defineProperty(this, "_listeners", new Set()); this._ctrl = ctrl; this._gestureKey = gestureKey; } @@ -32048,7 +30394,7 @@ class EventStore { const listeners = this._listeners; const type = toDomEventType(device, action); const _options = this._gestureKey ? this._ctrl.config[this._gestureKey].eventOptions : {}; - const eventOptions = actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_esm_objectSpread2({}, _options), options); + const eventOptions = _objectSpread2(_objectSpread2({}, _options), options); element.addEventListener(type, handler, eventOptions); const remove = () => { element.removeEventListener(type, handler, eventOptions); @@ -32065,7 +30411,7 @@ class EventStore { class TimeoutStore { constructor() { - actions_b1cc53c2_esm_defineProperty(this, "_timeouts", new Map()); + _defineProperty(this, "_timeouts", new Map()); } add(key, callback, ms = 140, ...args) { this.remove(key); @@ -32083,15 +30429,15 @@ class TimeoutStore { class Controller { constructor(handlers) { - actions_b1cc53c2_esm_defineProperty(this, "gestures", new Set()); - actions_b1cc53c2_esm_defineProperty(this, "_targetEventStore", new EventStore(this)); - actions_b1cc53c2_esm_defineProperty(this, "gestureEventStores", {}); - actions_b1cc53c2_esm_defineProperty(this, "gestureTimeoutStores", {}); - actions_b1cc53c2_esm_defineProperty(this, "handlers", {}); - actions_b1cc53c2_esm_defineProperty(this, "config", {}); - actions_b1cc53c2_esm_defineProperty(this, "pointerIds", new Set()); - actions_b1cc53c2_esm_defineProperty(this, "touchIds", new Set()); - actions_b1cc53c2_esm_defineProperty(this, "state", { + _defineProperty(this, "gestures", new Set()); + _defineProperty(this, "_targetEventStore", new EventStore(this)); + _defineProperty(this, "gestureEventStores", {}); + _defineProperty(this, "gestureTimeoutStores", {}); + _defineProperty(this, "handlers", {}); + _defineProperty(this, "config", {}); + _defineProperty(this, "pointerIds", new Set()); + _defineProperty(this, "touchIds", new Set()); + _defineProperty(this, "state", { shared: { shiftKey: false, metaKey: false, @@ -32147,7 +30493,7 @@ class Controller { } const nativeBindFunction = bindToProps(props, sharedConfig.eventOptions, !!target); for (const eventKey in this.nativeHandlers) { - nativeBindFunction(eventKey, '', event => this.nativeHandlers[eventKey](actions_b1cc53c2_esm_objectSpread2(actions_b1cc53c2_esm_objectSpread2({}, this.state.shared), {}, { + nativeBindFunction(eventKey, '', event => this.nativeHandlers[eventKey](_objectSpread2(_objectSpread2({}, this.state.shared), {}, { event, args })), undefined, true); @@ -32302,7 +30648,7 @@ function useMove(handler, config) { } function useHover(handler, config) { - actions_b1cc53c2_esm_registerAction(actions_b1cc53c2_esm_hoverAction); + registerAction(hoverAction); return useRecognizers({ hover: handler }, config || {}, 'hover'); @@ -32873,7 +31219,7 @@ function InputField({ } }; } - return (0,external_wp_element_namespaceObject.createElement)(Input, { + return (0,external_React_.createElement)(Input, { ...props, ...dragProps, className: "components-input-control__input", @@ -32896,10 +31242,10 @@ function InputField({ }); } const ForwardedComponent = (0,external_wp_element_namespaceObject.forwardRef)(InputField); -/* harmony default export */ var input_field = (ForwardedComponent); +/* harmony default export */ const input_field = (ForwardedComponent); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/font-values.js -/* harmony default export */ var font_values = ({ +/* harmony default export */ const font_values = ({ 'default.fontFamily': "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif", 'default.fontSize': '13px', 'helpText.fontSize': '12px', @@ -32992,6 +31338,7 @@ const StyledVisualLabel = emotion_styled_base_browser_esm("span", true ? { + /** * `BaseControl` is a component used to generate labels and help text for components handling user inputs. * @@ -33015,31 +31362,32 @@ const StyledVisualLabel = emotion_styled_base_browser_esm("span", true ? { * ); * ``` */ -const BaseControl = ({ - __nextHasNoMarginBottom = false, - id, - label, - hideLabelFromVision = false, - help, - className, - children -}) => { - return (0,external_wp_element_namespaceObject.createElement)(base_control_styles_Wrapper, { - className: classnames_default()('components-base-control', className) - }, (0,external_wp_element_namespaceObject.createElement)(StyledField, { +const UnconnectedBaseControl = props => { + const { + __nextHasNoMarginBottom = false, + id, + label, + hideLabelFromVision = false, + help, + className, + children + } = useContextSystem(props, 'BaseControl'); + return (0,external_React_.createElement)(base_control_styles_Wrapper, { + className: className + }, (0,external_React_.createElement)(StyledField, { className: "components-base-control__field" // TODO: Official deprecation for this should start after all internal usages have been migrated , __nextHasNoMarginBottom: __nextHasNoMarginBottom - }, label && id && (hideLabelFromVision ? (0,external_wp_element_namespaceObject.createElement)(visually_hidden_component, { + }, label && id && (hideLabelFromVision ? (0,external_React_.createElement)(visually_hidden_component, { as: "label", htmlFor: id - }, label) : (0,external_wp_element_namespaceObject.createElement)(StyledLabel, { + }, label) : (0,external_React_.createElement)(StyledLabel, { className: "components-base-control__label", htmlFor: id - }, label)), label && !id && (hideLabelFromVision ? (0,external_wp_element_namespaceObject.createElement)(visually_hidden_component, { + }, label)), label && !id && (hideLabelFromVision ? (0,external_React_.createElement)(visually_hidden_component, { as: "label" - }, label) : (0,external_wp_element_namespaceObject.createElement)(BaseControl.VisualLabel, null, label)), children), !!help && (0,external_wp_element_namespaceObject.createElement)(StyledHelp, { + }, label) : (0,external_React_.createElement)(VisualLabel, null, label)), children), !!help && (0,external_React_.createElement)(StyledHelp, { id: id ? id + '__help' : undefined, className: "components-base-control__help", __nextHasNoMarginBottom: __nextHasNoMarginBottom @@ -33068,13 +31416,15 @@ const VisualLabel = ({ children, ...props }) => { - return (0,external_wp_element_namespaceObject.createElement)(StyledVisualLabel, { + return (0,external_React_.createElement)(StyledVisualLabel, { ...props, className: classnames_default()('components-base-control__label', className) }, children); }; -BaseControl.VisualLabel = VisualLabel; -/* harmony default export */ var base_control = (BaseControl); +const BaseControl = Object.assign(contextConnectWithoutRef(UnconnectedBaseControl, 'BaseControl'), { + VisualLabel +}); +/* harmony default export */ const base_control = (BaseControl); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/index.js @@ -33096,40 +31446,42 @@ BaseControl.VisualLabel = VisualLabel; + const input_control_noop = () => {}; function input_control_useUniqueId(idProp) { const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(InputControl); const id = `inspector-input-control-${instanceId}`; return idProp || id; } -function UnforwardedInputControl({ - __next36pxDefaultSize, - __unstableStateReducer: stateReducer = state => state, - __unstableInputWidth, - className, - disabled = false, - help, - hideLabelFromVision = false, - id: idProp, - isPressEnterToChange = false, - label, - labelPosition = 'top', - onChange = input_control_noop, - onValidate = input_control_noop, - onKeyDown = input_control_noop, - prefix, - size = 'default', - style, - suffix, - value, - ...props -}, ref) { +function UnforwardedInputControl(props, ref) { + const { + __next40pxDefaultSize, + __unstableStateReducer: stateReducer = state => state, + __unstableInputWidth, + className, + disabled = false, + help, + hideLabelFromVision = false, + id: idProp, + isPressEnterToChange = false, + label, + labelPosition = 'top', + onChange = input_control_noop, + onValidate = input_control_noop, + onKeyDown = input_control_noop, + prefix, + size = 'default', + style, + suffix, + value, + ...restProps + } = useDeprecated36pxDefaultSizeProp(props); const [isFocused, setIsFocused] = (0,external_wp_element_namespaceObject.useState)(false); const id = input_control_useUniqueId(idProp); const classes = classnames_default()('components-input-control', className); const draftHookProps = useDraft({ value, - onBlur: props.onBlur, + onBlur: restProps.onBlur, onChange }); @@ -33138,13 +31490,13 @@ function UnforwardedInputControl({ const helpProp = !!help ? { [helpPropName]: `${id}__help` } : {}; - return (0,external_wp_element_namespaceObject.createElement)(base_control, { + return (0,external_React_.createElement)(base_control, { className: classes, help: help, id: id, __nextHasNoMarginBottom: true - }, (0,external_wp_element_namespaceObject.createElement)(input_base, { - __next36pxDefaultSize: __next36pxDefaultSize, + }, (0,external_React_.createElement)(input_base, { + __next40pxDefaultSize: __next40pxDefaultSize, __unstableInputWidth: __unstableInputWidth, disabled: disabled, gap: 3, @@ -33158,10 +31510,10 @@ function UnforwardedInputControl({ size: size, style: style, suffix: suffix - }, (0,external_wp_element_namespaceObject.createElement)(input_field, { - ...props, + }, (0,external_React_.createElement)(input_field, { + ...restProps, ...helpProp, - __next36pxDefaultSize: __next36pxDefaultSize, + __next40pxDefaultSize: __next40pxDefaultSize, className: "components-input-control__input", disabled: disabled, id: id, @@ -33200,7 +31552,7 @@ function UnforwardedInputControl({ * ``` */ const InputControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedInputControl); -/* harmony default export */ var input_control = (InputControl); +/* harmony default export */ const input_control = (InputControl); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/dashicon/index.js @@ -33238,13 +31590,13 @@ function Dashicon({ ...sizeStyles, ...style }; - return (0,external_wp_element_namespaceObject.createElement)("span", { + return (0,external_React_.createElement)("span", { className: iconClass, style: styles, ...extraProps }); } -/* harmony default export */ var dashicon = (Dashicon); +/* harmony default export */ const dashicon = (Dashicon); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/icon/index.js /** @@ -33304,7 +31656,7 @@ function Icon({ } return icon; } -/* harmony default export */ var build_module_icon = (Icon); +/* harmony default export */ const build_module_icon = (Icon); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/button/index.js @@ -33333,6 +31685,7 @@ function button_useDeprecatedProps({ isSecondary, isTertiary, isLink, + isPressed, isSmall, size, variant, @@ -33340,6 +31693,10 @@ function button_useDeprecatedProps({ }) { let computedSize = size; let computedVariant = variant; + const newProps = { + // @TODO Mark `isPressed` as deprecated + 'aria-pressed': isPressed + }; if (isSmall) { var _computedSize; (_computedSize = computedSize) !== null && _computedSize !== void 0 ? _computedSize : computedSize = 'small'; @@ -33370,6 +31727,7 @@ function button_useDeprecatedProps({ (_computedVariant5 = computedVariant) !== null && _computedVariant5 !== void 0 ? _computedVariant5 : computedVariant = 'link'; } return { + ...newProps, ...otherProps, size: computedSize, variant: computedVariant @@ -33378,7 +31736,6 @@ function button_useDeprecatedProps({ function UnforwardedButton(props, ref) { const { __next40pxDefaultSize, - isPressed, isBusy, isDestructive, className, @@ -33401,6 +31758,9 @@ function UnforwardedButton(props, ref) { const { href, target, + 'aria-checked': ariaChecked, + 'aria-pressed': ariaPressed, + 'aria-selected': ariaSelected, ...additionalProps } = 'href' in buttonOrAnchorProps ? buttonOrAnchorProps : { href: undefined, @@ -33411,6 +31771,7 @@ function UnforwardedButton(props, ref) { const hasChildren = 'string' === typeof children && !!children || Array.isArray(children) && children?.[0] && children[0] !== null && // Tooltip should not considered as a child children?.[0]?.props?.className !== 'components-tooltip'; + const truthyAriaPressedValues = [true, 'true', 'mixed']; const classes = classnames_default()('components-button', className, { 'is-next-40px-default-size': __next40pxDefaultSize, 'is-secondary': variant === 'secondary', @@ -33418,11 +31779,12 @@ function UnforwardedButton(props, ref) { 'is-small': size === 'small', 'is-compact': size === 'compact', 'is-tertiary': variant === 'tertiary', - 'is-pressed': isPressed, + 'is-pressed': truthyAriaPressedValues.includes(ariaPressed), + 'is-pressed-mixed': ariaPressed === 'mixed', 'is-busy': isBusy, 'is-link': variant === 'link', 'is-destructive': isDestructive, - 'has-text': !!icon && hasChildren, + 'has-text': !!icon && (hasChildren || text), 'has-icon': !!icon }); const trulyDisabled = disabled && !isFocusable; @@ -33430,7 +31792,9 @@ function UnforwardedButton(props, ref) { const buttonProps = Tag === 'button' ? { type: 'button', disabled: trulyDisabled, - 'aria-pressed': isPressed + 'aria-checked': ariaChecked, + 'aria-pressed': ariaPressed, + 'aria-selected': ariaSelected } : {}; const anchorProps = Tag === 'a' ? { href, @@ -33454,9 +31818,9 @@ function UnforwardedButton(props, ref) { // Should show the tooltip if... const shouldShowTooltip = !trulyDisabled && ( // An explicit tooltip is passed or... - showTooltip && label || + showTooltip && !!label || // There's a shortcut or... - shortcut || + !!shortcut || // There's a label and... !!label && // The children are empty and... @@ -33471,39 +31835,37 @@ function UnforwardedButton(props, ref) { 'aria-describedby': describedById, ref }; - const elementChildren = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, icon && iconPosition === 'left' && (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { + const elementChildren = (0,external_React_.createElement)(external_React_.Fragment, null, icon && iconPosition === 'left' && (0,external_React_.createElement)(build_module_icon, { icon: icon, size: iconSize - }), text && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, text), icon && iconPosition === 'right' && (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { + }), text && (0,external_React_.createElement)(external_React_.Fragment, null, text), icon && iconPosition === 'right' && (0,external_React_.createElement)(build_module_icon, { icon: icon, size: iconSize }), children); - const element = Tag === 'a' ? (0,external_wp_element_namespaceObject.createElement)("a", { + const element = Tag === 'a' ? (0,external_React_.createElement)("a", { ...anchorProps, ...additionalProps, ...commonProps - }, elementChildren) : (0,external_wp_element_namespaceObject.createElement)("button", { + }, elementChildren) : (0,external_React_.createElement)("button", { ...buttonProps, ...additionalProps, ...commonProps }, elementChildren); - // Convert legacy `position` values to be used with the new `placement` prop - let computedPlacement; - // if `tooltipPosition` is defined, compute value to `placement` - if (tooltipPosition !== undefined) { - computedPlacement = positionToPlacement(tooltipPosition); - } - if (!shouldShowTooltip) { - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, element, describedBy && (0,external_wp_element_namespaceObject.createElement)(visually_hidden_component, null, (0,external_wp_element_namespaceObject.createElement)("span", { - id: descriptionId - }, describedBy))); - } - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(tooltip, { + // In order to avoid some React reconciliation issues, we are always rendering + // the `Tooltip` component even when `shouldShowTooltip` is `false`. + // In order to make sure that the tooltip doesn't show when it shouldn't, + // we don't pass the props to the `Tooltip` component. + const tooltipProps = shouldShowTooltip ? { text: children?.length && describedBy ? describedBy : label, - shortcut: shortcut, - placement: computedPlacement - }, element), describedBy && (0,external_wp_element_namespaceObject.createElement)(visually_hidden_component, null, (0,external_wp_element_namespaceObject.createElement)("span", { + shortcut, + placement: tooltipPosition && + // Convert legacy `position` values to be used with the new `placement` prop + positionToPlacement(tooltipPosition) + } : {}; + return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(tooltip, { + ...tooltipProps + }, element), describedBy && (0,external_React_.createElement)(visually_hidden_component, null, (0,external_React_.createElement)("span", { id: descriptionId }, describedBy))); } @@ -33524,7 +31886,7 @@ function UnforwardedButton(props, ref) { * ``` */ const Button = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedButton); -/* harmony default export */ var build_module_button = (Button); +/* harmony default export */ const build_module_button = (Button); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/number-control/styles/number-control-styles.js @@ -33760,7 +32122,7 @@ function getAlignmentProps(alignment, direction = 'row') { return alignmentProps; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/utils/get-valid-children.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/get-valid-children.js /** * External dependencies */ @@ -33811,7 +32173,7 @@ function useHStack(props) { if (_isSpacer) { const childElement = child; const _key = childElement.key || `hstack-${index}`; - return (0,external_wp_element_namespaceObject.createElement)(flex_item_component, { + return (0,external_React_.createElement)(flex_item_component, { isBlock: true, key: _key, ...childElement.props @@ -33842,7 +32204,7 @@ function useHStack(props) { function UnconnectedHStack(props, forwardedRef) { const hStackProps = useHStack(props); - return (0,external_wp_element_namespaceObject.createElement)(component, { + return (0,external_React_.createElement)(component, { ...hStackProps, ref: forwardedRef }); @@ -33871,7 +32233,7 @@ function UnconnectedHStack(props, forwardedRef) { * ``` */ const HStack = contextConnect(UnconnectedHStack, 'HStack'); -/* harmony default export */ var h_stack_component = (HStack); +/* harmony default export */ const h_stack_component = (HStack); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/number-control/index.js @@ -33898,36 +32260,37 @@ const HStack = contextConnect(UnconnectedHStack, 'HStack'); + const number_control_noop = () => {}; -function UnforwardedNumberControl({ - __unstableStateReducer: stateReducerProp, - className, - dragDirection = 'n', - hideHTMLArrows = false, - spinControls = 'native', - isDragEnabled = true, - isShiftStepEnabled = true, - label, - max = Infinity, - min = -Infinity, - required = false, - shiftStep = 10, - step = 1, - spinFactor = 1, - type: typeProp = 'number', - value: valueProp, - size = 'default', - suffix, - onChange = number_control_noop, - ...props -}, forwardedRef) { +function UnforwardedNumberControl(props, forwardedRef) { + const { + __unstableStateReducer: stateReducerProp, + className, + dragDirection = 'n', + hideHTMLArrows = false, + spinControls = hideHTMLArrows ? 'none' : 'native', + isDragEnabled = true, + isShiftStepEnabled = true, + label, + max = Infinity, + min = -Infinity, + required = false, + shiftStep = 10, + step = 1, + spinFactor = 1, + type: typeProp = 'number', + value: valueProp, + size = 'default', + suffix, + onChange = number_control_noop, + ...restProps + } = useDeprecated36pxDefaultSizeProp(props); if (hideHTMLArrows) { external_wp_deprecated_default()('wp.components.NumberControl hideHTMLArrows prop ', { alternative: 'spinControls="none"', since: '6.2', version: '6.3' }); - spinControls = 'none'; } const inputRef = (0,external_wp_element_namespaceObject.useRef)(); const mergedRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([inputRef, forwardedRef]); @@ -34037,10 +32400,10 @@ function UnforwardedNumberControl({ target: inputRef.current } }); - return (0,external_wp_element_namespaceObject.createElement)(number_control_styles_Input, { + return (0,external_React_.createElement)(number_control_styles_Input, { autoComplete: autoComplete, inputMode: "numeric", - ...props, + ...restProps, className: classes, dragDirection: dragDirection, hideHTMLArrows: spinControls !== 'native', @@ -34061,33 +32424,29 @@ function UnforwardedNumberControl({ return (_stateReducerProp = stateReducerProp?.(baseState, action)) !== null && _stateReducerProp !== void 0 ? _stateReducerProp : baseState; }, size: size, - suffix: spinControls === 'custom' ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, suffix, (0,external_wp_element_namespaceObject.createElement)(spacer_component, { + suffix: spinControls === 'custom' ? (0,external_React_.createElement)(external_React_.Fragment, null, suffix, (0,external_React_.createElement)(spacer_component, { marginBottom: 0, marginRight: 2 - }, (0,external_wp_element_namespaceObject.createElement)(h_stack_component, { + }, (0,external_React_.createElement)(h_stack_component, { spacing: 1 - }, (0,external_wp_element_namespaceObject.createElement)(SpinButton, { + }, (0,external_React_.createElement)(SpinButton, { className: spinButtonClasses, icon: library_plus, - isSmall: true, - "aria-hidden": "true", - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Increment'), - tabIndex: -1, + size: "small", + label: (0,external_wp_i18n_namespaceObject.__)('Increment'), onClick: buildSpinButtonClickHandler('up') - }), (0,external_wp_element_namespaceObject.createElement)(SpinButton, { + }), (0,external_React_.createElement)(SpinButton, { className: spinButtonClasses, icon: library_reset, - isSmall: true, - "aria-hidden": "true", - "aria-label": (0,external_wp_i18n_namespaceObject.__)('Decrement'), - tabIndex: -1, + size: "small", + label: (0,external_wp_i18n_namespaceObject.__)('Decrement'), onClick: buildSpinButtonClickHandler('down') })))) : suffix, onChange: onChange }); } const NumberControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedNumberControl); -/* harmony default export */ var number_control = (NumberControl); +/* harmony default export */ const number_control = (NumberControl); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/angle-picker-control/styles/angle-picker-control-styles.js @@ -34103,17 +32462,8 @@ function angle_picker_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return " - const CIRCLE_SIZE = 32; const INNER_CIRCLE_SIZE = 6; -const deprecatedBottomMargin = ({ - __nextHasNoMarginBottom -}) => { - return !__nextHasNoMarginBottom ? /*#__PURE__*/emotion_react_browser_esm_css("margin-bottom:", space(2), ";" + ( true ? "" : 0), true ? "" : 0) : ''; -}; -const angle_picker_control_styles_Root = /*#__PURE__*/emotion_styled_base_browser_esm(flex_component, true ? { - target: "eln3bjz4" -} : 0)(deprecatedBottomMargin, ";" + ( true ? "" : 0)); const CircleRoot = emotion_styled_base_browser_esm("div", true ? { target: "eln3bjz3" } : 0)("border-radius:50%;border:", config_values.borderWidth, " solid ", COLORS.ui.border, ";box-sizing:border-box;cursor:grab;height:", CIRCLE_SIZE, "px;overflow:hidden;width:", CIRCLE_SIZE, "px;:active{cursor:grabbing;}" + ( true ? "" : 0)); @@ -34200,18 +32550,18 @@ function AngleCircle({ previousCursorValue.current = undefined; } }, [isDragging]); - return (0,external_wp_element_namespaceObject.createElement)(CircleRoot, { + return (0,external_React_.createElement)(CircleRoot, { ref: angleCircleRef, onMouseDown: startDrag, className: "components-angle-picker-control__angle-circle", ...props - }, (0,external_wp_element_namespaceObject.createElement)(CircleIndicatorWrapper, { + }, (0,external_React_.createElement)(CircleIndicatorWrapper, { style: value ? { transform: `rotate(${value}deg)` } : undefined, className: "components-angle-picker-control__angle-circle-indicator-wrapper", tabIndex: -1 - }, (0,external_wp_element_namespaceObject.createElement)(CircleIndicator, { + }, (0,external_React_.createElement)(CircleIndicator, { className: "components-angle-picker-control__angle-circle-indicator" }))); } @@ -34225,7 +32575,7 @@ function getAngle(centerX, centerY, pointX, pointY) { } return angleInDeg; } -/* harmony default export */ var angle_circle = (AngleCircle); +/* harmony default export */ const angle_circle = (AngleCircle); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/angle-picker-control/index.js @@ -34241,7 +32591,6 @@ function getAngle(centerX, centerY, pointX, pointY) { - /** * Internal dependencies */ @@ -34252,20 +32601,12 @@ function getAngle(centerX, centerY, pointX, pointY) { function UnforwardedAnglePickerControl(props, ref) { const { - __nextHasNoMarginBottom = false, className, label = (0,external_wp_i18n_namespaceObject.__)('Angle'), onChange, value, ...restProps } = props; - if (!__nextHasNoMarginBottom) { - external_wp_deprecated_default()('Bottom margin styles for wp.components.AnglePickerControl', { - since: '6.1', - version: '6.4', - hint: 'Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version.' - }); - } const handleOnNumberChange = unprocessedValue => { if (onChange === undefined) { return; @@ -34274,15 +32615,14 @@ function UnforwardedAnglePickerControl(props, ref) { onChange(inputValue); }; const classes = classnames_default()('components-angle-picker-control', className); - const unitText = (0,external_wp_element_namespaceObject.createElement)(UnitText, null, "\xB0"); + const unitText = (0,external_React_.createElement)(UnitText, null, "\xB0"); const [prefixedUnitText, suffixedUnitText] = (0,external_wp_i18n_namespaceObject.isRTL)() ? [unitText, null] : [null, unitText]; - return (0,external_wp_element_namespaceObject.createElement)(angle_picker_control_styles_Root, { + return (0,external_React_.createElement)(flex_component, { ...restProps, ref: ref, - __nextHasNoMarginBottom: __nextHasNoMarginBottom, className: classes, gap: 2 - }, (0,external_wp_element_namespaceObject.createElement)(flex_block_component, null, (0,external_wp_element_namespaceObject.createElement)(number_control, { + }, (0,external_React_.createElement)(flex_block_component, null, (0,external_React_.createElement)(number_control, { label: label, className: "components-angle-picker-control__input-field", max: 360, @@ -34294,10 +32634,10 @@ function UnforwardedAnglePickerControl(props, ref) { spinControls: "none", prefix: prefixedUnitText, suffix: suffixedUnitText - })), (0,external_wp_element_namespaceObject.createElement)(spacer_component, { + })), (0,external_React_.createElement)(spacer_component, { marginBottom: "1", marginTop: "auto" - }, (0,external_wp_element_namespaceObject.createElement)(angle_circle, { + }, (0,external_React_.createElement)(angle_circle, { "aria-hidden": "true", value: value, onChange: onChange @@ -34320,29 +32660,29 @@ function UnforwardedAnglePickerControl(props, ref) { * <AnglePickerControl * value={ angle } * onChange={ setAngle } - * __nextHasNoMarginBottom * </> * ); * } * ``` */ const AnglePickerControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedAnglePickerControl); -/* harmony default export */ var angle_picker_control = (AnglePickerControl); +/* harmony default export */ const angle_picker_control = (AnglePickerControl); // EXTERNAL MODULE: ./node_modules/remove-accents/index.js -var remove_accents = __webpack_require__(4793); +var remove_accents = __webpack_require__(9681); var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents); ;// CONCATENATED MODULE: external ["wp","richText"] -var external_wp_richText_namespaceObject = window["wp"]["richText"]; +const external_wp_richText_namespaceObject = window["wp"]["richText"]; ;// CONCATENATED MODULE: external ["wp","a11y"] -var external_wp_a11y_namespaceObject = window["wp"]["a11y"]; +const external_wp_a11y_namespaceObject = window["wp"]["a11y"]; ;// CONCATENATED MODULE: external ["wp","keycodes"] -var external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; +const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/strings.js /** * External dependencies */ + const ALL_UNICODE_DASH_CHARACTERS = new RegExp(`[${[ // - (hyphen-minus) '\u002d', @@ -34405,11 +32745,40 @@ const normalizeTextString = value => { }; /** + * Converts any string to kebab case. + * Backwards compatible with Lodash's `_.kebabCase()`. + * Backwards compatible with `_wp_to_kebab_case()`. + * + * @see https://lodash.com/docs/4.17.15#kebabCase + * @see https://developer.wordpress.org/reference/functions/_wp_to_kebab_case/ + * + * @param str String to convert. + * @return Kebab-cased string + */ +function kebabCase(str) { + var _str$toString; + let input = (_str$toString = str?.toString?.()) !== null && _str$toString !== void 0 ? _str$toString : ''; + + // See https://github.com/lodash/lodash/blob/b185fcee26b2133bd071f4aaca14b455c2ed1008/lodash.js#L4970 + input = input.replace(/['\u2019]/, ''); + return paramCase(input, { + splitRegexp: [/(?!(?:1ST|2ND|3RD|[4-9]TH)(?![a-z]))([a-z0-9])([A-Z])/g, + // fooBar => foo-bar, 3Bar => 3-bar + /(?!(?:1st|2nd|3rd|[4-9]th)(?![a-z]))([0-9])([a-z])/g, + // 3bar => 3-bar + /([A-Za-z])([0-9])/g, + // Foo3 => foo-3, foo3 => foo-3 + /([A-Z])([A-Z][a-z])/g // FOOBar => foo-bar + ] + }); +} + +/** * Escapes the RegExp special characters. * - * @param {string} string Input string. + * @param string Input string. * - * @return {string} Regex-escaped string. + * @return Regex-escaped string. */ function escapeRegExp(string) { return string.replace(/[\\^$.*+?()[\]{}|]/g, '\\$&'); @@ -34533,14 +32902,15 @@ const floating_ui_react_dom_arrow = options => { } = typeof options === 'function' ? options(state) : options; if (element && isRef(element)) { if (element.current != null) { - return arrow({ + return floating_ui_dom_arrow({ element: element.current, padding }).fn(state); } return {}; - } else if (element) { - return arrow({ + } + if (element) { + return floating_ui_dom_arrow({ element, padding }).fn(state); @@ -34564,11 +32934,13 @@ function deepEqual(a, b) { if (typeof a === 'function' && a.toString() === b.toString()) { return true; } - let length, i, keys; - if (a && b && typeof a == 'object') { + let length; + let i; + let keys; + if (a && b && typeof a === 'object') { if (Array.isArray(a)) { length = a.length; - if (length != b.length) return false; + if (length !== b.length) return false; for (i = length; i-- !== 0;) { if (!deepEqual(a[i], b[i])) { return false; @@ -34597,6 +32969,8 @@ function deepEqual(a, b) { } return true; } + + // biome-ignore lint/suspicious/noSelfCompare: in source return a !== a && b !== b; } @@ -34623,7 +32997,7 @@ function useLatestRef(value) { /** * Provides data to position a floating element. - * @see https://floating-ui.com/docs/react + * @see https://floating-ui.com/docs/useFloating */ function useFloating(options) { if (options === void 0) { @@ -34657,22 +33031,23 @@ function useFloating(options) { const [_reference, _setReference] = external_React_.useState(null); const [_floating, _setFloating] = external_React_.useState(null); const setReference = external_React_.useCallback(node => { - if (node != referenceRef.current) { + if (node !== referenceRef.current) { referenceRef.current = node; _setReference(node); } - }, [_setReference]); + }, []); const setFloating = external_React_.useCallback(node => { if (node !== floatingRef.current) { floatingRef.current = node; _setFloating(node); } - }, [_setFloating]); + }, []); const referenceEl = externalReference || _reference; const floatingEl = externalFloating || _floating; const referenceRef = external_React_.useRef(null); const floatingRef = external_React_.useRef(null); const dataRef = external_React_.useRef(data); + const hasWhileElementsMounted = whileElementsMounted != null; const whileElementsMountedRef = useLatestRef(whileElementsMounted); const platformRef = useLatestRef(platform); const update = external_React_.useCallback(() => { @@ -34716,17 +33091,18 @@ function useFloating(options) { isMountedRef.current = false; }; }, []); + + // biome-ignore lint/correctness/useExhaustiveDependencies: `hasWhileElementsMounted` is intentionally included. index(() => { if (referenceEl) referenceRef.current = referenceEl; if (floatingEl) floatingRef.current = floatingEl; if (referenceEl && floatingEl) { if (whileElementsMountedRef.current) { return whileElementsMountedRef.current(referenceEl, floatingEl, update); - } else { - update(); } + update(); } - }, [referenceEl, floatingEl, update, whileElementsMountedRef]); + }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]); const refs = external_React_.useMemo(() => ({ reference: referenceRef, floating: floatingRef, @@ -34827,13 +33203,13 @@ function useReducedMotion() { * WordPress dependencies */ -const close_close = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const close_close = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z" })); -/* harmony default export */ var library_close = (close_close); +/* harmony default export */ const library_close = (close_close); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/scroll-lock/index.js /** @@ -34913,7 +33289,7 @@ function ScrollLock() { }, []); return null; } -/* harmony default export */ var scroll_lock = (ScrollLock); +/* harmony default export */ const scroll_lock = (ScrollLock); ;// CONCATENATED MODULE: ./node_modules/proxy-compare/dist/index.modern.js const index_modern_e=Symbol(),index_modern_t=Symbol(),index_modern_r=Symbol();let index_modern_n=(e,t)=>new Proxy(e,t);const index_modern_o=Object.getPrototypeOf,index_modern_s=new WeakMap,index_modern_c=e=>e&&(index_modern_s.has(e)?index_modern_s.get(e):index_modern_o(e)===Object.prototype||index_modern_o(e)===Array.prototype),index_modern_l=e=>"object"==typeof e&&null!==e,index_modern_a=new WeakMap,index_modern_f=e=>e[index_modern_r]||e,index_modern_i=(s,l,p)=>{if(!index_modern_c(s))return s;const y=index_modern_f(s),u=(e=>Object.isFrozen(e)||Object.values(Object.getOwnPropertyDescriptors(e)).some(e=>!e.writable))(y);let g=p&&p.get(y);return g&&g[1].f===u||(g=((n,o)=>{const s={f:o};let c=!1;const l=(t,r)=>{if(!c){let o=s.a.get(n);o||(o=new Set,s.a.set(n,o)),r&&o.has(index_modern_e)||o.add(t)}},a={get:(e,t)=>t===index_modern_r?n:(l(t),index_modern_i(e[t],s.a,s.c)),has:(e,r)=>r===index_modern_t?(c=!0,s.a.delete(n),!0):(l(r),r in e),getOwnPropertyDescriptor:(e,t)=>(l(t,!0),Object.getOwnPropertyDescriptor(e,t)),ownKeys:t=>(l(index_modern_e),Reflect.ownKeys(t))};return o&&(a.set=a.deleteProperty=()=>!1),[a,s]})(y,u),g[1].p=index_modern_n(u?(e=>{let t=index_modern_a.get(e);if(!t){if(Array.isArray(e))t=Array.from(e);else{const r=Object.getOwnPropertyDescriptors(e);Object.values(r).forEach(e=>{e.configurable=!0}),t=Object.create(index_modern_o(e),r)}index_modern_a.set(e,t)}return t})(y):y,g[0]),p&&p.set(y,g)),g[1].a=l,g[1].c=p,g[1].p},index_modern_p=(e,t)=>{const r=Reflect.ownKeys(e),n=Reflect.ownKeys(t);return r.length!==n.length||r.some((e,t)=>e!==n[t])},index_modern_y=(t,r,n,o)=>{if(Object.is(t,r))return!1;if(!index_modern_l(t)||!index_modern_l(r))return!0;const s=n.get(index_modern_f(t));if(!s)return!0;if(o){const e=o.get(t);if(e&&e.n===r)return e.g;o.set(t,{n:r,g:!1})}let c=null;for(const l of s){const s=l===index_modern_e?index_modern_p(t,r):index_modern_y(t[l],r[l],n,o);if(!0!==s&&!1!==s||(c=s),c)break}return null===c&&(c=!0),o&&o.set(t,{n:r,g:c}),c},index_modern_u=e=>!!index_modern_c(e)&&index_modern_t in e,index_modern_g=e=>index_modern_c(e)&&e[index_modern_r]||null,index_modern_b=(e,t=!0)=>{index_modern_s.set(e,t)},O=(e,t)=>{const r=[],n=new WeakSet,o=(e,s)=>{if(n.has(e))return;index_modern_l(e)&&n.add(e);const c=index_modern_l(e)&&t.get(index_modern_f(e));c?c.forEach(t=>{o(e[t],s?[...s,t]:[t])}):s&&r.push(s)};return o(e),r},index_modern_w=e=>{index_modern_n=e}; @@ -35142,7 +33518,7 @@ const unstable_buildProxyFunction = (/* unused pure expression or super */ null -const { useSyncExternalStore } = shim; +const { useSyncExternalStore: esm_useSyncExternalStore } = shim; const useAffectedDebugValue = (state, affected) => { const pathList = (0,external_React_.useRef)(); (0,external_React_.useEffect)(() => { @@ -35155,7 +33531,7 @@ function useSnapshot(proxyObject, options) { const lastSnapshot = (0,external_React_.useRef)(); const lastAffected = (0,external_React_.useRef)(); let inRender = true; - const currSnapshot = useSyncExternalStore( + const currSnapshot = esm_useSyncExternalStore( (0,external_React_.useCallback)( (callback) => { const unsub = vanilla_subscribe(proxyObject, callback, notifyInSync); @@ -35776,7 +34152,6 @@ function proxyMap(entries) { ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-context.js -// @ts-nocheck /** * External dependencies */ @@ -35786,7 +34161,11 @@ function proxyMap(entries) { */ -const SlotFillContext = (0,external_wp_element_namespaceObject.createContext)({ +/** + * Internal dependencies + */ + +const initialContextValue = { slots: proxyMap(), fills: proxyMap(), registerSlot: () => { @@ -35798,11 +34177,11 @@ const SlotFillContext = (0,external_wp_element_namespaceObject.createContext)({ unregisterFill: () => {}, // This helps the provider know if it's using the default context value or not. isDefault: true -}); -/* harmony default export */ var slot_fill_context = (SlotFillContext); +}; +const SlotFillContext = (0,external_wp_element_namespaceObject.createContext)(initialContextValue); +/* harmony default export */ const slot_fill_context = (SlotFillContext); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/use-slot.js -// @ts-nocheck /** * External dependencies */ @@ -35839,24 +34218,27 @@ function useSlot(name) { } ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/context.js -// @ts-nocheck /** * WordPress dependencies */ -const context_SlotFillContext = (0,external_wp_element_namespaceObject.createContext)({ +/** + * Internal dependencies + */ + +const initialValue = { registerSlot: () => {}, unregisterSlot: () => {}, registerFill: () => {}, unregisterFill: () => {}, - getSlot: () => {}, - getFills: () => {}, - subscribe: () => {} -}); -/* harmony default export */ var context = (context_SlotFillContext); + getSlot: () => undefined, + getFills: () => [], + subscribe: () => () => {} +}; +const context_SlotFillContext = (0,external_wp_element_namespaceObject.createContext)(initialValue); +/* harmony default export */ const context = (context_SlotFillContext); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/use-slot.js -// @ts-nocheck /** * WordPress dependencies */ @@ -35866,12 +34248,11 @@ const context_SlotFillContext = (0,external_wp_element_namespaceObject.createCon * Internal dependencies */ - /** * React hook returning the active slot given a name. * - * @param {string} name Slot name. - * @return {Object} Slot object. + * @param name Slot name. + * @return Slot object. */ const use_slot_useSlot = name => { const { @@ -35880,11 +34261,9 @@ const use_slot_useSlot = name => { } = (0,external_wp_element_namespaceObject.useContext)(context); return (0,external_wp_element_namespaceObject.useSyncExternalStore)(subscribe, () => getSlot(name), () => getSlot(name)); }; -/* harmony default export */ var use_slot = (use_slot_useSlot); +/* harmony default export */ const use_slot = (use_slot_useSlot); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/fill.js -// @ts-nocheck - /** * WordPress dependencies */ @@ -35942,7 +34321,10 @@ function Fill({ ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/slot.js -// @ts-nocheck +/** + * External dependencies + */ + /** * WordPress dependencies */ @@ -35952,19 +34334,18 @@ function Fill({ * Internal dependencies */ - /** * Whether the argument is a function. * - * @param {*} maybeFunc The argument to check. - * @return {boolean} True if the argument is a function, false otherwise. + * @param maybeFunc The argument to check. + * @return True if the argument is a function, false otherwise. */ function isFunction(maybeFunc) { return typeof maybeFunc === 'function'; } class SlotComponent extends external_wp_element_namespaceObject.Component { - constructor() { - super(...arguments); + constructor(props) { + super(props); this.isUnmounted = false; } componentDidMount() { @@ -35988,7 +34369,7 @@ class SlotComponent extends external_wp_element_namespaceObject.Component { registerSlot } = this.props; if (prevProps.name !== name) { - unregisterSlot(prevProps.name); + unregisterSlot(prevProps.name, this); registerSlot(name, this); } } @@ -36012,7 +34393,10 @@ class SlotComponent extends external_wp_element_namespaceObject.Component { if (!child || typeof child === 'string') { return child; } - const childKey = child.key || childIndex; + let childKey = childIndex; + if (typeof child === 'object' && 'key' in child && child?.key) { + childKey = child.key; + } return (0,external_wp_element_namespaceObject.cloneElement)(child, { key: childKey }); @@ -36022,24 +34406,24 @@ class SlotComponent extends external_wp_element_namespaceObject.Component { // This ensures that we only use non-empty fills when rendering, i.e., // it allows us to render wrappers only when the fills are actually present. element => !(0,external_wp_element_namespaceObject.isEmptyElement)(element)); - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, isFunction(children) ? children(fills) : fills); + return (0,external_React_.createElement)(external_React_.Fragment, null, isFunction(children) ? children(fills) : fills); } } -const Slot = props => (0,external_wp_element_namespaceObject.createElement)(context.Consumer, null, ({ +const Slot = props => (0,external_React_.createElement)(context.Consumer, null, ({ registerSlot, unregisterSlot, getFills -}) => (0,external_wp_element_namespaceObject.createElement)(SlotComponent, { +}) => (0,external_React_.createElement)(SlotComponent, { ...props, registerSlot: registerSlot, unregisterSlot: unregisterSlot, getFills: getFills })); -/* harmony default export */ var slot = (Slot); +/* harmony default export */ const slot = (Slot); ;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/native.js const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto); -/* harmony default export */ var esm_browser_native = ({ +/* harmony default export */ const esm_browser_native = ({ randomUUID }); ;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/rng.js @@ -36094,7 +34478,7 @@ function stringify_stringify(arr, offset = 0) { return uuid; } -/* harmony default export */ var esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify_stringify))); +/* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify_stringify))); ;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v4.js @@ -36124,7 +34508,7 @@ function v4(options, buf, offset) { return unsafeStringify(rnds); } -/* harmony default export */ var esm_browser_v4 = (v4); +/* harmony default export */ const esm_browser_v4 = (v4); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/style-provider/index.js /** @@ -36170,15 +34554,14 @@ function StyleProvider(props) { return null; } const cache = memoizedCreateCacheWithContainer(document.head); - return (0,external_wp_element_namespaceObject.createElement)(CacheProvider, { + return (0,external_React_.createElement)(CacheProvider, { value: cache }, children); } -/* harmony default export */ var style_provider = (StyleProvider); +/* harmony default export */ const style_provider = (StyleProvider); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/fill.js -// @ts-nocheck /** * WordPress dependencies */ @@ -36204,10 +34587,12 @@ function fill_useForceUpdate() { } }; } -function fill_Fill({ - name, - children -}) { +function fill_Fill(props) { + var _slot$fillProps; + const { + name, + children + } = props; const { registerFill, unregisterFill, @@ -36229,23 +34614,23 @@ function fill_Fill({ if (!slot.ref || !slot.ref.current) { return null; } - if (typeof children === 'function') { - children = children(slot.fillProps); - } // When using a `Fill`, the `children` will be rendered in the document of the // `Slot`. This means that we need to wrap the `children` in a `StyleProvider` // to make sure we're referencing the right document/iframe (instead of the // context of the `Fill`'s parent). - const wrappedChildren = (0,external_wp_element_namespaceObject.createElement)(style_provider, { + const wrappedChildren = (0,external_React_.createElement)(style_provider, { document: slot.ref.current.ownerDocument - }, children); + }, typeof children === 'function' ? children((_slot$fillProps = slot.fillProps) !== null && _slot$fillProps !== void 0 ? _slot$fillProps : {}) : children); return (0,external_wp_element_namespaceObject.createPortal)(wrappedChildren, slot.ref.current); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot.js -// @ts-nocheck +/** + * External dependencies + */ + /** * WordPress dependencies */ @@ -36264,6 +34649,7 @@ function slot_Slot(props, forwardedRef) { as, // `children` is not allowed. However, if it is passed, // it will be displayed as is, so remove `children`. + // @ts-ignore children, ...restProps } = props; @@ -36272,7 +34658,7 @@ function slot_Slot(props, forwardedRef) { unregisterSlot, ...registry } = (0,external_wp_element_namespaceObject.useContext)(slot_fill_context); - const ref = (0,external_wp_element_namespaceObject.useRef)(); + const ref = (0,external_wp_element_namespaceObject.useRef)(null); (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { registerSlot(name, ref, fillProps); return () => { @@ -36289,20 +34675,19 @@ function slot_Slot(props, forwardedRef) { (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { registry.updateSlot(name, fillProps); }); - return (0,external_wp_element_namespaceObject.createElement)(component, { + return (0,external_React_.createElement)(component, { as: as, ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, ref]), ...restProps }); } -/* harmony default export */ var bubbles_virtually_slot = ((0,external_wp_element_namespaceObject.forwardRef)(slot_Slot)); +/* harmony default export */ const bubbles_virtually_slot = ((0,external_wp_element_namespaceObject.forwardRef)(slot_Slot)); ;// CONCATENATED MODULE: external ["wp","isShallowEqual"] -var external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"]; +const external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"]; var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js -// @ts-nocheck /** * External dependencies */ @@ -36322,22 +34707,22 @@ var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(exte function createSlotRegistry() { const slots = proxyMap(); const fills = proxyMap(); - function registerSlot(name, ref, fillProps) { - const slot = slots.get(name) || {}; + const registerSlot = (name, ref, fillProps) => { + const slot = slots.get(name); slots.set(name, vanilla_ref({ ...slot, - ref: ref || slot.ref, - fillProps: fillProps || slot.fillProps || {} + ref: ref || slot?.ref, + fillProps: fillProps || slot?.fillProps || {} })); - } - function unregisterSlot(name, ref) { + }; + const unregisterSlot = (name, ref) => { // Make sure we're not unregistering a slot registered by another element // See https://github.com/WordPress/gutenberg/pull/19242#issuecomment-590295412 if (slots.get(name)?.ref === ref) { slots.delete(name); } - } - function updateSlot(name, fillProps) { + }; + const updateSlot = (name, fillProps) => { const slot = slots.get(name); if (!slot) { return; @@ -36349,19 +34734,19 @@ function createSlotRegistry() { const slotFills = fills.get(name); if (slotFills) { // Force update fills. - slotFills.map(fill => fill.current.rerender()); + slotFills.forEach(fill => fill.current.rerender()); } - } - function registerFill(name, ref) { + }; + const registerFill = (name, ref) => { fills.set(name, vanilla_ref([...(fills.get(name) || []), ref])); - } - function unregisterFill(name, ref) { + }; + const unregisterFill = (name, ref) => { const fillsForName = fills.get(name); if (!fillsForName) { return; } fills.set(name, vanilla_ref(fillsForName.filter(fillRef => fillRef !== ref))); - } + }; return { slots, fills, @@ -36375,55 +34760,36 @@ function createSlotRegistry() { function SlotFillProvider({ children }) { - const [registry] = (0,external_wp_element_namespaceObject.useState)(createSlotRegistry); - return (0,external_wp_element_namespaceObject.createElement)(slot_fill_context.Provider, { + const registry = (0,external_wp_element_namespaceObject.useMemo)(createSlotRegistry, []); + return (0,external_React_.createElement)(slot_fill_context.Provider, { value: registry }, children); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/provider.js -// @ts-nocheck /** * WordPress dependencies */ + /** * Internal dependencies */ -class provider_SlotFillProvider extends external_wp_element_namespaceObject.Component { - constructor() { - super(...arguments); - this.registerSlot = this.registerSlot.bind(this); - this.registerFill = this.registerFill.bind(this); - this.unregisterSlot = this.unregisterSlot.bind(this); - this.unregisterFill = this.unregisterFill.bind(this); - this.getSlot = this.getSlot.bind(this); - this.getFills = this.getFills.bind(this); - this.subscribe = this.subscribe.bind(this); - this.slots = {}; - this.fills = {}; - this.listeners = []; - this.contextValue = { - registerSlot: this.registerSlot, - unregisterSlot: this.unregisterSlot, - registerFill: this.registerFill, - unregisterFill: this.unregisterFill, - getSlot: this.getSlot, - getFills: this.getFills, - subscribe: this.subscribe - }; - } - registerSlot(name, slot) { - const previousSlot = this.slots[name]; - this.slots[name] = slot; - this.triggerListeners(); +function provider_createSlotRegistry() { + const slots = {}; + const fills = {}; + let listeners = []; + function registerSlot(name, slot) { + const previousSlot = slots[name]; + slots[name] = slot; + triggerListeners(); // Sometimes the fills are registered after the initial render of slot // But before the registerSlot call, we need to rerender the slot. - this.forceUpdateSlot(name); + forceUpdateSlot(name); // If a new instance of a slot is being mounted while another with the // same name exists, force its update _after_ the new slot has been @@ -36433,61 +34799,77 @@ class provider_SlotFillProvider extends external_wp_element_namespaceObject.Comp previousSlot.forceUpdate(); } } - registerFill(name, instance) { - this.fills[name] = [...(this.fills[name] || []), instance]; - this.forceUpdateSlot(name); + function registerFill(name, instance) { + fills[name] = [...(fills[name] || []), instance]; + forceUpdateSlot(name); } - unregisterSlot(name, instance) { + function unregisterSlot(name, instance) { // If a previous instance of a Slot by this name unmounts, do nothing, // as the slot and its fills should only be removed for the current // known instance. - if (this.slots[name] !== instance) { + if (slots[name] !== instance) { return; } - delete this.slots[name]; - this.triggerListeners(); + delete slots[name]; + triggerListeners(); } - unregisterFill(name, instance) { - var _this$fills$name$filt; - this.fills[name] = (_this$fills$name$filt = this.fills[name]?.filter(fill => fill !== instance)) !== null && _this$fills$name$filt !== void 0 ? _this$fills$name$filt : []; - this.forceUpdateSlot(name); + function unregisterFill(name, instance) { + var _fills$name$filter; + fills[name] = (_fills$name$filter = fills[name]?.filter(fill => fill !== instance)) !== null && _fills$name$filter !== void 0 ? _fills$name$filter : []; + forceUpdateSlot(name); } - getSlot(name) { - return this.slots[name]; + function getSlot(name) { + return slots[name]; } - getFills(name, slotInstance) { + function getFills(name, slotInstance) { // Fills should only be returned for the current instance of the slot // in which they occupy. - if (this.slots[name] !== slotInstance) { + if (slots[name] !== slotInstance) { return []; } - return this.fills[name]; + return fills[name]; } - forceUpdateSlot(name) { - const slot = this.getSlot(name); + function forceUpdateSlot(name) { + const slot = getSlot(name); if (slot) { slot.forceUpdate(); } } - triggerListeners() { - this.listeners.forEach(listener => listener()); + function triggerListeners() { + listeners.forEach(listener => listener()); } - subscribe(listener) { - this.listeners.push(listener); + function subscribe(listener) { + listeners.push(listener); return () => { - this.listeners = this.listeners.filter(l => l !== listener); + listeners = listeners.filter(l => l !== listener); }; } - render() { - return (0,external_wp_element_namespaceObject.createElement)(context.Provider, { - value: this.contextValue - }, this.props.children); - } + return { + registerSlot, + unregisterSlot, + registerFill, + unregisterFill, + getSlot, + getFills, + subscribe + }; +} +function provider_SlotFillProvider({ + children +}) { + const contextValue = (0,external_wp_element_namespaceObject.useMemo)(provider_createSlotRegistry, []); + return (0,external_React_.createElement)(context.Provider, { + value: contextValue + }, children); } +/* harmony default export */ const provider = (provider_SlotFillProvider); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/index.js -// @ts-nocheck +/** + * External dependencies + */ + /** * WordPress dependencies */ @@ -36509,47 +34891,46 @@ function slot_fill_Fill(props) { // We're adding both Fills here so they can register themselves before // their respective slot has been registered. Only the Fill that has a slot // will render. The other one will return null. - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(Fill, { + return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(Fill, { ...props - }), (0,external_wp_element_namespaceObject.createElement)(fill_Fill, { + }), (0,external_React_.createElement)(fill_Fill, { ...props })); } -const slot_fill_Slot = (0,external_wp_element_namespaceObject.forwardRef)(({ - bubblesVirtually, - ...props -}, ref) => { +function UnforwardedSlot(props, ref) { + const { + bubblesVirtually, + ...restProps + } = props; if (bubblesVirtually) { - return (0,external_wp_element_namespaceObject.createElement)(bubbles_virtually_slot, { - ...props, + return (0,external_React_.createElement)(bubbles_virtually_slot, { + ...restProps, ref: ref }); } - return (0,external_wp_element_namespaceObject.createElement)(slot, { - ...props + return (0,external_React_.createElement)(slot, { + ...restProps }); -}); +} +const slot_fill_Slot = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedSlot); function Provider({ children, - passthrough = false, - ...props + passthrough = false }) { const parent = (0,external_wp_element_namespaceObject.useContext)(slot_fill_context); if (!parent.isDefault && passthrough) { - return children; + return (0,external_React_.createElement)(external_React_.Fragment, null, children); } - return (0,external_wp_element_namespaceObject.createElement)(provider_SlotFillProvider, { - ...props - }, (0,external_wp_element_namespaceObject.createElement)(SlotFillProvider, null, children)); + return (0,external_React_.createElement)(provider, null, (0,external_React_.createElement)(SlotFillProvider, null, children)); } function createSlotFill(key) { const baseName = typeof key === 'symbol' ? key.description : key; - const FillComponent = props => (0,external_wp_element_namespaceObject.createElement)(slot_fill_Fill, { + const FillComponent = props => (0,external_React_.createElement)(slot_fill_Fill, { name: key, ...props }); FillComponent.displayName = `${baseName}Fill`; - const SlotComponent = props => (0,external_wp_element_namespaceObject.createElement)(slot_fill_Slot, { + const SlotComponent = props => (0,external_React_.createElement)(slot_fill_Slot, { name: key, ...props }); @@ -36583,7 +34964,7 @@ function overlayMiddlewares() { }) { return rects.reference; } - }, size({ + }, floating_ui_dom_size({ apply({ rects, elements @@ -36637,6 +35018,7 @@ function overlayMiddlewares() { + /** * Name of slot in which popover should fill. * @@ -36648,15 +35030,15 @@ const SLOT_NAME = 'Popover'; // color and bordered in such a way to create an arrow-like effect. // Keeping the SVG's viewbox squared simplify the arrow positioning // calculations. -const ArrowTriangle = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const ArrowTriangle = () => (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: `0 0 100 100`, className: "components-popover__triangle", role: "presentation" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { className: "components-popover__triangle-bg", d: "M 0 0 L 50 50 L 100 0" -}), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}), (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { className: "components-popover__triangle-border", d: "M 0 0 L 50 50 L 100 0", vectorEffect: "non-scaling-stroke" @@ -36672,10 +35054,11 @@ const getPopoverFallbackContainer = () => { } return container; }; -const UnforwardedPopover = (props, forwardedRef) => { +const UnconnectedPopover = (props, forwardedRef) => { const { animate = true, headerTitle, + constrainTabbing, onClose, children, className, @@ -36701,7 +35084,7 @@ const UnforwardedPopover = (props, forwardedRef) => { isAlternate, // Rest ...contentProps - } = props; + } = useContextSystem(props, 'Popover'); let computedFlipProp = flip; let computedResizeProp = resize; if (__unstableForcePosition !== undefined) { @@ -36750,7 +35133,7 @@ const UnforwardedPopover = (props, forwardedRef) => { const isExpanded = expandOnMobile && isMobileViewport; const hasArrow = !isExpanded && !noArrow; const normalizedPlacementFromProps = position ? positionToPlacement(position) : placementProp; - const middleware = [...(placementProp === 'overlay' ? overlayMiddlewares() : []), offset(offsetProp), computedFlipProp && floating_ui_core_flip(), computedResizeProp && size({ + const middleware = [...(placementProp === 'overlay' ? overlayMiddlewares() : []), offset(offsetProp), computedFlipProp && floating_ui_dom_flip(), computedResizeProp && floating_ui_dom_size({ apply(sizeProps) { var _refs$floating$curren; const { @@ -36766,9 +35149,9 @@ const UnforwardedPopover = (props, forwardedRef) => { overflow: 'auto' }); } - }), shift && floating_ui_core_shift({ + }), shift && floating_ui_dom_shift({ crossAxis: true, - limiter: limitShift(), + limiter: floating_ui_dom_limitShift(), padding: 1 // Necessary to avoid flickering at the edge of the viewport. }), floating_ui_react_dom_arrow({ element: arrowRef @@ -36788,6 +35171,7 @@ const UnforwardedPopover = (props, forwardedRef) => { }; } const [dialogRef, dialogProps] = (0,external_wp_compose_namespaceObject.__experimentalUseDialog)({ + constrainTabbing, focusOnMount, __unstableOnClose: onDialogClose, // @ts-expect-error The __unstableOnClose property needs to be deprecated first (see https://github.com/WordPress/gutenberg/pull/27675) @@ -36871,7 +35255,32 @@ const UnforwardedPopover = (props, forwardedRef) => { // When Floating UI has finished positioning and Framer Motion has finished animating // the popover, add the `is-positioned` class to signal that all transitions have finished. const isPositioned = (!shouldAnimate || animationFinished) && x !== null && y !== null; - let content = (0,external_wp_element_namespaceObject.createElement)(motion.div, { + + // In case a `ColorPicker` component is rendered as a child of `Popover`, + // the `Popover` component can be notified of when the user is dragging + // parts of the `ColorPicker` UI (this is possible because the `ColorPicker` + // component exposes the `onPickerDragStart` and `onPickerDragEnd` props + // via internal context). + // While the user is performing a pointer drag, the `Popover` will render + // a transparent backdrop element that will serve as a "pointer events trap", + // making sure that no pointer events reach any potential `iframe` element + // underneath (like, for example, the editor canvas in the WordPress editor). + const [showBackdrop, setShowBackdrop] = (0,external_wp_element_namespaceObject.useState)(false); + const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ + ColorPicker: { + onPickerDragStart() { + setShowBackdrop(true); + }, + onPickerDragEnd() { + setShowBackdrop(false); + } + } + }), []); + let content = (0,external_React_.createElement)(external_React_.Fragment, null, showBackdrop && (0,external_React_.createElement)("div", { + className: "components-popover-pointer-events-trap", + "aria-hidden": "true", + onClick: () => setShowBackdrop(false) + }), (0,external_React_.createElement)(motion.div, { className: classnames_default()('components-popover', className, { 'is-expanded': isExpanded, 'is-positioned': isPositioned, @@ -36883,39 +35292,41 @@ const UnforwardedPopover = (props, forwardedRef) => { ref: mergedFloatingRef, ...dialogProps, tabIndex: -1 - }, isExpanded && (0,external_wp_element_namespaceObject.createElement)(scroll_lock, null), isExpanded && (0,external_wp_element_namespaceObject.createElement)("div", { + }, isExpanded && (0,external_React_.createElement)(scroll_lock, null), isExpanded && (0,external_React_.createElement)("div", { className: "components-popover__header" - }, (0,external_wp_element_namespaceObject.createElement)("span", { + }, (0,external_React_.createElement)("span", { className: "components-popover__header-title" - }, headerTitle), (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }, headerTitle), (0,external_React_.createElement)(build_module_button, { className: "components-popover__close", icon: library_close, onClick: onClose - })), (0,external_wp_element_namespaceObject.createElement)("div", { + })), (0,external_React_.createElement)("div", { className: "components-popover__content" - }, children), hasArrow && (0,external_wp_element_namespaceObject.createElement)("div", { + }, (0,external_React_.createElement)(ContextSystemProvider, { + value: contextValue + }, children)), hasArrow && (0,external_React_.createElement)("div", { ref: arrowCallbackRef, className: ['components-popover__arrow', `is-${computedPlacement.split('-')[0]}`].join(' '), style: { left: typeof arrowData?.x !== 'undefined' && Number.isFinite(arrowData.x) ? `${arrowData.x}px` : '', top: typeof arrowData?.y !== 'undefined' && Number.isFinite(arrowData.y) ? `${arrowData.y}px` : '' } - }, (0,external_wp_element_namespaceObject.createElement)(ArrowTriangle, null))); + }, (0,external_React_.createElement)(ArrowTriangle, null)))); const shouldRenderWithinSlot = slot.ref && !inline; const hasAnchor = anchorRef || anchorRect || anchor; if (shouldRenderWithinSlot) { - content = (0,external_wp_element_namespaceObject.createElement)(slot_fill_Fill, { + content = (0,external_React_.createElement)(slot_fill_Fill, { name: slotName }, content); } else if (!inline) { - content = (0,external_wp_element_namespaceObject.createPortal)((0,external_wp_element_namespaceObject.createElement)(StyleProvider, { + content = (0,external_wp_element_namespaceObject.createPortal)((0,external_React_.createElement)(StyleProvider, { document: document }, content), getPopoverFallbackContainer()); } if (hasAnchor) { return content; } - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("span", { + return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)("span", { ref: anchorRefFallback }), content); }; @@ -36943,13 +35354,11 @@ const UnforwardedPopover = (props, forwardedRef) => { * ``` * */ -const popover_Popover = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedPopover); +const popover_Popover = contextConnect(UnconnectedPopover, 'Popover'); function PopoverSlot({ name = SLOT_NAME }, ref) { - return (0,external_wp_element_namespaceObject.createElement)(slot_fill_Slot - // @ts-expect-error Need to type `SlotFill` - , { + return (0,external_React_.createElement)(slot_fill_Slot, { bubblesVirtually: true, name: name, className: "popover-slot", @@ -36961,7 +35370,7 @@ function PopoverSlot({ popover_Popover.Slot = (0,external_wp_element_namespaceObject.forwardRef)(PopoverSlot); // @ts-expect-error For Legacy Reasons popover_Popover.__unstableSlotNameProvider = slotNameContext.Provider; -/* harmony default export */ var popover = (popover_Popover); +/* harmony default export */ const popover = (popover_Popover); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/autocomplete/autocompleter-ui.js @@ -37046,11 +35455,11 @@ function getAutoCompleterUI(autocompleter) { } const ListBox = ({ Component = 'div' - }) => (0,external_wp_element_namespaceObject.createElement)(Component, { + }) => (0,external_React_.createElement)(Component, { id: listBoxId, role: "listbox", className: "components-autocomplete__results" - }, items.map((option, index) => (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }, items.map((option, index) => (0,external_React_.createElement)(build_module_button, { key: option.key, id: `components-autocomplete-item-${instanceId}-${option.key}`, role: "option", @@ -37061,14 +35470,14 @@ function getAutoCompleterUI(autocompleter) { }), onClick: () => onSelect(option) }, option.label))); - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(popover, { + return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(popover, { focusOnMount: false, onClose: onReset, placement: "top-start", className: "components-autocomplete__popover", anchor: popoverAnchor, ref: popoverRefs - }, (0,external_wp_element_namespaceObject.createElement)(ListBox, null)), contentRef.current && needsA11yCompat && (0,external_ReactDOM_namespaceObject.createPortal)((0,external_wp_element_namespaceObject.createElement)(ListBox, { + }, (0,external_React_.createElement)(ListBox, null)), contentRef.current && needsA11yCompat && (0,external_ReactDOM_namespaceObject.createPortal)((0,external_React_.createElement)(ListBox, { Component: visually_hidden_component }), contentRef.current.ownerDocument.body)); } @@ -37288,58 +35697,68 @@ function useAutocomplete({ if (autocompleter) reset(); return; } - const completer = completers?.find(({ - triggerPrefix, - allowContext - }) => { - const index = textContent.lastIndexOf(triggerPrefix); - if (index === -1) { - return false; - } - const textWithoutTrigger = textContent.slice(index + triggerPrefix.length); - const tooDistantFromTrigger = textWithoutTrigger.length > 50; // 50 chars seems to be a good limit. - // This is a final barrier to prevent the effect from completing with - // an extremely long string, which causes the editor to slow-down - // significantly. This could happen, for example, if `matchingWhileBackspacing` - // is true and one of the "words" end up being too long. If that's the case, - // it will be caught by this guard. - if (tooDistantFromTrigger) return false; - const mismatch = filteredOptions.length === 0; - const wordsFromTrigger = textWithoutTrigger.split(/\s/); - // We need to allow the effect to run when not backspacing and if there - // was a mismatch. i.e when typing a trigger + the match string or when - // clicking in an existing trigger word on the page. We do that if we - // detect that we have one word from trigger in the current textual context. - // - // Ex.: "Some text @a" <-- "@a" will be detected as the trigger word and - // allow the effect to run. It will run until there's a mismatch. - const hasOneTriggerWord = wordsFromTrigger.length === 1; - // This is used to allow the effect to run when backspacing and if - // "touching" a word that "belongs" to a trigger. We consider a "trigger - // word" any word up to the limit of 3 from the trigger character. - // Anything beyond that is ignored if there's a mismatch. This allows - // us to "escape" a mismatch when backspacing, but still imposing some - // sane limits. - // - // Ex: "Some text @marcelo sekkkk" <--- "kkkk" caused a mismatch, but - // if the user presses backspace here, it will show the completion popup again. - const matchingWhileBackspacing = backspacing.current && textWithoutTrigger.split(/\s/).length <= 3; - if (mismatch && !(matchingWhileBackspacing || hasOneTriggerWord)) { - return false; - } - const textAfterSelection = (0,external_wp_richText_namespaceObject.getTextContent)((0,external_wp_richText_namespaceObject.slice)(record, undefined, (0,external_wp_richText_namespaceObject.getTextContent)(record).length)); - if (allowContext && !allowContext(textContent.slice(0, index), textAfterSelection)) { - return false; - } - if (/^\s/.test(textWithoutTrigger) || /\s\s+$/.test(textWithoutTrigger)) { - return false; - } - return /[\u0000-\uFFFF]*$/.test(textWithoutTrigger); - }); + + // Find the completer with the highest triggerPrefix index in the + // textContent. + const completer = completers.reduce((lastTrigger, currentCompleter) => { + const triggerIndex = textContent.lastIndexOf(currentCompleter.triggerPrefix); + const lastTriggerIndex = lastTrigger !== null ? textContent.lastIndexOf(lastTrigger.triggerPrefix) : -1; + return triggerIndex > lastTriggerIndex ? currentCompleter : lastTrigger; + }, null); if (!completer) { if (autocompleter) reset(); return; } + const { + allowContext, + triggerPrefix + } = completer; + const triggerIndex = textContent.lastIndexOf(triggerPrefix); + const textWithoutTrigger = textContent.slice(triggerIndex + triggerPrefix.length); + const tooDistantFromTrigger = textWithoutTrigger.length > 50; // 50 chars seems to be a good limit. + // This is a final barrier to prevent the effect from completing with + // an extremely long string, which causes the editor to slow-down + // significantly. This could happen, for example, if `matchingWhileBackspacing` + // is true and one of the "words" end up being too long. If that's the case, + // it will be caught by this guard. + if (tooDistantFromTrigger) return; + const mismatch = filteredOptions.length === 0; + const wordsFromTrigger = textWithoutTrigger.split(/\s/); + // We need to allow the effect to run when not backspacing and if there + // was a mismatch. i.e when typing a trigger + the match string or when + // clicking in an existing trigger word on the page. We do that if we + // detect that we have one word from trigger in the current textual context. + // + // Ex.: "Some text @a" <-- "@a" will be detected as the trigger word and + // allow the effect to run. It will run until there's a mismatch. + const hasOneTriggerWord = wordsFromTrigger.length === 1; + // This is used to allow the effect to run when backspacing and if + // "touching" a word that "belongs" to a trigger. We consider a "trigger + // word" any word up to the limit of 3 from the trigger character. + // Anything beyond that is ignored if there's a mismatch. This allows + // us to "escape" a mismatch when backspacing, but still imposing some + // sane limits. + // + // Ex: "Some text @marcelo sekkkk" <--- "kkkk" caused a mismatch, but + // if the user presses backspace here, it will show the completion popup again. + const matchingWhileBackspacing = backspacing.current && wordsFromTrigger.length <= 3; + if (mismatch && !(matchingWhileBackspacing || hasOneTriggerWord)) { + if (autocompleter) reset(); + return; + } + const textAfterSelection = (0,external_wp_richText_namespaceObject.getTextContent)((0,external_wp_richText_namespaceObject.slice)(record, undefined, (0,external_wp_richText_namespaceObject.getTextContent)(record).length)); + if (allowContext && !allowContext(textContent.slice(0, triggerIndex), textAfterSelection)) { + if (autocompleter) reset(); + return; + } + if (/^\s/.test(textWithoutTrigger) || /\s\s+$/.test(textWithoutTrigger)) { + if (autocompleter) reset(); + return; + } + if (!/[\u0000-\uFFFF]*$/.test(textWithoutTrigger)) { + if (autocompleter) reset(); + return; + } const safeTrigger = escapeRegExp(completer.triggerPrefix); const text = remove_accents_default()(textContent); const match = text.slice(text.lastIndexOf(completer.triggerPrefix)).match(new RegExp(`${safeTrigger}([\u0000-\uFFFF]*)$`)); @@ -37365,7 +35784,7 @@ function useAutocomplete({ listBoxId, activeId, onKeyDown: handleKeyDown, - popover: hasSelection && AutocompleterUI && (0,external_wp_element_namespaceObject.createElement)(AutocompleterUI, { + popover: hasSelection && AutocompleterUI && (0,external_React_.createElement)(AutocompleterUI, { className: className, filterValue: filterValue, instanceId: instanceId, @@ -37440,7 +35859,7 @@ function Autocomplete({ popover, ...props } = useAutocomplete(options); - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, children(props), isSelected && popover); + return (0,external_React_.createElement)(external_React_.Fragment, null, children(props), isSelected && popover); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/base-control/hooks.js @@ -37491,13 +35910,13 @@ function useBaseControlProps(props) { * WordPress dependencies */ -const link_link = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const link_link = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z" })); -/* harmony default export */ var library_link = (link_link); +/* harmony default export */ const library_link = (link_link); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link-off.js @@ -37505,13 +35924,13 @@ const link_link = (0,external_wp_element_namespaceObject.createElement)(external * WordPress dependencies */ -const linkOff = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const linkOff = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z" })); -/* harmony default export */ var link_off = (linkOff); +/* harmony default export */ const link_off = (linkOff); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/border-box-control/styles.js function border_box_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } @@ -37617,13 +36036,13 @@ const BorderBoxControlLinkedButton = (props, forwardedRef) => { ...buttonProps } = useBorderBoxControlLinkedButton(props); const label = isLinked ? (0,external_wp_i18n_namespaceObject.__)('Unlink sides') : (0,external_wp_i18n_namespaceObject.__)('Link sides'); - return (0,external_wp_element_namespaceObject.createElement)(tooltip, { + return (0,external_React_.createElement)(tooltip, { text: label - }, (0,external_wp_element_namespaceObject.createElement)(component, { + }, (0,external_React_.createElement)(component, { className: className - }, (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }, (0,external_React_.createElement)(build_module_button, { ...buttonProps, - isSmall: true, + size: "small", icon: isLinked ? library_link : link_off, iconSize: 24, "aria-label": label, @@ -37631,7 +36050,7 @@ const BorderBoxControlLinkedButton = (props, forwardedRef) => { }))); }; const ConnectedBorderBoxControlLinkedButton = contextConnect(BorderBoxControlLinkedButton, 'BorderBoxControlLinkedButton'); -/* harmony default export */ var border_box_control_linked_button_component = (ConnectedBorderBoxControlLinkedButton); +/* harmony default export */ const border_box_control_linked_button_component = (ConnectedBorderBoxControlLinkedButton); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control-visualizer/hook.js /** @@ -37682,13 +36101,13 @@ const BorderBoxControlVisualizer = (props, forwardedRef) => { value, ...otherProps } = useBorderBoxControlVisualizer(props); - return (0,external_wp_element_namespaceObject.createElement)(component, { + return (0,external_React_.createElement)(component, { ...otherProps, ref: forwardedRef }); }; const ConnectedBorderBoxControlVisualizer = contextConnect(BorderBoxControlVisualizer, 'BorderBoxControlVisualizer'); -/* harmony default export */ var border_box_control_visualizer_component = (ConnectedBorderBoxControlVisualizer); +/* harmony default export */ const border_box_control_visualizer_component = (ConnectedBorderBoxControlVisualizer); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js @@ -37696,13 +36115,13 @@ const ConnectedBorderBoxControlVisualizer = contextConnect(BorderBoxControlVisua * WordPress dependencies */ -const closeSmall = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const closeSmall = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z" })); -/* harmony default export */ var close_small = (closeSmall); +/* harmony default export */ const close_small = (closeSmall); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/line-solid.js @@ -37710,13 +36129,13 @@ const closeSmall = (0,external_wp_element_namespaceObject.createElement)(externa * WordPress dependencies */ -const lineSolid = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const lineSolid = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M5 11.25h14v1.5H5z" })); -/* harmony default export */ var line_solid = (lineSolid); +/* harmony default export */ const line_solid = (lineSolid); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/line-dashed.js @@ -37724,15 +36143,15 @@ const lineSolid = (0,external_wp_element_namespaceObject.createElement)(external * WordPress dependencies */ -const lineDashed = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const lineDashed = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", d: "M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z", clipRule: "evenodd" })); -/* harmony default export */ var line_dashed = (lineDashed); +/* harmony default export */ const line_dashed = (lineDashed); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/line-dotted.js @@ -37740,18 +36159,90 @@ const lineDashed = (0,external_wp_element_namespaceObject.createElement)(externa * WordPress dependencies */ -const lineDotted = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const lineDotted = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", d: "M5.25 11.25h1.5v1.5h-1.5v-1.5zm3 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5zm1.5 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5z", clipRule: "evenodd" })); -/* harmony default export */ var line_dotted = (lineDotted); +/* harmony default export */ const line_dotted = (lineDotted); -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/unit-control/styles/unit-control-styles.js +;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs + + +/** + * Note: Still used by components generated by old versions of Framer + * + * @deprecated + */ +const DeprecatedLayoutGroupContext = (0,external_React_.createContext)(null); + + + +;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/node/group.mjs +const notify = (node) => !node.isLayoutDirty && node.willUpdate(false); +function nodeGroup() { + const nodes = new Set(); + const subscriptions = new WeakMap(); + const dirtyAll = () => nodes.forEach(notify); + return { + add: (node) => { + nodes.add(node); + subscriptions.set(node, node.addEventListener("willUpdate", dirtyAll)); + }, + remove: (node) => { + nodes.delete(node); + const unsubscribe = subscriptions.get(node); + if (unsubscribe) { + unsubscribe(); + subscriptions.delete(node); + } + dirtyAll(); + }, + dirty: dirtyAll, + }; +} + + + +;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs + + + + + + + +const shouldInheritGroup = (inherit) => inherit === true; +const shouldInheritId = (inherit) => shouldInheritGroup(inherit === true) || inherit === "id"; +const LayoutGroup = ({ children, id, inherit = true }) => { + const layoutGroupContext = (0,external_React_.useContext)(LayoutGroupContext); + const deprecatedLayoutGroupContext = (0,external_React_.useContext)(DeprecatedLayoutGroupContext); + const [forceRender, key] = use_force_update_useForceUpdate(); + const context = (0,external_React_.useRef)(null); + const upstreamId = layoutGroupContext.id || deprecatedLayoutGroupContext; + if (context.current === null) { + if (shouldInheritId(inherit) && upstreamId) { + id = id ? upstreamId + "-" + id : upstreamId; + } + context.current = { + id, + group: shouldInheritGroup(inherit) + ? layoutGroupContext.group || nodeGroup() + : nodeGroup(), + }; + } + const memoizedContext = (0,external_React_.useMemo)(() => ({ ...context.current, forceRender }), [key]); + return (external_React_.createElement(LayoutGroupContext.Provider, { value: memoizedContext }, children)); +}; + + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/styles.js + +function toggle_group_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /** * External dependencies */ @@ -37760,53 +36251,233 @@ const lineDotted = (0,external_wp_element_namespaceObject.createElement)(externa * Internal dependencies */ +const toggleGroupControl = ({ + isBlock, + isDeselectable, + size +}) => /*#__PURE__*/emotion_react_browser_esm_css("background:", COLORS.ui.background, ";border:1px solid transparent;border-radius:", config_values.controlBorderRadius, ";display:inline-flex;min-width:0;position:relative;", toggleGroupControlSize(size), " ", !isDeselectable && enclosingBorders(isBlock), ";" + ( true ? "" : 0), true ? "" : 0); +const enclosingBorders = isBlock => { + const enclosingBorder = /*#__PURE__*/emotion_react_browser_esm_css("border-color:", COLORS.ui.border, ";" + ( true ? "" : 0), true ? "" : 0); + return /*#__PURE__*/emotion_react_browser_esm_css(isBlock && enclosingBorder, " &:hover{border-color:", COLORS.ui.borderHover, ";}&:focus-within{border-color:", COLORS.ui.borderFocus, ";box-shadow:", config_values.controlBoxShadowFocus, ";z-index:1;outline:2px solid transparent;outline-offset:-2px;}" + ( true ? "" : 0), true ? "" : 0); +}; +var styles_ref = true ? { + name: "1aqh2c7", + styles: "min-height:40px;padding:3px" +} : 0; +var styles_ref2 = true ? { + name: "1ndywgm", + styles: "min-height:36px;padding:2px" +} : 0; +const toggleGroupControlSize = size => { + const styles = { + default: styles_ref2, + '__unstable-large': styles_ref + }; + return styles[size]; +}; +const toggle_group_control_styles_block = true ? { + name: "7whenc", + styles: "display:flex;width:100%" +} : 0; +const VisualLabelWrapper = emotion_styled_base_browser_esm("div", true ? { + target: "eakva830" +} : 0)( true ? { + name: "zjik7", + styles: "display:flex" +} : 0); +;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/radio/radio-store.js +"use client"; -// Using `selectSize` instead of `size` to avoid a type conflict with the -// `size` HTML attribute of the `select` element. -// TODO: Resolve need to use &&& to increase specificity -// https://github.com/WordPress/gutenberg/issues/18483 -const ValueInput = /*#__PURE__*/emotion_styled_base_browser_esm(number_control, true ? { - target: "e1bagdl32" -} : 0)("&&&{input{display:block;width:100%;}", BackdropUI, "{transition:box-shadow 0.1s linear;}}" + ( true ? "" : 0)); -const baseUnitLabelStyles = ({ - selectSize -}) => { - const sizes = { - default: /*#__PURE__*/emotion_react_browser_esm_css("box-sizing:border-box;padding:2px 1px;width:20px;color:", COLORS.gray[800], ";font-size:8px;line-height:1;letter-spacing:-0.5px;text-transform:uppercase;text-align-last:center;" + ( true ? "" : 0), true ? "" : 0), - large: /*#__PURE__*/emotion_react_browser_esm_css("box-sizing:border-box;min-width:24px;max-width:48px;height:24px;margin-inline-end:", space(2), ";padding:", space(1), ";color:", COLORS.theme.accent, ";font-size:13px;line-height:1;text-align-last:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" + ( true ? "" : 0), true ? "" : 0) - }; - return selectSize === '__unstable-large' ? sizes.large : sizes.default; -}; -const UnitLabel = emotion_styled_base_browser_esm("div", true ? { - target: "e1bagdl31" -} : 0)("&&&{pointer-events:none;", baseUnitLabelStyles, ";color:", COLORS.gray[900], ";}" + ( true ? "" : 0)); -const unitSelectSizes = ({ - selectSize = 'default' -}) => { - const sizes = { - default: /*#__PURE__*/emotion_react_browser_esm_css("height:100%;border:1px solid transparent;transition:box-shadow 0.1s linear,border 0.1s linear;", rtl({ - borderTopLeftRadius: 0, - borderBottomLeftRadius: 0 - })(), " &:not(:disabled):hover{background-color:", COLORS.gray[100], ";}&:focus{border:1px solid ", COLORS.ui.borderFocus, ";box-shadow:inset 0 0 0 ", config_values.borderWidth + ' ' + COLORS.ui.borderFocus, ";outline-offset:0;outline:2px solid transparent;z-index:1;}" + ( true ? "" : 0), true ? "" : 0), - large: /*#__PURE__*/emotion_react_browser_esm_css("display:flex;justify-content:center;align-items:center;&:hover{color:", COLORS.ui.borderFocus, ";box-shadow:inset 0 0 0 ", config_values.borderWidth + ' ' + COLORS.ui.borderFocus, ";outline:", config_values.borderWidth, " solid transparent;}&:focus{box-shadow:0 0 0 ", config_values.borderWidthFocus + ' ' + COLORS.ui.borderFocus, ";outline:", config_values.borderWidthFocus, " solid transparent;}" + ( true ? "" : 0), true ? "" : 0) + + + +// src/radio/radio-store.ts +function createRadioStore(_a = {}) { + var props = _4R3V3JGP_objRest(_a, []); + var _a2; + const syncState = (_a2 = props.store) == null ? void 0 : _a2.getState(); + const composite = createCompositeStore(_chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, props), { + focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true) + })); + const initialState = _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, composite.getState()), { + value: defaultValue( + props.value, + syncState == null ? void 0 : syncState.value, + props.defaultValue, + null + ) + }); + const radio = createStore(initialState, composite, props.store); + return _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, composite), radio), { + setValue: (value) => radio.setState("value", value) + }); +} + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/LEIRFLRL.js +"use client"; + + + +// src/radio/radio-store.ts + +function useRadioStoreProps(store, update, props) { + store = useCompositeStoreProps(store, update, props); + useStoreProps(store, props, "value", "setValue"); + return store; +} +function useRadioStore(props = {}) { + const [store, update] = EKQEJRUF_useStore(createRadioStore, props); + return useRadioStoreProps(store, update, props); +} + + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/XEV62JUQ.js +"use client"; + + + +// src/radio/radio-context.tsx +var XEV62JUQ_ctx = createStoreContext( + [CompositeContextProvider], + [CompositeScopedContextProvider] +); +var useRadioContext = XEV62JUQ_ctx.useContext; +var useRadioScopedContext = XEV62JUQ_ctx.useScopedContext; +var useRadioProviderContext = XEV62JUQ_ctx.useProviderContext; +var RadioContextProvider = XEV62JUQ_ctx.ContextProvider; +var RadioScopedContextProvider = XEV62JUQ_ctx.ScopedContextProvider; + + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/radio/radio-group.js +"use client"; + + + + + + + + + + + + +// src/radio/radio-group.tsx + + +var useRadioGroup = createHook( + (_a) => { + var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); + const context = useRadioProviderContext(); + store = store || context; + invariant( + store, + false && 0 + ); + props = useWrapElement( + props, + (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(RadioScopedContextProvider, { value: store, children: element }), + [store] + ); + props = _4R3V3JGP_spreadValues({ + role: "radiogroup" + }, props); + props = useComposite(_4R3V3JGP_spreadValues({ store }, props)); + return props; + } +); +var RadioGroup = createComponent((props) => { + const htmlProps = useRadioGroup(props); + return _3ORBWXWF_createElement("div", htmlProps); +}); +if (false) {} + + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/context.js +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + +const ToggleGroupControlContext = (0,external_wp_element_namespaceObject.createContext)({}); +const useToggleGroupControlContext = () => (0,external_wp_element_namespaceObject.useContext)(ToggleGroupControlContext); +/* harmony default export */ const toggle_group_control_context = (ToggleGroupControlContext); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/utils.js +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + +/** + * Used to determine, via an internal heuristics, whether an `undefined` value + * received for the `value` prop should be interpreted as the component being + * used in uncontrolled mode, or as an "empty" value for controlled mode. + * + * @param valueProp The received `value` + */ +function useComputeControlledOrUncontrolledValue(valueProp) { + const isInitialRender = (0,external_wp_element_namespaceObject.useRef)(true); + const prevValueProp = (0,external_wp_compose_namespaceObject.usePrevious)(valueProp); + const prevIsControlled = (0,external_wp_element_namespaceObject.useRef)(false); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (isInitialRender.current) { + isInitialRender.current = false; + } + }, []); + + // Assume the component is being used in controlled mode on the first re-render + // that has a different `valueProp` from the previous render. + const isControlled = prevIsControlled.current || !isInitialRender.current && prevValueProp !== valueProp; + (0,external_wp_element_namespaceObject.useEffect)(() => { + prevIsControlled.current = isControlled; + }, [isControlled]); + if (isControlled) { + // When in controlled mode, use `''` instead of `undefined` + return { + value: valueProp !== null && valueProp !== void 0 ? valueProp : '', + defaultValue: undefined + }; + } + + // When in uncontrolled mode, the `value` should be intended as the initial value + return { + value: undefined, + defaultValue: valueProp }; - return selectSize === '__unstable-large' ? sizes.large : sizes.default; -}; -const UnitSelect = emotion_styled_base_browser_esm("select", true ? { - target: "e1bagdl30" -} : 0)("&&&{appearance:none;background:transparent;border-radius:2px;border:none;display:block;outline:none;margin:0;min-height:auto;font-family:inherit;", baseUnitLabelStyles, ";", unitSelectSizes, ";&:not( :disabled ){cursor:pointer;}}" + ( true ? "" : 0)); +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/as-radio-group.js -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/border-control/styles.js -function border_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /** * External dependencies */ +// eslint-disable-next-line no-restricted-imports + + +/** + * WordPress dependencies + */ + + /** * Internal dependencies @@ -37814,95 +36485,445 @@ function border_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You ha +function UnforwardedToggleGroupControlAsRadioGroup({ + children, + isAdaptiveWidth, + label, + onChange: onChangeProp, + size, + value: valueProp, + id: idProp, + ...otherProps +}, forwardedRef) { + const generatedId = (0,external_wp_compose_namespaceObject.useInstanceId)(ToggleGroupControlAsRadioGroup, 'toggle-group-control-as-radio-group'); + const baseId = idProp || generatedId; -const styles_labelStyles = true ? { - name: "f3vz0n", - styles: "font-weight:500" -} : 0; -const focusBoxShadow = /*#__PURE__*/emotion_react_browser_esm_css("box-shadow:inset ", config_values.controlBoxShadowFocus, ";" + ( true ? "" : 0), true ? "" : 0); -const borderControl = /*#__PURE__*/emotion_react_browser_esm_css("border:0;padding:0;margin:0;", boxSizingReset, ";" + ( true ? "" : 0), true ? "" : 0); -const innerWrapper = () => /*#__PURE__*/emotion_react_browser_esm_css(ValueInput, "{flex:1 1 40%;}&& ", UnitSelect, "{min-height:0;}" + ( true ? "" : 0), true ? "" : 0); + // Use a heuristic to understand if the component is being used in controlled + // or uncontrolled mode, and consequently: + // - when controlled, convert `undefined` values to `''` (ie. "no value") + // - use the `value` prop as the `defaultValue` when uncontrolled + const { + value, + defaultValue + } = useComputeControlledOrUncontrolledValue(valueProp); -/* - * This style is only applied to the UnitControl wrapper when the border width - * field should be a set width. Omitting this allows the UnitControl & - * RangeControl to share the available width in a 40/60 split respectively. + // `useRadioStore`'s `setValue` prop can be called with `null`, while + // the component's `onChange` prop only expects `undefined` + const wrappedOnChangeProp = onChangeProp ? v => { + onChangeProp(v !== null && v !== void 0 ? v : undefined); + } : undefined; + const radio = useRadioStore({ + defaultValue, + value, + setValue: wrappedOnChangeProp + }); + const selectedValue = radio.useState('value'); + const setValue = radio.setValue; + const groupContextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ + baseId, + isBlock: !isAdaptiveWidth, + size, + value: selectedValue, + setValue + }), [baseId, isAdaptiveWidth, size, selectedValue, setValue]); + return (0,external_React_.createElement)(toggle_group_control_context.Provider, { + value: groupContextValue + }, (0,external_React_.createElement)(RadioGroup, { + store: radio, + "aria-label": label, + render: (0,external_React_.createElement)(component, null), + ...otherProps, + id: baseId, + ref: forwardedRef + }, children)); +} +const ToggleGroupControlAsRadioGroup = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToggleGroupControlAsRadioGroup); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/hooks/use-controlled-value.js +/** + * WordPress dependencies */ -const styles_wrapperWidth = /*#__PURE__*/emotion_react_browser_esm_css(ValueInput, "{flex:0 0 auto;}" + ( true ? "" : 0), true ? "" : 0); -const wrapperHeight = size => { - return /*#__PURE__*/emotion_react_browser_esm_css("height:", size === '__unstable-large' ? '40px' : '30px', ";" + ( true ? "" : 0), true ? "" : 0); -}; -const borderControlDropdown = size => /*#__PURE__*/emotion_react_browser_esm_css("background:#fff;&&>button{height:", size === '__unstable-large' ? '40px' : '30px', ";width:", size === '__unstable-large' ? '40px' : '30px', ";padding:0;display:flex;align-items:center;justify-content:center;", rtl({ - borderRadius: `2px 0 0 2px` -}, { - borderRadius: `0 2px 2px 0` -})(), " border:", config_values.borderWidth, " solid ", COLORS.ui.border, ";&:focus,&:hover:not( :disabled ){", focusBoxShadow, " border-color:", COLORS.ui.borderFocus, ";z-index:1;position:relative;}}" + ( true ? "" : 0), true ? "" : 0); -const colorIndicatorBorder = border => { - const { - color, - style - } = border || {}; - const fallbackColor = !!style && style !== 'none' ? COLORS.gray[300] : undefined; - return /*#__PURE__*/emotion_react_browser_esm_css("border-style:", style === 'none' ? 'solid' : style, ";border-color:", color || fallbackColor, ";" + ( true ? "" : 0), true ? "" : 0); -}; -const colorIndicatorWrapper = (border, size) => { + +/** + * Simplified and improved implementation of useControlledState. + * + * @param props + * @param props.defaultValue + * @param props.value + * @param props.onChange + * @return The controlled value and the value setter. + */ +function useControlledValue({ + defaultValue, + onChange, + value: valueProp +}) { + const hasValue = typeof valueProp !== 'undefined'; + const initialValue = hasValue ? valueProp : defaultValue; + const [state, setState] = (0,external_wp_element_namespaceObject.useState)(initialValue); + const value = hasValue ? valueProp : state; + let setValue; + if (hasValue && typeof onChange === 'function') { + setValue = onChange; + } else if (!hasValue && typeof onChange === 'function') { + setValue = nextValue => { + onChange(nextValue); + setState(nextValue); + }; + } else { + setValue = setState; + } + return [value, setValue]; +} + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/as-button-group.js + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + +function UnforwardedToggleGroupControlAsButtonGroup({ + children, + isAdaptiveWidth, + label, + onChange, + size, + value: valueProp, + id: idProp, + ...otherProps +}, forwardedRef) { + const generatedId = (0,external_wp_compose_namespaceObject.useInstanceId)(ToggleGroupControlAsButtonGroup, 'toggle-group-control-as-button-group'); + const baseId = idProp || generatedId; + + // Use a heuristic to understand if the component is being used in controlled + // or uncontrolled mode, and consequently: + // - when controlled, convert `undefined` values to `''` (ie. "no value") + // - use the `value` prop as the `defaultValue` when uncontrolled const { - style - } = border || {}; - return /*#__PURE__*/emotion_react_browser_esm_css("border-radius:9999px;border:2px solid transparent;", style ? colorIndicatorBorder(border) : undefined, " width:", size === '__unstable-large' ? '24px' : '22px', ";height:", size === '__unstable-large' ? '24px' : '22px', ";padding:", size === '__unstable-large' ? '2px' : '1px', ";&>span{height:", space(4), ";width:", space(4), ";background:linear-gradient(\n\t\t\t\t-45deg,\n\t\t\t\ttransparent 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 52%,\n\t\t\t\ttransparent 52%\n\t\t\t);}" + ( true ? "" : 0), true ? "" : 0); -}; + value, + defaultValue + } = useComputeControlledOrUncontrolledValue(valueProp); + const [selectedValue, setSelectedValue] = useControlledValue({ + defaultValue, + value, + onChange + }); + const groupContextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ + baseId, + value: selectedValue, + setValue: setSelectedValue, + isBlock: !isAdaptiveWidth, + isDeselectable: true, + size + }), [baseId, selectedValue, setSelectedValue, isAdaptiveWidth, size]); + return (0,external_React_.createElement)(toggle_group_control_context.Provider, { + value: groupContextValue + }, (0,external_React_.createElement)(component, { + "aria-label": label, + ...otherProps, + ref: forwardedRef, + role: "group" + }, children)); +} +const ToggleGroupControlAsButtonGroup = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToggleGroupControlAsButtonGroup); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/component.js + +/** + * External dependencies + */ + +// eslint-disable-next-line no-restricted-imports -// Must equal $color-palette-circle-size from: -// @wordpress/components/src/circular-option-picker/style.scss -const swatchSize = 28; -const swatchGap = 12; -const borderControlPopoverControls = /*#__PURE__*/emotion_react_browser_esm_css("width:", swatchSize * 6 + swatchGap * 5, "px;>div:first-of-type>", StyledLabel, "{margin-bottom:0;", styles_labelStyles, ";}&& ", StyledLabel, "+button:not( .has-text ){min-width:24px;padding:0;}" + ( true ? "" : 0), true ? "" : 0); -const borderControlPopoverContent = /*#__PURE__*/emotion_react_browser_esm_css( true ? "" : 0, true ? "" : 0); -const borderColorIndicator = /*#__PURE__*/emotion_react_browser_esm_css( true ? "" : 0, true ? "" : 0); -const resetButton = /*#__PURE__*/emotion_react_browser_esm_css("justify-content:center;width:100%;&&{border-top:", config_values.borderWidth, " solid ", COLORS.gray[400], ";border-top-left-radius:0;border-top-right-radius:0;height:40px;}" + ( true ? "" : 0), true ? "" : 0); -const borderControlStylePicker = /*#__PURE__*/emotion_react_browser_esm_css(StyledLabel, "{", styles_labelStyles, ";}" + ( true ? "" : 0), true ? "" : 0); -const borderStyleButton = true ? { - name: "ed6beh", - styles: "&&&&&{min-width:32px;width:32px;height:32px;padding:4px;}" -} : 0; -const borderSlider = () => /*#__PURE__*/emotion_react_browser_esm_css("flex:1 1 60%;", rtl({ - marginRight: space(3) -})(), ";" + ( true ? "" : 0), true ? "" : 0); -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/border-control/border-control-style-picker/hook.js /** * WordPress dependencies */ + /** * Internal dependencies */ -function useBorderControlStylePicker(props) { + + + + + +function UnconnectedToggleGroupControl(props, forwardedRef) { const { + __nextHasNoMarginBottom = false, + __next40pxDefaultSize = false, className, + isAdaptiveWidth = false, + isBlock = false, + isDeselectable = false, + label, + hideLabelFromVision = false, + help, + onChange, + size = 'default', + value, + children, ...otherProps - } = useContextSystem(props, 'BorderControlStylePicker'); - - // Generate class names. + } = useContextSystem(props, 'ToggleGroupControl'); + const baseId = (0,external_wp_compose_namespaceObject.useInstanceId)(ToggleGroupControl, 'toggle-group-control'); + const normalizedSize = __next40pxDefaultSize && size === 'default' ? '__unstable-large' : size; const cx = useCx(); - const classes = (0,external_wp_element_namespaceObject.useMemo)(() => { - return cx(borderControlStylePicker, className); - }, [className, cx]); - const buttonClassName = (0,external_wp_element_namespaceObject.useMemo)(() => { - return cx(borderStyleButton); - }, [cx]); - return { + const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(toggleGroupControl({ + isBlock, + isDeselectable, + size: normalizedSize + }), isBlock && toggle_group_control_styles_block, className), [className, cx, isBlock, isDeselectable, normalizedSize]); + const MainControl = isDeselectable ? ToggleGroupControlAsButtonGroup : ToggleGroupControlAsRadioGroup; + return (0,external_React_.createElement)(base_control, { + help: help, + __nextHasNoMarginBottom: __nextHasNoMarginBottom + }, !hideLabelFromVision && (0,external_React_.createElement)(VisualLabelWrapper, null, (0,external_React_.createElement)(base_control.VisualLabel, null, label)), (0,external_React_.createElement)(MainControl, { ...otherProps, className: classes, - buttonClassName - }; + isAdaptiveWidth: isAdaptiveWidth, + label: label, + onChange: onChange, + ref: forwardedRef, + size: normalizedSize, + value: value + }, (0,external_React_.createElement)(LayoutGroup, { + id: baseId + }, children))); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/border-control/border-control-style-picker/component.js +/** + * `ToggleGroupControl` is a form component that lets users choose options + * represented in horizontal segments. To render options for this control use + * `ToggleGroupControlOption` component. + * + * This component is intended for selecting a single persistent value from a set of options, + * similar to a how a radio button group would work. If you simply want a toggle to switch between views, + * use a `TabPanel` instead. + * + * Only use this control when you know for sure the labels of items inside won't + * wrap. For items with longer labels, you can consider a `SelectControl` or a + * `CustomSelectControl` component instead. + * + * ```jsx + * import { + * __experimentalToggleGroupControl as ToggleGroupControl, + * __experimentalToggleGroupControlOption as ToggleGroupControlOption, + * } from '@wordpress/components'; + * + * function Example() { + * return ( + * <ToggleGroupControl label="my label" value="vertical" isBlock> + * <ToggleGroupControlOption value="horizontal" label="Horizontal" /> + * <ToggleGroupControlOption value="vertical" label="Vertical" /> + * </ToggleGroupControl> + * ); + * } + * ``` + */ +const ToggleGroupControl = contextConnect(UnconnectedToggleGroupControl, 'ToggleGroupControl'); +/* harmony default export */ const toggle_group_control_component = (ToggleGroupControl); + +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/JL6IRDFK.js +"use client"; + + + + + + + +// src/radio/radio.ts + + +function getIsChecked(value, storeValue) { + if (storeValue === void 0) + return; + if (value != null && storeValue != null) { + return storeValue === value; + } + return !!storeValue; +} +function isNativeRadio(tagName, type) { + return tagName === "input" && (!type || type === "radio"); +} +var useRadio = createHook( + (_a) => { + var _b = _a, { store, name, value, checked } = _b, props = __objRest(_b, ["store", "name", "value", "checked"]); + const context = useRadioContext(); + store = store || context; + const id = useId(props.id); + const ref = (0,external_React_.useRef)(null); + const isChecked = useStoreState( + store, + (state) => checked != null ? checked : getIsChecked(value, state == null ? void 0 : state.value) + ); + (0,external_React_.useEffect)(() => { + if (!id) + return; + if (!isChecked) + return; + const isActiveItem = (store == null ? void 0 : store.getState().activeId) === id; + if (isActiveItem) + return; + store == null ? void 0 : store.setActiveId(id); + }, [store, isChecked, id]); + const onChangeProp = props.onChange; + const tagName = useTagName(ref, props.as || "input"); + const nativeRadio = isNativeRadio(tagName, props.type); + const disabled = disabledFromProps(props); + const [propertyUpdated, schedulePropertyUpdate] = useForceUpdate(); + (0,external_React_.useEffect)(() => { + const element = ref.current; + if (!element) + return; + if (nativeRadio) + return; + if (isChecked !== void 0) { + element.checked = isChecked; + } + if (name !== void 0) { + element.name = name; + } + if (value !== void 0) { + element.value = `${value}`; + } + }, [propertyUpdated, nativeRadio, isChecked, name, value]); + const onChange = useEvent((event) => { + if (disabled) { + event.preventDefault(); + event.stopPropagation(); + return; + } + if (!nativeRadio) { + event.currentTarget.checked = true; + schedulePropertyUpdate(); + } + onChangeProp == null ? void 0 : onChangeProp(event); + if (event.defaultPrevented) + return; + store == null ? void 0 : store.setValue(value); + }); + const onClickProp = props.onClick; + const onClick = useEvent((event) => { + onClickProp == null ? void 0 : onClickProp(event); + if (event.defaultPrevented) + return; + if (nativeRadio) + return; + onChange(event); + }); + const onFocusProp = props.onFocus; + const onFocus = useEvent((event) => { + onFocusProp == null ? void 0 : onFocusProp(event); + if (event.defaultPrevented) + return; + if (!nativeRadio) + return; + if (!store) + return; + const { moves, activeId } = store.getState(); + if (!moves) + return; + if (id && activeId !== id) + return; + onChange(event); + }); + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ + id, + role: !nativeRadio ? "radio" : void 0, + type: nativeRadio ? "radio" : void 0, + "aria-checked": isChecked + }, props), { + ref: useMergeRefs(ref, props.ref), + onChange, + onClick, + onFocus + }); + props = useCompositeItem(_4R3V3JGP_spreadValues({ store, clickOnEnter: !nativeRadio }, props)); + return _4R3V3JGP_spreadValues({ + name: nativeRadio ? name : void 0, + value: nativeRadio ? value : void 0, + checked: isChecked + }, props); + } +); +var Radio = createMemoComponent((props) => { + const htmlProps = useRadio(props); + return _3ORBWXWF_createElement("input", htmlProps); +}); +if (false) {} + + + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option-base/styles.js + +function toggle_group_control_option_base_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } +/** + * External dependencies + */ + +/** + * Internal dependencies + */ + +const LabelView = emotion_styled_base_browser_esm("div", true ? { + target: "et6ln9s1" +} : 0)( true ? { + name: "sln1fl", + styles: "display:inline-flex;max-width:100%;min-width:0;position:relative" +} : 0); +const labelBlock = true ? { + name: "82a6rk", + styles: "flex:1" +} : 0; +const buttonView = ({ + isDeselectable, + isIcon, + isPressed, + size +}) => /*#__PURE__*/emotion_react_browser_esm_css("align-items:center;appearance:none;background:transparent;border:none;border-radius:", config_values.controlBorderRadius, ";color:", COLORS.gray[700], ";fill:currentColor;cursor:pointer;display:flex;font-family:inherit;height:100%;justify-content:center;line-height:100%;outline:none;padding:0 12px;position:relative;text-align:center;transition:background ", config_values.transitionDurationFast, " linear,color ", config_values.transitionDurationFast, " linear,font-weight 60ms linear;", reduceMotion('transition'), " user-select:none;width:100%;z-index:2;&::-moz-focus-inner{border:0;}&:active{background:", config_values.toggleGroupControlBackgroundColor, ";}", isDeselectable && deselectable, " ", isIcon && isIconStyles({ + size +}), " ", isPressed && pressed, ";" + ( true ? "" : 0), true ? "" : 0); +const pressed = /*#__PURE__*/emotion_react_browser_esm_css("color:", COLORS.white, ";&:active{background:transparent;}" + ( true ? "" : 0), true ? "" : 0); +const deselectable = /*#__PURE__*/emotion_react_browser_esm_css("color:", COLORS.gray[900], ";&:focus{box-shadow:inset 0 0 0 1px ", COLORS.white, ",0 0 0 ", config_values.borderWidthFocus, " ", COLORS.theme.accent, ";outline:2px solid transparent;}" + ( true ? "" : 0), true ? "" : 0); +const ButtonContentView = emotion_styled_base_browser_esm("div", true ? { + target: "et6ln9s0" +} : 0)("display:flex;font-size:", config_values.fontSize, ";line-height:1;" + ( true ? "" : 0)); +const isIconStyles = ({ + size = 'default' +}) => { + const iconButtonSizes = { + default: '30px', + '__unstable-large': '32px' + }; + return /*#__PURE__*/emotion_react_browser_esm_css("color:", COLORS.gray[900], ";height:", iconButtonSizes[size], ";aspect-ratio:1;padding-left:0;padding-right:0;" + ( true ? "" : 0), true ? "" : 0); +}; +const backdropView = /*#__PURE__*/emotion_react_browser_esm_css("background:", COLORS.gray[900], ";border-radius:", config_values.controlBorderRadius, ";position:absolute;inset:0;z-index:1;outline:2px solid transparent;outline-offset:-3px;" + ( true ? "" : 0), true ? "" : 0); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option-base/component.js + +/** + * External dependencies + */ + +// eslint-disable-next-line no-restricted-imports + +// eslint-disable-next-line no-restricted-imports + /** * WordPress dependencies @@ -37919,6 +36940,205 @@ function useBorderControlStylePicker(props) { +const { + ButtonContentView: component_ButtonContentView, + LabelView: component_LabelView +} = toggle_group_control_option_base_styles_namespaceObject; +const REDUCED_MOTION_TRANSITION_CONFIG = { + duration: 0 +}; +const LAYOUT_ID = 'toggle-group-backdrop-shared-layout-id'; +const WithToolTip = ({ + showTooltip, + text, + children +}) => { + if (showTooltip && text) { + return (0,external_React_.createElement)(tooltip, { + text: text, + placement: "top" + }, children); + } + return (0,external_React_.createElement)(external_React_.Fragment, null, children); +}; +function ToggleGroupControlOptionBase(props, forwardedRef) { + const shouldReduceMotion = useReducedMotion(); + const toggleGroupControlContext = useToggleGroupControlContext(); + const id = (0,external_wp_compose_namespaceObject.useInstanceId)(ToggleGroupControlOptionBase, toggleGroupControlContext.baseId || 'toggle-group-control-option-base'); + const buttonProps = useContextSystem({ + ...props, + id + }, 'ToggleGroupControlOptionBase'); + const { + isBlock = false, + isDeselectable = false, + size = 'default' + } = toggleGroupControlContext; + const { + className, + isIcon = false, + value, + children, + showTooltip = false, + onFocus: onFocusProp, + ...otherButtonProps + } = buttonProps; + const isPressed = toggleGroupControlContext.value === value; + const cx = useCx(); + const labelViewClasses = (0,external_wp_element_namespaceObject.useMemo)(() => cx(isBlock && labelBlock), [cx, isBlock]); + const itemClasses = (0,external_wp_element_namespaceObject.useMemo)(() => cx(buttonView({ + isDeselectable, + isIcon, + isPressed, + size + }), className), [cx, isDeselectable, isIcon, isPressed, size, className]); + const backdropClasses = (0,external_wp_element_namespaceObject.useMemo)(() => cx(backdropView), [cx]); + const buttonOnClick = () => { + if (isDeselectable && isPressed) { + toggleGroupControlContext.setValue(undefined); + } else { + toggleGroupControlContext.setValue(value); + } + }; + const commonProps = { + ...otherButtonProps, + className: itemClasses, + 'data-value': value, + ref: forwardedRef + }; + return (0,external_React_.createElement)(component_LabelView, { + className: labelViewClasses + }, (0,external_React_.createElement)(WithToolTip, { + showTooltip: showTooltip, + text: otherButtonProps['aria-label'] + }, isDeselectable ? (0,external_React_.createElement)("button", { + ...commonProps, + onFocus: onFocusProp, + "aria-pressed": isPressed, + type: "button", + onClick: buttonOnClick + }, (0,external_React_.createElement)(component_ButtonContentView, null, children)) : (0,external_React_.createElement)(Radio, { + render: (0,external_React_.createElement)("button", { + type: "button", + ...commonProps, + onFocus: event => { + onFocusProp?.(event); + if (event.defaultPrevented) return; + toggleGroupControlContext.setValue(value); + } + }), + value: value + }, (0,external_React_.createElement)(component_ButtonContentView, null, children))), isPressed ? (0,external_React_.createElement)(motion.div, { + className: backdropClasses, + transition: shouldReduceMotion ? REDUCED_MOTION_TRANSITION_CONFIG : undefined, + role: "presentation", + layoutId: LAYOUT_ID + }) : null); +} + +/** + * `ToggleGroupControlOptionBase` is a form component and is meant to be used as an internal, + * generic component for any children of `ToggleGroupControl`. + * + * @example + * ```jsx + * import { + * __experimentalToggleGroupControl as ToggleGroupControl, + * __experimentalToggleGroupControlOptionBase as ToggleGroupControlOptionBase, + * } from '@wordpress/components'; + * + * function Example() { + * return ( + * <ToggleGroupControl label="my label" value="vertical" isBlock> + * <ToggleGroupControlOption value="horizontal" label="Horizontal" /> + * <ToggleGroupControlOption value="vertical" label="Vertical" /> + * </ToggleGroupControl> + * ); + * } + * ``` + */ +const ConnectedToggleGroupControlOptionBase = contextConnect(ToggleGroupControlOptionBase, 'ToggleGroupControlOptionBase'); +/* harmony default export */ const toggle_group_control_option_base_component = (ConnectedToggleGroupControlOptionBase); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option-icon/component.js + +/** + * External dependencies + */ + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + + +function UnforwardedToggleGroupControlOptionIcon(props, ref) { + const { + icon, + label, + ...restProps + } = props; + return (0,external_React_.createElement)(toggle_group_control_option_base_component, { + ...restProps, + isIcon: true, + "aria-label": label, + showTooltip: true, + ref: ref + }, (0,external_React_.createElement)(build_module_icon, { + icon: icon + })); +} + +/** + * `ToggleGroupControlOptionIcon` is a form component which is meant to be used as a + * child of `ToggleGroupControl` and displays an icon. + * + * ```jsx + * + * import { + * __experimentalToggleGroupControl as ToggleGroupControl, + * __experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon, + * from '@wordpress/components'; + * import { formatLowercase, formatUppercase } from '@wordpress/icons'; + * + * function Example() { + * return ( + * <ToggleGroupControl> + * <ToggleGroupControlOptionIcon + * value="uppercase" + * label="Uppercase" + * icon={ formatUppercase } + * /> + * <ToggleGroupControlOptionIcon + * value="lowercase" + * label="Lowercase" + * icon={ formatLowercase } + * /> + * </ToggleGroupControl> + * ); + * } + * ``` + */ +const ToggleGroupControlOptionIcon = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToggleGroupControlOptionIcon); +/* harmony default export */ const toggle_group_control_option_icon_component = (ToggleGroupControlOptionIcon); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/border-control/border-control-style-picker/component.js + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + const BORDER_STYLES = [{ label: (0,external_wp_i18n_namespaceObject.__)('Solid'), @@ -37933,50 +37153,28 @@ const BORDER_STYLES = [{ icon: line_dotted, value: 'dotted' }]; -const component_Label = props => { - const { - label, - hideLabelFromVision - } = props; - if (!label) { - return null; - } - return hideLabelFromVision ? (0,external_wp_element_namespaceObject.createElement)(visually_hidden_component, { - as: "label" - }, label) : (0,external_wp_element_namespaceObject.createElement)(StyledLabel, null, label); -}; -const BorderControlStylePicker = (props, forwardedRef) => { - const { - buttonClassName, - hideLabelFromVision, - label, - onChange, - value, - ...otherProps - } = useBorderControlStylePicker(props); - return (0,external_wp_element_namespaceObject.createElement)(component, { - ...otherProps, - ref: forwardedRef - }, (0,external_wp_element_namespaceObject.createElement)(component_Label, { - label: label, - hideLabelFromVision: hideLabelFromVision - }), (0,external_wp_element_namespaceObject.createElement)(flex_component, { - justify: "flex-start", - gap: 1 - }, BORDER_STYLES.map(borderStyle => (0,external_wp_element_namespaceObject.createElement)(build_module_button, { +function UnconnectedBorderControlStylePicker({ + onChange, + ...restProps +}, forwardedRef) { + return (0,external_React_.createElement)(toggle_group_control_component, { + __nextHasNoMarginBottom: true, + __next40pxDefaultSize: true, + ref: forwardedRef, + isDeselectable: true, + onChange: value => { + onChange?.(value); + }, + ...restProps + }, BORDER_STYLES.map(borderStyle => (0,external_React_.createElement)(toggle_group_control_option_icon_component, { key: borderStyle.value, - className: buttonClassName, + value: borderStyle.value, icon: borderStyle.icon, - isSmall: true, - isPressed: borderStyle.value === value, - onClick: () => onChange(borderStyle.value === value ? undefined : borderStyle.value), - "aria-label": borderStyle.label, - label: borderStyle.label, - showTooltip: true - })))); -}; -const ConnectedBorderControlStylePicker = contextConnect(BorderControlStylePicker, 'BorderControlStylePicker'); -/* harmony default export */ var border_control_style_picker_component = (ConnectedBorderControlStylePicker); + label: borderStyle.label + }))); +} +const BorderControlStylePicker = contextConnect(UnconnectedBorderControlStylePicker, 'BorderControlStylePicker'); +/* harmony default export */ const border_control_style_picker_component = (BorderControlStylePicker); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-indicator/index.js @@ -37999,7 +37197,7 @@ function UnforwardedColorIndicator(props, forwardedRef) { colorValue, ...additionalProps } = props; - return (0,external_wp_element_namespaceObject.createElement)("span", { + return (0,external_React_.createElement)("span", { className: classnames_default()('component-color-indicator', className), style: { background: colorValue @@ -38021,48 +37219,11 @@ function UnforwardedColorIndicator(props, forwardedRef) { * ``` */ const ColorIndicator = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedColorIndicator); -/* harmony default export */ var color_indicator = (ColorIndicator); +/* harmony default export */ const color_indicator = (ColorIndicator); ;// CONCATENATED MODULE: ./node_modules/colord/plugins/a11y.mjs var a11y_o=function(o){var t=o/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},a11y_t=function(t){return.2126*a11y_o(t.r)+.7152*a11y_o(t.g)+.0722*a11y_o(t.b)};/* harmony default export */ function a11y(o){o.prototype.luminance=function(){return o=a11y_t(this.rgba),void 0===(r=2)&&(r=0),void 0===n&&(n=Math.pow(10,r)),Math.round(n*o)/n+0;var o,r,n},o.prototype.contrast=function(r){void 0===r&&(r="#FFF");var n,a,i,e,v,u,d,c=r instanceof o?r:new o(r);return e=this.rgba,v=c.toRgb(),u=a11y_t(e),d=a11y_t(v),n=u>d?(u+.05)/(d+.05):(d+.05)/(u+.05),void 0===(a=2)&&(a=0),void 0===i&&(i=Math.pow(10,a)),Math.floor(i*n)/i+0},o.prototype.isReadable=function(o,t){return void 0===o&&(o="#FFF"),void 0===t&&(t={}),this.contrast(o)>=(e=void 0===(i=(r=t).size)?"normal":i,"AAA"===(a=void 0===(n=r.level)?"AA":n)&&"normal"===e?7:"AA"===a&&"large"===e?3:4.5);var r,n,a,i,e}} -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/hooks/use-controlled-value.js -/** - * WordPress dependencies - */ - -/** - * Simplified and improved implementation of useControlledState. - * - * @param props - * @param props.defaultValue - * @param props.value - * @param props.onChange - * @return The controlled value and the value setter. - */ -function useControlledValue({ - defaultValue, - onChange, - value: valueProp -}) { - const hasValue = typeof valueProp !== 'undefined'; - const initialValue = hasValue ? valueProp : defaultValue; - const [state, setState] = (0,external_wp_element_namespaceObject.useState)(initialValue); - const value = hasValue ? valueProp : state; - let setValue; - if (hasValue && typeof onChange === 'function') { - setValue = onChange; - } else if (!hasValue && typeof onChange === 'function') { - setValue = nextValue => { - onChange(nextValue); - setState(nextValue); - }; - } else { - setValue = setState; - } - return [value, setValue]; -} - ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/dropdown/index.js /** @@ -38151,7 +37312,7 @@ const UnconnectedDropdown = (props, forwardedRef) => { // Note: `anchorRef`, `getAnchorRect` and `anchorRect` are deprecated and // be removed from `Popover` from WordPress 6.3 !!popoverProps?.anchorRef || !!popoverProps?.getAnchorRect || !!popoverProps?.anchorRect; - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { className: className, ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([containerRef, forwardedRef, setFallbackPopoverAnchor]) // Some UAs focus the closest focusable parent when the toggle is @@ -38160,7 +37321,7 @@ const UnconnectedDropdown = (props, forwardedRef) => { , tabIndex: -1, style: style - }, renderToggle(args), isOpen && (0,external_wp_element_namespaceObject.createElement)(popover, { + }, renderToggle(args), isOpen && (0,external_React_.createElement)(popover, { position: position, onClose: close, onFocusOutside: closeIfFocusOutside, @@ -38204,7 +37365,7 @@ const UnconnectedDropdown = (props, forwardedRef) => { * ``` */ const Dropdown = contextConnect(UnconnectedDropdown, 'Dropdown'); -/* harmony default export */ var dropdown = (Dropdown); +/* harmony default export */ const dropdown = (Dropdown); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/input-suffix-wrapper.js @@ -38219,7 +37380,7 @@ const Dropdown = contextConnect(UnconnectedDropdown, 'Dropdown'); function UnconnectedInputControlSuffixWrapper(props, forwardedRef) { const derivedProps = useContextSystem(props, 'InputControlSuffixWrapper'); - return (0,external_wp_element_namespaceObject.createElement)(spacer_component, { + return (0,external_React_.createElement)(spacer_component, { marginBottom: 0, ...derivedProps, ref: forwardedRef @@ -38242,7 +37403,7 @@ function UnconnectedInputControlSuffixWrapper(props, forwardedRef) { * ``` */ const InputControlSuffixWrapper = contextConnect(UnconnectedInputControlSuffixWrapper, 'InputControlSuffixWrapper'); -/* harmony default export */ var input_suffix_wrapper = (InputControlSuffixWrapper); +/* harmony default export */ const input_suffix_wrapper = (InputControlSuffixWrapper); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/select-control/styles/select-control-styles.js @@ -38256,6 +37417,7 @@ const InputControlSuffixWrapper = contextConnect(UnconnectedInputControlSuffixWr + const select_control_styles_disabledStyles = ({ disabled }) => { @@ -38264,21 +37426,8 @@ const select_control_styles_disabledStyles = ({ color: COLORS.ui.textDisabled }, true ? "" : 0, true ? "" : 0); }; -const select_control_styles_fontSizeStyles = ({ - selectSize = 'default' -}) => { - const sizes = { - default: '13px', - small: '11px', - '__unstable-large': '13px' - }; - const fontSize = sizes[selectSize]; - const fontSizeMobile = '16px'; - if (!fontSize) return ''; - return /*#__PURE__*/emotion_react_browser_esm_css("font-size:", fontSizeMobile, ";@media ( min-width: 600px ){font-size:", fontSize, ";}" + ( true ? "" : 0), true ? "" : 0); -}; const select_control_styles_sizeStyles = ({ - __next36pxDefaultSize, + __next40pxDefaultSize, multiple, selectSize = 'default' }) => { @@ -38289,8 +37438,8 @@ const select_control_styles_sizeStyles = ({ } const sizes = { default: { - height: 36, - minHeight: 36, + height: 40, + minHeight: 40, paddingTop: 0, paddingBottom: 0 }, @@ -38300,6 +37449,12 @@ const select_control_styles_sizeStyles = ({ paddingTop: 0, paddingBottom: 0 }, + compact: { + height: 32, + minHeight: 32, + paddingTop: 0, + paddingBottom: 0 + }, '__unstable-large': { height: 40, minHeight: 40, @@ -38307,30 +37462,26 @@ const select_control_styles_sizeStyles = ({ paddingBottom: 0 } }; - if (!__next36pxDefaultSize) { - sizes.default = { - height: 30, - minHeight: 30, - paddingTop: 0, - paddingBottom: 0 - }; + if (!__next40pxDefaultSize) { + sizes.default = sizes.compact; } const style = sizes[selectSize] || sizes.default; return /*#__PURE__*/emotion_react_browser_esm_css(style, true ? "" : 0, true ? "" : 0); }; const chevronIconSize = 18; const sizePaddings = ({ - __next36pxDefaultSize, + __next40pxDefaultSize, multiple, selectSize = 'default' }) => { const padding = { default: 16, small: 8, + compact: 8, '__unstable-large': 16 }; - if (!__next36pxDefaultSize) { - padding.default = 8; + if (!__next40pxDefaultSize) { + padding.default = padding.compact; } const selectedPadding = padding[selectSize] || padding.default; return rtl({ @@ -38355,7 +37506,7 @@ const overflowStyles = ({ const Select = emotion_styled_base_browser_esm("select", true ? { target: "e1mv6sxx2" -} : 0)("&&&{appearance:none;background:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:", COLORS.gray[900], ";display:block;font-family:inherit;margin:0;width:100%;max-width:none;cursor:pointer;white-space:nowrap;text-overflow:ellipsis;", select_control_styles_disabledStyles, ";", select_control_styles_fontSizeStyles, ";", select_control_styles_sizeStyles, ";", sizePaddings, ";", overflowStyles, ";}" + ( true ? "" : 0)); +} : 0)("&&&{appearance:none;background:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:", COLORS.gray[900], ";display:block;font-family:inherit;margin:0;width:100%;max-width:none;cursor:pointer;white-space:nowrap;text-overflow:ellipsis;", select_control_styles_disabledStyles, ";", fontSizeStyles, ";", select_control_styles_sizeStyles, ";", sizePaddings, ";", overflowStyles, ";}" + ( true ? "" : 0)); const DownArrowWrapper = emotion_styled_base_browser_esm("div", true ? { target: "e1mv6sxx1" } : 0)("margin-inline-end:", space(-1), ";line-height:0;" + ( true ? "" : 0)); @@ -38395,7 +37546,7 @@ function icon_Icon({ ref }); } -/* harmony default export */ var icons_build_module_icon = ((0,external_wp_element_namespaceObject.forwardRef)(icon_Icon)); +/* harmony default export */ const icons_build_module_icon = ((0,external_wp_element_namespaceObject.forwardRef)(icon_Icon)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-down.js @@ -38403,13 +37554,13 @@ function icon_Icon({ * WordPress dependencies */ -const chevronDown = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const chevronDown = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" })); -/* harmony default export */ var chevron_down = (chevronDown); +/* harmony default export */ const chevron_down = (chevronDown); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/select-control/chevron-down.js @@ -38423,12 +37574,12 @@ const chevronDown = (0,external_wp_element_namespaceObject.createElement)(extern */ const SelectControlChevronDown = () => { - return (0,external_wp_element_namespaceObject.createElement)(InputControlSuffixWrapperWithClickThrough, null, (0,external_wp_element_namespaceObject.createElement)(DownArrowWrapper, null, (0,external_wp_element_namespaceObject.createElement)(icons_build_module_icon, { + return (0,external_React_.createElement)(InputControlSuffixWrapperWithClickThrough, null, (0,external_React_.createElement)(DownArrowWrapper, null, (0,external_React_.createElement)(icons_build_module_icon, { icon: chevron_down, size: chevronIconSize }))); }; -/* harmony default export */ var select_control_chevron_down = (SelectControlChevronDown); +/* harmony default export */ const select_control_chevron_down = (SelectControlChevronDown); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/select-control/index.js @@ -38450,6 +37601,7 @@ const SelectControlChevronDown = () => { + const select_control_noop = () => {}; function select_control_useUniqueId(idProp) { const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(SelectControl); @@ -38475,10 +37627,10 @@ function UnforwardedSelectControl(props, ref) { children, prefix, suffix, - __next36pxDefaultSize = false, + __next40pxDefaultSize = false, __nextHasNoMarginBottom = false, ...restProps - } = props; + } = useDeprecated36pxDefaultSizeProp(props); const [isFocused, setIsFocused] = (0,external_wp_element_namespaceObject.useState)(false); const id = select_control_useUniqueId(idProp); const helpId = help ? `${id}__help` : undefined; @@ -38511,11 +37663,11 @@ function UnforwardedSelectControl(props, ref) { }); }; const classes = classnames_default()('components-select-control', className); - return (0,external_wp_element_namespaceObject.createElement)(base_control, { + return (0,external_React_.createElement)(base_control, { help: help, id: id, __nextHasNoMarginBottom: __nextHasNoMarginBottom - }, (0,external_wp_element_namespaceObject.createElement)(input_base, { + }, (0,external_React_.createElement)(input_base, { className: classes, disabled: disabled, hideLabelFromVision: hideLabelFromVision, @@ -38523,13 +37675,13 @@ function UnforwardedSelectControl(props, ref) { isFocused: isFocused, label: label, size: size, - suffix: suffix || !multiple && (0,external_wp_element_namespaceObject.createElement)(select_control_chevron_down, null), + suffix: suffix || !multiple && (0,external_React_.createElement)(select_control_chevron_down, null), prefix: prefix, labelPosition: labelPosition, - __next36pxDefaultSize: __next36pxDefaultSize - }, (0,external_wp_element_namespaceObject.createElement)(Select, { + __next40pxDefaultSize: __next40pxDefaultSize + }, (0,external_React_.createElement)(Select, { ...restProps, - __next36pxDefaultSize: __next36pxDefaultSize, + __next40pxDefaultSize: __next40pxDefaultSize, "aria-describedby": helpId, className: "components-select-control__input", disabled: disabled, @@ -38543,7 +37695,7 @@ function UnforwardedSelectControl(props, ref) { value: valueProp }, children || options.map((option, index) => { const key = option.id || `${option.label}-${option.value}-${index}`; - return (0,external_wp_element_namespaceObject.createElement)("option", { + return (0,external_React_.createElement)("option", { key: key, value: option.value, disabled: option.disabled, @@ -38579,7 +37731,7 @@ function UnforwardedSelectControl(props, ref) { * ``` */ const SelectControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedSelectControl); -/* harmony default export */ var select_control = (SelectControl); +/* harmony default export */ const select_control = (SelectControl); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/hooks/use-controlled-state.js /** @@ -38664,7 +37816,7 @@ function use_controlled_state_useControlledState(currentState, options = default return [state, setState]; } -/* harmony default export */ var use_controlled_state = (use_controlled_state_useControlledState); +/* harmony default export */ const use_controlled_state = (use_controlled_state_useControlledState); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/range-control/utils.js /** @@ -38897,7 +38049,7 @@ const range_control_styles_Tooltip = emotion_styled_base_browser_esm("span", tr }), ";" + ( true ? "" : 0)); // @todo: Refactor RangeControl with latest HStack configuration -// @wordpress/components/ui/hstack. +// @see: packages/components/src/h-stack const InputNumber = /*#__PURE__*/emotion_styled_base_browser_esm(number_control, true ? { target: "e1epgpqk1" } : 0)("display:inline-block;font-size:13px;margin-top:0;input[type='number']&{", rangeHeight, ";}", rtl({ @@ -38927,7 +38079,7 @@ function input_range_InputRange(props, ref) { value, ...otherProps } = props; - return (0,external_wp_element_namespaceObject.createElement)(InputRange, { + return (0,external_React_.createElement)(InputRange, { ...otherProps, "aria-describedby": describedBy, "aria-label": label, @@ -38939,7 +38091,7 @@ function input_range_InputRange(props, ref) { }); } const input_range_ForwardedComponent = (0,external_wp_element_namespaceObject.forwardRef)(input_range_InputRange); -/* harmony default export */ var input_range = (input_range_ForwardedComponent); +/* harmony default export */ const input_range = (input_range_ForwardedComponent); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/range-control/mark.js @@ -38962,13 +38114,13 @@ function RangeMark(props) { } = props; const classes = classnames_default()('components-range-control__mark', isFilled && 'is-filled', className); const labelClasses = classnames_default()('components-range-control__mark-label', isFilled && 'is-filled'); - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(Mark, { + return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(Mark, { ...otherProps, "aria-hidden": "true", className: classes, isFilled: isFilled, style: style - }), label && (0,external_wp_element_namespaceObject.createElement)(MarkLabel, { + }), label && (0,external_React_.createElement)(MarkLabel, { "aria-hidden": "true", className: labelClasses, isFilled: isFilled, @@ -38998,10 +38150,10 @@ function RangeRail(props) { value = 0, ...restProps } = props; - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(Rail, { + return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(Rail, { disabled: disabled, ...restProps - }), marks && (0,external_wp_element_namespaceObject.createElement)(Marks, { + }), marks && (0,external_React_.createElement)(Marks, { disabled: disabled, marks: marks, min: min, @@ -39027,10 +38179,10 @@ function Marks(props) { step, value }); - return (0,external_wp_element_namespaceObject.createElement)(MarksWrapper, { + return (0,external_React_.createElement)(MarksWrapper, { "aria-hidden": "true", className: "components-range-control__marks" - }, marksData.map(mark => (0,external_wp_element_namespaceObject.createElement)(RangeMark, { + }, marksData.map(mark => (0,external_React_.createElement)(RangeMark, { ...mark, key: mark.key, "aria-hidden": "true", @@ -39113,7 +38265,7 @@ function SimpleTooltip(props) { ...style, zIndex }; - return (0,external_wp_element_namespaceObject.createElement)(range_control_styles_Tooltip, { + return (0,external_React_.createElement)(range_control_styles_Tooltip, { ...restProps, "aria-hidden": show, className: classes, @@ -39309,24 +38461,24 @@ function UnforwardedRangeControl(props, forwardedRef) { const offsetStyle = { [(0,external_wp_i18n_namespaceObject.isRTL)() ? 'right' : 'left']: fillValueOffset }; - return (0,external_wp_element_namespaceObject.createElement)(base_control, { + return (0,external_React_.createElement)(base_control, { __nextHasNoMarginBottom: __nextHasNoMarginBottom, className: classes, label: label, hideLabelFromVision: hideLabelFromVision, id: `${id}`, help: help - }, (0,external_wp_element_namespaceObject.createElement)(range_control_styles_Root, { + }, (0,external_React_.createElement)(range_control_styles_Root, { className: "components-range-control__root", __next40pxDefaultSize: __next40pxDefaultSize - }, beforeIcon && (0,external_wp_element_namespaceObject.createElement)(BeforeIconWrapper, null, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { + }, beforeIcon && (0,external_React_.createElement)(BeforeIconWrapper, null, (0,external_React_.createElement)(build_module_icon, { icon: beforeIcon - })), (0,external_wp_element_namespaceObject.createElement)(range_control_styles_Wrapper, { + })), (0,external_React_.createElement)(range_control_styles_Wrapper, { __nextHasNoMarginBottom: __nextHasNoMarginBottom, className: wrapperClasses, color: colorProp, marks: !!marks - }, (0,external_wp_element_namespaceObject.createElement)(input_range, { + }, (0,external_React_.createElement)(input_range, { ...otherProps, className: "components-range-control__slider", describedBy: describedBy, @@ -39343,7 +38495,7 @@ function UnforwardedRangeControl(props, forwardedRef) { ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([inputRef, forwardedRef]), step: step, value: inputSliderValue !== null && inputSliderValue !== void 0 ? inputSliderValue : undefined - }), (0,external_wp_element_namespaceObject.createElement)(RangeRail, { + }), (0,external_React_.createElement)(RangeRail, { "aria-hidden": true, disabled: disabled, marks: marks, @@ -39352,7 +38504,7 @@ function UnforwardedRangeControl(props, forwardedRef) { railColor: railColor, step: step, value: rangeFillValue - }), (0,external_wp_element_namespaceObject.createElement)(Track, { + }), (0,external_React_.createElement)(Track, { "aria-hidden": true, className: "components-range-control__track", disabled: disabled, @@ -39360,15 +38512,15 @@ function UnforwardedRangeControl(props, forwardedRef) { width: fillValueOffset }, trackColor: trackColor - }), (0,external_wp_element_namespaceObject.createElement)(ThumbWrapper, { + }), (0,external_React_.createElement)(ThumbWrapper, { className: "components-range-control__thumb-wrapper", style: offsetStyle, disabled: disabled - }, (0,external_wp_element_namespaceObject.createElement)(Thumb, { + }, (0,external_React_.createElement)(Thumb, { "aria-hidden": true, isFocused: isThumbFocused, disabled: disabled - })), enableTooltip && (0,external_wp_element_namespaceObject.createElement)(SimpleTooltip, { + })), enableTooltip && (0,external_React_.createElement)(SimpleTooltip, { className: "components-range-control__tooltip", inputRef: inputRef, tooltipPosition: "bottom", @@ -39376,9 +38528,9 @@ function UnforwardedRangeControl(props, forwardedRef) { show: isCurrentlyFocused || showTooltip, style: offsetStyle, value: value - })), afterIcon && (0,external_wp_element_namespaceObject.createElement)(AfterIconWrapper, null, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { + })), afterIcon && (0,external_React_.createElement)(AfterIconWrapper, null, (0,external_React_.createElement)(build_module_icon, { icon: afterIcon - })), hasInputField && (0,external_wp_element_namespaceObject.createElement)(InputNumber, { + })), hasInputField && (0,external_React_.createElement)(InputNumber, { "aria-label": label, className: "components-range-control__number", disabled: disabled, @@ -39395,11 +38547,11 @@ function UnforwardedRangeControl(props, forwardedRef) { // @ts-expect-error TODO: Investigate if the `null` value is necessary , value: inputSliderValue - }), allowReset && (0,external_wp_element_namespaceObject.createElement)(ActionRightWrapper, null, (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }), allowReset && (0,external_React_.createElement)(ActionRightWrapper, null, (0,external_React_.createElement)(build_module_button, { className: "components-range-control__reset", disabled: disabled || value === undefined, variant: "secondary", - isSmall: true, + size: "small", onClick: handleOnReset }, (0,external_wp_i18n_namespaceObject.__)('Reset'))))); } @@ -39427,7 +38579,7 @@ function UnforwardedRangeControl(props, forwardedRef) { * ``` */ const RangeControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedRangeControl); -/* harmony default export */ var range_control = (RangeControl); +/* harmony default export */ const range_control = (RangeControl); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-picker/styles.js @@ -39475,7 +38627,7 @@ const ColorInputWrapper = /*#__PURE__*/emotion_styled_base_browser_esm(flex_comp } : 0)("padding-top:", space(4), ";padding-left:", space(4), ";padding-right:", space(3), ";padding-bottom:", space(5), ";" + ( true ? "" : 0)); const ColorfulWrapper = emotion_styled_base_browser_esm("div", true ? { target: "ez9hsf41" -} : 0)(boxSizingReset, ";width:216px;.react-colorful{display:flex;flex-direction:column;align-items:center;width:216px;height:auto;overflow:hidden;}.react-colorful__saturation{width:100%;border-radius:0;height:216px;margin-bottom:", space(4), ";border-bottom:none;}.react-colorful__hue,.react-colorful__alpha{width:184px;height:16px;border-radius:16px;margin-bottom:", space(2), ";}.react-colorful__pointer{height:16px;width:16px;border:none;box-shadow:0 0 2px 0 rgba( 0, 0, 0, 0.25 );outline:2px solid transparent;}.react-colorful__pointer-fill{box-shadow:inset 0 0 0 ", config_values.borderWidthFocus, " #fff;}", interactiveHueStyles, ";" + ( true ? "" : 0)); +} : 0)(boxSizingReset, ";width:216px;.react-colorful{display:flex;flex-direction:column;align-items:center;width:216px;height:auto;}.react-colorful__saturation{width:100%;border-radius:0;height:216px;margin-bottom:", space(4), ";border-bottom:none;}.react-colorful__hue,.react-colorful__alpha{width:184px;height:16px;border-radius:16px;margin-bottom:", space(2), ";}.react-colorful__pointer{height:16px;width:16px;border:none;box-shadow:0 0 2px 0 rgba( 0, 0, 0, 0.25 );outline:2px solid transparent;}.react-colorful__pointer-fill{box-shadow:inset 0 0 0 ", config_values.borderWidthFocus, " #fff;}", interactiveHueStyles, ";" + ( true ? "" : 0)); const CopyButton = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_button, true ? { target: "ez9hsf40" } : 0)("&&&&&{min-width:", space(6), ";padding:0;>svg{margin-right:0;}}" + ( true ? "" : 0)); @@ -39486,3016 +38638,15 @@ const CopyButton = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_but * WordPress dependencies */ -const copy_copy = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const copy_copy = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { - d: "M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zm-13.5 0V4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1v11.8c0 .1-.1.1-.1.1H4.6l-.1-.1z" +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z" })); -/* harmony default export */ var library_copy = (copy_copy); - -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindow.js -function getWindow_getWindow(node) { - if (node == null) { - return window; - } - - if (node.toString() !== '[object Window]') { - var ownerDocument = node.ownerDocument; - return ownerDocument ? ownerDocument.defaultView || window : window; - } - - return node; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js - - -function instanceOf_isElement(node) { - var OwnElement = getWindow_getWindow(node).Element; - return node instanceof OwnElement || node instanceof Element; -} - -function instanceOf_isHTMLElement(node) { - var OwnElement = getWindow_getWindow(node).HTMLElement; - return node instanceof OwnElement || node instanceof HTMLElement; -} - -function instanceOf_isShadowRoot(node) { - // IE 11 has no ShadowRoot - if (typeof ShadowRoot === 'undefined') { - return false; - } - - var OwnElement = getWindow_getWindow(node).ShadowRoot; - return node instanceof OwnElement || node instanceof ShadowRoot; -} - - -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/math.js -var math_max = Math.max; -var math_min = Math.min; -var math_round = Math.round; -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/userAgent.js -function getUAString() { - var uaData = navigator.userAgentData; - - if (uaData != null && uaData.brands) { - return uaData.brands.map(function (item) { - return item.brand + "/" + item.version; - }).join(' '); - } - - return navigator.userAgent; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js - -function isLayoutViewport() { - return !/^((?!chrome|android).)*safari/i.test(getUAString()); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js - - - - -function getBoundingClientRect_getBoundingClientRect(element, includeScale, isFixedStrategy) { - if (includeScale === void 0) { - includeScale = false; - } - - if (isFixedStrategy === void 0) { - isFixedStrategy = false; - } - - var clientRect = element.getBoundingClientRect(); - var scaleX = 1; - var scaleY = 1; - - if (includeScale && instanceOf_isHTMLElement(element)) { - scaleX = element.offsetWidth > 0 ? math_round(clientRect.width) / element.offsetWidth || 1 : 1; - scaleY = element.offsetHeight > 0 ? math_round(clientRect.height) / element.offsetHeight || 1 : 1; - } - - var _ref = instanceOf_isElement(element) ? getWindow_getWindow(element) : window, - visualViewport = _ref.visualViewport; - - var addVisualOffsets = !isLayoutViewport() && isFixedStrategy; - var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX; - var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY; - var width = clientRect.width / scaleX; - var height = clientRect.height / scaleY; - return { - width: width, - height: height, - top: y, - right: x + width, - bottom: y + height, - left: x, - x: x, - y: y - }; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js - -function getWindowScroll(node) { - var win = getWindow_getWindow(node); - var scrollLeft = win.pageXOffset; - var scrollTop = win.pageYOffset; - return { - scrollLeft: scrollLeft, - scrollTop: scrollTop - }; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js -function getHTMLElementScroll(element) { - return { - scrollLeft: element.scrollLeft, - scrollTop: element.scrollTop - }; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js - - - - -function getNodeScroll_getNodeScroll(node) { - if (node === getWindow_getWindow(node) || !instanceOf_isHTMLElement(node)) { - return getWindowScroll(node); - } else { - return getHTMLElementScroll(node); - } -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js -function getNodeName_getNodeName(element) { - return element ? (element.nodeName || '').toLowerCase() : null; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js - -function getDocumentElement_getDocumentElement(element) { - // $FlowFixMe[incompatible-return]: assume body is always available - return ((instanceOf_isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing] - element.document) || window.document).documentElement; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js - - - -function getWindowScrollBarX_getWindowScrollBarX(element) { - // If <html> has a CSS width greater than the viewport, then this will be - // incorrect for RTL. - // Popper 1 is broken in this case and never had a bug report so let's assume - // it's not an issue. I don't think anyone ever specifies width on <html> - // anyway. - // Browsers where the left scrollbar doesn't cause an issue report `0` for - // this (e.g. Edge 2019, IE11, Safari) - return getBoundingClientRect_getBoundingClientRect(getDocumentElement_getDocumentElement(element)).left + getWindowScroll(element).scrollLeft; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js - -function getComputedStyle_getComputedStyle(element) { - return getWindow_getWindow(element).getComputedStyle(element); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js - -function isScrollParent(element) { - // Firefox wants us to check `-x` and `-y` variations as well - var _getComputedStyle = getComputedStyle_getComputedStyle(element), - overflow = _getComputedStyle.overflow, - overflowX = _getComputedStyle.overflowX, - overflowY = _getComputedStyle.overflowY; - - return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js - - - - - - - - - -function isElementScaled(element) { - var rect = element.getBoundingClientRect(); - var scaleX = math_round(rect.width) / element.offsetWidth || 1; - var scaleY = math_round(rect.height) / element.offsetHeight || 1; - return scaleX !== 1 || scaleY !== 1; -} // Returns the composite rect of an element relative to its offsetParent. -// Composite means it takes into account transforms as well as layout. - - -function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { - if (isFixed === void 0) { - isFixed = false; - } - - var isOffsetParentAnElement = instanceOf_isHTMLElement(offsetParent); - var offsetParentIsScaled = instanceOf_isHTMLElement(offsetParent) && isElementScaled(offsetParent); - var documentElement = getDocumentElement_getDocumentElement(offsetParent); - var rect = getBoundingClientRect_getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed); - var scroll = { - scrollLeft: 0, - scrollTop: 0 - }; - var offsets = { - x: 0, - y: 0 - }; - - if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { - if (getNodeName_getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078 - isScrollParent(documentElement)) { - scroll = getNodeScroll_getNodeScroll(offsetParent); - } - - if (instanceOf_isHTMLElement(offsetParent)) { - offsets = getBoundingClientRect_getBoundingClientRect(offsetParent, true); - offsets.x += offsetParent.clientLeft; - offsets.y += offsetParent.clientTop; - } else if (documentElement) { - offsets.x = getWindowScrollBarX_getWindowScrollBarX(documentElement); - } - } - - return { - x: rect.left + scroll.scrollLeft - offsets.x, - y: rect.top + scroll.scrollTop - offsets.y, - width: rect.width, - height: rect.height - }; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js - // Returns the layout rect of an element relative to its offsetParent. Layout -// means it doesn't take into account transforms. - -function getLayoutRect(element) { - var clientRect = getBoundingClientRect_getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed. - // Fixes https://github.com/popperjs/popper-core/issues/1223 - - var width = element.offsetWidth; - var height = element.offsetHeight; - - if (Math.abs(clientRect.width - width) <= 1) { - width = clientRect.width; - } - - if (Math.abs(clientRect.height - height) <= 1) { - height = clientRect.height; - } - - return { - x: element.offsetLeft, - y: element.offsetTop, - width: width, - height: height - }; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js - - - -function getParentNode_getParentNode(element) { - if (getNodeName_getNodeName(element) === 'html') { - return element; - } - - return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle - // $FlowFixMe[incompatible-return] - // $FlowFixMe[prop-missing] - element.assignedSlot || // step into the shadow DOM of the parent of a slotted node - element.parentNode || ( // DOM Element detected - instanceOf_isShadowRoot(element) ? element.host : null) || // ShadowRoot detected - // $FlowFixMe[incompatible-call]: HTMLElement is a Node - getDocumentElement_getDocumentElement(element) // fallback - - ); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js - - - - -function getScrollParent(node) { - if (['html', 'body', '#document'].indexOf(getNodeName_getNodeName(node)) >= 0) { - // $FlowFixMe[incompatible-return]: assume body is always available - return node.ownerDocument.body; - } - - if (instanceOf_isHTMLElement(node) && isScrollParent(node)) { - return node; - } - - return getScrollParent(getParentNode_getParentNode(node)); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js - - - - -/* -given a DOM element, return the list of all scroll parents, up the list of ancesors -until we get to the top window object. This list is what we attach scroll listeners -to, because if any of these parent elements scroll, we'll need to re-calculate the -reference element's position. -*/ - -function listScrollParents(element, list) { - var _element$ownerDocumen; - - if (list === void 0) { - list = []; - } - - var scrollParent = getScrollParent(element); - var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); - var win = getWindow_getWindow(scrollParent); - var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; - var updatedList = list.concat(target); - return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here - updatedList.concat(listScrollParents(getParentNode_getParentNode(target))); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js - -function isTableElement_isTableElement(element) { - return ['table', 'td', 'th'].indexOf(getNodeName_getNodeName(element)) >= 0; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js - - - - - - - - -function getOffsetParent_getTrueOffsetParent(element) { - if (!instanceOf_isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837 - getComputedStyle_getComputedStyle(element).position === 'fixed') { - return null; - } - - return element.offsetParent; -} // `.offsetParent` reports `null` for fixed elements, while absolute elements -// return the containing block - - -function getOffsetParent_getContainingBlock(element) { - var isFirefox = /firefox/i.test(getUAString()); - var isIE = /Trident/i.test(getUAString()); - - if (isIE && instanceOf_isHTMLElement(element)) { - // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport - var elementCss = getComputedStyle_getComputedStyle(element); - - if (elementCss.position === 'fixed') { - return null; - } - } - - var currentNode = getParentNode_getParentNode(element); - - if (instanceOf_isShadowRoot(currentNode)) { - currentNode = currentNode.host; - } - - while (instanceOf_isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName_getNodeName(currentNode)) < 0) { - var css = getComputedStyle_getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that - // create a containing block. - // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block - - if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') { - return currentNode; - } else { - currentNode = currentNode.parentNode; - } - } - - return null; -} // Gets the closest ancestor positioned element. Handles some edge cases, -// such as table ancestors and cross browser bugs. - - -function getOffsetParent_getOffsetParent(element) { - var window = getWindow_getWindow(element); - var offsetParent = getOffsetParent_getTrueOffsetParent(element); - - while (offsetParent && isTableElement_isTableElement(offsetParent) && getComputedStyle_getComputedStyle(offsetParent).position === 'static') { - offsetParent = getOffsetParent_getTrueOffsetParent(offsetParent); - } - - if (offsetParent && (getNodeName_getNodeName(offsetParent) === 'html' || getNodeName_getNodeName(offsetParent) === 'body' && getComputedStyle_getComputedStyle(offsetParent).position === 'static')) { - return window; - } - - return offsetParent || getOffsetParent_getContainingBlock(element) || window; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/enums.js -var enums_top = 'top'; -var bottom = 'bottom'; -var right = 'right'; -var left = 'left'; -var enums_auto = 'auto'; -var basePlacements = [enums_top, bottom, right, left]; -var start = 'start'; -var end = 'end'; -var clippingParents = 'clippingParents'; -var viewport = 'viewport'; -var popper = 'popper'; -var reference = 'reference'; -var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) { - return acc.concat([placement + "-" + start, placement + "-" + end]); -}, []); -var enums_placements = /*#__PURE__*/[].concat(basePlacements, [enums_auto]).reduce(function (acc, placement) { - return acc.concat([placement, placement + "-" + start, placement + "-" + end]); -}, []); // modifiers that need to read the DOM - -var beforeRead = 'beforeRead'; -var read = 'read'; -var afterRead = 'afterRead'; // pure-logic modifiers - -var beforeMain = 'beforeMain'; -var main = 'main'; -var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state) - -var beforeWrite = 'beforeWrite'; -var write = 'write'; -var afterWrite = 'afterWrite'; -var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/orderModifiers.js - // source: https://stackoverflow.com/questions/49875255 - -function order(modifiers) { - var map = new Map(); - var visited = new Set(); - var result = []; - modifiers.forEach(function (modifier) { - map.set(modifier.name, modifier); - }); // On visiting object, check for its dependencies and visit them recursively - - function sort(modifier) { - visited.add(modifier.name); - var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []); - requires.forEach(function (dep) { - if (!visited.has(dep)) { - var depModifier = map.get(dep); - - if (depModifier) { - sort(depModifier); - } - } - }); - result.push(modifier); - } - - modifiers.forEach(function (modifier) { - if (!visited.has(modifier.name)) { - // check for visited object - sort(modifier); - } - }); - return result; -} - -function orderModifiers(modifiers) { - // order based on dependencies - var orderedModifiers = order(modifiers); // order based on phase - - return modifierPhases.reduce(function (acc, phase) { - return acc.concat(orderedModifiers.filter(function (modifier) { - return modifier.phase === phase; - })); - }, []); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/debounce.js -function debounce(fn) { - var pending; - return function () { - if (!pending) { - pending = new Promise(function (resolve) { - Promise.resolve().then(function () { - pending = undefined; - resolve(fn()); - }); - }); - } - - return pending; - }; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/mergeByName.js -function mergeByName(modifiers) { - var merged = modifiers.reduce(function (merged, current) { - var existing = merged[current.name]; - merged[current.name] = existing ? Object.assign({}, existing, current, { - options: Object.assign({}, existing.options, current.options), - data: Object.assign({}, existing.data, current.data) - }) : current; - return merged; - }, {}); // IE11 does not support Object.values - - return Object.keys(merged).map(function (key) { - return merged[key]; - }); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/createPopper.js - - - - - - - - - - - - - - -var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.'; -var INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.'; -var DEFAULT_OPTIONS = { - placement: 'bottom', - modifiers: [], - strategy: 'absolute' -}; - -function areValidElements() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return !args.some(function (element) { - return !(element && typeof element.getBoundingClientRect === 'function'); - }); -} - -function popperGenerator(generatorOptions) { - if (generatorOptions === void 0) { - generatorOptions = {}; - } - - var _generatorOptions = generatorOptions, - _generatorOptions$def = _generatorOptions.defaultModifiers, - defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, - _generatorOptions$def2 = _generatorOptions.defaultOptions, - defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; - return function createPopper(reference, popper, options) { - if (options === void 0) { - options = defaultOptions; - } - - var state = { - placement: 'bottom', - orderedModifiers: [], - options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), - modifiersData: {}, - elements: { - reference: reference, - popper: popper - }, - attributes: {}, - styles: {} - }; - var effectCleanupFns = []; - var isDestroyed = false; - var instance = { - state: state, - setOptions: function setOptions(setOptionsAction) { - var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction; - cleanupModifierEffects(); - state.options = Object.assign({}, defaultOptions, state.options, options); - state.scrollParents = { - reference: instanceOf_isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [], - popper: listScrollParents(popper) - }; // Orders the modifiers based on their dependencies and `phase` - // properties - - var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers - - state.orderedModifiers = orderedModifiers.filter(function (m) { - return m.enabled; - }); // Validate the provided modifiers so that the consumer will get warned - // if one of the modifiers is invalid for any reason - - if (false) { var _getComputedStyle, marginTop, marginRight, marginBottom, marginLeft, flipModifier, modifiers; } - - runModifierEffects(); - return instance.update(); - }, - // Sync update – it will always be executed, even if not necessary. This - // is useful for low frequency updates where sync behavior simplifies the - // logic. - // For high frequency updates (e.g. `resize` and `scroll` events), always - // prefer the async Popper#update method - forceUpdate: function forceUpdate() { - if (isDestroyed) { - return; - } - - var _state$elements = state.elements, - reference = _state$elements.reference, - popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements - // anymore - - if (!areValidElements(reference, popper)) { - if (false) {} - - return; - } // Store the reference and popper rects to be read by modifiers - - - state.rects = { - reference: getCompositeRect(reference, getOffsetParent_getOffsetParent(popper), state.options.strategy === 'fixed'), - popper: getLayoutRect(popper) - }; // Modifiers have the ability to reset the current update cycle. The - // most common use case for this is the `flip` modifier changing the - // placement, which then needs to re-run all the modifiers, because the - // logic was previously ran for the previous placement and is therefore - // stale/incorrect - - state.reset = false; - state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier - // is filled with the initial data specified by the modifier. This means - // it doesn't persist and is fresh on each update. - // To ensure persistent data, use `${name}#persistent` - - state.orderedModifiers.forEach(function (modifier) { - return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); - }); - var __debug_loops__ = 0; - - for (var index = 0; index < state.orderedModifiers.length; index++) { - if (false) {} - - if (state.reset === true) { - state.reset = false; - index = -1; - continue; - } - - var _state$orderedModifie = state.orderedModifiers[index], - fn = _state$orderedModifie.fn, - _state$orderedModifie2 = _state$orderedModifie.options, - _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, - name = _state$orderedModifie.name; - - if (typeof fn === 'function') { - state = fn({ - state: state, - options: _options, - name: name, - instance: instance - }) || state; - } - } - }, - // Async and optimistically optimized update – it will not be executed if - // not necessary (debounced to run at most once-per-tick) - update: debounce(function () { - return new Promise(function (resolve) { - instance.forceUpdate(); - resolve(state); - }); - }), - destroy: function destroy() { - cleanupModifierEffects(); - isDestroyed = true; - } - }; - - if (!areValidElements(reference, popper)) { - if (false) {} - - return instance; - } - - instance.setOptions(options).then(function (state) { - if (!isDestroyed && options.onFirstUpdate) { - options.onFirstUpdate(state); - } - }); // Modifiers have the ability to execute arbitrary code before the first - // update cycle runs. They will be executed in the same order as the update - // cycle. This is useful when a modifier adds some persistent data that - // other modifiers need to use, but the modifier is run after the dependent - // one. - - function runModifierEffects() { - state.orderedModifiers.forEach(function (_ref3) { - var name = _ref3.name, - _ref3$options = _ref3.options, - options = _ref3$options === void 0 ? {} : _ref3$options, - effect = _ref3.effect; - - if (typeof effect === 'function') { - var cleanupFn = effect({ - state: state, - name: name, - instance: instance, - options: options - }); - - var noopFn = function noopFn() {}; - - effectCleanupFns.push(cleanupFn || noopFn); - } - }); - } - - function cleanupModifierEffects() { - effectCleanupFns.forEach(function (fn) { - return fn(); - }); - effectCleanupFns = []; - } - - return instance; - }; -} -var createPopper = /*#__PURE__*/(/* unused pure expression or super */ null && (popperGenerator())); // eslint-disable-next-line import/no-unused-modules - - -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/eventListeners.js - // eslint-disable-next-line import/no-unused-modules - -var passive = { - passive: true -}; - -function effect(_ref) { - var state = _ref.state, - instance = _ref.instance, - options = _ref.options; - var _options$scroll = options.scroll, - scroll = _options$scroll === void 0 ? true : _options$scroll, - _options$resize = options.resize, - resize = _options$resize === void 0 ? true : _options$resize; - var window = getWindow_getWindow(state.elements.popper); - var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); - - if (scroll) { - scrollParents.forEach(function (scrollParent) { - scrollParent.addEventListener('scroll', instance.update, passive); - }); - } - - if (resize) { - window.addEventListener('resize', instance.update, passive); - } - - return function () { - if (scroll) { - scrollParents.forEach(function (scrollParent) { - scrollParent.removeEventListener('scroll', instance.update, passive); - }); - } - - if (resize) { - window.removeEventListener('resize', instance.update, passive); - } - }; -} // eslint-disable-next-line import/no-unused-modules - - -/* harmony default export */ var eventListeners = ({ - name: 'eventListeners', - enabled: true, - phase: 'write', - fn: function fn() {}, - effect: effect, - data: {} -}); -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getBasePlacement.js - -function getBasePlacement(placement) { - return placement.split('-')[0]; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getVariation.js -function getVariation(placement) { - return placement.split('-')[1]; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js -function getMainAxisFromPlacement(placement) { - return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y'; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/computeOffsets.js - - - - -function computeOffsets(_ref) { - var reference = _ref.reference, - element = _ref.element, - placement = _ref.placement; - var basePlacement = placement ? getBasePlacement(placement) : null; - var variation = placement ? getVariation(placement) : null; - var commonX = reference.x + reference.width / 2 - element.width / 2; - var commonY = reference.y + reference.height / 2 - element.height / 2; - var offsets; - - switch (basePlacement) { - case enums_top: - offsets = { - x: commonX, - y: reference.y - element.height - }; - break; - - case bottom: - offsets = { - x: commonX, - y: reference.y + reference.height - }; - break; - - case right: - offsets = { - x: reference.x + reference.width, - y: commonY - }; - break; - - case left: - offsets = { - x: reference.x - element.width, - y: commonY - }; - break; - - default: - offsets = { - x: reference.x, - y: reference.y - }; - } - - var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; - - if (mainAxis != null) { - var len = mainAxis === 'y' ? 'height' : 'width'; - - switch (variation) { - case start: - offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2); - break; - - case end: - offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2); - break; - - default: - } - } - - return offsets; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js - - -function popperOffsets(_ref) { - var state = _ref.state, - name = _ref.name; - // Offsets are the actual position the popper needs to have to be - // properly positioned near its reference element - // This is the most basic placement, and will be adjusted by - // the modifiers in the next step - state.modifiersData[name] = computeOffsets({ - reference: state.rects.reference, - element: state.rects.popper, - strategy: 'absolute', - placement: state.placement - }); -} // eslint-disable-next-line import/no-unused-modules - - -/* harmony default export */ var modifiers_popperOffsets = ({ - name: 'popperOffsets', - enabled: true, - phase: 'read', - fn: popperOffsets, - data: {} -}); -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/computeStyles.js - - - - - - - - // eslint-disable-next-line import/no-unused-modules - -var unsetSides = { - top: 'auto', - right: 'auto', - bottom: 'auto', - left: 'auto' -}; // Round the offsets to the nearest suitable subpixel based on the DPR. -// Zooming can change the DPR, but it seems to report a value that will -// cleanly divide the values into the appropriate subpixels. - -function roundOffsetsByDPR(_ref) { - var x = _ref.x, - y = _ref.y; - var win = window; - var dpr = win.devicePixelRatio || 1; - return { - x: math_round(x * dpr) / dpr || 0, - y: math_round(y * dpr) / dpr || 0 - }; -} - -function mapToStyles(_ref2) { - var _Object$assign2; - - var popper = _ref2.popper, - popperRect = _ref2.popperRect, - placement = _ref2.placement, - variation = _ref2.variation, - offsets = _ref2.offsets, - position = _ref2.position, - gpuAcceleration = _ref2.gpuAcceleration, - adaptive = _ref2.adaptive, - roundOffsets = _ref2.roundOffsets, - isFixed = _ref2.isFixed; - var _offsets$x = offsets.x, - x = _offsets$x === void 0 ? 0 : _offsets$x, - _offsets$y = offsets.y, - y = _offsets$y === void 0 ? 0 : _offsets$y; - - var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({ - x: x, - y: y - }) : { - x: x, - y: y - }; - - x = _ref3.x; - y = _ref3.y; - var hasX = offsets.hasOwnProperty('x'); - var hasY = offsets.hasOwnProperty('y'); - var sideX = left; - var sideY = enums_top; - var win = window; - - if (adaptive) { - var offsetParent = getOffsetParent_getOffsetParent(popper); - var heightProp = 'clientHeight'; - var widthProp = 'clientWidth'; - - if (offsetParent === getWindow_getWindow(popper)) { - offsetParent = getDocumentElement_getDocumentElement(popper); - - if (getComputedStyle_getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') { - heightProp = 'scrollHeight'; - widthProp = 'scrollWidth'; - } - } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it - - - offsetParent = offsetParent; - - if (placement === enums_top || (placement === left || placement === right) && variation === end) { - sideY = bottom; - var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing] - offsetParent[heightProp]; - y -= offsetY - popperRect.height; - y *= gpuAcceleration ? 1 : -1; - } - - if (placement === left || (placement === enums_top || placement === bottom) && variation === end) { - sideX = right; - var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing] - offsetParent[widthProp]; - x -= offsetX - popperRect.width; - x *= gpuAcceleration ? 1 : -1; - } - } - - var commonStyles = Object.assign({ - position: position - }, adaptive && unsetSides); - - var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ - x: x, - y: y - }) : { - x: x, - y: y - }; - - x = _ref4.x; - y = _ref4.y; - - if (gpuAcceleration) { - var _Object$assign; - - return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); - } - - return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2)); -} - -function computeStyles(_ref5) { - var state = _ref5.state, - options = _ref5.options; - var _options$gpuAccelerat = options.gpuAcceleration, - gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, - _options$adaptive = options.adaptive, - adaptive = _options$adaptive === void 0 ? true : _options$adaptive, - _options$roundOffsets = options.roundOffsets, - roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; - - if (false) { var transitionProperty; } - - var commonStyles = { - placement: getBasePlacement(state.placement), - variation: getVariation(state.placement), - popper: state.elements.popper, - popperRect: state.rects.popper, - gpuAcceleration: gpuAcceleration, - isFixed: state.options.strategy === 'fixed' - }; - - if (state.modifiersData.popperOffsets != null) { - state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { - offsets: state.modifiersData.popperOffsets, - position: state.options.strategy, - adaptive: adaptive, - roundOffsets: roundOffsets - }))); - } - - if (state.modifiersData.arrow != null) { - state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { - offsets: state.modifiersData.arrow, - position: 'absolute', - adaptive: false, - roundOffsets: roundOffsets - }))); - } - - state.attributes.popper = Object.assign({}, state.attributes.popper, { - 'data-popper-placement': state.placement - }); -} // eslint-disable-next-line import/no-unused-modules - - -/* harmony default export */ var modifiers_computeStyles = ({ - name: 'computeStyles', - enabled: true, - phase: 'beforeWrite', - fn: computeStyles, - data: {} -}); -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/applyStyles.js - - // This modifier takes the styles prepared by the `computeStyles` modifier -// and applies them to the HTMLElements such as popper and arrow - -function applyStyles(_ref) { - var state = _ref.state; - Object.keys(state.elements).forEach(function (name) { - var style = state.styles[name] || {}; - var attributes = state.attributes[name] || {}; - var element = state.elements[name]; // arrow is optional + virtual elements - - if (!instanceOf_isHTMLElement(element) || !getNodeName_getNodeName(element)) { - return; - } // Flow doesn't support to extend this property, but it's the most - // effective way to apply styles to an HTMLElement - // $FlowFixMe[cannot-write] - - - Object.assign(element.style, style); - Object.keys(attributes).forEach(function (name) { - var value = attributes[name]; - - if (value === false) { - element.removeAttribute(name); - } else { - element.setAttribute(name, value === true ? '' : value); - } - }); - }); -} - -function applyStyles_effect(_ref2) { - var state = _ref2.state; - var initialStyles = { - popper: { - position: state.options.strategy, - left: '0', - top: '0', - margin: '0' - }, - arrow: { - position: 'absolute' - }, - reference: {} - }; - Object.assign(state.elements.popper.style, initialStyles.popper); - state.styles = initialStyles; - - if (state.elements.arrow) { - Object.assign(state.elements.arrow.style, initialStyles.arrow); - } - - return function () { - Object.keys(state.elements).forEach(function (name) { - var element = state.elements[name]; - var attributes = state.attributes[name] || {}; - var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them - - var style = styleProperties.reduce(function (style, property) { - style[property] = ''; - return style; - }, {}); // arrow is optional + virtual elements - - if (!instanceOf_isHTMLElement(element) || !getNodeName_getNodeName(element)) { - return; - } - - Object.assign(element.style, style); - Object.keys(attributes).forEach(function (attribute) { - element.removeAttribute(attribute); - }); - }); - }; -} // eslint-disable-next-line import/no-unused-modules - - -/* harmony default export */ var modifiers_applyStyles = ({ - name: 'applyStyles', - enabled: true, - phase: 'write', - fn: applyStyles, - effect: applyStyles_effect, - requires: ['computeStyles'] -}); -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/offset.js - - // eslint-disable-next-line import/no-unused-modules - -function distanceAndSkiddingToXY(placement, rects, offset) { - var basePlacement = getBasePlacement(placement); - var invertDistance = [left, enums_top].indexOf(basePlacement) >= 0 ? -1 : 1; - - var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, { - placement: placement - })) : offset, - skidding = _ref[0], - distance = _ref[1]; - - skidding = skidding || 0; - distance = (distance || 0) * invertDistance; - return [left, right].indexOf(basePlacement) >= 0 ? { - x: distance, - y: skidding - } : { - x: skidding, - y: distance - }; -} - -function offset_offset(_ref2) { - var state = _ref2.state, - options = _ref2.options, - name = _ref2.name; - var _options$offset = options.offset, - offset = _options$offset === void 0 ? [0, 0] : _options$offset; - var data = enums_placements.reduce(function (acc, placement) { - acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset); - return acc; - }, {}); - var _data$state$placement = data[state.placement], - x = _data$state$placement.x, - y = _data$state$placement.y; - - if (state.modifiersData.popperOffsets != null) { - state.modifiersData.popperOffsets.x += x; - state.modifiersData.popperOffsets.y += y; - } - - state.modifiersData[name] = data; -} // eslint-disable-next-line import/no-unused-modules - - -/* harmony default export */ var modifiers_offset = ({ - name: 'offset', - enabled: true, - phase: 'main', - requires: ['popperOffsets'], - fn: offset_offset -}); -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js -var getOppositePlacement_hash = { - left: 'right', - right: 'left', - bottom: 'top', - top: 'bottom' -}; -function getOppositePlacement_getOppositePlacement(placement) { - return placement.replace(/left|right|bottom|top/g, function (matched) { - return getOppositePlacement_hash[matched]; - }); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js -var getOppositeVariationPlacement_hash = { - start: 'end', - end: 'start' -}; -function getOppositeVariationPlacement(placement) { - return placement.replace(/start|end/g, function (matched) { - return getOppositeVariationPlacement_hash[matched]; - }); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js - - - - -function getViewportRect_getViewportRect(element, strategy) { - var win = getWindow_getWindow(element); - var html = getDocumentElement_getDocumentElement(element); - var visualViewport = win.visualViewport; - var width = html.clientWidth; - var height = html.clientHeight; - var x = 0; - var y = 0; - - if (visualViewport) { - width = visualViewport.width; - height = visualViewport.height; - var layoutViewport = isLayoutViewport(); - - if (layoutViewport || !layoutViewport && strategy === 'fixed') { - x = visualViewport.offsetLeft; - y = visualViewport.offsetTop; - } - } - - return { - width: width, - height: height, - x: x + getWindowScrollBarX_getWindowScrollBarX(element), - y: y - }; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js - - - - - // Gets the entire size of the scrollable document area, even extending outside -// of the `<html>` and `<body>` rect bounds if horizontally scrollable - -function getDocumentRect_getDocumentRect(element) { - var _element$ownerDocumen; - - var html = getDocumentElement_getDocumentElement(element); - var winScroll = getWindowScroll(element); - var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; - var width = math_max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); - var height = math_max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); - var x = -winScroll.scrollLeft + getWindowScrollBarX_getWindowScrollBarX(element); - var y = -winScroll.scrollTop; - - if (getComputedStyle_getComputedStyle(body || html).direction === 'rtl') { - x += math_max(html.clientWidth, body ? body.clientWidth : 0) - width; - } - - return { - width: width, - height: height, - x: x, - y: y - }; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/contains.js - -function contains_contains(parent, child) { - var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method - - if (parent.contains(child)) { - return true; - } // then fallback to custom implementation with Shadow DOM support - else if (rootNode && instanceOf_isShadowRoot(rootNode)) { - var next = child; - - do { - if (next && parent.isSameNode(next)) { - return true; - } // $FlowFixMe[prop-missing]: need a better way to handle this... - - - next = next.parentNode || next.host; - } while (next); - } // Give up, the result is false - - - return false; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/rectToClientRect.js -function rectToClientRect_rectToClientRect(rect) { - return Object.assign({}, rect, { - left: rect.x, - top: rect.y, - right: rect.x + rect.width, - bottom: rect.y + rect.height - }); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js - - - - - - - - - - - - - - - -function getClippingRect_getInnerBoundingClientRect(element, strategy) { - var rect = getBoundingClientRect_getBoundingClientRect(element, false, strategy === 'fixed'); - rect.top = rect.top + element.clientTop; - rect.left = rect.left + element.clientLeft; - rect.bottom = rect.top + element.clientHeight; - rect.right = rect.left + element.clientWidth; - rect.width = element.clientWidth; - rect.height = element.clientHeight; - rect.x = rect.left; - rect.y = rect.top; - return rect; -} - -function getClientRectFromMixedType(element, clippingParent, strategy) { - return clippingParent === viewport ? rectToClientRect_rectToClientRect(getViewportRect_getViewportRect(element, strategy)) : instanceOf_isElement(clippingParent) ? getClippingRect_getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect_rectToClientRect(getDocumentRect_getDocumentRect(getDocumentElement_getDocumentElement(element))); -} // A "clipping parent" is an overflowable container with the characteristic of -// clipping (or hiding) overflowing elements with a position different from -// `initial` - - -function getClippingParents(element) { - var clippingParents = listScrollParents(getParentNode_getParentNode(element)); - var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle_getComputedStyle(element).position) >= 0; - var clipperElement = canEscapeClipping && instanceOf_isHTMLElement(element) ? getOffsetParent_getOffsetParent(element) : element; - - if (!instanceOf_isElement(clipperElement)) { - return []; - } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414 - - - return clippingParents.filter(function (clippingParent) { - return instanceOf_isElement(clippingParent) && contains_contains(clippingParent, clipperElement) && getNodeName_getNodeName(clippingParent) !== 'body'; - }); -} // Gets the maximum area that the element is visible in due to any number of -// clipping parents - - -function getClippingRect_getClippingRect(element, boundary, rootBoundary, strategy) { - var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary); - var clippingParents = [].concat(mainClippingParents, [rootBoundary]); - var firstClippingParent = clippingParents[0]; - var clippingRect = clippingParents.reduce(function (accRect, clippingParent) { - var rect = getClientRectFromMixedType(element, clippingParent, strategy); - accRect.top = math_max(rect.top, accRect.top); - accRect.right = math_min(rect.right, accRect.right); - accRect.bottom = math_min(rect.bottom, accRect.bottom); - accRect.left = math_max(rect.left, accRect.left); - return accRect; - }, getClientRectFromMixedType(element, firstClippingParent, strategy)); - clippingRect.width = clippingRect.right - clippingRect.left; - clippingRect.height = clippingRect.bottom - clippingRect.top; - clippingRect.x = clippingRect.left; - clippingRect.y = clippingRect.top; - return clippingRect; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js -function getFreshSideObject() { - return { - top: 0, - right: 0, - bottom: 0, - left: 0 - }; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js - -function mergePaddingObject(paddingObject) { - return Object.assign({}, getFreshSideObject(), paddingObject); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/expandToHashMap.js -function expandToHashMap(value, keys) { - return keys.reduce(function (hashMap, key) { - hashMap[key] = value; - return hashMap; - }, {}); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/detectOverflow.js - - - - - - - - - // eslint-disable-next-line import/no-unused-modules - -function detectOverflow_detectOverflow(state, options) { - if (options === void 0) { - options = {}; - } - - var _options = options, - _options$placement = _options.placement, - placement = _options$placement === void 0 ? state.placement : _options$placement, - _options$strategy = _options.strategy, - strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, - _options$boundary = _options.boundary, - boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, - _options$rootBoundary = _options.rootBoundary, - rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, - _options$elementConte = _options.elementContext, - elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, - _options$altBoundary = _options.altBoundary, - altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, - _options$padding = _options.padding, - padding = _options$padding === void 0 ? 0 : _options$padding; - var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); - var altContext = elementContext === popper ? reference : popper; - var popperRect = state.rects.popper; - var element = state.elements[altBoundary ? altContext : elementContext]; - var clippingClientRect = getClippingRect_getClippingRect(instanceOf_isElement(element) ? element : element.contextElement || getDocumentElement_getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy); - var referenceClientRect = getBoundingClientRect_getBoundingClientRect(state.elements.reference); - var popperOffsets = computeOffsets({ - reference: referenceClientRect, - element: popperRect, - strategy: 'absolute', - placement: placement - }); - var popperClientRect = rectToClientRect_rectToClientRect(Object.assign({}, popperRect, popperOffsets)); - var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect - // 0 or negative = within the clipping rect - - var overflowOffsets = { - top: clippingClientRect.top - elementClientRect.top + paddingObject.top, - bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, - left: clippingClientRect.left - elementClientRect.left + paddingObject.left, - right: elementClientRect.right - clippingClientRect.right + paddingObject.right - }; - var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element - - if (elementContext === popper && offsetData) { - var offset = offsetData[placement]; - Object.keys(overflowOffsets).forEach(function (key) { - var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; - var axis = [enums_top, bottom].indexOf(key) >= 0 ? 'y' : 'x'; - overflowOffsets[key] += offset[axis] * multiply; - }); - } - - return overflowOffsets; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js - - - - -function computeAutoPlacement(state, options) { - if (options === void 0) { - options = {}; - } - - var _options = options, - placement = _options.placement, - boundary = _options.boundary, - rootBoundary = _options.rootBoundary, - padding = _options.padding, - flipVariations = _options.flipVariations, - _options$allowedAutoP = _options.allowedAutoPlacements, - allowedAutoPlacements = _options$allowedAutoP === void 0 ? enums_placements : _options$allowedAutoP; - var variation = getVariation(placement); - var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) { - return getVariation(placement) === variation; - }) : basePlacements; - var allowedPlacements = placements.filter(function (placement) { - return allowedAutoPlacements.indexOf(placement) >= 0; - }); - - if (allowedPlacements.length === 0) { - allowedPlacements = placements; - - if (false) {} - } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions... - - - var overflows = allowedPlacements.reduce(function (acc, placement) { - acc[placement] = detectOverflow_detectOverflow(state, { - placement: placement, - boundary: boundary, - rootBoundary: rootBoundary, - padding: padding - })[getBasePlacement(placement)]; - return acc; - }, {}); - return Object.keys(overflows).sort(function (a, b) { - return overflows[a] - overflows[b]; - }); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/flip.js - - - - - - - // eslint-disable-next-line import/no-unused-modules - -function getExpandedFallbackPlacements(placement) { - if (getBasePlacement(placement) === enums_auto) { - return []; - } - - var oppositePlacement = getOppositePlacement_getOppositePlacement(placement); - return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)]; -} - -function flip(_ref) { - var state = _ref.state, - options = _ref.options, - name = _ref.name; - - if (state.modifiersData[name]._skip) { - return; - } - - var _options$mainAxis = options.mainAxis, - checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, - _options$altAxis = options.altAxis, - checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, - specifiedFallbackPlacements = options.fallbackPlacements, - padding = options.padding, - boundary = options.boundary, - rootBoundary = options.rootBoundary, - altBoundary = options.altBoundary, - _options$flipVariatio = options.flipVariations, - flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, - allowedAutoPlacements = options.allowedAutoPlacements; - var preferredPlacement = state.options.placement; - var basePlacement = getBasePlacement(preferredPlacement); - var isBasePlacement = basePlacement === preferredPlacement; - var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement_getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement)); - var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) { - return acc.concat(getBasePlacement(placement) === enums_auto ? computeAutoPlacement(state, { - placement: placement, - boundary: boundary, - rootBoundary: rootBoundary, - padding: padding, - flipVariations: flipVariations, - allowedAutoPlacements: allowedAutoPlacements - }) : placement); - }, []); - var referenceRect = state.rects.reference; - var popperRect = state.rects.popper; - var checksMap = new Map(); - var makeFallbackChecks = true; - var firstFittingPlacement = placements[0]; - - for (var i = 0; i < placements.length; i++) { - var placement = placements[i]; - - var _basePlacement = getBasePlacement(placement); - - var isStartVariation = getVariation(placement) === start; - var isVertical = [enums_top, bottom].indexOf(_basePlacement) >= 0; - var len = isVertical ? 'width' : 'height'; - var overflow = detectOverflow_detectOverflow(state, { - placement: placement, - boundary: boundary, - rootBoundary: rootBoundary, - altBoundary: altBoundary, - padding: padding - }); - var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : enums_top; - - if (referenceRect[len] > popperRect[len]) { - mainVariationSide = getOppositePlacement_getOppositePlacement(mainVariationSide); - } - - var altVariationSide = getOppositePlacement_getOppositePlacement(mainVariationSide); - var checks = []; - - if (checkMainAxis) { - checks.push(overflow[_basePlacement] <= 0); - } - - if (checkAltAxis) { - checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0); - } - - if (checks.every(function (check) { - return check; - })) { - firstFittingPlacement = placement; - makeFallbackChecks = false; - break; - } - - checksMap.set(placement, checks); - } - - if (makeFallbackChecks) { - // `2` may be desired in some cases – research later - var numberOfChecks = flipVariations ? 3 : 1; - - var _loop = function _loop(_i) { - var fittingPlacement = placements.find(function (placement) { - var checks = checksMap.get(placement); - - if (checks) { - return checks.slice(0, _i).every(function (check) { - return check; - }); - } - }); - - if (fittingPlacement) { - firstFittingPlacement = fittingPlacement; - return "break"; - } - }; - - for (var _i = numberOfChecks; _i > 0; _i--) { - var _ret = _loop(_i); - - if (_ret === "break") break; - } - } - - if (state.placement !== firstFittingPlacement) { - state.modifiersData[name]._skip = true; - state.placement = firstFittingPlacement; - state.reset = true; - } -} // eslint-disable-next-line import/no-unused-modules - - -/* harmony default export */ var modifiers_flip = ({ - name: 'flip', - enabled: true, - phase: 'main', - fn: flip, - requiresIfExists: ['offset'], - data: { - _skip: false - } -}); -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getAltAxis.js -function getAltAxis(axis) { - return axis === 'x' ? 'y' : 'x'; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/within.js - -function within(min, value, max) { - return math_max(min, math_min(value, max)); -} -function withinMaxClamp(min, value, max) { - var v = within(min, value, max); - return v > max ? max : v; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js - - - - - - - - - - - - -function preventOverflow(_ref) { - var state = _ref.state, - options = _ref.options, - name = _ref.name; - var _options$mainAxis = options.mainAxis, - checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, - _options$altAxis = options.altAxis, - checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, - boundary = options.boundary, - rootBoundary = options.rootBoundary, - altBoundary = options.altBoundary, - padding = options.padding, - _options$tether = options.tether, - tether = _options$tether === void 0 ? true : _options$tether, - _options$tetherOffset = options.tetherOffset, - tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; - var overflow = detectOverflow_detectOverflow(state, { - boundary: boundary, - rootBoundary: rootBoundary, - padding: padding, - altBoundary: altBoundary - }); - var basePlacement = getBasePlacement(state.placement); - var variation = getVariation(state.placement); - var isBasePlacement = !variation; - var mainAxis = getMainAxisFromPlacement(basePlacement); - var altAxis = getAltAxis(mainAxis); - var popperOffsets = state.modifiersData.popperOffsets; - var referenceRect = state.rects.reference; - var popperRect = state.rects.popper; - var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, { - placement: state.placement - })) : tetherOffset; - var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? { - mainAxis: tetherOffsetValue, - altAxis: tetherOffsetValue - } : Object.assign({ - mainAxis: 0, - altAxis: 0 - }, tetherOffsetValue); - var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null; - var data = { - x: 0, - y: 0 - }; - - if (!popperOffsets) { - return; - } - - if (checkMainAxis) { - var _offsetModifierState$; - - var mainSide = mainAxis === 'y' ? enums_top : left; - var altSide = mainAxis === 'y' ? bottom : right; - var len = mainAxis === 'y' ? 'height' : 'width'; - var offset = popperOffsets[mainAxis]; - var min = offset + overflow[mainSide]; - var max = offset - overflow[altSide]; - var additive = tether ? -popperRect[len] / 2 : 0; - var minLen = variation === start ? referenceRect[len] : popperRect[len]; - var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go - // outside the reference bounds - - var arrowElement = state.elements.arrow; - var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { - width: 0, - height: 0 - }; - var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject(); - var arrowPaddingMin = arrowPaddingObject[mainSide]; - var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want - // to include its full size in the calculation. If the reference is small - // and near the edge of a boundary, the popper can overflow even if the - // reference is not overflowing as well (e.g. virtual elements with no - // width or height) - - var arrowLen = within(0, referenceRect[len], arrowRect[len]); - var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis; - var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis; - var arrowOffsetParent = state.elements.arrow && getOffsetParent_getOffsetParent(state.elements.arrow); - var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; - var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0; - var tetherMin = offset + minOffset - offsetModifierValue - clientOffset; - var tetherMax = offset + maxOffset - offsetModifierValue; - var preventedOffset = within(tether ? math_min(min, tetherMin) : min, offset, tether ? math_max(max, tetherMax) : max); - popperOffsets[mainAxis] = preventedOffset; - data[mainAxis] = preventedOffset - offset; - } - - if (checkAltAxis) { - var _offsetModifierState$2; - - var _mainSide = mainAxis === 'x' ? enums_top : left; - - var _altSide = mainAxis === 'x' ? bottom : right; - - var _offset = popperOffsets[altAxis]; - - var _len = altAxis === 'y' ? 'height' : 'width'; - - var _min = _offset + overflow[_mainSide]; - - var _max = _offset - overflow[_altSide]; - - var isOriginSide = [enums_top, left].indexOf(basePlacement) !== -1; - - var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0; - - var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis; - - var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max; - - var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max); - - popperOffsets[altAxis] = _preventedOffset; - data[altAxis] = _preventedOffset - _offset; - } - - state.modifiersData[name] = data; -} // eslint-disable-next-line import/no-unused-modules - - -/* harmony default export */ var modifiers_preventOverflow = ({ - name: 'preventOverflow', - enabled: true, - phase: 'main', - fn: preventOverflow, - requiresIfExists: ['offset'] -}); -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/arrow.js - - - - - - - - - - // eslint-disable-next-line import/no-unused-modules - -var toPaddingObject = function toPaddingObject(padding, state) { - padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, { - placement: state.placement - })) : padding; - return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); -}; - -function arrow_arrow(_ref) { - var _state$modifiersData$; - - var state = _ref.state, - name = _ref.name, - options = _ref.options; - var arrowElement = state.elements.arrow; - var popperOffsets = state.modifiersData.popperOffsets; - var basePlacement = getBasePlacement(state.placement); - var axis = getMainAxisFromPlacement(basePlacement); - var isVertical = [left, right].indexOf(basePlacement) >= 0; - var len = isVertical ? 'height' : 'width'; - - if (!arrowElement || !popperOffsets) { - return; - } - - var paddingObject = toPaddingObject(options.padding, state); - var arrowRect = getLayoutRect(arrowElement); - var minProp = axis === 'y' ? enums_top : left; - var maxProp = axis === 'y' ? bottom : right; - var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len]; - var startDiff = popperOffsets[axis] - state.rects.reference[axis]; - var arrowOffsetParent = getOffsetParent_getOffsetParent(arrowElement); - var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0; - var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is - // outside of the popper bounds - - var min = paddingObject[minProp]; - var max = clientSize - arrowRect[len] - paddingObject[maxProp]; - var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference; - var offset = within(min, center, max); // Prevents breaking syntax highlighting... - - var axisProp = axis; - state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$); -} - -function arrow_effect(_ref2) { - var state = _ref2.state, - options = _ref2.options; - var _options$element = options.element, - arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element; - - if (arrowElement == null) { - return; - } // CSS selector - - - if (typeof arrowElement === 'string') { - arrowElement = state.elements.popper.querySelector(arrowElement); - - if (!arrowElement) { - return; - } - } - - if (false) {} - - if (!contains_contains(state.elements.popper, arrowElement)) { - if (false) {} - - return; - } - - state.elements.arrow = arrowElement; -} // eslint-disable-next-line import/no-unused-modules - - -/* harmony default export */ var modifiers_arrow = ({ - name: 'arrow', - enabled: true, - phase: 'main', - fn: arrow_arrow, - effect: arrow_effect, - requires: ['popperOffsets'], - requiresIfExists: ['preventOverflow'] -}); -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/hide.js - - - -function hide_getSideOffsets(overflow, rect, preventedOffsets) { - if (preventedOffsets === void 0) { - preventedOffsets = { - x: 0, - y: 0 - }; - } - - return { - top: overflow.top - rect.height - preventedOffsets.y, - right: overflow.right - rect.width + preventedOffsets.x, - bottom: overflow.bottom - rect.height + preventedOffsets.y, - left: overflow.left - rect.width - preventedOffsets.x - }; -} - -function hide_isAnySideFullyClipped(overflow) { - return [enums_top, right, bottom, left].some(function (side) { - return overflow[side] >= 0; - }); -} - -function hide_hide(_ref) { - var state = _ref.state, - name = _ref.name; - var referenceRect = state.rects.reference; - var popperRect = state.rects.popper; - var preventedOffsets = state.modifiersData.preventOverflow; - var referenceOverflow = detectOverflow_detectOverflow(state, { - elementContext: 'reference' - }); - var popperAltOverflow = detectOverflow_detectOverflow(state, { - altBoundary: true - }); - var referenceClippingOffsets = hide_getSideOffsets(referenceOverflow, referenceRect); - var popperEscapeOffsets = hide_getSideOffsets(popperAltOverflow, popperRect, preventedOffsets); - var isReferenceHidden = hide_isAnySideFullyClipped(referenceClippingOffsets); - var hasPopperEscaped = hide_isAnySideFullyClipped(popperEscapeOffsets); - state.modifiersData[name] = { - referenceClippingOffsets: referenceClippingOffsets, - popperEscapeOffsets: popperEscapeOffsets, - isReferenceHidden: isReferenceHidden, - hasPopperEscaped: hasPopperEscaped - }; - state.attributes.popper = Object.assign({}, state.attributes.popper, { - 'data-popper-reference-hidden': isReferenceHidden, - 'data-popper-escaped': hasPopperEscaped - }); -} // eslint-disable-next-line import/no-unused-modules - - -/* harmony default export */ var modifiers_hide = ({ - name: 'hide', - enabled: true, - phase: 'main', - requiresIfExists: ['preventOverflow'], - fn: hide_hide -}); -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/popper.js - - - - - - - - - - -var defaultModifiers = [eventListeners, modifiers_popperOffsets, modifiers_computeStyles, modifiers_applyStyles, modifiers_offset, modifiers_flip, modifiers_preventOverflow, modifiers_arrow, modifiers_hide]; -var popper_createPopper = /*#__PURE__*/popperGenerator({ - defaultModifiers: defaultModifiers -}); // eslint-disable-next-line import/no-unused-modules - - // eslint-disable-next-line import/no-unused-modules - - // eslint-disable-next-line import/no-unused-modules - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/Disclosure/DisclosureState.js - - - - - - - - -function useLastValue(value) { - var lastValue = (0,external_React_.useRef)(null); - useIsomorphicEffect(function () { - lastValue.current = value; - }, [value]); - return lastValue; -} - -function useDisclosureState(initialState) { - if (initialState === void 0) { - initialState = {}; - } - - var _useSealedState = useSealedState(initialState), - _useSealedState$visib = _useSealedState.visible, - initialVisible = _useSealedState$visib === void 0 ? false : _useSealedState$visib, - _useSealedState$anima = _useSealedState.animated, - initialAnimated = _useSealedState$anima === void 0 ? false : _useSealedState$anima, - sealed = _objectWithoutPropertiesLoose(_useSealedState, ["visible", "animated"]); - - var id = unstable_useIdState(sealed); - - var _React$useState = (0,external_React_.useState)(initialVisible), - visible = _React$useState[0], - setVisible = _React$useState[1]; - - var _React$useState2 = (0,external_React_.useState)(initialAnimated), - animated = _React$useState2[0], - setAnimated = _React$useState2[1]; - - var _React$useState3 = (0,external_React_.useState)(false), - animating = _React$useState3[0], - setAnimating = _React$useState3[1]; - - var lastVisible = useLastValue(visible); - var visibleHasChanged = lastVisible.current != null && lastVisible.current !== visible; - - if (animated && !animating && visibleHasChanged) { - // Sets animating to true when when visible is updated - setAnimating(true); - } - - (0,external_React_.useEffect)(function () { - if (typeof animated === "number" && animating) { - var timeout = setTimeout(function () { - return setAnimating(false); - }, animated); - return function () { - clearTimeout(timeout); - }; - } - - if (animated && animating && "production" === "development") { var _timeout; } - - return function () {}; - }, [animated, animating]); - var show = (0,external_React_.useCallback)(function () { - return setVisible(true); - }, []); - var hide = (0,external_React_.useCallback)(function () { - return setVisible(false); - }, []); - var toggle = (0,external_React_.useCallback)(function () { - return setVisible(function (v) { - return !v; - }); - }, []); - var stopAnimation = (0,external_React_.useCallback)(function () { - return setAnimating(false); - }, []); - return _objectSpread2(_objectSpread2({}, id), {}, { - visible: visible, - animated: animated, - animating: animating, - show: show, - hide: hide, - toggle: toggle, - setVisible: setVisible, - setAnimated: setAnimated, - stopAnimation: stopAnimation - }); -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/Dialog/DialogState.js - - - - - - - - - -function useDialogState(initialState) { - if (initialState === void 0) { - initialState = {}; - } - - var _useSealedState = useSealedState(initialState), - _useSealedState$modal = _useSealedState.modal, - initialModal = _useSealedState$modal === void 0 ? true : _useSealedState$modal, - sealed = _objectWithoutPropertiesLoose(_useSealedState, ["modal"]); - - var disclosure = useDisclosureState(sealed); - - var _React$useState = (0,external_React_.useState)(initialModal), - modal = _React$useState[0], - setModal = _React$useState[1]; - - var disclosureRef = (0,external_React_.useRef)(null); - return _objectSpread2(_objectSpread2({}, disclosure), {}, { - modal: modal, - setModal: setModal, - unstable_disclosureRef: disclosureRef - }); -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/Popover/PopoverState.js - - - - - - - - - - - - - -var PopoverState_isSafari = isUA("Mac") && !isUA("Chrome") && isUA("Safari"); - -function PopoverState_applyStyles(styles) { - return function (prevStyles) { - if (styles && !shallowEqual(prevStyles, styles)) { - return styles; - } - - return prevStyles; - }; -} - -function usePopoverState(initialState) { - if (initialState === void 0) { - initialState = {}; - } - - var _useSealedState = useSealedState(initialState), - _useSealedState$gutte = _useSealedState.gutter, - gutter = _useSealedState$gutte === void 0 ? 12 : _useSealedState$gutte, - _useSealedState$place = _useSealedState.placement, - sealedPlacement = _useSealedState$place === void 0 ? "bottom" : _useSealedState$place, - _useSealedState$unsta = _useSealedState.unstable_flip, - flip = _useSealedState$unsta === void 0 ? true : _useSealedState$unsta, - sealedOffset = _useSealedState.unstable_offset, - _useSealedState$unsta2 = _useSealedState.unstable_preventOverflow, - preventOverflow = _useSealedState$unsta2 === void 0 ? true : _useSealedState$unsta2, - _useSealedState$unsta3 = _useSealedState.unstable_fixed, - fixed = _useSealedState$unsta3 === void 0 ? false : _useSealedState$unsta3, - _useSealedState$modal = _useSealedState.modal, - modal = _useSealedState$modal === void 0 ? false : _useSealedState$modal, - sealed = _objectWithoutPropertiesLoose(_useSealedState, ["gutter", "placement", "unstable_flip", "unstable_offset", "unstable_preventOverflow", "unstable_fixed", "modal"]); - - var popper = (0,external_React_.useRef)(null); - var referenceRef = (0,external_React_.useRef)(null); - var popoverRef = (0,external_React_.useRef)(null); - var arrowRef = (0,external_React_.useRef)(null); - - var _React$useState = (0,external_React_.useState)(sealedPlacement), - originalPlacement = _React$useState[0], - place = _React$useState[1]; - - var _React$useState2 = (0,external_React_.useState)(sealedPlacement), - placement = _React$useState2[0], - setPlacement = _React$useState2[1]; - - var _React$useState3 = (0,external_React_.useState)(sealedOffset || [0, gutter]), - offset = _React$useState3[0]; - - var _React$useState4 = (0,external_React_.useState)({ - position: "fixed", - left: "100%", - top: "100%" - }), - popoverStyles = _React$useState4[0], - setPopoverStyles = _React$useState4[1]; - - var _React$useState5 = (0,external_React_.useState)({}), - arrowStyles = _React$useState5[0], - setArrowStyles = _React$useState5[1]; - - var dialog = useDialogState(_objectSpread2({ - modal: modal - }, sealed)); - var update = (0,external_React_.useCallback)(function () { - if (popper.current) { - popper.current.forceUpdate(); - return true; - } - - return false; - }, []); - var updateState = (0,external_React_.useCallback)(function (state) { - if (state.placement) { - setPlacement(state.placement); - } - - if (state.styles) { - setPopoverStyles(PopoverState_applyStyles(state.styles.popper)); - - if (arrowRef.current) { - setArrowStyles(PopoverState_applyStyles(state.styles.arrow)); - } - } - }, []); - useIsomorphicEffect(function () { - if (referenceRef.current && popoverRef.current) { - popper.current = popper_createPopper(referenceRef.current, popoverRef.current, { - // https://popper.js.org/docs/v2/constructors/#options - placement: originalPlacement, - strategy: fixed ? "fixed" : "absolute", - // Safari needs styles to be applied in the first render, otherwise - // hovering over the popover when it gets visible for the first time - // will change its dimensions unexpectedly. - onFirstUpdate: PopoverState_isSafari ? updateState : undefined, - modifiers: [{ - // https://popper.js.org/docs/v2/modifiers/event-listeners/ - name: "eventListeners", - enabled: dialog.visible - }, { - // https://popper.js.org/docs/v2/modifiers/apply-styles/ - name: "applyStyles", - enabled: false - }, { - // https://popper.js.org/docs/v2/modifiers/flip/ - name: "flip", - enabled: flip, - options: { - padding: 8 - } - }, { - // https://popper.js.org/docs/v2/modifiers/offset/ - name: "offset", - options: { - offset: offset - } - }, { - // https://popper.js.org/docs/v2/modifiers/prevent-overflow/ - name: "preventOverflow", - enabled: preventOverflow, - options: { - tetherOffset: function tetherOffset() { - var _arrowRef$current; - - return ((_arrowRef$current = arrowRef.current) === null || _arrowRef$current === void 0 ? void 0 : _arrowRef$current.clientWidth) || 0; - } - } - }, { - // https://popper.js.org/docs/v2/modifiers/arrow/ - name: "arrow", - enabled: !!arrowRef.current, - options: { - element: arrowRef.current - } - }, { - // https://popper.js.org/docs/v2/modifiers/#custom-modifiers - name: "updateState", - phase: "write", - requires: ["computeStyles"], - enabled: dialog.visible && "production" !== "test", - fn: function fn(_ref) { - var state = _ref.state; - return updateState(state); - } - }] - }); - } - - return function () { - if (popper.current) { - popper.current.destroy(); - popper.current = null; - } - }; - }, [originalPlacement, fixed, dialog.visible, flip, offset, preventOverflow]); // Ensure that the popover will be correctly positioned with an additional - // update. - - (0,external_React_.useEffect)(function () { - if (!dialog.visible) return undefined; - var id = window.requestAnimationFrame(function () { - var _popper$current; - - (_popper$current = popper.current) === null || _popper$current === void 0 ? void 0 : _popper$current.forceUpdate(); - }); - return function () { - window.cancelAnimationFrame(id); - }; - }, [dialog.visible]); - return _objectSpread2(_objectSpread2({}, dialog), {}, { - unstable_referenceRef: referenceRef, - unstable_popoverRef: popoverRef, - unstable_arrowRef: arrowRef, - unstable_popoverStyles: popoverStyles, - unstable_arrowStyles: arrowStyles, - unstable_update: update, - unstable_originalPlacement: originalPlacement, - placement: placement, - place: place - }); -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/__globalState-300469f0.js -var globalState = { - currentTooltipId: null, - listeners: new Set(), - subscribe: function subscribe(listener) { - var _this = this; - - this.listeners.add(listener); - return function () { - _this.listeners.delete(listener); - }; - }, - show: function show(id) { - this.currentTooltipId = id; - this.listeners.forEach(function (listener) { - return listener(id); - }); - }, - hide: function hide(id) { - if (this.currentTooltipId === id) { - this.currentTooltipId = null; - this.listeners.forEach(function (listener) { - return listener(null); - }); - } - } -}; - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/Tooltip/TooltipState.js - - - - - - - - - - - - - - - -function useTooltipState(initialState) { - if (initialState === void 0) { - initialState = {}; - } - - var _useSealedState = useSealedState(initialState), - _useSealedState$place = _useSealedState.placement, - placement = _useSealedState$place === void 0 ? "top" : _useSealedState$place, - _useSealedState$unsta = _useSealedState.unstable_timeout, - initialTimeout = _useSealedState$unsta === void 0 ? 0 : _useSealedState$unsta, - sealed = _objectWithoutPropertiesLoose(_useSealedState, ["placement", "unstable_timeout"]); - - var _React$useState = (0,external_React_.useState)(initialTimeout), - timeout = _React$useState[0], - setTimeout = _React$useState[1]; - - var showTimeout = (0,external_React_.useRef)(null); - var hideTimeout = (0,external_React_.useRef)(null); - - var _usePopoverState = usePopoverState(_objectSpread2(_objectSpread2({}, sealed), {}, { - placement: placement - })), - modal = _usePopoverState.modal, - setModal = _usePopoverState.setModal, - popover = _objectWithoutPropertiesLoose(_usePopoverState, ["modal", "setModal"]); - - var clearTimeouts = (0,external_React_.useCallback)(function () { - if (showTimeout.current !== null) { - window.clearTimeout(showTimeout.current); - } - - if (hideTimeout.current !== null) { - window.clearTimeout(hideTimeout.current); - } - }, []); - var hide = (0,external_React_.useCallback)(function () { - clearTimeouts(); - popover.hide(); // Let's give some time so people can move from a reference to another - // and still show tooltips immediately - - hideTimeout.current = window.setTimeout(function () { - globalState.hide(popover.baseId); - }, timeout); - }, [clearTimeouts, popover.hide, timeout, popover.baseId]); - var show = (0,external_React_.useCallback)(function () { - clearTimeouts(); - - if (!timeout || globalState.currentTooltipId) { - // If there's no timeout or a tooltip visible already, we can show this - // immediately - globalState.show(popover.baseId); - popover.show(); - } else { - // There may be a reference with focus whose tooltip is still not visible - // In this case, we want to update it before it gets shown. - globalState.show(null); // Otherwise, wait a little bit to show the tooltip - - showTimeout.current = window.setTimeout(function () { - globalState.show(popover.baseId); - popover.show(); - }, timeout); - } - }, [clearTimeouts, timeout, popover.show, popover.baseId]); - (0,external_React_.useEffect)(function () { - return globalState.subscribe(function (id) { - if (id !== popover.baseId) { - clearTimeouts(); - - if (popover.visible) { - // Make sure there will be only one tooltip visible - popover.hide(); - } - } - }); - }, [popover.baseId, clearTimeouts, popover.visible, popover.hide]); - (0,external_React_.useEffect)(function () { - return function () { - clearTimeouts(); - globalState.hide(popover.baseId); - }; - }, [clearTimeouts, popover.baseId]); - return _objectSpread2(_objectSpread2({}, popover), {}, { - hide: hide, - show: show, - unstable_timeout: timeout, - unstable_setTimeout: setTimeout - }); -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/__keys-d101cb3b.js -// Automatically generated -var TOOLTIP_STATE_KEYS = ["baseId", "unstable_idCountRef", "visible", "animated", "animating", "setBaseId", "show", "hide", "toggle", "setVisible", "setAnimated", "stopAnimation", "unstable_disclosureRef", "unstable_referenceRef", "unstable_popoverRef", "unstable_arrowRef", "unstable_popoverStyles", "unstable_arrowStyles", "unstable_originalPlacement", "unstable_update", "placement", "place", "unstable_timeout", "unstable_setTimeout"]; -var TOOLTIP_KEYS = [].concat(TOOLTIP_STATE_KEYS, ["unstable_portal"]); -var TOOLTIP_ARROW_KEYS = TOOLTIP_STATE_KEYS; -var TOOLTIP_REFERENCE_KEYS = TOOLTIP_ARROW_KEYS; - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/Tooltip/TooltipReference.js - - - - - - - - - - -var useTooltipReference = createHook({ - name: "TooltipReference", - compose: useRole, - keys: TOOLTIP_REFERENCE_KEYS, - useProps: function useProps(options, _ref) { - var htmlRef = _ref.ref, - htmlOnFocus = _ref.onFocus, - htmlOnBlur = _ref.onBlur, - htmlOnMouseEnter = _ref.onMouseEnter, - htmlOnMouseLeave = _ref.onMouseLeave, - htmlProps = _objectWithoutPropertiesLoose(_ref, ["ref", "onFocus", "onBlur", "onMouseEnter", "onMouseLeave"]); - - var onFocusRef = useLiveRef(htmlOnFocus); - var onBlurRef = useLiveRef(htmlOnBlur); - var onMouseEnterRef = useLiveRef(htmlOnMouseEnter); - var onMouseLeaveRef = useLiveRef(htmlOnMouseLeave); - var onFocus = (0,external_React_.useCallback)(function (event) { - var _onFocusRef$current, _options$show; - - (_onFocusRef$current = onFocusRef.current) === null || _onFocusRef$current === void 0 ? void 0 : _onFocusRef$current.call(onFocusRef, event); - if (event.defaultPrevented) return; - (_options$show = options.show) === null || _options$show === void 0 ? void 0 : _options$show.call(options); - }, [options.show]); - var onBlur = (0,external_React_.useCallback)(function (event) { - var _onBlurRef$current, _options$hide; - - (_onBlurRef$current = onBlurRef.current) === null || _onBlurRef$current === void 0 ? void 0 : _onBlurRef$current.call(onBlurRef, event); - if (event.defaultPrevented) return; - (_options$hide = options.hide) === null || _options$hide === void 0 ? void 0 : _options$hide.call(options); - }, [options.hide]); - var onMouseEnter = (0,external_React_.useCallback)(function (event) { - var _onMouseEnterRef$curr, _options$show2; - - (_onMouseEnterRef$curr = onMouseEnterRef.current) === null || _onMouseEnterRef$curr === void 0 ? void 0 : _onMouseEnterRef$curr.call(onMouseEnterRef, event); - if (event.defaultPrevented) return; - (_options$show2 = options.show) === null || _options$show2 === void 0 ? void 0 : _options$show2.call(options); - }, [options.show]); - var onMouseLeave = (0,external_React_.useCallback)(function (event) { - var _onMouseLeaveRef$curr, _options$hide2; - - (_onMouseLeaveRef$curr = onMouseLeaveRef.current) === null || _onMouseLeaveRef$curr === void 0 ? void 0 : _onMouseLeaveRef$curr.call(onMouseLeaveRef, event); - if (event.defaultPrevented) return; - (_options$hide2 = options.hide) === null || _options$hide2 === void 0 ? void 0 : _options$hide2.call(options); - }, [options.hide]); - return _objectSpread2({ - ref: useForkRef(options.unstable_referenceRef, htmlRef), - tabIndex: 0, - onFocus: onFocus, - onBlur: onBlur, - onMouseEnter: onMouseEnter, - onMouseLeave: onMouseLeave, - "aria-describedby": options.baseId - }, htmlProps); - } -}); -var TooltipReference = createComponent({ - as: "div", - useHook: useTooltipReference -}); - - - -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/tooltip/context.js -/** - * WordPress dependencies - */ - - -/** - * @type {import('react').Context<{ tooltip?: import('reakit').TooltipState }>} - */ -const context_TooltipContext = (0,external_wp_element_namespaceObject.createContext)({}); -const useTooltipContext = () => (0,external_wp_element_namespaceObject.useContext)(context_TooltipContext); - -;// CONCATENATED MODULE: ./node_modules/reakit/es/__keys-e6a5cfbe.js -// Automatically generated -var DISCLOSURE_STATE_KEYS = ["baseId", "unstable_idCountRef", "visible", "animated", "animating", "setBaseId", "show", "hide", "toggle", "setVisible", "setAnimated", "stopAnimation"]; -var DISCLOSURE_KEYS = DISCLOSURE_STATE_KEYS; -var DISCLOSURE_CONTENT_KEYS = DISCLOSURE_KEYS; - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/Disclosure/DisclosureContent.js - - - - - - - - - - -var DisclosureContent_useDisclosureContent = createHook({ - name: "DisclosureContent", - compose: useRole, - keys: DISCLOSURE_CONTENT_KEYS, - useProps: function useProps(options, _ref) { - var htmlOnTransitionEnd = _ref.onTransitionEnd, - htmlOnAnimationEnd = _ref.onAnimationEnd, - htmlStyle = _ref.style, - htmlProps = _objectWithoutPropertiesLoose(_ref, ["onTransitionEnd", "onAnimationEnd", "style"]); - - var animating = options.animated && options.animating; - - var _React$useState = (0,external_React_.useState)(null), - transition = _React$useState[0], - setTransition = _React$useState[1]; - - var hidden = !options.visible && !animating; - var style = hidden ? _objectSpread2({ - display: "none" - }, htmlStyle) : htmlStyle; - var onTransitionEndRef = useLiveRef(htmlOnTransitionEnd); - var onAnimationEndRef = useLiveRef(htmlOnAnimationEnd); - var raf = (0,external_React_.useRef)(0); - (0,external_React_.useEffect)(function () { - if (!options.animated) return undefined; // Double RAF is needed so the browser has enough time to paint the - // default styles before processing the `data-enter` attribute. Otherwise - // it wouldn't be considered a transition. - // See https://github.com/reakit/reakit/issues/643 - - raf.current = window.requestAnimationFrame(function () { - raf.current = window.requestAnimationFrame(function () { - if (options.visible) { - setTransition("enter"); - } else if (animating) { - setTransition("leave"); - } else { - setTransition(null); - } - }); - }); - return function () { - return window.cancelAnimationFrame(raf.current); - }; - }, [options.animated, options.visible, animating]); - var onEnd = (0,external_React_.useCallback)(function (event) { - if (!isSelfTarget(event)) return; - if (!animating) return; // Ignores number animated - - if (options.animated === true) { - var _options$stopAnimatio; - - (_options$stopAnimatio = options.stopAnimation) === null || _options$stopAnimatio === void 0 ? void 0 : _options$stopAnimatio.call(options); - } - }, [options.animated, animating, options.stopAnimation]); - var onTransitionEnd = (0,external_React_.useCallback)(function (event) { - var _onTransitionEndRef$c; - - (_onTransitionEndRef$c = onTransitionEndRef.current) === null || _onTransitionEndRef$c === void 0 ? void 0 : _onTransitionEndRef$c.call(onTransitionEndRef, event); - onEnd(event); - }, [onEnd]); - var onAnimationEnd = (0,external_React_.useCallback)(function (event) { - var _onAnimationEndRef$cu; - - (_onAnimationEndRef$cu = onAnimationEndRef.current) === null || _onAnimationEndRef$cu === void 0 ? void 0 : _onAnimationEndRef$cu.call(onAnimationEndRef, event); - onEnd(event); - }, [onEnd]); - return _objectSpread2({ - id: options.baseId, - "data-enter": transition === "enter" ? "" : undefined, - "data-leave": transition === "leave" ? "" : undefined, - onTransitionEnd: onTransitionEnd, - onAnimationEnd: onAnimationEnd, - hidden: hidden, - style: style - }, htmlProps); - } -}); -var DisclosureContent_DisclosureContent = createComponent({ - as: "div", - useHook: DisclosureContent_useDisclosureContent -}); - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/Portal/Portal.js - - - - - -function getBodyElement() { - return canUseDOM ? document.body : null; -} - -var Portal_PortalContext = /*#__PURE__*/(0,external_React_.createContext)(getBodyElement()); -function Portal_Portal(_ref) { - var children = _ref.children; - // if it's a nested portal, context is the parent portal - // otherwise it's document.body - // https://github.com/reakit/reakit/issues/513 - var context = (0,external_React_.useContext)(Portal_PortalContext) || getBodyElement(); - - var _React$useState = (0,external_React_.useState)(function () { - if (canUseDOM) { - var element = document.createElement("div"); - element.className = Portal_Portal.__className; - return element; - } // ssr - - - return null; - }), - hostNode = _React$useState[0]; - - useIsomorphicEffect(function () { - if (!hostNode || !context) return undefined; - context.appendChild(hostNode); - return function () { - context.removeChild(hostNode); - }; - }, [hostNode, context]); - - if (hostNode) { - return /*#__PURE__*/(0,external_ReactDOM_namespaceObject.createPortal)( /*#__PURE__*/(0,external_React_.createElement)(Portal_PortalContext.Provider, { - value: hostNode - }, children), hostNode); - } // ssr - - - return null; -} -Portal_Portal.__className = "__reakit-portal"; -Portal_Portal.__selector = "." + Portal_Portal.__className; - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/Tooltip/Tooltip.js - - - - - - - - - - - - - - - - - - - -function globallyHideTooltipOnEscape(event) { - if (event.defaultPrevented) return; - - if (event.key === "Escape") { - globalState.show(null); - } -} - -var Tooltip_useTooltip = createHook({ - name: "Tooltip", - compose: DisclosureContent_useDisclosureContent, - keys: TOOLTIP_KEYS, - useOptions: function useOptions(_ref) { - var _ref$unstable_portal = _ref.unstable_portal, - unstable_portal = _ref$unstable_portal === void 0 ? true : _ref$unstable_portal, - options = _objectWithoutPropertiesLoose(_ref, ["unstable_portal"]); - - return _objectSpread2({ - unstable_portal: unstable_portal - }, options); - }, - useProps: function useProps(options, _ref2) { - var htmlRef = _ref2.ref, - htmlStyle = _ref2.style, - htmlWrapElement = _ref2.wrapElement, - htmlProps = _objectWithoutPropertiesLoose(_ref2, ["ref", "style", "wrapElement"]); - - (0,external_React_.useEffect)(function () { - var _options$unstable_pop; - - var document = getDocument_getDocument((_options$unstable_pop = options.unstable_popoverRef) === null || _options$unstable_pop === void 0 ? void 0 : _options$unstable_pop.current); - document.addEventListener("keydown", globallyHideTooltipOnEscape); - }, []); - var wrapElement = (0,external_React_.useCallback)(function (element) { - if (options.unstable_portal) { - element = /*#__PURE__*/(0,external_React_.createElement)(Portal_Portal, null, element); - } - - if (htmlWrapElement) { - return htmlWrapElement(element); - } - - return element; - }, [options.unstable_portal, htmlWrapElement]); - return _objectSpread2({ - ref: useForkRef(options.unstable_popoverRef, htmlRef), - role: "tooltip", - style: _objectSpread2(_objectSpread2({}, options.unstable_popoverStyles), {}, { - pointerEvents: "none" - }, htmlStyle), - wrapElement: wrapElement - }, htmlProps); - } -}); -var Tooltip_Tooltip = createComponent({ - as: "div", - memo: true, - useHook: Tooltip_useTooltip -}); - - - -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/shortcut/component.js - -/** - * External dependencies - */ - -/** - * Internal dependencies - */ - - - -function component_Shortcut(props, forwardedRef) { - const { - as: asProp = 'span', - shortcut, - className, - ...otherProps - } = useContextSystem(props, 'Shortcut'); - if (!shortcut) { - return null; - } - let displayText; - let ariaLabel; - if (typeof shortcut === 'string') { - displayText = shortcut; - } else { - displayText = shortcut.display; - ariaLabel = shortcut.ariaLabel; - } - return (0,external_wp_element_namespaceObject.createElement)(component, { - as: asProp, - className: className, - "aria-label": ariaLabel, - ref: forwardedRef, - ...otherProps - }, displayText); -} -const ConnectedShortcut = contextConnect(component_Shortcut, 'Shortcut'); -/* harmony default export */ var shortcut_component = (ConnectedShortcut); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/z-index.js -const Flyout = 10000; -const z_index_Tooltip = 1000002; - -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/tooltip/styles.js - -function tooltip_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } -/** - * External dependencies - */ - -/** - * Internal dependencies - */ - - - - - -const TooltipContent = /*#__PURE__*/emotion_react_browser_esm_css("z-index:", z_index_Tooltip, ";box-sizing:border-box;opacity:0;outline:none;transform-origin:top center;transition:opacity ", config_values.transitionDurationFastest, " ease;font-size:", config_values.fontSize, ";&[data-enter]{opacity:1;}" + ( true ? "" : 0), true ? "" : 0); -const TooltipPopoverView = emotion_styled_base_browser_esm("div", true ? { - target: "e7tfjmw1" -} : 0)("background:rgba( 0, 0, 0, 0.8 );border-radius:2px;box-shadow:0 0 0 1px rgba( 255, 255, 255, 0.04 );color:", COLORS.white, ";padding:4px 8px;" + ( true ? "" : 0)); -const noOutline = true ? { - name: "12mkfdx", - styles: "outline:none" -} : 0; -const TooltipShortcut = /*#__PURE__*/emotion_styled_base_browser_esm(shortcut_component, true ? { - target: "e7tfjmw0" -} : 0)("display:inline-block;margin-left:", space(1), ";" + ( true ? "" : 0)); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/tooltip/content.js - -/** - * External dependencies - */ -// eslint-disable-next-line no-restricted-imports - - -/** - * Internal dependencies - */ - - - - - -const { - TooltipPopoverView: content_TooltipPopoverView -} = tooltip_styles_namespaceObject; - -/** - * - * @param {import('../context').WordPressComponentProps<import('./types').ContentProps, 'div'>} props - * @param {import('react').ForwardedRef<any>} forwardedRef - */ -function content_TooltipContent(props, forwardedRef) { - const { - children, - className, - ...otherProps - } = useContextSystem(props, 'TooltipContent'); - const { - tooltip - } = useTooltipContext(); - const cx = useCx(); - const classes = cx(TooltipContent, className); - return (0,external_wp_element_namespaceObject.createElement)(Tooltip_Tooltip, { - as: component, - ...otherProps, - ...tooltip, - className: classes, - ref: forwardedRef - }, (0,external_wp_element_namespaceObject.createElement)(content_TooltipPopoverView, null, children)); -} -/* harmony default export */ var tooltip_content = (contextConnect(content_TooltipContent, 'TooltipContent')); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/tooltip/component.js - -/** - * External dependencies - */ -// eslint-disable-next-line no-restricted-imports - - -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - - - - - -/** - * @param {import('../context').WordPressComponentProps<import('./types').Props, 'div'>} props - * @param {import('react').ForwardedRef<any>} forwardedRef - */ -function component_Tooltip(props, forwardedRef) { - const { - animated = true, - animationDuration = 160, - baseId, - children, - content, - focusable = true, - gutter = 4, - id, - modal = true, - placement, - visible = false, - shortcut, - ...otherProps - } = useContextSystem(props, 'Tooltip'); - const tooltip = useTooltipState({ - animated: animated ? animationDuration : undefined, - baseId: baseId || id, - gutter, - placement, - visible, - ...otherProps - }); - const contextProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({ - tooltip - }), [tooltip]); - return (0,external_wp_element_namespaceObject.createElement)(context_TooltipContext.Provider, { - value: contextProps - }, content && (0,external_wp_element_namespaceObject.createElement)(tooltip_content, { - unstable_portal: modal, - ref: forwardedRef - }, content, shortcut && (0,external_wp_element_namespaceObject.createElement)(TooltipShortcut, { - shortcut: shortcut - })), children && (0,external_wp_element_namespaceObject.createElement)(TooltipReference, { - ...tooltip, - ...children.props, - // @ts-ignore If ref doesn't exist that's fine with us, it'll just be undefined, but it can exist on ReactElement and there's no reason to try to scope this (it'll just overcomplicate things) - ref: children?.ref - }, referenceProps => { - if (!focusable) { - referenceProps.tabIndex = undefined; - } - return (0,external_wp_element_namespaceObject.cloneElement)(children, referenceProps); - })); -} - -/** - * `Tooltip` is a component that provides context for a user interface element. - * - * @example - * ```jsx - * import { Tooltip, Text } from `@wordpress/components/ui`; - * - * function Example() { - * return ( - * <Tooltip content="Code is Poetry"> - * <Text>WordPress.org</Text> - * </Tooltip> - * ) - * } - * ``` - */ -const ConnectedTooltip = contextConnect(component_Tooltip, 'Tooltip'); -/* harmony default export */ var tooltip_component = (ConnectedTooltip); +/* harmony default export */ const library_copy = (copy_copy); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-picker/color-copy-button.js @@ -42512,7 +38663,6 @@ const ConnectedTooltip = contextConnect(component_Tooltip, 'Tooltip'); */ - const ColorCopyButton = props => { const { color, @@ -42554,13 +38704,12 @@ const ColorCopyButton = props => { } }; }, []); - return (0,external_wp_element_namespaceObject.createElement)(tooltip_component, { - content: (0,external_wp_element_namespaceObject.createElement)(text_component, { - color: "white" - }, copiedColor === color.toHex() ? (0,external_wp_i18n_namespaceObject.__)('Copied!') : (0,external_wp_i18n_namespaceObject.__)('Copy')), - placement: "bottom" - }, (0,external_wp_element_namespaceObject.createElement)(CopyButton, { - isSmall: true, + return (0,external_React_.createElement)(tooltip, { + delay: 0, + hideOnClick: false, + text: copiedColor === color.toHex() ? (0,external_wp_i18n_namespaceObject.__)('Copied!') : (0,external_wp_i18n_namespaceObject.__)('Copy') + }, (0,external_React_.createElement)(CopyButton, { + size: "small", ref: copyRef, icon: library_copy, showTooltip: false @@ -42597,16 +38746,16 @@ const InputWithSlider = ({ } onChange(newValue); }; - return (0,external_wp_element_namespaceObject.createElement)(h_stack_component, { + return (0,external_React_.createElement)(h_stack_component, { spacing: 4 - }, (0,external_wp_element_namespaceObject.createElement)(NumberControlWrapper, { + }, (0,external_React_.createElement)(NumberControlWrapper, { min: min, max: max, label: label, hideLabelFromVision: true, value: value, onChange: onNumberControlChange, - prefix: (0,external_wp_element_namespaceObject.createElement)(spacer_component, { + prefix: (0,external_React_.createElement)(spacer_component, { as: text_component, paddingLeft: space(4), color: COLORS.theme.accent, @@ -42614,7 +38763,7 @@ const InputWithSlider = ({ }, abbreviation), spinControls: "none", size: "__unstable-large" - }), (0,external_wp_element_namespaceObject.createElement)(styles_RangeControl, { + }), (0,external_React_.createElement)(styles_RangeControl, { __nextHasNoMarginBottom: true, label: label, hideLabelFromVision: true, @@ -42651,7 +38800,7 @@ const RgbInput = ({ b, a } = color.toRgb(); - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(InputWithSlider, { + return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(InputWithSlider, { min: 0, max: 255, label: "Red", @@ -42663,7 +38812,7 @@ const RgbInput = ({ b, a })) - }), (0,external_wp_element_namespaceObject.createElement)(InputWithSlider, { + }), (0,external_React_.createElement)(InputWithSlider, { min: 0, max: 255, label: "Green", @@ -42675,7 +38824,7 @@ const RgbInput = ({ b, a })) - }), (0,external_wp_element_namespaceObject.createElement)(InputWithSlider, { + }), (0,external_React_.createElement)(InputWithSlider, { min: 0, max: 255, label: "Blue", @@ -42687,7 +38836,7 @@ const RgbInput = ({ b: nextB, a })) - }), enableAlpha && (0,external_wp_element_namespaceObject.createElement)(InputWithSlider, { + }), enableAlpha && (0,external_React_.createElement)(InputWithSlider, { min: 0, max: 100, label: "Alpha", @@ -42710,6 +38859,11 @@ const RgbInput = ({ /** + * WordPress dependencies + */ + + +/** * Internal dependencies */ @@ -42718,67 +38872,84 @@ const HslInput = ({ onChange, enableAlpha }) => { - const { - h, - s, - l, - a - } = color.toHsl(); - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(InputWithSlider, { + const colorPropHSLA = (0,external_wp_element_namespaceObject.useMemo)(() => color.toHsl(), [color]); + const [internalHSLA, setInternalHSLA] = (0,external_wp_element_namespaceObject.useState)({ + ...colorPropHSLA + }); + const isInternalColorSameAsReceivedColor = color.isEqual(w(internalHSLA)); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (!isInternalColorSameAsReceivedColor) { + // Keep internal HSLA color up to date with the received color prop + setInternalHSLA(colorPropHSLA); + } + }, [colorPropHSLA, isInternalColorSameAsReceivedColor]); + + // If the internal color is equal to the received color prop, we can use the + // HSLA values from the local state which, compared to the received color prop, + // retain more details about the actual H and S values that the user selected, + // and thus allow for better UX when interacting with the H and S sliders. + const colorValue = isInternalColorSameAsReceivedColor ? internalHSLA : colorPropHSLA; + const updateHSLAValue = partialNewValue => { + const nextOnChangeValue = w({ + ...colorValue, + ...partialNewValue + }); + + // Fire `onChange` only if the resulting color is different from the + // current one. + // Otherwise, update the internal HSLA color to cause a re-render. + if (!color.isEqual(nextOnChangeValue)) { + onChange(nextOnChangeValue); + } else { + setInternalHSLA(prevHSLA => ({ + ...prevHSLA, + ...partialNewValue + })); + } + }; + return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(InputWithSlider, { min: 0, max: 359, label: "Hue", abbreviation: "H", - value: h, + value: colorValue.h, onChange: nextH => { - onChange(w({ - h: nextH, - s, - l, - a - })); + updateHSLAValue({ + h: nextH + }); } - }), (0,external_wp_element_namespaceObject.createElement)(InputWithSlider, { + }), (0,external_React_.createElement)(InputWithSlider, { min: 0, max: 100, label: "Saturation", abbreviation: "S", - value: s, + value: colorValue.s, onChange: nextS => { - onChange(w({ - h, - s: nextS, - l, - a - })); + updateHSLAValue({ + s: nextS + }); } - }), (0,external_wp_element_namespaceObject.createElement)(InputWithSlider, { + }), (0,external_React_.createElement)(InputWithSlider, { min: 0, max: 100, label: "Lightness", abbreviation: "L", - value: l, + value: colorValue.l, onChange: nextL => { - onChange(w({ - h, - s, - l: nextL, - a - })); + updateHSLAValue({ + l: nextL + }); } - }), enableAlpha && (0,external_wp_element_namespaceObject.createElement)(InputWithSlider, { + }), enableAlpha && (0,external_React_.createElement)(InputWithSlider, { min: 0, max: 100, label: "Alpha", abbreviation: "A", - value: Math.trunc(100 * a), + value: Math.trunc(100 * colorValue.a), onChange: nextA => { - onChange(w({ - h, - s, - l, + updateHSLAValue({ a: nextA / 100 - })); + }); } })); }; @@ -42826,8 +38997,8 @@ const HexInput = ({ value }; }; - return (0,external_wp_element_namespaceObject.createElement)(InputControl, { - prefix: (0,external_wp_element_namespaceObject.createElement)(spacer_component, { + return (0,external_React_.createElement)(InputControl, { + prefix: (0,external_React_.createElement)(spacer_component, { as: text_component, marginLeft: space(4), color: COLORS.theme.accent, @@ -42865,16 +39036,16 @@ const ColorInput = ({ }; switch (colorType) { case 'hsl': - return (0,external_wp_element_namespaceObject.createElement)(HslInput, { + return (0,external_React_.createElement)(HslInput, { ...props }); case 'rgb': - return (0,external_wp_element_namespaceObject.createElement)(RgbInput, { + return (0,external_React_.createElement)(RgbInput, { ...props }); default: case 'hex': - return (0,external_wp_element_namespaceObject.createElement)(HexInput, { + return (0,external_React_.createElement)(HexInput, { ...props }); } @@ -42900,14 +39071,90 @@ function dist_u(){return(dist_u=Object.assign||function(e){for(var r=1;r<argumen * Internal dependencies */ +/** + * Track the start and the end of drag pointer events related to controlling + * the picker's saturation / hue / alpha, and fire the corresponding callbacks. + * This is particularly useful to implement synergies like the one with the + * `Popover` component, where a pointer events "trap" is rendered while + * the user is dragging the pointer to avoid potential interference with iframe + * elements. + * + * @param props + * @param props.containerEl + * @param props.onDragStart + * @param props.onDragEnd + */ +const useOnPickerDrag = ({ + containerEl, + onDragStart, + onDragEnd +}) => { + const isDragging = (0,external_wp_element_namespaceObject.useRef)(false); + const leftWhileDragging = (0,external_wp_element_namespaceObject.useRef)(false); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (!containerEl || !onDragStart && !onDragEnd) { + return; + } + const interactiveElements = [containerEl.querySelector('.react-colorful__saturation'), containerEl.querySelector('.react-colorful__hue'), containerEl.querySelector('.react-colorful__alpha')].filter(el => !!el); + if (interactiveElements.length === 0) { + return; + } + const doc = containerEl.ownerDocument; + const onPointerUp = event => { + isDragging.current = false; + leftWhileDragging.current = false; + onDragEnd?.(event); + }; + const onPointerDown = event => { + isDragging.current = true; + onDragStart?.(event); + }; + const onPointerLeave = () => { + leftWhileDragging.current = isDragging.current; + }; + + // Try to detect if the user released the pointer while away from the + // current window. If the check is successfull, the dragEnd callback will + // called as soon as the pointer re-enters the window (better late than never) + const onPointerEnter = event => { + const noPointerButtonsArePressed = event.buttons === 0; + if (leftWhileDragging.current && noPointerButtonsArePressed) { + onPointerUp(event); + } + }; + + // The pointerdown event is added on the interactive elements, + // while the remaining events are added on the document object since + // the pointer wouldn't necessarily be hovering the initial interactive + // element at that point. + interactiveElements.forEach(el => el.addEventListener('pointerdown', onPointerDown)); + doc.addEventListener('pointerup', onPointerUp); + doc.addEventListener('pointerenter', onPointerEnter); + doc.addEventListener('pointerleave', onPointerLeave); + return () => { + interactiveElements.forEach(el => el.removeEventListener('pointerdown', onPointerDown)); + doc.removeEventListener('pointerup', onPointerUp); + doc.removeEventListener('pointerenter', onPointerEnter); + doc.removeEventListener('pointerleave', onPointerUp); + }; + }, [onDragStart, onDragEnd, containerEl]); +}; const Picker = ({ color, enableAlpha, - onChange + onChange, + onDragStart, + onDragEnd, + containerEl }) => { const Component = enableAlpha ? He : ye; const rgbColor = (0,external_wp_element_namespaceObject.useMemo)(() => color.toRgbString(), [color]); - return (0,external_wp_element_namespaceObject.createElement)(Component, { + useOnPickerDrag({ + containerEl, + onDragStart, + onDragEnd + }); + return (0,external_React_.createElement)(Component, { color: rgbColor, onChange: nextColor => { onChange(w(nextColor)); @@ -42958,8 +39205,15 @@ const UnconnectedColorPicker = (props, forwardedRef) => { onChange, defaultValue = '#fff', copyFormat, + // Context + onPickerDragStart, + onPickerDragEnd, ...divProps } = useContextSystem(props, 'ColorPicker'); + const [containerEl, setContainerEl] = (0,external_wp_element_namespaceObject.useState)(null); + const containerRef = node => { + setContainerEl(node); + }; // Use a safe default value for the color and remove the possibility of `undefined`. const [color, setColor] = useControlledValue({ @@ -42975,29 +39229,32 @@ const UnconnectedColorPicker = (props, forwardedRef) => { debouncedSetColor(nextValue.toHex()); }, [debouncedSetColor]); const [colorType, setColorType] = (0,external_wp_element_namespaceObject.useState)(copyFormat || 'hex'); - return (0,external_wp_element_namespaceObject.createElement)(ColorfulWrapper, { - ref: forwardedRef, + return (0,external_React_.createElement)(ColorfulWrapper, { + ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([containerRef, forwardedRef]), ...divProps - }, (0,external_wp_element_namespaceObject.createElement)(Picker, { + }, (0,external_React_.createElement)(Picker, { + containerEl: containerEl, onChange: handleChange, color: safeColordColor, - enableAlpha: enableAlpha - }), (0,external_wp_element_namespaceObject.createElement)(AuxiliaryColorArtefactWrapper, null, (0,external_wp_element_namespaceObject.createElement)(AuxiliaryColorArtefactHStackHeader, { + enableAlpha: enableAlpha, + onDragStart: onPickerDragStart, + onDragEnd: onPickerDragEnd + }), (0,external_React_.createElement)(AuxiliaryColorArtefactWrapper, null, (0,external_React_.createElement)(AuxiliaryColorArtefactHStackHeader, { justify: "space-between" - }, (0,external_wp_element_namespaceObject.createElement)(styles_SelectControl, { + }, (0,external_React_.createElement)(styles_SelectControl, { __nextHasNoMarginBottom: true, options: options, value: colorType, onChange: nextColorType => setColorType(nextColorType), label: (0,external_wp_i18n_namespaceObject.__)('Color format'), hideLabelFromVision: true - }), (0,external_wp_element_namespaceObject.createElement)(ColorCopyButton, { + }), (0,external_React_.createElement)(ColorCopyButton, { color: safeColordColor, colorType: copyFormat || colorType - })), (0,external_wp_element_namespaceObject.createElement)(ColorInputWrapper, { + })), (0,external_React_.createElement)(ColorInputWrapper, { direction: "column", gap: 2 - }, (0,external_wp_element_namespaceObject.createElement)(ColorInput, { + }, (0,external_React_.createElement)(ColorInput, { colorType: colorType, color: safeColordColor, onChange: handleChange, @@ -43005,7 +39262,7 @@ const UnconnectedColorPicker = (props, forwardedRef) => { })))); }; const ColorPicker = contextConnect(UnconnectedColorPicker, 'ColorPicker'); -/* harmony default export */ var color_picker_component = (ColorPicker); +/* harmony default export */ const color_picker_component = (ColorPicker); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-picker/use-deprecated-props.js /** @@ -43077,7 +39334,7 @@ function use_deprecated_props_useDeprecatedProps(props) { const LegacyAdapter = props => { - return (0,external_wp_element_namespaceObject.createElement)(color_picker_component, { + return (0,external_React_.createElement)(color_picker_component, { ...use_deprecated_props_useDeprecatedProps(props) }); }; @@ -43100,13 +39357,13 @@ const CircularOptionPickerContext = (0,external_wp_element_namespaceObject.creat * WordPress dependencies */ -const check = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const check = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z" })); -/* harmony default export */ var library_check = (check); +/* harmony default export */ const library_check = (check); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/circular-option-picker/circular-option-picker-option.js @@ -43128,10 +39385,14 @@ const check = (0,external_wp_element_namespaceObject.createElement)(external_wp_ -const hasSelectedOption = new Map(); function UnforwardedOptionAsButton(props, forwardedRef) { - return (0,external_wp_element_namespaceObject.createElement)(build_module_button, { - ...props, + const { + isPressed, + ...additionalProps + } = props; + return (0,external_React_.createElement)(build_module_button, { + ...additionalProps, + "aria-pressed": isPressed, ref: forwardedRef }); } @@ -43139,51 +39400,23 @@ const OptionAsButton = (0,external_wp_element_namespaceObject.forwardRef)(Unforw function UnforwardedOptionAsOption(props, forwardedRef) { const { id, - className, isSelected, - context, + compositeStore, ...additionalProps } = props; - const { - isComposite, - ..._compositeState - } = context; - const compositeState = _compositeState; - const { - baseId, - currentId, - setCurrentId - } = compositeState; - (0,external_wp_element_namespaceObject.useEffect)(() => { - // If we call `setCurrentId` here, it doesn't update for other - // Option renders in the same pass. So we have to store our own - // map to make sure that we only set the first selected option. - // We still need to check `currentId` because the control will - // update this as the user moves around, and that state should - // be maintained as the group gains and loses focus. - if (isSelected && !currentId && !hasSelectedOption.get(baseId)) { - hasSelectedOption.set(baseId, true); - setCurrentId(id); - } - }, [baseId, currentId, id, isSelected, setCurrentId]); - return (0,external_wp_element_namespaceObject.createElement)(CompositeItem, { - ...additionalProps, - ...compositeState, - as: build_module_button, - id: id - // Ideally we'd let the underlying `Button` component - // handle this by passing `isPressed` as a prop. - // Unfortunately doing so also sets `aria-pressed` as - // an attribute on the element, which is incompatible - // with `role="option"`, and there is no way at this - // point to override that behaviour. - , - className: classnames_default()(className, { - 'is-pressed': isSelected + const activeId = compositeStore.useState('activeId'); + if (isSelected && !activeId) { + compositeStore.setActiveId(id); + } + return (0,external_React_.createElement)(CompositeItem, { + render: (0,external_React_.createElement)(build_module_button, { + ...additionalProps, + role: "option", + "aria-selected": !!isSelected, + ref: forwardedRef }), - role: "option", - "aria-selected": !!isSelected, - ref: forwardedRef + store: compositeStore, + id: id }); } const OptionAsOption = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedOptionAsOption); @@ -43194,30 +39427,29 @@ function Option({ tooltipText, ...additionalProps }) { - const compositeContext = (0,external_wp_element_namespaceObject.useContext)(CircularOptionPickerContext); const { - isComposite, - baseId - } = compositeContext; + baseId, + compositeStore + } = (0,external_wp_element_namespaceObject.useContext)(CircularOptionPickerContext); const id = (0,external_wp_compose_namespaceObject.useInstanceId)(Option, baseId || 'components-circular-option-picker__option'); const commonProps = { id, className: 'components-circular-option-picker__option', ...additionalProps }; - const optionControl = isComposite ? (0,external_wp_element_namespaceObject.createElement)(OptionAsOption, { + const optionControl = compositeStore ? (0,external_React_.createElement)(OptionAsOption, { ...commonProps, - context: compositeContext, + compositeStore: compositeStore, isSelected: isSelected - }) : (0,external_wp_element_namespaceObject.createElement)(OptionAsButton, { + }) : (0,external_React_.createElement)(OptionAsButton, { ...commonProps, isPressed: isSelected }); - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { className: classnames_default()(className, 'components-circular-option-picker__option-wrapper') - }, tooltipText ? (0,external_wp_element_namespaceObject.createElement)(tooltip, { + }, tooltipText ? (0,external_React_.createElement)(tooltip, { text: tooltipText - }, optionControl) : optionControl, isSelected && (0,external_wp_element_namespaceObject.createElement)(icons_build_module_icon, { + }, optionControl) : optionControl, isSelected && (0,external_React_.createElement)(icons_build_module_icon, { icon: library_check, ...selectedIconProps })); @@ -43240,7 +39472,7 @@ function OptionGroup({ ...additionalProps }) { const role = 'aria-label' in additionalProps || 'aria-labelledby' in additionalProps ? 'group' : undefined; - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { ...additionalProps, role: role, className: classnames_default()('components-circular-option-picker__option-group', 'components-circular-option-picker__swatches', className) @@ -43265,12 +39497,12 @@ function DropdownLinkAction({ dropdownProps, linkText }) { - return (0,external_wp_element_namespaceObject.createElement)(dropdown, { + return (0,external_React_.createElement)(dropdown, { className: classnames_default()('components-circular-option-picker__dropdown-link-action', className), renderToggle: ({ isOpen, onToggle - }) => (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }) => (0,external_React_.createElement)(build_module_button, { "aria-expanded": isOpen, "aria-haspopup": "true", onClick: onToggle, @@ -43285,7 +39517,7 @@ function ButtonAction({ children, ...additionalProps }) { - return (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + return (0,external_React_.createElement)(build_module_button, { className: classnames_default()('components-circular-option-picker__clear', className), variant: "tertiary", ...additionalProps @@ -43305,7 +39537,6 @@ function ButtonAction({ - /** * Internal dependencies */ @@ -43371,42 +39602,22 @@ function ListboxCircularOptionPicker(props) { children, ...additionalProps } = props; - const rtl = (0,external_wp_i18n_namespaceObject.isRTL)(); - const compositeState = useCompositeState({ - baseId, - loop, - rtl + const compositeStore = useCompositeStore({ + focusLoop: loop, + rtl: (0,external_wp_i18n_namespaceObject.isRTL)() }); - const { - setBaseId, - setLoop, - setRTL - } = compositeState; - - // These are necessary as `useCompositeState` is sealed after - // the first render, so although unlikely to happen, if a state - // property should change, we need to process it accordingly. - - (0,external_wp_element_namespaceObject.useEffect)(() => { - setBaseId(baseId); - }, [setBaseId, baseId]); - (0,external_wp_element_namespaceObject.useEffect)(() => { - setLoop(loop); - }, [setLoop, loop]); - (0,external_wp_element_namespaceObject.useEffect)(() => { - setRTL(rtl); - }, [setRTL, rtl]); const compositeContext = { - isComposite: true, - ...compositeState + baseId, + compositeStore }; - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { className: className - }, (0,external_wp_element_namespaceObject.createElement)(CircularOptionPickerContext.Provider, { + }, (0,external_React_.createElement)(CircularOptionPickerContext.Provider, { value: compositeContext - }, (0,external_wp_element_namespaceObject.createElement)(Composite, { + }, (0,external_React_.createElement)(Composite, { ...additionalProps, - ...compositeState, + id: baseId, + store: compositeStore, role: 'listbox' }, options), children, actions)); } @@ -43418,11 +39629,11 @@ function ButtonsCircularOptionPicker(props) { baseId, ...additionalProps } = props; - return (0,external_wp_element_namespaceObject.createElement)("div", { - ...additionalProps - }, (0,external_wp_element_namespaceObject.createElement)(CircularOptionPickerContext.Provider, { + return (0,external_React_.createElement)("div", { + ...additionalProps, + id: baseId + }, (0,external_React_.createElement)(CircularOptionPickerContext.Provider, { value: { - isComposite: false, baseId } }, options, children, actions)); @@ -43438,13 +39649,13 @@ function CircularOptionPicker(props) { } = props; const baseId = (0,external_wp_compose_namespaceObject.useInstanceId)(CircularOptionPicker, 'components-circular-option-picker', additionalProps.id); const OptionPickerImplementation = asButtons ? ButtonsCircularOptionPicker : ListboxCircularOptionPicker; - const actions = actionsProp ? (0,external_wp_element_namespaceObject.createElement)("div", { + const actions = actionsProp ? (0,external_React_.createElement)("div", { className: "components-circular-option-picker__custom-clear-wrapper" }, actionsProp) : undefined; - const options = (0,external_wp_element_namespaceObject.createElement)("div", { + const options = (0,external_React_.createElement)("div", { className: 'components-circular-option-picker__swatches' }, optionsProp); - return (0,external_wp_element_namespaceObject.createElement)(OptionPickerImplementation, { + return (0,external_React_.createElement)(OptionPickerImplementation, { ...additionalProps, baseId: baseId, className: classnames_default()('components-circular-option-picker', className), @@ -43456,7 +39667,7 @@ CircularOptionPicker.Option = Option; CircularOptionPicker.OptionGroup = OptionGroup; CircularOptionPicker.ButtonAction = ButtonAction; CircularOptionPicker.DropdownLinkAction = DropdownLinkAction; -/* harmony default export */ var circular_option_picker = (CircularOptionPicker); +/* harmony default export */ const circular_option_picker = (CircularOptionPicker); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/circular-option-picker/index.js /** @@ -43466,7 +39677,7 @@ CircularOptionPicker.DropdownLinkAction = DropdownLinkAction; -/* harmony default export */ var build_module_circular_option_picker = (circular_option_picker); +/* harmony default export */ const build_module_circular_option_picker = (circular_option_picker); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/v-stack/hook.js /** @@ -43505,7 +39716,7 @@ function useVStack(props) { function UnconnectedVStack(props, forwardedRef) { const vStackProps = useVStack(props); - return (0,external_wp_element_namespaceObject.createElement)(component, { + return (0,external_React_.createElement)(component, { ...vStackProps, ref: forwardedRef }); @@ -43535,7 +39746,7 @@ function UnconnectedVStack(props, forwardedRef) { * ``` */ const VStack = contextConnect(UnconnectedVStack, 'VStack'); -/* harmony default export */ var v_stack_component = (VStack); +/* harmony default export */ const v_stack_component = (VStack); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/truncate/component.js @@ -43552,7 +39763,7 @@ const VStack = contextConnect(UnconnectedVStack, 'VStack'); function UnconnectedTruncate(props, forwardedRef) { const truncateProps = useTruncate(props); - return (0,external_wp_element_namespaceObject.createElement)(component, { + return (0,external_React_.createElement)(component, { as: "span", ...truncateProps, ref: forwardedRef @@ -43580,7 +39791,7 @@ function UnconnectedTruncate(props, forwardedRef) { * ``` */ const component_Truncate = contextConnect(UnconnectedTruncate, 'Truncate'); -/* harmony default export */ var truncate_component = (component_Truncate); +/* harmony default export */ const truncate_component = (component_Truncate); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/heading/hook.js /** @@ -43595,6 +39806,9 @@ function useHeading(props) { const { as: asProp, level = 2, + color = COLORS.gray[900], + isBlock = true, + weight = config_values.fontWeightHeading, ...otherProps } = useContextSystem(props, 'Heading'); const as = asProp || `h${level}`; @@ -43605,10 +39819,10 @@ function useHeading(props) { a11yProps['aria-level'] = typeof level === 'string' ? parseInt(level) : level; } const textProps = useText({ - color: COLORS.gray[900], + color, + isBlock, + weight, size: getHeadingFontSize(level), - isBlock: true, - weight: config_values.fontWeightHeading, ...otherProps }); return { @@ -43633,7 +39847,7 @@ function useHeading(props) { function UnconnectedHeading(props, forwardedRef) { const headerProps = useHeading(props); - return (0,external_wp_element_namespaceObject.createElement)(component, { + return (0,external_React_.createElement)(component, { ...headerProps, ref: forwardedRef }); @@ -43651,7 +39865,7 @@ function UnconnectedHeading(props, forwardedRef) { * ``` */ const Heading = contextConnect(UnconnectedHeading, 'Heading'); -/* harmony default export */ var heading_component = (Heading); +/* harmony default export */ const heading_component = (Heading); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-palette/styles.js @@ -43712,7 +39926,7 @@ function UnconnectedDropdownContentWrapper(props, forwardedRef) { paddingSize = 'small', ...derivedProps } = useContextSystem(props, 'DropdownContentWrapper'); - return (0,external_wp_element_namespaceObject.createElement)(DropdownContentWrapperDiv, { + return (0,external_React_.createElement)(DropdownContentWrapperDiv, { ...derivedProps, paddingSize: paddingSize, ref: forwardedRef @@ -43739,7 +39953,7 @@ function UnconnectedDropdownContentWrapper(props, forwardedRef) { * ``` */ const DropdownContentWrapper = contextConnect(UnconnectedDropdownContentWrapper, 'DropdownContentWrapper'); -/* harmony default export */ var dropdown_content_wrapper = (DropdownContentWrapper); +/* harmony default export */ const dropdown_content_wrapper = (DropdownContentWrapper); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-palette/utils.js /** @@ -43863,7 +40077,7 @@ function SinglePalette({ }, index) => { const colordColor = w(color); const isSelected = value === color; - return (0,external_wp_element_namespaceObject.createElement)(build_module_circular_option_picker.Option, { + return (0,external_React_.createElement)(build_module_circular_option_picker.Option, { key: `${color}-${index}`, isSelected: isSelected, selectedIconProps: isSelected ? { @@ -43885,7 +40099,7 @@ function SinglePalette({ }); }); }, [colors, value, onChange, clearColor]); - return (0,external_wp_element_namespaceObject.createElement)(build_module_circular_option_picker.OptionGroup, { + return (0,external_React_.createElement)(build_module_circular_option_picker.OptionGroup, { className: className, options: colorOptions, ...additionalProps @@ -43903,7 +40117,7 @@ function MultiplePalettes({ if (colors.length === 0) { return null; } - return (0,external_wp_element_namespaceObject.createElement)(v_stack_component, { + return (0,external_React_.createElement)(v_stack_component, { spacing: 3, className: className }, colors.map(({ @@ -43911,13 +40125,13 @@ function MultiplePalettes({ colors: colorPalette }, index) => { const id = `${instanceId}-${index}`; - return (0,external_wp_element_namespaceObject.createElement)(v_stack_component, { + return (0,external_React_.createElement)(v_stack_component, { spacing: 2, key: index - }, (0,external_wp_element_namespaceObject.createElement)(ColorHeading, { + }, (0,external_React_.createElement)(ColorHeading, { id: id, level: headingLevel - }, name), (0,external_wp_element_namespaceObject.createElement)(SinglePalette, { + }, name), (0,external_React_.createElement)(SinglePalette, { clearColor: clearColor, colors: colorPalette, onChange: newColor => onChange(newColor, index), @@ -43933,6 +40147,10 @@ function CustomColorPickerDropdown({ }) { const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({ shift: true, + // Disabling resize as it would otherwise cause the popover to show + // scrollbars while dragging the color picker's handle close to the + // popover edge. + resize: false, ...(isRenderedInSidebar ? { // When in the sidebar: open to the left (stacking), // leaving the same gap as the parent popover. @@ -43945,7 +40163,7 @@ function CustomColorPickerDropdown({ }), ...receivedPopoverProps }), [isRenderedInSidebar, receivedPopoverProps]); - return (0,external_wp_element_namespaceObject.createElement)(dropdown, { + return (0,external_React_.createElement)(dropdown, { contentClassName: "components-color-palette__custom-color-dropdown-content", popoverProps: popoverProps, ...props @@ -43974,9 +40192,9 @@ function UnforwardedColorPalette(props, forwardedRef) { }, [value]); const hasMultipleColorOrigins = isMultiplePaletteArray(colors); const buttonLabelName = (0,external_wp_element_namespaceObject.useMemo)(() => extractColorNameFromCurrentValue(value, colors, hasMultipleColorOrigins), [value, colors, hasMultipleColorOrigins]); - const renderCustomColorPicker = () => (0,external_wp_element_namespaceObject.createElement)(dropdown_content_wrapper, { + const renderCustomColorPicker = () => (0,external_React_.createElement)(dropdown_content_wrapper, { paddingSize: "none" - }, (0,external_wp_element_namespaceObject.createElement)(LegacyAdapter, { + }, (0,external_React_.createElement)(LegacyAdapter, { color: normalizedColorValue, onChange: color => onChange(color), enableAlpha: enableAlpha @@ -43993,7 +40211,7 @@ function UnforwardedColorPalette(props, forwardedRef) { onChange, value }; - const actions = !!clearable && (0,external_wp_element_namespaceObject.createElement)(build_module_circular_option_picker.ButtonAction, { + const actions = !!clearable && (0,external_React_.createElement)(build_module_circular_option_picker.ButtonAction, { onClick: clearColor }, (0,external_wp_i18n_namespaceObject.__)('Clear')); let metaProps; @@ -44023,20 +40241,20 @@ function UnforwardedColorPalette(props, forwardedRef) { }; } } - return (0,external_wp_element_namespaceObject.createElement)(v_stack_component, { + return (0,external_React_.createElement)(v_stack_component, { spacing: 3, ref: forwardedRef, ...additionalProps - }, !disableCustomColors && (0,external_wp_element_namespaceObject.createElement)(CustomColorPickerDropdown, { + }, !disableCustomColors && (0,external_React_.createElement)(CustomColorPickerDropdown, { isRenderedInSidebar: __experimentalIsRenderedInSidebar, renderContent: renderCustomColorPicker, renderToggle: ({ isOpen, onToggle - }) => (0,external_wp_element_namespaceObject.createElement)(v_stack_component, { + }) => (0,external_React_.createElement)(v_stack_component, { className: "components-color-palette__custom-color-wrapper", spacing: 0 - }, (0,external_wp_element_namespaceObject.createElement)("button", { + }, (0,external_React_.createElement)("button", { ref: customColorPaletteCallbackRef, className: "components-color-palette__custom-color-button", "aria-expanded": isOpen, @@ -44045,26 +40263,27 @@ function UnforwardedColorPalette(props, forwardedRef) { "aria-label": customColorAccessibleLabel, style: { background: value - } - }), (0,external_wp_element_namespaceObject.createElement)(v_stack_component, { + }, + type: "button" + }), (0,external_React_.createElement)(v_stack_component, { className: "components-color-palette__custom-color-text-wrapper", spacing: 0.5 - }, (0,external_wp_element_namespaceObject.createElement)(truncate_component, { + }, (0,external_React_.createElement)(truncate_component, { className: "components-color-palette__custom-color-name" - }, value ? buttonLabelName : 'No color selected'), (0,external_wp_element_namespaceObject.createElement)(truncate_component, { + }, value ? buttonLabelName : (0,external_wp_i18n_namespaceObject.__)('No color selected')), (0,external_React_.createElement)(truncate_component, { className: classnames_default()('components-color-palette__custom-color-value', { 'components-color-palette__custom-color-value--is-hex': isHex }) }, displayValue))) - }), (0,external_wp_element_namespaceObject.createElement)(build_module_circular_option_picker, { + }), (0,external_React_.createElement)(build_module_circular_option_picker, { ...metaProps, actions: actions, - options: hasMultipleColorOrigins ? (0,external_wp_element_namespaceObject.createElement)(MultiplePalettes, { + options: hasMultipleColorOrigins ? (0,external_React_.createElement)(MultiplePalettes, { ...paletteCommonProps, headingLevel: headingLevel, colors: colors, value: value - }) : (0,external_wp_element_namespaceObject.createElement)(SinglePalette, { + }) : (0,external_React_.createElement)(SinglePalette, { ...paletteCommonProps, colors: colors, value: value @@ -44097,7 +40316,121 @@ function UnforwardedColorPalette(props, forwardedRef) { * ``` */ const ColorPalette = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedColorPalette); -/* harmony default export */ var color_palette = (ColorPalette); +/* harmony default export */ const color_palette = (ColorPalette); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/unit-control/styles/unit-control-styles.js + +/** + * External dependencies + */ + +/** + * Internal dependencies + */ + + + + + +// Using `selectSize` instead of `size` to avoid a type conflict with the +// `size` HTML attribute of the `select` element. + +// TODO: Resolve need to use &&& to increase specificity +// https://github.com/WordPress/gutenberg/issues/18483 + +const ValueInput = /*#__PURE__*/emotion_styled_base_browser_esm(number_control, true ? { + target: "e1bagdl32" +} : 0)("&&&{input{display:block;width:100%;}", BackdropUI, "{transition:box-shadow 0.1s linear;}}" + ( true ? "" : 0)); +const baseUnitLabelStyles = ({ + selectSize +}) => { + const sizes = { + small: /*#__PURE__*/emotion_react_browser_esm_css("box-sizing:border-box;padding:2px 1px;width:20px;color:", COLORS.gray[800], ";font-size:8px;line-height:1;letter-spacing:-0.5px;text-transform:uppercase;text-align-last:center;" + ( true ? "" : 0), true ? "" : 0), + default: /*#__PURE__*/emotion_react_browser_esm_css("box-sizing:border-box;min-width:24px;max-width:48px;height:24px;margin-inline-end:", space(2), ";padding:", space(1), ";color:", COLORS.theme.accent, ";font-size:13px;line-height:1;text-align-last:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" + ( true ? "" : 0), true ? "" : 0) + }; + return sizes[selectSize]; +}; +const UnitLabel = emotion_styled_base_browser_esm("div", true ? { + target: "e1bagdl31" +} : 0)("&&&{pointer-events:none;", baseUnitLabelStyles, ";color:", COLORS.gray[900], ";}" + ( true ? "" : 0)); +const unitSelectSizes = ({ + selectSize = 'default' +}) => { + const sizes = { + small: /*#__PURE__*/emotion_react_browser_esm_css("height:100%;border:1px solid transparent;transition:box-shadow 0.1s linear,border 0.1s linear;", rtl({ + borderTopLeftRadius: 0, + borderBottomLeftRadius: 0 + })(), " &:not(:disabled):hover{background-color:", COLORS.gray[100], ";}&:focus{border:1px solid ", COLORS.ui.borderFocus, ";box-shadow:inset 0 0 0 ", config_values.borderWidth + ' ' + COLORS.ui.borderFocus, ";outline-offset:0;outline:2px solid transparent;z-index:1;}" + ( true ? "" : 0), true ? "" : 0), + default: /*#__PURE__*/emotion_react_browser_esm_css("display:flex;justify-content:center;align-items:center;&:hover{color:", COLORS.ui.borderFocus, ";box-shadow:inset 0 0 0 ", config_values.borderWidth + ' ' + COLORS.ui.borderFocus, ";outline:", config_values.borderWidth, " solid transparent;}&:focus{box-shadow:0 0 0 ", config_values.borderWidthFocus + ' ' + COLORS.ui.borderFocus, ";outline:", config_values.borderWidthFocus, " solid transparent;}" + ( true ? "" : 0), true ? "" : 0) + }; + return sizes[selectSize]; +}; +const UnitSelect = emotion_styled_base_browser_esm("select", true ? { + target: "e1bagdl30" +} : 0)("&&&{appearance:none;background:transparent;border-radius:2px;border:none;display:block;outline:none;margin:0;min-height:auto;font-family:inherit;", baseUnitLabelStyles, ";", unitSelectSizes, ";&:not( :disabled ){cursor:pointer;}}" + ( true ? "" : 0)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/border-control/styles.js +function border_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } +/** + * External dependencies + */ + + +/** + * Internal dependencies + */ + + + + +const styles_labelStyles = true ? { + name: "f3vz0n", + styles: "font-weight:500" +} : 0; +const focusBoxShadow = /*#__PURE__*/emotion_react_browser_esm_css("box-shadow:inset ", config_values.controlBoxShadowFocus, ";" + ( true ? "" : 0), true ? "" : 0); +const borderControl = /*#__PURE__*/emotion_react_browser_esm_css("border:0;padding:0;margin:0;", boxSizingReset, ";" + ( true ? "" : 0), true ? "" : 0); +const innerWrapper = () => /*#__PURE__*/emotion_react_browser_esm_css(ValueInput, "{flex:1 1 40%;}&& ", UnitSelect, "{min-height:0;}" + ( true ? "" : 0), true ? "" : 0); + +/* + * This style is only applied to the UnitControl wrapper when the border width + * field should be a set width. Omitting this allows the UnitControl & + * RangeControl to share the available width in a 40/60 split respectively. + */ +const styles_wrapperWidth = /*#__PURE__*/emotion_react_browser_esm_css(ValueInput, "{flex:0 0 auto;}" + ( true ? "" : 0), true ? "" : 0); +const wrapperHeight = size => { + return /*#__PURE__*/emotion_react_browser_esm_css("height:", size === '__unstable-large' ? '40px' : '30px', ";" + ( true ? "" : 0), true ? "" : 0); +}; +const borderControlDropdown = /*#__PURE__*/emotion_react_browser_esm_css("background:#fff;&&>button{aspect-ratio:1;padding:0;display:flex;align-items:center;justify-content:center;", rtl({ + borderRadius: `2px 0 0 2px` +}, { + borderRadius: `0 2px 2px 0` +})(), " border:", config_values.borderWidth, " solid ", COLORS.ui.border, ";&:focus,&:hover:not( :disabled ){", focusBoxShadow, " border-color:", COLORS.ui.borderFocus, ";z-index:1;position:relative;}}" + ( true ? "" : 0), true ? "" : 0); +const colorIndicatorBorder = border => { + const { + color, + style + } = border || {}; + const fallbackColor = !!style && style !== 'none' ? COLORS.gray[300] : undefined; + return /*#__PURE__*/emotion_react_browser_esm_css("border-style:", style === 'none' ? 'solid' : style, ";border-color:", color || fallbackColor, ";" + ( true ? "" : 0), true ? "" : 0); +}; +const colorIndicatorWrapper = (border, size) => { + const { + style + } = border || {}; + return /*#__PURE__*/emotion_react_browser_esm_css("border-radius:9999px;border:2px solid transparent;", style ? colorIndicatorBorder(border) : undefined, " width:", size === '__unstable-large' ? '24px' : '22px', ";height:", size === '__unstable-large' ? '24px' : '22px', ";padding:", size === '__unstable-large' ? '2px' : '1px', ";&>span{height:", space(4), ";width:", space(4), ";background:linear-gradient(\n\t\t\t\t-45deg,\n\t\t\t\ttransparent 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 52%,\n\t\t\t\ttransparent 52%\n\t\t\t);}" + ( true ? "" : 0), true ? "" : 0); +}; + +// Must equal $color-palette-circle-size from: +// @wordpress/components/src/circular-option-picker/style.scss +const swatchSize = 28; +const swatchGap = 12; +const borderControlPopoverControls = /*#__PURE__*/emotion_react_browser_esm_css("width:", swatchSize * 6 + swatchGap * 5, "px;>div:first-of-type>", StyledLabel, "{margin-bottom:0;", styles_labelStyles, ";}&& ", StyledLabel, "+button:not( .has-text ){min-width:24px;padding:0;}" + ( true ? "" : 0), true ? "" : 0); +const borderControlPopoverContent = /*#__PURE__*/emotion_react_browser_esm_css( true ? "" : 0, true ? "" : 0); +const borderColorIndicator = /*#__PURE__*/emotion_react_browser_esm_css( true ? "" : 0, true ? "" : 0); +const resetButton = /*#__PURE__*/emotion_react_browser_esm_css("justify-content:center;width:100%;&&{border-top:", config_values.borderWidth, " solid ", COLORS.gray[400], ";border-top-left-radius:0;border-top-right-radius:0;height:40px;}" + ( true ? "" : 0), true ? "" : 0); +const borderSlider = () => /*#__PURE__*/emotion_react_browser_esm_css("flex:1 1 60%;", rtl({ + marginRight: space(3) +})(), ";" + ( true ? "" : 0), true ? "" : 0); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/unit-control/utils.js /** @@ -44201,6 +40534,114 @@ const allUnits = { label: isWeb ? 'pt' : (0,external_wp_i18n_namespaceObject.__)('Points (pt)'), a11yLabel: (0,external_wp_i18n_namespaceObject.__)('Points (pt)'), step: 1 + }, + svw: { + value: 'svw', + label: isWeb ? 'svw' : (0,external_wp_i18n_namespaceObject.__)('Small viewport width (svw)'), + a11yLabel: (0,external_wp_i18n_namespaceObject.__)('Small viewport width (svw)'), + step: 0.1 + }, + svh: { + value: 'svh', + label: isWeb ? 'svh' : (0,external_wp_i18n_namespaceObject.__)('Small viewport height (svh)'), + a11yLabel: (0,external_wp_i18n_namespaceObject.__)('Small viewport height (svh)'), + step: 0.1 + }, + svi: { + value: 'svi', + label: isWeb ? 'svi' : (0,external_wp_i18n_namespaceObject.__)('Viewport smallest size in the inline direction (svi)'), + a11yLabel: (0,external_wp_i18n_namespaceObject.__)('Small viewport width or height (svi)'), + step: 0.1 + }, + svb: { + value: 'svb', + label: isWeb ? 'svb' : (0,external_wp_i18n_namespaceObject.__)('Viewport smallest size in the block direction (svb)'), + a11yLabel: (0,external_wp_i18n_namespaceObject.__)('Small viewport width or height (svb)'), + step: 0.1 + }, + svmin: { + value: 'svmin', + label: isWeb ? 'svmin' : (0,external_wp_i18n_namespaceObject.__)('Small viewport smallest dimension (svmin)'), + a11yLabel: (0,external_wp_i18n_namespaceObject.__)('Small viewport smallest dimension (svmin)'), + step: 0.1 + }, + lvw: { + value: 'lvw', + label: isWeb ? 'lvw' : (0,external_wp_i18n_namespaceObject.__)('Large viewport width (lvw)'), + a11yLabel: (0,external_wp_i18n_namespaceObject.__)('Large viewport width (lvw)'), + step: 0.1 + }, + lvh: { + value: 'lvh', + label: isWeb ? 'lvh' : (0,external_wp_i18n_namespaceObject.__)('Large viewport height (lvh)'), + a11yLabel: (0,external_wp_i18n_namespaceObject.__)('Large viewport height (lvh)'), + step: 0.1 + }, + lvi: { + value: 'lvi', + label: isWeb ? 'lvi' : (0,external_wp_i18n_namespaceObject.__)('Large viewport width or height (lvi)'), + a11yLabel: (0,external_wp_i18n_namespaceObject.__)('Large viewport width or height (lvi)'), + step: 0.1 + }, + lvb: { + value: 'lvb', + label: isWeb ? 'lvb' : (0,external_wp_i18n_namespaceObject.__)('Large viewport width or height (lvb)'), + a11yLabel: (0,external_wp_i18n_namespaceObject.__)('Large viewport width or height (lvb)'), + step: 0.1 + }, + lvmin: { + value: 'lvmin', + label: isWeb ? 'lvmin' : (0,external_wp_i18n_namespaceObject.__)('Large viewport smallest dimension (lvmin)'), + a11yLabel: (0,external_wp_i18n_namespaceObject.__)('Large viewport smallest dimension (lvmin)'), + step: 0.1 + }, + dvw: { + value: 'dvw', + label: isWeb ? 'dvw' : (0,external_wp_i18n_namespaceObject.__)('Dynamic viewport width (dvw)'), + a11yLabel: (0,external_wp_i18n_namespaceObject.__)('Dynamic viewport width (dvw)'), + step: 0.1 + }, + dvh: { + value: 'dvh', + label: isWeb ? 'dvh' : (0,external_wp_i18n_namespaceObject.__)('Dynamic viewport height (dvh)'), + a11yLabel: (0,external_wp_i18n_namespaceObject.__)('Dynamic viewport height (dvh)'), + step: 0.1 + }, + dvi: { + value: 'dvi', + label: isWeb ? 'dvi' : (0,external_wp_i18n_namespaceObject.__)('Dynamic viewport width or height (dvi)'), + a11yLabel: (0,external_wp_i18n_namespaceObject.__)('Dynamic viewport width or height (dvi)'), + step: 0.1 + }, + dvb: { + value: 'dvb', + label: isWeb ? 'dvb' : (0,external_wp_i18n_namespaceObject.__)('Dynamic viewport width or height (dvb)'), + a11yLabel: (0,external_wp_i18n_namespaceObject.__)('Dynamic viewport width or height (dvb)'), + step: 0.1 + }, + dvmin: { + value: 'dvmin', + label: isWeb ? 'dvmin' : (0,external_wp_i18n_namespaceObject.__)('Dynamic viewport smallest dimension (dvmin)'), + a11yLabel: (0,external_wp_i18n_namespaceObject.__)('Dynamic viewport smallest dimension (dvmin)'), + step: 0.1 + }, + dvmax: { + value: 'dvmax', + label: isWeb ? 'dvmax' : (0,external_wp_i18n_namespaceObject.__)('Dynamic viewport largest dimension (dvmax)'), + a11yLabel: (0,external_wp_i18n_namespaceObject.__)('Dynamic viewport largest dimension (dvmax)'), + step: 0.1 + }, + svmax: { + value: 'svmax', + label: isWeb ? 'svmax' : (0,external_wp_i18n_namespaceObject.__)('Small viewport largest dimension (svmax)'), + a11yLabel: (0,external_wp_i18n_namespaceObject.__)('Small viewport largest dimension (svmax)'), + step: 0.1 + }, + lvmax: { + value: 'lvmax', + label: isWeb ? 'lvmax' : (0,external_wp_i18n_namespaceObject.__)('Large viewport largest dimension (lvmax)'), + a11yLabel: (0,external_wp_i18n_namespaceObject.__)('Large viewport largest dimension (lvmax)'), + step: 0.1 } }; @@ -44444,8 +40885,8 @@ function useBorderControlDropdown(props) { // Generate class names. const cx = useCx(); const classes = (0,external_wp_element_namespaceObject.useMemo)(() => { - return cx(borderControlDropdown(size), className); - }, [className, cx, size]); + return cx(borderControlDropdown, className); + }, [className, cx]); const indicatorClassName = (0,external_wp_element_namespaceObject.useMemo)(() => { return cx(borderColorIndicator); }, [cx]); @@ -44476,6 +40917,7 @@ function useBorderControlDropdown(props) { popoverContentClassName, popoverControlsClassName, resetButtonClassName, + size, __experimentalIsRenderedInSidebar }; } @@ -44573,6 +41015,7 @@ const BorderControlDropdown = (props, forwardedRef) => { enableStyle, indicatorClassName, indicatorWrapperClassName, + isStyleSettable, onReset, onColorChange, onStyleChange, @@ -44580,6 +41023,7 @@ const BorderControlDropdown = (props, forwardedRef) => { popoverControlsClassName, resetButtonClassName, showDropdownHeader, + size, __unstablePopoverProps, ...otherProps } = useBorderControlDropdown(props); @@ -44593,32 +41037,33 @@ const BorderControlDropdown = (props, forwardedRef) => { const dropdownPosition = __experimentalIsRenderedInSidebar ? 'bottom left' : undefined; const renderToggle = ({ onToggle - }) => (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }) => (0,external_React_.createElement)(build_module_button, { onClick: onToggle, variant: "tertiary", "aria-label": toggleAriaLabel, tooltipPosition: dropdownPosition, label: (0,external_wp_i18n_namespaceObject.__)('Border color and style picker'), - showTooltip: true - }, (0,external_wp_element_namespaceObject.createElement)("span", { + showTooltip: true, + __next40pxDefaultSize: size === '__unstable-large' ? true : false + }, (0,external_React_.createElement)("span", { className: indicatorWrapperClassName - }, (0,external_wp_element_namespaceObject.createElement)(color_indicator, { + }, (0,external_React_.createElement)(color_indicator, { className: indicatorClassName, colorValue: color }))); const renderContent = ({ onClose - }) => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(dropdown_content_wrapper, { + }) => (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(dropdown_content_wrapper, { paddingSize: "medium" - }, (0,external_wp_element_namespaceObject.createElement)(v_stack_component, { + }, (0,external_React_.createElement)(v_stack_component, { className: popoverControlsClassName, spacing: 6 - }, showDropdownHeader ? (0,external_wp_element_namespaceObject.createElement)(h_stack_component, null, (0,external_wp_element_namespaceObject.createElement)(StyledLabel, null, (0,external_wp_i18n_namespaceObject.__)('Border color')), (0,external_wp_element_namespaceObject.createElement)(build_module_button, { - isSmall: true, + }, showDropdownHeader ? (0,external_React_.createElement)(h_stack_component, null, (0,external_React_.createElement)(StyledLabel, null, (0,external_wp_i18n_namespaceObject.__)('Border color')), (0,external_React_.createElement)(build_module_button, { + size: "small", label: (0,external_wp_i18n_namespaceObject.__)('Close border color'), icon: close_small, onClick: onClose - })) : undefined, (0,external_wp_element_namespaceObject.createElement)(color_palette, { + })) : undefined, (0,external_React_.createElement)(color_palette, { className: popoverContentClassName, value: color, onChange: onColorChange, @@ -44627,13 +41072,13 @@ const BorderControlDropdown = (props, forwardedRef) => { __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar, clearable: false, enableAlpha: enableAlpha - }), enableStyle && (0,external_wp_element_namespaceObject.createElement)(border_control_style_picker_component, { + }), enableStyle && isStyleSettable && (0,external_React_.createElement)(border_control_style_picker_component, { label: (0,external_wp_i18n_namespaceObject.__)('Style'), value: style, onChange: onStyleChange - }))), showResetButton && (0,external_wp_element_namespaceObject.createElement)(dropdown_content_wrapper, { + }))), showResetButton && (0,external_React_.createElement)(dropdown_content_wrapper, { paddingSize: "none" - }, (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }, (0,external_React_.createElement)(build_module_button, { className: resetButtonClassName, variant: "tertiary", onClick: () => { @@ -44641,7 +41086,7 @@ const BorderControlDropdown = (props, forwardedRef) => { onClose(); } }, (0,external_wp_i18n_namespaceObject.__)('Reset')))); - return (0,external_wp_element_namespaceObject.createElement)(dropdown, { + return (0,external_React_.createElement)(dropdown, { renderToggle: renderToggle, renderContent: renderContent, popoverProps: { @@ -44652,7 +41097,7 @@ const BorderControlDropdown = (props, forwardedRef) => { }); }; const ConnectedBorderControlDropdown = contextConnect(BorderControlDropdown, 'BorderControlDropdown'); -/* harmony default export */ var border_control_dropdown_component = (ConnectedBorderControlDropdown); +/* harmony default export */ const border_control_dropdown_component = (ConnectedBorderControlDropdown); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/unit-control/unit-select-control.js @@ -44681,7 +41126,7 @@ function UnitSelectControl({ ...props }, ref) { if (!hasUnits(units) || units?.length === 1) { - return (0,external_wp_element_namespaceObject.createElement)(UnitLabel, { + return (0,external_React_.createElement)(UnitLabel, { className: "components-unit-control__unit-label", selectSize: size }, unit); @@ -44697,7 +41142,7 @@ function UnitSelectControl({ }); }; const classes = classnames_default()('components-unit-control__select', className); - return (0,external_wp_element_namespaceObject.createElement)(UnitSelect, { + return (0,external_React_.createElement)(UnitSelect, { ref: ref, className: classes, onChange: handleOnChange, @@ -44705,12 +41150,12 @@ function UnitSelectControl({ tabIndex: isTabbable ? undefined : -1, value: unit, ...props - }, units.map(option => (0,external_wp_element_namespaceObject.createElement)("option", { + }, units.map(option => (0,external_React_.createElement)("option", { value: option.value, key: option.value }, option.label))); } -/* harmony default export */ var unit_select_control = ((0,external_wp_element_namespaceObject.forwardRef)(UnitSelectControl)); +/* harmony default export */ const unit_select_control = ((0,external_wp_element_namespaceObject.forwardRef)(UnitSelectControl)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/unit-control/index.js @@ -44736,6 +41181,7 @@ function UnitSelectControl({ + function UnforwardedUnitControl(unitControlProps, forwardedRef) { const { __unstableStateReducer, @@ -44757,7 +41203,7 @@ function UnforwardedUnitControl(unitControlProps, forwardedRef) { value: valueProp, onFocus: onFocusProp, ...props - } = unitControlProps; + } = useDeprecated36pxDefaultSizeProp(unitControlProps); if ('unit' in unitControlProps) { external_wp_deprecated_default()('UnitControl unit prop', { since: '5.6', @@ -44833,13 +41279,13 @@ function UnforwardedUnitControl(unitControlProps, forwardedRef) { }; } const refInputSuffix = (0,external_wp_element_namespaceObject.useRef)(null); - const inputSuffix = !disableUnits ? (0,external_wp_element_namespaceObject.createElement)(unit_select_control, { + const inputSuffix = !disableUnits ? (0,external_React_.createElement)(unit_select_control, { ref: refInputSuffix, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Select unit'), disabled: disabled, isUnitSelectTabbable: isUnitSelectTabbable, onChange: handleOnUnitChange, - size: size, + size: ['small', 'compact'].includes(size) || size === 'default' && !props.__next40pxDefaultSize ? 'small' : 'default', unit: unit, units: units, onFocus: onFocusProp, @@ -44856,7 +41302,7 @@ function UnforwardedUnitControl(unitControlProps, forwardedRef) { const activeUnit = units.find(option => option.value === unit); step = (_activeUnit$step = activeUnit?.step) !== null && _activeUnit$step !== void 0 ? _activeUnit$step : 1; } - return (0,external_wp_element_namespaceObject.createElement)(ValueInput, { + return (0,external_React_.createElement)(ValueInput, { ...props, autoComplete: autoComplete, className: classes, @@ -44894,7 +41340,7 @@ function UnforwardedUnitControl(unitControlProps, forwardedRef) { */ const UnitControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedUnitControl); -/* harmony default export */ var unit_control = (UnitControl); +/* harmony default export */ const unit_control = (UnitControl); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/border-control/border-control/hook.js /** @@ -44909,15 +41355,12 @@ const UnitControl = (0,external_wp_element_namespaceObject.forwardRef)(Unforward -const sanitizeBorder = border => { - const hasNoWidth = border?.width === undefined || border.width === ''; - const hasNoColor = border?.color === undefined; - - // If width and color are undefined, unset any style selection as well. - if (hasNoWidth && hasNoColor) { - return undefined; - } - return border; +// If either width or color are defined, the border is considered valid +// and a border style can be set as well. +const isValidBorder = border => { + const hasWidth = border?.width !== undefined && border.width !== ''; + const hasColor = border?.color !== undefined; + return hasWidth || hasColor; }; function useBorderControl(props) { const { @@ -44932,16 +41375,20 @@ function useBorderControl(props) { value: border, width, __experimentalIsRenderedInSidebar = false, + __next40pxDefaultSize, ...otherProps } = useContextSystem(props, 'BorderControl'); + const computedSize = size === 'default' && __next40pxDefaultSize ? '__unstable-large' : size; const [widthValue, originalWidthUnit] = parseQuantityAndUnitFromRawValue(border?.width); const widthUnit = originalWidthUnit || 'px'; const hadPreviousZeroWidth = widthValue === 0; const [colorSelection, setColorSelection] = (0,external_wp_element_namespaceObject.useState)(); const [styleSelection, setStyleSelection] = (0,external_wp_element_namespaceObject.useState)(); + const isStyleSettable = shouldSanitizeBorder ? isValidBorder(border) : true; const onBorderChange = (0,external_wp_element_namespaceObject.useCallback)(newBorder => { - if (shouldSanitizeBorder) { - return onChange(sanitizeBorder(newBorder)); + if (shouldSanitizeBorder && !isValidBorder(newBorder)) { + onChange(undefined); + return; } onChange(newBorder); }, [onChange, shouldSanitizeBorder]); @@ -44998,9 +41445,9 @@ function useBorderControl(props) { } const innerWrapperClassName = (0,external_wp_element_namespaceObject.useMemo)(() => { const widthStyle = !!wrapperWidth && styles_wrapperWidth; - const heightStyle = wrapperHeight(size); + const heightStyle = wrapperHeight(computedSize); return cx(innerWrapper(), widthStyle, heightStyle); - }, [wrapperWidth, cx, size]); + }, [wrapperWidth, cx, computedSize]); const sliderClassName = (0,external_wp_element_namespaceObject.useMemo)(() => { return cx(borderSlider()); }, [cx]); @@ -45012,6 +41459,7 @@ function useBorderControl(props) { enableStyle, innerWrapperClassName, inputWidth: wrapperWidth, + isStyleSettable, onBorderChange, onSliderChange, onWidthChange, @@ -45020,8 +41468,9 @@ function useBorderControl(props) { value: border, widthUnit, widthValue, - size, - __experimentalIsRenderedInSidebar + size: computedSize, + __experimentalIsRenderedInSidebar, + __next40pxDefaultSize }; } @@ -45052,14 +41501,15 @@ const BorderLabel = props => { if (!label) { return null; } - return hideLabelFromVision ? (0,external_wp_element_namespaceObject.createElement)(visually_hidden_component, { + return hideLabelFromVision ? (0,external_React_.createElement)(visually_hidden_component, { as: "legend" - }, label) : (0,external_wp_element_namespaceObject.createElement)(StyledLabel, { + }, label) : (0,external_React_.createElement)(StyledLabel, { as: "legend" }, label); }; const UnconnectedBorderControl = (props, forwardedRef) => { const { + __next40pxDefaultSize = false, colors, disableCustomColors, disableUnits, @@ -45068,6 +41518,7 @@ const UnconnectedBorderControl = (props, forwardedRef) => { hideLabelFromVision, innerWrapperClassName, inputWidth, + isStyleSettable, label, onBorderChange, onSliderChange, @@ -45085,24 +41536,25 @@ const UnconnectedBorderControl = (props, forwardedRef) => { __experimentalIsRenderedInSidebar, ...otherProps } = useBorderControl(props); - return (0,external_wp_element_namespaceObject.createElement)(component, { + return (0,external_React_.createElement)(component, { as: "fieldset", ...otherProps, ref: forwardedRef - }, (0,external_wp_element_namespaceObject.createElement)(BorderLabel, { + }, (0,external_React_.createElement)(BorderLabel, { label: label, hideLabelFromVision: hideLabelFromVision - }), (0,external_wp_element_namespaceObject.createElement)(h_stack_component, { + }), (0,external_React_.createElement)(h_stack_component, { spacing: 4, className: innerWrapperClassName - }, (0,external_wp_element_namespaceObject.createElement)(unit_control, { - prefix: (0,external_wp_element_namespaceObject.createElement)(border_control_dropdown_component, { + }, (0,external_React_.createElement)(unit_control, { + prefix: (0,external_React_.createElement)(border_control_dropdown_component, { border: border, colors: colors, __unstablePopoverProps: __unstablePopoverProps, disableCustomColors: disableCustomColors, enableAlpha: enableAlpha, enableStyle: enableStyle, + isStyleSettable: isStyleSettable, onChange: onBorderChange, previousStyleSelection: previousStyleSelection, showDropdownHeader: showDropdownHeader, @@ -45118,7 +41570,7 @@ const UnconnectedBorderControl = (props, forwardedRef) => { disableUnits: disableUnits, __unstableInputWidth: inputWidth, size: size - }), withSlider && (0,external_wp_element_namespaceObject.createElement)(range_control, { + }), withSlider && (0,external_React_.createElement)(range_control, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Border width'), hideLabelFromVision: true, @@ -45129,7 +41581,8 @@ const UnconnectedBorderControl = (props, forwardedRef) => { onChange: onSliderChange, step: ['px', '%'].includes(widthUnit) ? 1 : 0.1, value: widthValue || undefined, - withInputField: false + withInputField: false, + __next40pxDefaultSize: __next40pxDefaultSize }))); }; @@ -45168,7 +41621,7 @@ const UnconnectedBorderControl = (props, forwardedRef) => { * ``` */ const BorderControl = contextConnect(UnconnectedBorderControl, 'BorderControl'); -/* harmony default export */ var border_control_component = (BorderControl); +/* harmony default export */ const border_control_component = (BorderControl); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/grid/utils.js /** @@ -45305,7 +41758,7 @@ function useGrid(props) { function UnconnectedGrid(props, forwardedRef) { const gridProps = useGrid(props); - return (0,external_wp_element_namespaceObject.createElement)(component, { + return (0,external_React_.createElement)(component, { ...gridProps, ref: forwardedRef }); @@ -45332,7 +41785,7 @@ function UnconnectedGrid(props, forwardedRef) { * ``` */ const Grid = contextConnect(UnconnectedGrid, 'Grid'); -/* harmony default export */ var grid_component = (Grid); +/* harmony default export */ const grid_component = (Grid); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/border-box-control/border-box-control-split-controls/hook.js /** @@ -45436,14 +41889,14 @@ const BorderBoxControlSplitControls = (props, forwardedRef) => { size }; const mergedRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, forwardedRef]); - return (0,external_wp_element_namespaceObject.createElement)(grid_component, { + return (0,external_React_.createElement)(grid_component, { ...otherProps, ref: mergedRef, gap: 4 - }, (0,external_wp_element_namespaceObject.createElement)(border_box_control_visualizer_component, { + }, (0,external_React_.createElement)(border_box_control_visualizer_component, { value: value, size: size - }), (0,external_wp_element_namespaceObject.createElement)(border_control_component, { + }), (0,external_React_.createElement)(border_control_component, { className: centeredClassName, hideLabelFromVision: true, label: (0,external_wp_i18n_namespaceObject.__)('Top border'), @@ -45451,14 +41904,14 @@ const BorderBoxControlSplitControls = (props, forwardedRef) => { __unstablePopoverProps: popoverProps, value: value?.top, ...sharedBorderControlProps - }), (0,external_wp_element_namespaceObject.createElement)(border_control_component, { + }), (0,external_React_.createElement)(border_control_component, { hideLabelFromVision: true, label: (0,external_wp_i18n_namespaceObject.__)('Left border'), onChange: newBorder => onChange(newBorder, 'left'), __unstablePopoverProps: popoverProps, value: value?.left, ...sharedBorderControlProps - }), (0,external_wp_element_namespaceObject.createElement)(border_control_component, { + }), (0,external_React_.createElement)(border_control_component, { className: rightAlignedClassName, hideLabelFromVision: true, label: (0,external_wp_i18n_namespaceObject.__)('Right border'), @@ -45466,7 +41919,7 @@ const BorderBoxControlSplitControls = (props, forwardedRef) => { __unstablePopoverProps: popoverProps, value: value?.right, ...sharedBorderControlProps - }), (0,external_wp_element_namespaceObject.createElement)(border_control_component, { + }), (0,external_React_.createElement)(border_control_component, { className: centeredClassName, hideLabelFromVision: true, label: (0,external_wp_i18n_namespaceObject.__)('Bottom border'), @@ -45477,10 +41930,10 @@ const BorderBoxControlSplitControls = (props, forwardedRef) => { })); }; const ConnectedBorderBoxControlSplitControls = contextConnect(BorderBoxControlSplitControls, 'BorderBoxControlSplitControls'); -/* harmony default export */ var border_box_control_split_controls_component = (ConnectedBorderBoxControlSplitControls); +/* harmony default export */ const border_box_control_split_controls_component = (ConnectedBorderBoxControlSplitControls); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/unit-values.js -const UNITED_VALUE_REGEX = /^([\d.\-+]*)\s*(fr|cm|mm|Q|in|pc|pt|px|em|ex|ch|rem|lh|vw|vh|vmin|vmax|%|cap|ic|rlh|vi|vb|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?$/; +const UNITED_VALUE_REGEX = /^([\d.\-+]*)\s*(fr|cm|mm|Q|in|pc|pt|px|em|ex|ch|rem|lh|vw|vh|vmin|vmax|%|cap|ic|rlh|vi|vb|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx|svw|lvw|dvw|svh|lvh|dvh|svi|lvi|dvi|svb|lvb|dvb|svmin|lvmin|dvmin|svmax|lvmax|dvmax)?$/; /** * Parses a number and unit from a value. @@ -45685,8 +42138,10 @@ function useBorderBoxControl(props) { size = 'default', value, __experimentalIsRenderedInSidebar = false, + __next40pxDefaultSize, ...otherProps } = useContextSystem(props, 'BorderBoxControl'); + const computedSize = size === 'default' && __next40pxDefaultSize ? '__unstable-large' : size; const mixedBorders = hasMixedBorders(value); const splitBorders = hasSplitBorders(value); const linkedValue = splitBorders ? getCommonBorder(value) : value; @@ -45770,7 +42225,7 @@ function useBorderBoxControl(props) { onSplitChange, toggleLinked, linkedValue, - size, + size: computedSize, splitValue, wrapperClassName, __experimentalIsRenderedInSidebar @@ -45805,9 +42260,9 @@ const component_BorderLabel = props => { if (!label) { return null; } - return hideLabelFromVision ? (0,external_wp_element_namespaceObject.createElement)(visually_hidden_component, { + return hideLabelFromVision ? (0,external_React_.createElement)(visually_hidden_component, { as: "label" - }, label) : (0,external_wp_element_namespaceObject.createElement)(StyledLabel, null, label); + }, label) : (0,external_React_.createElement)(StyledLabel, null, label); }; const UnconnectedBorderBoxControl = (props, forwardedRef) => { const { @@ -45847,16 +42302,16 @@ const UnconnectedBorderBoxControl = (props, forwardedRef) => { shift: true } : undefined, [popoverPlacement, popoverOffset, popoverAnchor]); const mergedRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, forwardedRef]); - return (0,external_wp_element_namespaceObject.createElement)(component, { + return (0,external_React_.createElement)(component, { className: className, ...otherProps, ref: mergedRef - }, (0,external_wp_element_namespaceObject.createElement)(component_BorderLabel, { + }, (0,external_React_.createElement)(component_BorderLabel, { label: label, hideLabelFromVision: hideLabelFromVision - }), (0,external_wp_element_namespaceObject.createElement)(component, { + }), (0,external_React_.createElement)(component, { className: wrapperClassName - }, isLinked ? (0,external_wp_element_namespaceObject.createElement)(border_control_component, { + }, isLinked ? (0,external_React_.createElement)(border_control_component, { className: linkedControlClassName, colors: colors, disableUnits: disableUnits, @@ -45873,7 +42328,7 @@ const UnconnectedBorderBoxControl = (props, forwardedRef) => { width: size === '__unstable-large' ? '116px' : '110px', __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar, size: size - }) : (0,external_wp_element_namespaceObject.createElement)(border_box_control_split_controls_component, { + }) : (0,external_React_.createElement)(border_box_control_split_controls_component, { colors: colors, disableCustomColors: disableCustomColors, enableAlpha: enableAlpha, @@ -45884,7 +42339,7 @@ const UnconnectedBorderBoxControl = (props, forwardedRef) => { value: splitValue, __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar, size: size - }), (0,external_wp_element_namespaceObject.createElement)(border_box_control_linked_button_component, { + }), (0,external_React_.createElement)(border_box_control_linked_button_component, { onClick: toggleLinked, isLinked: isLinked, size: size @@ -45941,168 +42396,168 @@ const UnconnectedBorderBoxControl = (props, forwardedRef) => { * ``` */ const BorderBoxControl = contextConnect(UnconnectedBorderBoxControl, 'BorderBoxControl'); -/* harmony default export */ var border_box_control_component = (BorderBoxControl); +/* harmony default export */ const border_box_control_component = (BorderBoxControl); -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/styles/box-control-styles.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/styles/box-control-icon-styles.js -function box_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } +function box_control_icon_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /** * External dependencies */ -/** - * Internal dependencies - */ - - - -const box_control_styles_Root = emotion_styled_base_browser_esm("div", true ? { - target: "e1jovhle6" +const box_control_icon_styles_Root = emotion_styled_base_browser_esm("span", true ? { + target: "e1j5nr4z8" } : 0)( true ? { - name: "14bvcyk", - styles: "box-sizing:border-box;max-width:235px;padding-bottom:12px;width:100%" + name: "1w884gc", + styles: "box-sizing:border-box;display:block;width:24px;height:24px;position:relative;padding:4px" } : 0); -const Header = /*#__PURE__*/emotion_styled_base_browser_esm(flex_component, true ? { - target: "e1jovhle5" +const Viewbox = emotion_styled_base_browser_esm("span", true ? { + target: "e1j5nr4z7" } : 0)( true ? { - name: "5bhc30", - styles: "margin-bottom:8px" + name: "i6vjox", + styles: "box-sizing:border-box;display:block;position:relative;width:100%;height:100%" } : 0); -const HeaderControlWrapper = /*#__PURE__*/emotion_styled_base_browser_esm(flex_component, true ? { - target: "e1jovhle4" +const strokeFocus = ({ + isFocused +}) => { + return /*#__PURE__*/emotion_react_browser_esm_css({ + backgroundColor: 'currentColor', + opacity: isFocused ? 1 : 0.3 + }, true ? "" : 0, true ? "" : 0); +}; +const Stroke = emotion_styled_base_browser_esm("span", true ? { + target: "e1j5nr4z6" +} : 0)("box-sizing:border-box;display:block;pointer-events:none;position:absolute;", strokeFocus, ";" + ( true ? "" : 0)); +const VerticalStroke = /*#__PURE__*/emotion_styled_base_browser_esm(Stroke, true ? { + target: "e1j5nr4z5" } : 0)( true ? { - name: "aujtid", - styles: "min-height:30px;gap:0" + name: "1k2w39q", + styles: "bottom:3px;top:3px;width:2px" } : 0); -const UnitControlWrapper = emotion_styled_base_browser_esm("div", true ? { - target: "e1jovhle3" +const HorizontalStroke = /*#__PURE__*/emotion_styled_base_browser_esm(Stroke, true ? { + target: "e1j5nr4z4" } : 0)( true ? { - name: "112jwab", - styles: "box-sizing:border-box;max-width:80px" + name: "1q9b07k", + styles: "height:2px;left:3px;right:3px" } : 0); -const LayoutContainer = /*#__PURE__*/emotion_styled_base_browser_esm(flex_component, true ? { - target: "e1jovhle2" +const TopStroke = /*#__PURE__*/emotion_styled_base_browser_esm(HorizontalStroke, true ? { + target: "e1j5nr4z3" } : 0)( true ? { - name: "xy18ro", - styles: "justify-content:center;padding-top:8px" + name: "abcix4", + styles: "top:0" } : 0); -const Layout = /*#__PURE__*/emotion_styled_base_browser_esm(flex_component, true ? { - target: "e1jovhle1" +const RightStroke = /*#__PURE__*/emotion_styled_base_browser_esm(VerticalStroke, true ? { + target: "e1j5nr4z2" } : 0)( true ? { - name: "3tw5wk", - styles: "position:relative;height:100%;width:100%;justify-content:flex-start" + name: "1wf8jf", + styles: "right:0" +} : 0); +const BottomStroke = /*#__PURE__*/emotion_styled_base_browser_esm(HorizontalStroke, true ? { + target: "e1j5nr4z1" +} : 0)( true ? { + name: "8tapst", + styles: "bottom:0" +} : 0); +const LeftStroke = /*#__PURE__*/emotion_styled_base_browser_esm(VerticalStroke, true ? { + target: "e1j5nr4z0" +} : 0)( true ? { + name: "1ode3cm", + styles: "left:0" } : 0); -var box_control_styles_ref = true ? { - name: "1ch9yvl", - styles: "border-radius:0" -} : 0; -var box_control_styles_ref2 = true ? { - name: "tg3mx0", - styles: "border-radius:2px" -} : 0; -const unitControlBorderRadiusStyles = ({ - isFirst, - isLast, - isOnly -}) => { - if (isFirst) { - return rtl({ - borderTopRightRadius: 0, - borderBottomRightRadius: 0 - })(); - } - if (isLast) { - return rtl({ - borderTopLeftRadius: 0, - borderBottomLeftRadius: 0 - })(); - } - if (isOnly) { - return box_control_styles_ref2; - } - return box_control_styles_ref; -}; -const unitControlMarginStyles = ({ - isFirst, - isOnly -}) => { - const marginLeft = isFirst || isOnly ? 0 : -1; - return rtl({ - marginLeft - })(); -}; -const box_control_styles_UnitControl = /*#__PURE__*/emotion_styled_base_browser_esm(unit_control, true ? { - target: "e1jovhle0" -} : 0)("max-width:60px;", unitControlBorderRadiusStyles, ";", unitControlMarginStyles, ";" + ( true ? "" : 0)); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/unit-control.js - -/** - * External dependencies - */ +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/icon.js /** * Internal dependencies */ -const unit_control_noop = () => {}; -function BoxUnitControl({ - isFirst, - isLast, - isOnly, - onHoverOn = unit_control_noop, - onHoverOff = unit_control_noop, - label, - value, +const BASE_ICON_SIZE = 24; +function BoxControlIcon({ + size = 24, + side = 'all', + sides, ...props }) { - const bindHoverGesture = useHover(({ - event, - ...state - }) => { - if (state.hovering) { - onHoverOn(event, state); - } else { - onHoverOff(event, state); + const isSideDisabled = value => sides?.length && !sides.includes(value); + const hasSide = value => { + if (isSideDisabled(value)) { + return false; } - }); - return (0,external_wp_element_namespaceObject.createElement)(UnitControlWrapper, { - ...bindHoverGesture() - }, (0,external_wp_element_namespaceObject.createElement)(unit_control_Tooltip, { - text: label - }, (0,external_wp_element_namespaceObject.createElement)(box_control_styles_UnitControl, { - "aria-label": label, - className: "component-box-control__unit-control", - isFirst: isFirst, - isLast: isLast, - isOnly: isOnly, - isPressEnterToChange: true, - isResetValueOnUnitChange: false, - value: value, + return side === 'all' || side === value; + }; + const top = hasSide('top') || hasSide('vertical'); + const right = hasSide('right') || hasSide('horizontal'); + const bottom = hasSide('bottom') || hasSide('vertical'); + const left = hasSide('left') || hasSide('horizontal'); + + // Simulates SVG Icon scaling. + const scale = size / BASE_ICON_SIZE; + return (0,external_React_.createElement)(box_control_icon_styles_Root, { + style: { + transform: `scale(${scale})` + }, ...props + }, (0,external_React_.createElement)(Viewbox, null, (0,external_React_.createElement)(TopStroke, { + isFocused: top + }), (0,external_React_.createElement)(RightStroke, { + isFocused: right + }), (0,external_React_.createElement)(BottomStroke, { + isFocused: bottom + }), (0,external_React_.createElement)(LeftStroke, { + isFocused: left }))); } -function unit_control_Tooltip({ - children, - text -}) { - if (!text) return children; - /** - * Wrapping the children in a `<div />` as Tooltip as it attempts - * to render the <UnitControl />. Using a plain `<div />` appears to - * resolve this issue. - * - * Originally discovered and referenced here: - * https://github.com/WordPress/gutenberg/pull/24966#issuecomment-685875026 - */ - return (0,external_wp_element_namespaceObject.createElement)(tooltip, { - text: text, - placement: "top" - }, (0,external_wp_element_namespaceObject.createElement)("div", null, children)); -} +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/styles/box-control-styles.js + +function box_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } +/** + * External dependencies + */ + +/** + * Internal dependencies + */ + + + + + + +const StyledUnitControl = /*#__PURE__*/emotion_styled_base_browser_esm(unit_control, true ? { + target: "e1jovhle5" +} : 0)( true ? { + name: "1ejyr19", + styles: "max-width:90px" +} : 0); +const InputWrapper = /*#__PURE__*/emotion_styled_base_browser_esm(h_stack_component, true ? { + target: "e1jovhle4" +} : 0)( true ? { + name: "1j1lmoi", + styles: "grid-column:1/span 3" +} : 0); +const ResetButton = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_button, true ? { + target: "e1jovhle3" +} : 0)( true ? { + name: "tkya7b", + styles: "grid-area:1/2;justify-self:end" +} : 0); +const LinkedButtonWrapper = emotion_styled_base_browser_esm("div", true ? { + target: "e1jovhle2" +} : 0)( true ? { + name: "1dfa8al", + styles: "grid-area:1/3;justify-self:end" +} : 0); +const FlexedBoxControlIcon = /*#__PURE__*/emotion_styled_base_browser_esm(BoxControlIcon, true ? { + target: "e1jovhle1" +} : 0)( true ? { + name: "ou8xsw", + styles: "flex:0 0 auto" +} : 0); +const FlexedRangeControl = /*#__PURE__*/emotion_styled_base_browser_esm(range_control, true ? { + target: "e1jovhle0" +} : 0)("width:100%;margin-inline-end:", space(2), ";" + ( true ? "" : 0)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/utils.js /** @@ -46114,15 +42569,129 @@ function unit_control_Tooltip({ * Internal dependencies */ +const CUSTOM_VALUE_SETTINGS = { + px: { + max: 300, + step: 1 + }, + '%': { + max: 100, + step: 1 + }, + vw: { + max: 100, + step: 1 + }, + vh: { + max: 100, + step: 1 + }, + em: { + max: 10, + step: 0.1 + }, + rm: { + max: 10, + step: 0.1 + }, + svw: { + max: 100, + step: 1 + }, + lvw: { + max: 100, + step: 1 + }, + dvw: { + max: 100, + step: 1 + }, + svh: { + max: 100, + step: 1 + }, + lvh: { + max: 100, + step: 1 + }, + dvh: { + max: 100, + step: 1 + }, + vi: { + max: 100, + step: 1 + }, + svi: { + max: 100, + step: 1 + }, + lvi: { + max: 100, + step: 1 + }, + dvi: { + max: 100, + step: 1 + }, + vb: { + max: 100, + step: 1 + }, + svb: { + max: 100, + step: 1 + }, + lvb: { + max: 100, + step: 1 + }, + dvb: { + max: 100, + step: 1 + }, + vmin: { + max: 100, + step: 1 + }, + svmin: { + max: 100, + step: 1 + }, + lvmin: { + max: 100, + step: 1 + }, + dvmin: { + max: 100, + step: 1 + }, + vmax: { + max: 100, + step: 1 + }, + svmax: { + max: 100, + step: 1 + }, + lvmax: { + max: 100, + step: 1 + }, + dvmax: { + max: 100, + step: 1 + } +}; const LABELS = { - all: (0,external_wp_i18n_namespaceObject.__)('All'), - top: (0,external_wp_i18n_namespaceObject.__)('Top'), - bottom: (0,external_wp_i18n_namespaceObject.__)('Bottom'), - left: (0,external_wp_i18n_namespaceObject.__)('Left'), - right: (0,external_wp_i18n_namespaceObject.__)('Right'), + all: (0,external_wp_i18n_namespaceObject.__)('All sides'), + top: (0,external_wp_i18n_namespaceObject.__)('Top side'), + bottom: (0,external_wp_i18n_namespaceObject.__)('Bottom side'), + left: (0,external_wp_i18n_namespaceObject.__)('Left side'), + right: (0,external_wp_i18n_namespaceObject.__)('Right side'), mixed: (0,external_wp_i18n_namespaceObject.__)('Mixed'), - vertical: (0,external_wp_i18n_namespaceObject.__)('Vertical'), - horizontal: (0,external_wp_i18n_namespaceObject.__)('Horizontal') + vertical: (0,external_wp_i18n_namespaceObject.__)('Top and bottom sides'), + horizontal: (0,external_wp_i18n_namespaceObject.__)('Left and right sides') }; const DEFAULT_VALUES = { top: undefined, @@ -46303,38 +42872,49 @@ function applyValueToSides(currentValues, newValue, sides) { ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/all-input-control.js /** + * WordPress dependencies + */ + +/** * Internal dependencies */ + + const all_input_control_noop = () => {}; function AllInputControl({ + __next40pxDefaultSize, onChange = all_input_control_noop, onFocus = all_input_control_noop, - onHoverOn = all_input_control_noop, - onHoverOff = all_input_control_noop, values, sides, selectedUnits, setSelectedUnits, ...props }) { + var _CUSTOM_VALUE_SETTING, _CUSTOM_VALUE_SETTING2; + const inputId = (0,external_wp_compose_namespaceObject.useInstanceId)(AllInputControl, 'box-control-input-all'); const allValue = getAllValue(values, selectedUnits, sides); const hasValues = isValuesDefined(values); const isMixed = hasValues && isValuesMixed(values, selectedUnits, sides); const allPlaceholder = isMixed ? LABELS.mixed : undefined; + const [parsedQuantity, parsedUnit] = parseQuantityAndUnitFromRawValue(allValue); const handleOnFocus = event => { onFocus(event, { side: 'all' }); }; - const handleOnChange = next => { + const onValueChange = next => { const isNumeric = next !== undefined && !isNaN(parseFloat(next)); const nextValue = isNumeric ? next : undefined; const nextValues = applyValueToSides(values, nextValue, sides); onChange(nextValues); }; + const sliderOnChange = next => { + onValueChange(next !== undefined ? [next, parsedUnit].join('') : undefined); + }; // Set selected unit so it can be used as fallback by unlinked controls // when individual sides do not have a value containing a unit. @@ -46342,39 +42922,42 @@ function AllInputControl({ const newUnits = applyValueToSides(selectedUnits, unit, sides); setSelectedUnits(newUnits); }; - const handleOnHoverOn = () => { - onHoverOn({ - top: true, - bottom: true, - left: true, - right: true - }); - }; - const handleOnHoverOff = () => { - onHoverOff({ - top: false, - bottom: false, - left: false, - right: false - }); - }; - return (0,external_wp_element_namespaceObject.createElement)(BoxUnitControl, { + return (0,external_React_.createElement)(h_stack_component, null, (0,external_React_.createElement)(StyledUnitControl, { ...props, + __next40pxDefaultSize: __next40pxDefaultSize, + className: "component-box-control__unit-control", disableUnits: isMixed, - isOnly: true, + id: inputId, + isPressEnterToChange: true, value: allValue, - onChange: handleOnChange, + onChange: onValueChange, onUnitChange: handleOnUnitChange, onFocus: handleOnFocus, - onHoverOn: handleOnHoverOn, - onHoverOff: handleOnHoverOff, - placeholder: allPlaceholder - }); + placeholder: allPlaceholder, + label: LABELS.all, + hideLabelFromVision: true + }), (0,external_React_.createElement)(FlexedRangeControl, { + __nextHasNoMarginBottom: true, + __next40pxDefaultSize: __next40pxDefaultSize, + "aria-controls": inputId, + label: LABELS.all, + hideLabelFromVision: true, + onChange: sliderOnChange, + min: 0, + max: (_CUSTOM_VALUE_SETTING = CUSTOM_VALUE_SETTINGS[parsedUnit !== null && parsedUnit !== void 0 ? parsedUnit : 'px']?.max) !== null && _CUSTOM_VALUE_SETTING !== void 0 ? _CUSTOM_VALUE_SETTING : 10, + step: (_CUSTOM_VALUE_SETTING2 = CUSTOM_VALUE_SETTINGS[parsedUnit !== null && parsedUnit !== void 0 ? parsedUnit : 'px']?.step) !== null && _CUSTOM_VALUE_SETTING2 !== void 0 ? _CUSTOM_VALUE_SETTING2 : 0.1, + value: parsedQuantity !== null && parsedQuantity !== void 0 ? parsedQuantity : 0, + withInputField: false + })); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/input-controls.js /** + * WordPress dependencies + */ + +/** * Internal dependencies */ @@ -46383,37 +42966,25 @@ function AllInputControl({ const input_controls_noop = () => {}; function BoxInputControls({ + __next40pxDefaultSize, onChange = input_controls_noop, onFocus = input_controls_noop, - onHoverOn = input_controls_noop, - onHoverOff = input_controls_noop, values, selectedUnits, setSelectedUnits, sides, ...props }) { + const generatedId = (0,external_wp_compose_namespaceObject.useInstanceId)(BoxInputControls, 'box-control-input'); const createHandleOnFocus = side => event => { onFocus(event, { side }); }; - const createHandleOnHoverOn = side => () => { - onHoverOn({ - [side]: true - }); - }; - const createHandleOnHoverOff = side => () => { - onHoverOff({ - [side]: false - }); - }; const handleOnChange = nextValues => { onChange(nextValues); }; - const createHandleOnChange = side => (next, { - event - }) => { + const handleOnValueChange = (side, next, extra) => { const nextValues = { ...values }; @@ -46428,7 +42999,7 @@ function BoxInputControls({ // @ts-expect-error - TODO: event.altKey is only present when the change event was // triggered by a keyboard event. Should this feature be implemented differently so // it also works with drag events? - if (event.altKey) { + if (extra?.event.altKey) { switch (side) { case 'top': nextValues.bottom = nextValue; @@ -46456,38 +43027,57 @@ function BoxInputControls({ // Filter sides if custom configuration provided, maintaining default order. const filteredSides = sides?.length ? ALL_SIDES.filter(side => sides.includes(side)) : ALL_SIDES; - const first = filteredSides[0]; - const last = filteredSides[filteredSides.length - 1]; - const only = first === last && first; - return (0,external_wp_element_namespaceObject.createElement)(LayoutContainer, { - className: "component-box-control__input-controls-wrapper" - }, (0,external_wp_element_namespaceObject.createElement)(Layout, { - gap: 0, - align: "top", - className: "component-box-control__input-controls" - }, filteredSides.map(side => { + return (0,external_React_.createElement)(external_React_.Fragment, null, filteredSides.map(side => { + var _CUSTOM_VALUE_SETTING, _CUSTOM_VALUE_SETTING2; const [parsedQuantity, parsedUnit] = parseQuantityAndUnitFromRawValue(values[side]); const computedUnit = values[side] ? parsedUnit : selectedUnits[side]; - return (0,external_wp_element_namespaceObject.createElement)(BoxUnitControl, { + const inputId = [generatedId, side].join('-'); + return (0,external_React_.createElement)(InputWrapper, { + key: `box-control-${side}`, + expanded: true + }, (0,external_React_.createElement)(FlexedBoxControlIcon, { + side: side, + sides: sides + }), (0,external_React_.createElement)(tooltip, { + placement: "top-end", + text: LABELS[side] + }, (0,external_React_.createElement)(StyledUnitControl, { ...props, - isFirst: first === side, - isLast: last === side, - isOnly: only === side, + __next40pxDefaultSize: __next40pxDefaultSize, + className: "component-box-control__unit-control", + id: inputId, + isPressEnterToChange: true, value: [parsedQuantity, computedUnit].join(''), - onChange: createHandleOnChange(side), + onChange: (nextValue, extra) => handleOnValueChange(side, nextValue, extra), onUnitChange: createHandleOnUnitChange(side), onFocus: createHandleOnFocus(side), - onHoverOn: createHandleOnHoverOn(side), - onHoverOff: createHandleOnHoverOff(side), label: LABELS[side], - key: `box-control-${side}` - }); - }))); + hideLabelFromVision: true + })), (0,external_React_.createElement)(FlexedRangeControl, { + __nextHasNoMarginBottom: true, + __next40pxDefaultSize: __next40pxDefaultSize, + "aria-controls": inputId, + label: LABELS[side], + hideLabelFromVision: true, + onChange: newValue => { + handleOnValueChange(side, newValue !== undefined ? [newValue, computedUnit].join('') : undefined); + }, + min: 0, + max: (_CUSTOM_VALUE_SETTING = CUSTOM_VALUE_SETTINGS[computedUnit !== null && computedUnit !== void 0 ? computedUnit : 'px']?.max) !== null && _CUSTOM_VALUE_SETTING !== void 0 ? _CUSTOM_VALUE_SETTING : 10, + step: (_CUSTOM_VALUE_SETTING2 = CUSTOM_VALUE_SETTINGS[computedUnit !== null && computedUnit !== void 0 ? computedUnit : 'px']?.step) !== null && _CUSTOM_VALUE_SETTING2 !== void 0 ? _CUSTOM_VALUE_SETTING2 : 0.1, + value: parsedQuantity !== null && parsedQuantity !== void 0 ? parsedQuantity : 0, + withInputField: false + })); + })); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/axial-input-controls.js /** + * WordPress dependencies + */ + +/** * Internal dependencies */ @@ -46496,16 +43086,16 @@ function BoxInputControls({ const groupedSides = ['vertical', 'horizontal']; function AxialInputControls({ + __next40pxDefaultSize, onChange, onFocus, - onHoverOn, - onHoverOff, values, selectedUnits, setSelectedUnits, sides, ...props }) { + const generatedId = (0,external_wp_compose_namespaceObject.useInstanceId)(AxialInputControls, `box-control-input`); const createHandleOnFocus = side => event => { if (!onFocus) { return; @@ -46514,41 +43104,7 @@ function AxialInputControls({ side }); }; - const createHandleOnHoverOn = side => () => { - if (!onHoverOn) { - return; - } - if (side === 'vertical') { - onHoverOn({ - top: true, - bottom: true - }); - } - if (side === 'horizontal') { - onHoverOn({ - left: true, - right: true - }); - } - }; - const createHandleOnHoverOff = side => () => { - if (!onHoverOff) { - return; - } - if (side === 'vertical') { - onHoverOff({ - top: false, - bottom: false - }); - } - if (side === 'horizontal') { - onHoverOff({ - left: false, - right: false - }); - } - }; - const createHandleOnChange = side => next => { + const handleOnValueChange = (side, next) => { if (!onChange) { return; } @@ -46584,144 +43140,48 @@ function AxialInputControls({ // Filter sides if custom configuration provided, maintaining default order. const filteredSides = sides?.length ? groupedSides.filter(side => sides.includes(side)) : groupedSides; - const first = filteredSides[0]; - const last = filteredSides[filteredSides.length - 1]; - const only = first === last && first; - return (0,external_wp_element_namespaceObject.createElement)(Layout, { - gap: 0, - align: "top", - className: "component-box-control__vertical-horizontal-input-controls" - }, filteredSides.map(side => { + return (0,external_React_.createElement)(external_React_.Fragment, null, filteredSides.map(side => { + var _CUSTOM_VALUE_SETTING, _CUSTOM_VALUE_SETTING2; const [parsedQuantity, parsedUnit] = parseQuantityAndUnitFromRawValue(side === 'vertical' ? values.top : values.left); const selectedUnit = side === 'vertical' ? selectedUnits.top : selectedUnits.left; - return (0,external_wp_element_namespaceObject.createElement)(BoxUnitControl, { + const inputId = [generatedId, side].join('-'); + return (0,external_React_.createElement)(InputWrapper, { + key: side + }, (0,external_React_.createElement)(FlexedBoxControlIcon, { + side: side, + sides: sides + }), (0,external_React_.createElement)(tooltip, { + placement: "top-end", + text: LABELS[side] + }, (0,external_React_.createElement)(StyledUnitControl, { ...props, - isFirst: first === side, - isLast: last === side, - isOnly: only === side, + __next40pxDefaultSize: __next40pxDefaultSize, + className: "component-box-control__unit-control", + id: inputId, + isPressEnterToChange: true, value: [parsedQuantity, selectedUnit !== null && selectedUnit !== void 0 ? selectedUnit : parsedUnit].join(''), - onChange: createHandleOnChange(side), + onChange: newValue => handleOnValueChange(side, newValue), onUnitChange: createHandleOnUnitChange(side), onFocus: createHandleOnFocus(side), - onHoverOn: createHandleOnHoverOn(side), - onHoverOff: createHandleOnHoverOff(side), label: LABELS[side], + hideLabelFromVision: true, key: side - }); + })), (0,external_React_.createElement)(FlexedRangeControl, { + __nextHasNoMarginBottom: true, + __next40pxDefaultSize: __next40pxDefaultSize, + "aria-controls": inputId, + label: LABELS[side], + hideLabelFromVision: true, + onChange: newValue => handleOnValueChange(side, newValue !== undefined ? [newValue, selectedUnit !== null && selectedUnit !== void 0 ? selectedUnit : parsedUnit].join('') : undefined), + min: 0, + max: (_CUSTOM_VALUE_SETTING = CUSTOM_VALUE_SETTINGS[selectedUnit !== null && selectedUnit !== void 0 ? selectedUnit : 'px']?.max) !== null && _CUSTOM_VALUE_SETTING !== void 0 ? _CUSTOM_VALUE_SETTING : 10, + step: (_CUSTOM_VALUE_SETTING2 = CUSTOM_VALUE_SETTINGS[selectedUnit !== null && selectedUnit !== void 0 ? selectedUnit : 'px']?.step) !== null && _CUSTOM_VALUE_SETTING2 !== void 0 ? _CUSTOM_VALUE_SETTING2 : 0.1, + value: parsedQuantity !== null && parsedQuantity !== void 0 ? parsedQuantity : 0, + withInputField: false + })); })); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/styles/box-control-icon-styles.js - -function box_control_icon_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } -/** - * External dependencies - */ - -const box_control_icon_styles_Root = emotion_styled_base_browser_esm("span", true ? { - target: "e1j5nr4z8" -} : 0)( true ? { - name: "1w884gc", - styles: "box-sizing:border-box;display:block;width:24px;height:24px;position:relative;padding:4px" -} : 0); -const Viewbox = emotion_styled_base_browser_esm("span", true ? { - target: "e1j5nr4z7" -} : 0)( true ? { - name: "i6vjox", - styles: "box-sizing:border-box;display:block;position:relative;width:100%;height:100%" -} : 0); -const strokeFocus = ({ - isFocused -}) => { - return /*#__PURE__*/emotion_react_browser_esm_css({ - backgroundColor: 'currentColor', - opacity: isFocused ? 1 : 0.3 - }, true ? "" : 0, true ? "" : 0); -}; -const Stroke = emotion_styled_base_browser_esm("span", true ? { - target: "e1j5nr4z6" -} : 0)("box-sizing:border-box;display:block;pointer-events:none;position:absolute;", strokeFocus, ";" + ( true ? "" : 0)); -const VerticalStroke = /*#__PURE__*/emotion_styled_base_browser_esm(Stroke, true ? { - target: "e1j5nr4z5" -} : 0)( true ? { - name: "1k2w39q", - styles: "bottom:3px;top:3px;width:2px" -} : 0); -const HorizontalStroke = /*#__PURE__*/emotion_styled_base_browser_esm(Stroke, true ? { - target: "e1j5nr4z4" -} : 0)( true ? { - name: "1q9b07k", - styles: "height:2px;left:3px;right:3px" -} : 0); -const TopStroke = /*#__PURE__*/emotion_styled_base_browser_esm(HorizontalStroke, true ? { - target: "e1j5nr4z3" -} : 0)( true ? { - name: "abcix4", - styles: "top:0" -} : 0); -const RightStroke = /*#__PURE__*/emotion_styled_base_browser_esm(VerticalStroke, true ? { - target: "e1j5nr4z2" -} : 0)( true ? { - name: "1wf8jf", - styles: "right:0" -} : 0); -const BottomStroke = /*#__PURE__*/emotion_styled_base_browser_esm(HorizontalStroke, true ? { - target: "e1j5nr4z1" -} : 0)( true ? { - name: "8tapst", - styles: "bottom:0" -} : 0); -const LeftStroke = /*#__PURE__*/emotion_styled_base_browser_esm(VerticalStroke, true ? { - target: "e1j5nr4z0" -} : 0)( true ? { - name: "1ode3cm", - styles: "left:0" -} : 0); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/icon.js - -/** - * Internal dependencies - */ - - -const BASE_ICON_SIZE = 24; -function BoxControlIcon({ - size = 24, - side = 'all', - sides, - ...props -}) { - const isSideDisabled = value => sides?.length && !sides.includes(value); - const hasSide = value => { - if (isSideDisabled(value)) { - return false; - } - return side === 'all' || side === value; - }; - const top = hasSide('top') || hasSide('vertical'); - const right = hasSide('right') || hasSide('horizontal'); - const bottom = hasSide('bottom') || hasSide('vertical'); - const left = hasSide('left') || hasSide('horizontal'); - - // Simulates SVG Icon scaling. - const scale = size / BASE_ICON_SIZE; - return (0,external_wp_element_namespaceObject.createElement)(box_control_icon_styles_Root, { - style: { - transform: `scale(${scale})` - }, - ...props - }, (0,external_wp_element_namespaceObject.createElement)(Viewbox, null, (0,external_wp_element_namespaceObject.createElement)(TopStroke, { - isFocused: top - }), (0,external_wp_element_namespaceObject.createElement)(RightStroke, { - isFocused: right - }), (0,external_wp_element_namespaceObject.createElement)(BottomStroke, { - isFocused: bottom - }), (0,external_wp_element_namespaceObject.createElement)(LeftStroke, { - isFocused: left - }))); -} - ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/linked-button.js /** @@ -46740,12 +43200,12 @@ function LinkedButton({ ...props }) { const label = isLinked ? (0,external_wp_i18n_namespaceObject.__)('Unlink sides') : (0,external_wp_i18n_namespaceObject.__)('Link sides'); - return (0,external_wp_element_namespaceObject.createElement)(tooltip, { + return (0,external_React_.createElement)(tooltip, { text: label - }, (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }, (0,external_React_.createElement)(build_module_button, { ...props, className: "component-box-control__linked-button", - isSmall: true, + size: "small", icon: isLinked ? library_link : link_off, iconSize: 24, "aria-label": label @@ -46774,8 +43234,6 @@ function LinkedButton({ - - const defaultInputProps = { min: 0 }; @@ -46811,6 +43269,7 @@ function box_control_useUniqueId(idProp) { * ``` */ function BoxControl({ + __next40pxDefaultSize = false, id: idProp, inputProps = defaultInputProps, onChange = box_control_noop, @@ -46876,41 +43335,39 @@ function BoxControl({ sides, values: inputValues, onMouseOver, - onMouseOut + onMouseOut, + __next40pxDefaultSize }; - return (0,external_wp_element_namespaceObject.createElement)(box_control_styles_Root, { + return (0,external_React_.createElement)(grid_component, { id: id, + columns: 3, + templateColumns: "1fr min-content min-content", role: "group", "aria-labelledby": headingId - }, (0,external_wp_element_namespaceObject.createElement)(Header, { - className: "component-box-control__header" - }, (0,external_wp_element_namespaceObject.createElement)(flex_item_component, null, (0,external_wp_element_namespaceObject.createElement)(BaseControl.VisualLabel, { + }, (0,external_React_.createElement)(BaseControl.VisualLabel, { id: headingId - }, label)), allowReset && (0,external_wp_element_namespaceObject.createElement)(flex_item_component, null, (0,external_wp_element_namespaceObject.createElement)(build_module_button, { - className: "component-box-control__reset-button", - variant: "secondary", - isSmall: true, - onClick: handleOnReset, - disabled: !isDirty - }, (0,external_wp_i18n_namespaceObject.__)('Reset')))), (0,external_wp_element_namespaceObject.createElement)(HeaderControlWrapper, { - className: "component-box-control__header-control-wrapper" - }, (0,external_wp_element_namespaceObject.createElement)(flex_item_component, null, (0,external_wp_element_namespaceObject.createElement)(BoxControlIcon, { + }, label), isLinked && (0,external_React_.createElement)(InputWrapper, null, (0,external_React_.createElement)(FlexedBoxControlIcon, { side: side, sides: sides - })), isLinked && (0,external_wp_element_namespaceObject.createElement)(flex_block_component, null, (0,external_wp_element_namespaceObject.createElement)(AllInputControl, { - "aria-label": label, - ...inputControlProps - })), !isLinked && splitOnAxis && (0,external_wp_element_namespaceObject.createElement)(flex_block_component, null, (0,external_wp_element_namespaceObject.createElement)(AxialInputControls, { + }), (0,external_React_.createElement)(AllInputControl, { ...inputControlProps - })), !hasOneSide && (0,external_wp_element_namespaceObject.createElement)(flex_item_component, null, (0,external_wp_element_namespaceObject.createElement)(LinkedButton, { + })), !hasOneSide && (0,external_React_.createElement)(LinkedButtonWrapper, null, (0,external_React_.createElement)(LinkedButton, { onClick: toggleLinked, isLinked: isLinked - }))), !isLinked && !splitOnAxis && (0,external_wp_element_namespaceObject.createElement)(BoxInputControls, { + })), !isLinked && splitOnAxis && (0,external_React_.createElement)(AxialInputControls, { ...inputControlProps - })); + }), !isLinked && !splitOnAxis && (0,external_React_.createElement)(BoxInputControls, { + ...inputControlProps + }), allowReset && (0,external_React_.createElement)(ResetButton, { + className: "component-box-control__reset-button", + variant: "secondary", + size: "small", + onClick: handleOnReset, + disabled: !isDirty + }, (0,external_wp_i18n_namespaceObject.__)('Reset'))); } -/* harmony default export */ var box_control = (BoxControl); +/* harmony default export */ const box_control = (BoxControl); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/button-group/index.js @@ -46933,7 +43390,7 @@ function UnforwardedButtonGroup(props, ref) { ...restProps } = props; const classes = classnames_default()('components-button-group', className); - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { ref: ref, role: "group", className: classes, @@ -46957,7 +43414,7 @@ function UnforwardedButtonGroup(props, ref) { * ``` */ const ButtonGroup = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedButtonGroup); -/* harmony default export */ var button_group = (ButtonGroup); +/* harmony default export */ const button_group = (ButtonGroup); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/elevation/styles.js function elevation_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } @@ -47062,7 +43519,7 @@ function useElevation(props) { function UnconnectedElevation(props, forwardedRef) { const elevationProps = useElevation(props); - return (0,external_wp_element_namespaceObject.createElement)(component, { + return (0,external_React_.createElement)(component, { ...elevationProps, ref: forwardedRef }); @@ -47092,7 +43549,7 @@ function UnconnectedElevation(props, forwardedRef) { * ``` */ const component_Elevation = contextConnect(UnconnectedElevation, 'Elevation'); -/* harmony default export */ var elevation_component = (component_Elevation); +/* harmony default export */ const elevation_component = (component_Elevation); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/card/styles.js function card_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } @@ -47112,7 +43569,7 @@ function card_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried t // as an "outer radius"). const adjustedBorderRadius = `calc(${config_values.cardBorderRadius} - 1px)`; const Card = /*#__PURE__*/emotion_react_browser_esm_css("box-shadow:0 0 0 1px ", config_values.surfaceBorderColor, ";outline:none;" + ( true ? "" : 0), true ? "" : 0); -const styles_Header = true ? { +const Header = true ? { name: "1showjb", styles: "border-bottom:1px solid;box-sizing:border-box;&:last-child{border-bottom:none;}" } : 0; @@ -47378,18 +43835,18 @@ function UnconnectedCard(props, forwardedRef) { CardFooter: contextProps }; }, [isBorderless, size]); - return (0,external_wp_element_namespaceObject.createElement)(ContextSystemProvider, { + return (0,external_React_.createElement)(ContextSystemProvider, { value: contextProviderValue - }, (0,external_wp_element_namespaceObject.createElement)(component, { + }, (0,external_React_.createElement)(component, { ...otherProps, ref: forwardedRef - }, (0,external_wp_element_namespaceObject.createElement)(component, { + }, (0,external_React_.createElement)(component, { className: cx(Content) - }, children), (0,external_wp_element_namespaceObject.createElement)(elevation_component, { + }, children), (0,external_React_.createElement)(elevation_component, { className: elevationClassName, isInteractive: false, value: elevation ? 1 : 0 - }), (0,external_wp_element_namespaceObject.createElement)(elevation_component, { + }), (0,external_React_.createElement)(elevation_component, { className: elevationClassName, isInteractive: false, value: elevation @@ -47429,7 +43886,7 @@ function UnconnectedCard(props, forwardedRef) { * ``` */ const component_Card = contextConnect(UnconnectedCard, 'Card'); -/* harmony default export */ var card_component = (component_Card); +/* harmony default export */ const card_component = (component_Card); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/scrollable/styles.js function scrollable_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } @@ -47511,7 +43968,7 @@ function useScrollable(props) { function UnconnectedScrollable(props, forwardedRef) { const scrollableProps = useScrollable(props); - return (0,external_wp_element_namespaceObject.createElement)(component, { + return (0,external_React_.createElement)(component, { ...scrollableProps, ref: forwardedRef }); @@ -47533,7 +43990,7 @@ function UnconnectedScrollable(props, forwardedRef) { * ``` */ const component_Scrollable = contextConnect(UnconnectedScrollable, 'Scrollable'); -/* harmony default export */ var scrollable_component = (component_Scrollable); +/* harmony default export */ const scrollable_component = (component_Scrollable); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/card/card-body/hook.js /** @@ -47587,12 +44044,12 @@ function UnconnectedCardBody(props, forwardedRef) { ...otherProps } = useCardBody(props); if (isScrollable) { - return (0,external_wp_element_namespaceObject.createElement)(scrollable_component, { + return (0,external_React_.createElement)(scrollable_component, { ...otherProps, ref: forwardedRef }); } - return (0,external_wp_element_namespaceObject.createElement)(component, { + return (0,external_React_.createElement)(component, { ...otherProps, ref: forwardedRef }); @@ -47613,43 +44070,29 @@ function UnconnectedCardBody(props, forwardedRef) { * ``` */ const CardBody = contextConnect(UnconnectedCardBody, 'CardBody'); -/* harmony default export */ var card_body_component = (CardBody); - -;// CONCATENATED MODULE: ./node_modules/reakit/es/Separator/Separator.js - - - - +/* harmony default export */ const card_body_component = (CardBody); +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/YZEJGRDQ.js +"use client"; -// Automatically generated -var SEPARATOR_KEYS = ["orientation"]; -var useSeparator = createHook({ - name: "Separator", - compose: useRole, - keys: SEPARATOR_KEYS, - useOptions: function useOptions(_ref) { - var _ref$orientation = _ref.orientation, - orientation = _ref$orientation === void 0 ? "horizontal" : _ref$orientation, - options = _objectWithoutPropertiesLoose(_ref, ["orientation"]); - return _objectSpread2({ - orientation: orientation - }, options); - }, - useProps: function useProps(options, htmlProps) { - return _objectSpread2({ +// src/separator/separator.ts +var useSeparator = createHook( + (_a) => { + var _b = _a, { orientation = "horizontal" } = _b, props = __objRest(_b, ["orientation"]); + props = _4R3V3JGP_spreadValues({ role: "separator", - "aria-orientation": options.orientation - }, htmlProps); + "aria-orientation": orientation + }, props); + return props; } +); +var Separator = createComponent((props) => { + const htmlProps = useSeparator(props); + return _3ORBWXWF_createElement("hr", htmlProps); }); -var Separator = createComponent({ - as: "hr", - memo: true, - useHook: useSeparator -}); +if (false) {} @@ -47690,14 +44133,14 @@ const renderMargin = ({ [MARGIN_DIRECTIONS[orientation].start]: space(marginStart !== null && marginStart !== void 0 ? marginStart : margin), [MARGIN_DIRECTIONS[orientation].end]: space(marginEnd !== null && marginEnd !== void 0 ? marginEnd : margin) })(), true ? "" : 0, true ? "" : 0); -var styles_ref = true ? { +var divider_styles_ref = true ? { name: "1u4hpl4", styles: "display:inline" } : 0; const renderDisplay = ({ 'aria-orientation': orientation = 'horizontal' }) => { - return orientation === 'vertical' ? styles_ref : undefined; + return orientation === 'vertical' ? divider_styles_ref : undefined; }; const renderBorder = ({ 'aria-orientation': orientation = 'horizontal' @@ -47727,8 +44170,8 @@ const DividerView = emotion_styled_base_browser_esm("hr", true ? { function UnconnectedDivider(props, forwardedRef) { const contextProps = useContextSystem(props, 'Divider'); - return (0,external_wp_element_namespaceObject.createElement)(Separator, { - as: DividerView, + return (0,external_React_.createElement)(Separator, { + render: (0,external_React_.createElement)(DividerView, null), ...contextProps, ref: forwardedRef }); @@ -47756,7 +44199,7 @@ function UnconnectedDivider(props, forwardedRef) { * ``` */ const component_Divider = contextConnect(UnconnectedDivider, 'Divider'); -/* harmony default export */ var divider_component = (component_Divider); +/* harmony default export */ const divider_component = (component_Divider); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/card/card-divider/hook.js /** @@ -47801,7 +44244,7 @@ function useCardDivider(props) { function UnconnectedCardDivider(props, forwardedRef) { const dividerProps = useCardDivider(props); - return (0,external_wp_element_namespaceObject.createElement)(divider_component, { + return (0,external_React_.createElement)(divider_component, { ...dividerProps, ref: forwardedRef }); @@ -47822,7 +44265,7 @@ function UnconnectedCardDivider(props, forwardedRef) { * ``` */ const CardDivider = contextConnect(UnconnectedCardDivider, 'CardDivider'); -/* harmony default export */ var card_divider_component = (CardDivider); +/* harmony default export */ const card_divider_component = (CardDivider); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/card/card-footer/hook.js /** @@ -47872,7 +44315,7 @@ function useCardFooter(props) { function UnconnectedCardFooter(props, forwardedRef) { const footerProps = useCardFooter(props); - return (0,external_wp_element_namespaceObject.createElement)(flex_component, { + return (0,external_React_.createElement)(flex_component, { ...footerProps, ref: forwardedRef }); @@ -47891,7 +44334,7 @@ function UnconnectedCardFooter(props, forwardedRef) { * ``` */ const CardFooter = contextConnect(UnconnectedCardFooter, 'CardFooter'); -/* harmony default export */ var card_footer_component = (CardFooter); +/* harmony default export */ const card_footer_component = (CardFooter); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/card/card-header/hook.js /** @@ -47915,7 +44358,7 @@ function useCardHeader(props) { ...otherProps } = useContextSystem(props, 'CardHeader'); const cx = useCx(); - const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(styles_Header, borderRadius, borderColor, cardPaddings[size], isBorderless && borderless, isShady && shady, + const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(Header, borderRadius, borderColor, cardPaddings[size], isBorderless && borderless, isShady && shady, // This classname is added for legacy compatibility reasons. 'components-card__header', className), [className, cx, isBorderless, isShady, size]); return { @@ -47939,7 +44382,7 @@ function useCardHeader(props) { function UnconnectedCardHeader(props, forwardedRef) { const headerProps = useCardHeader(props); - return (0,external_wp_element_namespaceObject.createElement)(flex_component, { + return (0,external_React_.createElement)(flex_component, { ...headerProps, ref: forwardedRef }); @@ -47958,7 +44401,7 @@ function UnconnectedCardHeader(props, forwardedRef) { * ``` */ const CardHeader = contextConnect(UnconnectedCardHeader, 'CardHeader'); -/* harmony default export */ var card_header_component = (CardHeader); +/* harmony default export */ const card_header_component = (CardHeader); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/card/card-media/hook.js /** @@ -48003,7 +44446,7 @@ function useCardMedia(props) { function UnconnectedCardMedia(props, forwardedRef) { const cardMediaProps = useCardMedia(props); - return (0,external_wp_element_namespaceObject.createElement)(component, { + return (0,external_React_.createElement)(component, { ...cardMediaProps, ref: forwardedRef }); @@ -48028,7 +44471,7 @@ function UnconnectedCardMedia(props, forwardedRef) { * ``` */ const CardMedia = contextConnect(UnconnectedCardMedia, 'CardMedia'); -/* harmony default export */ var card_media_component = (CardMedia); +/* harmony default export */ const card_media_component = (CardMedia); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/checkbox-control/index.js @@ -48104,15 +44547,15 @@ function CheckboxControl(props) { }, [checked, indeterminate]); const id = (0,external_wp_compose_namespaceObject.useInstanceId)(CheckboxControl, 'inspector-checkbox-control', idProp); const onChangeValue = event => onChange(event.target.checked); - return (0,external_wp_element_namespaceObject.createElement)(base_control, { + return (0,external_React_.createElement)(base_control, { __nextHasNoMarginBottom: __nextHasNoMarginBottom, label: heading, id: id, help: help, className: classnames_default()('components-checkbox-control', className) - }, (0,external_wp_element_namespaceObject.createElement)("span", { + }, (0,external_React_.createElement)("span", { className: "components-checkbox-control__input-container" - }, (0,external_wp_element_namespaceObject.createElement)("input", { + }, (0,external_React_.createElement)("input", { ref: ref, id: id, className: "components-checkbox-control__input", @@ -48122,20 +44565,20 @@ function CheckboxControl(props) { checked: checked, "aria-describedby": !!help ? id + '__help' : undefined, ...additionalProps - }), showIndeterminateIcon ? (0,external_wp_element_namespaceObject.createElement)(icons_build_module_icon, { + }), showIndeterminateIcon ? (0,external_React_.createElement)(icons_build_module_icon, { icon: library_reset, className: "components-checkbox-control__indeterminate", role: "presentation" - }) : null, showCheckedIcon ? (0,external_wp_element_namespaceObject.createElement)(icons_build_module_icon, { + }) : null, showCheckedIcon ? (0,external_React_.createElement)(icons_build_module_icon, { icon: library_check, className: "components-checkbox-control__checked", role: "presentation" - }) : null), (0,external_wp_element_namespaceObject.createElement)("label", { + }) : null), label && (0,external_React_.createElement)("label", { className: "components-checkbox-control__label", htmlFor: id }, label)); } -/* harmony default export */ var checkbox_control = (CheckboxControl); +/* harmony default export */ const checkbox_control = (CheckboxControl); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/clipboard-button/index.js @@ -48194,7 +44637,7 @@ function ClipboardButton({ // @ts-expect-error: Should be currentTarget, but not changing because this component is deprecated. event.target.focus(); }; - return (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + return (0,external_React_.createElement)(build_module_button, { ...buttonProps, className: classes, ref: ref, @@ -48208,13 +44651,13 @@ function ClipboardButton({ * WordPress dependencies */ -const moreVertical = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const moreVertical = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" })); -/* harmony default export */ var more_vertical = (moreVertical); +/* harmony default export */ const more_vertical = (moreVertical); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/item-group/styles.js function item_group_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } @@ -48228,7 +44671,7 @@ function item_group_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have t */ const unstyledButton = as => { - return /*#__PURE__*/emotion_react_browser_esm_css("font-size:", font('default.fontSize'), ";font-family:inherit;appearance:none;border:1px solid transparent;cursor:pointer;background:none;text-align:start;text-decoration:", as === 'a' ? 'none' : undefined, ";svg,path{fill:currentColor;}&:hover{color:", COLORS.theme.accent, ";}&:focus{box-shadow:none;outline:none;}&:focus-visible{box-shadow:0 0 0 var( --wp-admin-border-width-focus ) var(\n\t\t\t\t\t--wp-components-color-accent,\n\t\t\t\t\tvar( --wp-admin-theme-color, ", COLORS.theme.accent, " )\n\t\t\t\t);outline:2px solid transparent;outline-offset:0;}" + ( true ? "" : 0), true ? "" : 0); + return /*#__PURE__*/emotion_react_browser_esm_css("font-size:", font('default.fontSize'), ";font-family:inherit;appearance:none;border:1px solid transparent;cursor:pointer;background:none;text-align:start;text-decoration:", as === 'a' ? 'none' : undefined, ";svg,path{fill:currentColor;}&:hover{color:", COLORS.theme.accent, ";}&:focus{box-shadow:none;outline:none;}&:focus-visible{box-shadow:0 0 0 var( --wp-admin-border-width-focus ) ", COLORS.theme.accent, ";outline:2px solid transparent;outline-offset:0;}" + ( true ? "" : 0), true ? "" : 0); }; const itemWrapper = true ? { name: "1bcj5ek", @@ -48338,9 +44781,9 @@ function UnconnectedItemGroup(props, forwardedRef) { spacedAround, size }; - return (0,external_wp_element_namespaceObject.createElement)(ItemGroupContext.Provider, { + return (0,external_React_.createElement)(ItemGroupContext.Provider, { value: contextValue - }, (0,external_wp_element_namespaceObject.createElement)(component, { + }, (0,external_React_.createElement)(component, { ...otherProps, ref: forwardedRef })); @@ -48367,7 +44810,7 @@ function UnconnectedItemGroup(props, forwardedRef) { * ``` */ const ItemGroup = contextConnect(UnconnectedItemGroup, 'ItemGroup'); -/* harmony default export */ var item_group_component = (ItemGroup); +/* harmony default export */ const item_group_component = (ItemGroup); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-picker/gradient-bar/constants.js const GRADIENT_MARKERS_WIDTH = 16; @@ -48561,6 +45004,7 @@ function getHorizontalRelativeGradientPosition(mouseXCoordinate, containerElemen + function ControlPointButton({ isOpen, position, @@ -48569,7 +45013,7 @@ function ControlPointButton({ }) { const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ControlPointButton); const descriptionId = `components-custom-gradient-picker__control-point-button-description-${instanceId}`; - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(build_module_button, { "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %1$s: gradient position e.g: 70, %2$s: gradient color code e.g: rgb(52,121,151). (0,external_wp_i18n_namespaceObject.__)('Gradient control point at position %1$s%% with color code %2$s.'), position, color), @@ -48580,7 +45024,7 @@ function ControlPointButton({ 'is-active': isOpen }), ...additionalProps - }), (0,external_wp_element_namespaceObject.createElement)(visually_hidden_component, { + }), (0,external_React_.createElement)(visually_hidden_component, { id: descriptionId }, (0,external_wp_i18n_namespaceObject.__)('Use your left or right arrow keys or drag and drop with the mouse to change the gradient position. Press the button to change the color or remove the control point.'))); } @@ -48592,10 +45036,14 @@ function GradientColorPickerDropdown({ // Open the popover below the gradient control/insertion point const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({ placement: 'bottom', - offset: 8 + offset: 8, + // Disabling resize as it would otherwise cause the popover to show + // scrollbars while dragging the color picker's handle close to the + // popover edge. + resize: false }), []); const mergedClassName = classnames_default()('components-custom-gradient-picker__control-point-dropdown', className); - return (0,external_wp_element_namespaceObject.createElement)(CustomColorPickerDropdown, { + return (0,external_React_.createElement)(CustomColorPickerDropdown, { isRenderedInSidebar: isRenderedInSidebar, popoverProps: popoverProps, className: mergedClassName, @@ -48648,16 +45096,16 @@ function ControlPoints({ cleanEventListenersRef.current?.(); }; }, []); - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, controlPoints.map((point, index) => { + return (0,external_React_.createElement)(external_React_.Fragment, null, controlPoints.map((point, index) => { const initialPosition = point?.position; - return ignoreMarkerPosition !== initialPosition && (0,external_wp_element_namespaceObject.createElement)(GradientColorPickerDropdown, { + return ignoreMarkerPosition !== initialPosition && (0,external_React_.createElement)(GradientColorPickerDropdown, { isRenderedInSidebar: __experimentalIsRenderedInSidebar, key: index, onClose: onStopControlPointChange, renderToggle: ({ isOpen, onToggle - }) => (0,external_wp_element_namespaceObject.createElement)(ControlPointButton, { + }) => (0,external_React_.createElement)(ControlPointButton, { key: index, onClick: () => { if (controlPointMoveState.current && controlPointMoveState.current.significantMoveHappened) { @@ -48702,16 +45150,18 @@ function ControlPoints({ }), renderContent: ({ onClose - }) => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(LegacyAdapter, { + }) => (0,external_React_.createElement)(dropdown_content_wrapper, { + paddingSize: "none" + }, (0,external_React_.createElement)(LegacyAdapter, { enableAlpha: !disableAlpha, color: point.color, onChange: color => { onChange(updateControlPointColor(controlPoints, index, w(color).toRgbString())); } - }), !disableRemove && controlPoints.length > 2 && (0,external_wp_element_namespaceObject.createElement)(h_stack_component, { + }), !disableRemove && controlPoints.length > 2 && (0,external_React_.createElement)(h_stack_component, { className: "components-custom-gradient-picker__remove-control-point-wrapper", alignment: "center" - }, (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }, (0,external_React_.createElement)(build_module_button, { onClick: () => { onChange(removeControlPoint(controlPoints, index)); onClose(); @@ -48735,7 +45185,7 @@ function InsertPoint({ __experimentalIsRenderedInSidebar }) { const [alreadyInsertedPoint, setAlreadyInsertedPoint] = (0,external_wp_element_namespaceObject.useState)(false); - return (0,external_wp_element_namespaceObject.createElement)(GradientColorPickerDropdown, { + return (0,external_React_.createElement)(GradientColorPickerDropdown, { isRenderedInSidebar: __experimentalIsRenderedInSidebar, className: "components-custom-gradient-picker__inserter", onClose: () => { @@ -48744,7 +45194,7 @@ function InsertPoint({ renderToggle: ({ isOpen, onToggle - }) => (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }) => (0,external_React_.createElement)(build_module_button, { "aria-expanded": isOpen, "aria-haspopup": "true", onClick: () => { @@ -48759,7 +45209,9 @@ function InsertPoint({ className: "components-custom-gradient-picker__insert-point-dropdown", icon: library_plus }), - renderContent: () => (0,external_wp_element_namespaceObject.createElement)(LegacyAdapter, { + renderContent: () => (0,external_React_.createElement)(dropdown_content_wrapper, { + paddingSize: "none" + }, (0,external_React_.createElement)(LegacyAdapter, { enableAlpha: !disableAlpha, onChange: color => { if (!alreadyInsertedPoint) { @@ -48769,7 +45221,7 @@ function InsertPoint({ onChange(updateControlPointColorByPosition(controlPoints, insertPosition, w(color).toRgbString())); } } - }), + })), style: insertPosition !== null ? { left: `${insertPosition}%`, transform: 'translateX( -50% )' @@ -48777,7 +45229,7 @@ function InsertPoint({ }); } ControlPoints.InsertPoint = InsertPoint; -/* harmony default export */ var control_points = (ControlPoints); +/* harmony default export */ const control_points = (ControlPoints); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-picker/gradient-bar/index.js @@ -48891,23 +45343,23 @@ function CustomGradientBar({ }; const isMovingInserter = gradientBarState.id === 'MOVING_INSERTER'; const isInsertingControlPoint = gradientBarState.id === 'INSERTING_CONTROL_POINT'; - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { className: classnames_default()('components-custom-gradient-picker__gradient-bar', { 'has-gradient': hasGradient }), onMouseEnter: onMouseEnterAndMove, onMouseMove: onMouseEnterAndMove, onMouseLeave: onMouseLeave - }, (0,external_wp_element_namespaceObject.createElement)("div", { + }, (0,external_React_.createElement)("div", { className: "components-custom-gradient-picker__gradient-bar-background", style: { background, opacity: hasGradient ? 1 : 0.4 } - }), (0,external_wp_element_namespaceObject.createElement)("div", { + }), (0,external_React_.createElement)("div", { ref: gradientMarkersContainerDomRef, className: "components-custom-gradient-picker__markers-container" - }, !disableInserter && (isMovingInserter || isInsertingControlPoint) && (0,external_wp_element_namespaceObject.createElement)(control_points.InsertPoint, { + }, !disableInserter && (isMovingInserter || isInsertingControlPoint) && (0,external_React_.createElement)(control_points.InsertPoint, { __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar, disableAlpha: disableAlpha, insertPosition: gradientBarState.insertPosition, @@ -48923,7 +45375,7 @@ function CustomGradientBar({ type: 'CLOSE_INSERTER' }); } - }), (0,external_wp_element_namespaceObject.createElement)(control_points, { + }), (0,external_React_.createElement)(control_points, { __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar, disableAlpha: disableAlpha, disableRemove: disableInserter, @@ -48945,7 +45397,7 @@ function CustomGradientBar({ } // EXTERNAL MODULE: ./node_modules/gradient-parser/build/node.js -var build_node = __webpack_require__(7115); +var build_node = __webpack_require__(8924); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-picker/constants.js /** * WordPress dependencies @@ -49173,7 +45625,6 @@ const AccessoryWrapper = /*#__PURE__*/emotion_styled_base_browser_esm(flex_block */ - /** * Internal dependencies */ @@ -49202,8 +45653,7 @@ const GradientAnglePicker = ({ } })); }; - return (0,external_wp_element_namespaceObject.createElement)(angle_picker_control, { - __nextHasNoMarginBottom: true, + return (0,external_React_.createElement)(angle_picker_control, { onChange: onAngleChange, value: hasGradient ? angle : '' }); @@ -49241,7 +45691,7 @@ const GradientTypePicker = ({ onSetRadialGradient(); } }; - return (0,external_wp_element_namespaceObject.createElement)(select_control, { + return (0,external_React_.createElement)(select_control, { __nextHasNoMarginBottom: true, className: "components-custom-gradient-picker__type-picker", label: (0,external_wp_i18n_namespaceObject.__)('Type'), @@ -49275,8 +45725,6 @@ const GradientTypePicker = ({ * ``` */ function CustomGradientPicker({ - /** Start opting into the new margin-free styles that will become the default in a future version. */ - __nextHasNoMargin = false, value, onChange, __experimentalIsRenderedInSidebar = false @@ -49302,19 +45750,10 @@ function CustomGradientPicker({ position: parseInt(colorStop.length.value) }; }); - if (!__nextHasNoMargin) { - external_wp_deprecated_default()('Outer margin styles for wp.components.CustomGradientPicker', { - since: '6.1', - version: '6.4', - hint: 'Set the `__nextHasNoMargin` prop to true to start opting into the new styles, which will become the default in a future version' - }); - } - return (0,external_wp_element_namespaceObject.createElement)(v_stack_component, { + return (0,external_React_.createElement)(v_stack_component, { spacing: 4, - className: classnames_default()('components-custom-gradient-picker', { - 'is-next-has-no-margin': __nextHasNoMargin - }) - }, (0,external_wp_element_namespaceObject.createElement)(CustomGradientBar, { + className: "components-custom-gradient-picker" + }, (0,external_React_.createElement)(CustomGradientBar, { __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar, background: background, hasGradient: hasGradient, @@ -49322,20 +45761,20 @@ function CustomGradientPicker({ onChange: newControlPoints => { onChange(serializeGradient(getGradientAstWithControlPoints(gradientAST, newControlPoints))); } - }), (0,external_wp_element_namespaceObject.createElement)(flex_component, { + }), (0,external_React_.createElement)(flex_component, { gap: 3, className: "components-custom-gradient-picker__ui-line" - }, (0,external_wp_element_namespaceObject.createElement)(SelectWrapper, null, (0,external_wp_element_namespaceObject.createElement)(GradientTypePicker, { + }, (0,external_React_.createElement)(SelectWrapper, null, (0,external_React_.createElement)(GradientTypePicker, { gradientAST: gradientAST, hasGradient: hasGradient, onChange: onChange - })), (0,external_wp_element_namespaceObject.createElement)(AccessoryWrapper, null, gradientAST.type === 'linear-gradient' && (0,external_wp_element_namespaceObject.createElement)(GradientAnglePicker, { + })), (0,external_React_.createElement)(AccessoryWrapper, null, gradientAST.type === 'linear-gradient' && (0,external_React_.createElement)(GradientAnglePicker, { gradientAST: gradientAST, hasGradient: hasGradient, onChange: onChange })))); } -/* harmony default export */ var custom_gradient_picker = (CustomGradientPicker); +/* harmony default export */ const custom_gradient_picker = (CustomGradientPicker); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/gradient-picker/index.js @@ -49346,7 +45785,6 @@ function CustomGradientPicker({ - /** * Internal dependencies */ @@ -49354,7 +45792,6 @@ function CustomGradientPicker({ - // The Multiple Origin Gradients have a `gradients` property (an array of // gradient objects), while Single Origin ones have a `gradient` property. const isMultipleOriginObject = obj => Array.isArray(obj.gradients) && !('gradient' in obj); @@ -49372,9 +45809,10 @@ function SingleOrigin({ const gradientOptions = (0,external_wp_element_namespaceObject.useMemo)(() => { return gradients.map(({ gradient, - name - }, index) => (0,external_wp_element_namespaceObject.createElement)(build_module_circular_option_picker.Option, { - key: gradient, + name, + slug + }, index) => (0,external_React_.createElement)(build_module_circular_option_picker.Option, { + key: slug, value: gradient, isSelected: value === gradient, tooltipText: name || @@ -49392,7 +45830,7 @@ function SingleOrigin({ (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Gradient code: %s'), gradient) })); }, [gradients, value, onChange, clearGradient]); - return (0,external_wp_element_namespaceObject.createElement)(build_module_circular_option_picker.OptionGroup, { + return (0,external_React_.createElement)(build_module_circular_option_picker.OptionGroup, { className: className, options: gradientOptions, ...additionalProps @@ -49407,7 +45845,7 @@ function MultipleOrigin({ headingLevel }) { const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(MultipleOrigin); - return (0,external_wp_element_namespaceObject.createElement)(v_stack_component, { + return (0,external_React_.createElement)(v_stack_component, { spacing: 3, className: className }, gradients.map(({ @@ -49415,13 +45853,13 @@ function MultipleOrigin({ gradients: gradientSet }, index) => { const id = `color-palette-${instanceId}-${index}`; - return (0,external_wp_element_namespaceObject.createElement)(v_stack_component, { + return (0,external_React_.createElement)(v_stack_component, { spacing: 2, key: index - }, (0,external_wp_element_namespaceObject.createElement)(ColorHeading, { + }, (0,external_React_.createElement)(ColorHeading, { level: headingLevel, id: id - }, name), (0,external_wp_element_namespaceObject.createElement)(SingleOrigin, { + }, name), (0,external_React_.createElement)(SingleOrigin, { clearGradient: clearGradient, gradients: gradientSet, onChange: gradient => onChange(gradient, index), @@ -49440,10 +45878,10 @@ function gradient_picker_Component(props) { 'aria-labelledby': ariaLabelledby, ...additionalProps } = props; - const options = isMultipleOriginArray(props.gradients) ? (0,external_wp_element_namespaceObject.createElement)(MultipleOrigin, { + const options = isMultipleOriginArray(props.gradients) ? (0,external_React_.createElement)(MultipleOrigin, { headingLevel: headingLevel, ...additionalProps - }) : (0,external_wp_element_namespaceObject.createElement)(SingleOrigin, { + }) : (0,external_React_.createElement)(SingleOrigin, { ...additionalProps }); let metaProps; @@ -49473,7 +45911,7 @@ function gradient_picker_Component(props) { }; } } - return (0,external_wp_element_namespaceObject.createElement)(build_module_circular_option_picker, { + return (0,external_React_.createElement)(build_module_circular_option_picker, { ...metaProps, actions: actions, options: options @@ -49494,7 +45932,6 @@ function gradient_picker_Component(props) { * * return ( * <GradientPicker - * __nextHasNoMargin * value={ gradient } * onChange={ ( currentGradient ) => setGradient( currentGradient ) } * gradients={ [ @@ -49524,8 +45961,6 @@ function gradient_picker_Component(props) { * */ function GradientPicker({ - /** Start opting into the new margin-free styles that will become the default in a future version. */ - __nextHasNoMargin = false, className, gradients = [], onChange, @@ -49537,44 +45972,26 @@ function GradientPicker({ ...additionalProps }) { const clearGradient = (0,external_wp_element_namespaceObject.useCallback)(() => onChange(undefined), [onChange]); - if (!__nextHasNoMargin) { - external_wp_deprecated_default()('Outer margin styles for wp.components.GradientPicker', { - since: '6.1', - version: '6.4', - hint: 'Set the `__nextHasNoMargin` prop to true to start opting into the new styles, which will become the default in a future version' - }); - } - const deprecatedMarginSpacerProps = !__nextHasNoMargin ? { - marginTop: !gradients.length ? 3 : undefined, - marginBottom: !clearable ? 6 : 0 - } : {}; - return ( - // Outmost Spacer wrapper can be removed when deprecation period is over - (0,external_wp_element_namespaceObject.createElement)(spacer_component, { - marginBottom: 0, - ...deprecatedMarginSpacerProps - }, (0,external_wp_element_namespaceObject.createElement)(v_stack_component, { - spacing: gradients.length ? 4 : 0 - }, !disableCustomGradients && (0,external_wp_element_namespaceObject.createElement)(custom_gradient_picker, { - __nextHasNoMargin: true, - __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar, - value: value, - onChange: onChange - }), (gradients.length || clearable) && (0,external_wp_element_namespaceObject.createElement)(gradient_picker_Component, { - ...additionalProps, - className: className, - clearGradient: clearGradient, - gradients: gradients, - onChange: onChange, - value: value, - actions: clearable && !disableCustomGradients && (0,external_wp_element_namespaceObject.createElement)(build_module_circular_option_picker.ButtonAction, { - onClick: clearGradient - }, (0,external_wp_i18n_namespaceObject.__)('Clear')), - headingLevel: headingLevel - }))) - ); + return (0,external_React_.createElement)(v_stack_component, { + spacing: gradients.length ? 4 : 0 + }, !disableCustomGradients && (0,external_React_.createElement)(custom_gradient_picker, { + __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar, + value: value, + onChange: onChange + }), (gradients.length > 0 || clearable) && (0,external_React_.createElement)(gradient_picker_Component, { + ...additionalProps, + className: className, + clearGradient: clearGradient, + gradients: gradients, + onChange: onChange, + value: value, + actions: clearable && !disableCustomGradients && (0,external_React_.createElement)(build_module_circular_option_picker.ButtonAction, { + onClick: clearGradient + }, (0,external_wp_i18n_namespaceObject.__)('Clear')), + headingLevel: headingLevel + })); } -/* harmony default export */ var gradient_picker = (GradientPicker); +/* harmony default export */ const gradient_picker = (GradientPicker); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/menu.js @@ -49582,16 +45999,16 @@ function GradientPicker({ * WordPress dependencies */ -const menu = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const menu = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z" })); -/* harmony default export */ var library_menu = (menu); +/* harmony default export */ const library_menu = (menu); ;// CONCATENATED MODULE: external ["wp","dom"] -var external_wp_dom_namespaceObject = window["wp"]["dom"]; +const external_wp_dom_namespaceObject = window["wp"]["dom"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigable-container/container.js /** @@ -49747,20 +46164,20 @@ class NavigableContainer extends external_wp_element_namespaceObject.Component { forwardedRef, ...restProps } = this.props; - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { ref: this.bindContainer, ...restProps }, children); } } const forwardedNavigableContainer = (props, ref) => { - return (0,external_wp_element_namespaceObject.createElement)(NavigableContainer, { + return (0,external_React_.createElement)(NavigableContainer, { ...props, forwardedRef: ref }); }; forwardedNavigableContainer.displayName = 'NavigableContainer'; -/* harmony default export */ var container = ((0,external_wp_element_namespaceObject.forwardRef)(forwardedNavigableContainer)); +/* harmony default export */ const container = ((0,external_wp_element_namespaceObject.forwardRef)(forwardedNavigableContainer)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigable-container/menu.js @@ -49808,7 +46225,7 @@ function UnforwardedNavigableMenu({ } return undefined; }; - return (0,external_wp_element_namespaceObject.createElement)(container, { + return (0,external_React_.createElement)(container, { ref: ref, stopNavigationEvents: true, onlyBrowserTabstops: false, @@ -49845,7 +46262,7 @@ function UnforwardedNavigableMenu({ * ``` */ const NavigableMenu = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedNavigableMenu); -/* harmony default export */ var navigable_container_menu = (NavigableMenu); +/* harmony default export */ const navigable_container_menu = (NavigableMenu); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/dropdown-menu/index.js @@ -49918,7 +46335,7 @@ function UnconnectedDropdownMenu(dropdownMenuProps) { className: 'components-dropdown-menu__popover', variant }, popoverProps); - return (0,external_wp_element_namespaceObject.createElement)(dropdown, { + return (0,external_React_.createElement)(dropdown, { className: className, popoverProps: mergedPopoverProps, renderToggle: ({ @@ -49944,7 +46361,7 @@ function UnconnectedDropdownMenu(dropdownMenuProps) { 'is-opened': isOpen }) }, restToggleProps); - return (0,external_wp_element_namespaceObject.createElement)(Toggle, { + return (0,external_React_.createElement)(Toggle, { ...mergedToggleProps, icon: icon, onClick: event => { @@ -49973,10 +46390,10 @@ function UnconnectedDropdownMenu(dropdownMenuProps) { 'no-icons': noIcons }) }, menuProps); - return (0,external_wp_element_namespaceObject.createElement)(navigable_container_menu, { + return (0,external_React_.createElement)(navigable_container_menu, { ...mergedMenuProps, role: "menu" - }, dropdown_menu_isFunction(children) ? children(props) : null, controlSets?.flatMap((controlSet, indexOfSet) => controlSet.map((control, indexOfControl) => (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }, dropdown_menu_isFunction(children) ? children(props) : null, controlSets?.flatMap((controlSet, indexOfSet) => controlSet.map((control, indexOfControl) => (0,external_React_.createElement)(build_module_button, { key: [indexOfSet, indexOfControl].join(), onClick: event => { event.stopPropagation(); @@ -50084,7 +46501,7 @@ function UnconnectedDropdownMenu(dropdownMenuProps) { * */ const DropdownMenu = contextConnectWithoutRef(UnconnectedDropdownMenu, 'DropdownMenu'); -/* harmony default export */ var dropdown_menu = (DropdownMenu); +/* harmony default export */ const dropdown_menu = (DropdownMenu); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/palette-edit/styles.js @@ -50093,6 +46510,8 @@ function palette_edit_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have * External dependencies */ + + /** * Internal dependencies */ @@ -50105,38 +46524,46 @@ function palette_edit_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have -const IndicatorStyled = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_circular_option_picker.Option, true ? { - target: "e5bw3229" -} : 0)("width:", space(6), ";height:", space(6), ";pointer-events:none;" + ( true ? "" : 0)); +const IndicatorStyled = /*#__PURE__*/emotion_styled_base_browser_esm(color_indicator, true ? { + target: "e1lpqc909" +} : 0)("&&{flex-shrink:0;width:", space(6), ";height:", space(6), ";}" + ( true ? "" : 0)); const NameInputControl = /*#__PURE__*/emotion_styled_base_browser_esm(input_control, true ? { - target: "e5bw3228" + target: "e1lpqc908" } : 0)(Container, "{background:", COLORS.gray[100], ";border-radius:", config_values.controlBorderRadius, ";", Input, Input, Input, Input, "{height:", space(8), ";}", BackdropUI, BackdropUI, BackdropUI, "{border-color:transparent;box-shadow:none;}}" + ( true ? "" : 0)); +const buttonStyleReset = ({ + as +}) => { + if (as === 'button') { + return /*#__PURE__*/emotion_react_browser_esm_css("display:flex;align-items:center;width:100%;appearance:none;background:transparent;border:none;border-radius:0;padding:0;cursor:pointer;&:hover{color:", COLORS.theme.accent, ";}" + ( true ? "" : 0), true ? "" : 0); + } + return null; +}; const PaletteItem = /*#__PURE__*/emotion_styled_base_browser_esm(component, true ? { - target: "e5bw3227" -} : 0)("padding-block:3px;padding-inline-start:", space(3), ";border:1px solid ", config_values.surfaceBorderColor, ";border-bottom-color:transparent;&:first-of-type{border-top-left-radius:", config_values.controlBorderRadius, ";border-top-right-radius:", config_values.controlBorderRadius, ";}&:last-of-type{border-bottom-left-radius:", config_values.controlBorderRadius, ";border-bottom-right-radius:", config_values.controlBorderRadius, ";border-bottom-color:", config_values.surfaceBorderColor, ";}&.is-selected+&{border-top-color:transparent;}&.is-selected{border-color:", COLORS.theme.accent, ";}" + ( true ? "" : 0)); + target: "e1lpqc907" +} : 0)(buttonStyleReset, " padding-block:3px;padding-inline-start:", space(3), ";border:1px solid ", config_values.surfaceBorderColor, ";border-bottom-color:transparent;font-size:", font('default.fontSize'), ";&:focus-visible{border-color:transparent;box-shadow:0 0 0 var( --wp-admin-border-width-focus ) ", COLORS.theme.accent, ";outline:2px solid transparent;outline-offset:0;}border-top-left-radius:", config_values.controlBorderRadius, ";border-top-right-radius:", config_values.controlBorderRadius, ";&+&{border-top-left-radius:0;border-top-right-radius:0;}&:last-child{border-bottom-left-radius:", config_values.controlBorderRadius, ";border-bottom-right-radius:", config_values.controlBorderRadius, ";border-bottom-color:", config_values.surfaceBorderColor, ";}&.is-selected+&{border-top-color:transparent;}&.is-selected{border-color:", COLORS.theme.accent, ";}" + ( true ? "" : 0)); const NameContainer = emotion_styled_base_browser_esm("div", true ? { - target: "e5bw3226" -} : 0)("line-height:", space(8), ";margin-left:", space(2), ";margin-right:", space(2), ";white-space:nowrap;overflow:hidden;", PaletteItem, ":hover &{color:", COLORS.theme.accent, ";}" + ( true ? "" : 0)); + target: "e1lpqc906" +} : 0)("line-height:", space(8), ";margin-left:", space(2), ";margin-right:", space(2), ";white-space:nowrap;overflow:hidden;" + ( true ? "" : 0)); const PaletteHeading = /*#__PURE__*/emotion_styled_base_browser_esm(heading_component, true ? { - target: "e5bw3225" + target: "e1lpqc905" } : 0)("text-transform:uppercase;line-height:", space(6), ";font-weight:500;&&&{font-size:11px;margin-bottom:0;}" + ( true ? "" : 0)); const PaletteActionsContainer = /*#__PURE__*/emotion_styled_base_browser_esm(component, true ? { - target: "e5bw3224" + target: "e1lpqc904" } : 0)("height:", space(6), ";display:flex;" + ( true ? "" : 0)); const PaletteHStackHeader = /*#__PURE__*/emotion_styled_base_browser_esm(h_stack_component, true ? { - target: "e5bw3223" + target: "e1lpqc903" } : 0)("margin-bottom:", space(2), ";" + ( true ? "" : 0)); const PaletteEditStyles = /*#__PURE__*/emotion_styled_base_browser_esm(component, true ? { - target: "e5bw3222" + target: "e1lpqc902" } : 0)( true ? { name: "u6wnko", styles: "&&&{.components-button.has-icon{min-width:0;padding:0;}}" } : 0); const DoneButton = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_button, true ? { - target: "e5bw3221" + target: "e1lpqc901" } : 0)("&&{color:", COLORS.theme.accent, ";}" + ( true ? "" : 0)); const RemoveButton = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_button, true ? { - target: "e5bw3220" + target: "e1lpqc900" } : 0)("&&{margin-top:", space(1), ";}" + ( true ? "" : 0)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/palette-edit/index.js @@ -50146,7 +46573,6 @@ const RemoveButton = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_b */ - /** * WordPress dependencies */ @@ -50172,13 +46598,14 @@ const RemoveButton = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_b + const DEFAULT_COLOR = '#000'; function NameInput({ value, onChange, label }) { - return (0,external_wp_element_namespaceObject.createElement)(NameInputControl, { + return (0,external_React_.createElement)(NameInputControl, { label: label, hideLabelFromVision: true, value: value, @@ -50187,8 +46614,8 @@ function NameInput({ } /** - * Returns a temporary name for a palette item in the format "Color + id". - * To ensure there are no duplicate ids, this function checks all slugs for temporary names. + * Returns a name for a palette item in the format "Color + id". + * To ensure there are no duplicate ids, this function checks all slugs. * It expects slugs to be in the format: slugPrefix + color- + number. * It then sets the id component of the new name based on the incremented id of the highest existing slug id. * @@ -50198,10 +46625,10 @@ function NameInput({ * @return A unique name for a palette item. */ function getNameForPosition(elements, slugPrefix) { - const temporaryNameRegex = new RegExp(`^${slugPrefix}color-([\\d]+)$`); + const nameRegex = new RegExp(`^${slugPrefix}color-([\\d]+)$`); const position = elements.reduce((previousValue, currentValue) => { if (typeof currentValue?.slug === 'string') { - const matches = currentValue?.slug.match(temporaryNameRegex); + const matches = currentValue?.slug.match(nameRegex); if (matches) { const id = parseInt(matches[1], 10); if (id >= previousValue) { @@ -50211,7 +46638,7 @@ function getNameForPosition(elements, slugPrefix) { } return previousValue; }, 1); - return (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: is a temporary id for a custom color */ + return (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: is an id for a custom color */ (0,external_wp_i18n_namespaceObject.__)('Color %s'), position); } function ColorPickerPopover({ @@ -50224,14 +46651,18 @@ function ColorPickerPopover({ const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({ shift: true, offset: 20, + // Disabling resize as it would otherwise cause the popover to show + // scrollbars while dragging the color picker's handle close to the + // popover edge. + resize: false, placement: 'left-start', ...receivedPopoverProps, className: classnames_default()('components-palette-edit__popover', receivedPopoverProps?.className) }), [receivedPopoverProps]); - return (0,external_wp_element_namespaceObject.createElement)(popover, { + return (0,external_React_.createElement)(popover, { ...popoverProps, onClose: onClose - }, !isGradient && (0,external_wp_element_namespaceObject.createElement)(LegacyAdapter, { + }, !isGradient && (0,external_React_.createElement)(LegacyAdapter, { color: element.color, enableAlpha: true, onChange: newColor => { @@ -50240,10 +46671,9 @@ function ColorPickerPopover({ color: newColor }); } - }), isGradient && (0,external_wp_element_namespaceObject.createElement)("div", { + }), isGradient && (0,external_React_.createElement)("div", { className: "components-palette-edit__popover-gradient-picker" - }, (0,external_wp_element_namespaceObject.createElement)(custom_gradient_picker, { - __nextHasNoMargin: true, + }, (0,external_React_.createElement)(custom_gradient_picker, { __experimentalIsRenderedInSidebar: true, value: element.gradient, onChange: newGradient => { @@ -50277,53 +46707,42 @@ function palette_edit_Option({ // Use the custom palette color item as the popover anchor. anchor: popoverAnchor }), [popoverAnchor, receivedPopoverProps]); - return (0,external_wp_element_namespaceObject.createElement)(PaletteItem, { + return (0,external_React_.createElement)(PaletteItem, { className: isEditing ? 'is-selected' : undefined, - as: "div", + as: isEditing ? 'div' : 'button', onClick: onStartEditing, + "aria-label": isEditing ? undefined : (0,external_wp_i18n_namespaceObject.sprintf)( + // translators: %s is a color or gradient name, e.g. "Red". + (0,external_wp_i18n_namespaceObject.__)('Edit: %s'), element.name.trim().length ? element.name : value), ref: setPopoverAnchor, ...(isEditing ? { ...focusOutsideProps - } : { - style: { - cursor: 'pointer' - } - }) - }, (0,external_wp_element_namespaceObject.createElement)(h_stack_component, { + } : {}) + }, (0,external_React_.createElement)(h_stack_component, { justify: "flex-start" - }, (0,external_wp_element_namespaceObject.createElement)(flex_item_component, null, (0,external_wp_element_namespaceObject.createElement)(IndicatorStyled, { - style: { - background: value, - color: 'transparent' - } - })), (0,external_wp_element_namespaceObject.createElement)(flex_item_component, null, isEditing && !canOnlyChangeValues ? (0,external_wp_element_namespaceObject.createElement)(NameInput, { + }, (0,external_React_.createElement)(IndicatorStyled, { + colorValue: value + }), (0,external_React_.createElement)(flex_item_component, null, isEditing && !canOnlyChangeValues ? (0,external_React_.createElement)(NameInput, { label: isGradient ? (0,external_wp_i18n_namespaceObject.__)('Gradient name') : (0,external_wp_i18n_namespaceObject.__)('Color name'), value: element.name, onChange: nextName => onChange({ ...element, name: nextName, - slug: slugPrefix + paramCase(nextName !== null && nextName !== void 0 ? nextName : '') + slug: slugPrefix + kebabCase(nextName !== null && nextName !== void 0 ? nextName : '') }) - }) : (0,external_wp_element_namespaceObject.createElement)(NameContainer, null, element.name)), isEditing && !canOnlyChangeValues && (0,external_wp_element_namespaceObject.createElement)(flex_item_component, null, (0,external_wp_element_namespaceObject.createElement)(RemoveButton, { - isSmall: true, + }) : (0,external_React_.createElement)(NameContainer, null, element.name.trim().length ? element.name : /* Fall back to non-breaking space to maintain height */ + '\u00A0')), isEditing && !canOnlyChangeValues && (0,external_React_.createElement)(flex_item_component, null, (0,external_React_.createElement)(RemoveButton, { + size: "small", icon: line_solid, label: (0,external_wp_i18n_namespaceObject.__)('Remove color'), onClick: onRemove - }))), isEditing && (0,external_wp_element_namespaceObject.createElement)(ColorPickerPopover, { + }))), isEditing && (0,external_React_.createElement)(ColorPickerPopover, { isGradient: isGradient, onChange: onChange, element: element, popoverProps: popoverProps })); } -function isTemporaryElement(slugPrefix, { - slug, - color, - gradient -}) { - const regex = new RegExp(`^${slugPrefix}color-([\\d]+)$`); - return regex.test(slug) && (!!color && color === DEFAULT_COLOR || !!gradient && gradient === DEFAULT_GRADIENT); -} function PaletteEditListView({ elements, onChange, @@ -50339,23 +46758,12 @@ function PaletteEditListView({ (0,external_wp_element_namespaceObject.useEffect)(() => { elementsReference.current = elements; }, [elements]); - (0,external_wp_element_namespaceObject.useEffect)(() => { - return () => { - if (elementsReference.current?.some(element => isTemporaryElement(slugPrefix, element))) { - const newElements = elementsReference.current.filter(element => !isTemporaryElement(slugPrefix, element)); - onChange(newElements.length ? newElements : undefined); - } - }; - // Disable reason: adding the missing dependency here would cause breaking changes that will require - // a heavier refactor to avoid. See https://github.com/WordPress/gutenberg/pull/43911 - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); const debounceOnChange = (0,external_wp_compose_namespaceObject.useDebounce)(onChange, 100); - return (0,external_wp_element_namespaceObject.createElement)(v_stack_component, { + return (0,external_React_.createElement)(v_stack_component, { spacing: 3 - }, (0,external_wp_element_namespaceObject.createElement)(item_group_component, { + }, (0,external_React_.createElement)(item_group_component, { isRounded: true - }, elements.map((element, index) => (0,external_wp_element_namespaceObject.createElement)(palette_edit_Option, { + }, elements.map((element, index) => (0,external_React_.createElement)(palette_edit_Option, { isGradient: isGradient, canOnlyChangeValues: canOnlyChangeValues, key: index, @@ -50445,38 +46853,38 @@ function PaletteEdit({ setIsEditing(true); } }, [isGradient, elements]); - return (0,external_wp_element_namespaceObject.createElement)(PaletteEditStyles, null, (0,external_wp_element_namespaceObject.createElement)(PaletteHStackHeader, null, (0,external_wp_element_namespaceObject.createElement)(PaletteHeading, { + return (0,external_React_.createElement)(PaletteEditStyles, null, (0,external_React_.createElement)(PaletteHStackHeader, null, (0,external_React_.createElement)(PaletteHeading, { level: paletteLabelHeadingLevel - }, paletteLabel), (0,external_wp_element_namespaceObject.createElement)(PaletteActionsContainer, null, hasElements && isEditing && (0,external_wp_element_namespaceObject.createElement)(DoneButton, { - isSmall: true, + }, paletteLabel), (0,external_React_.createElement)(PaletteActionsContainer, null, hasElements && isEditing && (0,external_React_.createElement)(DoneButton, { + size: "small", onClick: () => { setIsEditing(false); setEditingElement(null); } - }, (0,external_wp_i18n_namespaceObject.__)('Done')), !canOnlyChangeValues && (0,external_wp_element_namespaceObject.createElement)(build_module_button, { - isSmall: true, + }, (0,external_wp_i18n_namespaceObject.__)('Done')), !canOnlyChangeValues && (0,external_React_.createElement)(build_module_button, { + size: "small", isPressed: isAdding, icon: library_plus, label: isGradient ? (0,external_wp_i18n_namespaceObject.__)('Add gradient') : (0,external_wp_i18n_namespaceObject.__)('Add color'), onClick: () => { - const tempOptionName = getNameForPosition(elements, slugPrefix); + const optionName = getNameForPosition(elements, slugPrefix); if (!!gradients) { onChange([...gradients, { gradient: DEFAULT_GRADIENT, - name: tempOptionName, - slug: slugPrefix + paramCase(tempOptionName) + name: optionName, + slug: slugPrefix + kebabCase(optionName) }]); } else { onChange([...colors, { color: DEFAULT_COLOR, - name: tempOptionName, - slug: slugPrefix + paramCase(tempOptionName) + name: optionName, + slug: slugPrefix + kebabCase(optionName) }]); } setIsEditing(true); setEditingElement(elements.length); } - }), hasElements && (!isEditing || !canOnlyChangeValues || canReset) && (0,external_wp_element_namespaceObject.createElement)(dropdown_menu, { + }), hasElements && (!isEditing || !canOnlyChangeValues || canReset) && (0,external_React_.createElement)(dropdown_menu, { icon: more_vertical, label: isGradient ? (0,external_wp_i18n_namespaceObject.__)('Gradient options') : (0,external_wp_i18n_namespaceObject.__)('Color options'), toggleProps: { @@ -50484,16 +46892,16 @@ function PaletteEdit({ } }, ({ onClose - }) => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(navigable_container_menu, { + }) => (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(navigable_container_menu, { role: "menu" - }, !isEditing && (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }, !isEditing && (0,external_React_.createElement)(build_module_button, { variant: "tertiary", onClick: () => { setIsEditing(true); onClose(); }, className: "components-palette-edit__menu-button" - }, (0,external_wp_i18n_namespaceObject.__)('Show details')), !canOnlyChangeValues && (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }, (0,external_wp_i18n_namespaceObject.__)('Show details')), !canOnlyChangeValues && (0,external_React_.createElement)(build_module_button, { variant: "tertiary", onClick: () => { setEditingElement(null); @@ -50502,14 +46910,14 @@ function PaletteEdit({ onClose(); }, className: "components-palette-edit__menu-button" - }, isGradient ? (0,external_wp_i18n_namespaceObject.__)('Remove all gradients') : (0,external_wp_i18n_namespaceObject.__)('Remove all colors')), canReset && (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }, isGradient ? (0,external_wp_i18n_namespaceObject.__)('Remove all gradients') : (0,external_wp_i18n_namespaceObject.__)('Remove all colors')), canReset && (0,external_React_.createElement)(build_module_button, { variant: "tertiary", onClick: () => { setEditingElement(null); onChange(); onClose(); } - }, isGradient ? (0,external_wp_i18n_namespaceObject.__)('Reset gradient') : (0,external_wp_i18n_namespaceObject.__)('Reset colors'))))))), hasElements && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, isEditing && (0,external_wp_element_namespaceObject.createElement)(PaletteEditListView, { + }, isGradient ? (0,external_wp_i18n_namespaceObject.__)('Reset gradient') : (0,external_wp_i18n_namespaceObject.__)('Reset colors'))))))), hasElements && (0,external_React_.createElement)(external_React_.Fragment, null, isEditing && (0,external_React_.createElement)(PaletteEditListView, { canOnlyChangeValues: canOnlyChangeValues, elements: elements // @ts-expect-error TODO: Don't know how to resolve @@ -50520,7 +46928,7 @@ function PaletteEdit({ slugPrefix: slugPrefix, isGradient: isGradient, popoverProps: popoverProps - }), !isEditing && editingElement !== null && (0,external_wp_element_namespaceObject.createElement)(ColorPickerPopover, { + }), !isEditing && editingElement !== null && (0,external_React_.createElement)(ColorPickerPopover, { isGradient: isGradient, onClose: () => setEditingElement(null), onChange: newElement => { @@ -50535,20 +46943,19 @@ function PaletteEdit({ }, element: elements[editingElement !== null && editingElement !== void 0 ? editingElement : -1], popoverProps: popoverProps - }), !isEditing && (isGradient ? (0,external_wp_element_namespaceObject.createElement)(gradient_picker, { - __nextHasNoMargin: true, + }), !isEditing && (isGradient ? (0,external_React_.createElement)(gradient_picker, { gradients: gradients, onChange: onSelectPaletteItem, clearable: false, disableCustomGradients: true - }) : (0,external_wp_element_namespaceObject.createElement)(color_palette, { + }) : (0,external_React_.createElement)(color_palette, { colors: colors, onChange: onSelectPaletteItem, clearable: false, disableCustomColors: true }))), !hasElements && emptyMessage); } -/* harmony default export */ var palette_edit = (PaletteEdit); +/* harmony default export */ const palette_edit = (PaletteEdit); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/combobox-control/styles.js @@ -50614,7 +47021,7 @@ function UnForwardedTokenInput(props, ref) { setHasFocus(false); onBlur?.(e); }; - return (0,external_wp_element_namespaceObject.createElement)("input", { + return (0,external_React_.createElement)("input", { ref: ref, id: `components-form-token-input-${instanceId}`, type: "text", @@ -50640,10 +47047,10 @@ function UnForwardedTokenInput(props, ref) { }); } const TokenInput = (0,external_wp_element_namespaceObject.forwardRef)(UnForwardedTokenInput); -/* harmony default export */ var token_input = (TokenInput); +/* harmony default export */ const token_input = (TokenInput); // EXTERNAL MODULE: ./node_modules/dom-scroll-into-view/lib/index.js -var lib = __webpack_require__(5425); +var lib = __webpack_require__(5428); var lib_default = /*#__PURE__*/__webpack_require__.n(lib); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/form-token-field/suggestions-list.js @@ -50722,7 +47129,7 @@ function SuggestionsList({ suggestionAfterMatch: transformedSuggestion.substring(indexOfMatch + matchText.length) }; }; - return (0,external_wp_element_namespaceObject.createElement)("ul", { + return (0,external_React_.createElement)("ul", { ref: listRef, className: "components-form-token-field__suggestions-list", id: `components-form-token-suggestions-${instanceId}`, @@ -50738,9 +47145,9 @@ function SuggestionsList({ item: suggestion }); } else if (matchText) { - output = (0,external_wp_element_namespaceObject.createElement)("span", { + output = (0,external_React_.createElement)("span", { "aria-label": displayTransform(suggestion) - }, matchText.suggestionBeforeMatch, (0,external_wp_element_namespaceObject.createElement)("strong", { + }, matchText.suggestionBeforeMatch, (0,external_React_.createElement)("strong", { className: "components-form-token-field__suggestion-match" }, matchText.suggestionMatch), matchText.suggestionAfterMatch); } else { @@ -50748,7 +47155,7 @@ function SuggestionsList({ } /* eslint-disable jsx-a11y/click-events-have-key-events */ - return (0,external_wp_element_namespaceObject.createElement)("li", { + return (0,external_React_.createElement)("li", { id: `components-form-token-suggestions-${instanceId}-${index}`, role: "option", className: className, @@ -50761,8 +47168,7 @@ function SuggestionsList({ /* eslint-enable jsx-a11y/click-events-have-key-events */ })); } - -/* harmony default export */ var suggestions_list = (SuggestionsList); +/* harmony default export */ const suggestions_list = (SuggestionsList); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-focus-outside/index.js @@ -50771,41 +47177,17 @@ function SuggestionsList({ */ -/* harmony default export */ var with_focus_outside = ((0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => props => { +/* harmony default export */ const with_focus_outside = ((0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => props => { const [handleFocusOutside, setHandleFocusOutside] = (0,external_wp_element_namespaceObject.useState)(undefined); const bindFocusOutsideHandler = (0,external_wp_element_namespaceObject.useCallback)(node => setHandleFocusOutside(() => node?.handleFocusOutside ? node.handleFocusOutside.bind(node) : undefined), []); - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { ...(0,external_wp_compose_namespaceObject.__experimentalUseFocusOutside)(handleFocusOutside) - }, (0,external_wp_element_namespaceObject.createElement)(WrappedComponent, { + }, (0,external_React_.createElement)(WrappedComponent, { ref: bindFocusOutsideHandler, ...props })); }, 'withFocusOutside')); -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/use-deprecated-props.js -/** - * WordPress dependencies - */ - -function useDeprecated36pxDefaultSizeProp(props, /** The component identifier in dot notation, e.g. `wp.components.ComponentName`. */ -componentIdentifier) { - const { - __next36pxDefaultSize, - __next40pxDefaultSize, - ...otherProps - } = props; - if (typeof __next36pxDefaultSize !== 'undefined') { - external_wp_deprecated_default()('`__next36pxDefaultSize` prop in ' + componentIdentifier, { - alternative: '`__next40pxDefaultSize`', - since: '6.3' - }); - } - return { - ...otherProps, - __next40pxDefaultSize: __next40pxDefaultSize !== null && __next40pxDefaultSize !== void 0 ? __next40pxDefaultSize : __next36pxDefaultSize - }; -} - ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/combobox-control/index.js /** @@ -50910,7 +47292,7 @@ function ComboboxControl(props) { selected: (0,external_wp_i18n_namespaceObject.__)('Item selected.') }, __experimentalRenderItem - } = useDeprecated36pxDefaultSizeProp(props, 'wp.components.ComboboxControl'); + } = useDeprecated36pxDefaultSizeProp(props); const [value, setValue] = useControlledValue({ value: valueProp, onChange: onChangeProp @@ -51045,22 +47427,22 @@ function ComboboxControl(props) { // input container intended accessible usability. // TODO: Refactor click detection to use blur to stop propagation. /* eslint-disable jsx-a11y/no-static-element-interactions */ - return (0,external_wp_element_namespaceObject.createElement)(DetectOutside, { + return (0,external_React_.createElement)(DetectOutside, { onFocusOutside: onFocusOutside - }, (0,external_wp_element_namespaceObject.createElement)(base_control, { + }, (0,external_React_.createElement)(base_control, { __nextHasNoMarginBottom: __nextHasNoMarginBottom, className: classnames_default()(className, 'components-combobox-control'), label: label, id: `components-form-token-input-${instanceId}`, hideLabelFromVision: hideLabelFromVision, help: help - }, (0,external_wp_element_namespaceObject.createElement)("div", { + }, (0,external_React_.createElement)("div", { className: "components-combobox-control__suggestions-container", tabIndex: -1, onKeyDown: onKeyDown - }, (0,external_wp_element_namespaceObject.createElement)(InputWrapperFlex, { + }, (0,external_React_.createElement)(InputWrapperFlex, { __next40pxDefaultSize: __next40pxDefaultSize - }, (0,external_wp_element_namespaceObject.createElement)(flex_block_component, null, (0,external_wp_element_namespaceObject.createElement)(token_input, { + }, (0,external_React_.createElement)(flex_block_component, null, (0,external_React_.createElement)(token_input, { className: "components-combobox-control__input", instanceId: instanceId, ref: inputContainer, @@ -51070,13 +47452,13 @@ function ComboboxControl(props) { isExpanded: isExpanded, selectedSuggestionIndex: getIndexOfMatchingSuggestion(selectedSuggestion, matchingSuggestions), onChange: onInputChange - })), allowReset && (0,external_wp_element_namespaceObject.createElement)(flex_item_component, null, (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + })), allowReset && (0,external_React_.createElement)(flex_item_component, null, (0,external_React_.createElement)(build_module_button, { className: "components-combobox-control__reset", icon: close_small, disabled: !value, onClick: handleOnReset, label: (0,external_wp_i18n_namespaceObject.__)('Reset') - }))), isExpanded && (0,external_wp_element_namespaceObject.createElement)(suggestions_list, { + }))), isExpanded && (0,external_React_.createElement)(suggestions_list, { instanceId: instanceId // The empty string for `value` here is not actually used, but is // just a quick way to satisfy the TypeScript requirements of SuggestionsList. @@ -51096,13 +47478,193 @@ function ComboboxControl(props) { })))); /* eslint-enable jsx-a11y/no-static-element-interactions */ } +/* harmony default export */ const combobox_control = (ComboboxControl); + +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/3X3MDQGM.js +"use client"; + +// src/group/group-label-context.ts + +var GroupLabelContext = (0,external_React_.createContext)(void 0); -/* harmony default export */ var combobox_control = (ComboboxControl); + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/R2QZ3KXH.js +"use client"; + + + + + +// src/group/group.tsx + + +var useGroup = createHook((props) => { + const [labelId, setLabelId] = (0,external_React_.useState)(); + props = useWrapElement( + props, + (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(GroupLabelContext.Provider, { value: setLabelId, children: element }), + [] + ); + props = _4R3V3JGP_spreadValues({ + role: "group", + "aria-labelledby": labelId + }, props); + return props; +}); +var Group = createComponent((props) => { + const htmlProps = useGroup(props); + return _3ORBWXWF_createElement("div", htmlProps); +}); +if (false) {} + + + +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/636A7WVS.js +"use client"; + + + + +// src/composite/composite-group.ts +var useCompositeGroup = createHook( + (_a) => { + var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); + props = useGroup(props); + return props; + } +); +var CompositeGroup = createComponent( + (props) => { + const htmlProps = useCompositeGroup(props); + return _3ORBWXWF_createElement("div", htmlProps); + } +); +if (false) {} + + + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/composite/legacy/index.js + +/** + * Composite is a component that may contain navigable items represented by + * CompositeItem. It's inspired by the WAI-ARIA Composite Role and implements + * all the keyboard navigation mechanisms to ensure that there's only one + * tab stop for the whole Composite element. This means that it can behave as + * a roving tabindex or aria-activedescendant container. + * + * @see https://ariakit.org/components/composite + */ + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + + +function mapLegacyStatePropsToComponentProps(legacyProps) { + // If a `state` prop is provided, we unpack that; otherwise, + // the necessary props are provided directly in `legacyProps`. + if (legacyProps.state) { + const { + state, + ...rest + } = legacyProps; + const { + store, + ...props + } = mapLegacyStatePropsToComponentProps(state); + return { + ...rest, + ...props, + store + }; + } + return legacyProps; +} +function proxyComposite(ProxiedComponent, propMap = {}) { + const displayName = ProxiedComponent.displayName; + const Component = legacyProps => { + const { + store, + ...rest + } = mapLegacyStatePropsToComponentProps(legacyProps); + const props = rest; + props.id = (0,external_wp_compose_namespaceObject.useInstanceId)(store, props.baseId, props.id); + Object.entries(propMap).forEach(([from, to]) => { + if (props.hasOwnProperty(from)) { + Object.assign(props, { + [to]: props[from] + }); + delete props[from]; + } + }); + delete props.baseId; + return (0,external_React_.createElement)(ProxiedComponent, { + ...props, + store: store + }); + }; + Component.displayName = displayName; + return Component; +} + +// The old `CompositeGroup` used to behave more like the current +// `CompositeRow`, but this has been split into two different +// components. We handle that difference by checking on the +// provided role, and returning the appropriate component. +const unproxiedCompositeGroup = (0,external_wp_element_namespaceObject.forwardRef)(({ + role, + ...props +}, ref) => { + const Component = role === 'row' ? CompositeRow : CompositeGroup; + return (0,external_React_.createElement)(Component, { + ref: ref, + role: role, + ...props + }); +}); +unproxiedCompositeGroup.displayName = 'CompositeGroup'; +const legacy_Composite = proxyComposite(Composite, { + baseId: 'id' +}); +const legacy_CompositeGroup = proxyComposite(unproxiedCompositeGroup); +const legacy_CompositeItem = proxyComposite(CompositeItem, { + focusable: 'accessibleWhenDisabled' +}); +function useCompositeState(legacyStateOptions = {}) { + const { + baseId, + currentId: defaultActiveId, + orientation, + rtl = false, + loop: focusLoop = false, + wrap: focusWrap = false, + shift: focusShift = false, + // eslint-disable-next-line camelcase + unstable_virtual: virtualFocus + } = legacyStateOptions; + return { + baseId: (0,external_wp_compose_namespaceObject.useInstanceId)(legacy_Composite, 'composite', baseId), + store: useCompositeStore({ + defaultActiveId, + rtl, + orientation, + focusLoop, + focusShift, + focusWrap, + virtualFocus + }) + }; +} ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/modal/aria-helper.js const LIVE_REGION_ARIA_ROLES = new Set(['alert', 'status', 'log', 'marquee', 'timer']); -let hiddenElements = [], - aria_helper_isHidden = false; +const hiddenElementsByDepth = []; /** * Hides all elements in the body element from screen-readers except @@ -51114,31 +47676,27 @@ let hiddenElements = [], * we should consider removing these helper functions in favor of * `aria-modal="true"`. * - * @param {HTMLDivElement} unhiddenElement The element that should not be hidden. + * @param modalElement The element that should not be hidden. */ -function hideApp(unhiddenElement) { - if (aria_helper_isHidden) { - return; - } +function modalize(modalElement) { const elements = Array.from(document.body.children); - elements.forEach(element => { - if (element === unhiddenElement) { - return; - } + const hiddenElements = []; + hiddenElementsByDepth.push(hiddenElements); + for (const element of elements) { + if (element === modalElement) continue; if (elementShouldBeHidden(element)) { element.setAttribute('aria-hidden', 'true'); hiddenElements.push(element); } - }); - aria_helper_isHidden = true; + } } /** * Determines if the passed element should not be hidden from screen readers. * - * @param {HTMLElement} element The element that should be checked. + * @param element The element that should be checked. * - * @return {boolean} Whether the element should not be hidden from screen-readers. + * @return Whether the element should not be hidden from screen-readers. */ function elementShouldBeHidden(element) { const role = element.getAttribute('role'); @@ -51146,18 +47704,12 @@ function elementShouldBeHidden(element) { } /** - * Makes all elements in the body that have been hidden by `hideApp` - * visible again to screen-readers. + * Accessibly reveals the elements hidden by the latest modal. */ -function showApp() { - if (!aria_helper_isHidden) { - return; - } - hiddenElements.forEach(element => { - element.removeAttribute('aria-hidden'); - }); - hiddenElements = []; - aria_helper_isHidden = false; +function unmodalize() { + const hiddenElements = hiddenElementsByDepth.pop(); + if (!hiddenElements) return; + for (const element of hiddenElements) element.removeAttribute('aria-hidden'); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/modal/index.js @@ -51181,8 +47733,11 @@ function showApp() { -// Used to count the number of open modals. -let openModalCount = 0; +// Used to track and dismiss the prior modal when another opens unless nested. +const ModalContext = (0,external_wp_element_namespaceObject.createContext)([]); + +// Used to track body class names applied while modals are open. +const bodyOpenClasses = new Map(); function UnforwardedModal(props, forwardedRef) { const { bodyOpenClassName = 'modal-open', @@ -51207,6 +47762,7 @@ function UnforwardedModal(props, forwardedRef) { contentLabel, onKeyDown, isFullScreen = false, + size, headerActions = null, __experimentalHideHeader = false } = props; @@ -51225,11 +47781,16 @@ function UnforwardedModal(props, forwardedRef) { const focusOnMountRef = (0,external_wp_compose_namespaceObject.useFocusOnMount)(focusOnMount === 'firstContentElement' ? 'firstElement' : focusOnMount); const constrainedTabbingRef = (0,external_wp_compose_namespaceObject.useConstrainedTabbing)(); const focusReturnRef = (0,external_wp_compose_namespaceObject.useFocusReturn)(); - const focusOutsideProps = (0,external_wp_compose_namespaceObject.__experimentalUseFocusOutside)(onRequestClose); const contentRef = (0,external_wp_element_namespaceObject.useRef)(null); const childrenContainerRef = (0,external_wp_element_namespaceObject.useRef)(null); const [hasScrolledContent, setHasScrolledContent] = (0,external_wp_element_namespaceObject.useState)(false); const [hasScrollableContent, setHasScrollableContent] = (0,external_wp_element_namespaceObject.useState)(false); + let sizeClass; + if (isFullScreen || size === 'fill') { + sizeClass = 'is-full-screen'; + } else if (size) { + sizeClass = `has-size-${size}`; + } // Determines whether the Modal content is scrollable and updates the state. const isContentScrollable = (0,external_wp_element_namespaceObject.useCallback)(() => { @@ -51243,17 +47804,52 @@ function UnforwardedModal(props, forwardedRef) { setHasScrollableContent(false); } }, [contentRef]); + + // Accessibly isolates/unisolates the modal. (0,external_wp_element_namespaceObject.useEffect)(() => { - openModalCount++; - if (openModalCount === 1) { - hideApp(ref.current); - document.body.classList.add(bodyOpenClassName); - } + modalize(ref.current); + return () => unmodalize(); + }, []); + + // Keeps a fresh ref for the subsequent effect. + const refOnRequestClose = (0,external_wp_element_namespaceObject.useRef)(); + (0,external_wp_element_namespaceObject.useEffect)(() => { + refOnRequestClose.current = onRequestClose; + }, [onRequestClose]); + + // The list of `onRequestClose` callbacks of open (non-nested) Modals. Only + // one should remain open at a time and the list enables closing prior ones. + const dismissers = (0,external_wp_element_namespaceObject.useContext)(ModalContext); + // Used for the tracking and dismissing any nested modals. + const nestedDismissers = (0,external_wp_element_namespaceObject.useRef)([]); + + // Updates the stack tracking open modals at this level and calls + // onRequestClose for any prior and/or nested modals as applicable. + (0,external_wp_element_namespaceObject.useEffect)(() => { + dismissers.push(refOnRequestClose); + const [first, second] = dismissers; + if (second) first?.current?.(); + const nested = nestedDismissers.current; + return () => { + nested[0]?.current?.(); + dismissers.shift(); + }; + }, [dismissers]); + + // Adds/removes the value of bodyOpenClassName to body element. + (0,external_wp_element_namespaceObject.useEffect)(() => { + var _bodyOpenClasses$get; + const theClass = bodyOpenClassName; + const oneMore = 1 + ((_bodyOpenClasses$get = bodyOpenClasses.get(theClass)) !== null && _bodyOpenClasses$get !== void 0 ? _bodyOpenClasses$get : 0); + bodyOpenClasses.set(theClass, oneMore); + document.body.classList.add(bodyOpenClassName); return () => { - openModalCount--; - if (openModalCount === 0) { - document.body.classList.remove(bodyOpenClassName); - showApp(); + const oneLess = bodyOpenClasses.get(theClass) - 1; + if (oneLess === 0) { + document.body.classList.remove(theClass); + bodyOpenClasses.delete(theClass); + } else { + bodyOpenClasses.set(theClass, oneLess); } }; }, [bodyOpenClassName]); @@ -51280,7 +47876,7 @@ function UnforwardedModal(props, forwardedRef) { event.keyCode === 229) { return; } - if (shouldCloseOnEsc && event.code === 'Escape' && !event.defaultPrevented) { + if (shouldCloseOnEsc && (event.code === 'Escape' || event.key === 'Escape') && !event.defaultPrevented) { event.preventDefault(); if (onRequestClose) { onRequestClose(event); @@ -51299,12 +47895,9 @@ function UnforwardedModal(props, forwardedRef) { let pressTarget = null; const overlayPressHandlers = { onPointerDown: event => { - if (event.isPrimary && event.target === event.currentTarget) { + if (event.target === event.currentTarget) { pressTarget = event.target; - // Avoids loss of focus yet also leaves `useFocusOutside` - // practically useless with its only potential trigger being - // programmatic focus movement. TODO opt for either removing - // the hook or enhancing it such that this isn't needed. + // Avoids focus changing so that focus return works as expected. event.preventDefault(); } }, @@ -51323,19 +47916,17 @@ function UnforwardedModal(props, forwardedRef) { if (button === 0 && isSameTarget) onRequestClose(); } }; - return (0,external_wp_element_namespaceObject.createPortal)( + const modal = // eslint-disable-next-line jsx-a11y/no-static-element-interactions - (0,external_wp_element_namespaceObject.createElement)("div", { + (0,external_React_.createElement)("div", { ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, forwardedRef]), className: classnames_default()('components-modal__screen-overlay', overlayClassName), onKeyDown: handleEscapeKeyDown, ...(shouldCloseOnClickOutside ? overlayPressHandlers : {}) - }, (0,external_wp_element_namespaceObject.createElement)(style_provider, { + }, (0,external_React_.createElement)(style_provider, { document: document - }, (0,external_wp_element_namespaceObject.createElement)("div", { - className: classnames_default()('components-modal__frame', className, { - 'is-full-screen': isFullScreen - }), + }, (0,external_React_.createElement)("div", { + className: classnames_default()('components-modal__frame', sizeClass, className), style: style, ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([constrainedTabbingRef, focusReturnRef, focusOnMount !== 'firstContentElement' ? focusOnMountRef : null]), role: role, @@ -51343,9 +47934,8 @@ function UnforwardedModal(props, forwardedRef) { "aria-labelledby": contentLabel ? undefined : headingId, "aria-describedby": aria.describedby, tabIndex: -1, - ...(shouldCloseOnClickOutside ? focusOutsideProps : {}), onKeyDown: onKeyDown - }, (0,external_wp_element_namespaceObject.createElement)("div", { + }, (0,external_React_.createElement)("div", { className: classnames_default()('components-modal__content', { 'hide-header': __experimentalHideHeader, 'is-scrollable': hasScrollableContent, @@ -51356,23 +47946,26 @@ function UnforwardedModal(props, forwardedRef) { ref: contentRef, "aria-label": hasScrollableContent ? (0,external_wp_i18n_namespaceObject.__)('Scrollable section') : undefined, tabIndex: hasScrollableContent ? 0 : undefined - }, !__experimentalHideHeader && (0,external_wp_element_namespaceObject.createElement)("div", { + }, !__experimentalHideHeader && (0,external_React_.createElement)("div", { className: "components-modal__header" - }, (0,external_wp_element_namespaceObject.createElement)("div", { + }, (0,external_React_.createElement)("div", { className: "components-modal__header-heading-container" - }, icon && (0,external_wp_element_namespaceObject.createElement)("span", { + }, icon && (0,external_React_.createElement)("span", { className: "components-modal__icon-container", "aria-hidden": true - }, icon), title && (0,external_wp_element_namespaceObject.createElement)("h1", { + }, icon), title && (0,external_React_.createElement)("h1", { id: headingId, className: "components-modal__header-heading" - }, title)), headerActions, isDismissible && (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }, title)), headerActions, isDismissible && (0,external_React_.createElement)(build_module_button, { onClick: onRequestClose, icon: library_close, label: closeButtonLabel || (0,external_wp_i18n_namespaceObject.__)('Close') - })), (0,external_wp_element_namespaceObject.createElement)("div", { + })), (0,external_React_.createElement)("div", { ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([childrenContainerRef, focusOnMount === 'firstContentElement' ? focusOnMountRef : null]) - }, children))))), document.body); + }, children))))); + return (0,external_wp_element_namespaceObject.createPortal)((0,external_React_.createElement)(ModalContext.Provider, { + value: nestedDismissers.current + }, modal), document.body); } /** @@ -51407,7 +48000,7 @@ function UnforwardedModal(props, forwardedRef) { * ``` */ const Modal = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedModal); -/* harmony default export */ var modal = (Modal); +/* harmony default export */ const modal = (Modal); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/confirm-dialog/styles.js function confirm_dialog_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } @@ -51432,10 +48025,6 @@ const styles_wrapper = true ? { ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/confirm-dialog/component.js /** - * External dependencies - */ - -/** * WordPress dependencies */ @@ -51452,7 +48041,7 @@ const styles_wrapper = true ? { -function ConfirmDialog(props, forwardedRef) { +const UnconnectedConfirmDialog = (props, forwardedRef) => { const { isOpen: isOpenProp, onConfirm, @@ -51493,7 +48082,7 @@ function ConfirmDialog(props, forwardedRef) { }, [handleEvent, onConfirm]); const cancelLabel = cancelButtonText !== null && cancelButtonText !== void 0 ? cancelButtonText : (0,external_wp_i18n_namespaceObject.__)('Cancel'); const confirmLabel = confirmButtonText !== null && confirmButtonText !== void 0 ? confirmButtonText : (0,external_wp_i18n_namespaceObject.__)('OK'); - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, isOpen && (0,external_wp_element_namespaceObject.createElement)(modal, { + return (0,external_React_.createElement)(external_React_.Fragment, null, isOpen && (0,external_React_.createElement)(modal, { onRequestClose: handleEvent(onCancel), onKeyDown: handleEnter, closeButtonLabel: cancelLabel, @@ -51502,28 +48091,99 @@ function ConfirmDialog(props, forwardedRef) { overlayClassName: wrapperClassName, __experimentalHideHeader: true, ...otherProps - }, (0,external_wp_element_namespaceObject.createElement)(v_stack_component, { + }, (0,external_React_.createElement)(v_stack_component, { spacing: 8 - }, (0,external_wp_element_namespaceObject.createElement)(text_component, null, children), (0,external_wp_element_namespaceObject.createElement)(flex_component, { + }, (0,external_React_.createElement)(text_component, null, children), (0,external_React_.createElement)(flex_component, { direction: "row", justify: "flex-end" - }, (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }, (0,external_React_.createElement)(build_module_button, { + __next40pxDefaultSize: true, ref: cancelButtonRef, variant: "tertiary", onClick: handleEvent(onCancel) - }, cancelLabel), (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }, cancelLabel), (0,external_React_.createElement)(build_module_button, { + __next40pxDefaultSize: true, ref: confirmButtonRef, variant: "primary", onClick: handleEvent(onConfirm) }, confirmLabel))))); -} -/* harmony default export */ var confirm_dialog_component = (contextConnect(ConfirmDialog, 'ConfirmDialog')); +}; + +/** + * `ConfirmDialog` is built of top of [`Modal`](/packages/components/src/modal/README.md) + * and displays a confirmation dialog, with _confirm_ and _cancel_ buttons. + * The dialog is confirmed by clicking the _confirm_ button or by pressing the `Enter` key. + * It is cancelled (closed) by clicking the _cancel_ button, by pressing the `ESC` key, or by + * clicking outside the dialog focus (i.e, the overlay). + * + * `ConfirmDialog` has two main implicit modes: controlled and uncontrolled. + * + * UnControlled: + * + * Allows the component to be used standalone, just by declaring it as part of another React's component render method: + * - It will be automatically open (displayed) upon mounting; + * - It will be automatically closed when clicking the _cancel_ button, by pressing the `ESC` key, or by clicking outside the dialog focus (i.e, the overlay); + * - `onCancel` is not mandatory but can be passed. Even if passed, the dialog will still be able to close itself. + * + * Activating this mode is as simple as omitting the `isOpen` prop. The only mandatory prop, in this case, is the `onConfirm` callback. The message is passed as the `children`. You can pass any JSX you'd like, which allows to further format the message or include sub-component if you'd like: + * + * ```jsx + * import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components'; + * + * function Example() { + * return ( + * <ConfirmDialog onConfirm={ () => console.debug( ' Confirmed! ' ) }> + * Are you sure? <strong>This action cannot be undone!</strong> + * </ConfirmDialog> + * ); + * } + * ``` + * + * + * Controlled mode: + * Let the parent component control when the dialog is open/closed. It's activated when a + * boolean value is passed to `isOpen`: + * - It will not be automatically closed. You need to let it know when to open/close by updating the value of the `isOpen` prop; + * - Both `onConfirm` and the `onCancel` callbacks are mandatory props in this mode; + * - You'll want to update the state that controls `isOpen` by updating it from the `onCancel` and `onConfirm` callbacks. + * + *```jsx + * import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components'; + * import { useState } from '@wordpress/element'; + * + * function Example() { + * const [ isOpen, setIsOpen ] = useState( true ); + * + * const handleConfirm = () => { + * console.debug( 'Confirmed!' ); + * setIsOpen( false ); + * }; + * + * const handleCancel = () => { + * console.debug( 'Cancelled!' ); + * setIsOpen( false ); + * }; + * + * return ( + * <ConfirmDialog + * isOpen={ isOpen } + * onConfirm={ handleConfirm } + * onCancel={ handleCancel } + * > + * Are you sure? <strong>This action cannot be undone!</strong> + * </ConfirmDialog> + * ); + * } + * ``` + */ +const ConfirmDialog = contextConnect(UnconnectedConfirmDialog, 'ConfirmDialog'); +/* harmony default export */ const confirm_dialog_component = (ConfirmDialog); // EXTERNAL MODULE: ./node_modules/prop-types/index.js -var prop_types = __webpack_require__(2652); +var prop_types = __webpack_require__(5826); var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types); // EXTERNAL MODULE: ./node_modules/downshift/node_modules/react-is/index.js -var react_is = __webpack_require__(2797); +var react_is = __webpack_require__(1915); ;// CONCATENATED MODULE: ./node_modules/compute-scroll-into-view/dist/index.mjs function dist_t(t){return"object"==typeof t&&null!=t&&1===t.nodeType}function dist_e(t,e){return(!e||"hidden"!==t)&&"visible"!==t&&"clip"!==t}function dist_n(t,n){if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){var r=getComputedStyle(t,null);return dist_e(r.overflowY,n)||dist_e(r.overflowX,n)||function(t){var e=function(t){if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}}(t);return!!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)}(t)}return!1}function dist_r(t,e,n,r,i,o,l,d){return o<t&&l>e||o>t&&l<e?0:o<=t&&d<=n||l>=e&&d>=n?o-t-r:l>e&&d<n||o<t&&d>n?l-e+i:0}var compute_scroll_into_view_dist_i=function(e,i){var o=window,l=i.scrollMode,d=i.block,f=i.inline,h=i.boundary,u=i.skipOverflowHiddenElements,s="function"==typeof h?h:function(t){return t!==h};if(!dist_t(e))throw new TypeError("Invalid target");for(var a,c,g=document.scrollingElement||document.documentElement,p=[],m=e;dist_t(m)&&s(m);){if((m=null==(c=(a=m).parentElement)?a.getRootNode().host||null:c)===g){p.push(m);break}null!=m&&m===document.body&&dist_n(m)&&!dist_n(document.documentElement)||null!=m&&dist_n(m,u)&&p.push(m)}for(var w=o.visualViewport?o.visualViewport.width:innerWidth,v=o.visualViewport?o.visualViewport.height:innerHeight,W=window.scrollX||pageXOffset,H=window.scrollY||pageYOffset,b=e.getBoundingClientRect(),y=b.height,E=b.width,M=b.top,V=b.right,x=b.bottom,I=b.left,C="start"===d||"nearest"===d?M:"end"===d?x:M+y/2,R="center"===f?I+E/2:"end"===f?V:I,T=[],k=0;k<p.length;k++){var B=p[k],D=B.getBoundingClientRect(),O=D.height,X=D.width,Y=D.top,L=D.right,S=D.bottom,j=D.left;if("if-needed"===l&&M>=0&&I>=0&&x<=v&&V<=w&&M>=Y&&x<=S&&I>=j&&V<=L)return T;var N=getComputedStyle(B),q=parseInt(N.borderLeftWidth,10),z=parseInt(N.borderTopWidth,10),A=parseInt(N.borderRightWidth,10),F=parseInt(N.borderBottomWidth,10),G=0,J=0,K="offsetWidth"in B?B.offsetWidth-B.clientWidth-q-A:0,P="offsetHeight"in B?B.offsetHeight-B.clientHeight-z-F:0,Q="offsetWidth"in B?0===B.offsetWidth?0:X/B.offsetWidth:0,U="offsetHeight"in B?0===B.offsetHeight?0:O/B.offsetHeight:0;if(g===B)G="start"===d?C:"end"===d?C-v:"nearest"===d?dist_r(H,H+v,v,z,F,H+C,H+C+y,y):C-v/2,J="start"===f?R:"center"===f?R-w/2:"end"===f?R-w:dist_r(W,W+w,w,q,A,W+R,W+R+E,E),G=Math.max(0,G+H),J=Math.max(0,J+W);else{G="start"===d?C-Y-z:"end"===d?C-S+F+P:"nearest"===d?dist_r(Y,S,O,z,F+P,C,C+y,y):C-(Y+O/2)+P/2,J="start"===f?R-j-q:"center"===f?R-(j+X/2)+K/2:"end"===f?R-L+A+K:dist_r(j,L,X,q,A+K,R,R+E,E);var Z=B.scrollLeft,$=B.scrollTop;C+=$-(G=Math.max(0,Math.min($+G/U,B.scrollHeight-O/U+P))),R+=Z-(J=Math.max(0,Math.min(Z+J/Q,B.scrollWidth-X/Q+K)))}T.push({el:B,top:G,left:J})}return T}; //# sourceMappingURL=index.mjs.map @@ -51599,7 +48259,7 @@ function isOrContainsNode(parent, child, environment) { */ -function downshift_esm_debounce(fn, time) { +function debounce(fn, time) { let timeoutId; function cancel() { @@ -51960,7 +48620,7 @@ let validateControlledUnchanged = (/* unused pure expression or super */ null && if (false) {} -const cleanupStatus = downshift_esm_debounce(documentProp => { +const cleanupStatus = debounce(documentProp => { getStatusDiv(documentProp).textContent = ''; }, 500); /** @@ -52749,7 +49409,7 @@ const Downshift = /*#__PURE__*/(/* unused pure expression or super */ null && (( }, cb); }; - this.updateStatus = downshift_esm_debounce(() => { + this.updateStatus = debounce(() => { const state = this.getState(); const item = this.items[state.highlightedIndex]; const resultCount = this.getItemCount(); @@ -53226,7 +49886,7 @@ function getA11ySelectionMessage(selectionParameters) { */ -const updateA11yStatus = downshift_esm_debounce((getA11yMessage, document) => { +const updateA11yStatus = debounce((getA11yMessage, document) => { setStatus(getA11yMessage(), document); }, 200); // istanbul ignore next @@ -53996,7 +50656,7 @@ function useSelect(userProps) { (0,external_React_.useEffect)(() => { // init the clean function here as we need access to dispatch. - clearTimeoutRef.current = downshift_esm_debounce(outerDispatch => { + clearTimeoutRef.current = debounce(outerDispatch => { outerDispatch({ type: FunctionSetInputValue$1, inputValue: '' @@ -55741,6 +52401,7 @@ const InputBaseWithBackCompatMinWidth = /*#__PURE__*/emotion_styled_base_browser + const custom_select_control_itemToString = item => item?.name; // This is needed so that in Windows, where // the menu does not necessarily open on @@ -55775,7 +52436,7 @@ const custom_select_control_stateReducer = ({ function CustomSelectControl(props) { const { /** Start opting into the larger default height that will become the default size in a future version. */ - __next36pxDefaultSize = false, + __next40pxDefaultSize = false, /** Start opting into the unconstrained width that will become the default in a future version. */ __nextUnconstrainedWidth = false, className, @@ -55792,7 +52453,7 @@ function CustomSelectControl(props) { onFocus, onBlur, __experimentalShowSelectedHint = false - } = props; + } = useDeprecated36pxDefaultSizeProp(props); const { getLabelProps, getToggleButtonProps, @@ -55851,32 +52512,32 @@ function CustomSelectControl(props) { if (menuProps['aria-activedescendant']?.startsWith('downshift-null')) { delete menuProps['aria-activedescendant']; } - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { className: classnames_default()('components-custom-select-control', className) - }, hideLabelFromVision ? (0,external_wp_element_namespaceObject.createElement)(visually_hidden_component, { + }, hideLabelFromVision ? (0,external_React_.createElement)(visually_hidden_component, { as: "label", ...getLabelProps() }, label) : /* eslint-disable-next-line jsx-a11y/label-has-associated-control, jsx-a11y/label-has-for */ - (0,external_wp_element_namespaceObject.createElement)(StyledLabel, { + (0,external_React_.createElement)(StyledLabel, { ...getLabelProps({ className: 'components-custom-select-control__label' }) - }, label), (0,external_wp_element_namespaceObject.createElement)(InputBaseWithBackCompatMinWidth, { - __next36pxDefaultSize: __next36pxDefaultSize, + }, label), (0,external_React_.createElement)(InputBaseWithBackCompatMinWidth, { + __next40pxDefaultSize: __next40pxDefaultSize, __nextUnconstrainedWidth: __nextUnconstrainedWidth, isFocused: isOpen || isFocused, __unstableInputWidth: __nextUnconstrainedWidth ? undefined : 'auto', labelPosition: __nextUnconstrainedWidth ? undefined : 'top', size: size, - suffix: (0,external_wp_element_namespaceObject.createElement)(select_control_chevron_down, null) - }, (0,external_wp_element_namespaceObject.createElement)(Select, { + suffix: (0,external_React_.createElement)(select_control_chevron_down, null) + }, (0,external_React_.createElement)(Select, { onMouseOver: onMouseOver, onMouseOut: onMouseOut, as: "button", onFocus: handleOnFocus, onBlur: handleOnBlur, selectSize: size, - __next36pxDefaultSize: __next36pxDefaultSize, + __next40pxDefaultSize: __next40pxDefaultSize, ...getToggleButtonProps({ // This is needed because some speech recognition software don't support `aria-labelledby`. 'aria-label': label, @@ -55884,14 +52545,14 @@ function CustomSelectControl(props) { className: 'components-custom-select-control__button', describedBy: getDescribedBy() }) - }, custom_select_control_itemToString(selectedItem), __experimentalShowSelectedHint && selectedItem.__experimentalHint && (0,external_wp_element_namespaceObject.createElement)("span", { + }, custom_select_control_itemToString(selectedItem), __experimentalShowSelectedHint && selectedItem.__experimentalHint && (0,external_React_.createElement)("span", { className: "components-custom-select-control__hint" - }, selectedItem.__experimentalHint))), (0,external_wp_element_namespaceObject.createElement)("ul", { + }, selectedItem.__experimentalHint))), (0,external_React_.createElement)("ul", { ...menuProps, onKeyDown: onKeyDownHandler }, isOpen && items.map((item, index) => // eslint-disable-next-line react/jsx-key - (0,external_wp_element_namespaceObject.createElement)("li", { + (0,external_React_.createElement)("li", { ...getItemProps({ item, index, @@ -55899,19 +52560,19 @@ function CustomSelectControl(props) { className: classnames_default()(item.className, 'components-custom-select-control__item', { 'is-highlighted': index === highlightedIndex, 'has-hint': !!item.__experimentalHint, - 'is-next-36px-default-size': __next36pxDefaultSize + 'is-next-40px-default-size': __next40pxDefaultSize }), style: item.style }) - }, item.name, item.__experimentalHint && (0,external_wp_element_namespaceObject.createElement)("span", { + }, item.name, item.__experimentalHint && (0,external_React_.createElement)("span", { className: "components-custom-select-control__item-hint" - }, item.__experimentalHint), item === selectedItem && (0,external_wp_element_namespaceObject.createElement)(icons_build_module_icon, { + }, item.__experimentalHint), item === selectedItem && (0,external_React_.createElement)(icons_build_module_icon, { icon: library_check, className: "components-custom-select-control__item-icon" }))))); } function StableCustomSelectControl(props) { - return (0,external_wp_element_namespaceObject.createElement)(CustomSelectControl, { + return (0,external_React_.createElement)(CustomSelectControl, { ...props, __experimentalShowSelectedHint: false }); @@ -57571,7 +54232,7 @@ var formatters = { return addLeadingZeros(fractionalSeconds, token.length); } }; -/* harmony default export */ var lightFormatters = (formatters); +/* harmony default export */ const lightFormatters = (formatters); ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/_lib/format/formatters/index.js @@ -58438,7 +55099,7 @@ function formatTimezone(offset, dirtyDelimiter) { return sign + hours + delimiter + minutes; } -/* harmony default export */ var format_formatters = (formatters_formatters); +/* harmony default export */ const format_formatters = (formatters_formatters); ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/_lib/format/longFormatters/index.js var dateLongFormatter = function dateLongFormatter(pattern, formatLong) { switch (pattern) { @@ -58535,7 +55196,7 @@ var longFormatters = { p: timeLongFormatter, P: dateTimeLongFormatter }; -/* harmony default export */ var format_longFormatters = (longFormatters); +/* harmony default export */ const format_longFormatters = (longFormatters); ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js /** * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds. @@ -58661,7 +55322,7 @@ var formatDistance = function formatDistance(token, count, options) { return result; }; -/* harmony default export */ var _lib_formatDistance = (formatDistance); +/* harmony default export */ const _lib_formatDistance = (formatDistance); ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js function buildFormatLongFn(args) { return function () { @@ -58706,7 +55367,7 @@ var formatLong = { defaultWidth: 'full' }) }; -/* harmony default export */ var _lib_formatLong = (formatLong); +/* harmony default export */ const _lib_formatLong = (formatLong); ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js var formatRelativeLocale = { lastWeek: "'last' eeee 'at' p", @@ -58721,7 +55382,7 @@ var formatRelative = function formatRelative(token, _date, _baseDate, _options) return formatRelativeLocale[token]; }; -/* harmony default export */ var _lib_formatRelative = (formatRelative); +/* harmony default export */ const _lib_formatRelative = (formatRelative); ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js function buildLocalizeFn(args) { return function (dirtyIndex, options) { @@ -58891,7 +55552,7 @@ var localize = { defaultFormattingWidth: 'wide' }) }; -/* harmony default export */ var _lib_localize = (localize); +/* harmony default export */ const _lib_localize = (localize); ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js function buildMatchFn(args) { return function (string) { @@ -59057,7 +55718,7 @@ var match_match = { defaultParseWidth: 'any' }) }; -/* harmony default export */ var _lib_match = (match_match); +/* harmony default export */ const _lib_match = (match_match); ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/locale/en-US/index.js @@ -59088,10 +55749,10 @@ var locale = { firstWeekContainsDate: 1 } }; -/* harmony default export */ var en_US = (locale); +/* harmony default export */ const en_US = (locale); ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/_lib/defaultLocale/index.js -/* harmony default export */ var defaultLocale = (en_US); +/* harmony default export */ const defaultLocale = (en_US); ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/format/index.js @@ -59818,13 +56479,13 @@ function endOfWeek_endOfWeek(dirtyDate, options) { * WordPress dependencies */ -const arrowRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const arrowRight = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z" })); -/* harmony default export */ var arrow_right = (arrowRight); +/* harmony default export */ const arrow_right = (arrowRight); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/arrow-left.js @@ -59832,16 +56493,16 @@ const arrowRight = (0,external_wp_element_namespaceObject.createElement)(externa * WordPress dependencies */ -const arrowLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const arrowLeft = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z" })); -/* harmony default export */ var arrow_left = (arrowLeft); +/* harmony default export */ const arrow_left = (arrowLeft); ;// CONCATENATED MODULE: external ["wp","date"] -var external_wp_date_namespaceObject = window["wp"]["date"]; +const external_wp_date_namespaceObject = window["wp"]["date"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/date-time/date/styles.js function date_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } @@ -59884,7 +56545,7 @@ const DayButton = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_butt justify-self: end; `, " ", props => props.disabled && ` pointer-events: none; - `, " &&&{border-radius:100%;height:", space(7), ";width:", space(7), ";", props => props.isSelected && ` + `, " &&&{border-radius:100%;height:", space(8), ";width:", space(8), ";", props => props.isSelected && ` background: ${COLORS.theme.accent}; color: ${COLORS.white}; `, " ", props => !props.isSelected && props.isToday && ` @@ -59893,7 +56554,7 @@ const DayButton = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_butt ::before { background: ${props.isSelected ? COLORS.white : COLORS.theme.accent}; border-radius: 2px; - bottom: 0; + bottom: 2px; content: " "; height: 4px; left: 50%; @@ -60008,11 +56669,11 @@ function DatePicker({ setViewing(startOfDay_startOfDay(date)); setFocusable(startOfDay_startOfDay(date)); } - return (0,external_wp_element_namespaceObject.createElement)(styles_Wrapper, { + return (0,external_React_.createElement)(styles_Wrapper, { className: "components-datetime__date", role: "application", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Calendar') - }, (0,external_wp_element_namespaceObject.createElement)(Navigator, null, (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }, (0,external_React_.createElement)(Navigator, null, (0,external_React_.createElement)(build_module_button, { icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? arrow_right : arrow_left, variant: "tertiary", "aria-label": (0,external_wp_i18n_namespaceObject.__)('View previous month'), @@ -60021,9 +56682,9 @@ function DatePicker({ setFocusable(subMonths_subMonths(focusable, 1)); onMonthPreviewed?.(format(subMonths_subMonths(viewing, 1), TIMEZONELESS_FORMAT)); } - }), (0,external_wp_element_namespaceObject.createElement)(NavigatorHeading, { + }), (0,external_React_.createElement)(NavigatorHeading, { level: 3 - }, (0,external_wp_element_namespaceObject.createElement)("strong", null, (0,external_wp_date_namespaceObject.dateI18n)('F', viewing, -viewing.getTimezoneOffset())), ' ', (0,external_wp_date_namespaceObject.dateI18n)('Y', viewing, -viewing.getTimezoneOffset())), (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }, (0,external_React_.createElement)("strong", null, (0,external_wp_date_namespaceObject.dateI18n)('F', viewing, -viewing.getTimezoneOffset())), ' ', (0,external_wp_date_namespaceObject.dateI18n)('Y', viewing, -viewing.getTimezoneOffset())), (0,external_React_.createElement)(build_module_button, { icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? arrow_left : arrow_right, variant: "tertiary", "aria-label": (0,external_wp_i18n_namespaceObject.__)('View next month'), @@ -60032,16 +56693,16 @@ function DatePicker({ setFocusable(addMonths_addMonths(focusable, 1)); onMonthPreviewed?.(format(addMonths_addMonths(viewing, 1), TIMEZONELESS_FORMAT)); } - })), (0,external_wp_element_namespaceObject.createElement)(Calendar, { + })), (0,external_React_.createElement)(Calendar, { onFocus: () => setIsFocusWithinCalendar(true), onBlur: () => setIsFocusWithinCalendar(false) - }, calendar[0][0].map(day => (0,external_wp_element_namespaceObject.createElement)(DayOfWeek, { + }, calendar[0][0].map(day => (0,external_React_.createElement)(DayOfWeek, { key: day.toString() }, (0,external_wp_date_namespaceObject.dateI18n)('D', day, -day.getTimezoneOffset()))), calendar[0].map(week => week.map((day, index) => { if (!isSameMonth(day, viewing)) { return null; } - return (0,external_wp_element_namespaceObject.createElement)(date_Day, { + return (0,external_React_.createElement)(date_Day, { key: day.toString(), day: day, column: index + 1, @@ -60121,7 +56782,7 @@ function date_Day({ // an already focused element. // eslint-disable-next-line react-hooks/exhaustive-deps }, [isFocusable]); - return (0,external_wp_element_namespaceObject.createElement)(DayButton, { + return (0,external_React_.createElement)(DayButton, { ref: ref, className: "components-datetime__date__day" // Unused, for backwards compatibility. , @@ -60156,7 +56817,7 @@ function getDayLabel(date, isSelected, numEvents) { } return localizedDate; } -/* harmony default export */ var date = (DatePicker); +/* harmony default export */ const date = (DatePicker); ;// CONCATENATED MODULE: ./node_modules/date-fns/esm/startOfMinute/index.js @@ -60391,42 +57052,37 @@ function time_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried t - - const time_styles_Wrapper = emotion_styled_base_browser_esm("div", true ? { - target: "evcr23110" + target: "evcr2319" } : 0)("box-sizing:border-box;font-size:", config_values.fontSize, ";" + ( true ? "" : 0)); const Fieldset = emotion_styled_base_browser_esm("fieldset", true ? { - target: "evcr2319" + target: "evcr2318" } : 0)("border:0;margin:0 0 ", space(2 * 2), " 0;padding:0;&:last-child{margin-bottom:0;}" + ( true ? "" : 0)); const TimeWrapper = emotion_styled_base_browser_esm("div", true ? { - target: "evcr2318" + target: "evcr2317" } : 0)( true ? { name: "pd0mhc", styles: "direction:ltr;display:flex" } : 0); const baseInput = /*#__PURE__*/emotion_react_browser_esm_css("&&& ", Input, "{padding-left:", space(2), ";padding-right:", space(2), ";text-align:center;}" + ( true ? "" : 0), true ? "" : 0); const HoursInput = /*#__PURE__*/emotion_styled_base_browser_esm(number_control, true ? { - target: "evcr2317" + target: "evcr2316" } : 0)(baseInput, " width:", space(9), ";&&& ", Input, "{padding-right:0;}&&& ", BackdropUI, "{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0;}" + ( true ? "" : 0)); const TimeSeparator = emotion_styled_base_browser_esm("span", true ? { - target: "evcr2316" + target: "evcr2315" } : 0)("border-top:", config_values.borderWidth, " solid ", COLORS.gray[700], ";border-bottom:", config_values.borderWidth, " solid ", COLORS.gray[700], ";line-height:calc(\n\t\t", config_values.controlHeight, " - ", config_values.borderWidth, " * 2\n\t);display:inline-block;" + ( true ? "" : 0)); const MinutesInput = /*#__PURE__*/emotion_styled_base_browser_esm(number_control, true ? { - target: "evcr2315" + target: "evcr2314" } : 0)(baseInput, " width:", space(9), ";&&& ", Input, "{padding-left:0;}&&& ", BackdropUI, "{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0;}" + ( true ? "" : 0)); // Ideally we wouldn't need a wrapper, but can't otherwise target the // <BaseControl> in <SelectControl> const MonthSelectWrapper = emotion_styled_base_browser_esm("div", true ? { - target: "evcr2314" + target: "evcr2313" } : 0)( true ? { name: "1ff36h2", styles: "flex-grow:1" } : 0); -const MonthSelect = /*#__PURE__*/emotion_styled_base_browser_esm(select_control, true ? { - target: "evcr2313" -} : 0)("height:36px;", Select, "{line-height:30px;}" + ( true ? "" : 0)); const DayInput = /*#__PURE__*/emotion_styled_base_browser_esm(number_control, true ? { target: "evcr2312" } : 0)(baseInput, " width:", space(9), ";" + ( true ? "" : 0)); @@ -60472,16 +57128,25 @@ const timezone_TimeZone = () => { return null; } const offsetSymbol = Number(timezone.offset) >= 0 ? '+' : ''; - const zoneAbbr = '' !== timezone.abbr && isNaN(Number(timezone.abbr)) ? timezone.abbr : `UTC${offsetSymbol}${timezone.offset}`; - const timezoneDetail = 'UTC' === timezone.string ? (0,external_wp_i18n_namespaceObject.__)('Coordinated Universal Time') : `(${zoneAbbr}) ${timezone.string.replace('_', ' ')}`; - return (0,external_wp_element_namespaceObject.createElement)(tooltip, { + const zoneAbbr = '' !== timezone.abbr && isNaN(Number(timezone.abbr)) ? timezone.abbr : `UTC${offsetSymbol}${timezone.offsetFormatted}`; + + // Replace underscore with space in strings like `America/Costa_Rica`. + const prettyTimezoneString = timezone.string.replace('_', ' '); + const timezoneDetail = 'UTC' === timezone.string ? (0,external_wp_i18n_namespaceObject.__)('Coordinated Universal Time') : `(${zoneAbbr}) ${prettyTimezoneString}`; + + // When the prettyTimezoneString is empty, there is no additional timezone + // detail information to show in a Tooltip. + const hasNoAdditionalTimezoneDetail = prettyTimezoneString.trim().length === 0; + return hasNoAdditionalTimezoneDetail ? (0,external_React_.createElement)(TimeZone, { + className: "components-datetime__timezone" + }, zoneAbbr) : (0,external_React_.createElement)(tooltip, { placement: "top", text: timezoneDetail - }, (0,external_wp_element_namespaceObject.createElement)(TimeZone, { + }, (0,external_React_.createElement)(TimeZone, { className: "components-datetime__timezone" }, zoneAbbr)); }; -/* harmony default export */ var timezone = (timezone_TimeZone); +/* harmony default export */ const timezone = (timezone_TimeZone); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/date-time/time/index.js @@ -60509,6 +57174,7 @@ const timezone_TimeZone = () => { + function from12hTo24h(hours, isPm) { return isPm ? (hours % 12 + 12) % 24 : hours % 12; } @@ -60627,12 +57293,12 @@ function TimePicker({ onChange?.(format(newDate, TIMEZONELESS_FORMAT)); }; } - const dayField = (0,external_wp_element_namespaceObject.createElement)(DayInput, { + const dayField = (0,external_React_.createElement)(DayInput, { className: "components-datetime__time-field components-datetime__time-field-day" // Unused, for backwards compatibility. , label: (0,external_wp_i18n_namespaceObject.__)('Day'), hideLabelFromVision: true, - __next36pxDefaultSize: true, + __next40pxDefaultSize: true, value: day, step: 1, min: 1, @@ -60644,11 +57310,12 @@ function TimePicker({ isShiftStepEnabled: false, onChange: buildNumberControlChangeCallback('date') }); - const monthField = (0,external_wp_element_namespaceObject.createElement)(MonthSelectWrapper, null, (0,external_wp_element_namespaceObject.createElement)(MonthSelect, { + const monthField = (0,external_React_.createElement)(MonthSelectWrapper, null, (0,external_React_.createElement)(select_control, { className: "components-datetime__time-field components-datetime__time-field-month" // Unused, for backwards compatibility. , label: (0,external_wp_i18n_namespaceObject.__)('Month'), hideLabelFromVision: true, + __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, value: month, options: [{ @@ -60694,21 +57361,21 @@ function TimePicker({ onChange?.(format(newDate, TIMEZONELESS_FORMAT)); } })); - return (0,external_wp_element_namespaceObject.createElement)(time_styles_Wrapper, { + return (0,external_React_.createElement)(time_styles_Wrapper, { className: "components-datetime__time" // Unused, for backwards compatibility. - }, (0,external_wp_element_namespaceObject.createElement)(Fieldset, null, (0,external_wp_element_namespaceObject.createElement)(base_control.VisualLabel, { + }, (0,external_React_.createElement)(Fieldset, null, (0,external_React_.createElement)(base_control.VisualLabel, { as: "legend", className: "components-datetime__time-legend" // Unused, for backwards compatibility. - }, (0,external_wp_i18n_namespaceObject.__)('Time')), (0,external_wp_element_namespaceObject.createElement)(h_stack_component, { + }, (0,external_wp_i18n_namespaceObject.__)('Time')), (0,external_React_.createElement)(h_stack_component, { className: "components-datetime__time-wrapper" // Unused, for backwards compatibility. - }, (0,external_wp_element_namespaceObject.createElement)(TimeWrapper, { + }, (0,external_React_.createElement)(TimeWrapper, { className: "components-datetime__time-field components-datetime__time-field-time" // Unused, for backwards compatibility. - }, (0,external_wp_element_namespaceObject.createElement)(HoursInput, { + }, (0,external_React_.createElement)(HoursInput, { className: "components-datetime__time-field-hours-input" // Unused, for backwards compatibility. , label: (0,external_wp_i18n_namespaceObject.__)('Hours'), hideLabelFromVision: true, - __next36pxDefaultSize: true, + __next40pxDefaultSize: true, value: hours, step: 1, min: is12Hour ? 1 : 0, @@ -60720,16 +57387,16 @@ function TimePicker({ isShiftStepEnabled: false, onChange: buildNumberControlChangeCallback('hours'), __unstableStateReducer: buildPadInputStateReducer(2) - }), (0,external_wp_element_namespaceObject.createElement)(TimeSeparator, { + }), (0,external_React_.createElement)(TimeSeparator, { className: "components-datetime__time-separator" // Unused, for backwards compatibility. , "aria-hidden": "true" - }, ":"), (0,external_wp_element_namespaceObject.createElement)(MinutesInput, { + }, ":"), (0,external_React_.createElement)(MinutesInput, { className: "components-datetime__time-field-minutes-input" // Unused, for backwards compatibility. , label: (0,external_wp_i18n_namespaceObject.__)('Minutes'), hideLabelFromVision: true, - __next36pxDefaultSize: true, + __next40pxDefaultSize: true, value: minutes, step: 1, min: 0, @@ -60741,29 +57408,31 @@ function TimePicker({ isShiftStepEnabled: false, onChange: buildNumberControlChangeCallback('minutes'), __unstableStateReducer: buildPadInputStateReducer(2) - })), is12Hour && (0,external_wp_element_namespaceObject.createElement)(button_group, { + })), is12Hour && (0,external_React_.createElement)(button_group, { className: "components-datetime__time-field components-datetime__time-field-am-pm" // Unused, for backwards compatibility. - }, (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }, (0,external_React_.createElement)(build_module_button, { className: "components-datetime__time-am-button" // Unused, for backwards compatibility. , variant: am === 'AM' ? 'primary' : 'secondary', + __next40pxDefaultSize: true, onClick: buildAmPmChangeCallback('AM') - }, (0,external_wp_i18n_namespaceObject.__)('AM')), (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }, (0,external_wp_i18n_namespaceObject.__)('AM')), (0,external_React_.createElement)(build_module_button, { className: "components-datetime__time-pm-button" // Unused, for backwards compatibility. , variant: am === 'PM' ? 'primary' : 'secondary', + __next40pxDefaultSize: true, onClick: buildAmPmChangeCallback('PM') - }, (0,external_wp_i18n_namespaceObject.__)('PM'))), (0,external_wp_element_namespaceObject.createElement)(spacer_component, null), (0,external_wp_element_namespaceObject.createElement)(timezone, null))), (0,external_wp_element_namespaceObject.createElement)(Fieldset, null, (0,external_wp_element_namespaceObject.createElement)(base_control.VisualLabel, { + }, (0,external_wp_i18n_namespaceObject.__)('PM'))), (0,external_React_.createElement)(spacer_component, null), (0,external_React_.createElement)(timezone, null))), (0,external_React_.createElement)(Fieldset, null, (0,external_React_.createElement)(base_control.VisualLabel, { as: "legend", className: "components-datetime__time-legend" // Unused, for backwards compatibility. - }, (0,external_wp_i18n_namespaceObject.__)('Date')), (0,external_wp_element_namespaceObject.createElement)(h_stack_component, { + }, (0,external_wp_i18n_namespaceObject.__)('Date')), (0,external_React_.createElement)(h_stack_component, { className: "components-datetime__time-wrapper" // Unused, for backwards compatibility. - }, is12Hour ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, monthField, dayField) : (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, dayField, monthField), (0,external_wp_element_namespaceObject.createElement)(YearInput, { + }, is12Hour ? (0,external_React_.createElement)(external_React_.Fragment, null, monthField, dayField) : (0,external_React_.createElement)(external_React_.Fragment, null, dayField, monthField), (0,external_React_.createElement)(YearInput, { className: "components-datetime__time-field components-datetime__time-field-year" // Unused, for backwards compatibility. , label: (0,external_wp_i18n_namespaceObject.__)('Year'), hideLabelFromVision: true, - __next36pxDefaultSize: true, + __next40pxDefaultSize: true, value: year, step: 1, min: 1, @@ -60777,7 +57446,7 @@ function TimePicker({ __unstableStateReducer: buildPadInputStateReducer(4) })))); } -/* harmony default export */ var time = (TimePicker); +/* harmony default export */ const time = (TimePicker); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/date-time/date-time/styles.js @@ -60824,15 +57493,15 @@ function UnforwardedDateTimePicker({ events, startOfWeek }, ref) { - return (0,external_wp_element_namespaceObject.createElement)(date_time_styles_Wrapper, { + return (0,external_React_.createElement)(date_time_styles_Wrapper, { ref: ref, className: "components-datetime", spacing: 4 - }, (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(time, { + }, (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(time, { currentTime: currentDate, onChange: onChange, is12Hour: is12Hour - }), (0,external_wp_element_namespaceObject.createElement)(date, { + }), (0,external_React_.createElement)(date, { currentDate: currentDate, onChange: onChange, isInvalidDate: isInvalidDate, @@ -60865,7 +57534,7 @@ function UnforwardedDateTimePicker({ * ``` */ const DateTimePicker = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedDateTimePicker); -/* harmony default export */ var date_time = (DateTimePicker); +/* harmony default export */ const date_time = (DateTimePicker); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/date-time/index.js /** @@ -60875,7 +57544,7 @@ const DateTimePicker = (0,external_wp_element_namespaceObject.forwardRef)(Unforw -/* harmony default export */ var build_module_date_time = (date_time); +/* harmony default export */ const build_module_date_time = (date_time); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/dimension-control/sizes.js /** @@ -60904,7 +57573,7 @@ const DateTimePicker = (0,external_wp_element_namespaceObject.forwardRef)(Unforw * @param slug a string representation of the size (eg: `medium`). */ const findSizeBySlug = (sizes, slug) => sizes.find(size => slug === size.slug); -/* harmony default export */ var dimension_control_sizes = ([{ +/* harmony default export */ const dimension_control_sizes = ([{ name: (0,external_wp_i18n_namespaceObject._x)('None', 'Size of a UI element'), slug: 'none' }, { @@ -60964,6 +57633,7 @@ const findSizeBySlug = (sizes, slug) => sizes.find(size => slug === size.slug); */ function DimensionControl(props) { const { + __next40pxDefaultSize = false, label, value, sizes = dimension_control_sizes, @@ -60992,10 +57662,11 @@ function DimensionControl(props) { value: '' }, ...options]; }; - const selectLabel = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, icon && (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { + const selectLabel = (0,external_React_.createElement)(external_React_.Fragment, null, icon && (0,external_React_.createElement)(build_module_icon, { icon: icon }), label); - return (0,external_wp_element_namespaceObject.createElement)(select_control, { + return (0,external_React_.createElement)(select_control, { + __next40pxDefaultSize: __next40pxDefaultSize, className: classnames_default()(className, 'block-editor-dimension-control'), label: selectLabel, hideLabelFromVision: false, @@ -61004,7 +57675,7 @@ function DimensionControl(props) { options: formatSizesAsOptions(sizes) }); } -/* harmony default export */ var dimension_control = (DimensionControl); +/* harmony default export */ const dimension_control = (DimensionControl); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/disabled/styles/disabled-styles.js function disabled_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } @@ -61079,9 +57750,9 @@ function Disabled({ ...props }) { const cx = useCx(); - return (0,external_wp_element_namespaceObject.createElement)(disabled_Provider, { + return (0,external_React_.createElement)(disabled_Provider, { value: isDisabled - }, (0,external_wp_element_namespaceObject.createElement)("div", { + }, (0,external_React_.createElement)("div", { // @ts-ignore Reason: inert is a recent HTML attribute inert: isDisabled ? 'true' : undefined, className: isDisabled ? cx(disabled_styles_disabledStyles, className, 'components-disabled') : undefined, @@ -61090,7 +57761,45 @@ function Disabled({ } Disabled.Context = Context; Disabled.Consumer = Consumer; -/* harmony default export */ var disabled = (Disabled); +/* harmony default export */ const disabled = (Disabled); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/disclosure/index.js + +/** + * External dependencies + */ +// eslint-disable-next-line no-restricted-imports + + +/** + * WordPress dependencies + */ + + +/** + * Internal dependencies + */ + +/** + * Accessible Disclosure component that controls visibility of a section of + * content. It follows the WAI-ARIA Disclosure Pattern. + */ +const UnforwardedDisclosureContent = ({ + visible, + children, + ...props +}, ref) => { + const disclosure = useDisclosureStore({ + open: visible + }); + return (0,external_React_.createElement)(DisclosureContent, { + store: disclosure, + ref: ref, + ...props + }, children); +}; +const disclosure_DisclosureContent = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedDisclosureContent); +/* harmony default export */ const disclosure = ((/* unused pure expression or super */ null && (disclosure_DisclosureContent))); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/draggable/index.js @@ -61305,10 +58014,10 @@ function Draggable({ (0,external_wp_element_namespaceObject.useEffect)(() => () => { cleanup.current(); }, []); - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, children({ + return (0,external_React_.createElement)(external_React_.Fragment, null, children({ onDraggableStart: start, onDraggableEnd: end - }), dragComponent && (0,external_wp_element_namespaceObject.createElement)("div", { + }), dragComponent && (0,external_React_.createElement)("div", { className: "components-draggable-drag-component-root", style: { display: 'none' @@ -61316,7 +58025,7 @@ function Draggable({ ref: dragComponentRef }, dragComponent)); } -/* harmony default export */ var draggable = (Draggable); +/* harmony default export */ const draggable = (Draggable); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/upload.js @@ -61324,13 +58033,13 @@ function Draggable({ * WordPress dependencies */ -const upload = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const upload = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z" })); -/* harmony default export */ var library_upload = (upload); +/* harmony default export */ const library_upload = (upload); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/drop-zone/index.js @@ -61473,7 +58182,7 @@ function DropZoneComponent({ } }; if (isDraggingOverElement) { - children = (0,external_wp_element_namespaceObject.createElement)(motion.div, { + children = (0,external_React_.createElement)(motion.div, { variants: backdrop, initial: disableMotion ? 'show' : 'hidden', animate: "show", @@ -61486,12 +58195,12 @@ function DropZoneComponent({ style: { pointerEvents: 'none' } - }, (0,external_wp_element_namespaceObject.createElement)(motion.div, { + }, (0,external_React_.createElement)(motion.div, { variants: foreground - }, (0,external_wp_element_namespaceObject.createElement)(icons_build_module_icon, { + }, (0,external_React_.createElement)(icons_build_module_icon, { icon: library_upload, className: "components-drop-zone__content-icon" - }), (0,external_wp_element_namespaceObject.createElement)("span", { + }), (0,external_React_.createElement)("span", { className: "components-drop-zone__content-text" }, label ? label : (0,external_wp_i18n_namespaceObject.__)('Drop files to upload')))); } @@ -61501,13 +58210,13 @@ function DropZoneComponent({ 'is-dragging-over-element': isDraggingOverElement, [`is-dragging-${type}`]: !!type }); - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { ...restProps, ref: ref, className: classes - }, disableMotion ? children : (0,external_wp_element_namespaceObject.createElement)(AnimatePresence, null, children)); + }, disableMotion ? children : (0,external_React_.createElement)(AnimatePresence, null, children)); } -/* harmony default export */ var drop_zone = (DropZoneComponent); +/* harmony default export */ const drop_zone = (DropZoneComponent); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/drop-zone/provider.js /** @@ -61530,13 +58239,13 @@ function DropZoneProvider({ * WordPress dependencies */ -const swatch = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const swatch = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M5 17.7c.4.5.8.9 1.2 1.2l1.1-1.4c-.4-.3-.7-.6-1-1L5 17.7zM5 6.3l1.4 1.1c.3-.4.6-.7 1-1L6.3 5c-.5.4-.9.8-1.3 1.3zm.1 7.8l-1.7.5c.2.6.4 1.1.7 1.6l1.5-.8c-.2-.4-.4-.8-.5-1.3zM4.8 12v-.7L3 11.1v1.8l1.7-.2c.1-.2.1-.5.1-.7zm3 7.9c.5.3 1.1.5 1.6.7l.5-1.7c-.5-.1-.9-.3-1.3-.5l-.8 1.5zM19 6.3c-.4-.5-.8-.9-1.2-1.2l-1.1 1.4c.4.3.7.6 1 1L19 6.3zm-.1 3.6l1.7-.5c-.2-.6-.4-1.1-.7-1.6l-1.5.8c.2.4.4.8.5 1.3zM5.6 8.6l-1.5-.8c-.3.5-.5 1-.7 1.6l1.7.5c.1-.5.3-.9.5-1.3zm2.2-4.5l.8 1.5c.4-.2.8-.4 1.3-.5l-.5-1.7c-.6.2-1.1.4-1.6.7zm8.8 13.5l1.1 1.4c.5-.4.9-.8 1.2-1.2l-1.4-1.1c-.2.3-.5.6-.9.9zm1.8-2.2l1.5.8c.3-.5.5-1.1.7-1.6l-1.7-.5c-.1.5-.3.9-.5 1.3zm2.6-4.3l-1.7.2v1.4l1.7.2V12v-.9zM11.1 3l.2 1.7h1.4l.2-1.7h-1.8zm3 2.1c.5.1.9.3 1.3.5l.8-1.5c-.5-.3-1.1-.5-1.6-.7l-.5 1.7zM12 19.2h-.7l-.2 1.8h1.8l-.2-1.7c-.2-.1-.5-.1-.7-.1zm2.1-.3l.5 1.7c.6-.2 1.1-.4 1.6-.7l-.8-1.5c-.4.2-.8.4-1.3.5z" })); -/* harmony default export */ var library_swatch = (swatch); +/* harmony default export */ const library_swatch = (swatch); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/duotone-picker/utils.js /** @@ -61645,13 +58354,13 @@ function getColorsFromColorStops(colorStops = []) { function DuotoneSwatch({ values }) { - return values ? (0,external_wp_element_namespaceObject.createElement)(color_indicator, { + return values ? (0,external_React_.createElement)(color_indicator, { colorValue: getGradientFromCSSColors(values, '135deg') - }) : (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { + }) : (0,external_React_.createElement)(build_module_icon, { icon: library_swatch }); } -/* harmony default export */ var duotone_swatch = (DuotoneSwatch); +/* harmony default export */ const duotone_swatch = (DuotoneSwatch); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/duotone-picker/color-list-picker/index.js @@ -61683,27 +58392,27 @@ function ColorOption({ const idRoot = (0,external_wp_compose_namespaceObject.useInstanceId)(ColorOption, 'color-list-picker-option'); const labelId = `${idRoot}__label`; const contentId = `${idRoot}__content`; - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(build_module_button, { className: "components-color-list-picker__swatch-button", onClick: () => setIsOpen(prev => !prev), "aria-expanded": isOpen, "aria-controls": contentId - }, (0,external_wp_element_namespaceObject.createElement)(h_stack_component, { + }, (0,external_React_.createElement)(h_stack_component, { justify: "flex-start", spacing: 2 - }, value ? (0,external_wp_element_namespaceObject.createElement)(color_indicator, { + }, value ? (0,external_React_.createElement)(color_indicator, { colorValue: value, className: "components-color-list-picker__swatch-color" - }) : (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { + }) : (0,external_React_.createElement)(build_module_icon, { icon: library_swatch - }), (0,external_wp_element_namespaceObject.createElement)("span", { + }), (0,external_React_.createElement)("span", { id: labelId - }, label))), (0,external_wp_element_namespaceObject.createElement)("div", { + }, label))), (0,external_React_.createElement)("div", { role: "group", id: contentId, "aria-labelledby": labelId, "aria-hidden": !isOpen - }, isOpen && (0,external_wp_element_namespaceObject.createElement)(color_palette, { + }, isOpen && (0,external_React_.createElement)(color_palette, { "aria-label": (0,external_wp_i18n_namespaceObject.__)('Color options'), className: "components-color-list-picker__color-picker", colors: colors, @@ -61722,9 +58431,9 @@ function ColorListPicker({ enableAlpha, onChange }) { - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { className: "components-color-list-picker" - }, labels.map((label, index) => (0,external_wp_element_namespaceObject.createElement)(ColorOption, { + }, labels.map((label, index) => (0,external_React_.createElement)(ColorOption, { key: index, label: label, value: value[index], @@ -61738,7 +58447,7 @@ function ColorListPicker({ } }))); } -/* harmony default export */ var color_list_picker = (ColorListPicker); +/* harmony default export */ const color_list_picker = (ColorListPicker); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/duotone-picker/custom-duotone-bar.js @@ -61756,7 +58465,7 @@ function CustomDuotoneBar({ const values = hasGradient ? value : PLACEHOLDER_VALUES; const background = getGradientFromCSSColors(values); const controlPoints = getColorStopsFromColors(values); - return (0,external_wp_element_namespaceObject.createElement)(CustomGradientBar, { + return (0,external_React_.createElement)(CustomGradientBar, { disableInserter: true, background: background, hasGradient: hasGradient, @@ -61835,21 +58544,24 @@ function DuotonePicker({ value, onChange, 'aria-label': ariaLabel, - 'aria-labelledby': ariaLabelledby + 'aria-labelledby': ariaLabelledby, + ...otherProps }) { const [defaultDark, defaultLight] = (0,external_wp_element_namespaceObject.useMemo)(() => getDefaultColors(colorPalette), [colorPalette]); const isUnset = value === 'unset'; - const unsetOption = (0,external_wp_element_namespaceObject.createElement)(build_module_circular_option_picker.Option, { + const unsetOptionLabel = (0,external_wp_i18n_namespaceObject.__)('Unset'); + const unsetOption = (0,external_React_.createElement)(build_module_circular_option_picker.Option, { key: "unset", value: "unset", isSelected: isUnset, - tooltipText: (0,external_wp_i18n_namespaceObject.__)('Unset'), + tooltipText: unsetOptionLabel, + "aria-label": unsetOptionLabel, className: "components-duotone-picker__color-indicator", onClick: () => { onChange(isUnset ? undefined : 'unset'); } }); - const options = duotonePalette.map(({ + const duotoneOptions = duotonePalette.map(({ colors, slug, name @@ -61865,7 +58577,7 @@ function DuotonePicker({ // translators: %s: The name of the option e.g: "Dark grayscale". (0,external_wp_i18n_namespaceObject.__)('Duotone: %s'), name) : tooltipText; const isSelected = es6_default()(colors, value); - return (0,external_wp_element_namespaceObject.createElement)(build_module_circular_option_picker.Option, { + return (0,external_React_.createElement)(build_module_circular_option_picker.Option, { key: slug, value: colors, isSelected: isSelected, @@ -61904,20 +58616,22 @@ function DuotonePicker({ }; } } - return (0,external_wp_element_namespaceObject.createElement)(build_module_circular_option_picker, { + const options = unsetable ? [unsetOption, ...duotoneOptions] : duotoneOptions; + return (0,external_React_.createElement)(build_module_circular_option_picker, { + ...otherProps, ...metaProps, - options: unsetable ? [unsetOption, ...options] : options, - actions: !!clearable && (0,external_wp_element_namespaceObject.createElement)(build_module_circular_option_picker.ButtonAction, { + options: options, + actions: !!clearable && (0,external_React_.createElement)(build_module_circular_option_picker.ButtonAction, { onClick: () => onChange(undefined) }, (0,external_wp_i18n_namespaceObject.__)('Clear')) - }, (0,external_wp_element_namespaceObject.createElement)(spacer_component, { - paddingTop: 4 - }, (0,external_wp_element_namespaceObject.createElement)(v_stack_component, { + }, (0,external_React_.createElement)(spacer_component, { + paddingTop: options.length === 0 ? 0 : 4 + }, (0,external_React_.createElement)(v_stack_component, { spacing: 3 - }, !disableCustomColors && !disableCustomDuotone && (0,external_wp_element_namespaceObject.createElement)(CustomDuotoneBar, { + }, !disableCustomColors && !disableCustomDuotone && (0,external_React_.createElement)(CustomDuotoneBar, { value: isUnset ? undefined : value, onChange: onChange - }), !disableCustomDuotone && (0,external_wp_element_namespaceObject.createElement)(color_list_picker, { + }), !disableCustomDuotone && (0,external_React_.createElement)(color_list_picker, { labels: [(0,external_wp_i18n_namespaceObject.__)('Shadows'), (0,external_wp_i18n_namespaceObject.__)('Highlights')], colors: colorPalette, value: isUnset ? undefined : value, @@ -61938,7 +58652,7 @@ function DuotonePicker({ } })))); } -/* harmony default export */ var duotone_picker = (DuotonePicker); +/* harmony default export */ const duotone_picker = (DuotonePicker); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/external.js @@ -61946,13 +58660,13 @@ function DuotonePicker({ * WordPress dependencies */ -const external = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const external = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z" })); -/* harmony default export */ var library_external = (external); +/* harmony default export */ const library_external = (external); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/external-link/styles/external-link-styles.js @@ -62012,8 +58726,8 @@ function UnforwardedExternalLink(props, ref) { props.onClick(event); } }; - return (/* eslint-disable react/jsx-no-target-blank */ - (0,external_wp_element_namespaceObject.createElement)("a", { + return /* eslint-disable react/jsx-no-target-blank */( + (0,external_React_.createElement)("a", { ...additionalProps, className: classes, href: href, @@ -62021,10 +58735,10 @@ function UnforwardedExternalLink(props, ref) { target: "_blank", rel: optimizedRel, ref: ref - }, children, (0,external_wp_element_namespaceObject.createElement)(visually_hidden_component, { + }, children, (0,external_React_.createElement)(visually_hidden_component, { as: "span" }, /* translators: accessibility text */ - (0,external_wp_i18n_namespaceObject.__)('(opens in a new tab)')), (0,external_wp_element_namespaceObject.createElement)(StyledIcon, { + (0,external_wp_i18n_namespaceObject.__)('(opens in a new tab)')), (0,external_React_.createElement)(StyledIcon, { icon: library_external, className: "components-external-link__icon" })) @@ -62044,7 +58758,7 @@ function UnforwardedExternalLink(props, ref) { * ``` */ const ExternalLink = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedExternalLink); -/* harmony default export */ var external_link = (ExternalLink); +/* harmony default export */ const external_link = (ExternalLink); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/focal-point-picker/utils.js const INITIAL_BOUNDS = { @@ -62102,29 +58816,26 @@ function focal_point_picker_style_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You const MediaWrapper = emotion_styled_base_browser_esm("div", true ? { target: "eeew7dm8" } : 0)( true ? { - name: "w0nf6b", - styles: "background-color:transparent;text-align:center;width:100%" + name: "jqnsxy", + styles: "background-color:transparent;display:flex;text-align:center;width:100%" } : 0); const MediaContainer = emotion_styled_base_browser_esm("div", true ? { target: "eeew7dm7" -} : 0)( true ? { - name: "megach", - styles: "align-items:center;box-shadow:0 0 0 1px rgba( 0, 0, 0, 0.2 );cursor:pointer;display:inline-flex;justify-content:center;margin:auto;position:relative;height:100%;img,video{box-sizing:border-box;display:block;height:auto;margin:0;max-height:100%;max-width:100%;pointer-events:none;user-select:none;width:auto;}" -} : 0); +} : 0)("align-items:center;border-radius:", config_values.radiusBlockUi, ";cursor:pointer;display:inline-flex;justify-content:center;margin:auto;position:relative;height:100%;&:after{border-radius:inherit;bottom:0;box-shadow:inset 0 0 0 1px rgba( 0, 0, 0, 0.1 );content:'';left:0;pointer-events:none;position:absolute;right:0;top:0;}img,video{border-radius:inherit;box-sizing:border-box;display:block;height:auto;margin:0;max-height:100%;max-width:100%;pointer-events:none;user-select:none;width:auto;}" + ( true ? "" : 0)); const MediaPlaceholder = emotion_styled_base_browser_esm("div", true ? { target: "eeew7dm6" -} : 0)("background:", COLORS.gray[100], ";box-sizing:border-box;height:", INITIAL_BOUNDS.height, "px;max-width:280px;min-width:", INITIAL_BOUNDS.width, "px;width:100%;" + ( true ? "" : 0)); -const StyledUnitControl = /*#__PURE__*/emotion_styled_base_browser_esm(unit_control, true ? { +} : 0)("background:", COLORS.gray[100], ";border-radius:inherit;box-sizing:border-box;height:", INITIAL_BOUNDS.height, "px;max-width:280px;min-width:", INITIAL_BOUNDS.width, "px;width:100%;" + ( true ? "" : 0)); +const focal_point_picker_style_StyledUnitControl = /*#__PURE__*/emotion_styled_base_browser_esm(unit_control, true ? { target: "eeew7dm5" } : 0)( true ? { - name: "1pzk433", - styles: "width:100px" + name: "1d3w5wq", + styles: "width:100%" } : 0); var focal_point_picker_style_ref2 = true ? { name: "1mn7kwb", styles: "padding-bottom:1em" } : 0; -const focal_point_picker_style_deprecatedBottomMargin = ({ +const deprecatedBottomMargin = ({ __nextHasNoMarginBottom }) => { return !__nextHasNoMarginBottom ? focal_point_picker_style_ref2 : undefined; @@ -62140,29 +58851,29 @@ const extraHelpTextMargin = ({ }; const ControlWrapper = /*#__PURE__*/emotion_styled_base_browser_esm(flex_component, true ? { target: "eeew7dm4" -} : 0)("max-width:320px;padding-top:1em;", extraHelpTextMargin, " ", focal_point_picker_style_deprecatedBottomMargin, ";" + ( true ? "" : 0)); +} : 0)("max-width:320px;padding-top:1em;", extraHelpTextMargin, " ", deprecatedBottomMargin, ";" + ( true ? "" : 0)); const GridView = emotion_styled_base_browser_esm("div", true ? { target: "eeew7dm3" -} : 0)("left:50%;overflow:hidden;pointer-events:none;position:absolute;top:50%;transform:translate3d( -50%, -50%, 0 );transition:opacity 120ms linear;z-index:1;opacity:", ({ +} : 0)("left:50%;overflow:hidden;pointer-events:none;position:absolute;top:50%;transform:translate3d( -50%, -50%, 0 );transition:opacity 100ms linear;z-index:1;", reduceMotion('transition'), " opacity:", ({ showOverlay }) => showOverlay ? 1 : 0, ";" + ( true ? "" : 0)); const GridLine = emotion_styled_base_browser_esm("div", true ? { target: "eeew7dm2" } : 0)( true ? { - name: "1d42i6k", - styles: "background:white;box-shadow:0 0 2px rgba( 0, 0, 0, 0.6 );position:absolute;opacity:0.4;transform:translateZ( 0 )" + name: "1yzbo24", + styles: "background:rgba( 255, 255, 255, 0.4 );backdrop-filter:blur( 16px ) saturate( 180% );position:absolute;transform:translateZ( 0 )" } : 0); const GridLineX = /*#__PURE__*/emotion_styled_base_browser_esm(GridLine, true ? { target: "eeew7dm1" } : 0)( true ? { - name: "1qp910y", - styles: "height:1px;left:0;right:0" + name: "1sw8ur", + styles: "height:1px;left:1px;right:1px" } : 0); const GridLineY = /*#__PURE__*/emotion_styled_base_browser_esm(GridLine, true ? { target: "eeew7dm0" } : 0)( true ? { - name: "1oz3zka", - styles: "width:1px;top:0;bottom:0" + name: "188vg4t", + styles: "width:1px;top:1px;bottom:1px" } : 0); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/focal-point-picker/controls.js @@ -62182,6 +58893,7 @@ const TEXTCONTROL_MAX = 100; const controls_noop = () => {}; function FocalPointPickerControls({ __nextHasNoMarginBottom, + __next40pxDefaultSize, hasHelpText, onChange = controls_noop, point = { @@ -62201,17 +58913,20 @@ function FocalPointPickerControls({ }); } }; - return (0,external_wp_element_namespaceObject.createElement)(ControlWrapper, { + return (0,external_React_.createElement)(ControlWrapper, { className: "focal-point-picker__controls", __nextHasNoMarginBottom: __nextHasNoMarginBottom, - hasHelpText: hasHelpText - }, (0,external_wp_element_namespaceObject.createElement)(FocalPointUnitControl, { + hasHelpText: hasHelpText, + gap: 4 + }, (0,external_React_.createElement)(FocalPointUnitControl, { + __next40pxDefaultSize: __next40pxDefaultSize, label: (0,external_wp_i18n_namespaceObject.__)('Left'), "aria-label": (0,external_wp_i18n_namespaceObject.__)('Focal point left position'), value: [valueX, '%'].join(''), onChange: next => handleChange(next, 'x'), dragDirection: "e" - }), (0,external_wp_element_namespaceObject.createElement)(FocalPointUnitControl, { + }), (0,external_React_.createElement)(FocalPointUnitControl, { + __next40pxDefaultSize: __next40pxDefaultSize, label: (0,external_wp_i18n_namespaceObject.__)('Top'), "aria-label": (0,external_wp_i18n_namespaceObject.__)('Focal point top position'), value: [valueY, '%'].join(''), @@ -62220,7 +58935,7 @@ function FocalPointPickerControls({ })); } function FocalPointUnitControl(props) { - return (0,external_wp_element_namespaceObject.createElement)(StyledUnitControl, { + return (0,external_React_.createElement)(focal_point_picker_style_StyledUnitControl, { className: "focal-point-picker__controls-position-unit-control", labelPosition: "top", max: TEXTCONTROL_MAX, @@ -62239,11 +58954,19 @@ function FocalPointUnitControl(props) { * External dependencies */ +/** + * Internal dependencies + */ + const PointerCircle = emotion_styled_base_browser_esm("div", true ? { target: "e19snlhg0" -} : 0)("background-color:transparent;cursor:grab;height:48px;margin:-24px 0 0 -24px;position:absolute;user-select:none;width:48px;will-change:transform;z-index:10000;background:rgba( 255, 255, 255, 0.6 );border-radius:50%;backdrop-filter:blur( 4px );box-shadow:rgb( 0 0 0 / 20% ) 0px 0px 10px;", ({ +} : 0)("background-color:transparent;cursor:grab;height:40px;margin:-20px 0 0 -20px;position:absolute;user-select:none;width:40px;will-change:transform;z-index:10000;background:rgba( 255, 255, 255, 0.4 );border:1px solid rgba( 255, 255, 255, 0.4 );border-radius:50%;backdrop-filter:blur( 16px ) saturate( 180% );box-shadow:rgb( 0 0 0 / 10% ) 0px 0px 8px;transition:transform 100ms linear;", reduceMotion('transition'), " ", ({ isDragging -}) => isDragging && 'cursor: grabbing;', ";" + ( true ? "" : 0)); +}) => isDragging && ` + box-shadow: rgb( 0 0 0 / 12% ) 0px 0px 10px; + transform: scale( 1.1 ); + cursor: grabbing; + `, ";" + ( true ? "" : 0)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/focal-point-picker/focal-point.js @@ -62266,7 +58989,7 @@ function FocalPoint({ left, top }; - return (0,external_wp_element_namespaceObject.createElement)(PointerCircle, { + return (0,external_React_.createElement)(PointerCircle, { ...props, className: classes, style: style @@ -62283,26 +59006,26 @@ function FocalPointPickerGrid({ bounds, ...props }) { - return (0,external_wp_element_namespaceObject.createElement)(GridView, { + return (0,external_React_.createElement)(GridView, { ...props, className: "components-focal-point-picker__grid", style: { width: bounds.width, height: bounds.height } - }, (0,external_wp_element_namespaceObject.createElement)(GridLineX, { + }, (0,external_React_.createElement)(GridLineX, { style: { top: '33%' } - }), (0,external_wp_element_namespaceObject.createElement)(GridLineX, { + }), (0,external_React_.createElement)(GridLineX, { style: { top: '66%' } - }), (0,external_wp_element_namespaceObject.createElement)(GridLineY, { + }), (0,external_React_.createElement)(GridLineY, { style: { left: '33%' } - }), (0,external_wp_element_namespaceObject.createElement)(GridLineY, { + }), (0,external_React_.createElement)(GridLineY, { style: { left: '66%' } @@ -62332,14 +59055,14 @@ function media_Media({ ...props }) { if (!src) { - return (0,external_wp_element_namespaceObject.createElement)(MediaPlaceholder, { + return (0,external_React_.createElement)(MediaPlaceholder, { className: "components-focal-point-picker__media components-focal-point-picker__media--placeholder", ref: mediaRef, ...props }); } const isVideo = isVideoType(src); - return isVideo ? (0,external_wp_element_namespaceObject.createElement)("video", { + return isVideo ? (0,external_React_.createElement)("video", { ...props, autoPlay: autoPlay, className: "components-focal-point-picker__media components-focal-point-picker__media--video", @@ -62348,7 +59071,7 @@ function media_Media({ onLoadedData: onLoad, ref: mediaRef, src: src - }) : (0,external_wp_element_namespaceObject.createElement)("img", { + }) : (0,external_React_.createElement)("img", { ...props, alt: alt, className: "components-focal-point-picker__media components-focal-point-picker__media--image", @@ -62432,6 +59155,7 @@ const GRID_OVERLAY_TIMEOUT = 600; */ function FocalPointPicker({ __nextHasNoMarginBottom, + __next40pxDefaultSize = false, autoPlay = true, className, help, @@ -62568,8 +59292,8 @@ function FocalPointPicker({ onChange?.(getFinalValue(value)); }; const focalPointPosition = { - left: x * bounds.width, - top: y * bounds.height + left: x !== undefined ? x * bounds.width : 0.5 * bounds.width, + top: y !== undefined ? y * bounds.height : 0.5 * bounds.height }; const classes = classnames_default()('components-focal-point-picker-control', className); const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(FocalPointPicker); @@ -62581,16 +59305,16 @@ function FocalPointPicker({ }, GRID_OVERLAY_TIMEOUT); return () => window.clearTimeout(timeout); }, [x, y]); - return (0,external_wp_element_namespaceObject.createElement)(base_control, { + return (0,external_React_.createElement)(base_control, { ...restProps, __nextHasNoMarginBottom: __nextHasNoMarginBottom, label: label, id: id, help: help, className: classes - }, (0,external_wp_element_namespaceObject.createElement)(MediaWrapper, { + }, (0,external_React_.createElement)(MediaWrapper, { className: "components-focal-point-picker-wrapper" - }, (0,external_wp_element_namespaceObject.createElement)(MediaContainer, { + }, (0,external_React_.createElement)(MediaContainer, { className: "components-focal-point-picker", onKeyDown: arrowKeyStep, onMouseDown: startDrag, @@ -62600,19 +59324,20 @@ function FocalPointPicker({ ref: dragAreaRef, role: "button", tabIndex: -1 - }, (0,external_wp_element_namespaceObject.createElement)(FocalPointPickerGrid, { + }, (0,external_React_.createElement)(FocalPointPickerGrid, { bounds: bounds, showOverlay: showGridOverlay - }), (0,external_wp_element_namespaceObject.createElement)(media_Media, { + }), (0,external_React_.createElement)(media_Media, { alt: (0,external_wp_i18n_namespaceObject.__)('Media preview'), autoPlay: autoPlay, onLoad: refUpdateBounds.current, src: url - }), (0,external_wp_element_namespaceObject.createElement)(FocalPoint, { + }), (0,external_React_.createElement)(FocalPoint, { ...focalPointPosition, isDragging: isDragging - }))), (0,external_wp_element_namespaceObject.createElement)(FocalPointPickerControls, { + }))), (0,external_React_.createElement)(FocalPointPickerControls, { __nextHasNoMarginBottom: __nextHasNoMarginBottom, + __next40pxDefaultSize: __next40pxDefaultSize, hasHelpText: !!help, point: { x, @@ -62623,7 +59348,7 @@ function FocalPointPicker({ } })); } -/* harmony default export */ var focal_point_picker = (FocalPointPicker); +/* harmony default export */ const focal_point_picker = (FocalPointPicker); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/focusable-iframe/index.js @@ -62649,7 +59374,7 @@ function FocusableIframe({ // assigning props inherited from the rendering parent. It's the // responsibility of the parent to assign a title. // eslint-disable-next-line jsx-a11y/iframe-has-title - return (0,external_wp_element_namespaceObject.createElement)("iframe", { + return (0,external_React_.createElement)("iframe", { ref: ref, ...props }); @@ -62661,15 +59386,15 @@ function FocusableIframe({ * WordPress dependencies */ -const settings = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const settings = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z" -}), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}), (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z" })); -/* harmony default export */ var library_settings = (settings); +/* harmony default export */ const library_settings = (settings); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/font-size-picker/utils.js /** @@ -62690,7 +59415,7 @@ const settings = (0,external_wp_element_namespaceObject.createElement)(external_ * @return Whether the value is a simple css value. */ function isSimpleCssValue(value) { - const sizeRegex = /^[\d\.]+(px|em|rem|vw|vh|%)?$/i; + const sizeRegex = /^[\d\.]+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i; return sizeRegex.test(String(value)); } @@ -62730,26 +59455,23 @@ function font_size_picker_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You const styles_Container = emotion_styled_base_browser_esm("fieldset", true ? { - target: "e8tqeku5" + target: "e8tqeku4" } : 0)( true ? { name: "1t1ytme", styles: "border:0;margin:0;padding:0" } : 0); -const font_size_picker_styles_Header = /*#__PURE__*/emotion_styled_base_browser_esm(h_stack_component, true ? { - target: "e8tqeku4" +const styles_Header = /*#__PURE__*/emotion_styled_base_browser_esm(h_stack_component, true ? { + target: "e8tqeku3" } : 0)("height:", space(4), ";" + ( true ? "" : 0)); const HeaderToggle = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_button, true ? { - target: "e8tqeku3" + target: "e8tqeku2" } : 0)("margin-top:", space(-1), ";" + ( true ? "" : 0)); const HeaderLabel = /*#__PURE__*/emotion_styled_base_browser_esm(base_control.VisualLabel, true ? { - target: "e8tqeku2" + target: "e8tqeku1" } : 0)("display:flex;gap:", space(1), ";justify-content:flex-start;margin-bottom:0;" + ( true ? "" : 0)); const HeaderHint = emotion_styled_base_browser_esm("span", true ? { - target: "e8tqeku1" -} : 0)("color:", COLORS.gray[700], ";" + ( true ? "" : 0)); -const Controls = emotion_styled_base_browser_esm("div", true ? { target: "e8tqeku0" -} : 0)(props => !props.__nextHasNoMarginBottom && `margin-bottom: ${space(6)};`, ";" + ( true ? "" : 0)); +} : 0)("color:", COLORS.gray[700], ";" + ( true ? "" : 0)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/font-size-picker/font-size-picker-select.js @@ -62776,6 +59498,7 @@ const CUSTOM_OPTION = { const FontSizePickerSelect = props => { var _options$find; const { + __next40pxDefaultSize, fontSizes, value, disableCustomFontSizes, @@ -62802,7 +59525,8 @@ const FontSizePickerSelect = props => { }; }), ...(disableCustomFontSizes ? [] : [CUSTOM_OPTION])]; const selectedOption = value ? (_options$find = options.find(option => option.value === value)) !== null && _options$find !== void 0 ? _options$find : CUSTOM_OPTION : DEFAULT_OPTION; - return (0,external_wp_element_namespaceObject.createElement)(CustomSelectControl, { + return (0,external_React_.createElement)(CustomSelectControl, { + __next40pxDefaultSize: __next40pxDefaultSize, __nextUnconstrainedWidth: true, className: "components-font-size-picker__select", label: (0,external_wp_i18n_namespaceObject.__)('Font size'), @@ -62825,2286 +59549,7 @@ const FontSizePickerSelect = props => { size: size }); }; -/* harmony default export */ var font_size_picker_select = (FontSizePickerSelect); - -;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs - - -/** - * Note: Still used by components generated by old versions of Framer - * - * @deprecated - */ -const DeprecatedLayoutGroupContext = (0,external_React_.createContext)(null); - - - -;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/node/group.mjs -const notify = (node) => !node.isLayoutDirty && node.willUpdate(false); -function nodeGroup() { - const nodes = new Set(); - const subscriptions = new WeakMap(); - const dirtyAll = () => nodes.forEach(notify); - return { - add: (node) => { - nodes.add(node); - subscriptions.set(node, node.addEventListener("willUpdate", dirtyAll)); - }, - remove: (node) => { - nodes.delete(node); - const unsubscribe = subscriptions.get(node); - if (unsubscribe) { - unsubscribe(); - subscriptions.delete(node); - } - dirtyAll(); - }, - dirty: dirtyAll, - }; -} - - - -;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs - - - - - - - -const shouldInheritGroup = (inherit) => inherit === true; -const shouldInheritId = (inherit) => shouldInheritGroup(inherit === true) || inherit === "id"; -const LayoutGroup = ({ children, id, inherit = true }) => { - const layoutGroupContext = (0,external_React_.useContext)(LayoutGroupContext); - const deprecatedLayoutGroupContext = (0,external_React_.useContext)(DeprecatedLayoutGroupContext); - const [forceRender, key] = use_force_update_useForceUpdate(); - const context = (0,external_React_.useRef)(null); - const upstreamId = layoutGroupContext.id || deprecatedLayoutGroupContext; - if (context.current === null) { - if (shouldInheritId(inherit) && upstreamId) { - id = id ? upstreamId + "-" + id : upstreamId; - } - context.current = { - id, - group: shouldInheritGroup(inherit) - ? layoutGroupContext.group || nodeGroup() - : nodeGroup(), - }; - } - const memoizedContext = (0,external_React_.useMemo)(() => ({ ...context.current, forceRender }), [key]); - return (external_React_.createElement(LayoutGroupContext.Provider, { value: memoizedContext }, children)); -}; - - - -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/styles.js - -function toggle_group_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } -/** - * External dependencies - */ - -/** - * Internal dependencies - */ - -const toggleGroupControl = ({ - isBlock, - isDeselectable, - size -}) => /*#__PURE__*/emotion_react_browser_esm_css("background:", COLORS.ui.background, ";border:1px solid transparent;border-radius:", config_values.controlBorderRadius, ";display:inline-flex;min-width:0;padding:2px;position:relative;", toggleGroupControlSize(size), " ", !isDeselectable && enclosingBorders(isBlock), ";" + ( true ? "" : 0), true ? "" : 0); -const enclosingBorders = isBlock => { - const enclosingBorder = /*#__PURE__*/emotion_react_browser_esm_css("border-color:", COLORS.ui.border, ";" + ( true ? "" : 0), true ? "" : 0); - return /*#__PURE__*/emotion_react_browser_esm_css(isBlock && enclosingBorder, " &:hover{border-color:", COLORS.ui.borderHover, ";}&:focus-within{border-color:", COLORS.ui.borderFocus, ";box-shadow:", config_values.controlBoxShadowFocus, ";z-index:1;outline:2px solid transparent;outline-offset:-2px;}" + ( true ? "" : 0), true ? "" : 0); -}; -const toggleGroupControlSize = size => { - const heights = { - default: '36px', - '__unstable-large': '40px' - }; - return /*#__PURE__*/emotion_react_browser_esm_css("min-height:", heights[size], ";" + ( true ? "" : 0), true ? "" : 0); -}; -const toggle_group_control_styles_block = true ? { - name: "7whenc", - styles: "display:flex;width:100%" -} : 0; -const VisualLabelWrapper = emotion_styled_base_browser_esm("div", true ? { - target: "eakva830" -} : 0)( true ? { - name: "zjik7", - styles: "display:flex" -} : 0); - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/6DS7ZDWX.js - - - -// src/collection/collection-store.ts - -function useCollectionStoreOptions(_props) { - return {}; -} -function useCollectionStoreProps(store, props) { - useStoreProps(store, props, "items", "setItems"); - return store; -} -function useCollectionStore(props = {}) { - const options = useCollectionStoreOptions(props); - const store = useStore( - () => Core.createCollectionStore(__spreadValues(__spreadValues({}, props), options)) - ); - return useCollectionStoreProps(store, props); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/OK4RCQBZ.js - - - - -// src/composite/composite-store.ts - -function useCompositeStoreOptions(props) { - return useCollectionStoreOptions(props); -} -function useCompositeStoreProps(store, props) { - store = useCollectionStoreProps(store, props); - useStoreProps(store, props, "activeId", "setActiveId"); - useStoreProps(store, props, "includesBaseElement"); - useStoreProps(store, props, "virtualFocus"); - useStoreProps(store, props, "orientation"); - useStoreProps(store, props, "rtl"); - useStoreProps(store, props, "focusLoop"); - useStoreProps(store, props, "focusWrap"); - useStoreProps(store, props, "focusShift"); - return store; -} -function useCompositeStore(props = {}) { - const options = useCompositeStoreOptions(props); - const store = useStore( - () => Core.createCompositeStore(__spreadValues(__spreadValues({}, props), options)) - ); - return useCompositeStoreProps(store, props); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/SHUO6V52.js - - - - - -// src/collection/collection-store.ts -function SHUO6V52_isElementPreceding(a, b) { - return Boolean( - b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING - ); -} -function SHUO6V52_sortBasedOnDOMPosition(items) { - const pairs = items.map((item, index) => [index, item]); - let isOrderDifferent = false; - pairs.sort(([indexA, a], [indexB, b]) => { - const elementA = a.element; - const elementB = b.element; - if (elementA === elementB) - return 0; - if (!elementA || !elementB) - return 0; - if (SHUO6V52_isElementPreceding(elementA, elementB)) { - if (indexA > indexB) { - isOrderDifferent = true; - } - return -1; - } - if (indexA < indexB) { - isOrderDifferent = true; - } - return 1; - }); - if (isOrderDifferent) { - return pairs.map(([_, item]) => item); - } - return items; -} -function SHUO6V52_getCommonParent(items) { - var _a; - const firstItem = items.find((item) => !!item.element); - const lastItem = [...items].reverse().find((item) => !!item.element); - let parentElement = (_a = firstItem == null ? void 0 : firstItem.element) == null ? void 0 : _a.parentElement; - while (parentElement && (lastItem == null ? void 0 : lastItem.element)) { - const parent = parentElement; - if (lastItem && parent.contains(lastItem.element)) { - return parentElement; - } - parentElement = parentElement.parentElement; - } - return O35LWD4W_getDocument(parentElement).body; -} -function createCollectionStore(props = {}) { - var _a; - const syncState = (_a = props.store) == null ? void 0 : _a.getState(); - const items = defaultValue( - props.items, - syncState == null ? void 0 : syncState.items, - props.defaultItems, - [] - ); - const itemsMap = new Map(items.map((item) => [item.id, item])); - const initialState = { - items, - renderedItems: defaultValue(syncState == null ? void 0 : syncState.renderedItems, []) - }; - const privateStore = createStore({ - renderedItems: initialState.renderedItems - }); - const collection = createStore(initialState, props.store); - const sortItems = () => { - const state = privateStore.getState(); - const renderedItems = SHUO6V52_sortBasedOnDOMPosition(state.renderedItems); - privateStore.setState("renderedItems", renderedItems); - collection.setState("renderedItems", renderedItems); - }; - collection.setup(() => { - return privateStore.syncBatch( - (state) => { - let firstRun = true; - let raf = requestAnimationFrame(sortItems); - if (typeof IntersectionObserver !== "function") - return; - const callback = () => { - if (firstRun) { - firstRun = false; - return; - } - cancelAnimationFrame(raf); - raf = requestAnimationFrame(sortItems); - }; - const root = SHUO6V52_getCommonParent(state.renderedItems); - const observer = new IntersectionObserver(callback, { root }); - state.renderedItems.forEach((item) => { - if (!item.element) - return; - observer.observe(item.element); - }); - return () => { - cancelAnimationFrame(raf); - observer.disconnect(); - }; - }, - ["renderedItems"] - ); - }); - const mergeItem = (item, setItems, canDeleteFromMap = false) => { - let prevItem; - setItems((items2) => { - const index = items2.findIndex(({ id }) => id === item.id); - const nextItems = items2.slice(); - if (index !== -1) { - prevItem = items2[index]; - const nextItem = _chunks_PNRLI7OV_spreadValues(_chunks_PNRLI7OV_spreadValues({}, prevItem), item); - nextItems[index] = nextItem; - itemsMap.set(item.id, nextItem); - } else { - nextItems.push(item); - itemsMap.set(item.id, item); - } - return nextItems; - }); - const unmergeItem = () => { - setItems((items2) => { - if (!prevItem) { - if (canDeleteFromMap) { - itemsMap.delete(item.id); - } - return items2.filter(({ id }) => id !== item.id); - } - const index = items2.findIndex(({ id }) => id === item.id); - if (index === -1) - return items2; - const nextItems = items2.slice(); - nextItems[index] = prevItem; - itemsMap.set(item.id, prevItem); - return nextItems; - }); - }; - return unmergeItem; - }; - const registerItem = (item) => mergeItem(item, (getItems) => collection.setState("items", getItems), true); - return _chunks_PNRLI7OV_spreadProps(_chunks_PNRLI7OV_spreadValues({}, collection), { - registerItem, - renderItem: (item) => chain( - registerItem(item), - mergeItem( - item, - (getItems) => privateStore.setState("renderedItems", getItems) - ) - ), - item: (id) => { - if (!id) - return null; - let item = itemsMap.get(id); - if (!item) { - const { items: items2 } = collection.getState(); - item = items2.find((item2) => item2.id === id); - if (item) { - itemsMap.set(id, item); - } - } - return item || null; - } - }); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/5XEKIOCW.js -// src/utils/array.ts -function _5XEKIOCW_toArray(arg) { - if (Array.isArray(arg)) { - return arg; - } - return typeof arg !== "undefined" ? [arg] : []; -} -function addItemToArray(array, item, index = -1) { - if (!(index in array)) { - return [...array, item]; - } - return [...array.slice(0, index), item, ...array.slice(index)]; -} -function flatten2DArray(array) { - const flattened = []; - for (const row of array) { - flattened.push(...row); - } - return flattened; -} -function reverseArray(array) { - return array.slice().reverse(); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/NRXA5QTV.js - - - - - - -// src/composite/composite-store.ts -var NULL_ITEM = { id: null }; -function NRXA5QTV_findFirstEnabledItem(items, excludeId) { - return items.find((item) => { - if (excludeId) { - return !item.disabled && item.id !== excludeId; - } - return !item.disabled; - }); -} -function getEnabledItems(items, excludeId) { - return items.filter((item) => { - if (excludeId) { - return !item.disabled && item.id !== excludeId; - } - return !item.disabled; - }); -} -function NRXA5QTV_getOppositeOrientation(orientation) { - if (orientation === "vertical") - return "horizontal"; - if (orientation === "horizontal") - return "vertical"; - return; -} -function getItemsInRow(items, rowId) { - return items.filter((item) => item.rowId === rowId); -} -function flipItems(items, activeId, shouldInsertNullItem = false) { - const index = items.findIndex((item) => item.id === activeId); - return [ - ...items.slice(index + 1), - ...shouldInsertNullItem ? [NULL_ITEM] : [], - ...items.slice(0, index) - ]; -} -function groupItemsByRows(items) { - const rows = []; - for (const item of items) { - const row = rows.find((currentRow) => { - var _a; - return ((_a = currentRow[0]) == null ? void 0 : _a.rowId) === item.rowId; - }); - if (row) { - row.push(item); - } else { - rows.push([item]); - } - } - return rows; -} -function getMaxRowLength(array) { - let maxLength = 0; - for (const { length } of array) { - if (length > maxLength) { - maxLength = length; - } - } - return maxLength; -} -function NRXA5QTV_createEmptyItem(rowId) { - return { - id: "__EMPTY_ITEM__", - disabled: true, - rowId - }; -} -function normalizeRows(rows, activeId, focusShift) { - const maxLength = getMaxRowLength(rows); - for (const row of rows) { - for (let i = 0; i < maxLength; i += 1) { - const item = row[i]; - if (!item || focusShift && item.disabled) { - const isFirst = i === 0; - const previousItem = isFirst && focusShift ? NRXA5QTV_findFirstEnabledItem(row) : row[i - 1]; - row[i] = previousItem && activeId !== previousItem.id && focusShift ? previousItem : NRXA5QTV_createEmptyItem(previousItem == null ? void 0 : previousItem.rowId); - } - } - } - return rows; -} -function NRXA5QTV_verticalizeItems(items) { - const rows = groupItemsByRows(items); - const maxLength = getMaxRowLength(rows); - const verticalized = []; - for (let i = 0; i < maxLength; i += 1) { - for (const row of rows) { - const item = row[i]; - if (item) { - verticalized.push(_chunks_PNRLI7OV_spreadProps(_chunks_PNRLI7OV_spreadValues({}, item), { - // If there's no rowId, it means that it's not a grid composite, but - // a single row instead. So, instead of verticalizing it, that is, - // assigning a different rowId based on the column index, we keep it - // undefined so they will be part of the same row. This is useful - // when using up/down on one-dimensional composites. - rowId: item.rowId ? `${i}` : void 0 - })); - } - } - } - return verticalized; -} -function createCompositeStore(props = {}) { - var _a; - const syncState = (_a = props.store) == null ? void 0 : _a.getState(); - const collection = createCollectionStore(props); - const activeId = defaultValue( - props.activeId, - syncState == null ? void 0 : syncState.activeId, - props.defaultActiveId - ); - const initialState = _chunks_PNRLI7OV_spreadProps(_chunks_PNRLI7OV_spreadValues({}, collection.getState()), { - activeId, - baseElement: defaultValue(syncState == null ? void 0 : syncState.baseElement, null), - includesBaseElement: defaultValue( - props.includesBaseElement, - syncState == null ? void 0 : syncState.includesBaseElement, - activeId === null - ), - moves: defaultValue(syncState == null ? void 0 : syncState.moves, 0), - orientation: defaultValue( - props.orientation, - syncState == null ? void 0 : syncState.orientation, - "both" - ), - rtl: defaultValue(props.rtl, syncState == null ? void 0 : syncState.rtl, false), - virtualFocus: defaultValue( - props.virtualFocus, - syncState == null ? void 0 : syncState.virtualFocus, - false - ), - focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, false), - focusWrap: defaultValue(props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false), - focusShift: defaultValue(props.focusShift, syncState == null ? void 0 : syncState.focusShift, false) - }); - const composite = createStore(initialState, collection, props.store); - composite.setup( - () => composite.sync( - (state) => { - composite.setState("activeId", (activeId2) => { - var _a2; - if (activeId2 !== void 0) - return activeId2; - return (_a2 = NRXA5QTV_findFirstEnabledItem(state.renderedItems)) == null ? void 0 : _a2.id; - }); - }, - ["renderedItems", "activeId"] - ) - ); - const getNextId = (items, orientation, hasNullItem, skip) => { - var _a2, _b; - const { activeId: activeId2, rtl, focusLoop, focusWrap, includesBaseElement } = composite.getState(); - const isHorizontal = orientation !== "vertical"; - const isRTL = rtl && isHorizontal; - const allItems = isRTL ? reverseArray(items) : items; - if (activeId2 == null) { - return (_a2 = NRXA5QTV_findFirstEnabledItem(allItems)) == null ? void 0 : _a2.id; - } - const activeItem = allItems.find((item) => item.id === activeId2); - if (!activeItem) { - return (_b = NRXA5QTV_findFirstEnabledItem(allItems)) == null ? void 0 : _b.id; - } - const isGrid = !!activeItem.rowId; - const activeIndex = allItems.indexOf(activeItem); - const nextItems = allItems.slice(activeIndex + 1); - const nextItemsInRow = getItemsInRow(nextItems, activeItem.rowId); - if (skip !== void 0) { - const nextEnabledItemsInRow = getEnabledItems(nextItemsInRow, activeId2); - const nextItem2 = nextEnabledItemsInRow.slice(skip)[0] || // If we can't find an item, just return the last one. - nextEnabledItemsInRow[nextEnabledItemsInRow.length - 1]; - return nextItem2 == null ? void 0 : nextItem2.id; - } - const oppositeOrientation = NRXA5QTV_getOppositeOrientation( - // If it's a grid and orientation is not set, it's a next/previous call, - // which is inherently horizontal. up/down will call next with orientation - // set to vertical by default (see below on up/down methods). - isGrid ? orientation || "horizontal" : orientation - ); - const canLoop = focusLoop && focusLoop !== oppositeOrientation; - const canWrap = isGrid && focusWrap && focusWrap !== oppositeOrientation; - hasNullItem = hasNullItem || !isGrid && canLoop && includesBaseElement; - if (canLoop) { - const loopItems = canWrap && !hasNullItem ? allItems : getItemsInRow(allItems, activeItem.rowId); - const sortedItems = flipItems(loopItems, activeId2, hasNullItem); - const nextItem2 = NRXA5QTV_findFirstEnabledItem(sortedItems, activeId2); - return nextItem2 == null ? void 0 : nextItem2.id; - } - if (canWrap) { - const nextItem2 = NRXA5QTV_findFirstEnabledItem( - // We can use nextItems, which contains all the next items, including - // items from other rows, to wrap between rows. However, if there is a - // null item (the composite container), we'll only use the next items in - // the row. So moving next from the last item will focus on the - // composite container. On grid composites, horizontal navigation never - // focuses on the composite container, only vertical. - hasNullItem ? nextItemsInRow : nextItems, - activeId2 - ); - const nextId = hasNullItem ? (nextItem2 == null ? void 0 : nextItem2.id) || null : nextItem2 == null ? void 0 : nextItem2.id; - return nextId; - } - const nextItem = NRXA5QTV_findFirstEnabledItem(nextItemsInRow, activeId2); - if (!nextItem && hasNullItem) { - return null; - } - return nextItem == null ? void 0 : nextItem.id; - }; - return _chunks_PNRLI7OV_spreadProps(_chunks_PNRLI7OV_spreadValues(_chunks_PNRLI7OV_spreadValues({}, collection), composite), { - setBaseElement: (element) => composite.setState("baseElement", element), - setActiveId: (id) => composite.setState("activeId", id), - move: (id) => { - if (id === void 0) - return; - composite.setState("activeId", id); - composite.setState("moves", (moves) => moves + 1); - }, - first: () => { - var _a2; - return (_a2 = NRXA5QTV_findFirstEnabledItem(composite.getState().renderedItems)) == null ? void 0 : _a2.id; - }, - last: () => { - var _a2; - return (_a2 = NRXA5QTV_findFirstEnabledItem(reverseArray(composite.getState().renderedItems))) == null ? void 0 : _a2.id; - }, - next: (skip) => { - const { renderedItems, orientation } = composite.getState(); - return getNextId(renderedItems, orientation, false, skip); - }, - previous: (skip) => { - var _a2; - const { renderedItems, orientation, includesBaseElement } = composite.getState(); - const isGrid = !!((_a2 = NRXA5QTV_findFirstEnabledItem(renderedItems)) == null ? void 0 : _a2.rowId); - const hasNullItem = !isGrid && includesBaseElement; - return getNextId( - reverseArray(renderedItems), - orientation, - hasNullItem, - skip - ); - }, - down: (skip) => { - const { - activeId: activeId2, - renderedItems, - focusShift, - focusLoop, - includesBaseElement - } = composite.getState(); - const shouldShift = focusShift && !skip; - const verticalItems = NRXA5QTV_verticalizeItems( - flatten2DArray( - normalizeRows(groupItemsByRows(renderedItems), activeId2, shouldShift) - ) - ); - const canLoop = focusLoop && focusLoop !== "horizontal"; - const hasNullItem = canLoop && includesBaseElement; - return getNextId(verticalItems, "vertical", hasNullItem, skip); - }, - up: (skip) => { - const { activeId: activeId2, renderedItems, focusShift, includesBaseElement } = composite.getState(); - const shouldShift = focusShift && !skip; - const verticalItems = NRXA5QTV_verticalizeItems( - reverseArray( - flatten2DArray( - normalizeRows( - groupItemsByRows(renderedItems), - activeId2, - shouldShift - ) - ) - ) - ); - const hasNullItem = includesBaseElement; - return getNextId(verticalItems, "vertical", hasNullItem, skip); - } - }); -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/radio/radio-store.js - - - - - - - - -// src/radio/radio-store.ts -function createRadioStore(_a = {}) { - var props = PNRLI7OV_objRest(_a, []); - var _a2; - const syncState = (_a2 = props.store) == null ? void 0 : _a2.getState(); - const composite = createCompositeStore(_chunks_PNRLI7OV_spreadProps(_chunks_PNRLI7OV_spreadValues({}, props), { - focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true) - })); - const initialState = _chunks_PNRLI7OV_spreadProps(_chunks_PNRLI7OV_spreadValues({}, composite.getState()), { - value: defaultValue( - props.value, - syncState == null ? void 0 : syncState.value, - props.defaultValue, - null - ) - }); - const radio = createStore(initialState, composite, props.store); - return _chunks_PNRLI7OV_spreadProps(_chunks_PNRLI7OV_spreadValues(_chunks_PNRLI7OV_spreadValues({}, composite), radio), { - setValue: (value) => radio.setState("value", value) - }); -} - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/radio/radio-store.js - - - - - - - -// src/radio/radio-store.ts - -function useRadioStoreOptions(props) { - return useCompositeStoreOptions(props); -} -function useRadioStoreProps(store, props) { - store = useCompositeStoreProps(store, props); - useStoreProps(store, props, "value", "setValue"); - return store; -} -function useRadioStore(props = {}) { - const options = useRadioStoreOptions(props); - const store = FHQZ2KRN_useStore(() => createRadioStore(PNRLI7OV_spreadValues(PNRLI7OV_spreadValues({}, props), options))); - return useRadioStoreProps(store, props); -} - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/6I2PARRP.js -// src/radio/radio-context.ts - -var RadioContext = (0,external_React_.createContext)(void 0); - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/OXPV2NBK.js -// src/composite/utils.ts - -var OXPV2NBK_NULL_ITEM = { id: null }; -function OXPV2NBK_flipItems(items, activeId, shouldInsertNullItem = false) { - const index = items.findIndex((item) => item.id === activeId); - return [ - ...items.slice(index + 1), - ...shouldInsertNullItem ? [OXPV2NBK_NULL_ITEM] : [], - ...items.slice(0, index) - ]; -} -function OXPV2NBK_findFirstEnabledItem(items, excludeId) { - return items.find((item) => { - if (excludeId) { - return !item.disabled && item.id !== excludeId; - } - return !item.disabled; - }); -} -function getEnabledItem(store, id) { - if (!id) - return null; - return store.item(id) || null; -} -function OXPV2NBK_groupItemsByRows(items) { - const rows = []; - for (const item of items) { - const row = rows.find((currentRow) => { - var _a; - return ((_a = currentRow[0]) == null ? void 0 : _a.rowId) === item.rowId; - }); - if (row) { - row.push(item); - } else { - rows.push([item]); - } - } - return rows; -} -function selectTextField(element, collapseToEnd = false) { - if (isTextField(element)) { - element.setSelectionRange( - collapseToEnd ? element.value.length : 0, - element.value.length - ); - } else if (element.isContentEditable) { - const selection = getDocument(element).getSelection(); - selection == null ? void 0 : selection.selectAllChildren(element); - if (collapseToEnd) { - selection == null ? void 0 : selection.collapseToEnd(); - } - } -} -var FOCUS_SILENTLY = Symbol("FOCUS_SILENTLY"); -function focusSilently(element) { - element[FOCUS_SILENTLY] = true; - element.focus(); -} -function silentlyFocused(element) { - const isSilentlyFocused = element[FOCUS_SILENTLY]; - delete element[FOCUS_SILENTLY]; - return isSilentlyFocused; -} -function OXPV2NBK_isItem(store, element, exclude) { - if (!element) - return false; - if (element === exclude) - return false; - const item = store.item(element.id); - if (!item) - return false; - if (exclude && item.element === exclude) - return false; - return true; -} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/WJ37OVG2.js -// src/composite/composite-context.ts - -var CompositeItemContext = (0,external_React_.createContext)( - void 0 -); -var CompositeRowContext = (0,external_React_.createContext)( - void 0 -); -var CompositeContext = (0,external_React_.createContext)( - void 0 -); - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/AAVDGJD5.js - - - - - - - -// src/composite/composite.tsx - - - - - - -function isGrid(items) { - return items.some((item) => !!item.rowId); -} -function isPrintableKey(event) { - return event.key.length === 1 && !event.ctrlKey && !event.metaKey; -} -function isModifierKey(event) { - return event.key === "Shift" || event.key === "Control" || event.key === "Alt" || event.key === "Meta"; -} -function AAVDGJD5_canProxyKeyboardEvent(event, state) { - if (!events_isSelfTarget(event)) - return false; - if (isModifierKey(event)) - return false; - const target = event.target; - if (!target) - return true; - if (O35LWD4W_isTextField(target)) { - if (isPrintableKey(event)) - return false; - const grid = isGrid(state.renderedItems); - const focusingInputOnly = state.activeId === null; - const allowHorizontalNavigationOnItems = grid && !focusingInputOnly; - const isHomeOrEnd = event.key === "Home" || event.key === "End"; - if (!allowHorizontalNavigationOnItems && isHomeOrEnd) - return false; - } - return !event.isPropagationStopped(); -} -function AAVDGJD5_useKeyboardEventProxy(store, onKeyboardEvent, previousElementRef) { - return useEvent((event) => { - var _a; - onKeyboardEvent == null ? void 0 : onKeyboardEvent(event); - if (event.defaultPrevented) - return; - const state = store.getState(); - const activeElement = (_a = getEnabledItem(store, state.activeId)) == null ? void 0 : _a.element; - if (!activeElement) - return; - if (!AAVDGJD5_canProxyKeyboardEvent(event, state)) - return; - const _b = event, { view } = _b, eventInit = __objRest(_b, ["view"]); - const previousElement = previousElementRef == null ? void 0 : previousElementRef.current; - if (activeElement !== previousElement) { - activeElement.focus(); - } - if (!fireKeyboardEvent(activeElement, event.type, eventInit)) { - event.preventDefault(); - } - if (event.currentTarget.contains(activeElement)) { - event.stopPropagation(); - } - }); -} -function AAVDGJD5_findFirstEnabledItemInTheLastRow(items) { - return OXPV2NBK_findFirstEnabledItem( - flatten2DArray(reverseArray(OXPV2NBK_groupItemsByRows(items))) - ); -} -function useScheduleFocus(store) { - const [scheduled, setScheduled] = (0,external_React_.useState)(false); - const schedule = (0,external_React_.useCallback)(() => setScheduled(true), []); - const activeItem = store.useState( - (state) => getEnabledItem(store, state.activeId) - ); - (0,external_React_.useEffect)(() => { - const activeElement = activeItem == null ? void 0 : activeItem.element; - if (!scheduled) - return; - if (!activeElement) - return; - setScheduled(false); - activeElement.focus({ preventScroll: true }); - }, [activeItem, scheduled]); - return schedule; -} -var AAVDGJD5_useComposite = NQJBHION_createHook( - (_a) => { - var _b = _a, { - store, - composite = true, - focusOnMove = composite, - moveOnKeyPress = true - } = _b, props = __objRest(_b, [ - "store", - "composite", - "focusOnMove", - "moveOnKeyPress" - ]); - const previousElementRef = (0,external_React_.useRef)(null); - const scheduleFocus = useScheduleFocus(store); - const moves = store.useState("moves"); - (0,external_React_.useEffect)(() => { - var _a2; - if (!moves) - return; - if (!composite) - return; - if (!focusOnMove) - return; - const { activeId: activeId2 } = store.getState(); - const itemElement = (_a2 = getEnabledItem(store, activeId2)) == null ? void 0 : _a2.element; - if (!itemElement) - return; - focusIntoView(itemElement); - }, [moves, composite, focusOnMove]); - useSafeLayoutEffect(() => { - if (!composite) - return; - if (!moves) - return; - const { baseElement, activeId: activeId2 } = store.getState(); - const isSelfAcive = activeId2 === null; - if (!isSelfAcive) - return; - if (!baseElement) - return; - const previousElement = previousElementRef.current; - previousElementRef.current = null; - if (previousElement) { - fireBlurEvent(previousElement, { relatedTarget: baseElement }); - } - if (focus_hasFocus(baseElement)) { - fireFocusEvent(baseElement, { relatedTarget: previousElement }); - } else { - baseElement.focus(); - } - }, [moves, composite]); - const activeId = store.useState("activeId"); - const virtualFocus = store.useState("virtualFocus"); - useSafeLayoutEffect(() => { - var _a2; - if (!composite) - return; - if (!virtualFocus) - return; - const previousElement = previousElementRef.current; - previousElementRef.current = null; - if (!previousElement) - return; - const activeElement = (_a2 = getEnabledItem(store, activeId)) == null ? void 0 : _a2.element; - const relatedTarget = activeElement || O35LWD4W_getActiveElement(previousElement); - fireBlurEvent(previousElement, { relatedTarget }); - }, [activeId, virtualFocus, composite]); - const onKeyDownCapture = AAVDGJD5_useKeyboardEventProxy( - store, - props.onKeyDownCapture, - previousElementRef - ); - const onKeyUpCapture = AAVDGJD5_useKeyboardEventProxy( - store, - props.onKeyUpCapture, - previousElementRef - ); - const onFocusCaptureProp = props.onFocusCapture; - const onFocusCapture = useEvent((event) => { - onFocusCaptureProp == null ? void 0 : onFocusCaptureProp(event); - if (event.defaultPrevented) - return; - const { virtualFocus: virtualFocus2 } = store.getState(); - if (!virtualFocus2) - return; - const previousActiveElement = event.relatedTarget; - const isSilentlyFocused = silentlyFocused(event.currentTarget); - if (events_isSelfTarget(event) && isSilentlyFocused) { - event.stopPropagation(); - previousElementRef.current = previousActiveElement; - } - }); - const onFocusProp = props.onFocus; - const onFocus = useEvent((event) => { - onFocusProp == null ? void 0 : onFocusProp(event); - if (event.defaultPrevented) - return; - if (!composite) - return; - const { relatedTarget } = event; - const { virtualFocus: virtualFocus2 } = store.getState(); - if (virtualFocus2) { - if (events_isSelfTarget(event) && !OXPV2NBK_isItem(store, relatedTarget)) { - queueMicrotask(scheduleFocus); - } - } else if (events_isSelfTarget(event)) { - store.setActiveId(null); - } - }); - const onBlurCaptureProp = props.onBlurCapture; - const onBlurCapture = useEvent((event) => { - var _a2; - onBlurCaptureProp == null ? void 0 : onBlurCaptureProp(event); - if (event.defaultPrevented) - return; - const { virtualFocus: virtualFocus2, activeId: activeId2 } = store.getState(); - if (!virtualFocus2) - return; - const activeElement = (_a2 = getEnabledItem(store, activeId2)) == null ? void 0 : _a2.element; - const nextActiveElement = event.relatedTarget; - const nextActiveElementIsItem = OXPV2NBK_isItem(store, nextActiveElement); - const previousElement = previousElementRef.current; - previousElementRef.current = null; - if (events_isSelfTarget(event) && nextActiveElementIsItem) { - if (nextActiveElement === activeElement) { - if (previousElement && previousElement !== nextActiveElement) { - fireBlurEvent(previousElement, event); - } - } else if (activeElement) { - fireBlurEvent(activeElement, event); - } - event.stopPropagation(); - } else { - const targetIsItem = OXPV2NBK_isItem(store, event.target); - if (!targetIsItem && activeElement) { - fireBlurEvent(activeElement, event); - } - } - }); - const onKeyDownProp = props.onKeyDown; - const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress); - const onKeyDown = useEvent((event) => { - var _a2; - onKeyDownProp == null ? void 0 : onKeyDownProp(event); - if (event.defaultPrevented) - return; - if (!events_isSelfTarget(event)) - return; - const { orientation, items, renderedItems, activeId: activeId2 } = store.getState(); - const activeItem = getEnabledItem(store, activeId2); - if ((_a2 = activeItem == null ? void 0 : activeItem.element) == null ? void 0 : _a2.isConnected) - return; - const isVertical = orientation !== "horizontal"; - const isHorizontal = orientation !== "vertical"; - const grid = isGrid(renderedItems); - const up = () => { - if (grid) { - const item = items && AAVDGJD5_findFirstEnabledItemInTheLastRow(items); - return item == null ? void 0 : item.id; - } - return store.last(); - }; - const keyMap = { - ArrowUp: (grid || isVertical) && up, - ArrowRight: (grid || isHorizontal) && store.first, - ArrowDown: (grid || isVertical) && store.first, - ArrowLeft: (grid || isHorizontal) && store.last, - Home: store.first, - End: store.last, - PageUp: store.first, - PageDown: store.last - }; - const action = keyMap[event.key]; - if (action) { - const id = action(); - if (id !== void 0) { - if (!moveOnKeyPressProp(event)) - return; - event.preventDefault(); - store.move(id); - } - } - }); - props = useWrapElement( - props, - (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(CompositeContext.Provider, { value: store, children: element }), - [store] - ); - const activeDescendant = store.useState( - (state) => { - var _a2; - return composite && state.virtualFocus ? (_a2 = getEnabledItem(store, state.activeId)) == null ? void 0 : _a2.id : void 0; - } - ); - props = PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({ - "aria-activedescendant": activeDescendant - }, props), { - ref: useMergeRefs(composite ? store.setBaseElement : null, props.ref), - onKeyDownCapture, - onKeyUpCapture, - onFocusCapture, - onFocus, - onBlurCapture, - onKeyDown - }); - const focusable = store.useState( - (state) => composite && (state.virtualFocus || state.activeId === null) - ); - props = useFocusable(PNRLI7OV_spreadValues({ focusable }, props)); - return props; - } -); -var AAVDGJD5_Composite = NQJBHION_createComponent((props) => { - const htmlProps = AAVDGJD5_useComposite(props); - return NQJBHION_createElement("div", htmlProps); -}); -if (false) {} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/radio/radio-group.js - - - - - - - - - - - -// src/radio/radio-group.tsx - -var useRadioGroup = NQJBHION_createHook( - (_a) => { - var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); - props = useWrapElement( - props, - (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(RadioContext.Provider, { value: store, children: element }), - [store] - ); - props = PNRLI7OV_spreadValues({ - role: "radiogroup" - }, props); - props = AAVDGJD5_useComposite(PNRLI7OV_spreadValues({ store }, props)); - return props; - } -); -var RadioGroup = NQJBHION_createComponent((props) => { - const htmlProps = useRadioGroup(props); - return NQJBHION_createElement("div", htmlProps); -}); -if (false) {} - - -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/context.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - -const ToggleGroupControlContext = (0,external_wp_element_namespaceObject.createContext)({}); -const useToggleGroupControlContext = () => (0,external_wp_element_namespaceObject.useContext)(ToggleGroupControlContext); -/* harmony default export */ var toggle_group_control_context = (ToggleGroupControlContext); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/utils.js -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - -/** - * Used to determine, via an internal heuristics, whether an `undefined` value - * received for the `value` prop should be interpreted as the component being - * used in uncontrolled mode, or as an "empty" value for controlled mode. - * - * @param valueProp The received `value` - */ -function useComputeControlledOrUncontrolledValue(valueProp) { - const hasEverBeenUsedInControlledMode = (0,external_wp_element_namespaceObject.useRef)(false); - const previousValueProp = (0,external_wp_compose_namespaceObject.usePrevious)(valueProp); - (0,external_wp_element_namespaceObject.useEffect)(() => { - if (!hasEverBeenUsedInControlledMode.current) { - // Assume the component is being used in controlled mode if: - // - the `value` prop is not `undefined` - // - the `value` prop was not previously `undefined` and was given a new value - hasEverBeenUsedInControlledMode.current = valueProp !== undefined && previousValueProp !== undefined && valueProp !== previousValueProp; - } - }, [valueProp, previousValueProp]); - let value, defaultValue; - if (hasEverBeenUsedInControlledMode.current) { - // When in controlled mode, use `''` instead of `undefined` - value = valueProp !== null && valueProp !== void 0 ? valueProp : ''; - } else { - // When in uncontrolled mode, the `value` should be intended as the initial value - defaultValue = valueProp; - } - return { - value, - defaultValue - }; -} - -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/as-radio-group.js - -/** - * External dependencies - */ - -// eslint-disable-next-line no-restricted-imports - - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - -function UnforwardedToggleGroupControlAsRadioGroup({ - children, - isAdaptiveWidth, - label, - onChange: onChangeProp, - size, - value: valueProp, - id: idProp, - ...otherProps -}, forwardedRef) { - const generatedId = (0,external_wp_compose_namespaceObject.useInstanceId)(ToggleGroupControlAsRadioGroup, 'toggle-group-control-as-radio-group'); - const baseId = idProp || generatedId; - - // Use a heuristic to understand if the component is being used in controlled - // or uncontrolled mode, and consequently: - // - when controlled, convert `undefined` values to `''` (ie. "no value") - // - use the `value` prop as the `defaultValue` when uncontrolled - const { - value, - defaultValue - } = useComputeControlledOrUncontrolledValue(valueProp); - - // `useRadioStore`'s `setValue` prop can be called with `null`, while - // the component's `onChange` prop only expects `undefined` - const wrappedOnChangeProp = onChangeProp ? v => { - onChangeProp(v !== null && v !== void 0 ? v : undefined); - } : undefined; - const radio = useRadioStore({ - defaultValue, - value, - setValue: wrappedOnChangeProp - }); - const selectedValue = radio.useState('value'); - const setValue = radio.setValue; - const groupContextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ - baseId, - isBlock: !isAdaptiveWidth, - size, - value: selectedValue, - setValue - }), [baseId, isAdaptiveWidth, size, selectedValue, setValue]); - return (0,external_wp_element_namespaceObject.createElement)(toggle_group_control_context.Provider, { - value: groupContextValue - }, (0,external_wp_element_namespaceObject.createElement)(RadioGroup, { - store: radio, - "aria-label": label, - as: component, - ...otherProps, - id: baseId, - ref: forwardedRef - }, children)); -} -const ToggleGroupControlAsRadioGroup = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToggleGroupControlAsRadioGroup); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/as-button-group.js - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - -function UnforwardedToggleGroupControlAsButtonGroup({ - children, - isAdaptiveWidth, - label, - onChange, - size, - value: valueProp, - id: idProp, - ...otherProps -}, forwardedRef) { - const generatedId = (0,external_wp_compose_namespaceObject.useInstanceId)(ToggleGroupControlAsButtonGroup, 'toggle-group-control-as-button-group'); - const baseId = idProp || generatedId; - - // Use a heuristic to understand if the component is being used in controlled - // or uncontrolled mode, and consequently: - // - when controlled, convert `undefined` values to `''` (ie. "no value") - // - use the `value` prop as the `defaultValue` when uncontrolled - const { - value, - defaultValue - } = useComputeControlledOrUncontrolledValue(valueProp); - const [selectedValue, setSelectedValue] = useControlledValue({ - defaultValue, - value, - onChange - }); - const groupContextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ - baseId, - value: selectedValue, - setValue: setSelectedValue, - isBlock: !isAdaptiveWidth, - isDeselectable: true, - size - }), [baseId, selectedValue, setSelectedValue, isAdaptiveWidth, size]); - return (0,external_wp_element_namespaceObject.createElement)(toggle_group_control_context.Provider, { - value: groupContextValue - }, (0,external_wp_element_namespaceObject.createElement)(component, { - "aria-label": label, - ...otherProps, - ref: forwardedRef, - role: "group" - }, children)); -} -const ToggleGroupControlAsButtonGroup = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToggleGroupControlAsButtonGroup); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/component.js - -/** - * External dependencies - */ - -// eslint-disable-next-line no-restricted-imports - - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - - - - - -function UnconnectedToggleGroupControl(props, forwardedRef) { - const { - __nextHasNoMarginBottom = false, - className, - isAdaptiveWidth = false, - isBlock = false, - isDeselectable = false, - label, - hideLabelFromVision = false, - help, - onChange, - size = 'default', - value, - children, - ...otherProps - } = useContextSystem(props, 'ToggleGroupControl'); - const baseId = (0,external_wp_compose_namespaceObject.useInstanceId)(ToggleGroupControl, 'toggle-group-control'); - const cx = useCx(); - const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(toggleGroupControl({ - isBlock, - isDeselectable, - size - }), isBlock && toggle_group_control_styles_block, className), [className, cx, isBlock, isDeselectable, size]); - const MainControl = isDeselectable ? ToggleGroupControlAsButtonGroup : ToggleGroupControlAsRadioGroup; - return (0,external_wp_element_namespaceObject.createElement)(base_control, { - help: help, - __nextHasNoMarginBottom: __nextHasNoMarginBottom - }, !hideLabelFromVision && (0,external_wp_element_namespaceObject.createElement)(VisualLabelWrapper, null, (0,external_wp_element_namespaceObject.createElement)(base_control.VisualLabel, null, label)), (0,external_wp_element_namespaceObject.createElement)(MainControl, { - ...otherProps, - className: classes, - isAdaptiveWidth: isAdaptiveWidth, - label: label, - onChange: onChange, - ref: forwardedRef, - size: size, - value: value - }, (0,external_wp_element_namespaceObject.createElement)(LayoutGroup, { - id: baseId - }, children))); -} - -/** - * `ToggleGroupControl` is a form component that lets users choose options - * represented in horizontal segments. To render options for this control use - * `ToggleGroupControlOption` component. - * - * This component is intended for selecting a single persistent value from a set of options, - * similar to a how a radio button group would work. If you simply want a toggle to switch between views, - * use a `TabPanel` instead. - * - * Only use this control when you know for sure the labels of items inside won't - * wrap. For items with longer labels, you can consider a `SelectControl` or a - * `CustomSelectControl` component instead. - * - * ```jsx - * import { - * __experimentalToggleGroupControl as ToggleGroupControl, - * __experimentalToggleGroupControlOption as ToggleGroupControlOption, - * } from '@wordpress/components'; - * - * function Example() { - * return ( - * <ToggleGroupControl label="my label" value="vertical" isBlock> - * <ToggleGroupControlOption value="horizontal" label="Horizontal" /> - * <ToggleGroupControlOption value="vertical" label="Vertical" /> - * </ToggleGroupControl> - * ); - * } - * ``` - */ -const ToggleGroupControl = contextConnect(UnconnectedToggleGroupControl, 'ToggleGroupControl'); -/* harmony default export */ var toggle_group_control_component = (ToggleGroupControl); - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/P4RGQGTG.js - - - - - -// src/command/command.ts - - - - -function P4RGQGTG_isNativeClick(event) { - if (!event.isTrusted) - return false; - const element = event.currentTarget; - if (event.key === "Enter") { - return O35LWD4W_isButton(element) || element.tagName === "SUMMARY" || element.tagName === "A"; - } - if (event.key === " ") { - return O35LWD4W_isButton(element) || element.tagName === "SUMMARY" || element.tagName === "INPUT" || element.tagName === "SELECT"; - } - return false; -} -var useCommand = NQJBHION_createHook( - (_a) => { - var _b = _a, { clickOnEnter = true, clickOnSpace = true } = _b, props = __objRest(_b, ["clickOnEnter", "clickOnSpace"]); - const ref = (0,external_React_.useRef)(null); - const tagName = useTagName(ref, props.as); - const type = props.type; - const [isNativeButton, setIsNativeButton] = (0,external_React_.useState)( - () => !!tagName && O35LWD4W_isButton({ tagName, type }) - ); - (0,external_React_.useEffect)(() => { - if (!ref.current) - return; - setIsNativeButton(O35LWD4W_isButton(ref.current)); - }, []); - const [active, setActive] = (0,external_React_.useState)(false); - const activeRef = (0,external_React_.useRef)(false); - const isDuplicate = "data-command" in props; - const onKeyDownProp = props.onKeyDown; - const onKeyDown = useEvent((event) => { - onKeyDownProp == null ? void 0 : onKeyDownProp(event); - const element = event.currentTarget; - if (event.defaultPrevented) - return; - if (isDuplicate) - return; - if (props.disabled) - return; - if (!events_isSelfTarget(event)) - return; - if (O35LWD4W_isTextField(element)) - return; - if (element.isContentEditable) - return; - const isEnter = clickOnEnter && event.key === "Enter"; - const isSpace = clickOnSpace && event.key === " "; - const shouldPreventEnter = event.key === "Enter" && !clickOnEnter; - const shouldPreventSpace = event.key === " " && !clickOnSpace; - if (shouldPreventEnter || shouldPreventSpace) { - event.preventDefault(); - return; - } - if (isEnter || isSpace) { - const nativeClick = P4RGQGTG_isNativeClick(event); - if (isEnter) { - if (!nativeClick) { - event.preventDefault(); - const _a2 = event, { view } = _a2, eventInit = __objRest(_a2, ["view"]); - const click = () => fireClickEvent(element, eventInit); - if (isFirefox()) { - queueBeforeEvent(element, "keyup", click); - } else { - queueMicrotask(click); - } - } - } else if (isSpace) { - activeRef.current = true; - if (!nativeClick) { - event.preventDefault(); - setActive(true); - } - } - } - }); - const onKeyUpProp = props.onKeyUp; - const onKeyUp = useEvent((event) => { - onKeyUpProp == null ? void 0 : onKeyUpProp(event); - if (event.defaultPrevented) - return; - if (isDuplicate) - return; - if (props.disabled) - return; - if (event.metaKey) - return; - const isSpace = clickOnSpace && event.key === " "; - if (activeRef.current && isSpace) { - activeRef.current = false; - if (!P4RGQGTG_isNativeClick(event)) { - setActive(false); - const element = event.currentTarget; - const _a2 = event, { view } = _a2, eventInit = __objRest(_a2, ["view"]); - queueMicrotask(() => fireClickEvent(element, eventInit)); - } - } - }); - props = PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({ - "data-command": "", - "data-active": active ? "" : void 0, - type: isNativeButton ? "button" : void 0 - }, props), { - ref: useMergeRefs(ref, props.ref), - onKeyDown, - onKeyUp - }); - props = useFocusable(props); - return props; - } -); -var Command = NQJBHION_createComponent((props) => { - props = useCommand(props); - return NQJBHION_createElement("button", props); -}); -if (false) {} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/T3DJZG63.js -// src/collection/collection-context.ts - -var CollectionContext = (0,external_React_.createContext)( - void 0 -); - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/HGFTMLQ7.js - - - - - -// src/collection/collection-item.ts - - -var useCollectionItem = NQJBHION_createHook( - (_a) => { - var _b = _a, { - store, - shouldRegisterItem = true, - getItem = identity, - element: element - } = _b, props = __objRest(_b, [ - "store", - "shouldRegisterItem", - "getItem", - // @ts-expect-error This prop may come from a collection renderer. - "element" - ]); - const context = (0,external_React_.useContext)(CollectionContext); - store = store || context; - const id = useId(props.id); - const unrenderItem = (0,external_React_.useRef)(); - const ref = (0,external_React_.useCallback)( - (element2) => { - var _a2; - if (!element2 || !id || !shouldRegisterItem) { - return (_a2 = unrenderItem.current) == null ? void 0 : _a2.call(unrenderItem); - } - const item = getItem({ id, element: element2 }); - unrenderItem.current = store == null ? void 0 : store.renderItem(item); - }, - [id, shouldRegisterItem, getItem, store] - ); - props = PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({}, props), { - ref: useMergeRefs(ref, props.ref) - }); - return props; - } -); -var CollectionItem = NQJBHION_createComponent( - (props) => { - const htmlProps = useCollectionItem(props); - return NQJBHION_createElement("div", htmlProps); - } -); -if (false) {} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/WFK3YK7D.js - - - - - - - - - -// src/composite/composite-item.tsx - - - - -function isEditableElement(element) { - if (element.isContentEditable) - return true; - if (O35LWD4W_isTextField(element)) - return true; - return element.tagName === "INPUT" && !O35LWD4W_isButton(element); -} -function getNextPageOffset(scrollingElement, pageUp = false) { - const height = scrollingElement.clientHeight; - const { top } = scrollingElement.getBoundingClientRect(); - const pageSize = Math.max(height * 0.875, height - 40) * 1.5; - const pageOffset = pageUp ? height - pageSize + top : pageSize + top; - if (scrollingElement.tagName === "HTML") { - return pageOffset + scrollingElement.scrollTop; - } - return pageOffset; -} -function getItemOffset(itemElement, pageUp = false) { - const { top } = itemElement.getBoundingClientRect(); - if (pageUp) { - return top + itemElement.clientHeight; - } - return top; -} -function findNextPageItemId(element, store, next, pageUp = false) { - var _a; - if (!store) - return; - if (!next) - return; - const { renderedItems } = store.getState(); - const scrollingElement = getScrollingElement(element); - if (!scrollingElement) - return; - const nextPageOffset = getNextPageOffset(scrollingElement, pageUp); - let id; - let prevDifference; - for (let i = 0; i < renderedItems.length; i += 1) { - const previousId = id; - id = next(i); - if (!id) - break; - if (id === previousId) - continue; - const itemElement = (_a = getEnabledItem(store, id)) == null ? void 0 : _a.element; - if (!itemElement) - continue; - const itemOffset = getItemOffset(itemElement, pageUp); - const difference = itemOffset - nextPageOffset; - const absDifference = Math.abs(difference); - if (pageUp && difference <= 0 || !pageUp && difference >= 0) { - if (prevDifference !== void 0 && prevDifference < absDifference) { - id = previousId; - } - break; - } - prevDifference = absDifference; - } - return id; -} -function WFK3YK7D_targetIsAnotherItem(event, store) { - if (events_isSelfTarget(event)) - return false; - return OXPV2NBK_isItem(store, event.target); -} -function WFK3YK7D_useRole(ref, props) { - const roleProp = props.role; - const [role, setRole] = (0,external_React_.useState)(roleProp); - useSafeLayoutEffect(() => { - const element = ref.current; - if (!element) - return; - setRole(element.getAttribute("role") || roleProp); - }, [roleProp]); - return role; -} -function requiresAriaSelected(role) { - return role === "option" || role === "treeitem"; -} -function supportsAriaSelected(role) { - if (role === "option") - return true; - if (role === "tab") - return true; - if (role === "treeitem") - return true; - if (role === "gridcell") - return true; - if (role === "row") - return true; - if (role === "columnheader") - return true; - if (role === "rowheader") - return true; - return false; -} -var WFK3YK7D_useCompositeItem = NQJBHION_createHook( - (_a) => { - var _b = _a, { - store, - rowId: rowIdProp, - preventScrollOnKeyDown = false, - moveOnKeyPress = true, - getItem: getItemProp, - "aria-setsize": ariaSetSizeProp, - "aria-posinset": ariaPosInSetProp - } = _b, props = __objRest(_b, [ - "store", - "rowId", - "preventScrollOnKeyDown", - "moveOnKeyPress", - "getItem", - "aria-setsize", - "aria-posinset" - ]); - var _a2; - const context = (0,external_React_.useContext)(CompositeContext); - store = store || context; - const id = useId(props.id); - const ref = (0,external_React_.useRef)(null); - const row = (0,external_React_.useContext)(CompositeRowContext); - const rowId = useStoreState(store, (state) => { - if (rowIdProp) - return rowIdProp; - if (!(row == null ? void 0 : row.baseElement)) - return; - if (row.baseElement !== state.baseElement) - return; - return row.id; - }); - const trulyDisabled = props.disabled && !props.accessibleWhenDisabled; - const getItem = (0,external_React_.useCallback)( - (item) => { - const nextItem = PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({}, item), { - id: id || item.id, - rowId, - disabled: !!trulyDisabled - }); - if (getItemProp) { - return getItemProp(nextItem); - } - return nextItem; - }, - [id, rowId, trulyDisabled, getItemProp] - ); - const onFocusProp = props.onFocus; - const hasFocusedComposite = (0,external_React_.useRef)(false); - const onFocus = useEvent((event) => { - onFocusProp == null ? void 0 : onFocusProp(event); - if (event.defaultPrevented) - return; - if (events_isPortalEvent(event)) - return; - if (!id) - return; - if (!store) - return; - const { activeId, virtualFocus: virtualFocus2, baseElement: baseElement2 } = store.getState(); - if (WFK3YK7D_targetIsAnotherItem(event, store)) - return; - if (activeId !== id) { - store.setActiveId(id); - } - if (!virtualFocus2) - return; - if (!events_isSelfTarget(event)) - return; - if (isEditableElement(event.currentTarget)) - return; - if (!baseElement2) - return; - hasFocusedComposite.current = true; - const fromComposite = event.relatedTarget === baseElement2 || OXPV2NBK_isItem(store, event.relatedTarget); - if (fromComposite) { - focusSilently(baseElement2); - } else { - baseElement2.focus(); - } - }); - const onBlurCaptureProp = props.onBlurCapture; - const onBlurCapture = useEvent((event) => { - onBlurCaptureProp == null ? void 0 : onBlurCaptureProp(event); - if (event.defaultPrevented) - return; - const state = store == null ? void 0 : store.getState(); - if ((state == null ? void 0 : state.virtualFocus) && hasFocusedComposite.current) { - hasFocusedComposite.current = false; - event.preventDefault(); - event.stopPropagation(); - } - }); - const onKeyDownProp = props.onKeyDown; - const preventScrollOnKeyDownProp = useBooleanEvent(preventScrollOnKeyDown); - const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress); - const onKeyDown = useEvent((event) => { - onKeyDownProp == null ? void 0 : onKeyDownProp(event); - if (event.defaultPrevented) - return; - if (!events_isSelfTarget(event)) - return; - if (!store) - return; - const { currentTarget } = event; - const state = store.getState(); - const item = store.item(id); - const isGrid = !!(item == null ? void 0 : item.rowId); - const isVertical = state.orientation !== "horizontal"; - const isHorizontal = state.orientation !== "vertical"; - const keyMap = { - ArrowUp: (isGrid || isVertical) && store.up, - ArrowRight: (isGrid || isHorizontal) && store.next, - ArrowDown: (isGrid || isVertical) && store.down, - ArrowLeft: (isGrid || isHorizontal) && store.previous, - Home: () => { - if (!isGrid || event.ctrlKey) { - return store == null ? void 0 : store.first(); - } - return store == null ? void 0 : store.previous(-1); - }, - End: () => { - if (!isGrid || event.ctrlKey) { - return store == null ? void 0 : store.last(); - } - return store == null ? void 0 : store.next(-1); - }, - PageUp: () => { - return findNextPageItemId(currentTarget, store, store == null ? void 0 : store.up, true); - }, - PageDown: () => { - return findNextPageItemId(currentTarget, store, store == null ? void 0 : store.down); - } - }; - const action = keyMap[event.key]; - if (action) { - const nextId = action(); - if (preventScrollOnKeyDownProp(event) || nextId !== void 0) { - if (!moveOnKeyPressProp(event)) - return; - event.preventDefault(); - store.move(nextId); - } - } - }); - const baseElement = useStoreState( - store, - (state) => state.baseElement || void 0 - ); - const providerValue = (0,external_React_.useMemo)( - () => ({ id, baseElement }), - [id, baseElement] - ); - props = useWrapElement( - props, - (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(CompositeItemContext.Provider, { value: providerValue, children: element }), - [providerValue] - ); - const isActiveItem = useStoreState(store, (state) => state.activeId === id); - const virtualFocus = useStoreState(store, "virtualFocus"); - const role = WFK3YK7D_useRole(ref, props); - let ariaSelected; - if (isActiveItem) { - if (requiresAriaSelected(role)) { - ariaSelected = true; - } else if (virtualFocus && supportsAriaSelected(role)) { - ariaSelected = true; - } - } - const ariaSetSize = useStoreState(store, (state) => { - if (ariaSetSizeProp != null) - return ariaSetSizeProp; - if (!(row == null ? void 0 : row.ariaSetSize)) - return; - if (row.baseElement !== state.baseElement) - return; - return row.ariaSetSize; - }); - const ariaPosInSet = useStoreState(store, (state) => { - if (ariaPosInSetProp != null) - return ariaPosInSetProp; - if (!(row == null ? void 0 : row.ariaPosInSet)) - return; - if (row.baseElement !== state.baseElement) - return; - const itemsInRow = state.renderedItems.filter( - (item) => item.rowId === rowId - ); - return row.ariaPosInSet + itemsInRow.findIndex((item) => item.id === id); - }); - const isTabbable = (_a2 = useStoreState(store, (state) => { - if (!state.renderedItems.length) - return true; - return !state.virtualFocus && state.activeId === id; - })) != null ? _a2 : true; - props = PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({ - id, - "aria-selected": ariaSelected, - "data-active-item": isActiveItem ? "" : void 0 - }, props), { - ref: useMergeRefs(ref, props.ref), - tabIndex: isTabbable ? props.tabIndex : -1, - onFocus, - onBlurCapture, - onKeyDown - }); - props = useCommand(props); - props = useCollectionItem(PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({ - store - }, props), { - getItem, - shouldRegisterItem: !!id ? props.shouldRegisterItem : false - })); - return PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({}, props), { - "aria-setsize": ariaSetSize, - "aria-posinset": ariaPosInSet - }); - } -); -var WFK3YK7D_CompositeItem = createMemoComponent( - (props) => { - const htmlProps = WFK3YK7D_useCompositeItem(props); - return NQJBHION_createElement("button", htmlProps); - } -); -if (false) {} - - - -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/X2PAO7C6.js - - - - - - - -// src/radio/radio.ts - -function getIsChecked(value, storeValue) { - if (storeValue === void 0) - return; - if (value != null && storeValue != null) { - return storeValue === value; - } - return !!storeValue; -} -function isNativeRadio(tagName, type) { - return tagName === "input" && (!type || type === "radio"); -} -var useRadio = NQJBHION_createHook( - (_a) => { - var _b = _a, { store, value, checked } = _b, props = __objRest(_b, ["store", "value", "checked"]); - var _a2; - const context = (0,external_React_.useContext)(RadioContext); - store = store || context; - const id = useId(props.id); - const ref = (0,external_React_.useRef)(null); - const isChecked = (_a2 = useStoreState( - store, - (state) => checked != null ? checked : getIsChecked(value, state.value) - )) != null ? _a2 : checked; - (0,external_React_.useEffect)(() => { - if (!id) - return; - if (!isChecked) - return; - const isActiveItem = (store == null ? void 0 : store.getState().activeId) === id; - if (isActiveItem) - return; - store == null ? void 0 : store.setActiveId(id); - }, [store, isChecked, id]); - const onChangeProp = props.onChange; - const tagName = useTagName(ref, props.as || "input"); - const nativeRadio = isNativeRadio(tagName, props.type); - const onChange = useEvent((event) => { - if (props.disabled) { - event.preventDefault(); - event.stopPropagation(); - return; - } - if (!nativeRadio) { - event.currentTarget.checked = true; - } - onChangeProp == null ? void 0 : onChangeProp(event); - if (event.defaultPrevented) - return; - store == null ? void 0 : store.setValue(value); - }); - const onClickProp = props.onClick; - const onClick = useEvent((event) => { - onClickProp == null ? void 0 : onClickProp(event); - if (event.defaultPrevented) - return; - if (nativeRadio) - return; - onChange(event); - }); - const onFocusProp = props.onFocus; - const onFocus = useEvent((event) => { - onFocusProp == null ? void 0 : onFocusProp(event); - if (event.defaultPrevented) - return; - if (!nativeRadio) - return; - if (!store) - return; - const { moves, activeId } = store.getState(); - if (!moves) - return; - if (id && activeId !== id) - return; - onChange(event); - }); - props = PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({ - id, - role: !nativeRadio ? "radio" : void 0, - type: nativeRadio ? "radio" : void 0, - "aria-checked": isChecked - }, props), { - ref: useMergeRefs(ref, props.ref), - onChange, - onClick, - onFocus - }); - props = WFK3YK7D_useCompositeItem(PNRLI7OV_spreadValues({ store, clickOnEnter: !nativeRadio }, props)); - return PNRLI7OV_spreadValues({ - value: nativeRadio ? value : void 0, - checked: isChecked - }, props); - } -); -var Radio = createMemoComponent((props) => { - const htmlProps = useRadio(props); - return NQJBHION_createElement("input", htmlProps); -}); -if (false) {} - - - -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option-base/styles.js - -function toggle_group_control_option_base_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } -/** - * External dependencies - */ - -/** - * Internal dependencies - */ - -const LabelView = emotion_styled_base_browser_esm("div", true ? { - target: "et6ln9s1" -} : 0)( true ? { - name: "sln1fl", - styles: "display:inline-flex;max-width:100%;min-width:0;position:relative" -} : 0); -const labelBlock = true ? { - name: "82a6rk", - styles: "flex:1" -} : 0; -const buttonView = ({ - isDeselectable, - isIcon, - isPressed, - size -}) => /*#__PURE__*/emotion_react_browser_esm_css("align-items:center;appearance:none;background:transparent;border:none;border-radius:", config_values.controlBorderRadius, ";color:", COLORS.gray[700], ";fill:currentColor;cursor:pointer;display:flex;font-family:inherit;height:100%;justify-content:center;line-height:100%;outline:none;padding:0 12px;position:relative;text-align:center;transition:background ", config_values.transitionDurationFast, " linear,color ", config_values.transitionDurationFast, " linear,font-weight 60ms linear;", reduceMotion('transition'), " user-select:none;width:100%;z-index:2;&::-moz-focus-inner{border:0;}&:active{background:", config_values.toggleGroupControlBackgroundColor, ";}", isDeselectable && deselectable, " ", isIcon && isIconStyles({ - size -}), " ", isPressed && pressed, ";" + ( true ? "" : 0), true ? "" : 0); -const pressed = /*#__PURE__*/emotion_react_browser_esm_css("color:", COLORS.white, ";&:active{background:transparent;}" + ( true ? "" : 0), true ? "" : 0); -const deselectable = /*#__PURE__*/emotion_react_browser_esm_css("color:", COLORS.gray[900], ";&:focus{box-shadow:inset 0 0 0 1px ", COLORS.white, ",0 0 0 ", config_values.borderWidthFocus, " ", COLORS.theme.accent, ";outline:2px solid transparent;}" + ( true ? "" : 0), true ? "" : 0); -const ButtonContentView = emotion_styled_base_browser_esm("div", true ? { - target: "et6ln9s0" -} : 0)("display:flex;font-size:", config_values.fontSize, ";line-height:1;" + ( true ? "" : 0)); -const isIconStyles = ({ - size = 'default' -}) => { - const iconButtonSizes = { - default: '30px', - '__unstable-large': '34px' - }; - return /*#__PURE__*/emotion_react_browser_esm_css("color:", COLORS.gray[900], ";width:", iconButtonSizes[size], ";padding-left:0;padding-right:0;" + ( true ? "" : 0), true ? "" : 0); -}; -const backdropView = /*#__PURE__*/emotion_react_browser_esm_css("background:", COLORS.gray[900], ";border-radius:", config_values.controlBorderRadius, ";position:absolute;inset:0;z-index:1;outline:2px solid transparent;outline-offset:-3px;" + ( true ? "" : 0), true ? "" : 0); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option-base/component.js - -/** - * External dependencies - */ - -// eslint-disable-next-line no-restricted-imports - -// eslint-disable-next-line no-restricted-imports - - -/** - * WordPress dependencies - */ - - - -/** - * Internal dependencies - */ - - - - - - -const { - ButtonContentView: component_ButtonContentView, - LabelView: component_LabelView -} = toggle_group_control_option_base_styles_namespaceObject; -const REDUCED_MOTION_TRANSITION_CONFIG = { - duration: 0 -}; -const LAYOUT_ID = 'toggle-group-backdrop-shared-layout-id'; -const WithToolTip = ({ - showTooltip, - text, - children -}) => { - if (showTooltip && text) { - return (0,external_wp_element_namespaceObject.createElement)(tooltip, { - text: text, - placement: "top" - }, children); - } - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, children); -}; -function ToggleGroupControlOptionBase(props, forwardedRef) { - const shouldReduceMotion = useReducedMotion(); - const toggleGroupControlContext = useToggleGroupControlContext(); - const id = (0,external_wp_compose_namespaceObject.useInstanceId)(ToggleGroupControlOptionBase, toggleGroupControlContext.baseId || 'toggle-group-control-option-base'); - const buttonProps = useContextSystem({ - ...props, - id - }, 'ToggleGroupControlOptionBase'); - const { - isBlock = false, - isDeselectable = false, - size = 'default' - } = toggleGroupControlContext; - const { - className, - isIcon = false, - value, - children, - showTooltip = false, - onFocus: onFocusProp, - ...otherButtonProps - } = buttonProps; - const isPressed = toggleGroupControlContext.value === value; - const cx = useCx(); - const labelViewClasses = (0,external_wp_element_namespaceObject.useMemo)(() => cx(isBlock && labelBlock), [cx, isBlock]); - const itemClasses = (0,external_wp_element_namespaceObject.useMemo)(() => cx(buttonView({ - isDeselectable, - isIcon, - isPressed, - size - }), className), [cx, isDeselectable, isIcon, isPressed, size, className]); - const backdropClasses = (0,external_wp_element_namespaceObject.useMemo)(() => cx(backdropView), [cx]); - const buttonOnClick = () => { - if (isDeselectable && isPressed) { - toggleGroupControlContext.setValue(undefined); - } else { - toggleGroupControlContext.setValue(value); - } - }; - const commonProps = { - ...otherButtonProps, - className: itemClasses, - 'data-value': value, - ref: forwardedRef - }; - return (0,external_wp_element_namespaceObject.createElement)(component_LabelView, { - className: labelViewClasses - }, (0,external_wp_element_namespaceObject.createElement)(WithToolTip, { - showTooltip: showTooltip, - text: otherButtonProps['aria-label'] - }, isDeselectable ? (0,external_wp_element_namespaceObject.createElement)("button", { - ...commonProps, - onFocus: onFocusProp, - "aria-pressed": isPressed, - type: "button", - onClick: buttonOnClick - }, (0,external_wp_element_namespaceObject.createElement)(component_ButtonContentView, null, children)) : (0,external_wp_element_namespaceObject.createElement)(Radio, { - render: (0,external_wp_element_namespaceObject.createElement)("button", { - ...commonProps, - onFocus: event => { - onFocusProp?.(event); - if (event.defaultPrevented) return; - toggleGroupControlContext.setValue(value); - } - }), - value: value - }, (0,external_wp_element_namespaceObject.createElement)(component_ButtonContentView, null, children))), isPressed ? (0,external_wp_element_namespaceObject.createElement)(motion.div, { - className: backdropClasses, - transition: shouldReduceMotion ? REDUCED_MOTION_TRANSITION_CONFIG : undefined, - role: "presentation", - layoutId: LAYOUT_ID - }) : null); -} - -/** - * `ToggleGroupControlOptionBase` is a form component and is meant to be used as an internal, - * generic component for any children of `ToggleGroupControl`. - * - * @example - * ```jsx - * import { - * __experimentalToggleGroupControl as ToggleGroupControl, - * __experimentalToggleGroupControlOptionBase as ToggleGroupControlOptionBase, - * } from '@wordpress/components'; - * - * function Example() { - * return ( - * <ToggleGroupControl label="my label" value="vertical" isBlock> - * <ToggleGroupControlOption value="horizontal" label="Horizontal" /> - * <ToggleGroupControlOption value="vertical" label="Vertical" /> - * </ToggleGroupControl> - * ); - * } - * ``` - */ -const ConnectedToggleGroupControlOptionBase = contextConnect(ToggleGroupControlOptionBase, 'ToggleGroupControlOptionBase'); -/* harmony default export */ var toggle_group_control_option_base_component = (ConnectedToggleGroupControlOptionBase); +/* harmony default export */ const font_size_picker_select = (FontSizePickerSelect); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option/component.js @@ -65128,7 +59573,7 @@ function UnforwardedToggleGroupControlOption(props, ref) { ...restProps } = props; const optionLabel = restProps['aria-label'] || label; - return (0,external_wp_element_namespaceObject.createElement)(toggle_group_control_option_base_component, { + return (0,external_React_.createElement)(toggle_group_control_option_base_component, { ...restProps, "aria-label": optionLabel, ref: ref @@ -65156,7 +59601,7 @@ function UnforwardedToggleGroupControlOption(props, ref) { * ``` */ const ToggleGroupControlOption = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToggleGroupControlOption); -/* harmony default export */ var toggle_group_control_option_component = (ToggleGroupControlOption); +/* harmony default export */ const toggle_group_control_option_component = (ToggleGroupControlOption); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/font-size-picker/constants.js /** @@ -65201,19 +59646,20 @@ const FontSizePickerToggleGroup = props => { const { fontSizes, value, - __nextHasNoMarginBottom, + __next40pxDefaultSize, size, onChange } = props; - return (0,external_wp_element_namespaceObject.createElement)(toggle_group_control_component, { - __nextHasNoMarginBottom: __nextHasNoMarginBottom, + return (0,external_React_.createElement)(toggle_group_control_component, { + __nextHasNoMarginBottom: true, + __next40pxDefaultSize: __next40pxDefaultSize, label: (0,external_wp_i18n_namespaceObject.__)('Font size'), hideLabelFromVision: true, value: value, onChange: onChange, isBlock: true, size: size - }, fontSizes.map((fontSize, index) => (0,external_wp_element_namespaceObject.createElement)(toggle_group_control_option_component, { + }, fontSizes.map((fontSize, index) => (0,external_React_.createElement)(toggle_group_control_option_component, { key: fontSize.slug, value: fontSize.size, label: T_SHIRT_ABBREVIATIONS[index], @@ -65221,7 +59667,7 @@ const FontSizePickerToggleGroup = props => { showTooltip: true }))); }; -/* harmony default export */ var font_size_picker_toggle_group = (FontSizePickerToggleGroup); +/* harmony default export */ const font_size_picker_toggle_group = (FontSizePickerToggleGroup); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/font-size-picker/index.js @@ -65236,7 +59682,6 @@ const FontSizePickerToggleGroup = props => { - /** * Internal dependencies */ @@ -65253,8 +59698,7 @@ const FontSizePickerToggleGroup = props => { const UnforwardedFontSizePicker = (props, ref) => { const { - /** Start opting into the new margin-free styles that will become the default in a future version. */ - __nextHasNoMarginBottom = false, + __next40pxDefaultSize = false, fallbackFontSize, fontSizes = [], disableCustomFontSizes = false, @@ -65265,13 +59709,6 @@ const UnforwardedFontSizePicker = (props, ref) => { withSlider = false, withReset = true } = props; - if (!__nextHasNoMarginBottom) { - external_wp_deprecated_default()('Bottom margin styles for wp.components.FontSizePicker', { - since: '6.1', - version: '6.4', - hint: 'Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version.' - }); - } const units = useCustomUnits({ availableUnits: unitsProp || ['px', 'em', 'rem'] }); @@ -65305,29 +59742,28 @@ const UnforwardedFontSizePicker = (props, ref) => { const hasUnits = typeof value === 'string' || typeof fontSizes[0]?.size === 'string'; const [valueQuantity, valueUnit] = parseQuantityAndUnitFromRawValue(value, units); const isValueUnitRelative = !!valueUnit && ['em', 'rem'].includes(valueUnit); - return (0,external_wp_element_namespaceObject.createElement)(styles_Container, { + const isDisabled = value === undefined; + return (0,external_React_.createElement)(styles_Container, { ref: ref, className: "components-font-size-picker" - }, (0,external_wp_element_namespaceObject.createElement)(visually_hidden_component, { + }, (0,external_React_.createElement)(visually_hidden_component, { as: "legend" - }, (0,external_wp_i18n_namespaceObject.__)('Font size')), (0,external_wp_element_namespaceObject.createElement)(spacer_component, null, (0,external_wp_element_namespaceObject.createElement)(font_size_picker_styles_Header, { + }, (0,external_wp_i18n_namespaceObject.__)('Font size')), (0,external_React_.createElement)(spacer_component, null, (0,external_React_.createElement)(styles_Header, { className: "components-font-size-picker__header" - }, (0,external_wp_element_namespaceObject.createElement)(HeaderLabel, { + }, (0,external_React_.createElement)(HeaderLabel, { "aria-label": `${(0,external_wp_i18n_namespaceObject.__)('Size')} ${headerHint || ''}` - }, (0,external_wp_i18n_namespaceObject.__)('Size'), headerHint && (0,external_wp_element_namespaceObject.createElement)(HeaderHint, { + }, (0,external_wp_i18n_namespaceObject.__)('Size'), headerHint && (0,external_React_.createElement)(HeaderHint, { className: "components-font-size-picker__header__hint" - }, headerHint)), !disableCustomFontSizes && (0,external_wp_element_namespaceObject.createElement)(HeaderToggle, { + }, headerHint)), !disableCustomFontSizes && (0,external_React_.createElement)(HeaderToggle, { label: showCustomValueControl ? (0,external_wp_i18n_namespaceObject.__)('Use size preset') : (0,external_wp_i18n_namespaceObject.__)('Set custom size'), icon: library_settings, onClick: () => { setShowCustomValueControl(!showCustomValueControl); }, isPressed: showCustomValueControl, - isSmall: true - }))), (0,external_wp_element_namespaceObject.createElement)(Controls, { - className: "components-font-size-picker__controls", - __nextHasNoMarginBottom: __nextHasNoMarginBottom - }, !!fontSizes.length && shouldUseSelectControl && !showCustomValueControl && (0,external_wp_element_namespaceObject.createElement)(font_size_picker_select, { + size: "small" + }))), (0,external_React_.createElement)("div", null, !!fontSizes.length && shouldUseSelectControl && !showCustomValueControl && (0,external_React_.createElement)(font_size_picker_select, { + __next40pxDefaultSize: __next40pxDefaultSize, fontSizes: fontSizes, value: value, disableCustomFontSizes: disableCustomFontSizes, @@ -65340,10 +59776,10 @@ const UnforwardedFontSizePicker = (props, ref) => { } }, onSelectCustom: () => setShowCustomValueControl(true) - }), !shouldUseSelectControl && !showCustomValueControl && (0,external_wp_element_namespaceObject.createElement)(font_size_picker_toggle_group, { + }), !shouldUseSelectControl && !showCustomValueControl && (0,external_React_.createElement)(font_size_picker_toggle_group, { fontSizes: fontSizes, value: value, - __nextHasNoMarginBottom: __nextHasNoMarginBottom, + __next40pxDefaultSize: __next40pxDefaultSize, size: size, onChange: newValue => { if (newValue === undefined) { @@ -65352,11 +59788,12 @@ const UnforwardedFontSizePicker = (props, ref) => { onChange?.(hasUnits ? newValue : Number(newValue), fontSizes.find(fontSize => fontSize.size === newValue)); } } - }), !disableCustomFontSizes && showCustomValueControl && (0,external_wp_element_namespaceObject.createElement)(flex_component, { + }), !disableCustomFontSizes && showCustomValueControl && (0,external_React_.createElement)(flex_component, { className: "components-font-size-picker__custom-size-control" - }, (0,external_wp_element_namespaceObject.createElement)(flex_item_component, { + }, (0,external_React_.createElement)(flex_item_component, { isBlock: true - }, (0,external_wp_element_namespaceObject.createElement)(unit_control, { + }, (0,external_React_.createElement)(unit_control, { + __next40pxDefaultSize: __next40pxDefaultSize, label: (0,external_wp_i18n_namespaceObject.__)('Custom'), labelPosition: "top", hideLabelFromVision: true, @@ -65371,13 +59808,14 @@ const UnforwardedFontSizePicker = (props, ref) => { size: size, units: hasUnits ? units : [], min: 0 - })), withSlider && (0,external_wp_element_namespaceObject.createElement)(flex_item_component, { + })), withSlider && (0,external_React_.createElement)(flex_item_component, { isBlock: true - }, (0,external_wp_element_namespaceObject.createElement)(spacer_component, { + }, (0,external_React_.createElement)(spacer_component, { marginX: 2, marginBottom: 0 - }, (0,external_wp_element_namespaceObject.createElement)(range_control, { - __nextHasNoMarginBottom: __nextHasNoMarginBottom, + }, (0,external_React_.createElement)(range_control, { + __nextHasNoMarginBottom: true, + __next40pxDefaultSize: __next40pxDefaultSize, className: "components-font-size-picker__custom-input", label: (0,external_wp_i18n_namespaceObject.__)('Custom Size'), hideLabelFromVision: true, @@ -65396,18 +59834,19 @@ const UnforwardedFontSizePicker = (props, ref) => { min: 0, max: isValueUnitRelative ? 10 : 100, step: isValueUnitRelative ? 0.1 : 1 - }))), withReset && (0,external_wp_element_namespaceObject.createElement)(flex_item_component, null, (0,external_wp_element_namespaceObject.createElement)(Button, { - disabled: value === undefined, + }))), withReset && (0,external_React_.createElement)(flex_item_component, null, (0,external_React_.createElement)(Button, { + disabled: isDisabled, + __experimentalIsFocusable: true, onClick: () => { onChange?.(undefined); }, variant: "secondary", __next40pxDefaultSize: true, - size: size !== '__unstable-large' ? 'small' : 'default' + size: size === '__unstable-large' || props.__next40pxDefaultSize ? 'default' : 'small' }, (0,external_wp_i18n_namespaceObject.__)('Reset')))))); }; const FontSizePicker = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedFontSizePicker); -/* harmony default export */ var font_size_picker = (FontSizePicker); +/* harmony default export */ const font_size_picker = (FontSizePicker); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/form-file-upload/index.js @@ -65451,13 +59890,13 @@ function FormFileUpload({ }; const ui = render ? render({ openFileDialog - }) : (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }) : (0,external_React_.createElement)(build_module_button, { onClick: openFileDialog, ...props }, children); - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { className: "components-form-file-upload" - }, ui, (0,external_wp_element_namespaceObject.createElement)("input", { + }, ui, (0,external_React_.createElement)("input", { type: "file", ref: ref, multiple: multiple, @@ -65470,7 +59909,7 @@ function FormFileUpload({ "data-testid": "form-file-upload-input" })); } -/* harmony default export */ var form_file_upload = (FormFileUpload); +/* harmony default export */ const form_file_upload = (FormFileUpload); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/form-toggle/index.js @@ -65517,9 +59956,9 @@ function FormToggle(props) { 'is-checked': checked, 'is-disabled': disabled }); - return (0,external_wp_element_namespaceObject.createElement)("span", { + return (0,external_React_.createElement)("span", { className: wrapperClasses - }, (0,external_wp_element_namespaceObject.createElement)("input", { + }, (0,external_React_.createElement)("input", { className: "components-form-toggle__input", id: id, type: "checkbox", @@ -65527,13 +59966,13 @@ function FormToggle(props) { onChange: onChange, disabled: disabled, ...additionalProps - }), (0,external_wp_element_namespaceObject.createElement)("span", { + }), (0,external_React_.createElement)("span", { className: "components-form-toggle__track" - }), (0,external_wp_element_namespaceObject.createElement)("span", { + }), (0,external_React_.createElement)("span", { className: "components-form-toggle__thumb" })); } -/* harmony default export */ var form_toggle = (FormToggle); +/* harmony default export */ const form_toggle = (FormToggle); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/form-token-field/token.js @@ -65583,22 +60022,23 @@ function Token({ const transformedValue = displayTransform(value); const termPositionAndCount = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: term name, 2: term position in a set of terms, 3: total term set count. */ (0,external_wp_i18n_namespaceObject.__)('%1$s (%2$s of %3$s)'), transformedValue, termPosition, termsCount); - return (0,external_wp_element_namespaceObject.createElement)("span", { + return (0,external_React_.createElement)("span", { className: tokenClasses, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, title: title - }, (0,external_wp_element_namespaceObject.createElement)("span", { + }, (0,external_React_.createElement)("span", { className: "components-form-token-field__token-text", id: `components-form-token-field__token-text-${instanceId}` - }, (0,external_wp_element_namespaceObject.createElement)(visually_hidden_component, { + }, (0,external_React_.createElement)(visually_hidden_component, { as: "span" - }, termPositionAndCount), (0,external_wp_element_namespaceObject.createElement)("span", { + }, termPositionAndCount), (0,external_React_.createElement)("span", { "aria-hidden": "true" - }, transformedValue)), (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }, transformedValue)), (0,external_React_.createElement)(build_module_button, { className: "components-form-token-field__remove-token", icon: close_small, onClick: !disabled ? onClick : undefined, + disabled: disabled, label: messages.remove, "aria-describedby": `components-form-token-field__token-text-${instanceId}` })); @@ -65697,7 +60137,7 @@ function FormTokenField(props) { __experimentalAutoSelectFirstMatch = false, __nextHasNoMarginBottom = false, tokenizeOnBlur = false - } = useDeprecated36pxDefaultSizeProp(props, 'wp.components.FormTokenField'); + } = useDeprecated36pxDefaultSizeProp(props); const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(FormTokenField); // We reset to these initial values again in the onBlur @@ -65762,7 +60202,7 @@ function FormTokenField(props) { onFocus(event); } } - function onBlur() { + function onBlur(event) { if (inputHasValidValue() && __experimentalValidateInput(incompleteTokenValue)) { setIsActive(false); if (tokenizeOnBlur && inputHasValidValue()) { @@ -65773,7 +60213,16 @@ function FormTokenField(props) { setIncompleteTokenValue(''); setInputOffsetFromEnd(0); setIsActive(false); - setIsExpanded(false); + if (__experimentalExpandOnFocus) { + // If `__experimentalExpandOnFocus` is true, don't close the suggestions list when + // the user clicks on it (`tokensAndInput` will be the element that caused the blur). + const hasFocusWithin = event.relatedTarget === tokensAndInput.current; + setIsExpanded(hasFocusWithin); + } else { + // Else collapse the suggestion list. This will result in the suggestion list closing + // after a suggestion has been submitted since that causes a blur. + setIsExpanded(false); + } setSelectedSuggestionIndex(-1); setSelectedSuggestionScroll(false); } @@ -65902,7 +60351,6 @@ function FormTokenField(props) { setSelectedSuggestionScroll(true); return true; // PreventDefault. } - function handleDownArrowKey() { setSelectedSuggestionIndex(index => { return (index + 1) % getMatchingSuggestions(incompleteTokenValue, suggestions, value, maxSuggestions, saveTransform).length; @@ -65910,7 +60358,6 @@ function FormTokenField(props) { setSelectedSuggestionScroll(true); return true; // PreventDefault. } - function handleEscapeKey(event) { if (event.target instanceof HTMLInputElement) { setIncompleteTokenValue(event.target.value); @@ -65920,14 +60367,12 @@ function FormTokenField(props) { } return true; // PreventDefault. } - function handleCommaKey() { if (inputHasValidValue()) { addNewToken(incompleteTokenValue); } return true; // PreventDefault. } - function moveInputToIndex(index) { setInputOffsetFromEnd(value.length - Math.max(index, -1) - 1); } @@ -66082,9 +60527,9 @@ function FormTokenField(props) { const status = typeof token !== 'string' ? token.status : undefined; const termPosition = index + 1; const termsCount = tokens.length; - return (0,external_wp_element_namespaceObject.createElement)(flex_item_component, { + return (0,external_React_.createElement)(flex_item_component, { key: 'token-' + _value - }, (0,external_wp_element_namespaceObject.createElement)(Token, { + }, (0,external_React_.createElement)(Token, { value: _value, status: status, title: typeof token !== 'string' ? token.title : undefined, @@ -66112,7 +60557,7 @@ function FormTokenField(props) { isExpanded, selectedSuggestionIndex }; - return (0,external_wp_element_namespaceObject.createElement)(token_input, { + return (0,external_React_.createElement)(token_input, { ...inputProps, onChange: !(maxLength && value.length >= maxLength) ? onInputChangeHandler : undefined, ref: input @@ -66139,25 +60584,25 @@ function FormTokenField(props) { // input container intended accessible usability. // TODO: Refactor click detection to use blur to stop propagation. /* eslint-disable jsx-a11y/no-static-element-interactions */ - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { ...tokenFieldProps - }, (0,external_wp_element_namespaceObject.createElement)(StyledLabel, { + }, (0,external_React_.createElement)(StyledLabel, { htmlFor: `components-form-token-input-${instanceId}`, className: "components-form-token-field__label" - }, label), (0,external_wp_element_namespaceObject.createElement)("div", { + }, label), (0,external_React_.createElement)("div", { ref: tokensAndInput, className: classes, tabIndex: -1, onMouseDown: onContainerTouched, onTouchStart: onContainerTouched - }, (0,external_wp_element_namespaceObject.createElement)(TokensAndInputWrapperFlex, { + }, (0,external_React_.createElement)(TokensAndInputWrapperFlex, { justify: "flex-start", align: "center", gap: 1, wrap: true, __next40pxDefaultSize: __next40pxDefaultSize, hasTokens: !!value.length - }, renderTokensAndInput()), isExpanded && (0,external_wp_element_namespaceObject.createElement)(suggestions_list, { + }, renderTokensAndInput()), isExpanded && (0,external_React_.createElement)(suggestions_list, { instanceId: instanceId, match: saveTransform(incompleteTokenValue), displayTransform: displayTransform, @@ -66167,17 +60612,16 @@ function FormTokenField(props) { onHover: onSuggestionHovered, onSelect: onSuggestionSelected, __experimentalRenderItem: __experimentalRenderItem - })), !__nextHasNoMarginBottom && (0,external_wp_element_namespaceObject.createElement)(spacer_component, { + })), !__nextHasNoMarginBottom && (0,external_React_.createElement)(spacer_component, { marginBottom: 2 - }), __experimentalShowHowTo && (0,external_wp_element_namespaceObject.createElement)(StyledHelp, { + }), __experimentalShowHowTo && (0,external_React_.createElement)(StyledHelp, { id: `components-form-token-suggestions-howto-${instanceId}`, className: "components-form-token-field__help", __nextHasNoMarginBottom: __nextHasNoMarginBottom }, tokenizeOnSpace ? (0,external_wp_i18n_namespaceObject.__)('Separate with commas, spaces, or the Enter key.') : (0,external_wp_i18n_namespaceObject.__)('Separate with commas or the Enter key.'))); /* eslint-enable jsx-a11y/no-static-element-interactions */ } - -/* harmony default export */ var form_token_field = (FormTokenField); +/* harmony default export */ const form_token_field = (FormTokenField); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/guide/icons.js @@ -66185,12 +60629,12 @@ function FormTokenField(props) { * WordPress dependencies */ -const PageControlIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const PageControlIcon = () => (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { width: "8", height: "8", fill: "none", xmlns: "http://www.w3.org/2000/svg" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Circle, { +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Circle, { cx: "4", cy: "4", r: "4" @@ -66213,19 +60657,19 @@ function PageControl({ numberOfPages, setCurrentPage }) { - return (0,external_wp_element_namespaceObject.createElement)("ul", { + return (0,external_React_.createElement)("ul", { className: "components-guide__page-control", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Guide controls') }, Array.from({ length: numberOfPages - }).map((_, page) => (0,external_wp_element_namespaceObject.createElement)("li", { + }).map((_, page) => (0,external_React_.createElement)("li", { key: page // Set aria-current="step" on the active page, see https://www.w3.org/TR/wai-aria-1.1/#aria-current , "aria-current": page === currentPage ? 'step' : undefined - }, (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }, (0,external_React_.createElement)(build_module_button, { key: page, - icon: (0,external_wp_element_namespaceObject.createElement)(PageControlIcon, null), + icon: (0,external_React_.createElement)(PageControlIcon, null), "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: current page number 2: total number of pages */ (0,external_wp_i18n_namespaceObject.__)('Page %1$d of %2$d'), page + 1, numberOfPages), onClick: () => setCurrentPage(page) @@ -66330,7 +60774,7 @@ function Guide({ if (pages.length === 0) { return null; } - return (0,external_wp_element_namespaceObject.createElement)(modal, { + return (0,external_React_.createElement)(modal, { className: classnames_default()('components-guide', className), contentLabel: contentLabel, isDismissible: pages.length > 1, @@ -66347,31 +60791,31 @@ function Guide({ } }, ref: ref - }, (0,external_wp_element_namespaceObject.createElement)("div", { + }, (0,external_React_.createElement)("div", { className: "components-guide__container" - }, (0,external_wp_element_namespaceObject.createElement)("div", { + }, (0,external_React_.createElement)("div", { className: "components-guide__page" - }, pages[currentPage].image, pages.length > 1 && (0,external_wp_element_namespaceObject.createElement)(PageControl, { + }, pages[currentPage].image, pages.length > 1 && (0,external_React_.createElement)(PageControl, { currentPage: currentPage, numberOfPages: pages.length, setCurrentPage: setCurrentPage - }), pages[currentPage].content), (0,external_wp_element_namespaceObject.createElement)("div", { + }), pages[currentPage].content), (0,external_React_.createElement)("div", { className: "components-guide__footer" - }, canGoBack && (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }, canGoBack && (0,external_React_.createElement)(build_module_button, { className: "components-guide__back-button", variant: "tertiary", onClick: goBack - }, (0,external_wp_i18n_namespaceObject.__)('Previous')), canGoForward && (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }, (0,external_wp_i18n_namespaceObject.__)('Previous')), canGoForward && (0,external_React_.createElement)(build_module_button, { className: "components-guide__forward-button", variant: "primary", onClick: goForward - }, (0,external_wp_i18n_namespaceObject.__)('Next')), !canGoForward && (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }, (0,external_wp_i18n_namespaceObject.__)('Next')), !canGoForward && (0,external_React_.createElement)(build_module_button, { className: "components-guide__finish-button", variant: "primary", onClick: onFinish }, finishButtonText)))); } -/* harmony default export */ var guide = (Guide); +/* harmony default export */ const guide = (Guide); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/guide/page.js @@ -66392,7 +60836,7 @@ function GuidePage(props) { alternative: 'the `pages` prop in <Guide>' }); }, []); - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { ...props }); } @@ -66425,7 +60869,7 @@ function UnforwardedIconButton({ alternative: 'wp.components.Button', version: '6.2' }); - return (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + return (0,external_React_.createElement)(build_module_button, { ...props, ref: ref, tooltipPosition: labelPosition, @@ -66434,7 +60878,7 @@ function UnforwardedIconButton({ label: tooltip || label }); } -/* harmony default export */ var deprecated = ((0,external_wp_element_namespaceObject.forwardRef)(UnforwardedIconButton)); +/* harmony default export */ const deprecated = ((0,external_wp_element_namespaceObject.forwardRef)(UnforwardedIconButton)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/item-group/item/hook.js /** @@ -66454,7 +60898,7 @@ function UnforwardedIconButton({ -function hook_useItem(props) { +function useItem(props) { const { as: asProp, className, @@ -66500,11 +60944,11 @@ function UnconnectedItem(props, forwardedRef) { role, wrapperClassName, ...otherProps - } = hook_useItem(props); - return (0,external_wp_element_namespaceObject.createElement)("div", { + } = useItem(props); + return (0,external_React_.createElement)("div", { role: role, className: wrapperClassName - }, (0,external_wp_element_namespaceObject.createElement)(component, { + }, (0,external_React_.createElement)(component, { ...otherProps, ref: forwardedRef })); @@ -66532,7 +60976,7 @@ function UnconnectedItem(props, forwardedRef) { * ``` */ const component_Item = contextConnect(UnconnectedItem, 'Item'); -/* harmony default export */ var item_component = (component_Item); +/* harmony default export */ const item_component = (component_Item); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/input-prefix-wrapper.js @@ -66547,7 +60991,7 @@ const component_Item = contextConnect(UnconnectedItem, 'Item'); function UnconnectedInputControlPrefixWrapper(props, forwardedRef) { const derivedProps = useContextSystem(props, 'InputControlPrefixWrapper'); - return (0,external_wp_element_namespaceObject.createElement)(spacer_component, { + return (0,external_React_.createElement)(spacer_component, { marginBottom: 0, ...derivedProps, ref: forwardedRef @@ -66570,7 +61014,7 @@ function UnconnectedInputControlPrefixWrapper(props, forwardedRef) { * ``` */ const InputControlPrefixWrapper = contextConnect(UnconnectedInputControlPrefixWrapper, 'InputControlPrefixWrapper'); -/* harmony default export */ var input_prefix_wrapper = (InputControlPrefixWrapper); +/* harmony default export */ const input_prefix_wrapper = (InputControlPrefixWrapper); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/keyboard-shortcuts/index.js @@ -66636,7 +61080,7 @@ function KeyboardShortcuts({ eventName }) { const target = (0,external_wp_element_namespaceObject.useRef)(null); - const element = Object.entries(shortcuts !== null && shortcuts !== void 0 ? shortcuts : {}).map(([shortcut, callback]) => (0,external_wp_element_namespaceObject.createElement)(KeyboardShortcut, { + const element = Object.entries(shortcuts !== null && shortcuts !== void 0 ? shortcuts : {}).map(([shortcut, callback]) => (0,external_React_.createElement)(KeyboardShortcut, { key: shortcut, shortcut: shortcut, callback: callback, @@ -66648,13 +61092,13 @@ function KeyboardShortcuts({ // Render as non-visual if there are no children pressed. Keyboard // events will be bound to the document instead. if (!external_wp_element_namespaceObject.Children.count(children)) { - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, element); + return (0,external_React_.createElement)(external_React_.Fragment, null, element); } - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { ref: target }, element, children); } -/* harmony default export */ var keyboard_shortcuts = (KeyboardShortcuts); +/* harmony default export */ const keyboard_shortcuts = (KeyboardShortcuts); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/menu-group/index.js @@ -66703,18 +61147,18 @@ function MenuGroup(props) { const classNames = classnames_default()(className, 'components-menu-group', { 'has-hidden-separator': hideSeparator }); - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { className: classNames - }, label && (0,external_wp_element_namespaceObject.createElement)("div", { + }, label && (0,external_React_.createElement)("div", { className: "components-menu-group__label", id: labelId, "aria-hidden": "true" - }, label), (0,external_wp_element_namespaceObject.createElement)("div", { + }, label), (0,external_React_.createElement)("div", { role: "group", "aria-labelledby": label ? labelId : undefined }, children)); } -/* harmony default export */ var menu_group = (MenuGroup); +/* harmony default export */ const menu_group = (MenuGroup); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/menu-item/index.js @@ -66750,11 +61194,11 @@ function UnforwardedMenuItem(props, ref) { } = props; className = classnames_default()('components-menu-item__button', className); if (info) { - children = (0,external_wp_element_namespaceObject.createElement)("span", { + children = (0,external_React_.createElement)("span", { className: "components-menu-item__info-wrapper" - }, (0,external_wp_element_namespaceObject.createElement)("span", { + }, (0,external_React_.createElement)("span", { className: "components-menu-item__item" - }, children), (0,external_wp_element_namespaceObject.createElement)("span", { + }, children), (0,external_React_.createElement)("span", { className: "components-menu-item__info" }, info)); } @@ -66765,7 +61209,7 @@ function UnforwardedMenuItem(props, ref) { }) }); } - return (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + return (0,external_React_.createElement)(build_module_button, { ref: ref // Make sure aria-checked matches spec https://www.w3.org/TR/wai-aria-1.1/#aria-checked , @@ -66774,12 +61218,12 @@ function UnforwardedMenuItem(props, ref) { icon: iconPosition === 'left' ? icon : undefined, className: className, ...buttonProps - }, (0,external_wp_element_namespaceObject.createElement)("span", { + }, (0,external_React_.createElement)("span", { className: "components-menu-item__item" - }, children), !suffix && (0,external_wp_element_namespaceObject.createElement)(build_module_shortcut, { + }, children), !suffix && (0,external_React_.createElement)(build_module_shortcut, { className: "components-menu-item__shortcut", shortcut: shortcut - }), !suffix && icon && iconPosition === 'right' && (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { + }), !suffix && icon && iconPosition === 'right' && (0,external_React_.createElement)(build_module_icon, { icon: icon }), suffix); } @@ -66808,7 +61252,7 @@ function UnforwardedMenuItem(props, ref) { * ``` */ const MenuItem = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedMenuItem); -/* harmony default export */ var menu_item = (MenuItem); +/* harmony default export */ const menu_item = (MenuItem); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/menu-items-choice/index.js @@ -66862,9 +61306,9 @@ function MenuItemsChoice({ onSelect, value }) { - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, choices.map(item => { + return (0,external_React_.createElement)(external_React_.Fragment, null, choices.map(item => { const isSelected = value === item.value; - return (0,external_wp_element_namespaceObject.createElement)(menu_item, { + return (0,external_React_.createElement)(menu_item, { key: item.value, role: "menuitemradio", disabled: item.disabled, @@ -66884,7 +61328,7 @@ function MenuItemsChoice({ }, item.label); })); } -/* harmony default export */ var menu_items_choice = (MenuItemsChoice); +/* harmony default export */ const menu_items_choice = (MenuItemsChoice); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigable-container/tabbable.js @@ -66930,7 +61374,7 @@ function UnforwardedTabbableContainer({ } return undefined; }; - return (0,external_wp_element_namespaceObject.createElement)(container, { + return (0,external_React_.createElement)(container, { ref: ref, stopNavigationEvents: true, onlyBrowserTabstops: true, @@ -66974,7 +61418,7 @@ function UnforwardedTabbableContainer({ * ``` */ const TabbableContainer = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTabbableContainer); -/* harmony default export */ var tabbable = (TabbableContainer); +/* harmony default export */ const tabbable = (TabbableContainer); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/constants.js const ROOT_MENU = 'root'; @@ -67013,134 +61457,6 @@ const NavigationContext = (0,external_wp_element_namespaceObject.createContext)( }); const useNavigationContext = () => (0,external_wp_element_namespaceObject.useContext)(NavigationContext); -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/search.js - -/** - * WordPress dependencies - */ - -const search = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { - d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" -})); -/* harmony default export */ var library_search = (search); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/search-control/index.js - -/** - * External dependencies - */ - - -/** - * WordPress dependencies - */ - - - - - -/** - * Internal dependencies - */ - - -function UnforwardedSearchControl({ - __nextHasNoMarginBottom, - __next40pxDefaultSize = false, - className, - onChange, - onKeyDown, - value, - label, - placeholder = (0,external_wp_i18n_namespaceObject.__)('Search'), - hideLabelFromVision = true, - help, - onClose, - size = 'default', - ...restProps -}, forwardedRef) { - const searchRef = (0,external_wp_element_namespaceObject.useRef)(); - const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(SearchControl); - const id = `components-search-control-${instanceId}`; - const renderRightButton = () => { - if (onClose) { - return (0,external_wp_element_namespaceObject.createElement)(build_module_button, { - __next40pxDefaultSize: __next40pxDefaultSize, - icon: close_small, - label: (0,external_wp_i18n_namespaceObject.__)('Close search'), - onClick: onClose, - size: size - }); - } - if (!!value) { - return (0,external_wp_element_namespaceObject.createElement)(build_module_button, { - __next40pxDefaultSize: __next40pxDefaultSize, - icon: close_small, - label: (0,external_wp_i18n_namespaceObject.__)('Reset search'), - onClick: () => { - onChange(''); - searchRef.current?.focus(); - }, - size: size - }); - } - return (0,external_wp_element_namespaceObject.createElement)(icons_build_module_icon, { - icon: library_search - }); - }; - return (0,external_wp_element_namespaceObject.createElement)(base_control, { - __nextHasNoMarginBottom: __nextHasNoMarginBottom, - label: label, - id: id, - hideLabelFromVision: hideLabelFromVision, - help: help, - className: classnames_default()(className, 'components-search-control', { - 'is-next-40px-default-size': __next40pxDefaultSize, - 'is-size-compact': size === 'compact' - }) - }, (0,external_wp_element_namespaceObject.createElement)("div", { - className: "components-search-control__input-wrapper" - }, (0,external_wp_element_namespaceObject.createElement)("input", { - ...restProps, - ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([searchRef, forwardedRef]), - className: "components-search-control__input", - id: id, - type: "search", - placeholder: placeholder, - onChange: event => onChange(event.target.value), - onKeyDown: onKeyDown, - autoComplete: "off", - value: value || '' - }), (0,external_wp_element_namespaceObject.createElement)("div", { - className: "components-search-control__icon" - }, renderRightButton()))); -} - -/** - * SearchControl components let users display a search control. - * - * ```jsx - * import { SearchControl } from '@wordpress/components'; - * import { useState } from '@wordpress/element'; - * - * function MySearchControl( { className, setState } ) { - * const [ searchInput, setSearchInput ] = useState( '' ); - * - * return ( - * <SearchControl - * value={ searchInput } - * onChange={ setSearchInput } - * /> - * ); - * } - * ``` - */ -const SearchControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedSearchControl); -/* harmony default export */ var search_control = (SearchControl); - ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/styles/navigation-styles.js function navigation_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } @@ -67162,7 +61478,6 @@ function navigation_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have t - const NavigationUI = emotion_styled_base_browser_esm("div", true ? { target: "eeiismy11" } : 0)("width:100%;box-sizing:border-box;padding:0 ", space(4), ";overflow:hidden;" + ( true ? "" : 0)); @@ -67181,15 +61496,15 @@ const MenuTitleUI = emotion_styled_base_browser_esm("div", true ? { name: "1aubja5", styles: "overflow:hidden;width:100%" } : 0); -const MenuTitleActionsUI = emotion_styled_base_browser_esm("span", true ? { +const MenuTitleSearchControlWrapper = emotion_styled_base_browser_esm("div", true ? { target: "eeiismy7" -} : 0)("height:", space(6), ";.components-button.is-small{color:inherit;opacity:0.7;margin-right:", space(1), ";padding:0;&:active:not( :disabled ){background:none;opacity:1;color:inherit;}&:hover:not( :disabled ){box-shadow:none;opacity:1;color:inherit;}}" + ( true ? "" : 0)); -const MenuTitleSearchUI = /*#__PURE__*/emotion_styled_base_browser_esm(search_control, true ? { - target: "eeiismy6" } : 0)( true ? { - name: "za3n3e", - styles: "input[type='search'].components-search-control__input{margin:0;background:#303030;color:#fff;&:focus{background:#434343;color:#fff;}&::placeholder{color:rgba( 255, 255, 255, 0.6 );}}svg{fill:white;}.components-button.has-icon{padding:0;min-width:auto;}" + name: "rgorny", + styles: "margin:11px 0;padding:1px" } : 0); +const MenuTitleActionsUI = emotion_styled_base_browser_esm("span", true ? { + target: "eeiismy6" +} : 0)("height:", space(6), ";.components-button.is-small{color:inherit;opacity:0.7;margin-right:", space(1), ";padding:0;&:active:not( :disabled ){background:none;opacity:1;color:inherit;}&:hover:not( :disabled ){box-shadow:none;opacity:1;color:inherit;}}" + ( true ? "" : 0)); const GroupTitleUI = /*#__PURE__*/emotion_styled_base_browser_esm(heading_component, true ? { target: "eeiismy5" } : 0)("min-height:", space(12), ";align-items:center;color:inherit;display:flex;justify-content:space-between;margin-bottom:", space(2), ";padding:", () => (0,external_wp_i18n_namespaceObject.isRTL)() ? `${space(1)} ${space(4)} ${space(1)} ${space(2)}` : `${space(1)} ${space(2)} ${space(1)} ${space(4)}`, ";" + ( true ? "" : 0)); @@ -67448,18 +61763,18 @@ function Navigation({ type: 'slide-in', origin: slideOrigin }); - return (0,external_wp_element_namespaceObject.createElement)(NavigationUI, { + return (0,external_React_.createElement)(NavigationUI, { className: classes - }, (0,external_wp_element_namespaceObject.createElement)("div", { + }, (0,external_React_.createElement)("div", { key: menu, className: animateClassName ? classnames_default()({ [animateClassName]: isMounted.current && slideOrigin }) : undefined - }, (0,external_wp_element_namespaceObject.createElement)(NavigationContext.Provider, { + }, (0,external_React_.createElement)(NavigationContext.Provider, { value: context }, children))); } -/* harmony default export */ var navigation = (Navigation); +/* harmony default export */ const navigation = (Navigation); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right.js @@ -67467,13 +61782,13 @@ function Navigation({ * WordPress dependencies */ -const chevronRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const chevronRight = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" })); -/* harmony default export */ var chevron_right = (chevronRight); +/* harmony default export */ const chevron_right = (chevronRight); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-left.js @@ -67481,13 +61796,13 @@ const chevronRight = (0,external_wp_element_namespaceObject.createElement)(exter * WordPress dependencies */ -const chevronLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const chevronLeft = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" })); -/* harmony default export */ var chevron_left = (chevronLeft); +/* harmony default export */ const chevron_left = (chevronLeft); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/back-button/index.js @@ -67530,18 +61845,18 @@ function UnforwardedNavigationBackButton({ } }; const icon = (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left; - return (0,external_wp_element_namespaceObject.createElement)(MenuBackButtonUI, { + return (0,external_React_.createElement)(MenuBackButtonUI, { className: classes, href: href, variant: "tertiary", ref: ref, onClick: handleOnClick - }, (0,external_wp_element_namespaceObject.createElement)(icons_build_module_icon, { + }, (0,external_React_.createElement)(icons_build_module_icon, { icon: icon }), backButtonLabel || parentMenuTitle || (0,external_wp_i18n_namespaceObject.__)('Back')); } const NavigationBackButton = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedNavigationBackButton); -/* harmony default export */ var back_button = (NavigationBackButton); +/* harmony default export */ const back_button = (NavigationBackButton); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/group/context.js /** @@ -67594,26 +61909,26 @@ function NavigationGroup({ // Keep the children rendered to make sure invisible items are included in the navigation tree. if (!Object.values(items).some(item => item.group === groupId && item._isVisible)) { - return (0,external_wp_element_namespaceObject.createElement)(NavigationGroupContext.Provider, { + return (0,external_React_.createElement)(NavigationGroupContext.Provider, { value: context }, children); } const groupTitleId = `components-navigation__group-title-${groupId}`; const classes = classnames_default()('components-navigation__group', className); - return (0,external_wp_element_namespaceObject.createElement)(NavigationGroupContext.Provider, { + return (0,external_React_.createElement)(NavigationGroupContext.Provider, { value: context - }, (0,external_wp_element_namespaceObject.createElement)("li", { + }, (0,external_React_.createElement)("li", { className: classes - }, title && (0,external_wp_element_namespaceObject.createElement)(GroupTitleUI, { + }, title && (0,external_React_.createElement)(GroupTitleUI, { className: "components-navigation__group-title", id: groupTitleId, level: 3 - }, title), (0,external_wp_element_namespaceObject.createElement)("ul", { + }, title), (0,external_React_.createElement)("ul", { "aria-labelledby": groupTitleId, role: "group" }, children))); } -/* harmony default export */ var group = (NavigationGroup); +/* harmony default export */ const group = (NavigationGroup); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/item/base-content.js @@ -67626,10 +61941,10 @@ function NavigationItemBaseContent(props) { badge, title } = props; - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, title && (0,external_wp_element_namespaceObject.createElement)(ItemTitleUI, { + return (0,external_React_.createElement)(external_React_.Fragment, null, title && (0,external_React_.createElement)(ItemTitleUI, { className: "components-navigation__item-title", as: "span" - }, title), badge && (0,external_wp_element_namespaceObject.createElement)(ItemBadgeUI, { + }, title), badge && (0,external_React_.createElement)(ItemBadgeUI, { className: "components-navigation__item-badge" }, badge)); } @@ -67742,7 +62057,7 @@ function NavigationItemBase(props) { return null; } const classes = classnames_default()('components-navigation__item', className); - return (0,external_wp_element_namespaceObject.createElement)(ItemBaseUI, { + return (0,external_React_.createElement)(ItemBaseUI, { className: classes, ...restProps }, children); @@ -67821,21 +62136,21 @@ function NavigationItem(props) { 'aria-current': isActive ? 'page' : undefined, ...restProps }; - return (0,external_wp_element_namespaceObject.createElement)(NavigationItemBase, { + return (0,external_React_.createElement)(NavigationItemBase, { ...baseProps, className: classes - }, children || (0,external_wp_element_namespaceObject.createElement)(ItemUI, { + }, children || (0,external_React_.createElement)(ItemUI, { ...itemProps - }, icon && (0,external_wp_element_namespaceObject.createElement)(ItemIconUI, null, (0,external_wp_element_namespaceObject.createElement)(icons_build_module_icon, { + }, icon && (0,external_React_.createElement)(ItemIconUI, null, (0,external_React_.createElement)(icons_build_module_icon, { icon: icon - })), (0,external_wp_element_namespaceObject.createElement)(NavigationItemBaseContent, { + })), (0,external_React_.createElement)(NavigationItemBaseContent, { title: title, badge: badge - }), navigateToMenu && (0,external_wp_element_namespaceObject.createElement)(icons_build_module_icon, { + }), navigateToMenu && (0,external_React_.createElement)(icons_build_module_icon, { icon: navigationIcon }))); } -/* harmony default export */ var navigation_item = (NavigationItem); +/* harmony default export */ const navigation_item = (NavigationItem); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/menu/use-navigation-tree-menu.js /** @@ -67869,6 +62184,20 @@ const useNavigationTreeMenu = props => { }, []); }; +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/search.js + +/** + * WordPress dependencies + */ + +const search = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" +})); +/* harmony default export */ const library_search = (search); + ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-spoken-messages/index.js /** @@ -67877,7 +62206,7 @@ const useNavigationTreeMenu = props => { -/** @typedef {import('@wordpress/element').WPComponent} WPComponent */ +/** @typedef {import('react').ComponentType} ComponentType */ /** * A Higher Order Component used to be provide speak and debounced speak @@ -67885,16 +62214,164 @@ const useNavigationTreeMenu = props => { * * @see https://developer.wordpress.org/block-editor/packages/packages-a11y/#speak * - * @param {WPComponent} Component The component to be wrapped. + * @param {ComponentType} Component The component to be wrapped. * - * @return {WPComponent} The wrapped component. + * @return {ComponentType} The wrapped component. */ -/* harmony default export */ var with_spoken_messages = ((0,external_wp_compose_namespaceObject.createHigherOrderComponent)(Component => props => (0,external_wp_element_namespaceObject.createElement)(Component, { +/* harmony default export */ const with_spoken_messages = ((0,external_wp_compose_namespaceObject.createHigherOrderComponent)(Component => props => (0,external_React_.createElement)(Component, { ...props, speak: external_wp_a11y_namespaceObject.speak, debouncedSpeak: (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500) }), 'withSpokenMessages')); +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/search-control/styles.js + +/** + * External dependencies + */ + +/** + * Internal dependencies + */ + + + +const inlinePadding = ({ + size +}) => { + return space(size === 'compact' ? 1 : 2); +}; +const SuffixItemWrapper = emotion_styled_base_browser_esm("div", true ? { + target: "effl84m1" +} : 0)("display:flex;padding-inline-end:", inlinePadding, ";svg{fill:currentColor;}" + ( true ? "" : 0)); +const StyledInputControl = /*#__PURE__*/emotion_styled_base_browser_esm(input_control, true ? { + target: "effl84m0" +} : 0)("input[type='search']{&::-webkit-search-decoration,&::-webkit-search-cancel-button,&::-webkit-search-results-button,&::-webkit-search-results-decoration{-webkit-appearance:none;}}&:not( :focus-within ){--wp-components-color-background:", COLORS.theme.gray[100], ";}" + ( true ? "" : 0)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/search-control/index.js + +/** + * External dependencies + */ + + +/** + * WordPress dependencies + */ + + + + + +/** + * Internal dependencies + */ + + + +function SuffixItem({ + searchRef, + value, + onChange, + onClose +}) { + if (!onClose && !value) { + return (0,external_React_.createElement)(icons_build_module_icon, { + icon: library_search + }); + } + const onReset = () => { + onChange(''); + searchRef.current?.focus(); + }; + return (0,external_React_.createElement)(build_module_button, { + size: "small", + icon: close_small, + label: onClose ? (0,external_wp_i18n_namespaceObject.__)('Close search') : (0,external_wp_i18n_namespaceObject.__)('Reset search'), + onClick: onClose !== null && onClose !== void 0 ? onClose : onReset + }); +} +function UnforwardedSearchControl({ + __nextHasNoMarginBottom = false, + className, + onChange, + value, + label = (0,external_wp_i18n_namespaceObject.__)('Search'), + placeholder = (0,external_wp_i18n_namespaceObject.__)('Search'), + hideLabelFromVision = true, + onClose, + size = 'default', + ...restProps +}, forwardedRef) { + // @ts-expect-error The `disabled` prop is not yet supported in the SearchControl component. + // Work with the design team (@WordPress/gutenberg-design) if you need this feature. + delete restProps.disabled; + const searchRef = (0,external_wp_element_namespaceObject.useRef)(null); + const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(SearchControl, 'components-search-control'); + const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ + // Overrides the underlying BaseControl `__nextHasNoMarginBottom` via the context system + // to provide backwards compatibile margin for SearchControl. + // (In a standard InputControl, the BaseControl `__nextHasNoMarginBottom` is always set to true.) + BaseControl: { + _overrides: { + __nextHasNoMarginBottom + } + }, + // `isBorderless` is still experimental and not a public prop for InputControl yet. + InputBase: { + isBorderless: true + } + }), [__nextHasNoMarginBottom]); + return (0,external_React_.createElement)(ContextSystemProvider, { + value: contextValue + }, (0,external_React_.createElement)(StyledInputControl, { + __next40pxDefaultSize: true, + id: instanceId, + hideLabelFromVision: hideLabelFromVision, + label: label, + ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([searchRef, forwardedRef]), + type: "search", + size: size, + className: classnames_default()('components-search-control', className), + onChange: nextValue => onChange(nextValue !== null && nextValue !== void 0 ? nextValue : ''), + autoComplete: "off", + placeholder: placeholder, + value: value !== null && value !== void 0 ? value : '', + suffix: (0,external_React_.createElement)(SuffixItemWrapper, { + size: size + }, (0,external_React_.createElement)(SuffixItem, { + searchRef: searchRef, + value: value, + onChange: onChange, + onClose: onClose + })), + ...restProps + })); +} + +/** + * SearchControl components let users display a search control. + * + * ```jsx + * import { SearchControl } from '@wordpress/components'; + * import { useState } from '@wordpress/element'; + * + * function MySearchControl( { className, setState } ) { + * const [ searchInput, setSearchInput ] = useState( '' ); + * + * return ( + * <SearchControl + * __nextHasNoMarginBottom + * value={ searchInput } + * onChange={ setSearchInput } + * /> + * ); + * } + * ``` + */ +const SearchControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedSearchControl); +/* harmony default export */ const search_control = (SearchControl); + ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/menu/menu-title-search.js /** @@ -67911,6 +62388,7 @@ const useNavigationTreeMenu = props => { + function MenuTitleSearch({ debouncedSpeak, onCloseSearch, @@ -67962,10 +62440,8 @@ function MenuTitleSearch({ const inputId = `components-navigation__menu-title-search-${menu}`; const placeholder = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: placeholder for menu search box. %s: menu title */ (0,external_wp_i18n_namespaceObject.__)('Search %s'), title?.toLowerCase()).trim(); - return (0,external_wp_element_namespaceObject.createElement)("div", { - className: "components-navigation__menu-title-search" - }, (0,external_wp_element_namespaceObject.createElement)(MenuTitleSearchUI, { - autoComplete: "off", + return (0,external_React_.createElement)(MenuTitleSearchControlWrapper, null, (0,external_React_.createElement)(search_control, { + __nextHasNoMarginBottom: true, className: "components-navigation__menu-search-input", id: inputId, onChange: value => onSearch?.(value), @@ -67973,11 +62449,10 @@ function MenuTitleSearch({ placeholder: placeholder, onClose: onClose, ref: inputRef, - type: "search", value: search })); } -/* harmony default export */ var menu_title_search = (with_spoken_messages(MenuTitleSearch)); +/* harmony default export */ const menu_title_search = (with_spoken_messages(MenuTitleSearch)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/menu/menu-title.js @@ -68024,28 +62499,28 @@ function NavigationMenuTitle({ const menuTitleId = `components-navigation__menu-title-${menu}`; /* translators: search button label for menu search box. %s: menu title */ const searchButtonLabel = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Search in %s'), title); - return (0,external_wp_element_namespaceObject.createElement)(MenuTitleUI, { + return (0,external_React_.createElement)(MenuTitleUI, { className: "components-navigation__menu-title" - }, !isSearching && (0,external_wp_element_namespaceObject.createElement)(GroupTitleUI, { + }, !isSearching && (0,external_React_.createElement)(GroupTitleUI, { as: "h2", className: "components-navigation__menu-title-heading", level: 3 - }, (0,external_wp_element_namespaceObject.createElement)("span", { + }, (0,external_React_.createElement)("span", { id: menuTitleId - }, title), (hasSearch || titleAction) && (0,external_wp_element_namespaceObject.createElement)(MenuTitleActionsUI, null, titleAction, hasSearch && (0,external_wp_element_namespaceObject.createElement)(build_module_button, { - isSmall: true, + }, title), (hasSearch || titleAction) && (0,external_React_.createElement)(MenuTitleActionsUI, null, titleAction, hasSearch && (0,external_React_.createElement)(build_module_button, { + size: "small", variant: "tertiary", label: searchButtonLabel, onClick: () => setIsSearching(true), ref: searchButtonRef - }, (0,external_wp_element_namespaceObject.createElement)(icons_build_module_icon, { + }, (0,external_React_.createElement)(icons_build_module_icon, { icon: library_search - })))), isSearching && (0,external_wp_element_namespaceObject.createElement)("div", { + })))), isSearching && (0,external_React_.createElement)("div", { className: getAnimateClassName({ type: 'slide-in', origin: 'left' }) - }, (0,external_wp_element_namespaceObject.createElement)(menu_title_search, { + }, (0,external_React_.createElement)(menu_title_search, { onCloseSearch: onCloseSearch, onSearch: onSearch, search: search, @@ -68077,7 +62552,7 @@ function NavigationSearchNoResultsFound({ if (!search || !!resultsCount) { return null; } - return (0,external_wp_element_namespaceObject.createElement)(ItemBaseUI, null, (0,external_wp_element_namespaceObject.createElement)(ItemUI, null, (0,external_wp_i18n_namespaceObject.__)('No results found.'), " ")); + return (0,external_React_.createElement)(ItemBaseUI, null, (0,external_React_.createElement)(ItemUI, null, (0,external_wp_i18n_namespaceObject.__)('No results found.'), " ")); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/menu/index.js @@ -68131,7 +62606,7 @@ function NavigationMenu(props) { // Keep the children rendered to make sure invisible items are included in the navigation tree. if (activeMenu !== menu) { - return (0,external_wp_element_namespaceObject.createElement)(NavigationMenuContext.Provider, { + return (0,external_React_.createElement)(NavigationMenuContext.Provider, { value: context }, children); } @@ -68140,48 +62615,27 @@ function NavigationMenu(props) { const onSearch = isControlledSearch ? setControlledSearch : setUncontrolledSearch; const menuTitleId = `components-navigation__menu-title-${menu}`; const classes = classnames_default()('components-navigation__menu', className); - return (0,external_wp_element_namespaceObject.createElement)(NavigationMenuContext.Provider, { + return (0,external_React_.createElement)(NavigationMenuContext.Provider, { value: context - }, (0,external_wp_element_namespaceObject.createElement)(MenuUI, { + }, (0,external_React_.createElement)(MenuUI, { className: classes - }, (parentMenu || onBackButtonClick) && (0,external_wp_element_namespaceObject.createElement)(back_button, { + }, (parentMenu || onBackButtonClick) && (0,external_React_.createElement)(back_button, { backButtonLabel: backButtonLabel, parentMenu: parentMenu, onClick: onBackButtonClick - }), title && (0,external_wp_element_namespaceObject.createElement)(NavigationMenuTitle, { + }), title && (0,external_React_.createElement)(NavigationMenuTitle, { hasSearch: hasSearch, onSearch: onSearch, search: search, title: title, titleAction: titleAction - }), (0,external_wp_element_namespaceObject.createElement)(navigable_container_menu, null, (0,external_wp_element_namespaceObject.createElement)("ul", { + }), (0,external_React_.createElement)(navigable_container_menu, null, (0,external_React_.createElement)("ul", { "aria-labelledby": menuTitleId - }, children, search && !isSearchDebouncing && (0,external_wp_element_namespaceObject.createElement)(NavigationSearchNoResultsFound, { + }, children, search && !isSearchDebouncing && (0,external_React_.createElement)(NavigationSearchNoResultsFound, { search: search }))))); } -/* harmony default export */ var navigation_menu = (NavigationMenu); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigator/context.js -/** - * WordPress dependencies - */ - - -/** - * Internal dependencies - */ - -const initialContextValue = { - location: {}, - goTo: () => {}, - goBack: () => {}, - goToParent: () => {}, - addScreen: () => {}, - removeScreen: () => {}, - params: {} -}; -const NavigatorContext = (0,external_wp_element_namespaceObject.createContext)(initialContextValue); +/* harmony default export */ const navigation_menu = (NavigationMenu); ;// CONCATENATED MODULE: ./node_modules/path-to-regexp/dist.es2015/index.js /** @@ -68630,14 +63084,75 @@ function findParent(path, screens) { return parentPath; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigator/navigator-provider/component.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigator/context.js +/** + * WordPress dependencies + */ + -function component_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } +/** + * Internal dependencies + */ + +const context_initialContextValue = { + location: {}, + goTo: () => {}, + goBack: () => {}, + goToParent: () => {}, + addScreen: () => {}, + removeScreen: () => {}, + params: {} +}; +const NavigatorContext = (0,external_wp_element_namespaceObject.createContext)(context_initialContextValue); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigator/styles.js +function navigator_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /** * External dependencies */ +const navigatorProviderWrapper = true ? { + name: "xpkswc", + styles: "overflow-x:hidden;contain:content" +} : 0; +const fadeInFromRight = emotion_react_browser_esm_keyframes({ + '0%': { + opacity: 0, + transform: `translateX( 50px )` + }, + '100%': { + opacity: 1, + transform: 'none' + } +}); +const fadeInFromLeft = emotion_react_browser_esm_keyframes({ + '0%': { + opacity: 0, + transform: `translateX( -50px )` + }, + '100%': { + opacity: 1, + transform: 'none' + } +}); +const navigatorScreenAnimation = ({ + isInitial, + isBack, + isRTL +}) => { + if (isInitial && !isBack) { + return; + } + const animationName = isRTL && isBack || !isRTL && !isBack ? fadeInFromRight : fadeInFromLeft; + return /*#__PURE__*/emotion_react_browser_esm_css("animation-duration:0.14s;animation-timing-function:ease-in-out;will-change:transform,opacity;animation-name:", animationName, ";@media ( prefers-reduced-motion ){animation-duration:0s;}" + ( true ? "" : 0), true ? "" : 0); +}; +const navigatorScreen = props => /*#__PURE__*/emotion_react_browser_esm_css("overflow-x:auto;max-height:100%;", navigatorScreenAnimation(props), ";" + ( true ? "" : 0), true ? "" : 0); +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigator/navigator-provider/component.js + +/** + * External dependencies + */ /** * WordPress dependencies @@ -68654,6 +63169,7 @@ function component_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to + const MAX_HISTORY_LENGTH = 50; function screensReducer(state = [], action) { switch (action.type) { @@ -68664,10 +63180,6 @@ function screensReducer(state = [], action) { } return state; } -var component_ref = true ? { - name: "15bx5k", - styles: "overflow-x:hidden" -} : 0; function UnconnectedNavigatorProvider(props, forwardedRef) { const { initialPath, @@ -68794,14 +63306,12 @@ function UnconnectedNavigatorProvider(props, forwardedRef) { removeScreen }), [locationHistory, matchedPath, goTo, goBack, goToParent, addScreen, removeScreen]); const cx = useCx(); - const classes = (0,external_wp_element_namespaceObject.useMemo)( - // Prevents horizontal overflow while animating screen transitions. - () => cx(component_ref, className), [className, cx]); - return (0,external_wp_element_namespaceObject.createElement)(component, { + const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(navigatorProviderWrapper, className), [className, cx]); + return (0,external_React_.createElement)(component, { ref: forwardedRef, className: classes, ...otherProps - }, (0,external_wp_element_namespaceObject.createElement)(NavigatorContext.Provider, { + }, (0,external_React_.createElement)(NavigatorContext.Provider, { value: navigatorContextValue }, children)); } @@ -68840,23 +63350,16 @@ function UnconnectedNavigatorProvider(props, forwardedRef) { * ``` */ const NavigatorProvider = contextConnect(UnconnectedNavigatorProvider, 'NavigatorProvider'); -/* harmony default export */ var navigator_provider_component = (NavigatorProvider); +/* harmony default export */ const navigator_provider_component = (NavigatorProvider); ;// CONCATENATED MODULE: external ["wp","escapeHtml"] -var external_wp_escapeHtml_namespaceObject = window["wp"]["escapeHtml"]; +const external_wp_escapeHtml_namespaceObject = window["wp"]["escapeHtml"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigator/navigator-screen/component.js -function navigator_screen_component_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /** * External dependencies */ -// eslint-disable-next-line no-restricted-imports - -// eslint-disable-next-line no-restricted-imports - - - /** * WordPress dependencies */ @@ -68874,17 +63377,7 @@ function navigator_screen_component_EMOTION_STRINGIFIED_CSS_ERROR_() { return "Y -const animationEnterDelay = 0; -const animationEnterDuration = 0.14; -const animationExitDuration = 0.14; -const animationExitDelay = 0; -// Props specific to `framer-motion` can't be currently passed to `NavigatorScreen`, -// as some of them would overlap with HTML props (e.g. `onAnimationStart`, ...) -var navigator_screen_component_ref = true ? { - name: "14x3t6z", - styles: "overflow-x:auto;max-height:100%" -} : 0; function UnconnectedNavigatorScreen(props, forwardedRef) { const screenId = (0,external_wp_element_namespaceObject.useId)(); const { @@ -68893,7 +63386,6 @@ function UnconnectedNavigatorScreen(props, forwardedRef) { path, ...otherProps } = useContextSystem(props, 'NavigatorScreen'); - const prefersReducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); const { location, match, @@ -68910,8 +63402,17 @@ function UnconnectedNavigatorScreen(props, forwardedRef) { addScreen(screen); return () => removeScreen(screen); }, [screenId, path, addScreen, removeScreen]); + const isRTL = (0,external_wp_i18n_namespaceObject.isRTL)(); + const { + isInitial, + isBack + } = location; const cx = useCx(); - const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(navigator_screen_component_ref, className), [className, cx]); + const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(navigatorScreen({ + isInitial, + isBack, + isRTL + }), className), [className, cx, isInitial, isBack, isRTL]); const locationRef = (0,external_wp_element_namespaceObject.useRef)(location); (0,external_wp_element_namespaceObject.useEffect)(() => { locationRef.current = location; @@ -68954,51 +63455,11 @@ function UnconnectedNavigatorScreen(props, forwardedRef) { elementToFocus.focus(); }, [isInitialLocation, isMatch, location.isBack, location.focusTargetSelector, location.skipFocus]); const mergedWrapperRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, wrapperRef]); - if (!isMatch) { - return null; - } - if (prefersReducedMotion) { - return (0,external_wp_element_namespaceObject.createElement)(component, { - ref: mergedWrapperRef, - className: classes, - ...otherProps - }, children); - } - const animate = { - opacity: 1, - transition: { - delay: animationEnterDelay, - duration: animationEnterDuration, - ease: 'easeInOut' - }, - x: 0 - }; - // Disable the initial animation if the screen is the very first screen to be - // rendered within the current `NavigatorProvider`. - const initial = location.isInitial && !location.isBack ? false : { - opacity: 0, - x: (0,external_wp_i18n_namespaceObject.isRTL)() && location.isBack || !(0,external_wp_i18n_namespaceObject.isRTL)() && !location.isBack ? 50 : -50 - }; - const exit = { - delay: animationExitDelay, - opacity: 0, - x: !(0,external_wp_i18n_namespaceObject.isRTL)() && location.isBack || (0,external_wp_i18n_namespaceObject.isRTL)() && !location.isBack ? 50 : -50, - transition: { - duration: animationExitDuration, - ease: 'easeInOut' - } - }; - const animatedProps = { - animate, - exit, - initial - }; - return (0,external_wp_element_namespaceObject.createElement)(motion.div, { + return isMatch ? (0,external_React_.createElement)(component, { ref: mergedWrapperRef, className: classes, - ...otherProps, - ...animatedProps - }, children); + ...otherProps + }, children) : null; } /** @@ -69036,7 +63497,7 @@ function UnconnectedNavigatorScreen(props, forwardedRef) { * ``` */ const NavigatorScreen = contextConnect(UnconnectedNavigatorScreen, 'NavigatorScreen'); -/* harmony default export */ var navigator_screen_component = (NavigatorScreen); +/* harmony default export */ const navigator_screen_component = (NavigatorScreen); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigator/use-navigator.js /** @@ -69067,7 +63528,7 @@ function useNavigator() { params }; } -/* harmony default export */ var use_navigator = (useNavigator); +/* harmony default export */ const use_navigator = (useNavigator); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigator/navigator-button/hook.js /** @@ -69126,7 +63587,7 @@ function useNavigatorButton(props) { function UnconnectedNavigatorButton(props, forwardedRef) { const navigatorButtonProps = useNavigatorButton(props); - return (0,external_wp_element_namespaceObject.createElement)(component, { + return (0,external_React_.createElement)(component, { ref: forwardedRef, ...navigatorButtonProps }); @@ -69166,7 +63627,7 @@ function UnconnectedNavigatorButton(props, forwardedRef) { * ``` */ const NavigatorButton = contextConnect(UnconnectedNavigatorButton, 'NavigatorButton'); -/* harmony default export */ var navigator_button_component = (NavigatorButton); +/* harmony default export */ const navigator_button_component = (NavigatorButton); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigator/navigator-back-button/hook.js /** @@ -69223,7 +63684,7 @@ function useNavigatorBackButton(props) { function UnconnectedNavigatorBackButton(props, forwardedRef) { const navigatorBackButtonProps = useNavigatorBackButton(props); - return (0,external_wp_element_namespaceObject.createElement)(component, { + return (0,external_React_.createElement)(component, { ref: forwardedRef, ...navigatorBackButtonProps }); @@ -69264,7 +63725,7 @@ function UnconnectedNavigatorBackButton(props, forwardedRef) { * ``` */ const NavigatorBackButton = contextConnect(UnconnectedNavigatorBackButton, 'NavigatorBackButton'); -/* harmony default export */ var navigator_back_button_component = (NavigatorBackButton); +/* harmony default export */ const navigator_back_button_component = (NavigatorBackButton); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigator/navigator-to-parent-button/component.js @@ -69284,7 +63745,7 @@ function UnconnectedNavigatorToParentButton(props, forwardedRef) { ...props, goToParent: true }); - return (0,external_wp_element_namespaceObject.createElement)(component, { + return (0,external_React_.createElement)(component, { ref: forwardedRef, ...navigatorToParentButtonProps }); @@ -69325,7 +63786,7 @@ function UnconnectedNavigatorToParentButton(props, forwardedRef) { * ``` */ const NavigatorToParentButton = contextConnect(UnconnectedNavigatorToParentButton, 'NavigatorToParentButton'); -/* harmony default export */ var navigator_to_parent_button_component = (NavigatorToParentButton); +/* harmony default export */ const navigator_to_parent_button_component = (NavigatorToParentButton); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/notice/index.js @@ -69417,17 +63878,17 @@ function Notice({ 'is-dismissible': isDismissible }); if (__unstableHTML && typeof children === 'string') { - children = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, children); + children = (0,external_React_.createElement)(external_wp_element_namespaceObject.RawHTML, null, children); } const onDismissNotice = () => { onDismiss(); onRemove(); }; - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { className: classes - }, (0,external_wp_element_namespaceObject.createElement)(visually_hidden_component, null, getStatusLabel(status)), (0,external_wp_element_namespaceObject.createElement)("div", { + }, (0,external_React_.createElement)(visually_hidden_component, null, getStatusLabel(status)), (0,external_React_.createElement)("div", { className: "components-notice__content" - }, children, (0,external_wp_element_namespaceObject.createElement)("div", { + }, children, (0,external_React_.createElement)("div", { className: "components-notice__actions" }, actions.map(({ className: buttonCustomClasses, @@ -69445,21 +63906,21 @@ function Notice({ if (typeof computedVariant === 'undefined' && isPrimary) { computedVariant = 'primary'; } - return (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + return (0,external_React_.createElement)(build_module_button, { key: index, href: url, variant: computedVariant, onClick: url ? undefined : onClick, className: classnames_default()('components-notice__action', buttonCustomClasses) }, label); - }))), isDismissible && (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }))), isDismissible && (0,external_React_.createElement)(build_module_button, { className: "components-notice__dismiss", icon: library_close, label: (0,external_wp_i18n_namespaceObject.__)('Close'), onClick: onDismissNotice })); } -/* harmony default export */ var build_module_notice = (Notice); +/* harmony default export */ const build_module_notice = (Notice); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/notice/list.js @@ -69508,21 +63969,21 @@ function NoticeList({ }) { const removeNotice = id => () => onRemove(id); className = classnames_default()('components-notice-list', className); - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { className: className }, children, [...notices].reverse().map(notice => { const { content, ...restNotice } = notice; - return (0,external_wp_element_namespaceObject.createElement)(build_module_notice, { + return (0,external_React_.createElement)(build_module_notice, { ...restNotice, key: notice.id, onRemove: removeNotice(notice.id) }, notice.content); })); } -/* harmony default export */ var list = (NoticeList); +/* harmony default export */ const list = (NoticeList); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/panel/header.js @@ -69539,11 +64000,11 @@ function PanelHeader({ label, children }) { - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { className: "components-panel__header" - }, label && (0,external_wp_element_namespaceObject.createElement)("h2", null, label), children); + }, label && (0,external_React_.createElement)("h2", null, label), children); } -/* harmony default export */ var panel_header = (PanelHeader); +/* harmony default export */ const panel_header = (PanelHeader); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/panel/index.js @@ -69567,10 +64028,10 @@ function UnforwardedPanel({ children }, ref) { const classNames = classnames_default()(className, 'components-panel'); - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { className: classNames, ref: ref - }, header && (0,external_wp_element_namespaceObject.createElement)(panel_header, { + }, header && (0,external_React_.createElement)(panel_header, { label: header }), children); } @@ -69592,7 +64053,7 @@ function UnforwardedPanel({ * ``` */ const Panel = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedPanel); -/* harmony default export */ var panel = (Panel); +/* harmony default export */ const panel = (Panel); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-up.js @@ -69600,13 +64061,13 @@ const Panel = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedPane * WordPress dependencies */ -const chevronUp = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const chevronUp = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" })); -/* harmony default export */ var chevron_up = (chevronUp); +/* harmony default export */ const chevron_up = (chevronUp); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/panel/body.js @@ -69679,10 +64140,10 @@ function UnforwardedPanelBody(props, ref) { const classes = classnames_default()('components-panel__body', className, { 'is-opened': isOpened }); - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { className: classes, ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([nodeRef, ref]) - }, (0,external_wp_element_namespaceObject.createElement)(PanelBodyTitle, { + }, (0,external_React_.createElement)(PanelBodyTitle, { icon: icon, isOpened: Boolean(isOpened), onClick: handleOnToggle, @@ -69699,26 +64160,26 @@ const PanelBodyTitle = (0,external_wp_element_namespaceObject.forwardRef)(({ ...props }, ref) => { if (!title) return null; - return (0,external_wp_element_namespaceObject.createElement)("h2", { + return (0,external_React_.createElement)("h2", { className: "components-panel__body-title" - }, (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }, (0,external_React_.createElement)(build_module_button, { className: "components-panel__body-toggle", "aria-expanded": isOpened, ref: ref, ...props - }, (0,external_wp_element_namespaceObject.createElement)("span", { + }, (0,external_React_.createElement)("span", { "aria-hidden": "true" - }, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { + }, (0,external_React_.createElement)(build_module_icon, { className: "components-panel__arrow", icon: isOpened ? chevron_up : chevron_down - })), title, icon && (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { + })), title, icon && (0,external_React_.createElement)(build_module_icon, { icon: icon, className: "components-panel__icon", size: 20 }))); }); const PanelBody = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedPanelBody); -/* harmony default export */ var body = (PanelBody); +/* harmony default export */ const body = (PanelBody); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/panel/row.js @@ -69735,7 +64196,7 @@ function UnforwardedPanelRow({ className, children }, ref) { - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { className: classnames_default()('components-panel__row', className), ref: ref }, children); @@ -69746,7 +64207,7 @@ function UnforwardedPanelRow({ * It is a flex container with a top margin for spacing. */ const PanelRow = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedPanelRow); -/* harmony default export */ var row = (PanelRow); +/* harmony default export */ const row = (PanelRow); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/placeholder/index.js @@ -69767,13 +64228,13 @@ const PanelRow = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedP * Internal dependencies */ -const PlaceholderIllustration = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const PlaceholderIllustration = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { className: "components-placeholder__illustration", fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 60 60", preserveAspectRatio: "none" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { vectorEffect: "non-scaling-stroke", d: "M60 60 0 0" })); @@ -69824,22 +64285,22 @@ function Placeholder(props) { (0,external_wp_a11y_namespaceObject.speak)(instructions); } }, [instructions]); - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { ...additionalProps, className: classes - }, withIllustration ? PlaceholderIllustration : null, resizeListener, notices, preview && (0,external_wp_element_namespaceObject.createElement)("div", { + }, withIllustration ? PlaceholderIllustration : null, resizeListener, notices, preview && (0,external_React_.createElement)("div", { className: "components-placeholder__preview" - }, preview), (0,external_wp_element_namespaceObject.createElement)("div", { + }, preview), (0,external_React_.createElement)("div", { className: "components-placeholder__label" - }, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { + }, (0,external_React_.createElement)(build_module_icon, { icon: icon - }), label), !!instructions && (0,external_wp_element_namespaceObject.createElement)("div", { + }), label), !!instructions && (0,external_React_.createElement)("div", { className: "components-placeholder__instructions" - }, instructions), (0,external_wp_element_namespaceObject.createElement)("div", { + }, instructions), (0,external_React_.createElement)("div", { className: fieldsetClasses }, children)); } -/* harmony default export */ var placeholder = (Placeholder); +/* harmony default export */ const placeholder = (Placeholder); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/query-controls/terms.js /** @@ -69894,7 +64355,7 @@ function buildTermsTree(flatTerms) { } ;// CONCATENATED MODULE: external ["wp","htmlEntities"] -var external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; +const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-select/index.js /** @@ -69907,6 +64368,7 @@ var external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; * Internal dependencies */ + function getSelectOptions(tree, level = 0) { return tree.flatMap(treeNode => [{ value: treeNode.id, @@ -69962,29 +64424,30 @@ function getSelectOptions(tree, level = 0) { * ``` */ -function TreeSelect({ - label, - noOptionLabel, - onChange, - selectedId, - tree = [], - ...props -}) { +function TreeSelect(props) { + const { + label, + noOptionLabel, + onChange, + selectedId, + tree = [], + ...restProps + } = useDeprecated36pxDefaultSizeProp(props); const options = (0,external_wp_element_namespaceObject.useMemo)(() => { return [noOptionLabel && { value: '', label: noOptionLabel }, ...getSelectOptions(tree)].filter(option => !!option); }, [noOptionLabel, tree]); - return (0,external_wp_element_namespaceObject.createElement)(SelectControl, { + return (0,external_React_.createElement)(SelectControl, { label, options, onChange, value: selectedId, - ...props + ...restProps }); } -/* harmony default export */ var tree_select = (TreeSelect); +/* harmony default export */ const tree_select = (TreeSelect); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/query-controls/author-select.js @@ -69994,6 +64457,7 @@ function TreeSelect({ function AuthorSelect({ + __next40pxDefaultSize, label, noOptionLabel, authorList, @@ -70002,13 +64466,14 @@ function AuthorSelect({ }) { if (!authorList) return null; const termsTree = buildTermsTree(authorList); - return (0,external_wp_element_namespaceObject.createElement)(tree_select, { + return (0,external_React_.createElement)(tree_select, { label, noOptionLabel, onChange: onChangeProp, tree: termsTree, selectedId: selectedAuthorId !== undefined ? String(selectedAuthorId) : undefined, - __nextHasNoMarginBottom: true + __nextHasNoMarginBottom: true, + __next40pxDefaultSize: __next40pxDefaultSize }); } @@ -70025,6 +64490,7 @@ function AuthorSelect({ */ function CategorySelect({ + __next40pxDefaultSize, label, noOptionLabel, categoriesList, @@ -70035,14 +64501,15 @@ function CategorySelect({ const termsTree = (0,external_wp_element_namespaceObject.useMemo)(() => { return buildTermsTree(categoriesList); }, [categoriesList]); - return (0,external_wp_element_namespaceObject.createElement)(tree_select, { + return (0,external_React_.createElement)(tree_select, { label, noOptionLabel, onChange: onChangeProp, tree: termsTree, selectedId: selectedCategoryId !== undefined ? String(selectedCategoryId) : undefined, ...props, - __nextHasNoMarginBottom: true + __nextHasNoMarginBottom: true, + __next40pxDefaultSize: __next40pxDefaultSize }); } @@ -70098,6 +64565,7 @@ function isMultipleCategorySelection(props) { * ``` */ function QueryControls({ + __next40pxDefaultSize = false, authorList, selectedAuthorId, numberOfItems, @@ -70113,11 +64581,12 @@ function QueryControls({ // but instead are destructured inline where necessary. ...props }) { - return (0,external_wp_element_namespaceObject.createElement)(v_stack_component, { + return (0,external_React_.createElement)(v_stack_component, { spacing: "4", className: "components-query-controls" - }, [onOrderChange && onOrderByChange && (0,external_wp_element_namespaceObject.createElement)(select_control, { + }, [onOrderChange && onOrderByChange && (0,external_React_.createElement)(select_control, { __nextHasNoMarginBottom: true, + __next40pxDefaultSize: __next40pxDefaultSize, key: "query-controls-order-select", label: (0,external_wp_i18n_namespaceObject.__)('Order by'), value: `${orderBy}/${order}`, @@ -70128,11 +64597,11 @@ function QueryControls({ label: (0,external_wp_i18n_namespaceObject.__)('Oldest to newest'), value: 'date/asc' }, { - /* translators: label for ordering posts by title in ascending order */ + /* translators: Label for ordering posts by title in ascending order. */ label: (0,external_wp_i18n_namespaceObject.__)('A → Z'), value: 'title/asc' }, { - /* translators: label for ordering posts by title in descending order */ + /* translators: Label for ordering posts by title in descending order. */ label: (0,external_wp_i18n_namespaceObject.__)('Z → A'), value: 'title/desc' }], @@ -70148,14 +64617,16 @@ function QueryControls({ onOrderByChange(newOrderBy); } } - }), isSingleCategorySelection(props) && props.categoriesList && props.onCategoryChange && (0,external_wp_element_namespaceObject.createElement)(CategorySelect, { + }), isSingleCategorySelection(props) && props.categoriesList && props.onCategoryChange && (0,external_React_.createElement)(CategorySelect, { + __next40pxDefaultSize: __next40pxDefaultSize, key: "query-controls-category-select", categoriesList: props.categoriesList, label: (0,external_wp_i18n_namespaceObject.__)('Category'), - noOptionLabel: (0,external_wp_i18n_namespaceObject.__)('All'), + noOptionLabel: (0,external_wp_i18n_namespaceObject._x)('All', 'categories'), selectedCategoryId: props.selectedCategoryId, onChange: props.onCategoryChange - }), isMultipleCategorySelection(props) && props.categorySuggestions && props.onCategoryChange && (0,external_wp_element_namespaceObject.createElement)(form_token_field, { + }), isMultipleCategorySelection(props) && props.categorySuggestions && props.onCategoryChange && (0,external_React_.createElement)(form_token_field, { + __next40pxDefaultSize: __next40pxDefaultSize, __nextHasNoMarginBottom: true, key: "query-controls-categories-select", label: (0,external_wp_i18n_namespaceObject.__)('Categories'), @@ -70170,16 +64641,17 @@ function QueryControls({ suggestions: Object.keys(props.categorySuggestions), onChange: props.onCategoryChange, maxSuggestions: MAX_CATEGORIES_SUGGESTIONS - }), onAuthorChange && (0,external_wp_element_namespaceObject.createElement)(AuthorSelect, { + }), onAuthorChange && (0,external_React_.createElement)(AuthorSelect, { + __next40pxDefaultSize: __next40pxDefaultSize, key: "query-controls-author-select", authorList: authorList, label: (0,external_wp_i18n_namespaceObject.__)('Author'), - noOptionLabel: (0,external_wp_i18n_namespaceObject.__)('All'), + noOptionLabel: (0,external_wp_i18n_namespaceObject._x)('All', 'authors'), selectedAuthorId: selectedAuthorId, onChange: onAuthorChange - }), onNumberOfItemsChange && (0,external_wp_element_namespaceObject.createElement)(range_control, { + }), onNumberOfItemsChange && (0,external_React_.createElement)(range_control, { __nextHasNoMarginBottom: true, - __next40pxDefaultSize: true, + __next40pxDefaultSize: __next40pxDefaultSize, key: "query-controls-range-control", label: (0,external_wp_i18n_namespaceObject.__)('Number of items'), value: numberOfItems, @@ -70189,213 +64661,34 @@ function QueryControls({ required: true })]); } -/* harmony default export */ var query_controls = (QueryControls); - -;// CONCATENATED MODULE: ./node_modules/reakit/es/__keys-d251e56b.js -// Automatically generated -var RADIO_STATE_KEYS = ["baseId", "unstable_idCountRef", "unstable_virtual", "rtl", "orientation", "items", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "state", "setBaseId", "registerItem", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget", "setState"]; -var RADIO_KEYS = [].concat(RADIO_STATE_KEYS, ["value", "checked", "unstable_checkOnFocus"]); -var RADIO_GROUP_KEYS = RADIO_STATE_KEYS; - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/Radio/Radio.js - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -function getChecked(options) { - if (typeof options.checked !== "undefined") { - return options.checked; - } - - return typeof options.value !== "undefined" && options.state === options.value; -} - -function useInitialChecked(options) { - var _React$useState = (0,external_React_.useState)(function () { - return getChecked(options); - }), - initialChecked = _React$useState[0]; - - var _React$useState2 = (0,external_React_.useState)(options.currentId), - initialCurrentId = _React$useState2[0]; - - var id = options.id, - setCurrentId = options.setCurrentId; - (0,external_React_.useEffect)(function () { - if (initialChecked && id && initialCurrentId !== id) { - setCurrentId === null || setCurrentId === void 0 ? void 0 : setCurrentId(id); - } - }, [initialChecked, id, setCurrentId, initialCurrentId]); -} - -function fireChange(element, onChange) { - var event = createEvent(element, "change"); - Object.defineProperties(event, { - type: { - value: "change" - }, - target: { - value: element - }, - currentTarget: { - value: element - } - }); - onChange === null || onChange === void 0 ? void 0 : onChange(event); -} - -var Radio_useRadio = createHook({ - name: "Radio", - compose: useCompositeItem, - keys: RADIO_KEYS, - useOptions: function useOptions(_ref, _ref2) { - var _options$value; - - var value = _ref2.value, - checked = _ref2.checked; - - var _ref$unstable_clickOn = _ref.unstable_clickOnEnter, - unstable_clickOnEnter = _ref$unstable_clickOn === void 0 ? false : _ref$unstable_clickOn, - _ref$unstable_checkOn = _ref.unstable_checkOnFocus, - unstable_checkOnFocus = _ref$unstable_checkOn === void 0 ? true : _ref$unstable_checkOn, - options = _objectWithoutPropertiesLoose(_ref, ["unstable_clickOnEnter", "unstable_checkOnFocus"]); - - return _objectSpread2(_objectSpread2({ - checked: checked, - unstable_clickOnEnter: unstable_clickOnEnter, - unstable_checkOnFocus: unstable_checkOnFocus - }, options), {}, { - value: (_options$value = options.value) != null ? _options$value : value - }); - }, - useProps: function useProps(options, _ref3) { - var htmlRef = _ref3.ref, - htmlOnChange = _ref3.onChange, - htmlOnClick = _ref3.onClick, - htmlProps = _objectWithoutPropertiesLoose(_ref3, ["ref", "onChange", "onClick"]); - - var ref = (0,external_React_.useRef)(null); - - var _React$useState3 = (0,external_React_.useState)(true), - isNativeRadio = _React$useState3[0], - setIsNativeRadio = _React$useState3[1]; - - var checked = getChecked(options); - var isCurrentItemRef = useLiveRef(options.currentId === options.id); - var onChangeRef = useLiveRef(htmlOnChange); - var onClickRef = useLiveRef(htmlOnClick); - useInitialChecked(options); - (0,external_React_.useEffect)(function () { - var element = ref.current; - - if (!element) { - false ? 0 : void 0; - return; - } - - if (element.tagName !== "INPUT" || element.type !== "radio") { - setIsNativeRadio(false); - } - }, []); - var onChange = (0,external_React_.useCallback)(function (event) { - var _onChangeRef$current, _options$setState; - - (_onChangeRef$current = onChangeRef.current) === null || _onChangeRef$current === void 0 ? void 0 : _onChangeRef$current.call(onChangeRef, event); - if (event.defaultPrevented) return; - if (options.disabled) return; - (_options$setState = options.setState) === null || _options$setState === void 0 ? void 0 : _options$setState.call(options, options.value); - }, [options.disabled, options.setState, options.value]); - var onClick = (0,external_React_.useCallback)(function (event) { - var _onClickRef$current; - - (_onClickRef$current = onClickRef.current) === null || _onClickRef$current === void 0 ? void 0 : _onClickRef$current.call(onClickRef, event); - if (event.defaultPrevented) return; - if (isNativeRadio) return; - fireChange(event.currentTarget, onChange); - }, [onChange, isNativeRadio]); - (0,external_React_.useEffect)(function () { - var element = ref.current; - if (!element) return; - - if (options.unstable_moves && isCurrentItemRef.current && options.unstable_checkOnFocus) { - fireChange(element, onChange); - } - }, [options.unstable_moves, options.unstable_checkOnFocus, onChange]); - return _objectSpread2({ - ref: useForkRef(ref, htmlRef), - role: !isNativeRadio ? "radio" : undefined, - type: isNativeRadio ? "radio" : undefined, - value: isNativeRadio ? options.value : undefined, - name: isNativeRadio ? options.baseId : undefined, - "aria-checked": checked, - checked: checked, - onChange: onChange, - onClick: onClick - }, htmlProps); - } -}); -var Radio_Radio = createComponent({ - as: "input", - memo: true, - useHook: Radio_useRadio -}); - +/* harmony default export */ const query_controls = (QueryControls); +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/radio-group/context.js +/** + * External dependencies + */ +// eslint-disable-next-line no-restricted-imports -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/radio-group/radio-context/index.js /** * WordPress dependencies */ -const radio_context_RadioContext = (0,external_wp_element_namespaceObject.createContext)({ - state: null, - setState: () => {} +const RadioGroupContext = (0,external_wp_element_namespaceObject.createContext)({ + store: undefined, + disabled: undefined }); -/* harmony default export */ var radio_context = (radio_context_RadioContext); - -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/radio-group/radio/index.js -// @ts-nocheck +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/radio-group/radio.js /** - * External dependencies + * WordPress dependencies */ /** - * WordPress dependencies + * External dependencies */ +// eslint-disable-next-line no-restricted-imports /** @@ -70403,128 +64696,41 @@ const radio_context_RadioContext = (0,external_wp_element_namespaceObject.create */ -function radio_Radio({ - children, +function UnforwardedRadio({ value, + children, ...props }, ref) { - const radioContext = (0,external_wp_element_namespaceObject.useContext)(radio_context); - const checked = radioContext.state === value; - return (0,external_wp_element_namespaceObject.createElement)(Radio_Radio, { + const { + store, + disabled + } = (0,external_wp_element_namespaceObject.useContext)(RadioGroupContext); + const selectedValue = store?.useState('value'); + const isChecked = selectedValue !== undefined && selectedValue === value; + return (0,external_React_.createElement)(Radio, { + disabled: disabled, + store: store, ref: ref, - as: build_module_button, - variant: checked ? 'primary' : 'secondary', value: value, - ...radioContext, - ...props + render: (0,external_React_.createElement)(build_module_button, { + variant: isChecked ? 'primary' : 'secondary', + ...props + }) }, children || value); } /** * @deprecated Use `RadioControl` or `ToggleGroupControl` instead. */ -/* harmony default export */ var radio_group_radio = ((0,external_wp_element_namespaceObject.forwardRef)(radio_Radio)); - -;// CONCATENATED MODULE: ./node_modules/reakit/es/Radio/RadioState.js - - - - - - - - - - - - - -function useRadioState(initialState) { - if (initialState === void 0) { - initialState = {}; - } - - var _useSealedState = useSealedState(initialState), - initialValue = _useSealedState.state, - _useSealedState$loop = _useSealedState.loop, - loop = _useSealedState$loop === void 0 ? true : _useSealedState$loop, - sealed = _objectWithoutPropertiesLoose(_useSealedState, ["state", "loop"]); - - var _React$useState = (0,external_React_.useState)(initialValue), - state = _React$useState[0], - setState = _React$useState[1]; - - var composite = useCompositeState(_objectSpread2(_objectSpread2({}, sealed), {}, { - loop: loop - })); - return _objectSpread2(_objectSpread2({}, composite), {}, { - state: state, - setState: setState - }); -} - - - -;// CONCATENATED MODULE: ./node_modules/reakit/es/Radio/RadioGroup.js - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var RadioGroup_useRadioGroup = createHook({ - name: "RadioGroup", - compose: useComposite, - keys: RADIO_GROUP_KEYS, - useProps: function useProps(_, htmlProps) { - return _objectSpread2({ - role: "radiogroup" - }, htmlProps); - } -}); -var RadioGroup_RadioGroup = createComponent({ - as: "div", - useHook: RadioGroup_useRadioGroup, - useCreateElement: function useCreateElement$1(type, props, children) { - false ? 0 : void 0; - return useCreateElement(type, props, children); - } -}); - - +const radio_Radio = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedRadio); +/* harmony default export */ const radio_group_radio = (radio_Radio); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/radio-group/index.js -// @ts-nocheck - /** * External dependencies */ +// eslint-disable-next-line no-restricted-imports /** @@ -70537,32 +64743,33 @@ var RadioGroup_RadioGroup = createComponent({ */ -function radio_group_RadioGroup({ +function UnforwardedRadioGroup({ label, checked, defaultChecked, disabled, onChange, + children, ...props }, ref) { - const radioState = useRadioState({ - state: defaultChecked, - baseId: props.id + const radioStore = useRadioStore({ + value: checked, + defaultValue: defaultChecked, + setValue: newValue => { + onChange?.(newValue !== null && newValue !== void 0 ? newValue : undefined); + } }); - const radioContext = { - ...radioState, - disabled, - // Controlled or uncontrolled. - state: checked !== null && checked !== void 0 ? checked : radioState.state, - setState: onChange !== null && onChange !== void 0 ? onChange : radioState.setState - }; - return (0,external_wp_element_namespaceObject.createElement)(radio_context.Provider, { - value: radioContext - }, (0,external_wp_element_namespaceObject.createElement)(RadioGroup_RadioGroup, { - ref: ref, - as: button_group, + const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ + store: radioStore, + disabled + }), [radioStore, disabled]); + return (0,external_React_.createElement)(RadioGroupContext.Provider, { + value: contextValue + }, (0,external_React_.createElement)(RadioGroup, { + store: radioStore, + render: (0,external_React_.createElement)(button_group, null, children), "aria-label": label, - ...radioState, + ref: ref, ...props })); } @@ -70570,7 +64777,8 @@ function radio_group_RadioGroup({ /** * @deprecated Use `RadioControl` or `ToggleGroupControl` instead. */ -/* harmony default export */ var radio_group = ((0,external_wp_element_namespaceObject.forwardRef)(radio_group_RadioGroup)); +const radio_group_RadioGroup = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedRadioGroup); +/* harmony default export */ const radio_group = (radio_group_RadioGroup); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/radio-control/index.js @@ -70631,19 +64839,19 @@ function RadioControl(props) { if (!options?.length) { return null; } - return (0,external_wp_element_namespaceObject.createElement)(base_control, { + return (0,external_React_.createElement)(base_control, { __nextHasNoMarginBottom: true, label: label, id: id, hideLabelFromVision: hideLabelFromVision, help: help, className: classnames_default()(className, 'components-radio-control') - }, (0,external_wp_element_namespaceObject.createElement)(v_stack_component, { + }, (0,external_React_.createElement)(v_stack_component, { spacing: 1 - }, options.map((option, index) => (0,external_wp_element_namespaceObject.createElement)("div", { + }, options.map((option, index) => (0,external_React_.createElement)("div", { key: `${id}-${index}`, className: "components-radio-control__option" - }, (0,external_wp_element_namespaceObject.createElement)("input", { + }, (0,external_React_.createElement)("input", { id: `${id}-${index}`, className: "components-radio-control__input", type: "radio", @@ -70653,11 +64861,12 @@ function RadioControl(props) { checked: option.value === selected, "aria-describedby": !!help ? `${id}__help` : undefined, ...additionalProps - }), (0,external_wp_element_namespaceObject.createElement)("label", { + }), (0,external_React_.createElement)("label", { + className: "components-radio-control__label", htmlFor: `${id}-${index}` }, option.label))))); } -/* harmony default export */ var radio_control = (RadioControl); +/* harmony default export */ const radio_control = (RadioControl); ;// CONCATENATED MODULE: ./node_modules/re-resizable/lib/resizer.js var resizer_extends = (undefined && undefined.__extends) || (function () { @@ -71715,14 +65924,14 @@ const TooltipWrapper = emotion_styled_base_browser_esm("div", true ? { } : 0); const resize_tooltip_styles_Tooltip = emotion_styled_base_browser_esm("div", true ? { target: "e1wq7y4k1" -} : 0)("background:", COLORS.gray[900], ";border-radius:2px;box-sizing:border-box;font-family:", font('default.fontFamily'), ";font-size:12px;color:", COLORS.ui.textDark, ";padding:4px 8px;position:relative;" + ( true ? "" : 0)); +} : 0)("background:", COLORS.theme.foreground, ";border-radius:2px;box-sizing:border-box;font-family:", font('default.fontFamily'), ";font-size:12px;color:", COLORS.theme.foregroundInverted, ";padding:4px 8px;position:relative;" + ( true ? "" : 0)); // TODO: Resolve need to use &&& to increase specificity // https://github.com/WordPress/gutenberg/issues/18483 const LabelText = /*#__PURE__*/emotion_styled_base_browser_esm(text_component, true ? { target: "e1wq7y4k0" -} : 0)("&&&{color:", COLORS.ui.textDark, ";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}" + ( true ? "" : 0)); +} : 0)("&&&{color:", COLORS.theme.foregroundInverted, ";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}" + ( true ? "" : 0)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/resizable-box/resize-tooltip/label.js @@ -71780,21 +65989,21 @@ function resize_tooltip_label_Label({ left: (0,external_wp_i18n_namespaceObject.isRTL)() ? CORNER_OFFSET : undefined }; } - return (0,external_wp_element_namespaceObject.createElement)(TooltipWrapper, { + return (0,external_React_.createElement)(TooltipWrapper, { "aria-hidden": "true", className: "components-resizable-tooltip__tooltip-wrapper", ref: ref, style: style, ...props - }, (0,external_wp_element_namespaceObject.createElement)(resize_tooltip_styles_Tooltip, { + }, (0,external_React_.createElement)(resize_tooltip_styles_Tooltip, { className: "components-resizable-tooltip__tooltip", style: labelStyle - }, (0,external_wp_element_namespaceObject.createElement)(LabelText, { + }, (0,external_React_.createElement)(LabelText, { as: "span" }, label))); } const label_ForwardedComponent = (0,external_wp_element_namespaceObject.forwardRef)(resize_tooltip_label_Label); -/* harmony default export */ var resize_tooltip_label = (label_ForwardedComponent); +/* harmony default export */ const resize_tooltip_label = (label_ForwardedComponent); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/resizable-box/resize-tooltip/index.js @@ -71838,12 +66047,12 @@ function ResizeTooltip({ }); if (!isVisible) return null; const classes = classnames_default()('components-resize-tooltip', className); - return (0,external_wp_element_namespaceObject.createElement)(resize_tooltip_styles_Root, { + return (0,external_React_.createElement)(resize_tooltip_styles_Root, { "aria-hidden": "true", className: classes, ref: ref, ...props - }, resizeListener, (0,external_wp_element_namespaceObject.createElement)(resize_tooltip_label, { + }, resizeListener, (0,external_React_.createElement)(resize_tooltip_label, { "aria-hidden": props['aria-hidden'], label: label, position: position, @@ -71852,7 +66061,7 @@ function ResizeTooltip({ })); } const resize_tooltip_ForwardedComponent = (0,external_wp_element_namespaceObject.forwardRef)(ResizeTooltip); -/* harmony default export */ var resize_tooltip = (resize_tooltip_ForwardedComponent); +/* harmony default export */ const resize_tooltip = (resize_tooltip_ForwardedComponent); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/resizable-box/index.js @@ -71911,18 +66120,18 @@ function UnforwardedResizableBox({ __experimentalTooltipProps: tooltipProps = {}, ...props }, ref) { - return (0,external_wp_element_namespaceObject.createElement)(Resizable, { + return (0,external_React_.createElement)(Resizable, { className: classnames_default()('components-resizable-box__container', showHandle && 'has-show-handle', className), handleClasses: HANDLE_CLASSES, handleStyles: HANDLE_STYLES, ref: ref, ...props - }, children, showTooltip && (0,external_wp_element_namespaceObject.createElement)(resize_tooltip, { + }, children, showTooltip && (0,external_React_.createElement)(resize_tooltip, { ...tooltipProps })); } const ResizableBox = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedResizableBox); -/* harmony default export */ var resizable_box = (ResizableBox); +/* harmony default export */ const resizable_box = (ResizableBox); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/responsive-wrapper/index.js @@ -71970,9 +66179,9 @@ function ResponsiveWrapper({ if (naturalWidth && naturalHeight) { aspectRatio = `${naturalWidth} / ${naturalHeight}`; } - return (0,external_wp_element_namespaceObject.createElement)(TagName, { + return (0,external_React_.createElement)(TagName, { className: "components-responsive-wrapper" - }, (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.cloneElement)(children, { + }, (0,external_React_.createElement)("div", null, (0,external_wp_element_namespaceObject.cloneElement)(children, { className: classnames_default()('components-responsive-wrapper__content', children.props.className), style: { ...children.props.style, @@ -71980,7 +66189,7 @@ function ResponsiveWrapper({ } }))); } -/* harmony default export */ var responsive_wrapper = (ResponsiveWrapper); +/* harmony default export */ const responsive_wrapper = (ResponsiveWrapper); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/sandbox/index.js @@ -72026,7 +66235,7 @@ const observeAndResizeJS = function () { function removeViewportStyles(ruleOrNode) { if (ruleOrNode.style) { ['width', 'height', 'minHeight', 'maxHeight'].forEach(function (style) { - if (/^\\d+(vmin|vmax|vh|vw)$/.test(ruleOrNode.style[style])) { + if (/^\\d+(vw|vh|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)$/.test(ruleOrNode.style[style])) { ruleOrNode.style[style] = ''; } }); @@ -72087,7 +66296,8 @@ function SandBox({ type, styles = [], scripts = [], - onFocus + onFocus, + tabIndex }) { const ref = (0,external_wp_element_namespaceObject.useRef)(); const [width, setWidth] = (0,external_wp_element_namespaceObject.useState)(0); @@ -72115,31 +66325,31 @@ function SandBox({ // we can use this in the future to inject custom styles or scripts. // Scripts go into the body rather than the head, to support embedded content such as Instagram // that expect the scripts to be part of the body. - const htmlDoc = (0,external_wp_element_namespaceObject.createElement)("html", { + const htmlDoc = (0,external_React_.createElement)("html", { lang: ownerDocument.documentElement.lang, className: type - }, (0,external_wp_element_namespaceObject.createElement)("head", null, (0,external_wp_element_namespaceObject.createElement)("title", null, title), (0,external_wp_element_namespaceObject.createElement)("style", { + }, (0,external_React_.createElement)("head", null, (0,external_React_.createElement)("title", null, title), (0,external_React_.createElement)("style", { dangerouslySetInnerHTML: { __html: style } - }), styles.map((rules, i) => (0,external_wp_element_namespaceObject.createElement)("style", { + }), styles.map((rules, i) => (0,external_React_.createElement)("style", { key: i, dangerouslySetInnerHTML: { __html: rules } - }))), (0,external_wp_element_namespaceObject.createElement)("body", { + }))), (0,external_React_.createElement)("body", { "data-resizable-iframe-connected": "data-resizable-iframe-connected", className: type - }, (0,external_wp_element_namespaceObject.createElement)("div", { + }, (0,external_React_.createElement)("div", { dangerouslySetInnerHTML: { __html: html } - }), (0,external_wp_element_namespaceObject.createElement)("script", { + }), (0,external_React_.createElement)("script", { type: "text/javascript", dangerouslySetInnerHTML: { __html: `(${observeAndResizeJS.toString()})();` } - }), scripts.map(src => (0,external_wp_element_namespaceObject.createElement)("script", { + }), scripts.map(src => (0,external_React_.createElement)("script", { key: src, src: src })))); @@ -72209,9 +66419,10 @@ function SandBox({ // See https://github.com/WordPress/gutenberg/pull/44378 // eslint-disable-next-line react-hooks/exhaustive-deps }, [html, type]); - return (0,external_wp_element_namespaceObject.createElement)("iframe", { + return (0,external_React_.createElement)("iframe", { ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, (0,external_wp_compose_namespaceObject.useFocusableIframe)()]), title: title, + tabIndex: tabIndex, className: "components-sandbox", sandbox: "allow-scripts allow-same-origin allow-presentation", onFocus: onFocus, @@ -72219,7 +66430,7 @@ function SandBox({ height: Math.ceil(height) }); } -/* harmony default export */ var sandbox = (SandBox); +/* harmony default export */ const sandbox = (SandBox); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/snackbar/index.js @@ -72292,29 +66503,41 @@ function UnforwardedSnackbar({ } snackbar_useSpokenMessage(spokenMessage, politeness); - // Only set up the timeout dismiss if we're not explicitly dismissing. + // The `onDismiss/onRemove` can have unstable references, + // trigger side-effect cleanup, and reset timers. + const callbackRefs = (0,external_wp_element_namespaceObject.useRef)({ + onDismiss, + onRemove + }); + (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { + callbackRefs.current = { + onDismiss, + onRemove + }; + }); (0,external_wp_element_namespaceObject.useEffect)(() => { + // Only set up the timeout dismiss if we're not explicitly dismissing. const timeoutHandle = setTimeout(() => { if (!explicitDismiss) { - onDismiss?.(); - onRemove?.(); + callbackRefs.current.onDismiss?.(); + callbackRefs.current.onRemove?.(); } }, NOTICE_TIMEOUT); return () => clearTimeout(timeoutHandle); - }, [onDismiss, onRemove, explicitDismiss]); + }, [explicitDismiss]); const classes = classnames_default()(className, 'components-snackbar', { 'components-snackbar-explicit-dismiss': !!explicitDismiss }); if (actions && actions.length > 1) { // We need to inform developers that snackbar only accepts 1 action. - true ? external_wp_warning_default()('Snackbar can only have 1 action, use Notice if your message require many messages') : 0; + true ? external_wp_warning_default()('Snackbar can only have one action. Use Notice if your message requires many actions.') : 0; // return first element only while keeping it inside an array actions = [actions[0]]; } const snackbarContentClassnames = classnames_default()('components-snackbar__content', { 'components-snackbar__content-with-icon': !!icon }); - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { ref: ref, className: classes, onClick: !explicitDismiss ? dismissMe : undefined, @@ -72322,23 +66545,23 @@ function UnforwardedSnackbar({ role: !explicitDismiss ? 'button' : '', onKeyPress: !explicitDismiss ? dismissMe : undefined, "aria-label": !explicitDismiss ? (0,external_wp_i18n_namespaceObject.__)('Dismiss this notice') : '' - }, (0,external_wp_element_namespaceObject.createElement)("div", { + }, (0,external_React_.createElement)("div", { className: snackbarContentClassnames - }, icon && (0,external_wp_element_namespaceObject.createElement)("div", { + }, icon && (0,external_React_.createElement)("div", { className: "components-snackbar__icon" }, icon), children, actions.map(({ label, onClick, url }, index) => { - return (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + return (0,external_React_.createElement)(build_module_button, { key: index, href: url, variant: "tertiary", onClick: event => onActionClick(event, onClick), className: "components-snackbar__action" }, label); - }), explicitDismiss && (0,external_wp_element_namespaceObject.createElement)("span", { + }), explicitDismiss && (0,external_React_.createElement)("span", { role: "button", "aria-label": "Dismiss this notice", tabIndex: 0, @@ -72361,7 +66584,7 @@ function UnforwardedSnackbar({ * ``` */ const Snackbar = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedSnackbar); -/* harmony default export */ var snackbar = (Snackbar); +/* harmony default export */ const snackbar = (Snackbar); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/snackbar/list.js @@ -72435,16 +66658,16 @@ function SnackbarList({ const isReducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); className = classnames_default()('components-snackbar-list', className); const removeNotice = notice => () => onRemove?.(notice.id); - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { className: className, tabIndex: -1, ref: listRef - }, children, (0,external_wp_element_namespaceObject.createElement)(AnimatePresence, null, notices.map(notice => { + }, children, (0,external_React_.createElement)(AnimatePresence, null, notices.map(notice => { const { content, ...restNotice } = notice; - return (0,external_wp_element_namespaceObject.createElement)(motion.div, { + return (0,external_React_.createElement)(motion.div, { layout: !isReducedMotion // See https://www.framer.com/docs/animation/#layout-animations , initial: 'init', @@ -72452,16 +66675,16 @@ function SnackbarList({ exit: 'exit', key: notice.id, variants: isReducedMotion ? undefined : SNACKBAR_VARIANTS - }, (0,external_wp_element_namespaceObject.createElement)("div", { + }, (0,external_React_.createElement)("div", { className: "components-snackbar-list__notice-container" - }, (0,external_wp_element_namespaceObject.createElement)(snackbar, { + }, (0,external_React_.createElement)(snackbar, { ...restNotice, onRemove: removeNotice(notice), listRef: listRef }, notice.content))); }))); } -/* harmony default export */ var snackbar_list = (SnackbarList); +/* harmony default export */ const snackbar_list = (SnackbarList); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/spinner/styles.js @@ -72516,7 +66739,7 @@ function UnforwardedSpinner({ className, ...props }, forwardedRef) { - return (0,external_wp_element_namespaceObject.createElement)(StyledSpinner, { + return (0,external_React_.createElement)(StyledSpinner, { className: classnames_default()('components-spinner', className), viewBox: "0 0 100 100", width: "16", @@ -72526,12 +66749,12 @@ function UnforwardedSpinner({ focusable: "false", ...props, ref: forwardedRef - }, (0,external_wp_element_namespaceObject.createElement)(SpinnerTrack, { + }, (0,external_React_.createElement)(SpinnerTrack, { cx: "50", cy: "50", r: "50", vectorEffect: "non-scaling-stroke" - }), (0,external_wp_element_namespaceObject.createElement)(SpinnerIndicator, { + }), (0,external_React_.createElement)(SpinnerIndicator, { d: "m 50 0 a 50 50 0 0 1 50 50", vectorEffect: "non-scaling-stroke" })); @@ -72548,7 +66771,7 @@ function UnforwardedSpinner({ * ``` */ const Spinner = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedSpinner); -/* harmony default export */ var spinner = (Spinner); +/* harmony default export */ const spinner = (Spinner); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/surface/component.js @@ -72564,7 +66787,7 @@ const Spinner = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedSp function UnconnectedSurface(props, forwardedRef) { const surfaceProps = useSurface(props); - return (0,external_wp_element_namespaceObject.createElement)(component, { + return (0,external_React_.createElement)(component, { ...surfaceProps, ref: forwardedRef }); @@ -72591,9 +66814,10 @@ function UnconnectedSurface(props, forwardedRef) { * ``` */ const component_Surface = contextConnect(UnconnectedSurface, 'Surface'); -/* harmony default export */ var surface_component = (component_Surface); +/* harmony default export */ const surface_component = (component_Surface); ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/tab/tab-store.js +"use client"; @@ -72606,7 +66830,7 @@ const component_Surface = contextConnect(UnconnectedSurface, 'Surface'); function createTabStore(props = {}) { var _a; const syncState = (_a = props.store) == null ? void 0 : _a.getState(); - const composite = createCompositeStore(_chunks_PNRLI7OV_spreadProps(_chunks_PNRLI7OV_spreadValues({}, props), { + const composite = createCompositeStore(_chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, props), { orientation: defaultValue( props.orientation, syncState == null ? void 0 : syncState.orientation, @@ -72615,7 +66839,7 @@ function createTabStore(props = {}) { focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true) })); const panels = createCollectionStore(); - const initialState = _chunks_PNRLI7OV_spreadProps(_chunks_PNRLI7OV_spreadValues({}, composite.getState()), { + const initialState = _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, composite.getState()), { selectedId: defaultValue( props.selectedId, syncState == null ? void 0 : syncState.selectedId, @@ -72629,8 +66853,9 @@ function createTabStore(props = {}) { ) }); const tab = createStore(initialState, composite, props.store); - tab.setup( - () => tab.sync(() => { + setup( + tab, + () => sync(tab, ["moves"], () => { const { activeId, selectOnMove } = tab.getState(); if (!selectOnMove) return; @@ -72644,61 +66869,56 @@ function createTabStore(props = {}) { if (tabItem.disabled) return; tab.setState("selectedId", tabItem.id); - }, ["moves"]) + }) ); - tab.setup( - () => tab.syncBatch( - (state) => tab.setState("activeId", state.selectedId), - ["selectedId"] + setup( + tab, + () => batch( + tab, + ["selectedId"], + (state) => tab.setState("activeId", state.selectedId) ) ); - tab.setup( - () => tab.sync( - (state) => { - if (state.selectedId !== void 0) - return; - const { activeId, renderedItems } = tab.getState(); - const tabItem = composite.item(activeId); - if (tabItem && !tabItem.disabled && !tabItem.dimmed) { - tab.setState("selectedId", tabItem.id); - } else { - const tabItem2 = renderedItems.find( - (item) => !item.disabled && !item.dimmed - ); - tab.setState("selectedId", tabItem2 == null ? void 0 : tabItem2.id); - } - }, - ["selectedId", "renderedItems"] - ) + setup( + tab, + () => sync(tab, ["selectedId", "renderedItems"], (state) => { + if (state.selectedId !== void 0) + return; + const { activeId, renderedItems } = tab.getState(); + const tabItem = composite.item(activeId); + if (tabItem && !tabItem.disabled && !tabItem.dimmed) { + tab.setState("selectedId", tabItem.id); + } else { + const tabItem2 = renderedItems.find( + (item) => !item.disabled && !item.dimmed + ); + tab.setState("selectedId", tabItem2 == null ? void 0 : tabItem2.id); + } + }) ); - tab.setup( - () => tab.sync( - (state) => { - const tabs = state.renderedItems; - if (!tabs.length) + setup( + tab, + () => sync(tab, ["renderedItems"], (state) => { + const tabs = state.renderedItems; + if (!tabs.length) + return; + return sync(panels, ["renderedItems"], (state2) => { + const items = state2.renderedItems; + const hasOrphanPanels = items.some((panel) => !panel.tabId); + if (!hasOrphanPanels) return; - return panels.sync( - (state2) => { - const items = state2.renderedItems; - const hasOrphanPanels = items.some((panel) => !panel.tabId); - if (!hasOrphanPanels) - return; - items.forEach((panel, i) => { - if (panel.tabId) - return; - const tabItem = tabs[i]; - if (!tabItem) - return; - panels.renderItem(_chunks_PNRLI7OV_spreadProps(_chunks_PNRLI7OV_spreadValues({}, panel), { tabId: tabItem.id })); - }); - }, - ["renderedItems"] - ); - }, - ["renderedItems"] - ) + items.forEach((panel, i) => { + if (panel.tabId) + return; + const tabItem = tabs[i]; + if (!tabItem) + return; + panels.renderItem(_chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, panel), { tabId: tabItem.id })); + }); + }); + }) ); - return _chunks_PNRLI7OV_spreadProps(_chunks_PNRLI7OV_spreadValues(_chunks_PNRLI7OV_spreadValues({}, composite), tab), { + return _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, composite), tab), { panels, setSelectedId: (id) => tab.setState("selectedId", id), select: (id) => { @@ -72709,9 +66929,8 @@ function createTabStore(props = {}) { } -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/tab/tab-store.js - - +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/CQMDBRG5.js +"use client"; @@ -72720,31 +66939,42 @@ function createTabStore(props = {}) { // src/tab/tab-store.ts -function useTabStoreOptions(props) { - return useCompositeStoreOptions(props); -} -function useTabStoreProps(store, props) { - store = useCompositeStoreProps(store, props); +function useTabStoreProps(store, update, props) { + store = useCompositeStoreProps(store, update, props); useStoreProps(store, props, "selectedId", "setSelectedId"); useStoreProps(store, props, "selectOnMove"); - const panels = FHQZ2KRN_useStore(() => store.panels); - return (0,external_React_.useMemo)(() => PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({}, store), { panels }), []); + const [panels, updatePanels] = EKQEJRUF_useStore(() => store.panels, {}); + useUpdateEffect(updatePanels, [store, updatePanels]); + return (0,external_React_.useMemo)(() => _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, store), { panels }), [store, panels]); } function useTabStore(props = {}) { - const options = useTabStoreOptions(props); - const store = FHQZ2KRN_useStore(() => createTabStore(PNRLI7OV_spreadValues(PNRLI7OV_spreadValues({}, props), options))); - return useTabStoreProps(store, props); + const [store, update] = EKQEJRUF_useStore(createTabStore, props); + return useTabStoreProps(store, update, props); } -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/UZKBEGMB.js -// src/tab/tab-context.ts -var TabContext = (0,external_React_.createContext)(void 0); +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/4B73HROV.js +"use client"; + + + +// src/tab/tab-context.tsx +var _4B73HROV_ctx = createStoreContext( + [CompositeContextProvider], + [CompositeScopedContextProvider] +); +var useTabContext = _4B73HROV_ctx.useContext; +var useTabScopedContext = _4B73HROV_ctx.useScopedContext; +var useTabProviderContext = _4B73HROV_ctx.useProviderContext; +var TabContextProvider = _4B73HROV_ctx.ContextProvider; +var TabScopedContextProvider = _4B73HROV_ctx.ScopedContextProvider; ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/tab/tab-list.js +"use client"; + @@ -72758,31 +66988,39 @@ var TabContext = (0,external_React_.createContext)(void 0); // src/tab/tab-list.tsx -var useTabList = NQJBHION_createHook((_a) => { + +var useTabList = createHook((_a) => { var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); + const context = useTabProviderContext(); + store = store || context; + invariant( + store, + false && 0 + ); const orientation = store.useState( (state) => state.orientation === "both" ? void 0 : state.orientation ); props = useWrapElement( props, - (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(TabContext.Provider, { value: store, children: element }), + (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(TabScopedContextProvider, { value: store, children: element }), [store] ); - props = PNRLI7OV_spreadValues({ + props = _4R3V3JGP_spreadValues({ role: "tablist", "aria-orientation": orientation }, props); - props = AAVDGJD5_useComposite(PNRLI7OV_spreadValues({ store }, props)); + props = useComposite(_4R3V3JGP_spreadValues({ store }, props)); return props; }); -var TabList = NQJBHION_createComponent((props) => { +var tab_list_TabList = createComponent((props) => { const htmlProps = useTabList(props); - return NQJBHION_createElement("div", htmlProps); + return _3ORBWXWF_createElement("div", htmlProps); }); if (false) {} ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/tab/tab.js +"use client"; @@ -72801,7 +67039,7 @@ if (false) {} // src/tab/tab.ts -var useTab = NQJBHION_createHook( +var useTab = createHook( (_a) => { var _b = _a, { store, @@ -72812,7 +67050,7 @@ var useTab = NQJBHION_createHook( "accessibleWhenDisabled", "getItem" ]); - const context = (0,external_React_.useContext)(TabContext); + const context = useTabScopedContext(); store = store || context; invariant( store, @@ -72820,10 +67058,10 @@ var useTab = NQJBHION_createHook( ); const defaultId = useId(); const id = props.id || defaultId; - const dimmed = props.disabled; + const dimmed = disabledFromProps(props); const getItem = (0,external_React_.useCallback)( (item) => { - const nextItem = PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({}, item), { dimmed }); + const nextItem = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, item), { dimmed }); if (getItemProp) { return getItemProp(nextItem); } @@ -72845,7 +67083,7 @@ var useTab = NQJBHION_createHook( } ); const selected = store.useState((state) => !!id && state.selectedId === id); - props = PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({ + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ id, role: "tab", "aria-selected": selected, @@ -72853,7 +67091,7 @@ var useTab = NQJBHION_createHook( }, props), { onClick }); - props = WFK3YK7D_useCompositeItem(PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({ + props = useCompositeItem(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ store }, props), { accessibleWhenDisabled, @@ -72865,12 +67103,15 @@ var useTab = NQJBHION_createHook( ); var Tab = createMemoComponent((props) => { const htmlProps = useTab(props); - return NQJBHION_createElement("button", htmlProps); + return _3ORBWXWF_createElement("button", htmlProps); }); if (false) {} ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/tab/tab-panel.js +"use client"; + + @@ -72883,12 +67124,22 @@ if (false) {} -// src/tab/tab-panel.ts -var useTabPanel = NQJBHION_createHook( +// src/tab/tab-panel.tsx + + + + +var useTabPanel = createHook( (_a) => { var _b = _a, { store, tabId: tabIdProp, getItem: getItemProp } = _b, props = __objRest(_b, ["store", "tabId", "getItem"]); + const context = useTabProviderContext(); + store = store || context; + invariant( + store, + false && 0 + ); const ref = (0,external_React_.useRef)(null); const id = useId(props.id); const [hasTabbableChildren, setHasTabbableChildren] = (0,external_React_.useState)(false); @@ -72896,12 +67147,12 @@ var useTabPanel = NQJBHION_createHook( const element = ref.current; if (!element) return; - const tabbable = focus_getAllTabbableIn(element); + const tabbable = getAllTabbableIn(element); setHasTabbableChildren(!!tabbable.length); }, []); const getItem = (0,external_React_.useCallback)( (item) => { - const nextItem = PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({}, item), { id: id || item.id, tabId: tabIdProp }); + const nextItem = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, item), { id: id || item.id, tabId: tabIdProp }); if (getItemProp) { return getItemProp(nextItem); } @@ -72909,16 +67160,21 @@ var useTabPanel = NQJBHION_createHook( }, [id, tabIdProp, getItemProp] ); + props = useWrapElement( + props, + (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(TabScopedContextProvider, { value: store, children: element }), + [store] + ); const tabId = store.panels.useState( () => { var _a2; - return tabIdProp || ((_a2 = store.panels.item(id)) == null ? void 0 : _a2.tabId); + return tabIdProp || ((_a2 = store == null ? void 0 : store.panels.item(id)) == null ? void 0 : _a2.tabId); } ); const open = store.useState( (state) => !!tabId && state.selectedId === tabId ); - props = PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({ + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ id, role: "tabpanel", "aria-labelledby": tabId || void 0 @@ -72926,15 +67182,15 @@ var useTabPanel = NQJBHION_createHook( ref: useMergeRefs(ref, props.ref) }); const disclosure = useDisclosureStore({ open }); - props = useFocusable(PNRLI7OV_spreadValues({ focusable: !hasTabbableChildren }, props)); - props = useDisclosureContent(PNRLI7OV_spreadValues({ store: disclosure }, props)); - props = useCollectionItem(PNRLI7OV_spreadProps(PNRLI7OV_spreadValues({ store: store.panels }, props), { getItem })); + props = useFocusable(_4R3V3JGP_spreadValues({ focusable: !hasTabbableChildren }, props)); + props = useDisclosureContent(_4R3V3JGP_spreadValues({ store: disclosure }, props)); + props = useCollectionItem(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ store: store.panels }, props), { getItem })); return props; } ); -var TabPanel = NQJBHION_createComponent((props) => { +var TabPanel = createComponent((props) => { const htmlProps = useTabPanel(props); - return NQJBHION_createElement("div", htmlProps); + return _3ORBWXWF_createElement("div", htmlProps); }); if (false) {} @@ -72944,6 +67200,7 @@ if (false) {} /** * External dependencies */ +// eslint-disable-next-line no-restricted-imports /** @@ -73095,14 +67352,14 @@ const UnforwardedTabPanel = ({ setTabStoreSelectedId(firstEnabledTab.name); } }, [tabs, selectedTab?.disabled, setTabStoreSelectedId, instanceId]); - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { className: className, ref: ref - }, (0,external_wp_element_namespaceObject.createElement)(TabList, { + }, (0,external_React_.createElement)(tab_list_TabList, { store: tabStore, className: "components-tab-panel__tabs" }, tabs.map(tab => { - return (0,external_wp_element_namespaceObject.createElement)(Tab, { + return (0,external_React_.createElement)(Tab, { key: tab.name, id: prependInstanceId(tab.name), className: classnames_default()('components-tab-panel__tabs-item', tab.className, { @@ -73110,13 +67367,13 @@ const UnforwardedTabPanel = ({ }), disabled: tab.disabled, "aria-controls": `${prependInstanceId(tab.name)}-view`, - render: (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + render: (0,external_React_.createElement)(build_module_button, { icon: tab.icon, label: tab.icon && tab.title, showTooltip: !!tab.icon }) }, !tab.icon && tab.title); - })), selectedTab && (0,external_wp_element_namespaceObject.createElement)(TabPanel, { + })), selectedTab && (0,external_React_.createElement)(TabPanel, { id: `${prependInstanceId(selectedTab.name)}-view`, store: tabStore, tabId: prependInstanceId(selectedTab.name), @@ -73124,7 +67381,7 @@ const UnforwardedTabPanel = ({ }, children(selectedTab))); }; const tab_panel_TabPanel = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTabPanel); -/* harmony default export */ var tab_panel = (tab_panel_TabPanel); +/* harmony default export */ const tab_panel = (tab_panel_TabPanel); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text-control/index.js @@ -73132,6 +67389,8 @@ const tab_panel_TabPanel = (0,external_wp_element_namespaceObject.forwardRef)(Un * External dependencies */ + + /** * WordPress dependencies */ @@ -73145,6 +67404,7 @@ const tab_panel_TabPanel = (0,external_wp_element_namespaceObject.forwardRef)(Un function UnforwardedTextControl(props, ref) { const { __nextHasNoMarginBottom, + __next40pxDefaultSize = false, label, hideLabelFromVision, value, @@ -73157,15 +67417,17 @@ function UnforwardedTextControl(props, ref) { } = props; const id = (0,external_wp_compose_namespaceObject.useInstanceId)(TextControl, 'inspector-text-control', idProp); const onChangeValue = event => onChange(event.target.value); - return (0,external_wp_element_namespaceObject.createElement)(base_control, { + return (0,external_React_.createElement)(base_control, { __nextHasNoMarginBottom: __nextHasNoMarginBottom, label: label, hideLabelFromVision: hideLabelFromVision, id: id, help: help, className: className - }, (0,external_wp_element_namespaceObject.createElement)("input", { - className: "components-text-control__input", + }, (0,external_React_.createElement)("input", { + className: classnames_default()('components-text-control__input', { + 'is-next-40px-default-size': __next40pxDefaultSize + }), type: type, id: id, value: value, @@ -73197,7 +67459,7 @@ function UnforwardedTextControl(props, ref) { * ``` */ const TextControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTextControl); -/* harmony default export */ var text_control = (TextControl); +/* harmony default export */ const text_control = (TextControl); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/input/base.js /** @@ -73215,7 +67477,7 @@ const inputStyleNeutral = /*#__PURE__*/emotion_react_browser_esm_css("box-shadow const inputStyleFocus = /*#__PURE__*/emotion_react_browser_esm_css("border-color:", COLORS.theme.accent, ";box-shadow:0 0 0 calc( ", config_values.borderWidthFocus, " - ", config_values.borderWidth, " ) ", COLORS.theme.accent, ";outline:2px solid transparent;" + ( true ? "" : 0), true ? "" : 0); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/breakpoint-values.js -/* harmony default export */ var breakpoint_values = ({ +/* harmony default export */ const breakpoint_values = ({ huge: '1440px', wide: '1280px', 'x-large': '1080px', @@ -73272,43 +67534,17 @@ const StyledTextarea = emotion_styled_base_browser_esm("textarea", true ? { ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/textarea-control/index.js /** - * External dependencies - */ - -/** * WordPress dependencies */ + /** * Internal dependencies */ -/** - * TextareaControls are TextControls that allow for multiple lines of text, and - * wrap overflow text onto a new line. They are a fixed height and scroll - * vertically when the cursor reaches the bottom of the field. - * - * ```jsx - * import { TextareaControl } from '@wordpress/components'; - * import { useState } from '@wordpress/element'; - * - * const MyTextareaControl = () => { - * const [ text, setText ] = useState( '' ); - * - * return ( - * <TextareaControl - * label="Text" - * help="Enter some text" - * value={ text } - * onChange={ ( value ) => setText( value ) } - * /> - * ); - * }; - * ``` - */ -function TextareaControl(props) { +function UnforwardedTextareaControl(props, ref) { const { __nextHasNoMarginBottom, label, @@ -73323,24 +67559,50 @@ function TextareaControl(props) { const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(TextareaControl); const id = `inspector-textarea-control-${instanceId}`; const onChangeValue = event => onChange(event.target.value); - return (0,external_wp_element_namespaceObject.createElement)(base_control, { + return (0,external_React_.createElement)(base_control, { __nextHasNoMarginBottom: __nextHasNoMarginBottom, label: label, hideLabelFromVision: hideLabelFromVision, id: id, help: help, className: className - }, (0,external_wp_element_namespaceObject.createElement)(StyledTextarea, { + }, (0,external_React_.createElement)(StyledTextarea, { className: "components-textarea-control__input", id: id, rows: rows, onChange: onChangeValue, "aria-describedby": !!help ? id + '__help' : undefined, value: value, + ref: ref, ...additionalProps })); } -/* harmony default export */ var textarea_control = (TextareaControl); + +/** + * TextareaControls are TextControls that allow for multiple lines of text, and + * wrap overflow text onto a new line. They are a fixed height and scroll + * vertically when the cursor reaches the bottom of the field. + * + * ```jsx + * import { TextareaControl } from '@wordpress/components'; + * import { useState } from '@wordpress/element'; + * + * const MyTextareaControl = () => { + * const [ text, setText ] = useState( '' ); + * + * return ( + * <TextareaControl + * label="Text" + * help="Enter some text" + * value={ text } + * onChange={ ( value ) => setText( value ) } + * /> + * ); + * }; + * ``` + */ +const TextareaControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTextareaControl); +/* harmony default export */ const textarea_control = (TextareaControl); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text-highlight/index.js @@ -73375,14 +67637,14 @@ const TextHighlight = props => { } = props; const trimmedHighlightText = highlight.trim(); if (!trimmedHighlightText) { - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, text); + return (0,external_React_.createElement)(external_React_.Fragment, null, text); } const regex = new RegExp(`(${escapeRegExp(trimmedHighlightText)})`, 'gi'); return (0,external_wp_element_namespaceObject.createInterpolateElement)(text.replace(regex, '<mark>$&</mark>'), { - mark: (0,external_wp_element_namespaceObject.createElement)("mark", null) + mark: (0,external_React_.createElement)("mark", null) }); }; -/* harmony default export */ var text_highlight = (TextHighlight); +/* harmony default export */ const text_highlight = (TextHighlight); ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/tip.js @@ -73390,13 +67652,13 @@ const TextHighlight = props => { * WordPress dependencies */ -const tip = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { +const tip = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { d: "M12 15.8c-3.7 0-6.8-3-6.8-6.8s3-6.8 6.8-6.8c3.7 0 6.8 3 6.8 6.8s-3.1 6.8-6.8 6.8zm0-12C9.1 3.8 6.8 6.1 6.8 9s2.4 5.2 5.2 5.2c2.9 0 5.2-2.4 5.2-5.2S14.9 3.8 12 3.8zM8 17.5h8V19H8zM10 20.5h4V22h-4z" })); -/* harmony default export */ var library_tip = (tip); +/* harmony default export */ const library_tip = (tip); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tip/index.js @@ -73413,13 +67675,13 @@ function Tip(props) { const { children } = props; - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { className: "components-tip" - }, (0,external_wp_element_namespaceObject.createElement)(icons_build_module_icon, { + }, (0,external_React_.createElement)(icons_build_module_icon, { icon: library_tip - }), (0,external_wp_element_namespaceObject.createElement)("p", null, children)); + }), (0,external_React_.createElement)("p", null, children)); } -/* harmony default export */ var build_module_tip = (Tip); +/* harmony default export */ const build_module_tip = (Tip); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-control/index.js @@ -73498,111 +67760,66 @@ function ToggleControl({ describedBy = id + '__help'; } } - return (0,external_wp_element_namespaceObject.createElement)(base_control, { + return (0,external_React_.createElement)(base_control, { id: id, help: helpLabel, className: classes, __nextHasNoMarginBottom: true - }, (0,external_wp_element_namespaceObject.createElement)(h_stack_component, { + }, (0,external_React_.createElement)(h_stack_component, { justify: "flex-start", spacing: 3 - }, (0,external_wp_element_namespaceObject.createElement)(form_toggle, { + }, (0,external_React_.createElement)(form_toggle, { id: id, checked: checked, onChange: onChangeToggle, "aria-describedby": describedBy, disabled: disabled - }), (0,external_wp_element_namespaceObject.createElement)(flex_block_component, { + }), (0,external_React_.createElement)(flex_block_component, { as: "label", htmlFor: id, className: "components-toggle-control__label" }, label))); } -/* harmony default export */ var toggle_control = (ToggleControl); +/* harmony default export */ const toggle_control = (ToggleControl); -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option-icon/component.js - -/** - * External dependencies - */ - -/** - * WordPress dependencies - */ +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/SOK7T35T.js +"use client"; -/** - * Internal dependencies - */ +// src/toolbar/toolbar-context.tsx +var SOK7T35T_ctx = createStoreContext( + [CompositeContextProvider], + [CompositeScopedContextProvider] +); +var useToolbarContext = SOK7T35T_ctx.useContext; +var useToolbarScopedContext = SOK7T35T_ctx.useScopedContext; +var useToolbarProviderContext = SOK7T35T_ctx.useProviderContext; +var ToolbarContextProvider = SOK7T35T_ctx.ContextProvider; +var ToolbarScopedContextProvider = SOK7T35T_ctx.ScopedContextProvider; -function UnforwardedToggleGroupControlOptionIcon(props, ref) { - const { - icon, - label, - ...restProps - } = props; - return (0,external_wp_element_namespaceObject.createElement)(toggle_group_control_option_base_component, { - ...restProps, - isIcon: true, - "aria-label": label, - showTooltip: true, - ref: ref - }, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { - icon: icon - })); -} -/** - * `ToggleGroupControlOptionIcon` is a form component which is meant to be used as a - * child of `ToggleGroupControl` and displays an icon. - * - * ```jsx - * - * import { - * __experimentalToggleGroupControl as ToggleGroupControl, - * __experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon, - * from '@wordpress/components'; - * import { formatLowercase, formatUppercase } from '@wordpress/icons'; - * - * function Example() { - * return ( - * <ToggleGroupControl> - * <ToggleGroupControlOptionIcon - * value="uppercase" - * label="Uppercase" - * icon={ formatUppercase } - * /> - * <ToggleGroupControlOptionIcon - * value="lowercase" - * label="Lowercase" - * icon={ formatLowercase } - * /> - * </ToggleGroupControl> - * ); - * } - * ``` - */ -const ToggleGroupControlOptionIcon = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToggleGroupControlOptionIcon); -/* harmony default export */ var toggle_group_control_option_icon_component = (ToggleGroupControlOptionIcon); +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/7NHUGSTF.js +"use client"; -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/6YH4Z35H.js // src/toolbar/toolbar-item.ts -var useToolbarItem = NQJBHION_createHook( +var useToolbarItem = createHook( (_a) => { var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); - props = WFK3YK7D_useCompositeItem(PNRLI7OV_spreadValues({ store }, props)); + const context = useToolbarContext(); + store = store || context; + props = useCompositeItem(_4R3V3JGP_spreadValues({ store }, props)); return props; } ); var ToolbarItem = createMemoComponent((props) => { const htmlProps = useToolbarItem(props); - return NQJBHION_createElement("button", htmlProps); + return _3ORBWXWF_createElement("button", htmlProps); }); if (false) {} @@ -73612,19 +67829,21 @@ if (false) {} /** * External dependencies */ +// eslint-disable-next-line no-restricted-imports /** * WordPress dependencies */ const ToolbarContext = (0,external_wp_element_namespaceObject.createContext)(undefined); -/* harmony default export */ var toolbar_context = (ToolbarContext); +/* harmony default export */ const toolbar_context = (ToolbarContext); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar/toolbar-item/index.js /** * External dependencies */ +// eslint-disable-next-line no-restricted-imports /** * WordPress dependencies @@ -73654,7 +67873,7 @@ function toolbar_item_ToolbarItem({ }; if (!accessibleToolbarStore) { if (Component) { - return (0,external_wp_element_namespaceObject.createElement)(Component, { + return (0,external_React_.createElement)(Component, { ...allProps }, children); } @@ -73663,14 +67882,14 @@ function toolbar_item_ToolbarItem({ } return children(allProps); } - const render = isRenderProp ? children : Component && (0,external_wp_element_namespaceObject.createElement)(Component, null, children); - return (0,external_wp_element_namespaceObject.createElement)(ToolbarItem, { + const render = isRenderProp ? children : Component && (0,external_React_.createElement)(Component, null, children); + return (0,external_React_.createElement)(ToolbarItem, { ...allProps, store: accessibleToolbarStore, render: render }); } -/* harmony default export */ var toolbar_item = ((0,external_wp_element_namespaceObject.forwardRef)(toolbar_item_ToolbarItem)); +/* harmony default export */ const toolbar_item = ((0,external_wp_element_namespaceObject.forwardRef)(toolbar_item_ToolbarItem)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar/toolbar-button/toolbar-button-container.js @@ -73681,10 +67900,10 @@ function toolbar_item_ToolbarItem({ const ToolbarButtonContainer = ({ children, className -}) => (0,external_wp_element_namespaceObject.createElement)("div", { +}) => (0,external_React_.createElement)("div", { className: className }, children); -/* harmony default export */ var toolbar_button_container = (ToolbarButtonContainer); +/* harmony default export */ const toolbar_button_container = (ToolbarButtonContainer); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar/toolbar-button/index.js @@ -73716,9 +67935,9 @@ function UnforwardedToolbarButton({ }, ref) { const accessibleToolbarState = (0,external_wp_element_namespaceObject.useContext)(toolbar_context); if (!accessibleToolbarState) { - return (0,external_wp_element_namespaceObject.createElement)(toolbar_button_container, { + return (0,external_React_.createElement)(toolbar_button_container, { className: containerClassName - }, (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }, (0,external_React_.createElement)(build_module_button, { ref: ref, icon: props.icon, label: title, @@ -73743,12 +67962,12 @@ function UnforwardedToolbarButton({ // ToobarItem will pass all props to the render prop child, which will pass // all props to Button. This means that ToolbarButton has the same API as // Button. - return (0,external_wp_element_namespaceObject.createElement)(toolbar_item, { + return (0,external_React_.createElement)(toolbar_item, { className: classnames_default()('components-toolbar-button', className), ...extraProps, ...props, ref: ref - }, toolbarItemProps => (0,external_wp_element_namespaceObject.createElement)(build_module_button, { + }, toolbarItemProps => (0,external_React_.createElement)(build_module_button, { label: title, isPressed: isActive, disabled: isDisabled, @@ -73778,7 +67997,7 @@ function UnforwardedToolbarButton({ * ``` */ const ToolbarButton = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToolbarButton); -/* harmony default export */ var toolbar_button = (ToolbarButton); +/* harmony default export */ const toolbar_button = (ToolbarButton); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar/toolbar-group/toolbar-group-container.js @@ -73790,11 +68009,11 @@ const ToolbarGroupContainer = ({ className, children, ...props -}) => (0,external_wp_element_namespaceObject.createElement)("div", { +}) => (0,external_React_.createElement)("div", { className: className, ...props }, children); -/* harmony default export */ var toolbar_group_container = (ToolbarGroupContainer); +/* harmony default export */ const toolbar_group_container = (ToolbarGroupContainer); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar/toolbar-group/toolbar-group-collapsed.js @@ -73817,7 +68036,7 @@ function ToolbarGroupCollapsed({ // It'll contain state if `ToolbarGroup` is being used within // `<Toolbar label="label" />` const accessibleToolbarState = (0,external_wp_element_namespaceObject.useContext)(toolbar_context); - const renderDropdownMenu = internalToggleProps => (0,external_wp_element_namespaceObject.createElement)(dropdown_menu, { + const renderDropdownMenu = internalToggleProps => (0,external_React_.createElement)(dropdown_menu, { controls: controls, toggleProps: { ...internalToggleProps, @@ -73826,13 +68045,13 @@ function ToolbarGroupCollapsed({ ...props }); if (accessibleToolbarState) { - return (0,external_wp_element_namespaceObject.createElement)(toolbar_item, { + return (0,external_React_.createElement)(toolbar_item, { ...toggleProps }, renderDropdownMenu); } return renderDropdownMenu(toggleProps); } -/* harmony default export */ var toolbar_group_collapsed = (ToolbarGroupCollapsed); +/* harmony default export */ const toolbar_group_collapsed = (ToolbarGroupCollapsed); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar/toolbar-group/index.js @@ -73914,7 +68133,7 @@ function ToolbarGroup({ controlSets = [controls]; } if (isCollapsed) { - return (0,external_wp_element_namespaceObject.createElement)(toolbar_group_collapsed, { + return (0,external_React_.createElement)(toolbar_group_collapsed, { label: title, controls: controlSets, className: finalClassName, @@ -73922,18 +68141,19 @@ function ToolbarGroup({ ...props }); } - return (0,external_wp_element_namespaceObject.createElement)(toolbar_group_container, { + return (0,external_React_.createElement)(toolbar_group_container, { className: finalClassName, ...props - }, controlSets?.flatMap((controlSet, indexOfSet) => controlSet.map((control, indexOfControl) => (0,external_wp_element_namespaceObject.createElement)(toolbar_button, { + }, controlSets?.flatMap((controlSet, indexOfSet) => controlSet.map((control, indexOfControl) => (0,external_React_.createElement)(toolbar_button, { key: [indexOfSet, indexOfControl].join(), containerClassName: indexOfSet > 0 && indexOfControl === 0 ? 'has-left-divider' : undefined, ...control }))), children); } -/* harmony default export */ var toolbar_group = (ToolbarGroup); +/* harmony default export */ const toolbar_group = (ToolbarGroup); ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/toolbar/toolbar-store.js +"use client"; @@ -73946,7 +68166,7 @@ function ToolbarGroup({ function createToolbarStore(props = {}) { var _a; const syncState = (_a = props.store) == null ? void 0 : _a.getState(); - return createCompositeStore(_chunks_PNRLI7OV_spreadProps(_chunks_PNRLI7OV_spreadValues({}, props), { + return createCompositeStore(_chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, props), { orientation: defaultValue( props.orientation, syncState == null ? void 0 : syncState.orientation, @@ -73957,41 +68177,30 @@ function createToolbarStore(props = {}) { } -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/toolbar/toolbar-store.js - - - - +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/BPNXFCFY.js +"use client"; // src/toolbar/toolbar-store.ts -function useToolbarStoreOptions(props) { - return useCompositeStoreOptions(props); -} -function useToolbarStoreProps(store, props) { - return useCompositeStoreProps(store, props); +function useToolbarStoreProps(store, update, props) { + return useCompositeStoreProps(store, update, props); } function useToolbarStore(props = {}) { - const options = useToolbarStoreOptions(props); - const store = FHQZ2KRN_useStore( - () => createToolbarStore(PNRLI7OV_spreadValues(PNRLI7OV_spreadValues({}, props), options)) - ); - return useToolbarStoreProps(store, props); + const [store, update] = EKQEJRUF_useStore(createToolbarStore, props); + return useToolbarStoreProps(store, update, props); } -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/DFUIIKXE.js -// src/toolbar/toolbar-context.ts -var DFUIIKXE_ToolbarContext = (0,external_React_.createContext)( - void 0 -); +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/toolbar/toolbar.js +"use client"; + + -;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/toolbar/toolbar.js @@ -74005,26 +68214,49 @@ var DFUIIKXE_ToolbarContext = (0,external_React_.createContext)( // src/toolbar/toolbar.tsx -var useToolbar = NQJBHION_createHook((_a) => { - var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); - const orientation = store.useState( - (state) => state.orientation === "both" ? void 0 : state.orientation - ); - props = useWrapElement( - props, - (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(DFUIIKXE_ToolbarContext.Provider, { value: store, children: element }), - [store] - ); - props = PNRLI7OV_spreadValues({ - role: "toolbar", - "aria-orientation": orientation - }, props); - props = AAVDGJD5_useComposite(PNRLI7OV_spreadValues({ store }, props)); - return props; -}); -var Toolbar = NQJBHION_createComponent((props) => { +var useToolbar = createHook( + (_a) => { + var _b = _a, { + store: storeProp, + orientation: orientationProp, + virtualFocus, + focusLoop, + rtl + } = _b, props = __objRest(_b, [ + "store", + "orientation", + "virtualFocus", + "focusLoop", + "rtl" + ]); + const context = useToolbarProviderContext(); + storeProp = storeProp || context; + const store = useToolbarStore({ + store: storeProp, + orientation: orientationProp, + virtualFocus, + focusLoop, + rtl + }); + const orientation = store.useState( + (state) => state.orientation === "both" ? void 0 : state.orientation + ); + props = useWrapElement( + props, + (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(ToolbarScopedContextProvider, { value: store, children: element }), + [store] + ); + props = _4R3V3JGP_spreadValues({ + role: "toolbar", + "aria-orientation": orientation + }, props); + props = useComposite(_4R3V3JGP_spreadValues({ store }, props)); + return props; + } +); +var Toolbar = createComponent((props) => { const htmlProps = useToolbar(props); - return NQJBHION_createElement("div", htmlProps); + return _3ORBWXWF_createElement("div", htmlProps); }); if (false) {} @@ -74034,6 +68266,7 @@ if (false) {} /** * External dependencies */ +// eslint-disable-next-line no-restricted-imports /** * WordPress dependencies @@ -74055,9 +68288,9 @@ function UnforwardedToolbarContainer({ }); return ( // This will provide state for `ToolbarButton`'s - (0,external_wp_element_namespaceObject.createElement)(toolbar_context.Provider, { + (0,external_React_.createElement)(toolbar_context.Provider, { value: toolbarStore - }, (0,external_wp_element_namespaceObject.createElement)(Toolbar, { + }, (0,external_React_.createElement)(Toolbar, { ref: ref, "aria-label": label, store: toolbarStore, @@ -74066,7 +68299,7 @@ function UnforwardedToolbarContainer({ ); } const ToolbarContainer = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToolbarContainer); -/* harmony default export */ var toolbar_container = (ToolbarContainer); +/* harmony default export */ const toolbar_container = (ToolbarContainer); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar/toolbar/index.js @@ -74086,19 +68319,26 @@ const ToolbarContainer = (0,external_wp_element_namespaceObject.forwardRef)(Unfo -const CONTEXT_SYSTEM_VALUE = { - DropdownMenu: { - variant: 'toolbar' - }, - Dropdown: { - variant: 'toolbar' - } -}; function UnforwardedToolbar({ className, label, + variant, ...props }, ref) { + const isVariantDefined = variant !== undefined; + const contextSystemValue = (0,external_wp_element_namespaceObject.useMemo)(() => { + if (isVariantDefined) { + return {}; + } + return { + DropdownMenu: { + variant: 'toolbar' + }, + Dropdown: { + variant: 'toolbar' + } + }; + }, [isVariantDefined]); if (!label) { external_wp_deprecated_default()('Using Toolbar without label prop', { since: '5.6', @@ -74110,17 +68350,17 @@ function UnforwardedToolbar({ title: _title, ...restProps } = props; - return (0,external_wp_element_namespaceObject.createElement)(toolbar_group, { + return (0,external_React_.createElement)(toolbar_group, { isCollapsed: false, ...restProps, className: className }); } // `ToolbarGroup` already uses components-toolbar for compatibility reasons. - const finalClassName = classnames_default()('components-accessible-toolbar', className); - return (0,external_wp_element_namespaceObject.createElement)(ContextSystemProvider, { - value: CONTEXT_SYSTEM_VALUE - }, (0,external_wp_element_namespaceObject.createElement)(toolbar_container, { + const finalClassName = classnames_default()('components-accessible-toolbar', className, variant && `is-${variant}`); + return (0,external_React_.createElement)(ContextSystemProvider, { + value: contextSystemValue + }, (0,external_React_.createElement)(toolbar_container, { className: finalClassName, label: label, ref: ref, @@ -74149,7 +68389,7 @@ function UnforwardedToolbar({ * ``` */ const toolbar_Toolbar = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToolbar); -/* harmony default export */ var toolbar = (toolbar_Toolbar); +/* harmony default export */ const toolbar = (toolbar_Toolbar); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar/toolbar-dropdown-menu/index.js @@ -74171,7 +68411,7 @@ const toolbar_Toolbar = (0,external_wp_element_namespaceObject.forwardRef)(Unfor function ToolbarDropdownMenu(props, ref) { const accessibleToolbarState = (0,external_wp_element_namespaceObject.useContext)(toolbar_context); if (!accessibleToolbarState) { - return (0,external_wp_element_namespaceObject.createElement)(dropdown_menu, { + return (0,external_React_.createElement)(dropdown_menu, { ...props }); } @@ -74179,10 +68419,10 @@ function ToolbarDropdownMenu(props, ref) { // ToolbarItem will pass all props to the render prop child, which will pass // all props to the toggle of DropdownMenu. This means that ToolbarDropdownMenu // has the same API as DropdownMenu. - return (0,external_wp_element_namespaceObject.createElement)(toolbar_item, { + return (0,external_React_.createElement)(toolbar_item, { ref: ref, ...props.toggleProps - }, toolbarItemProps => (0,external_wp_element_namespaceObject.createElement)(dropdown_menu, { + }, toolbarItemProps => (0,external_React_.createElement)(dropdown_menu, { ...props, popoverProps: { ...props.popoverProps @@ -74190,7 +68430,7 @@ function ToolbarDropdownMenu(props, ref) { toggleProps: toolbarItemProps })); } -/* harmony default export */ var toolbar_dropdown_menu = ((0,external_wp_element_namespaceObject.forwardRef)(ToolbarDropdownMenu)); +/* harmony default export */ const toolbar_dropdown_menu = ((0,external_wp_element_namespaceObject.forwardRef)(ToolbarDropdownMenu)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tools-panel/styles.js @@ -74364,14 +68604,12 @@ const DefaultControlsGroup = ({ if (!items.length) { return null; } - const resetSuffix = (0,external_wp_element_namespaceObject.createElement)(ResetLabel, { + const resetSuffix = (0,external_React_.createElement)(ResetLabel, { "aria-hidden": true }, (0,external_wp_i18n_namespaceObject.__)('Reset')); - return (0,external_wp_element_namespaceObject.createElement)(menu_group, { - label: (0,external_wp_i18n_namespaceObject.__)('Defaults') - }, items.map(([label, hasValue]) => { + return (0,external_React_.createElement)(external_React_.Fragment, null, items.map(([label, hasValue]) => { if (hasValue) { - return (0,external_wp_element_namespaceObject.createElement)(menu_item, { + return (0,external_React_.createElement)(menu_item, { key: label, className: itemClassName, role: "menuitem", @@ -74387,8 +68625,9 @@ const DefaultControlsGroup = ({ suffix: resetSuffix }, label); } - return (0,external_wp_element_namespaceObject.createElement)(menu_item, { + return (0,external_React_.createElement)(menu_item, { key: label, + icon: library_check, className: itemClassName, role: "menuitemcheckbox", isSelected: true, @@ -74403,15 +68642,13 @@ const OptionalControlsGroup = ({ if (!items.length) { return null; } - return (0,external_wp_element_namespaceObject.createElement)(menu_group, { - label: (0,external_wp_i18n_namespaceObject.__)('Tools') - }, items.map(([label, isSelected]) => { + return (0,external_React_.createElement)(external_React_.Fragment, null, items.map(([label, isSelected]) => { const itemLabel = isSelected ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The name of the control being hidden and reset e.g. "Padding". (0,external_wp_i18n_namespaceObject.__)('Hide and reset %s'), label) : (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The name of the control to display e.g. "Padding". (0,external_wp_i18n_namespaceObject.__)('Show %s'), label); - return (0,external_wp_element_namespaceObject.createElement)(menu_item, { + return (0,external_React_.createElement)(menu_item, { key: label, icon: isSelected ? library_check : null, isSelected: isSelected, @@ -74444,6 +68681,7 @@ const component_ToolsPanelHeader = (props, forwardedRef) => { menuItems, resetAll, toggleItem, + dropdownMenuProps, ...headerProps } = useToolsPanelHeader(props); if (!labelText) { @@ -74457,13 +68695,14 @@ const component_ToolsPanelHeader = (props, forwardedRef) => { (0,external_wp_i18n_namespaceObject._x)('%s options', 'Button label to reveal tool panel options'), labelText); const dropdownMenuDescriptionText = areAllOptionalControlsHidden ? (0,external_wp_i18n_namespaceObject.__)('All options are currently hidden') : undefined; const canResetAll = [...defaultItems, ...optionalItems].some(([, isSelected]) => isSelected); - return (0,external_wp_element_namespaceObject.createElement)(h_stack_component, { + return (0,external_React_.createElement)(h_stack_component, { ...headerProps, ref: forwardedRef - }, (0,external_wp_element_namespaceObject.createElement)(heading_component, { + }, (0,external_React_.createElement)(heading_component, { level: headingLevel, className: headingClassName - }, labelText), hasMenuItems && (0,external_wp_element_namespaceObject.createElement)(dropdown_menu, { + }, labelText), hasMenuItems && (0,external_React_.createElement)(dropdown_menu, { + ...dropdownMenuProps, icon: dropDownMenuIcon, label: dropDownMenuLabelText, menuProps: { @@ -74473,14 +68712,16 @@ const component_ToolsPanelHeader = (props, forwardedRef) => { isSmall: true, describedBy: dropdownMenuDescriptionText } - }, () => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(DefaultControlsGroup, { + }, () => (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(menu_group, { + label: labelText + }, (0,external_React_.createElement)(DefaultControlsGroup, { items: defaultItems, toggleItem: toggleItem, itemClassName: defaultControlsItemClassName - }), (0,external_wp_element_namespaceObject.createElement)(OptionalControlsGroup, { + }), (0,external_React_.createElement)(OptionalControlsGroup, { items: optionalItems, toggleItem: toggleItem - }), (0,external_wp_element_namespaceObject.createElement)(menu_group, null, (0,external_wp_element_namespaceObject.createElement)(menu_item, { + })), (0,external_React_.createElement)(menu_group, null, (0,external_React_.createElement)(menu_item, { "aria-disabled": !canResetAll // @ts-expect-error - TODO: If this "tertiary" style is something we really want to allow on MenuItem, // we should rename it and explicitly allow it as an official API. All the other Button variants @@ -74496,7 +68737,7 @@ const component_ToolsPanelHeader = (props, forwardedRef) => { }, (0,external_wp_i18n_namespaceObject.__)('Reset all')))))); }; const ConnectedToolsPanelHeader = contextConnect(component_ToolsPanelHeader, 'ToolsPanelHeader'); -/* harmony default export */ var tools_panel_header_component = (ConnectedToolsPanelHeader); +/* harmony default export */ const tools_panel_header_component = (ConnectedToolsPanelHeader); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tools-panel/tools-panel/hook.js /** @@ -74790,19 +69031,21 @@ const UnconnectedToolsPanel = (props, forwardedRef) => { resetAllItems, toggleItem, headingLevel, + dropdownMenuProps, ...toolsPanelProps } = useToolsPanel(props); - return (0,external_wp_element_namespaceObject.createElement)(grid_component, { + return (0,external_React_.createElement)(grid_component, { ...toolsPanelProps, columns: 2, ref: forwardedRef - }, (0,external_wp_element_namespaceObject.createElement)(ToolsPanelContext.Provider, { + }, (0,external_React_.createElement)(ToolsPanelContext.Provider, { value: panelContext - }, (0,external_wp_element_namespaceObject.createElement)(tools_panel_header_component, { + }, (0,external_React_.createElement)(tools_panel_header_component, { label: label, resetAll: resetAllItems, toggleItem: toggleItem, - headingLevel: headingLevel + headingLevel: headingLevel, + dropdownMenuProps: dropdownMenuProps }), children)); }; @@ -74858,7 +69101,7 @@ const UnconnectedToolsPanel = (props, forwardedRef) => { * ``` */ const component_ToolsPanel = contextConnect(UnconnectedToolsPanel, 'ToolsPanel'); -/* harmony default export */ var tools_panel_component = (component_ToolsPanel); +/* harmony default export */ const tools_panel_component = (component_ToolsPanel); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tools-panel/tools-panel-item/hook.js /** @@ -74902,14 +69145,25 @@ function useToolsPanelItem(props) { __experimentalFirstVisibleItemClass, __experimentalLastVisibleItemClass } = useToolsPanelContext(); - const hasValueCallback = (0,external_wp_element_namespaceObject.useCallback)(hasValue, [panelId, hasValue]); - const resetAllFilterCallback = (0,external_wp_element_namespaceObject.useCallback)(resetAllFilter, [panelId, resetAllFilter]); + + // hasValue is a new function on every render, so do not add it as a + // dependency to the useCallback hook! If needed, we should use a ref. + // eslint-disable-next-line react-hooks/exhaustive-deps + const hasValueCallback = (0,external_wp_element_namespaceObject.useCallback)(hasValue, [panelId]); + // resetAllFilter is a new function on every render, so do not add it as a + // dependency to the useCallback hook! If needed, we should use a ref. + // eslint-disable-next-line react-hooks/exhaustive-deps + const resetAllFilterCallback = (0,external_wp_element_namespaceObject.useCallback)(resetAllFilter, [panelId]); const previousPanelId = (0,external_wp_compose_namespaceObject.usePrevious)(currentPanelId); const hasMatchingPanel = currentPanelId === panelId || currentPanelId === null; // Registering the panel item allows the panel to include it in its // automatically generated menu and determine its initial checked status. - (0,external_wp_element_namespaceObject.useEffect)(() => { + // + // This is performed in a layout effect to ensure that the panel item + // is registered before it is rendered preventing a rendering glitch. + // See: https://github.com/WordPress/gutenberg/issues/56470 + (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { if (hasMatchingPanel && previousPanelId !== null) { registerPanelItem({ hasValue: hasValueCallback, @@ -74946,19 +69200,12 @@ function useToolsPanelItem(props) { const newValueSet = isValueSet && !wasValueSet; // Notify the panel when an item's value has been set. - // - // 1. For default controls, this is so "reset" appears beside its menu item. - // 2. For optional controls, when the panel ID is `null`, it allows the - // panel to ensure the item is toggled on for display in the menu, given the - // value has been set external to the control. (0,external_wp_element_namespaceObject.useEffect)(() => { if (!newValueSet) { return; } - if (isShownByDefault || currentPanelId === null) { - flagItemCustomization(label, menuGroup); - } - }, [currentPanelId, newValueSet, isShownByDefault, menuGroup, label, flagItemCustomization]); + flagItemCustomization(label, menuGroup); + }, [newValueSet, menuGroup, label, flagItemCustomization]); // Determine if the panel item's corresponding menu is being toggled and // trigger appropriate callback if it is. @@ -74983,10 +69230,10 @@ function useToolsPanelItem(props) { const isShown = isShownByDefault ? menuItems?.[menuGroup]?.[label] !== undefined : isMenuItemChecked; const cx = useCx(); const classes = (0,external_wp_element_namespaceObject.useMemo)(() => { - const placeholderStyle = shouldRenderPlaceholder && !isShown && ToolsPanelItemPlaceholder; + const shouldApplyPlaceholderStyles = shouldRenderPlaceholder && !isShown; const firstItemStyle = firstDisplayedItem === label && __experimentalFirstVisibleItemClass; const lastItemStyle = lastDisplayedItem === label && __experimentalLastVisibleItemClass; - return cx(ToolsPanelItem, placeholderStyle, className, firstItemStyle, lastItemStyle); + return cx(ToolsPanelItem, shouldApplyPlaceholderStyles && ToolsPanelItemPlaceholder, !shouldApplyPlaceholderStyles && className, firstItemStyle, lastItemStyle); }, [isShown, shouldRenderPlaceholder, className, cx, firstDisplayedItem, lastDisplayedItem, __experimentalFirstVisibleItemClass, __experimentalLastVisibleItemClass, label]); return { ...otherProps, @@ -75018,18 +69265,18 @@ const UnconnectedToolsPanelItem = (props, forwardedRef) => { ...toolsPanelItemProps } = useToolsPanelItem(props); if (!isShown) { - return shouldRenderPlaceholder ? (0,external_wp_element_namespaceObject.createElement)(component, { + return shouldRenderPlaceholder ? (0,external_React_.createElement)(component, { ...toolsPanelItemProps, ref: forwardedRef }) : null; } - return (0,external_wp_element_namespaceObject.createElement)(component, { + return (0,external_React_.createElement)(component, { ...toolsPanelItemProps, ref: forwardedRef }, children); }; const component_ToolsPanelItem = contextConnect(UnconnectedToolsPanelItem, 'ToolsPanelItem'); -/* harmony default export */ var tools_panel_item_component = (component_ToolsPanelItem); +/* harmony default export */ const tools_panel_item_component = (component_ToolsPanelItem); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-grid/roving-tab-index-context.js /** @@ -75069,7 +69316,7 @@ function RovingTabIndex({ lastFocusedElement, setLastFocusedElement }), [lastFocusedElement]); - return (0,external_wp_element_namespaceObject.createElement)(RovingTabIndexProvider, { + return (0,external_React_.createElement)(RovingTabIndexProvider, { value: providerValue }, children); } @@ -75308,15 +69555,15 @@ ref) { /* Disable reason: A treegrid is implemented using a table element. */ /* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */ - return (0,external_wp_element_namespaceObject.createElement)(RovingTabIndex, null, (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)(RovingTabIndex, null, (0,external_React_.createElement)("div", { role: "application", "aria-label": applicationAriaLabel - }, (0,external_wp_element_namespaceObject.createElement)("table", { + }, (0,external_React_.createElement)("table", { ...props, role: "treegrid", onKeyDown: onKeyDown, ref: ref - }, (0,external_wp_element_namespaceObject.createElement)("tbody", null, children)))); + }, (0,external_React_.createElement)("tbody", null, children)))); /* eslint-enable jsx-a11y/no-noninteractive-element-to-interactive-role */ } @@ -75383,7 +69630,7 @@ ref) { * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html} */ const TreeGrid = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTreeGrid); -/* harmony default export */ var tree_grid = (TreeGrid); +/* harmony default export */ const tree_grid = (TreeGrid); @@ -75407,7 +69654,7 @@ function UnforwardedTreeGridRow({ isExpanded, ...props }, ref) { - return (0,external_wp_element_namespaceObject.createElement)("tr", { + return (0,external_React_.createElement)("tr", { ...props, ref: ref, role: "row", @@ -75426,7 +69673,7 @@ function UnforwardedTreeGridRow({ * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html} */ const TreeGridRow = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTreeGridRow); -/* harmony default export */ var tree_grid_row = (TreeGridRow); +/* harmony default export */ const tree_grid_row = (TreeGridRow); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-grid/roving-tab-index-item.js @@ -75471,11 +69718,11 @@ const RovingTabIndexItem = (0,external_wp_element_namespaceObject.forwardRef)(fu return children(allProps); } if (!Component) return null; - return (0,external_wp_element_namespaceObject.createElement)(Component, { + return (0,external_React_.createElement)(Component, { ...allProps }, children); }); -/* harmony default export */ var roving_tab_index_item = (RovingTabIndexItem); +/* harmony default export */ const roving_tab_index_item = (RovingTabIndexItem); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-grid/item.js @@ -75492,7 +69739,7 @@ function UnforwardedTreeGridItem({ children, ...props }, ref) { - return (0,external_wp_element_namespaceObject.createElement)(roving_tab_index_item, { + return (0,external_React_.createElement)(roving_tab_index_item, { ref: ref, ...props }, children); @@ -75506,7 +69753,7 @@ function UnforwardedTreeGridItem({ * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html} */ const TreeGridItem = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTreeGridItem); -/* harmony default export */ var tree_grid_item = (TreeGridItem); +/* harmony default export */ const tree_grid_item = (TreeGridItem); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tree-grid/cell.js @@ -75524,10 +69771,10 @@ function UnforwardedTreeGridCell({ withoutGridItem = false, ...props }, ref) { - return (0,external_wp_element_namespaceObject.createElement)("td", { + return (0,external_React_.createElement)("td", { ...props, role: "gridcell" - }, withoutGridItem ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, children) : (0,external_wp_element_namespaceObject.createElement)(tree_grid_item, { + }, withoutGridItem ? (0,external_React_.createElement)(external_React_.Fragment, null, children) : (0,external_React_.createElement)(tree_grid_item, { ref: ref }, children)); } @@ -75540,7 +69787,7 @@ function UnforwardedTreeGridCell({ * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html} */ const TreeGridCell = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedTreeGridCell); -/* harmony default export */ var cell = (TreeGridCell); +/* harmony default export */ const cell = (TreeGridCell); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/isolated-event-container/index.js @@ -75564,18 +69811,16 @@ const IsolatedEventContainer = (0,external_wp_element_namespaceObject.forwardRef // Disable reason: this stops certain events from propagating outside of the component. // - onMouseDown is disabled as this can cause interactions with other DOM elements. /* eslint-disable jsx-a11y/no-static-element-interactions */ - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { ...props, ref: ref, onMouseDown: stopPropagation }); /* eslint-enable jsx-a11y/no-static-element-interactions */ }); - -/* harmony default export */ var isolated_event_container = (IsolatedEventContainer); +/* harmony default export */ const isolated_event_container = (IsolatedEventContainer); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/use-slot-fills.js -// @ts-nocheck /** * External dependencies */ @@ -75597,7 +69842,7 @@ function useSlotFills(name) { }); // The important bit here is that this call ensures that the hook // only causes a re-render if the "fills" of a given slot name - // change change, not any fills. + // change, not any fills. return fills.get(name); } @@ -75664,13 +69909,13 @@ function UnconnectedZStack(props, forwardedRef) { // the item's index, so that items can correctly stack at the right distance const offsetAmount = isLayered ? offset * index : offset; const key = (0,external_wp_element_namespaceObject.isValidElement)(child) ? child.key : index; - return (0,external_wp_element_namespaceObject.createElement)(ZStackChildView, { + return (0,external_React_.createElement)(ZStackChildView, { offsetAmount: offsetAmount, zIndex: zIndex, key: key }, child); }); - return (0,external_wp_element_namespaceObject.createElement)(ZStackView, { + return (0,external_React_.createElement)(ZStackView, { ...otherProps, className: className, isLayered: isLayered, @@ -75696,7 +69941,7 @@ function UnconnectedZStack(props, forwardedRef) { * ``` */ const ZStack = contextConnect(UnconnectedZStack, 'ZStack'); -/* harmony default export */ var z_stack_component = (ZStack); +/* harmony default export */ const z_stack_component = (ZStack); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/navigate-regions/index.js @@ -75805,12 +70050,12 @@ function useNavigateRegions(shortcuts = defaultShortcuts) { * ) ); * ``` */ -/* harmony default export */ var navigate_regions = ((0,external_wp_compose_namespaceObject.createHigherOrderComponent)(Component => ({ +/* harmony default export */ const navigate_regions = ((0,external_wp_compose_namespaceObject.createHigherOrderComponent)(Component => ({ shortcuts, ...props -}) => (0,external_wp_element_namespaceObject.createElement)("div", { +}) => (0,external_React_.createElement)("div", { ...useNavigateRegions(shortcuts) -}, (0,external_wp_element_namespaceObject.createElement)(Component, { +}, (0,external_React_.createElement)(Component, { ...props })), 'navigateRegions')); @@ -75831,14 +70076,14 @@ function useNavigateRegions(shortcuts = defaultShortcuts) { */ const withConstrainedTabbing = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => function ComponentWithConstrainedTabbing(props) { const ref = (0,external_wp_compose_namespaceObject.useConstrainedTabbing)(); - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { ref: ref, tabIndex: -1 - }, (0,external_wp_element_namespaceObject.createElement)(WrappedComponent, { + }, (0,external_React_.createElement)(WrappedComponent, { ...props })); }, 'withConstrainedTabbing'); -/* harmony default export */ var with_constrained_tabbing = (withConstrainedTabbing); +/* harmony default export */ const with_constrained_tabbing = (withConstrainedTabbing); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-fallback-styles/index.js @@ -75852,7 +70097,7 @@ const withConstrainedTabbing = (0,external_wp_compose_namespaceObject.createHigh */ -/* harmony default export */ var with_fallback_styles = (mapNodeToProps => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => { +/* harmony default export */ const with_fallback_styles = (mapNodeToProps => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => { return class extends external_wp_element_namespaceObject.Component { constructor(props) { super(props); @@ -75891,11 +70136,11 @@ const withConstrainedTabbing = (0,external_wp_compose_namespaceObject.createHigh } } render() { - const wrappedComponent = (0,external_wp_element_namespaceObject.createElement)(WrappedComponent, { + const wrappedComponent = (0,external_React_.createElement)(WrappedComponent, { ...this.props, ...this.state.fallbackStyles }); - return this.props.node ? wrappedComponent : (0,external_wp_element_namespaceObject.createElement)("div", { + return this.props.node ? wrappedComponent : (0,external_React_.createElement)("div", { ref: this.bindRef }, " ", wrappedComponent, " "); } @@ -75903,7 +70148,7 @@ const withConstrainedTabbing = (0,external_wp_compose_namespaceObject.createHigh }, 'withFallbackStyles')); ;// CONCATENATED MODULE: external ["wp","hooks"] -var external_wp_hooks_namespaceObject = window["wp"]["hooks"]; +const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-filters/index.js /** @@ -75996,7 +70241,7 @@ function withFilters(hookName) { } } render() { - return (0,external_wp_element_namespaceObject.createElement)(FilteredComponent, { + return (0,external_React_.createElement)(FilteredComponent, { ...this.props }); } @@ -76067,7 +70312,7 @@ function isComponentLike(object) { * * @return Higher Order Component with the focus restauration behaviour. */ -/* harmony default export */ var with_focus_return = ((0,external_wp_compose_namespaceObject.createHigherOrderComponent)( +/* harmony default export */ const with_focus_return = ((0,external_wp_compose_namespaceObject.createHigherOrderComponent)( // @ts-expect-error TODO: Reconcile with intended `createHigherOrderComponent` types options => { const HoC = ({ @@ -76075,9 +70320,9 @@ options => { } = {}) => WrappedComponent => { const WithFocusReturn = props => { const ref = (0,external_wp_compose_namespaceObject.useFocusReturn)(onFocusReturn); - return (0,external_wp_element_namespaceObject.createElement)("div", { + return (0,external_React_.createElement)("div", { ref: ref - }, (0,external_wp_element_namespaceObject.createElement)(WrappedComponent, { + }, (0,external_React_.createElement)(WrappedComponent, { ...props })); }; @@ -76145,7 +70390,7 @@ const with_focus_return_Provider = ({ * * @return Wrapped component. */ -/* harmony default export */ var with_notices = ((0,external_wp_compose_namespaceObject.createHigherOrderComponent)(OriginalComponent => { +/* harmony default export */ const with_notices = ((0,external_wp_compose_namespaceObject.createHigherOrderComponent)(OriginalComponent => { function Component(props, ref) { const [noticeList, setNoticeList] = (0,external_wp_element_namespaceObject.useState)([]); const noticeOperations = (0,external_wp_element_namespaceObject.useMemo)(() => { @@ -76177,16 +70422,16 @@ const with_focus_return_Provider = ({ ...props, noticeList, noticeOperations, - noticeUI: noticeList.length > 0 && (0,external_wp_element_namespaceObject.createElement)(list, { + noticeUI: noticeList.length > 0 && (0,external_React_.createElement)(list, { className: "components-with-notices-ui", notices: noticeList, onRemove: noticeOperations.removeNotice }) }; - return isForwardRef ? (0,external_wp_element_namespaceObject.createElement)(OriginalComponent, { + return isForwardRef ? (0,external_React_.createElement)(OriginalComponent, { ...propsOut, ref: ref - }) : (0,external_wp_element_namespaceObject.createElement)(OriginalComponent, { + }) : (0,external_React_.createElement)(OriginalComponent, { ...propsOut }); } @@ -76203,8 +70448,6 @@ const with_focus_return_Provider = ({ return Component; }, 'withNotices')); -;// CONCATENATED MODULE: external ["wp","privateApis"] -var external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/progress-bar/styles.js function progress_bar_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } @@ -76277,12 +70520,12 @@ function UnforwardedProgressBar(props, ref) { ...progressProps } = props; const isIndeterminate = !Number.isFinite(value); - return (0,external_wp_element_namespaceObject.createElement)(styles_Track, { + return (0,external_React_.createElement)(styles_Track, { className: className - }, (0,external_wp_element_namespaceObject.createElement)(Indicator, { + }, (0,external_React_.createElement)(Indicator, { isIndeterminate: isIndeterminate, value: value - }), (0,external_wp_element_namespaceObject.createElement)(ProgressElement, { + }), (0,external_React_.createElement)(ProgressElement, { max: 100, value: value, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Loading …'), @@ -76291,351 +70534,189 @@ function UnforwardedProgressBar(props, ref) { })); } const ProgressBar = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedProgressBar); -/* harmony default export */ var progress_bar = (ProgressBar); +/* harmony default export */ const progress_bar = (ProgressBar); -;// CONCATENATED MODULE: ./node_modules/@radix-ui/primitive/dist/index.module.js -function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented: checkForDefaultPrevented = true } = {}) { - return function handleEvent(event) { - originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event); - if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event); - }; -} +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/YGMEBI3A.js +"use client"; +// src/menu/menu-context.ts -;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-compose-refs/dist/index.module.js +var YGMEBI3A_menu = createStoreContext( + [CompositeContextProvider, HovercardContextProvider], + [CompositeScopedContextProvider, HovercardScopedContextProvider] +); +var useMenuContext = YGMEBI3A_menu.useContext; +var useMenuScopedContext = YGMEBI3A_menu.useScopedContext; +var useMenuProviderContext = YGMEBI3A_menu.useProviderContext; +var MenuContextProvider = YGMEBI3A_menu.ContextProvider; +var MenuScopedContextProvider = YGMEBI3A_menu.ScopedContextProvider; +var useMenuBarContext = (/* unused pure expression or super */ null && (useMenubarContext)); +var useMenuBarScopedContext = (/* unused pure expression or super */ null && (useMenubarScopedContext)); +var useMenuBarProviderContext = (/* unused pure expression or super */ null && (useMenubarProviderContext)); +var MenuBarContextProvider = (/* unused pure expression or super */ null && (MenubarContextProvider)); +var MenuBarScopedContextProvider = (/* unused pure expression or super */ null && (MenubarScopedContextProvider)); +var MenuItemCheckedContext = (0,external_React_.createContext)( + void 0 +); -/** - * Set a given ref to a given value - * This utility takes care of different types of refs: callback refs and RefObject(s) - */ function $6ed0406888f73fc4$var$setRef(ref, value) { - if (typeof ref === 'function') ref(value); - else if (ref !== null && ref !== undefined) ref.current = value; -} -/** - * A utility to compose multiple refs together - * Accepts callback refs and RefObject(s) - */ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) { - return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node) - ) - ; -} -/** - * A custom hook that composes multiple refs - * Accepts callback refs and RefObject(s) - */ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) { - // eslint-disable-next-line react-hooks/exhaustive-deps - return (0,external_React_.useCallback)($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs); -} +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/6XBVQI3K.js +"use client"; +// src/checkbox/checkbox-checked-context.ts +var CheckboxCheckedContext = (0,external_React_.createContext)(false); +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/MW2F7SEA.js +"use client"; -;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-context/dist/index.module.js -function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) { - const Context = /*#__PURE__*/ $3bkAK$createContext(defaultContext); - function Provider(props) { - const { children: children , ...context } = props; // Only re-memoize when prop values change - // eslint-disable-next-line react-hooks/exhaustive-deps - const value = $3bkAK$useMemo(()=>context - , Object.values(context)); - return /*#__PURE__*/ $3bkAK$createElement(Context.Provider, { - value: value - }, children); - } - function useContext(consumerName) { - const context = $3bkAK$useContext(Context); - if (context) return context; - if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context. - throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``); - } - Provider.displayName = rootComponentName + 'Provider'; - return [ - Provider, - useContext - ]; -} -/* ------------------------------------------------------------------------------------------------- - * createContextScope - * -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeDeps = []) { - let defaultContexts = []; - /* ----------------------------------------------------------------------------------------------- - * createContext - * ---------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) { - const BaseContext = /*#__PURE__*/ (0,external_React_.createContext)(defaultContext); - const index = defaultContexts.length; - defaultContexts = [ - ...defaultContexts, - defaultContext - ]; - function Provider(props) { - const { scope: scope , children: children , ...context } = props; - const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; // Only re-memoize when prop values change - // eslint-disable-next-line react-hooks/exhaustive-deps - const value = (0,external_React_.useMemo)(()=>context - , Object.values(context)); - return /*#__PURE__*/ (0,external_React_.createElement)(Context.Provider, { - value: value - }, children); - } - function useContext(consumerName, scope) { - const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; - const context = (0,external_React_.useContext)(Context); - if (context) return context; - if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context. - throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``); - } - Provider.displayName = rootComponentName + 'Provider'; - return [ - Provider, - useContext - ]; - } - /* ----------------------------------------------------------------------------------------------- - * createScope - * ---------------------------------------------------------------------------------------------*/ const createScope = ()=>{ - const scopeContexts = defaultContexts.map((defaultContext)=>{ - return /*#__PURE__*/ (0,external_React_.createContext)(defaultContext); - }); - return function useScope(scope) { - const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts; - return (0,external_React_.useMemo)(()=>({ - [`__scope${scopeName}`]: { - ...scope, - [scopeName]: contexts - } - }) - , [ - scope, - contexts - ]); - }; - }; - createScope.scopeName = scopeName; - return [ - $c512c27ab02ef895$export$fd42f52fd3ae1109, - $c512c27ab02ef895$var$composeContextScopes(createScope, ...createContextScopeDeps) - ]; -} -/* ------------------------------------------------------------------------------------------------- - * composeContextScopes - * -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes(...scopes) { - const baseScope = scopes[0]; - if (scopes.length === 1) return baseScope; - const createScope1 = ()=>{ - const scopeHooks = scopes.map((createScope)=>({ - useScope: createScope(), - scopeName: createScope.scopeName - }) - ); - return function useComposedScopes(overrideScopes) { - const nextScopes1 = scopeHooks.reduce((nextScopes, { useScope: useScope , scopeName: scopeName })=>{ - // We are calling a hook inside a callback which React warns against to avoid inconsistent - // renders, however, scoping doesn't have render side effects so we ignore the rule. - // eslint-disable-next-line react-hooks/rules-of-hooks - const scopeProps = useScope(overrideScopes); - const currentScope = scopeProps[`__scope${scopeName}`]; - return { - ...nextScopes, - ...currentScope - }; - }, {}); - return (0,external_React_.useMemo)(()=>({ - [`__scope${baseScope.scopeName}`]: nextScopes1 - }) - , [ - nextScopes1 - ]); - }; - }; - createScope1.scopeName = baseScope.scopeName; - return createScope1; -} - +// src/checkbox/checkbox-check.tsx +var checkmark = /* @__PURE__ */ (0,jsx_runtime.jsx)( + "svg", + { + display: "block", + fill: "none", + stroke: "currentColor", + strokeLinecap: "round", + strokeLinejoin: "round", + strokeWidth: "1.5pt", + viewBox: "0 0 16 16", + height: "1em", + width: "1em", + children: /* @__PURE__ */ (0,jsx_runtime.jsx)("polyline", { points: "4,8 7,12 12,4" }) + } +); +function getChildren(props) { + if (props.checked) { + return props.children || checkmark; + } + if (typeof props.children === "function") { + return props.children; + } + return null; +} +var useCheckboxCheck = createHook( + (_a) => { + var _b = _a, { store, checked } = _b, props = __objRest(_b, ["store", "checked"]); + const context = (0,external_React_.useContext)(CheckboxCheckedContext); + checked = checked != null ? checked : context; + const children = getChildren({ checked, children: props.children }); + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ + "aria-hidden": true + }, props), { + children, + style: _4R3V3JGP_spreadValues({ + width: "1em", + height: "1em", + pointerEvents: "none" + }, props.style) + }); + return props; + } +); +var CheckboxCheck = createComponent((props) => { + const htmlProps = useCheckboxCheck(props); + return _3ORBWXWF_createElement("span", htmlProps); +}); +if (false) {} -;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-use-callback-ref/dist/index.module.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/menu/menu-item-check.js +"use client"; -/** - * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a - * prop or avoid re-executing effects when passed as a dependency - */ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) { - const callbackRef = (0,external_React_.useRef)(callback); - (0,external_React_.useEffect)(()=>{ - callbackRef.current = callback; - }); // https://github.com/facebook/react/issues/19240 - return (0,external_React_.useMemo)(()=>(...args)=>{ - var _callbackRef$current; - return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args); - } - , []); -} -;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-use-controllable-state/dist/index.module.js -function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop: prop , defaultProp: defaultProp , onChange: onChange = ()=>{} }) { - const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({ - defaultProp: defaultProp, - onChange: onChange - }); - const isControlled = prop !== undefined; - const value1 = isControlled ? prop : uncontrolledProp; - const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange); - const setValue = (0,external_React_.useCallback)((nextValue)=>{ - if (isControlled) { - const setter = nextValue; - const value = typeof nextValue === 'function' ? setter(prop) : nextValue; - if (value !== prop) handleChange(value); - } else setUncontrolledProp(nextValue); - }, [ - isControlled, - prop, - setUncontrolledProp, - handleChange - ]); - return [ - value1, - setValue - ]; -} -function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp: defaultProp , onChange: onChange }) { - const uncontrolledState = (0,external_React_.useState)(defaultProp); - const [value] = uncontrolledState; - const prevValueRef = (0,external_React_.useRef)(value); - const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange); - (0,external_React_.useEffect)(()=>{ - if (prevValueRef.current !== value) { - handleChange(value); - prevValueRef.current = value; - } - }, [ - value, - prevValueRef, - handleChange - ]); - return uncontrolledState; -} +// src/menu/menu-item-check.ts +var useMenuItemCheck = createHook( + (_a) => { + var _b = _a, { store, checked } = _b, props = __objRest(_b, ["store", "checked"]); + const context = (0,external_React_.useContext)(MenuItemCheckedContext); + checked = checked != null ? checked : context; + props = useCheckboxCheck(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { checked })); + return props; + } +); +var MenuItemCheck = createComponent((props) => { + const htmlProps = useMenuItemCheck(props); + return _3ORBWXWF_createElement("span", htmlProps); +}); +if (false) {} +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/KA4GX64Z.js +"use client"; -;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-slot/dist/index.module.js +// src/menubar/menubar-context.ts +var menubar = createStoreContext( + [CompositeContextProvider], + [CompositeScopedContextProvider] +); +var KA4GX64Z_useMenubarContext = menubar.useContext; +var KA4GX64Z_useMenubarScopedContext = menubar.useScopedContext; +var KA4GX64Z_useMenubarProviderContext = menubar.useProviderContext; +var KA4GX64Z_MenubarContextProvider = menubar.ContextProvider; +var KA4GX64Z_MenubarScopedContextProvider = menubar.ScopedContextProvider; +var KA4GX64Z_MenuItemCheckedContext = (0,external_React_.createContext)( + void 0 +); +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/W76OTZCC.js +"use client"; -/* ------------------------------------------------------------------------------------------------- - * Slot - * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { children: children , ...slotProps } = props; - const childrenArray = external_React_.Children.toArray(children); - const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable); - if (slottable) { - // the new element to render is the one passed as a child of `Slottable` - const newElement = slottable.props.children; - const newChildren = childrenArray.map((child)=>{ - if (child === slottable) { - // because the new element will be the one rendered, we are only interested - // in grabbing its children (`newElement.props.children`) - if (external_React_.Children.count(newElement) > 1) return external_React_.Children.only(null); - return /*#__PURE__*/ (0,external_React_.isValidElement)(newElement) ? newElement.props.children : null; - } else return child; - }); - return /*#__PURE__*/ (0,external_React_.createElement)($5e63c961fc1ce211$var$SlotClone, extends_extends({}, slotProps, { - ref: forwardedRef - }), /*#__PURE__*/ (0,external_React_.isValidElement)(newElement) ? /*#__PURE__*/ (0,external_React_.cloneElement)(newElement, undefined, newChildren) : null); - } - return /*#__PURE__*/ (0,external_React_.createElement)($5e63c961fc1ce211$var$SlotClone, extends_extends({}, slotProps, { - ref: forwardedRef - }), children); -}); -$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot'; -/* ------------------------------------------------------------------------------------------------- - * SlotClone - * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { children: children , ...slotProps } = props; - if (/*#__PURE__*/ (0,external_React_.isValidElement)(children)) return /*#__PURE__*/ (0,external_React_.cloneElement)(children, { - ...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props), - ref: $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref) - }); - return external_React_.Children.count(children) > 1 ? external_React_.Children.only(null) : null; -}); -$5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone'; -/* ------------------------------------------------------------------------------------------------- - * Slottable - * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{ - return /*#__PURE__*/ (0,external_React_.createElement)(external_React_.Fragment, null, children); -}; -/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) { - return /*#__PURE__*/ (0,external_React_.isValidElement)(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45; -} -function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) { - // all child props should override - const overrideProps = { - ...childProps - }; - for(const propName in childProps){ - const slotPropValue = slotProps[propName]; - const childPropValue = childProps[propName]; - const isHandler = /^on[A-Z]/.test(propName); - if (isHandler) { - // if the handler exists on both, we compose them - if (slotPropValue && childPropValue) overrideProps[propName] = (...args)=>{ - childPropValue(...args); - slotPropValue(...args); - }; - else if (slotPropValue) overrideProps[propName] = slotPropValue; - } else if (propName === 'style') overrideProps[propName] = { - ...slotPropValue, - ...childPropValue - }; - else if (propName === 'className') overrideProps[propName] = [ - slotPropValue, - childPropValue - ].filter(Boolean).join(' '); - } - return { - ...slotProps, - ...overrideProps - }; -} -const $5e63c961fc1ce211$export$be92b6f5f03c0fe9 = (/* unused pure expression or super */ null && ($5e63c961fc1ce211$export$8c6ed5c666ac1360)); +// src/combobox/combobox-context.tsx +var W76OTZCC_ctx = createStoreContext( + [PopoverContextProvider, CompositeContextProvider], + [PopoverScopedContextProvider, CompositeScopedContextProvider] +); +var useComboboxContext = W76OTZCC_ctx.useContext; +var useComboboxScopedContext = W76OTZCC_ctx.useScopedContext; +var useComboboxProviderContext = W76OTZCC_ctx.useProviderContext; +var ComboboxContextProvider = W76OTZCC_ctx.ContextProvider; +var ComboboxScopedContextProvider = W76OTZCC_ctx.ScopedContextProvider; +var ComboboxItemValueContext = (0,external_React_.createContext)( + void 0 +); +var ComboboxItemCheckedContext = (0,external_React_.createContext)(false); -;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-primitive/dist/index.module.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/menu/menu-store.js +"use client"; @@ -76645,94 +70726,117 @@ const $5e63c961fc1ce211$export$be92b6f5f03c0fe9 = (/* unused pure expression or -const $8927f6f2acc4f386$var$NODES = [ - 'a', - 'button', - 'div', - 'form', - 'h2', - 'h3', - 'img', - 'input', - 'label', - 'li', - 'nav', - 'ol', - 'p', - 'span', - 'svg', - 'ul' -]; // Temporary while we await merge of this fix: -// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55396 -// prettier-ignore -/* ------------------------------------------------------------------------------------------------- - * Primitive - * -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node)=>{ - const Node = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { asChild: asChild , ...primitiveProps } = props; - const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node; - (0,external_React_.useEffect)(()=>{ - window[Symbol.for('radix-ui')] = true; - }, []); - return /*#__PURE__*/ (0,external_React_.createElement)(Comp, extends_extends({}, primitiveProps, { - ref: forwardedRef - })); - }); - Node.displayName = `Primitive.${node}`; - return { - ...primitive, - [node]: Node - }; -}, {}); -/* ------------------------------------------------------------------------------------------------- - * Utils - * -----------------------------------------------------------------------------------------------*/ /** - * Flush custom event dispatch - * https://github.com/radix-ui/primitives/pull/1378 - * - * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types. - * - * Internally, React prioritises events in the following order: - * - discrete - * - continuous - * - default - * - * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350 - * - * `discrete` is an important distinction as updates within these events are applied immediately. - * React however, is not able to infer the priority of custom event types due to how they are detected internally. - * Because of this, it's possible for updates from custom events to be unexpectedly batched when - * dispatched by another `discrete` event. - * - * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch. - * This utility should be used when dispatching a custom event from within another `discrete` event, this utility - * is not nessesary when dispatching known event types, or if dispatching a custom type inside a non-discrete event. - * For example: - * - * dispatching a known click 👎 - * target.dispatchEvent(new Event(‘click’)) - * - * dispatching a custom type within a non-discrete event 👎 - * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))} - * - * dispatching a custom type within a `discrete` event 👍 - * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))} - * - * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use - * this utility with them. This is because it's possible for those handlers to be called implicitly during render - * e.g. when focus is within a component as it is unmounted, or when managing focus on mount. - */ function $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event) { - if (target) (0,external_ReactDOM_namespaceObject.flushSync)(()=>target.dispatchEvent(event) - ); -} -/* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$be92b6f5f03c0fe9 = (/* unused pure expression or super */ null && ($8927f6f2acc4f386$export$250ffa63cdc0d034)); +// src/menu/menu-store.ts +function createMenuStore(_a = {}) { + var _b = _a, { + combobox, + parent, + menubar + } = _b, props = _4R3V3JGP_objRest(_b, [ + "combobox", + "parent", + "menubar" + ]); + const parentIsMenubar = !!menubar && !parent; + const store = mergeStore( + props.store, + pick2(parent, ["values"]), + omit2(combobox, [ + "arrowElement", + "anchorElement", + "contentElement", + "popoverElement", + "disclosureElement" + ]) + ); + throwOnConflictingProps(props, store); + const syncState = store.getState(); + const composite = createCompositeStore(_chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, props), { + store, + orientation: defaultValue( + props.orientation, + syncState.orientation, + "vertical" + ) + })); + const hovercard = createHovercardStore(_chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, props), { + store, + placement: defaultValue( + props.placement, + syncState.placement, + "bottom-start" + ), + timeout: defaultValue( + props.timeout, + syncState.timeout, + parentIsMenubar ? 0 : 150 + ), + hideTimeout: defaultValue(props.hideTimeout, syncState.hideTimeout, 0) + })); + const initialState = _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, composite.getState()), hovercard.getState()), { + initialFocus: defaultValue(syncState.initialFocus, "container"), + values: defaultValue( + props.values, + syncState.values, + props.defaultValues, + {} + ) + }); + const menu = createStore(initialState, composite, hovercard, store); + setup( + menu, + () => sync(menu, ["mounted"], (state) => { + if (state.mounted) + return; + menu.setState("activeId", null); + }) + ); + setup( + menu, + () => sync(parent, ["orientation"], (state) => { + menu.setState( + "placement", + state.orientation === "vertical" ? "right-start" : "bottom-start" + ); + }) + ); + return _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, composite), hovercard), menu), { + combobox, + parent, + menubar, + hideAll: () => { + hovercard.hide(); + parent == null ? void 0 : parent.hideAll(); + }, + setInitialFocus: (value) => menu.setState("initialFocus", value), + setValues: (values) => menu.setState("values", values), + setValue: (name, value) => { + if (name === "__proto__") + return; + if (name === "constructor") + return; + if (Array.isArray(name)) + return; + menu.setState("values", (values) => { + const prevValue = values[name]; + const nextValue = Y3OOHFCN_applyState(value, prevValue); + if (nextValue === prevValue) + return values; + return _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, values), { + [name]: nextValue !== void 0 && nextValue + }); + }); + } + }); +} +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/XJXP7ZSQ.js +"use client"; -;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-collection/dist/index.module.js @@ -76741,1025 +70845,750 @@ const $8927f6f2acc4f386$var$NODES = [ +// src/menu/menu-store.ts -// We have resorted to returning slots directly rather than exposing primitives that can then -// be slotted like `<CollectionItem as={Slot}>…</CollectionItem>`. -// This is because we encountered issues with generic types that cannot be statically analysed -// due to creating them dynamically via createCollection. -function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) { - /* ----------------------------------------------------------------------------------------------- - * CollectionProvider - * ---------------------------------------------------------------------------------------------*/ const PROVIDER_NAME = name + 'CollectionProvider'; - const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1(PROVIDER_NAME); - const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, { - collectionRef: { - current: null - }, - itemMap: new Map() - }); - const CollectionProvider = (props)=>{ - const { scope: scope , children: children } = props; - const ref = external_React_default().useRef(null); - const itemMap = external_React_default().useRef(new Map()).current; - return /*#__PURE__*/ external_React_default().createElement(CollectionProviderImpl, { - scope: scope, - itemMap: itemMap, - collectionRef: ref - }, children); - }; - /*#__PURE__*/ Object.assign(CollectionProvider, { - displayName: PROVIDER_NAME - }); - /* ----------------------------------------------------------------------------------------------- - * CollectionSlot - * ---------------------------------------------------------------------------------------------*/ const COLLECTION_SLOT_NAME = name + 'CollectionSlot'; - const CollectionSlot = /*#__PURE__*/ external_React_default().forwardRef((props, forwardedRef)=>{ - const { scope: scope , children: children } = props; - const context = useCollectionContext(COLLECTION_SLOT_NAME, scope); - const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.collectionRef); - return /*#__PURE__*/ external_React_default().createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, { - ref: composedRefs - }, children); - }); - /*#__PURE__*/ Object.assign(CollectionSlot, { - displayName: COLLECTION_SLOT_NAME - }); - /* ----------------------------------------------------------------------------------------------- - * CollectionItem - * ---------------------------------------------------------------------------------------------*/ const ITEM_SLOT_NAME = name + 'CollectionItemSlot'; - const ITEM_DATA_ATTR = 'data-radix-collection-item'; - const CollectionItemSlot = /*#__PURE__*/ external_React_default().forwardRef((props, forwardedRef)=>{ - const { scope: scope , children: children , ...itemData } = props; - const ref = external_React_default().useRef(null); - const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref); - const context = useCollectionContext(ITEM_SLOT_NAME, scope); - external_React_default().useEffect(()=>{ - context.itemMap.set(ref, { - ref: ref, - ...itemData - }); - return ()=>void context.itemMap.delete(ref) - ; - }); - return /*#__PURE__*/ external_React_default().createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, { - [ITEM_DATA_ATTR]: '', - ref: composedRefs - }, children); - }); - /*#__PURE__*/ Object.assign(CollectionItemSlot, { - displayName: ITEM_SLOT_NAME - }); - /* ----------------------------------------------------------------------------------------------- - * useCollection - * ---------------------------------------------------------------------------------------------*/ function useCollection(scope) { - const context = useCollectionContext(name + 'CollectionConsumer', scope); - const getItems = external_React_default().useCallback(()=>{ - const collectionNode = context.collectionRef.current; - if (!collectionNode) return []; - const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`)); - const items = Array.from(context.itemMap.values()); - const orderedItems = items.sort((a, b)=>orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current) - ); - return orderedItems; - }, [ - context.collectionRef, - context.itemMap - ]); - return getItems; - } - return [ - { - Provider: CollectionProvider, - Slot: CollectionSlot, - ItemSlot: CollectionItemSlot - }, - useCollection, - createCollectionScope - ]; +function useMenuStoreProps(store, update, props) { + useUpdateEffect(update, [props.combobox, props.parent, props.menubar]); + store = useCompositeStoreProps(store, update, props); + store = useHovercardStoreProps(store, update, props); + useStoreProps(store, props, "values", "setValues"); + return Object.assign(store, { + combobox: props.combobox, + parent: props.parent, + menubar: props.menubar + }); +} +function useMenuStore(props = {}) { + const parent = useMenuContext(); + const menubar = KA4GX64Z_useMenubarContext(); + const combobox = useComboboxProviderContext(); + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { + parent: props.parent !== void 0 ? props.parent : parent, + menubar: props.menubar !== void 0 ? props.menubar : menubar, + combobox: props.combobox !== void 0 ? props.combobox : combobox + }); + const [store, update] = EKQEJRUF_useStore(createMenuStore, props); + return useMenuStoreProps(store, update, props); } +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/VDNZBO4W.js +"use client"; -;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-direction/dist/index.module.js - -const $f631663db3294ace$var$DirectionContext = /*#__PURE__*/ (0,external_React_.createContext)(undefined); -/* ------------------------------------------------------------------------------------------------- - * Direction - * -----------------------------------------------------------------------------------------------*/ const $f631663db3294ace$export$c760c09fdd558351 = (props)=>{ - const { dir: dir , children: children } = props; - return /*#__PURE__*/ $7Gjcd$createElement($f631663db3294ace$var$DirectionContext.Provider, { - value: dir - }, children); -}; -/* -----------------------------------------------------------------------------------------------*/ function $f631663db3294ace$export$b39126d51d94e6f3(localDir) { - const globalDir = (0,external_React_.useContext)($f631663db3294ace$var$DirectionContext); - return localDir || globalDir || 'ltr'; -} -const $f631663db3294ace$export$2881499e37b75b9a = (/* unused pure expression or super */ null && ($f631663db3294ace$export$c760c09fdd558351)); - +// src/button/button.ts +var useButton = createHook((props) => { + const ref = (0,external_React_.useRef)(null); + const tagName = useTagName(ref, props.as || "button"); + const [isNativeButton, setIsNativeButton] = (0,external_React_.useState)( + () => !!tagName && isButton({ tagName, type: props.type }) + ); + (0,external_React_.useEffect)(() => { + if (!ref.current) + return; + setIsNativeButton(isButton(ref.current)); + }, []); + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ + role: !isNativeButton && tagName !== "a" ? "button" : void 0 + }, props), { + ref: useMergeRefs(ref, props.ref) + }); + props = useCommand(props); + return props; +}); +var VDNZBO4W_Button = createComponent((props) => { + const htmlProps = useButton(props); + return _3ORBWXWF_createElement("button", htmlProps); +}); +if (false) {} -;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-use-escape-keydown/dist/index.module.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/BHEJ6NUH.js +"use client"; -/** - * Listens for when the escape key is down - */ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) { - const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp); - (0,external_React_.useEffect)(()=>{ - const handleKeyDown = (event)=>{ - if (event.key === 'Escape') onEscapeKeyDown(event); - }; - ownerDocument.addEventListener('keydown', handleKeyDown); - return ()=>ownerDocument.removeEventListener('keydown', handleKeyDown) - ; - }, [ - onEscapeKeyDown, - ownerDocument - ]); -} +// src/disclosure/disclosure.ts +var BHEJ6NUH_symbol = Symbol("disclosure"); +var useDisclosure = createHook( + (_a) => { + var _b = _a, { store, toggleOnClick = true } = _b, props = __objRest(_b, ["store", "toggleOnClick"]); + const context = useDisclosureProviderContext(); + store = store || context; + invariant( + store, + false && 0 + ); + const ref = (0,external_React_.useRef)(null); + const [expanded, setExpanded] = (0,external_React_.useState)(false); + const disclosureElement = store.useState("disclosureElement"); + const open = store.useState("open"); + (0,external_React_.useEffect)(() => { + let isCurrentDisclosure = disclosureElement === ref.current; + if (!(disclosureElement == null ? void 0 : disclosureElement.isConnected)) { + store == null ? void 0 : store.setDisclosureElement(ref.current); + isCurrentDisclosure = true; + } + setExpanded(open && isCurrentDisclosure); + }, [disclosureElement, store, open]); + const onClickProp = props.onClick; + const toggleOnClickProp = useBooleanEvent(toggleOnClick); + const [isDuplicate, metadataProps] = useMetadataProps(props, BHEJ6NUH_symbol, true); + const onClick = useEvent((event) => { + onClickProp == null ? void 0 : onClickProp(event); + if (event.defaultPrevented) + return; + if (isDuplicate) + return; + if (!toggleOnClickProp(event)) + return; + store == null ? void 0 : store.setDisclosureElement(event.currentTarget); + store == null ? void 0 : store.toggle(); + }); + const contentElement = store.useState("contentElement"); + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues(_4R3V3JGP_spreadValues({ + "aria-expanded": expanded, + "aria-controls": contentElement == null ? void 0 : contentElement.id + }, metadataProps), props), { + ref: useMergeRefs(ref, props.ref), + onClick + }); + props = useButton(props); + return props; + } +); +var Disclosure = createComponent((props) => { + const htmlProps = useDisclosure(props); + return _3ORBWXWF_createElement("button", htmlProps); +}); +if (false) {} -;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-dismissable-layer/dist/index.module.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/H3TG2CZP.js +"use client"; +// src/dialog/dialog-disclosure.ts +var useDialogDisclosure = createHook( + (_a) => { + var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); + const context = useDialogProviderContext(); + store = store || context; + invariant( + store, + false && 0 + ); + const contentElement = store.useState("contentElement"); + props = _4R3V3JGP_spreadValues({ + "aria-haspopup": getPopupRole(contentElement, "dialog") + }, props); + props = useDisclosure(_4R3V3JGP_spreadValues({ store }, props)); + return props; + } +); +var DialogDisclosure = createComponent( + (props) => { + const htmlProps = useDialogDisclosure(props); + return _3ORBWXWF_createElement("button", htmlProps); + } +); +if (false) {} +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/JCH6MLL2.js +"use client"; -/* ------------------------------------------------------------------------------------------------- - * DismissableLayer - * -----------------------------------------------------------------------------------------------*/ const $5cb92bef7577960e$var$DISMISSABLE_LAYER_NAME = 'DismissableLayer'; -const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update'; -const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside'; -const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside'; -let $5cb92bef7577960e$var$originalBodyPointerEvents; -const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ (0,external_React_.createContext)({ - layers: new Set(), - layersWithOutsidePointerEventsDisabled: new Set(), - branches: new Set() -}); -const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - var _node$ownerDocument; - const { disableOutsidePointerEvents: disableOutsidePointerEvents = false , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , ...layerProps } = props; - const context = (0,external_React_.useContext)($5cb92bef7577960e$var$DismissableLayerContext); - const [node1, setNode] = (0,external_React_.useState)(null); - const ownerDocument = (_node$ownerDocument = node1 === null || node1 === void 0 ? void 0 : node1.ownerDocument) !== null && _node$ownerDocument !== void 0 ? _node$ownerDocument : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document; - const [, force] = (0,external_React_.useState)({}); - const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node) - ); - const layers = Array.from(context.layers); - const [highestLayerWithOutsidePointerEventsDisabled] = [ - ...context.layersWithOutsidePointerEventsDisabled - ].slice(-1); // prettier-ignore - const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); // prettier-ignore - const index = node1 ? layers.indexOf(node1) : -1; - const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0; - const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex; - const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event)=>{ - const target = event.target; - const isPointerDownOnBranch = [ - ...context.branches - ].some((branch)=>branch.contains(target) - ); - if (!isPointerEventsEnabled || isPointerDownOnBranch) return; - onPointerDownOutside === null || onPointerDownOutside === void 0 || onPointerDownOutside(event); - onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event); - if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss(); - }, ownerDocument); - const focusOutside = $5cb92bef7577960e$var$useFocusOutside((event)=>{ - const target = event.target; - const isFocusInBranch = [ - ...context.branches - ].some((branch)=>branch.contains(target) - ); - if (isFocusInBranch) return; - onFocusOutside === null || onFocusOutside === void 0 || onFocusOutside(event); - onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event); - if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss(); - }, ownerDocument); - $addc16e1bbe58fd0$export$3a72a57244d6e765((event)=>{ - const isHighestLayer = index === context.layers.size - 1; - if (!isHighestLayer) return; - onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event); - if (!event.defaultPrevented && onDismiss) { - event.preventDefault(); - onDismiss(); - } - }, ownerDocument); - (0,external_React_.useEffect)(()=>{ - if (!node1) return; - if (disableOutsidePointerEvents) { - if (context.layersWithOutsidePointerEventsDisabled.size === 0) { - $5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents; - ownerDocument.body.style.pointerEvents = 'none'; - } - context.layersWithOutsidePointerEventsDisabled.add(node1); - } - context.layers.add(node1); - $5cb92bef7577960e$var$dispatchUpdate(); - return ()=>{ - if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents; - }; - }, [ - node1, - ownerDocument, - disableOutsidePointerEvents, - context - ]); - /** - * We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect - * because a change to `disableOutsidePointerEvents` would remove this layer from the stack - * and add it to the end again so the layering order wouldn't be _creation order_. - * We only want them to be removed from context stacks when unmounted. - */ (0,external_React_.useEffect)(()=>{ - return ()=>{ - if (!node1) return; - context.layers.delete(node1); - context.layersWithOutsidePointerEventsDisabled.delete(node1); - $5cb92bef7577960e$var$dispatchUpdate(); - }; - }, [ - node1, - context - ]); - (0,external_React_.useEffect)(()=>{ - const handleUpdate = ()=>force({}) - ; - document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate); - return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate) - ; - }, []); - return /*#__PURE__*/ (0,external_React_.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, extends_extends({}, layerProps, { - ref: composedRefs, - style: { - pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined, - ...props.style - }, - onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusCapture, focusOutside.onFocusCapture), - onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlurCapture, focusOutside.onBlurCapture), - onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture) - })); -}); -/*#__PURE__*/ Object.assign($5cb92bef7577960e$export$177fb62ff3ec1f22, { - displayName: $5cb92bef7577960e$var$DISMISSABLE_LAYER_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * DismissableLayerBranch - * -----------------------------------------------------------------------------------------------*/ const $5cb92bef7577960e$var$BRANCH_NAME = 'DismissableLayerBranch'; -const $5cb92bef7577960e$export$4d5eb2109db14228 = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const context = (0,external_React_.useContext)($5cb92bef7577960e$var$DismissableLayerContext); - const ref = (0,external_React_.useRef)(null); - const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref); - (0,external_React_.useEffect)(()=>{ - const node = ref.current; - if (node) { - context.branches.add(node); - return ()=>{ - context.branches.delete(node); - }; - } - }, [ - context.branches - ]); - return /*#__PURE__*/ (0,external_React_.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, extends_extends({}, props, { - ref: composedRefs - })); -}); -/*#__PURE__*/ Object.assign($5cb92bef7577960e$export$4d5eb2109db14228, { - displayName: $5cb92bef7577960e$var$BRANCH_NAME -}); -/* -----------------------------------------------------------------------------------------------*/ /** - * Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup` - * to mimic layer dismissing behaviour present in OS. - * Returns props to pass to the node we want to check for outside events. - */ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) { - const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside); - const isPointerInsideReactTreeRef = (0,external_React_.useRef)(false); - const handleClickRef = (0,external_React_.useRef)(()=>{}); - (0,external_React_.useEffect)(()=>{ - const handlePointerDown = (event)=>{ - if (event.target && !isPointerInsideReactTreeRef.current) { - const eventDetail = { - originalEvent: event - }; - function handleAndDispatchPointerDownOutsideEvent() { - $5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, { - discrete: true - }); - } - /** - * On touch devices, we need to wait for a click event because browsers implement - * a ~350ms delay between the time the user stops touching the display and when the - * browser executres events. We need to ensure we don't reactivate pointer-events within - * this timeframe otherwise the browser may execute events that should have been prevented. - * - * Additionally, this also lets us deal automatically with cancellations when a click event - * isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc. - * - * This is why we also continuously remove the previous listener, because we cannot be - * certain that it was raised, and therefore cleaned-up. - */ if (event.pointerType === 'touch') { - ownerDocument.removeEventListener('click', handleClickRef.current); - handleClickRef.current = handleAndDispatchPointerDownOutsideEvent; - ownerDocument.addEventListener('click', handleClickRef.current, { - once: true - }); - } else handleAndDispatchPointerDownOutsideEvent(); - } - isPointerInsideReactTreeRef.current = false; - }; - /** - * if this hook executes in a component that mounts via a `pointerdown` event, the event - * would bubble up to the document and trigger a `pointerDownOutside` event. We avoid - * this by delaying the event listener registration on the document. - * This is not React specific, but rather how the DOM works, ie: - * ``` - * button.addEventListener('pointerdown', () => { - * console.log('I will log'); - * document.addEventListener('pointerdown', () => { - * console.log('I will also log'); - * }) - * }); - */ const timerId = window.setTimeout(()=>{ - ownerDocument.addEventListener('pointerdown', handlePointerDown); - }, 0); - return ()=>{ - window.clearTimeout(timerId); - ownerDocument.removeEventListener('pointerdown', handlePointerDown); - ownerDocument.removeEventListener('click', handleClickRef.current); - }; - }, [ - ownerDocument, - handlePointerDownOutside - ]); - return { - // ensures we check React component tree (not just DOM tree) - onPointerDownCapture: ()=>isPointerInsideReactTreeRef.current = true - }; -} -/** - * Listens for when focus happens outside a react subtree. - * Returns props to pass to the root (node) of the subtree we want to check. - */ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) { - const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside); - const isFocusInsideReactTreeRef = (0,external_React_.useRef)(false); - (0,external_React_.useEffect)(()=>{ - const handleFocus = (event)=>{ - if (event.target && !isFocusInsideReactTreeRef.current) { - const eventDetail = { - originalEvent: event - }; - $5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, { - discrete: false - }); - } - }; - ownerDocument.addEventListener('focusin', handleFocus); - return ()=>ownerDocument.removeEventListener('focusin', handleFocus) - ; - }, [ - ownerDocument, - handleFocusOutside - ]); - return { - onFocusCapture: ()=>isFocusInsideReactTreeRef.current = true - , - onBlurCapture: ()=>isFocusInsideReactTreeRef.current = false - }; -} -function $5cb92bef7577960e$var$dispatchUpdate() { - const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE); - document.dispatchEvent(event); -} -function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete: discrete }) { - const target = detail.originalEvent.target; - const event = new CustomEvent(name, { - bubbles: false, - cancelable: true, - detail: detail - }); - if (handler) target.addEventListener(name, handler, { - once: true +// src/popover/popover-anchor.ts +var usePopoverAnchor = createHook( + (_a) => { + var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); + const context = usePopoverProviderContext(); + store = store || context; + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { + ref: useMergeRefs(store == null ? void 0 : store.setAnchorElement, props.ref) }); - if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event); - else target.dispatchEvent(event); -} -const $5cb92bef7577960e$export$be92b6f5f03c0fe9 = (/* unused pure expression or super */ null && ($5cb92bef7577960e$export$177fb62ff3ec1f22)); -const $5cb92bef7577960e$export$aecb2ddcb55c95be = (/* unused pure expression or super */ null && ($5cb92bef7577960e$export$4d5eb2109db14228)); - + return props; + } +); +var PopoverAnchor = createComponent((props) => { + const htmlProps = usePopoverAnchor(props); + return _3ORBWXWF_createElement("div", htmlProps); +}); +if (false) {} +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/4ZEZYKUR.js +"use client"; -;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-focus-guards/dist/index.module.js -/** Number of components which have requested interest to have focus guards */ let $3db38b7d1fb3fe6a$var$count = 0; -function $3db38b7d1fb3fe6a$export$ac5b58043b79449b(props) { - $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c(); - return props.children; -} -/** - * Injects a pair of focus guards at the edges of the whole DOM tree - * to ensure `focusin` & `focusout` events can be caught consistently. - */ function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() { - (0,external_React_.useEffect)(()=>{ - var _edgeGuards$, _edgeGuards$2; - const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]'); - document.body.insertAdjacentElement('afterbegin', (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard()); - document.body.insertAdjacentElement('beforeend', (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard()); - $3db38b7d1fb3fe6a$var$count++; - return ()=>{ - if ($3db38b7d1fb3fe6a$var$count === 1) document.querySelectorAll('[data-radix-focus-guard]').forEach((node)=>node.remove() - ); - $3db38b7d1fb3fe6a$var$count--; - }; - }, []); -} -function $3db38b7d1fb3fe6a$var$createFocusGuard() { - const element = document.createElement('span'); - element.setAttribute('data-radix-focus-guard', ''); - element.tabIndex = 0; - element.style.cssText = 'outline: none; opacity: 0; position: fixed; pointer-events: none'; - return element; -} -const $3db38b7d1fb3fe6a$export$be92b6f5f03c0fe9 = (/* unused pure expression or super */ null && ($3db38b7d1fb3fe6a$export$ac5b58043b79449b)); +// src/popover/popover-disclosure.tsx +var usePopoverDisclosure = createHook( + (_a) => { + var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); + const context = usePopoverProviderContext(); + store = store || context; + invariant( + store, + false && 0 + ); + const onClickProp = props.onClick; + const onClick = useEvent((event) => { + store == null ? void 0 : store.setAnchorElement(event.currentTarget); + onClickProp == null ? void 0 : onClickProp(event); + }); + props = useWrapElement( + props, + (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(PopoverScopedContextProvider, { value: store, children: element }), + [store] + ); + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { + onClick + }); + props = usePopoverAnchor(_4R3V3JGP_spreadValues({ store }, props)); + props = useDialogDisclosure(_4R3V3JGP_spreadValues({ store }, props)); + return props; + } +); +var PopoverDisclosure = createComponent( + (props) => { + const htmlProps = usePopoverDisclosure(props); + return _3ORBWXWF_createElement("button", htmlProps); + } +); +if (false) {} -;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-focus-scope/dist/index.module.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/346FK57L.js +"use client"; +// src/composite/composite-typeahead.ts -const $d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount'; -const $d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount'; -const $d3863c46a17e8a28$var$EVENT_OPTIONS = { - bubbles: false, - cancelable: true -}; -/* ------------------------------------------------------------------------------------------------- - * FocusScope - * -----------------------------------------------------------------------------------------------*/ const $d3863c46a17e8a28$var$FOCUS_SCOPE_NAME = 'FocusScope'; -const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { loop: loop = false , trapped: trapped = false , onMountAutoFocus: onMountAutoFocusProp , onUnmountAutoFocus: onUnmountAutoFocusProp , ...scopeProps } = props; - const [container1, setContainer] = (0,external_React_.useState)(null); - const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onMountAutoFocusProp); - const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onUnmountAutoFocusProp); - const lastFocusedElementRef = (0,external_React_.useRef)(null); - const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContainer(node) - ); - const focusScope = (0,external_React_.useRef)({ - paused: false, - pause () { - this.paused = true; - }, - resume () { - this.paused = false; - } - }).current; // Takes care of trapping focus if focus is moved outside programmatically for example - (0,external_React_.useEffect)(()=>{ - if (trapped) { - function handleFocusIn(event) { - if (focusScope.paused || !container1) return; - const target = event.target; - if (container1.contains(target)) lastFocusedElementRef.current = target; - else $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, { - select: true - }); - } - function handleFocusOut(event) { - if (focusScope.paused || !container1) return; - if (!container1.contains(event.relatedTarget)) $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, { - select: true - }); - } - document.addEventListener('focusin', handleFocusIn); - document.addEventListener('focusout', handleFocusOut); - return ()=>{ - document.removeEventListener('focusin', handleFocusIn); - document.removeEventListener('focusout', handleFocusOut); - }; - } - }, [ - trapped, - container1, - focusScope.paused - ]); - (0,external_React_.useEffect)(()=>{ - if (container1) { - $d3863c46a17e8a28$var$focusScopesStack.add(focusScope); - const previouslyFocusedElement = document.activeElement; - const hasFocusedCandidate = container1.contains(previouslyFocusedElement); - if (!hasFocusedCandidate) { - const mountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS); - container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus); - container1.dispatchEvent(mountEvent); - if (!mountEvent.defaultPrevented) { - $d3863c46a17e8a28$var$focusFirst($d3863c46a17e8a28$var$removeLinks($d3863c46a17e8a28$var$getTabbableCandidates(container1)), { - select: true - }); - if (document.activeElement === previouslyFocusedElement) $d3863c46a17e8a28$var$focus(container1); - } - } - return ()=>{ - container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus); // We hit a react bug (fixed in v17) with focusing in unmount. - // We need to delay the focus a little to get around it for now. - // See: https://github.com/facebook/react/issues/17894 - setTimeout(()=>{ - const unmountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS); - container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus); - container1.dispatchEvent(unmountEvent); - if (!unmountEvent.defaultPrevented) $d3863c46a17e8a28$var$focus(previouslyFocusedElement !== null && previouslyFocusedElement !== void 0 ? previouslyFocusedElement : document.body, { - select: true - }); - // we need to remove the listener after we `dispatchEvent` - container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus); - $d3863c46a17e8a28$var$focusScopesStack.remove(focusScope); - }, 0); - }; - } - }, [ - container1, - onMountAutoFocus, - onUnmountAutoFocus, - focusScope - ]); // Takes care of looping focus (when tabbing whilst at the edges) - const handleKeyDown = (0,external_React_.useCallback)((event)=>{ - if (!loop && !trapped) return; - if (focusScope.paused) return; - const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey; - const focusedElement = document.activeElement; - if (isTabKey && focusedElement) { - const container = event.currentTarget; - const [first, last] = $d3863c46a17e8a28$var$getTabbableEdges(container); - const hasTabbableElementsInside = first && last; // we can only wrap focus if we have tabbable edges - if (!hasTabbableElementsInside) { - if (focusedElement === container) event.preventDefault(); - } else { - if (!event.shiftKey && focusedElement === last) { - event.preventDefault(); - if (loop) $d3863c46a17e8a28$var$focus(first, { - select: true - }); - } else if (event.shiftKey && focusedElement === first) { - event.preventDefault(); - if (loop) $d3863c46a17e8a28$var$focus(last, { - select: true - }); - } - } - } - }, [ - loop, - trapped, - focusScope.paused - ]); - return /*#__PURE__*/ (0,external_React_.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, extends_extends({ - tabIndex: -1 - }, scopeProps, { - ref: composedRefs, - onKeyDown: handleKeyDown - })); -}); -/*#__PURE__*/ Object.assign($d3863c46a17e8a28$export$20e40289641fbbb6, { - displayName: $d3863c46a17e8a28$var$FOCUS_SCOPE_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * Utils - * -----------------------------------------------------------------------------------------------*/ /** - * Attempts focusing the first element in a list of candidates. - * Stops when focus has actually moved. - */ function $d3863c46a17e8a28$var$focusFirst(candidates, { select: select = false } = {}) { - const previouslyFocusedElement = document.activeElement; - for (const candidate of candidates){ - $d3863c46a17e8a28$var$focus(candidate, { - select: select - }); - if (document.activeElement !== previouslyFocusedElement) return; - } -} -/** - * Returns the first and last tabbable elements inside a container. - */ function $d3863c46a17e8a28$var$getTabbableEdges(container) { - const candidates = $d3863c46a17e8a28$var$getTabbableCandidates(container); - const first = $d3863c46a17e8a28$var$findVisible(candidates, container); - const last = $d3863c46a17e8a28$var$findVisible(candidates.reverse(), container); - return [ - first, - last - ]; -} -/** - * Returns a list of potential tabbable candidates. - * - * NOTE: This is only a close approximation. For example it doesn't take into account cases like when - * elements are not visible. This cannot be worked out easily by just reading a property, but rather - * necessitate runtime knowledge (computed styles, etc). We deal with these cases separately. - * - * See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker - * Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1 - */ function $d3863c46a17e8a28$var$getTabbableCandidates(container) { - const nodes = []; - const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { - acceptNode: (node)=>{ - const isHiddenInput = node.tagName === 'INPUT' && node.type === 'hidden'; - if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; // `.tabIndex` is not the same as the `tabindex` attribute. It works on the - // runtime's understanding of tabbability, so this automatically accounts - // for any kind of element that could be tabbed to. - return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; - } - }); - while(walker.nextNode())nodes.push(walker.currentNode); // we do not take into account the order of nodes with positive `tabIndex` as it - // hinders accessibility to have tab order different from visual order. - return nodes; -} -/** - * Returns the first visible element in a list. - * NOTE: Only checks visibility up to the `container`. - */ function $d3863c46a17e8a28$var$findVisible(elements, container) { - for (const element of elements){ - // we stop checking if it's hidden at the `container` level (excluding) - if (!$d3863c46a17e8a28$var$isHidden(element, { - upTo: container - })) return element; - } +var chars = ""; +function clearChars() { + chars = ""; } -function $d3863c46a17e8a28$var$isHidden(node, { upTo: upTo }) { - if (getComputedStyle(node).visibility === 'hidden') return true; - while(node){ - // we stop at `upTo` (excluding it) - if (upTo !== undefined && node === upTo) return false; - if (getComputedStyle(node).display === 'none') return true; - node = node.parentElement; - } +function isValidTypeaheadEvent(event) { + const target = event.target; + if (target && DLOEKDPY_isTextField(target)) return false; + if (event.key === " " && chars.length) + return true; + return event.key.length === 1 && !event.ctrlKey && !event.altKey && !event.metaKey && /^[\p{Letter}\p{Number}]$/u.test(event.key); } -function $d3863c46a17e8a28$var$isSelectableInput(element) { - return element instanceof HTMLInputElement && 'select' in element; +function isSelfTargetOrItem(event, items) { + if (isSelfTarget(event)) + return true; + const target = event.target; + if (!target) + return false; + const isItem = items.some((item) => item.element === target); + return isItem; } -function $d3863c46a17e8a28$var$focus(element, { select: select = false } = {}) { - // only focus if that element is focusable - if (element && element.focus) { - const previouslyFocusedElement = document.activeElement; // NOTE: we prevent scrolling on focus, to minimize jarring transitions for users - element.focus({ - preventScroll: true - }); // only select if its not the same element, it supports selection and we need to select - if (element !== previouslyFocusedElement && $d3863c46a17e8a28$var$isSelectableInput(element) && select) element.select(); - } +function _346FK57L_getEnabledItems(items) { + return items.filter((item) => !item.disabled); } -/* ------------------------------------------------------------------------------------------------- - * FocusScope stack - * -----------------------------------------------------------------------------------------------*/ const $d3863c46a17e8a28$var$focusScopesStack = $d3863c46a17e8a28$var$createFocusScopesStack(); -function $d3863c46a17e8a28$var$createFocusScopesStack() { - /** A stack of focus scopes, with the active one at the top */ let stack = []; - return { - add (focusScope) { - // pause the currently active focus scope (at the top of the stack) - const activeFocusScope = stack[0]; - if (focusScope !== activeFocusScope) activeFocusScope === null || activeFocusScope === void 0 || activeFocusScope.pause(); - // remove in case it already exists (because we'll re-add it at the top of the stack) - stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope); - stack.unshift(focusScope); - }, - remove (focusScope) { - var _stack$; - stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope); - (_stack$ = stack[0]) === null || _stack$ === void 0 || _stack$.resume(); +function itemTextStartsWith(item, text) { + var _a; + const itemText = ((_a = item.element) == null ? void 0 : _a.textContent) || item.children; + if (!itemText) + return false; + return normalizeString(itemText).trim().toLowerCase().startsWith(text.toLowerCase()); +} +function getSameInitialItems(items, char, activeId) { + if (!activeId) + return items; + const activeItem = items.find((item) => item.id === activeId); + if (!activeItem) + return items; + if (!itemTextStartsWith(activeItem, char)) + return items; + if (chars !== char && itemTextStartsWith(activeItem, chars)) + return items; + chars = char; + return flipItems( + items.filter((item) => itemTextStartsWith(item, chars)), + activeId + ).filter((item) => item.id !== activeId); +} +var useCompositeTypeahead = createHook( + (_a) => { + var _b = _a, { store, typeahead = true } = _b, props = __objRest(_b, ["store", "typeahead"]); + const context = useCompositeContext(); + store = store || context; + invariant( + store, + false && 0 + ); + const onKeyDownCaptureProp = props.onKeyDownCapture; + const cleanupTimeoutRef = (0,external_React_.useRef)(0); + const onKeyDownCapture = useEvent( + (event) => { + onKeyDownCaptureProp == null ? void 0 : onKeyDownCaptureProp(event); + if (event.defaultPrevented) + return; + if (!typeahead) + return; + if (!store) + return; + const { items, activeId } = store.getState(); + if (!isValidTypeaheadEvent(event)) + return clearChars(); + let enabledItems = _346FK57L_getEnabledItems(items); + if (!isSelfTargetOrItem(event, enabledItems)) + return clearChars(); + event.preventDefault(); + window.clearTimeout(cleanupTimeoutRef.current); + cleanupTimeoutRef.current = window.setTimeout(() => { + chars = ""; + }, 500); + const char = event.key.toLowerCase(); + chars += char; + enabledItems = getSameInitialItems(enabledItems, char, activeId); + const item = enabledItems.find( + (item2) => itemTextStartsWith(item2, chars) + ); + if (item) { + store.move(item.id); + } else { + clearChars(); } - }; -} -function $d3863c46a17e8a28$var$arrayRemove(array, item) { - const updatedArray = [ - ...array - ]; - const index = updatedArray.indexOf(item); - if (index !== -1) updatedArray.splice(index, 1); - return updatedArray; -} -function $d3863c46a17e8a28$var$removeLinks(items) { - return items.filter((item)=>item.tagName !== 'A' + } ); -} -const $d3863c46a17e8a28$export$be92b6f5f03c0fe9 = (/* unused pure expression or super */ null && ($d3863c46a17e8a28$export$20e40289641fbbb6)); - - + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { + onKeyDownCapture + }); + return props; + } +); +var CompositeTypeahead = createComponent( + (props) => { + const htmlProps = useCompositeTypeahead(props); + return _3ORBWXWF_createElement("div", htmlProps); + } +); +if (false) {} +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/menu/menu-button.js +"use client"; -;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-use-layout-effect/dist/index.module.js -/** - * On the server, React emits a warning when calling `useLayoutEffect`. - * This is because neither `useLayoutEffect` nor `useEffect` run on the server. - * We use this safe version which suppresses the warning by replacing it with a noop on the server. - * - * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect - */ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? external_React_.useLayoutEffect : ()=>{}; -;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-id/dist/index.module.js -const $1746a345f3d73bb7$var$useReactId = external_React_['useId'.toString()] || (()=>undefined -); -let $1746a345f3d73bb7$var$count = 0; -function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) { - const [id, setId] = external_React_.useState($1746a345f3d73bb7$var$useReactId()); // React versions older than 18 will have client-side ids only. - $9f79659886946c16$export$e5c5a5f917a5871c(()=>{ - if (!deterministicId) setId((reactId)=>reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++) - ); - }, [ - deterministicId - ]); - return deterministicId || (id ? `radix-${id}` : ''); -} -;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-popper/node_modules/@floating-ui/core/dist/floating-ui.core.browser.min.mjs -function floating_ui_core_browser_min_t(t){return t.split("-")[0]}function floating_ui_core_browser_min_e(t){return t.split("-")[1]}function floating_ui_core_browser_min_n(e){return["top","bottom"].includes(floating_ui_core_browser_min_t(e))?"x":"y"}function floating_ui_core_browser_min_r(t){return"y"===t?"height":"width"}function floating_ui_core_browser_min_i(i,o,a){let{reference:l,floating:s}=i;const c=l.x+l.width/2-s.width/2,f=l.y+l.height/2-s.height/2,u=floating_ui_core_browser_min_n(o),m=floating_ui_core_browser_min_r(u),g=l[m]/2-s[m]/2,d="x"===u;let p;switch(floating_ui_core_browser_min_t(o)){case"top":p={x:c,y:l.y-s.height};break;case"bottom":p={x:c,y:l.y+l.height};break;case"right":p={x:l.x+l.width,y:f};break;case"left":p={x:l.x-s.width,y:f};break;default:p={x:l.x,y:l.y}}switch(floating_ui_core_browser_min_e(o)){case"start":p[u]-=g*(a&&d?-1:1);break;case"end":p[u]+=g*(a&&d?-1:1)}return p}const floating_ui_core_browser_min_o=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:l}=n,s=await(null==l.isRTL?void 0:l.isRTL(e));let c=await l.getElementRects({reference:t,floating:e,strategy:o}),{x:f,y:u}=floating_ui_core_browser_min_i(c,r,s),m=r,g={},d=0;for(let n=0;n<a.length;n++){const{name:p,fn:h}=a[n],{x:y,y:x,data:w,reset:v}=await h({x:f,y:u,initialPlacement:r,placement:m,strategy:o,middlewareData:g,rects:c,platform:l,elements:{reference:t,floating:e}});f=null!=y?y:f,u=null!=x?x:u,g={...g,[p]:{...g[p],...w}},v&&d<=50&&(d++,"object"==typeof v&&(v.placement&&(m=v.placement),v.rects&&(c=!0===v.rects?await l.getElementRects({reference:t,floating:e,strategy:o}):v.rects),({x:f,y:u}=floating_ui_core_browser_min_i(c,m,s))),n=-1)}return{x:f,y:u,placement:m,strategy:o,middlewareData:g}};function floating_ui_core_browser_min_a(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function floating_ui_core_browser_min_l(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function floating_ui_core_browser_min_s(t,e){var n;void 0===e&&(e={});const{x:r,y:i,platform:o,rects:s,elements:c,strategy:f}=t,{boundary:u="clippingAncestors",rootBoundary:m="viewport",elementContext:g="floating",altBoundary:d=!1,padding:p=0}=e,h=floating_ui_core_browser_min_a(p),y=c[d?"floating"===g?"reference":"floating":g],x=floating_ui_core_browser_min_l(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(y)))||n?y:y.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(c.floating)),boundary:u,rootBoundary:m,strategy:f})),w=floating_ui_core_browser_min_l(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===g?{...s.floating,x:r,y:i}:s.reference,offsetParent:await(null==o.getOffsetParent?void 0:o.getOffsetParent(c.floating)),strategy:f}):s[g]);return{top:x.top-w.top+h.top,bottom:w.bottom-x.bottom+h.bottom,left:x.left-w.left+h.left,right:w.right-x.right+h.right}}const floating_ui_core_browser_min_c=Math.min,floating_ui_core_browser_min_f=Math.max;function floating_ui_core_browser_min_u(t,e,n){return floating_ui_core_browser_min_f(t,floating_ui_core_browser_min_c(e,n))}const floating_ui_core_browser_min_m=t=>({name:"arrow",options:t,async fn(i){const{element:o,padding:l=0}=null!=t?t:{},{x:s,y:c,placement:f,rects:m,platform:g}=i;if(null==o)return{};const d=floating_ui_core_browser_min_a(l),p={x:s,y:c},h=floating_ui_core_browser_min_n(f),y=floating_ui_core_browser_min_e(f),x=floating_ui_core_browser_min_r(h),w=await g.getDimensions(o),v="y"===h?"top":"left",b="y"===h?"bottom":"right",R=m.reference[x]+m.reference[h]-p[h]-m.floating[x],A=p[h]-m.reference[h],P=await(null==g.getOffsetParent?void 0:g.getOffsetParent(o));let T=P?"y"===h?P.clientHeight||0:P.clientWidth||0:0;0===T&&(T=m.floating[x]);const O=R/2-A/2,D=d[v],L=T-w[x]-d[b],k=T/2-w[x]/2+O,E=floating_ui_core_browser_min_u(D,k,L),C=("start"===y?d[v]:d[b])>0&&k!==E&&m.reference[x]<=m.floating[x];return{[h]:p[h]-(C?k<D?D-k:L-k:0),data:{[h]:E,centerOffset:k-E}}}}),floating_ui_core_browser_min_g={left:"right",right:"left",bottom:"top",top:"bottom"};function floating_ui_core_browser_min_d(t){return t.replace(/left|right|bottom|top/g,(t=>floating_ui_core_browser_min_g[t]))}function floating_ui_core_browser_min_p(t,i,o){void 0===o&&(o=!1);const a=floating_ui_core_browser_min_e(t),l=floating_ui_core_browser_min_n(t),s=floating_ui_core_browser_min_r(l);let c="x"===l?a===(o?"end":"start")?"right":"left":"start"===a?"bottom":"top";return i.reference[s]>i.floating[s]&&(c=floating_ui_core_browser_min_d(c)),{main:c,cross:floating_ui_core_browser_min_d(c)}}const floating_ui_core_browser_min_h={start:"end",end:"start"};function floating_ui_core_browser_min_y(t){return t.replace(/start|end/g,(t=>floating_ui_core_browser_min_h[t]))}const floating_ui_core_browser_min_x=["top","right","bottom","left"],floating_ui_core_browser_min_w=floating_ui_core_browser_min_x.reduce(((t,e)=>t.concat(e,e+"-start",e+"-end")),[]);const floating_ui_core_browser_min_v=function(n){return void 0===n&&(n={}),{name:"autoPlacement",options:n,async fn(r){var i,o,a,l,c;const{x:f,y:u,rects:m,middlewareData:g,placement:d,platform:h,elements:x}=r,{alignment:v=null,allowedPlacements:b=floating_ui_core_browser_min_w,autoAlignment:R=!0,...A}=n,P=function(n,r,i){return(n?[...i.filter((t=>floating_ui_core_browser_min_e(t)===n)),...i.filter((t=>floating_ui_core_browser_min_e(t)!==n))]:i.filter((e=>floating_ui_core_browser_min_t(e)===e))).filter((t=>!n||floating_ui_core_browser_min_e(t)===n||!!r&&floating_ui_core_browser_min_y(t)!==t))}(v,R,b),T=await floating_ui_core_browser_min_s(r,A),O=null!=(i=null==(o=g.autoPlacement)?void 0:o.index)?i:0,D=P[O];if(null==D)return{};const{main:L,cross:k}=floating_ui_core_browser_min_p(D,m,await(null==h.isRTL?void 0:h.isRTL(x.floating)));if(d!==D)return{x:f,y:u,reset:{placement:P[0]}};const E=[T[floating_ui_core_browser_min_t(D)],T[L],T[k]],C=[...null!=(a=null==(l=g.autoPlacement)?void 0:l.overflows)?a:[],{placement:D,overflows:E}],H=P[O+1];if(H)return{data:{index:O+1,overflows:C},reset:{placement:H}};const B=C.slice().sort(((t,e)=>t.overflows[0]-e.overflows[0])),V=null==(c=B.find((t=>{let{overflows:e}=t;return e.every((t=>t<=0))})))?void 0:c.placement,F=null!=V?V:B[0].placement;return F!==d?{data:{index:O+1,overflows:C},reset:{placement:F}}:{}}}};const floating_ui_core_browser_min_b=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(n){var r;const{placement:i,middlewareData:o,rects:a,initialPlacement:l,platform:c,elements:f}=n,{mainAxis:u=!0,crossAxis:m=!0,fallbackPlacements:g,fallbackStrategy:h="bestFit",flipAlignment:x=!0,...w}=e,v=floating_ui_core_browser_min_t(i),b=g||(v===l||!x?[floating_ui_core_browser_min_d(l)]:function(t){const e=floating_ui_core_browser_min_d(t);return[floating_ui_core_browser_min_y(t),e,floating_ui_core_browser_min_y(e)]}(l)),R=[l,...b],A=await floating_ui_core_browser_min_s(n,w),P=[];let T=(null==(r=o.flip)?void 0:r.overflows)||[];if(u&&P.push(A[v]),m){const{main:t,cross:e}=floating_ui_core_browser_min_p(i,a,await(null==c.isRTL?void 0:c.isRTL(f.floating)));P.push(A[t],A[e])}if(T=[...T,{placement:i,overflows:P}],!P.every((t=>t<=0))){var O,D;const t=(null!=(O=null==(D=o.flip)?void 0:D.index)?O:0)+1,e=R[t];if(e)return{data:{index:t,overflows:T},reset:{placement:e}};let n="bottom";switch(h){case"bestFit":{var L;const t=null==(L=T.map((t=>[t,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:L[0].placement;t&&(n=t);break}case"initialPlacement":n=l}if(i!==n)return{reset:{placement:n}}}return{}}}};function floating_ui_core_browser_min_R(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function floating_ui_core_browser_min_A(t){return floating_ui_core_browser_min_x.some((e=>t[e]>=0))}const floating_ui_core_browser_min_P=function(t){let{strategy:e="referenceHidden",...n}=void 0===t?{}:t;return{name:"hide",async fn(t){const{rects:r}=t;switch(e){case"referenceHidden":{const e=floating_ui_core_browser_min_R(await floating_ui_core_browser_min_s(t,{...n,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:floating_ui_core_browser_min_A(e)}}}case"escaped":{const e=floating_ui_core_browser_min_R(await floating_ui_core_browser_min_s(t,{...n,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:floating_ui_core_browser_min_A(e)}}}default:return{}}}}};const floating_ui_core_browser_min_T=function(r){return void 0===r&&(r=0),{name:"offset",options:r,async fn(i){const{x:o,y:a}=i,l=await async function(r,i){const{placement:o,platform:a,elements:l}=r,s=await(null==a.isRTL?void 0:a.isRTL(l.floating)),c=floating_ui_core_browser_min_t(o),f=floating_ui_core_browser_min_e(o),u="x"===floating_ui_core_browser_min_n(o),m=["left","top"].includes(c)?-1:1,g=s&&u?-1:1,d="function"==typeof i?i(r):i;let{mainAxis:p,crossAxis:h,alignmentAxis:y}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return f&&"number"==typeof y&&(h="end"===f?-1*y:y),u?{x:h*g,y:p*m}:{x:p*m,y:h*g}}(i,r);return{x:o+l.x,y:a+l.y,data:l}}}};function floating_ui_core_browser_min_O(t){return"x"===t?"y":"x"}const floating_ui_core_browser_min_D=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(r){const{x:i,y:o,placement:a}=r,{mainAxis:l=!0,crossAxis:c=!1,limiter:f={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...m}=e,g={x:i,y:o},d=await floating_ui_core_browser_min_s(r,m),p=floating_ui_core_browser_min_n(floating_ui_core_browser_min_t(a)),h=floating_ui_core_browser_min_O(p);let y=g[p],x=g[h];if(l){const t="y"===p?"bottom":"right";y=floating_ui_core_browser_min_u(y+d["y"===p?"top":"left"],y,y-d[t])}if(c){const t="y"===h?"bottom":"right";x=floating_ui_core_browser_min_u(x+d["y"===h?"top":"left"],x,x-d[t])}const w=f.fn({...r,[p]:y,[h]:x});return{...w,data:{x:w.x-i,y:w.y-o}}}}},floating_ui_core_browser_min_L=function(e){return void 0===e&&(e={}),{options:e,fn(r){const{x:i,y:o,placement:a,rects:l,middlewareData:s}=r,{offset:c=0,mainAxis:f=!0,crossAxis:u=!0}=e,m={x:i,y:o},g=floating_ui_core_browser_min_n(a),d=floating_ui_core_browser_min_O(g);let p=m[g],h=m[d];const y="function"==typeof c?c({...l,placement:a}):c,x="number"==typeof y?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(f){const t="y"===g?"height":"width",e=l.reference[g]-l.floating[t]+x.mainAxis,n=l.reference[g]+l.reference[t]-x.mainAxis;p<e?p=e:p>n&&(p=n)}if(u){var w,v,b,R;const e="y"===g?"width":"height",n=["top","left"].includes(floating_ui_core_browser_min_t(a)),r=l.reference[d]-l.floating[e]+(n&&null!=(w=null==(v=s.offset)?void 0:v[d])?w:0)+(n?0:x.crossAxis),i=l.reference[d]+l.reference[e]+(n?0:null!=(b=null==(R=s.offset)?void 0:R[d])?b:0)-(n?x.crossAxis:0);h<r?h=r:h>i&&(h=i)}return{[g]:p,[d]:h}}}},floating_ui_core_browser_min_k=function(n){return void 0===n&&(n={}),{name:"size",options:n,async fn(r){const{placement:i,rects:o,platform:a,elements:l}=r,{apply:c,...u}=n,m=await floating_ui_core_browser_min_s(r,u),g=floating_ui_core_browser_min_t(i),d=floating_ui_core_browser_min_e(i);let p,h;"top"===g||"bottom"===g?(p=g,h=d===(await(null==a.isRTL?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(h=g,p="end"===d?"top":"bottom");const y=floating_ui_core_browser_min_f(m.left,0),x=floating_ui_core_browser_min_f(m.right,0),w=floating_ui_core_browser_min_f(m.top,0),v=floating_ui_core_browser_min_f(m.bottom,0),b={availableHeight:o.floating.height-(["left","right"].includes(i)?2*(0!==w||0!==v?w+v:floating_ui_core_browser_min_f(m.top,m.bottom)):m[p]),availableWidth:o.floating.width-(["top","bottom"].includes(i)?2*(0!==y||0!==x?y+x:floating_ui_core_browser_min_f(m.left,m.right)):m[h])},R=await a.getDimensions(l.floating);null==c||c({...r,...b});const A=await a.getDimensions(l.floating);return R.width!==A.width||R.height!==A.height?{reset:{rects:!0}}:{}}}},floating_ui_core_browser_min_E=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(r){var i;const{placement:o,elements:s,rects:u,platform:m,strategy:g}=r,{padding:d=2,x:p,y:h}=e,y=floating_ui_core_browser_min_l(m.convertOffsetParentRelativeRectToViewportRelativeRect?await m.convertOffsetParentRelativeRectToViewportRelativeRect({rect:u.reference,offsetParent:await(null==m.getOffsetParent?void 0:m.getOffsetParent(s.floating)),strategy:g}):u.reference),x=null!=(i=await(null==m.getClientRects?void 0:m.getClientRects(s.reference)))?i:[],w=floating_ui_core_browser_min_a(d);const v=await m.getElementRects({reference:{getBoundingClientRect:function(){var e;if(2===x.length&&x[0].left>x[1].right&&null!=p&&null!=h)return null!=(e=x.find((t=>p>t.left-w.left&&p<t.right+w.right&&h>t.top-w.top&&h<t.bottom+w.bottom)))?e:y;if(x.length>=2){if("x"===floating_ui_core_browser_min_n(o)){const e=x[0],n=x[x.length-1],r="top"===floating_ui_core_browser_min_t(o),i=e.top,a=n.bottom,l=r?e.left:n.left,s=r?e.right:n.right;return{top:i,bottom:a,left:l,right:s,width:s-l,height:a-i,x:l,y:i}}const e="left"===floating_ui_core_browser_min_t(o),r=floating_ui_core_browser_min_f(...x.map((t=>t.right))),i=floating_ui_core_browser_min_c(...x.map((t=>t.left))),a=x.filter((t=>e?t.left===i:t.right===r)),l=a[0].top,s=a[a.length-1].bottom;return{top:l,bottom:s,left:i,right:r,width:r-i,height:s-l,x:i,y:l}}return y}},floating:s.floating,strategy:g});return u.reference.x!==v.reference.x||u.reference.y!==v.reference.y||u.reference.width!==v.reference.width||u.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}}; -;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-popper/node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.min.mjs -function floating_ui_dom_browser_min_n(t){return t&&t.document&&t.location&&t.alert&&t.setInterval}function floating_ui_dom_browser_min_o(t){if(null==t)return window;if(!floating_ui_dom_browser_min_n(t)){const e=t.ownerDocument;return e&&e.defaultView||window}return t}function floating_ui_dom_browser_min_i(t){return floating_ui_dom_browser_min_o(t).getComputedStyle(t)}function floating_ui_dom_browser_min_r(t){return floating_ui_dom_browser_min_n(t)?"":t?(t.nodeName||"").toLowerCase():""}function floating_ui_dom_browser_min_l(){const t=navigator.userAgentData;return null!=t&&t.brands?t.brands.map((t=>t.brand+"/"+t.version)).join(" "):navigator.userAgent}function floating_ui_dom_browser_min_c(t){return t instanceof floating_ui_dom_browser_min_o(t).HTMLElement}function floating_ui_dom_browser_min_f(t){return t instanceof floating_ui_dom_browser_min_o(t).Element}function floating_ui_dom_browser_min_s(t){if("undefined"==typeof ShadowRoot)return!1;return t instanceof floating_ui_dom_browser_min_o(t).ShadowRoot||t instanceof ShadowRoot}function floating_ui_dom_browser_min_u(t){const{overflow:e,overflowX:n,overflowY:o}=floating_ui_dom_browser_min_i(t);return/auto|scroll|overlay|hidden/.test(e+o+n)}function floating_ui_dom_browser_min_d(t){return["table","td","th"].includes(floating_ui_dom_browser_min_r(t))}function floating_ui_dom_browser_min_h(t){const e=/firefox/i.test(floating_ui_dom_browser_min_l()),n=floating_ui_dom_browser_min_i(t);return"none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||["transform","perspective"].includes(n.willChange)||e&&"filter"===n.willChange||e&&!!n.filter&&"none"!==n.filter}function floating_ui_dom_browser_min_a(){return!/^((?!chrome|android).)*safari/i.test(floating_ui_dom_browser_min_l())}const floating_ui_dom_browser_min_g=Math.min,floating_ui_dom_browser_min_p=Math.max,floating_ui_dom_browser_min_m=Math.round;function floating_ui_dom_browser_min_w(t,e,n){var i,r,l,s;void 0===e&&(e=!1),void 0===n&&(n=!1);const u=t.getBoundingClientRect();let d=1,h=1;e&&floating_ui_dom_browser_min_c(t)&&(d=t.offsetWidth>0&&floating_ui_dom_browser_min_m(u.width)/t.offsetWidth||1,h=t.offsetHeight>0&&floating_ui_dom_browser_min_m(u.height)/t.offsetHeight||1);const g=floating_ui_dom_browser_min_f(t)?floating_ui_dom_browser_min_o(t):window,p=!floating_ui_dom_browser_min_a()&&n,w=(u.left+(p&&null!=(i=null==(r=g.visualViewport)?void 0:r.offsetLeft)?i:0))/d,v=(u.top+(p&&null!=(l=null==(s=g.visualViewport)?void 0:s.offsetTop)?l:0))/h,y=u.width/d,x=u.height/h;return{width:y,height:x,top:v,right:w+y,bottom:v+x,left:w,x:w,y:v}}function floating_ui_dom_browser_min_v(t){return(e=t,(e instanceof floating_ui_dom_browser_min_o(e).Node?t.ownerDocument:t.document)||window.document).documentElement;var e}function floating_ui_dom_browser_min_y(t){return floating_ui_dom_browser_min_f(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function floating_ui_dom_browser_min_x(t){return floating_ui_dom_browser_min_w(floating_ui_dom_browser_min_v(t)).left+floating_ui_dom_browser_min_y(t).scrollLeft}function floating_ui_dom_browser_min_b(t,e,n){const o=floating_ui_dom_browser_min_c(e),i=floating_ui_dom_browser_min_v(e),l=floating_ui_dom_browser_min_w(t,o&&function(t){const e=floating_ui_dom_browser_min_w(t);return floating_ui_dom_browser_min_m(e.width)!==t.offsetWidth||floating_ui_dom_browser_min_m(e.height)!==t.offsetHeight}(e),"fixed"===n);let f={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(o||!o&&"fixed"!==n)if(("body"!==floating_ui_dom_browser_min_r(e)||floating_ui_dom_browser_min_u(i))&&(f=floating_ui_dom_browser_min_y(e)),floating_ui_dom_browser_min_c(e)){const t=floating_ui_dom_browser_min_w(e,!0);s.x=t.x+e.clientLeft,s.y=t.y+e.clientTop}else i&&(s.x=floating_ui_dom_browser_min_x(i));return{x:l.left+f.scrollLeft-s.x,y:l.top+f.scrollTop-s.y,width:l.width,height:l.height}}function floating_ui_dom_browser_min_L(t){return"html"===floating_ui_dom_browser_min_r(t)?t:t.assignedSlot||t.parentNode||(floating_ui_dom_browser_min_s(t)?t.host:null)||floating_ui_dom_browser_min_v(t)}function floating_ui_dom_browser_min_R(t){return floating_ui_dom_browser_min_c(t)&&"fixed"!==getComputedStyle(t).position?t.offsetParent:null}function floating_ui_dom_browser_min_T(t){const e=floating_ui_dom_browser_min_o(t);let n=floating_ui_dom_browser_min_R(t);for(;n&&floating_ui_dom_browser_min_d(n)&&"static"===getComputedStyle(n).position;)n=floating_ui_dom_browser_min_R(n);return n&&("html"===floating_ui_dom_browser_min_r(n)||"body"===floating_ui_dom_browser_min_r(n)&&"static"===getComputedStyle(n).position&&!floating_ui_dom_browser_min_h(n))?e:n||function(t){let e=floating_ui_dom_browser_min_L(t);for(floating_ui_dom_browser_min_s(e)&&(e=e.host);floating_ui_dom_browser_min_c(e)&&!["html","body"].includes(floating_ui_dom_browser_min_r(e));){if(floating_ui_dom_browser_min_h(e))return e;e=e.parentNode}return null}(t)||e}function floating_ui_dom_browser_min_W(t){if(floating_ui_dom_browser_min_c(t))return{width:t.offsetWidth,height:t.offsetHeight};const e=floating_ui_dom_browser_min_w(t);return{width:e.width,height:e.height}}function floating_ui_dom_browser_min_E(t){const e=floating_ui_dom_browser_min_L(t);return["html","body","#document"].includes(floating_ui_dom_browser_min_r(e))?t.ownerDocument.body:floating_ui_dom_browser_min_c(e)&&floating_ui_dom_browser_min_u(e)?e:floating_ui_dom_browser_min_E(e)}function floating_ui_dom_browser_min_H(t,e){var n;void 0===e&&(e=[]);const i=floating_ui_dom_browser_min_E(t),r=i===(null==(n=t.ownerDocument)?void 0:n.body),l=floating_ui_dom_browser_min_o(i),c=r?[l].concat(l.visualViewport||[],floating_ui_dom_browser_min_u(i)?i:[]):i,f=e.concat(c);return r?f:f.concat(floating_ui_dom_browser_min_H(c))}function floating_ui_dom_browser_min_C(e,n,r){return"viewport"===n?floating_ui_core_browser_min_l(function(t,e){const n=floating_ui_dom_browser_min_o(t),i=floating_ui_dom_browser_min_v(t),r=n.visualViewport;let l=i.clientWidth,c=i.clientHeight,f=0,s=0;if(r){l=r.width,c=r.height;const t=floating_ui_dom_browser_min_a();(t||!t&&"fixed"===e)&&(f=r.offsetLeft,s=r.offsetTop)}return{width:l,height:c,x:f,y:s}}(e,r)):floating_ui_dom_browser_min_f(n)?function(t,e){const n=floating_ui_dom_browser_min_w(t,!1,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft;return{top:o,left:i,x:i,y:o,right:i+t.clientWidth,bottom:o+t.clientHeight,width:t.clientWidth,height:t.clientHeight}}(n,r):floating_ui_core_browser_min_l(function(t){var e;const n=floating_ui_dom_browser_min_v(t),o=floating_ui_dom_browser_min_y(t),r=null==(e=t.ownerDocument)?void 0:e.body,l=floating_ui_dom_browser_min_p(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),c=floating_ui_dom_browser_min_p(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0);let f=-o.scrollLeft+floating_ui_dom_browser_min_x(t);const s=-o.scrollTop;return"rtl"===floating_ui_dom_browser_min_i(r||n).direction&&(f+=floating_ui_dom_browser_min_p(n.clientWidth,r?r.clientWidth:0)-l),{width:l,height:c,x:f,y:s}}(floating_ui_dom_browser_min_v(e)))}function floating_ui_dom_browser_min_S(t){const e=floating_ui_dom_browser_min_H(t),n=["absolute","fixed"].includes(floating_ui_dom_browser_min_i(t).position)&&floating_ui_dom_browser_min_c(t)?floating_ui_dom_browser_min_T(t):t;return floating_ui_dom_browser_min_f(n)?e.filter((t=>floating_ui_dom_browser_min_f(t)&&function(t,e){const n=null==e.getRootNode?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&floating_ui_dom_browser_min_s(n)){let n=e;do{if(n&&t===n)return!0;n=n.parentNode||n.host}while(n)}return!1}(t,n)&&"body"!==floating_ui_dom_browser_min_r(t))):[]}const floating_ui_dom_browser_min_D={getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?floating_ui_dom_browser_min_S(e):[].concat(n),o],l=r[0],c=r.reduce(((t,n)=>{const o=floating_ui_dom_browser_min_C(e,n,i);return t.top=floating_ui_dom_browser_min_p(o.top,t.top),t.right=floating_ui_dom_browser_min_g(o.right,t.right),t.bottom=floating_ui_dom_browser_min_g(o.bottom,t.bottom),t.left=floating_ui_dom_browser_min_p(o.left,t.left),t}),floating_ui_dom_browser_min_C(e,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=floating_ui_dom_browser_min_c(n),l=floating_ui_dom_browser_min_v(n);if(n===l)return e;let f={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&"fixed"!==o)&&(("body"!==floating_ui_dom_browser_min_r(n)||floating_ui_dom_browser_min_u(l))&&(f=floating_ui_dom_browser_min_y(n)),floating_ui_dom_browser_min_c(n))){const t=floating_ui_dom_browser_min_w(n,!0);s.x=t.x+n.clientLeft,s.y=t.y+n.clientTop}return{...e,x:e.x-f.scrollLeft+s.x,y:e.y-f.scrollTop+s.y}},isElement:floating_ui_dom_browser_min_f,getDimensions:floating_ui_dom_browser_min_W,getOffsetParent:floating_ui_dom_browser_min_T,getDocumentElement:floating_ui_dom_browser_min_v,getElementRects:t=>{let{reference:e,floating:n,strategy:o}=t;return{reference:floating_ui_dom_browser_min_b(e,floating_ui_dom_browser_min_T(n),o),floating:{...floating_ui_dom_browser_min_W(n),x:0,y:0}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>"rtl"===floating_ui_dom_browser_min_i(t).direction};function floating_ui_dom_browser_min_N(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=!0,animationFrame:c=!1}=o,s=i&&!c,u=r&&!c,d=s||u?[...floating_ui_dom_browser_min_f(t)?floating_ui_dom_browser_min_H(t):[],...floating_ui_dom_browser_min_H(e)]:[];d.forEach((t=>{s&&t.addEventListener("scroll",n,{passive:!0}),u&&t.addEventListener("resize",n)}));let h,a=null;if(l){let o=!0;a=new ResizeObserver((()=>{o||n(),o=!1})),floating_ui_dom_browser_min_f(t)&&!c&&a.observe(t),a.observe(e)}let g=c?floating_ui_dom_browser_min_w(t):null;return c&&function e(){const o=floating_ui_dom_browser_min_w(t);!g||o.x===g.x&&o.y===g.y&&o.width===g.width&&o.height===g.height||n();g=o,h=requestAnimationFrame(e)}(),n(),()=>{var t;d.forEach((t=>{s&&t.removeEventListener("scroll",n),u&&t.removeEventListener("resize",n)})),null==(t=a)||t.disconnect(),a=null,c&&cancelAnimationFrame(h)}}const floating_ui_dom_browser_min_z=(t,n,o)=>floating_ui_core_browser_min_o(t,n,{platform:floating_ui_dom_browser_min_D,...o}); -;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-popper/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js +// src/menu/menu-button.tsx -var floating_ui_react_dom_esm_index = typeof document !== 'undefined' ? external_React_.useLayoutEffect : external_React_.useEffect; -// Fork of `fast-deep-equal` that only does the comparisons we need and compares -// functions -function floating_ui_react_dom_esm_deepEqual(a, b) { - if (a === b) { - return true; +function getInitialFocus(event, dir) { + const keyMap = { + ArrowDown: dir === "bottom" || dir === "top" ? "first" : false, + ArrowUp: dir === "bottom" || dir === "top" ? "last" : false, + ArrowRight: dir === "right" ? "first" : false, + ArrowLeft: dir === "left" ? "first" : false + }; + return keyMap[event.key]; +} +function hasActiveItem(items, excludeElement) { + return !!(items == null ? void 0 : items.some((item) => { + if (!item.element) + return false; + if (item.element === excludeElement) + return false; + return item.element.getAttribute("aria-expanded") === "true"; + })); +} +var useMenuButton = createHook( + (_a) => { + var _b = _a, { store, focusable, accessibleWhenDisabled, showOnHover } = _b, props = __objRest(_b, ["store", "focusable", "accessibleWhenDisabled", "showOnHover"]); + const context = useMenuProviderContext(); + store = store || context; + invariant( + store, + false && 0 + ); + const ref = (0,external_React_.useRef)(null); + const parentMenu = store.parent; + const parentMenubar = store.menubar; + const hasParentMenu = !!parentMenu; + const parentIsMenubar = !!parentMenubar && !hasParentMenu; + const disabled = disabledFromProps(props); + const showMenu = () => { + const trigger = ref.current; + if (!trigger) + return; + store == null ? void 0 : store.setDisclosureElement(trigger); + store == null ? void 0 : store.setAnchorElement(trigger); + store == null ? void 0 : store.show(); + }; + const onFocusProp = props.onFocus; + const onFocus = useEvent((event) => { + onFocusProp == null ? void 0 : onFocusProp(event); + if (disabled) + return; + if (event.defaultPrevented) + return; + store == null ? void 0 : store.setAutoFocusOnShow(false); + store == null ? void 0 : store.setActiveId(null); + if (!parentMenubar) + return; + if (!parentIsMenubar) + return; + const { items } = parentMenubar.getState(); + if (hasActiveItem(items, event.currentTarget)) { + showMenu(); + } + }); + const dir = store.useState( + (state) => state.placement.split("-")[0] + ); + const onKeyDownProp = props.onKeyDown; + const onKeyDown = useEvent((event) => { + onKeyDownProp == null ? void 0 : onKeyDownProp(event); + if (disabled) + return; + if (event.defaultPrevented) + return; + const initialFocus = getInitialFocus(event, dir); + if (initialFocus) { + event.preventDefault(); + showMenu(); + store == null ? void 0 : store.setAutoFocusOnShow(true); + store == null ? void 0 : store.setInitialFocus(initialFocus); + } + }); + const onClickProp = props.onClick; + const onClick = useEvent((event) => { + onClickProp == null ? void 0 : onClickProp(event); + if (event.defaultPrevented) + return; + if (!store) + return; + const isKeyboardClick = !event.detail; + const { open } = store.getState(); + if (!open || isKeyboardClick) { + if (!hasParentMenu || isKeyboardClick) { + store.setAutoFocusOnShow(true); + } + store.setInitialFocus(isKeyboardClick ? "first" : "container"); + } + if (hasParentMenu) { + showMenu(); + } + }); + props = useWrapElement( + props, + (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(MenuContextProvider, { value: store, children: element }), + [store] + ); + if (hasParentMenu) { + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { + render: /* @__PURE__ */ (0,jsx_runtime.jsx)(Role.div, { render: props.render }) + }); + } + const id = useId(props.id); + const parentContentElement = useStoreState( + (parentMenu == null ? void 0 : parentMenu.combobox) || parentMenu, + "contentElement" + ); + const role = hasParentMenu || parentIsMenubar ? getPopupItemRole(parentContentElement, "menuitem") : void 0; + const contentElement = store.useState("contentElement"); + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ + id, + role, + "aria-haspopup": getPopupRole(contentElement, "menu") + }, props), { + ref: useMergeRefs(ref, props.ref), + onFocus, + onKeyDown, + onClick + }); + props = useHovercardAnchor(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ + store, + focusable, + accessibleWhenDisabled + }, props), { + showOnHover: (event) => { + const getShowOnHover = () => { + if (typeof showOnHover === "function") + return showOnHover(event); + if (showOnHover != null) + return showOnHover; + if (hasParentMenu) + return true; + if (!parentMenubar) + return false; + const { items } = parentMenubar.getState(); + return parentIsMenubar && hasActiveItem(items); + }; + const canShowOnHover = getShowOnHover(); + if (!canShowOnHover) + return false; + const parent = parentIsMenubar ? parentMenubar : parentMenu; + if (!parent) + return true; + parent.setActiveId(event.currentTarget.id); + return true; + } + })); + props = usePopoverDisclosure(_4R3V3JGP_spreadValues({ + store, + toggleOnClick: !hasParentMenu, + focusable, + accessibleWhenDisabled + }, props)); + props = useCompositeTypeahead(_4R3V3JGP_spreadValues({ + store, + typeahead: parentIsMenubar + }, props)); + return props; } +); +var MenuButton = createComponent((props) => { + const htmlProps = useMenuButton(props); + return _3ORBWXWF_createElement("button", htmlProps); +}); +if (false) {} - if (typeof a !== typeof b) { - return false; - } - if (typeof a === 'function' && a.toString() === b.toString()) { - return true; - } +;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right-small.js - let length, i, keys; +/** + * WordPress dependencies + */ - if (a && b && typeof a == 'object') { - if (Array.isArray(a)) { - length = a.length; - if (length != b.length) return false; +const chevronRightSmall = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Path, { + d: "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z" +})); +/* harmony default export */ const chevron_right_small = (chevronRightSmall); - for (i = length; i-- !== 0;) { - if (!floating_ui_react_dom_esm_deepEqual(a[i], b[i])) { - return false; - } - } +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/HHNFDKU2.js +"use client"; - return true; - } - keys = Object.keys(a); - length = keys.length; - if (length !== Object.keys(b).length) { - return false; - } - for (i = length; i-- !== 0;) { - if (!Object.prototype.hasOwnProperty.call(b, keys[i])) { - return false; - } - } - for (i = length; i-- !== 0;) { - const key = keys[i]; - if (key === '_owner' && a.$$typeof) { - continue; - } - if (!floating_ui_react_dom_esm_deepEqual(a[key], b[key])) { - return false; - } - } - return true; - } - return a !== a && b !== b; -} +// src/menu/menu-list.tsx -function floating_ui_react_dom_esm_useLatestRef(value) { - const ref = external_React_.useRef(value); - floating_ui_react_dom_esm_index(() => { - ref.current = value; - }); - return ref; -} - -function floating_ui_react_dom_esm_useFloating(_temp) { - let { - middleware, - placement = 'bottom', - strategy = 'absolute', - whileElementsMounted - } = _temp === void 0 ? {} : _temp; - const reference = external_React_.useRef(null); - const floating = external_React_.useRef(null); - const whileElementsMountedRef = floating_ui_react_dom_esm_useLatestRef(whileElementsMounted); - const cleanupRef = external_React_.useRef(null); - const [data, setData] = external_React_.useState({ - // Setting these to `null` will allow the consumer to determine if - // `computePosition()` has run yet - x: null, - y: null, - strategy, - placement, - middlewareData: {} - }); - const [latestMiddleware, setLatestMiddleware] = external_React_.useState(middleware); - if (!floating_ui_react_dom_esm_deepEqual(latestMiddleware == null ? void 0 : latestMiddleware.map(_ref => { - let { - options - } = _ref; - return options; - }), middleware == null ? void 0 : middleware.map(_ref2 => { - let { - options - } = _ref2; - return options; - }))) { - setLatestMiddleware(middleware); - } - const update = external_React_.useCallback(() => { - if (!reference.current || !floating.current) { +function useAriaLabelledBy(_a) { + var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); + const [id, setId] = (0,external_React_.useState)(void 0); + const label = props["aria-label"]; + const disclosureElement = useStoreState(store, "disclosureElement"); + const contentElement = useStoreState(store, "contentElement"); + (0,external_React_.useEffect)(() => { + const disclosure = disclosureElement; + if (!disclosure) + return; + const menu = contentElement; + if (!menu) return; + const menuLabel = label || menu.hasAttribute("aria-label"); + if (menuLabel) { + setId(void 0); + } else if (disclosure.id) { + setId(disclosure.id); } - - floating_ui_dom_browser_min_z(reference.current, floating.current, { - middleware: latestMiddleware, - placement, - strategy - }).then(data => { - if (isMountedRef.current) { - external_ReactDOM_namespaceObject.flushSync(() => { - setData(data); - }); + }, [label, disclosureElement, contentElement]); + return id; +} +var useMenuList = createHook( + (_a) => { + var _b = _a, { store, alwaysVisible, composite } = _b, props = __objRest(_b, ["store", "alwaysVisible", "composite"]); + const context = useMenuProviderContext(); + store = store || context; + invariant( + store, + false && 0 + ); + const parentMenu = store.parent; + const parentMenubar = store.menubar; + const hasParentMenu = !!parentMenu; + const id = useId(props.id); + const onKeyDownProp = props.onKeyDown; + const dir = store.useState( + (state) => state.placement.split("-")[0] + ); + const orientation = store.useState( + (state) => state.orientation === "both" ? void 0 : state.orientation + ); + const isHorizontal = orientation !== "vertical"; + const isMenubarHorizontal = useStoreState( + parentMenubar, + (state) => !!state && state.orientation !== "vertical" + ); + const onKeyDown = useEvent((event) => { + onKeyDownProp == null ? void 0 : onKeyDownProp(event); + if (event.defaultPrevented) + return; + if (hasParentMenu || parentMenubar && !isHorizontal) { + const hideMap = { + ArrowRight: () => dir === "left" && !isHorizontal, + ArrowLeft: () => dir === "right" && !isHorizontal, + ArrowUp: () => dir === "bottom" && isHorizontal, + ArrowDown: () => dir === "top" && isHorizontal + }; + const action = hideMap[event.key]; + if (action == null ? void 0 : action()) { + event.stopPropagation(); + event.preventDefault(); + return store == null ? void 0 : store.hide(); + } } - }); - }, [latestMiddleware, placement, strategy]); - floating_ui_react_dom_esm_index(() => { - // Skip first update - if (isMountedRef.current) { - update(); - } - }, [update]); - const isMountedRef = external_React_.useRef(false); - floating_ui_react_dom_esm_index(() => { - isMountedRef.current = true; - return () => { - isMountedRef.current = false; - }; - }, []); - const runElementMountCallback = external_React_.useCallback(() => { - if (typeof cleanupRef.current === 'function') { - cleanupRef.current(); - cleanupRef.current = null; - } - - if (reference.current && floating.current) { - if (whileElementsMountedRef.current) { - const cleanupFn = whileElementsMountedRef.current(reference.current, floating.current, update); - cleanupRef.current = cleanupFn; - } else { - update(); + if (parentMenubar) { + const keyMap = { + ArrowRight: () => { + if (!isMenubarHorizontal) + return; + return parentMenubar.next(); + }, + ArrowLeft: () => { + if (!isMenubarHorizontal) + return; + return parentMenubar.previous(); + }, + ArrowDown: () => { + if (isMenubarHorizontal) + return; + return parentMenubar.next(); + }, + ArrowUp: () => { + if (isMenubarHorizontal) + return; + return parentMenubar.previous(); + } + }; + const action = keyMap[event.key]; + const id2 = action == null ? void 0 : action(); + if (id2 !== void 0) { + event.stopPropagation(); + event.preventDefault(); + parentMenubar.move(id2); + } } + }); + props = useWrapElement( + props, + (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(MenuScopedContextProvider, { value: store, children: element }), + [store] + ); + const ariaLabelledBy = useAriaLabelledBy(_4R3V3JGP_spreadValues({ store }, props)); + const mounted = store.useState("mounted"); + const hidden = isHidden(mounted, props.hidden, alwaysVisible); + const style = hidden ? _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props.style), { display: "none" }) : props.style; + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ + id, + "aria-labelledby": ariaLabelledBy, + hidden + }, props), { + ref: useMergeRefs(id ? store.setContentElement : null, props.ref), + style, + onKeyDown + }); + const hasCombobox = !!store.combobox; + composite = composite != null ? composite : !hasCombobox; + if (composite) { + props = _4R3V3JGP_spreadValues({ + role: "menu", + "aria-orientation": orientation + }, props); } - }, [update, whileElementsMountedRef]); - const setReference = external_React_.useCallback(node => { - reference.current = node; - runElementMountCallback(); - }, [runElementMountCallback]); - const setFloating = external_React_.useCallback(node => { - floating.current = node; - runElementMountCallback(); - }, [runElementMountCallback]); - const refs = external_React_.useMemo(() => ({ - reference, - floating - }), []); - return external_React_.useMemo(() => ({ ...data, - update, - refs, - reference: setReference, - floating: setFloating - }), [data, update, refs, setReference, setFloating]); -} + props = useComposite(_4R3V3JGP_spreadValues({ store, composite }, props)); + props = useCompositeTypeahead(_4R3V3JGP_spreadValues({ store, typeahead: !hasCombobox }, props)); + return props; + } +); +var MenuList = createComponent((props) => { + const htmlProps = useMenuList(props); + return _3ORBWXWF_createElement("div", htmlProps); +}); +if (false) {} -/** - * Positions an inner element of the floating element such that it is centered - * to the reference element. - * This wraps the core `arrow` middleware to allow React refs as the element. - * @see https://floating-ui.com/docs/arrow - */ -const floating_ui_react_dom_esm_arrow = options => { - const { - element, - padding - } = options; - function isRef(value) { - return Object.prototype.hasOwnProperty.call(value, 'current'); - } +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/menu/menu.js +"use client"; - return { - name: 'arrow', - options, - fn(args) { - if (isRef(element)) { - if (element.current != null) { - return floating_ui_core_browser_min_m({ - element: element.current, - padding - }).fn(args); - } - return {}; - } else if (element) { - return floating_ui_core_browser_min_m({ - element, - padding - }).fn(args); - } - return {}; - } - }; -}; -;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-arrow/dist/index.module.js @@ -77767,90 +71596,23 @@ const floating_ui_react_dom_esm_arrow = options => { -/* ------------------------------------------------------------------------------------------------- - * Arrow - * -----------------------------------------------------------------------------------------------*/ const $7e8f5cd07187803e$var$NAME = 'Arrow'; -const $7e8f5cd07187803e$export$21b07c8f274aebd5 = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { children: children , width: width = 10 , height: height = 5 , ...arrowProps } = props; - return /*#__PURE__*/ (0,external_React_.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.svg, extends_extends({}, arrowProps, { - ref: forwardedRef, - width: width, - height: height, - viewBox: "0 0 30 10", - preserveAspectRatio: "none" - }), props.asChild ? children : /*#__PURE__*/ (0,external_React_.createElement)("polygon", { - points: "0,0 30,0 15,10" - })); -}); -/*#__PURE__*/ Object.assign($7e8f5cd07187803e$export$21b07c8f274aebd5, { - displayName: $7e8f5cd07187803e$var$NAME -}); -/* -----------------------------------------------------------------------------------------------*/ const $7e8f5cd07187803e$export$be92b6f5f03c0fe9 = $7e8f5cd07187803e$export$21b07c8f274aebd5; -;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-use-size/dist/index.module.js -function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) { - const [size, setSize] = (0,external_React_.useState)(undefined); - $9f79659886946c16$export$e5c5a5f917a5871c(()=>{ - if (element) { - // provide size as early as possible - setSize({ - width: element.offsetWidth, - height: element.offsetHeight - }); - const resizeObserver = new ResizeObserver((entries)=>{ - if (!Array.isArray(entries)) return; - // Since we only observe the one element, we don't need to loop over the - // array - if (!entries.length) return; - const entry = entries[0]; - let width; - let height; - if ('borderBoxSize' in entry) { - const borderSizeEntry = entry['borderBoxSize']; // iron out differences between browsers - const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry; - width = borderSize['inlineSize']; - height = borderSize['blockSize']; - } else { - // for browsers that don't support `borderBoxSize` - // we calculate it ourselves to get the correct border box. - width = element.offsetWidth; - height = element.offsetHeight; - } - setSize({ - width: width, - height: height - }); - }); - resizeObserver.observe(element, { - box: 'border-box' - }); - return ()=>resizeObserver.unobserve(element) - ; - } else // We only want to reset to `undefined` when the element becomes `null`, - // not if it changes to another element. - setSize(undefined); - }, [ - element - ]); - return size; -} -;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-popper/dist/index.module.js @@ -77868,1660 +71630,788 @@ function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) { +// src/menu/menu.tsx -const $cf1ac5d9fe0e8206$export$36f0086da09c4b9f = (/* unused pure expression or super */ null && ([ - 'top', - 'right', - 'bottom', - 'left' -])); -const $cf1ac5d9fe0e8206$export$3671ffab7b302fc9 = (/* unused pure expression or super */ null && ([ - 'start', - 'center', - 'end' -])); -/* ------------------------------------------------------------------------------------------------- - * Popper - * -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$POPPER_NAME = 'Popper'; -const [$cf1ac5d9fe0e8206$var$createPopperContext, $cf1ac5d9fe0e8206$export$722aac194ae923] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($cf1ac5d9fe0e8206$var$POPPER_NAME); -const [$cf1ac5d9fe0e8206$var$PopperProvider, $cf1ac5d9fe0e8206$var$usePopperContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$POPPER_NAME); -const $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9 = (props)=>{ - const { __scopePopper: __scopePopper , children: children } = props; - const [anchor, setAnchor] = (0,external_React_.useState)(null); - return /*#__PURE__*/ (0,external_React_.createElement)($cf1ac5d9fe0e8206$var$PopperProvider, { - scope: __scopePopper, - anchor: anchor, - onAnchorChange: setAnchor - }, children); -}; -/*#__PURE__*/ Object.assign($cf1ac5d9fe0e8206$export$badac9ada3a0bdf9, { - displayName: $cf1ac5d9fe0e8206$var$POPPER_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * PopperAnchor - * -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$ANCHOR_NAME = 'PopperAnchor'; -const $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { __scopePopper: __scopePopper , virtualRef: virtualRef , ...anchorProps } = props; - const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$ANCHOR_NAME, __scopePopper); +var useMenu = createHook( + (_a) => { + var _b = _a, { + store, + modal: modalProp = false, + portal = !!modalProp, + hideOnEscape = true, + autoFocusOnShow = true, + hideOnHoverOutside, + alwaysVisible + } = _b, props = __objRest(_b, [ + "store", + "modal", + "portal", + "hideOnEscape", + "autoFocusOnShow", + "hideOnHoverOutside", + "alwaysVisible" + ]); + const context = useMenuProviderContext(); + store = store || context; + invariant( + store, + false && 0 + ); const ref = (0,external_React_.useRef)(null); - const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref); - (0,external_React_.useEffect)(()=>{ - // Consumer can anchor the popper to something that isn't - // a DOM node e.g. pointer position, so we override the - // `anchorRef` with their virtual ref in this case. - context.onAnchorChange((virtualRef === null || virtualRef === void 0 ? void 0 : virtualRef.current) || ref.current); + const parentMenu = store.parent; + const parentMenubar = store.menubar; + const hasParentMenu = !!parentMenu; + const parentIsMenubar = !!parentMenubar && !hasParentMenu; + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { + ref: useMergeRefs(ref, props.ref) }); - return virtualRef ? null : /*#__PURE__*/ (0,external_React_.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, extends_extends({}, anchorProps, { - ref: composedRefs - })); -}); -/*#__PURE__*/ Object.assign($cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d, { - displayName: $cf1ac5d9fe0e8206$var$ANCHOR_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * PopperContent - * -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$CONTENT_NAME = 'PopperContent'; -const [$cf1ac5d9fe0e8206$var$PopperContentProvider, $cf1ac5d9fe0e8206$var$useContentContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME); -const [$cf1ac5d9fe0e8206$var$PositionContextProvider, $cf1ac5d9fe0e8206$var$usePositionContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME, { - hasParent: false, - positionUpdateFns: new Set() -}); -const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - var _arrowSize$width, _arrowSize$height, _middlewareData$arrow, _middlewareData$arrow2, _middlewareData$arrow3, _middlewareData$hide, _middlewareData$trans, _middlewareData$trans2; - const { __scopePopper: __scopePopper , side: side = 'bottom' , sideOffset: sideOffset = 0 , align: align = 'center' , alignOffset: alignOffset = 0 , arrowPadding: arrowPadding = 0 , collisionBoundary: collisionBoundary = [] , collisionPadding: collisionPaddingProp = 0 , sticky: sticky = 'partial' , hideWhenDetached: hideWhenDetached = false , avoidCollisions: avoidCollisions = true , onPlaced: onPlaced , ...contentProps } = props; - const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME, __scopePopper); - const [content, setContent] = (0,external_React_.useState)(null); - const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContent(node) - ); - const [arrow, setArrow] = (0,external_React_.useState)(null); - const arrowSize = $db6c3485150b8e66$export$1ab7ae714698c4b8(arrow); - const arrowWidth = (_arrowSize$width = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.width) !== null && _arrowSize$width !== void 0 ? _arrowSize$width : 0; - const arrowHeight = (_arrowSize$height = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.height) !== null && _arrowSize$height !== void 0 ? _arrowSize$height : 0; - const desiredPlacement = side + (align !== 'center' ? '-' + align : ''); - const collisionPadding = typeof collisionPaddingProp === 'number' ? collisionPaddingProp : { - top: 0, - right: 0, - bottom: 0, - left: 0, - ...collisionPaddingProp - }; - const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [ - collisionBoundary - ]; - const hasExplicitBoundaries = boundary.length > 0; - const detectOverflowOptions = { - padding: collisionPadding, - boundary: boundary.filter($cf1ac5d9fe0e8206$var$isNotNull), - // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries - altBoundary: hasExplicitBoundaries - }; - const { reference: reference , floating: floating , strategy: strategy , x: x , y: y , placement: placement , middlewareData: middlewareData , update: update } = floating_ui_react_dom_esm_useFloating({ - // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues - strategy: 'fixed', - placement: desiredPlacement, - whileElementsMounted: floating_ui_dom_browser_min_N, - middleware: [ - $cf1ac5d9fe0e8206$var$anchorCssProperties(), - floating_ui_core_browser_min_T({ - mainAxis: sideOffset + arrowHeight, - alignmentAxis: alignOffset - }), - avoidCollisions ? floating_ui_core_browser_min_D({ - mainAxis: true, - crossAxis: false, - limiter: sticky === 'partial' ? floating_ui_core_browser_min_L() : undefined, - ...detectOverflowOptions - }) : undefined, - arrow ? floating_ui_react_dom_esm_arrow({ - element: arrow, - padding: arrowPadding - }) : undefined, - avoidCollisions ? floating_ui_core_browser_min_b({ - ...detectOverflowOptions - }) : undefined, - floating_ui_core_browser_min_k({ - ...detectOverflowOptions, - apply: ({ elements: elements , availableWidth: width , availableHeight: height })=>{ - elements.floating.style.setProperty('--radix-popper-available-width', `${width}px`); - elements.floating.style.setProperty('--radix-popper-available-height', `${height}px`); - } - }), - $cf1ac5d9fe0e8206$var$transformOrigin({ - arrowWidth: arrowWidth, - arrowHeight: arrowHeight - }), - hideWhenDetached ? floating_ui_core_browser_min_P({ - strategy: 'referenceHidden' - }) : undefined - ].filter($cf1ac5d9fe0e8206$var$isDefined) - }); // assign the reference dynamically once `Content` has mounted so we can collocate the logic - $9f79659886946c16$export$e5c5a5f917a5871c(()=>{ - reference(context.anchor); - }, [ - reference, - context.anchor - ]); - const isPlaced = x !== null && y !== null; - const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement); - const handlePlaced = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPlaced); - $9f79659886946c16$export$e5c5a5f917a5871c(()=>{ - if (isPlaced) handlePlaced === null || handlePlaced === void 0 || handlePlaced(); - }, [ - isPlaced, - handlePlaced - ]); - const arrowX = (_middlewareData$arrow = middlewareData.arrow) === null || _middlewareData$arrow === void 0 ? void 0 : _middlewareData$arrow.x; - const arrowY = (_middlewareData$arrow2 = middlewareData.arrow) === null || _middlewareData$arrow2 === void 0 ? void 0 : _middlewareData$arrow2.y; - const cannotCenterArrow = ((_middlewareData$arrow3 = middlewareData.arrow) === null || _middlewareData$arrow3 === void 0 ? void 0 : _middlewareData$arrow3.centerOffset) !== 0; - const [contentZIndex, setContentZIndex] = (0,external_React_.useState)(); - $9f79659886946c16$export$e5c5a5f917a5871c(()=>{ - if (content) setContentZIndex(window.getComputedStyle(content).zIndex); - }, [ - content - ]); - const { hasParent: hasParent , positionUpdateFns: positionUpdateFns } = $cf1ac5d9fe0e8206$var$usePositionContext($cf1ac5d9fe0e8206$var$CONTENT_NAME, __scopePopper); - const isRoot = !hasParent; - (0,external_React_.useLayoutEffect)(()=>{ - if (!isRoot) { - positionUpdateFns.add(update); - return ()=>{ - positionUpdateFns.delete(update); - }; - } - }, [ - isRoot, - positionUpdateFns, - update - ]); // when nested contents are rendered in portals, they are appended out of order causing - // children to be positioned incorrectly if initially open. - // we need to re-compute the positioning once the parent has finally been placed. - // https://github.com/floating-ui/floating-ui/issues/1531 - $9f79659886946c16$export$e5c5a5f917a5871c(()=>{ - if (isRoot && isPlaced) Array.from(positionUpdateFns).reverse().forEach((fn)=>requestAnimationFrame(fn) - ); - }, [ - isRoot, - isPlaced, - positionUpdateFns - ]); - const commonProps = { - 'data-side': placedSide, - 'data-align': placedAlign, - ...contentProps, - ref: composedRefs, - style: { - ...contentProps.style, - // if the PopperContent hasn't been placed yet (not all measurements done) - // we prevent animations so that users's animation don't kick in too early referring wrong sides - animation: !isPlaced ? 'none' : undefined, - // hide the content if using the hide middleware and should be hidden - opacity: (_middlewareData$hide = middlewareData.hide) !== null && _middlewareData$hide !== void 0 && _middlewareData$hide.referenceHidden ? 0 : undefined - } - }; - return /*#__PURE__*/ (0,external_React_.createElement)("div", { - ref: floating, - "data-radix-popper-content-wrapper": "", - style: { - position: strategy, - left: 0, - top: 0, - transform: isPlaced ? `translate3d(${Math.round(x)}px, ${Math.round(y)}px, 0)` : 'translate3d(0, -200%, 0)', - // keep off the page when measuring - minWidth: 'max-content', - zIndex: contentZIndex, - ['--radix-popper-transform-origin']: [ - (_middlewareData$trans = middlewareData.transformOrigin) === null || _middlewareData$trans === void 0 ? void 0 : _middlewareData$trans.x, - (_middlewareData$trans2 = middlewareData.transformOrigin) === null || _middlewareData$trans2 === void 0 ? void 0 : _middlewareData$trans2.y - ].join(' ') - } // Floating UI interally calculates logical alignment based the `dir` attribute on - , - dir: props.dir - }, /*#__PURE__*/ (0,external_React_.createElement)($cf1ac5d9fe0e8206$var$PopperContentProvider, { - scope: __scopePopper, - placedSide: placedSide, - onArrowChange: setArrow, - arrowX: arrowX, - arrowY: arrowY, - shouldHideArrow: cannotCenterArrow - }, isRoot ? /*#__PURE__*/ (0,external_React_.createElement)($cf1ac5d9fe0e8206$var$PositionContextProvider, { - scope: __scopePopper, - hasParent: true, - positionUpdateFns: positionUpdateFns - }, /*#__PURE__*/ (0,external_React_.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, commonProps)) : /*#__PURE__*/ (0,external_React_.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, commonProps))); -}); -/*#__PURE__*/ Object.assign($cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc, { - displayName: $cf1ac5d9fe0e8206$var$CONTENT_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * PopperArrow - * -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$ARROW_NAME = 'PopperArrow'; -const $cf1ac5d9fe0e8206$var$OPPOSITE_SIDE = { - top: 'bottom', - right: 'left', - bottom: 'top', - left: 'right' -}; -const $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0 = /*#__PURE__*/ (0,external_React_.forwardRef)(function $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0(props, forwardedRef) { - const { __scopePopper: __scopePopper , ...arrowProps } = props; - const contentContext = $cf1ac5d9fe0e8206$var$useContentContext($cf1ac5d9fe0e8206$var$ARROW_NAME, __scopePopper); - const baseSide = $cf1ac5d9fe0e8206$var$OPPOSITE_SIDE[contentContext.placedSide]; - return(/*#__PURE__*/ // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`) - // doesn't report size as we'd expect on SVG elements. - // it reports their bounding box which is effectively the largest path inside the SVG. - (0,external_React_.createElement)("span", { - ref: contentContext.onArrowChange, - style: { - position: 'absolute', - left: contentContext.arrowX, - top: contentContext.arrowY, - [baseSide]: 0, - transformOrigin: { - top: '', - right: '0 0', - bottom: 'center 0', - left: '100% 0' - }[contentContext.placedSide], - transform: { - top: 'translateY(100%)', - right: 'translateY(50%) rotate(90deg) translateX(-50%)', - bottom: `rotate(180deg)`, - left: 'translateY(50%) rotate(-90deg) translateX(50%)' - }[contentContext.placedSide], - visibility: contentContext.shouldHideArrow ? 'hidden' : undefined - } - }, /*#__PURE__*/ (0,external_React_.createElement)($7e8f5cd07187803e$export$be92b6f5f03c0fe9, extends_extends({}, arrowProps, { - ref: forwardedRef, - style: { - ...arrowProps.style, - // ensures the element can be measured correctly (mostly for if SVG) - display: 'block' - } - })))); -}); -/*#__PURE__*/ Object.assign($cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0, { - displayName: $cf1ac5d9fe0e8206$var$ARROW_NAME -}); -/* -----------------------------------------------------------------------------------------------*/ function $cf1ac5d9fe0e8206$var$isDefined(value) { - return value !== undefined; -} -function $cf1ac5d9fe0e8206$var$isNotNull(value) { - return value !== null; -} -const $cf1ac5d9fe0e8206$var$anchorCssProperties = ()=>({ - name: 'anchorCssProperties', - fn (data) { - const { rects: rects , elements: elements } = data; - const { width: width , height: height } = rects.reference; - elements.floating.style.setProperty('--radix-popper-anchor-width', `${width}px`); - elements.floating.style.setProperty('--radix-popper-anchor-height', `${height}px`); - return {}; - } - }) -; -const $cf1ac5d9fe0e8206$var$transformOrigin = (options)=>({ - name: 'transformOrigin', - options: options, - fn (data) { - var _middlewareData$arrow4, _middlewareData$arrow5, _middlewareData$arrow6, _middlewareData$arrow7, _middlewareData$arrow8; - const { placement: placement , rects: rects , middlewareData: middlewareData } = data; - const cannotCenterArrow = ((_middlewareData$arrow4 = middlewareData.arrow) === null || _middlewareData$arrow4 === void 0 ? void 0 : _middlewareData$arrow4.centerOffset) !== 0; - const isArrowHidden = cannotCenterArrow; - const arrowWidth = isArrowHidden ? 0 : options.arrowWidth; - const arrowHeight = isArrowHidden ? 0 : options.arrowHeight; - const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement); - const noArrowAlign = { - start: '0%', - center: '50%', - end: '100%' - }[placedAlign]; - const arrowXCenter = ((_middlewareData$arrow5 = (_middlewareData$arrow6 = middlewareData.arrow) === null || _middlewareData$arrow6 === void 0 ? void 0 : _middlewareData$arrow6.x) !== null && _middlewareData$arrow5 !== void 0 ? _middlewareData$arrow5 : 0) + arrowWidth / 2; - const arrowYCenter = ((_middlewareData$arrow7 = (_middlewareData$arrow8 = middlewareData.arrow) === null || _middlewareData$arrow8 === void 0 ? void 0 : _middlewareData$arrow8.y) !== null && _middlewareData$arrow7 !== void 0 ? _middlewareData$arrow7 : 0) + arrowHeight / 2; - let x = ''; - let y = ''; - if (placedSide === 'bottom') { - x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`; - y = `${-arrowHeight}px`; - } else if (placedSide === 'top') { - x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`; - y = `${rects.floating.height + arrowHeight}px`; - } else if (placedSide === 'right') { - x = `${-arrowHeight}px`; - y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`; - } else if (placedSide === 'left') { - x = `${rects.floating.width + arrowHeight}px`; - y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`; - } - return { - data: { - x: x, - y: y - } - }; + const _a2 = useMenuList( + _4R3V3JGP_spreadValues({ store, alwaysVisible }, props) + ), { "aria-labelledby": ariaLabelledBy } = _a2, menuListProps = __objRest(_a2, ["aria-labelledby"]); + props = menuListProps; + const [initialFocusRef, setInitialFocusRef] = (0,external_React_.useState)(); + const autoFocusOnShowState = store.useState("autoFocusOnShow"); + const initialFocus = store.useState("initialFocus"); + const baseElement = store.useState("baseElement"); + const items = store.useState("renderedItems"); + (0,external_React_.useEffect)(() => { + let cleaning = false; + setInitialFocusRef((prevInitialFocusRef) => { + var _a3, _b2, _c; + if (cleaning) + return; + if (!autoFocusOnShowState) + return; + if ((_a3 = prevInitialFocusRef == null ? void 0 : prevInitialFocusRef.current) == null ? void 0 : _a3.isConnected) + return prevInitialFocusRef; + const ref2 = (0,external_React_.createRef)(); + switch (initialFocus) { + case "first": + ref2.current = ((_b2 = items.find((item) => !item.disabled && item.element)) == null ? void 0 : _b2.element) || null; + break; + case "last": + ref2.current = ((_c = [...items].reverse().find((item) => !item.disabled && item.element)) == null ? void 0 : _c.element) || null; + break; + default: + ref2.current = baseElement; } - }) -; -function $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement) { - const [side, align = 'center'] = placement.split('-'); - return [ - side, - align - ]; -} -const $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9 = $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9; -const $cf1ac5d9fe0e8206$export$b688253958b8dfe7 = $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d; -const $cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2 = $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc; -const $cf1ac5d9fe0e8206$export$21b07c8f274aebd5 = $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0; - - - - + return ref2; + }); + return () => { + cleaning = true; + }; + }, [store, autoFocusOnShowState, initialFocus, items, baseElement]); + const modal = hasParentMenu ? false : modalProp; + const mayAutoFocusOnShow = !!autoFocusOnShow; + const canAutoFocusOnShow = !!initialFocusRef || !!props.initialFocus || !!modal; + const contentElement = useStoreState( + store.combobox || store, + "contentElement" + ); + const parentContentElement = useStoreState( + (parentMenu == null ? void 0 : parentMenu.combobox) || parentMenu, + "contentElement" + ); + const preserveTabOrderAnchor = (0,external_React_.useMemo)(() => { + if (!parentContentElement) + return; + if (!contentElement) + return; + const role = contentElement.getAttribute("role"); + const parentRole = parentContentElement.getAttribute("role"); + const parentIsMenuOrMenubar = parentRole === "menu" || parentRole === "menubar"; + if (parentIsMenuOrMenubar && role === "menu") + return; + return parentContentElement; + }, [contentElement, parentContentElement]); + if (preserveTabOrderAnchor !== void 0) { + props = _4R3V3JGP_spreadValues({ + preserveTabOrderAnchor + }, props); + } + props = useHovercard(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ + store, + alwaysVisible, + initialFocus: initialFocusRef, + autoFocusOnShow: mayAutoFocusOnShow ? canAutoFocusOnShow && autoFocusOnShow : autoFocusOnShowState || !!modal + }, props), { + hideOnEscape: (event) => { + if (isFalsyBooleanCallback(hideOnEscape, event)) + return false; + store == null ? void 0 : store.hideAll(); + return true; + }, + hideOnHoverOutside: (event) => { + const disclosureElement = store == null ? void 0 : store.getState().disclosureElement; + const getHideOnHoverOutside = () => { + if (typeof hideOnHoverOutside === "function") { + return hideOnHoverOutside(event); + } + if (hideOnHoverOutside != null) + return hideOnHoverOutside; + if (hasParentMenu) + return true; + if (!parentIsMenubar) + return false; + if (!disclosureElement) + return true; + if (hasFocusWithin(disclosureElement)) + return false; + return true; + }; + if (!getHideOnHoverOutside()) + return false; + if (event.defaultPrevented) + return true; + if (!hasParentMenu) + return true; + if (!disclosureElement) + return true; + fireEvent(disclosureElement, "mouseout", event); + if (!hasFocusWithin(disclosureElement)) + return true; + requestAnimationFrame(() => { + if (hasFocusWithin(disclosureElement)) + return; + store == null ? void 0 : store.hide(); + }); + return false; + }, + modal, + portal, + backdrop: hasParentMenu ? false : props.backdrop + })); + props = _4R3V3JGP_spreadValues({ + "aria-labelledby": ariaLabelledBy + }, props); + return props; + } +); +var Menu = createDialogComponent( + createComponent((props) => { + const htmlProps = useMenu(props); + return _3ORBWXWF_createElement("div", htmlProps); + }), + useMenuProviderContext +); +if (false) {} -;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-portal/dist/index.module.js +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/G6ONQ5EH.js +"use client"; +// src/composite/composite-hover.ts -/* ------------------------------------------------------------------------------------------------- - * Portal - * -----------------------------------------------------------------------------------------------*/ const $f1701beae083dbae$var$PORTAL_NAME = 'Portal'; -const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - var _globalThis$document; - const { container: container = globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.body , ...portalProps } = props; - return container ? /*#__PURE__*/ external_ReactDOM_default().createPortal(/*#__PURE__*/ (0,external_React_.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, extends_extends({}, portalProps, { - ref: forwardedRef - })), container) : null; -}); -/*#__PURE__*/ Object.assign($f1701beae083dbae$export$602eac185826482c, { - displayName: $f1701beae083dbae$var$PORTAL_NAME -}); -/* -----------------------------------------------------------------------------------------------*/ const $f1701beae083dbae$export$be92b6f5f03c0fe9 = (/* unused pure expression or super */ null && ($f1701beae083dbae$export$602eac185826482c)); +function getMouseDestination(event) { + const relatedTarget = event.relatedTarget; + if ((relatedTarget == null ? void 0 : relatedTarget.nodeType) === Node.ELEMENT_NODE) { + return relatedTarget; + } + return null; +} +function hoveringInside(event) { + const nextElement = getMouseDestination(event); + if (!nextElement) + return false; + return contains(event.currentTarget, nextElement); +} +var G6ONQ5EH_symbol = Symbol("composite-hover"); +function movingToAnotherItem(event) { + let dest = getMouseDestination(event); + if (!dest) + return false; + do { + if (Y3OOHFCN_hasOwnProperty(dest, G6ONQ5EH_symbol) && dest[G6ONQ5EH_symbol]) + return true; + dest = dest.parentElement; + } while (dest); + return false; +} +var useCompositeHover = createHook( + (_a) => { + var _b = _a, { + store, + focusOnHover = true, + blurOnHoverEnd = !!focusOnHover + } = _b, props = __objRest(_b, [ + "store", + "focusOnHover", + "blurOnHoverEnd" + ]); + const context = useCompositeContext(); + store = store || context; + invariant( + store, + false && 0 + ); + const isMouseMoving = useIsMouseMoving(); + const onMouseMoveProp = props.onMouseMove; + const focusOnHoverProp = useBooleanEvent(focusOnHover); + const onMouseMove = useEvent((event) => { + onMouseMoveProp == null ? void 0 : onMouseMoveProp(event); + if (event.defaultPrevented) + return; + if (!isMouseMoving()) + return; + if (!focusOnHoverProp(event)) + return; + if (!hasFocusWithin(event.currentTarget)) { + const baseElement = store == null ? void 0 : store.getState().baseElement; + if (baseElement && !hasFocus(baseElement)) { + baseElement.focus(); + } + } + store == null ? void 0 : store.setActiveId(event.currentTarget.id); + }); + const onMouseLeaveProp = props.onMouseLeave; + const blurOnHoverEndProp = useBooleanEvent(blurOnHoverEnd); + const onMouseLeave = useEvent((event) => { + var _a2; + onMouseLeaveProp == null ? void 0 : onMouseLeaveProp(event); + if (event.defaultPrevented) + return; + if (!isMouseMoving()) + return; + if (hoveringInside(event)) + return; + if (movingToAnotherItem(event)) + return; + if (!focusOnHoverProp(event)) + return; + if (!blurOnHoverEndProp(event)) + return; + store == null ? void 0 : store.setActiveId(null); + (_a2 = store == null ? void 0 : store.getState().baseElement) == null ? void 0 : _a2.focus(); + }); + const ref = (0,external_React_.useCallback)((element) => { + if (!element) + return; + element[G6ONQ5EH_symbol] = true; + }, []); + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { + ref: useMergeRefs(ref, props.ref), + onMouseMove, + onMouseLeave + }); + return props; + } +); +var CompositeHover = createMemoComponent( + (props) => { + const htmlProps = useCompositeHover(props); + return _3ORBWXWF_createElement("div", htmlProps); + } +); +if (false) {} +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/Y6467XPW.js +"use client"; -;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-presence/dist/index.module.js +// src/menu/menu-item.ts -function $fe963b355347cc68$export$3e6543de14f8614f(initialState, machine) { - return (0,external_React_.useReducer)((state, event)=>{ - const nextState = machine[state][event]; - return nextState !== null && nextState !== void 0 ? nextState : state; - }, initialState); +function menuHasFocus(baseElement, items, currentTarget) { + var _a; + if (!baseElement) + return false; + if (hasFocusWithin(baseElement)) + return true; + const expandedItem = items == null ? void 0 : items.find((item) => { + var _a2; + if (item.element === currentTarget) + return false; + return ((_a2 = item.element) == null ? void 0 : _a2.getAttribute("aria-expanded")) === "true"; + }); + const expandedMenuId = (_a = expandedItem == null ? void 0 : expandedItem.element) == null ? void 0 : _a.getAttribute("aria-controls"); + if (!expandedMenuId) + return false; + const doc = DLOEKDPY_getDocument(baseElement); + const expandedMenu = doc.getElementById(expandedMenuId); + if (!expandedMenu) + return false; + if (hasFocusWithin(expandedMenu)) + return true; + return !!expandedMenu.querySelector("[role=menuitem][aria-expanded=true]"); } - - -const $921a889cee6df7e8$export$99c2b779aa4e8b8b = (props)=>{ - const { present: present , children: children } = props; - const presence = $921a889cee6df7e8$var$usePresence(present); - const child = typeof children === 'function' ? children({ - present: presence.isPresent - }) : external_React_.Children.only(children); - const ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(presence.ref, child.ref); - const forceMount = typeof children === 'function'; - return forceMount || presence.isPresent ? /*#__PURE__*/ (0,external_React_.cloneElement)(child, { - ref: ref - }) : null; -}; -$921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName = 'Presence'; -/* ------------------------------------------------------------------------------------------------- - * usePresence - * -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$usePresence(present) { - const [node1, setNode] = (0,external_React_.useState)(); - const stylesRef = (0,external_React_.useRef)({}); - const prevPresentRef = (0,external_React_.useRef)(present); - const prevAnimationNameRef = (0,external_React_.useRef)('none'); - const initialState = present ? 'mounted' : 'unmounted'; - const [state, send] = $fe963b355347cc68$export$3e6543de14f8614f(initialState, { - mounted: { - UNMOUNT: 'unmounted', - ANIMATION_OUT: 'unmountSuspended' - }, - unmountSuspended: { - MOUNT: 'mounted', - ANIMATION_END: 'unmounted' - }, - unmounted: { - MOUNT: 'mounted' - } - }); - (0,external_React_.useEffect)(()=>{ - const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current); - prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none'; - }, [ - state +var useMenuItem = createHook( + (_a) => { + var _b = _a, { + store, + hideOnClick = true, + preventScrollOnKeyDown = true, + focusOnHover, + blurOnHoverEnd + } = _b, props = __objRest(_b, [ + "store", + "hideOnClick", + "preventScrollOnKeyDown", + "focusOnHover", + "blurOnHoverEnd" ]); - $9f79659886946c16$export$e5c5a5f917a5871c(()=>{ - const styles = stylesRef.current; - const wasPresent = prevPresentRef.current; - const hasPresentChanged = wasPresent !== present; - if (hasPresentChanged) { - const prevAnimationName = prevAnimationNameRef.current; - const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(styles); - if (present) send('MOUNT'); - else if (currentAnimationName === 'none' || (styles === null || styles === void 0 ? void 0 : styles.display) === 'none') // If there is no exit animation or the element is hidden, animations won't run - // so we unmount instantly - send('UNMOUNT'); - else { - /** - * When `present` changes to `false`, we check changes to animation-name to - * determine whether an animation has started. We chose this approach (reading - * computed styles) because there is no `animationrun` event and `animationstart` - * fires after `animation-delay` has expired which would be too late. - */ const isAnimating = prevAnimationName !== currentAnimationName; - if (wasPresent && isAnimating) send('ANIMATION_OUT'); - else send('UNMOUNT'); - } - prevPresentRef.current = present; + const menuContext = useMenuScopedContext(true); + const menubarContext = KA4GX64Z_useMenubarScopedContext(); + store = store || menuContext || menubarContext; + invariant( + store, + false && 0 + ); + const onClickProp = props.onClick; + const hideOnClickProp = useBooleanEvent(hideOnClick); + const hideMenu = "hideAll" in store ? store.hideAll : void 0; + const isWithinMenu = !!hideMenu; + const onClick = useEvent((event) => { + onClickProp == null ? void 0 : onClickProp(event); + if (event.defaultPrevented) + return; + if (isDownloading(event)) + return; + if (isOpeningInNewTab(event)) + return; + if (!hideMenu) + return; + const popupType = event.currentTarget.getAttribute("aria-haspopup"); + if (popupType === "menu") + return; + if (!hideOnClickProp(event)) + return; + hideMenu(); + }); + const contentElement = useStoreState( + store, + (state) => "contentElement" in state ? state.contentElement : null + ); + const role = getPopupItemRole(contentElement, "menuitem"); + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ + role + }, props), { + onClick + }); + props = useCompositeItem(_4R3V3JGP_spreadValues({ store, preventScrollOnKeyDown }, props)); + props = useCompositeHover(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ + store + }, props), { + focusOnHover(event) { + const getFocusOnHover = () => { + if (typeof focusOnHover === "function") + return focusOnHover(event); + if (focusOnHover != null) + return focusOnHover; + return true; + }; + if (!store) + return false; + if (!getFocusOnHover()) + return false; + const { baseElement, items } = store.getState(); + if (isWithinMenu) { + if (event.currentTarget.hasAttribute("aria-expanded")) { + event.currentTarget.focus(); + } + return true; } - }, [ - present, - send - ]); - $9f79659886946c16$export$e5c5a5f917a5871c(()=>{ - if (node1) { - /** - * Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel` - * event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we - * make sure we only trigger ANIMATION_END for the currently active animation. - */ const handleAnimationEnd = (event)=>{ - const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current); - const isCurrentAnimation = currentAnimationName.includes(event.animationName); - if (event.target === node1 && isCurrentAnimation) // With React 18 concurrency this update is applied - // a frame after the animation ends, creating a flash of visible content. - // By manually flushing we ensure they sync within a frame, removing the flash. - (0,external_ReactDOM_namespaceObject.flushSync)(()=>send('ANIMATION_END') - ); - }; - const handleAnimationStart = (event)=>{ - if (event.target === node1) // if animation occurred, store its name as the previous animation. - prevAnimationNameRef.current = $921a889cee6df7e8$var$getAnimationName(stylesRef.current); - }; - node1.addEventListener('animationstart', handleAnimationStart); - node1.addEventListener('animationcancel', handleAnimationEnd); - node1.addEventListener('animationend', handleAnimationEnd); - return ()=>{ - node1.removeEventListener('animationstart', handleAnimationStart); - node1.removeEventListener('animationcancel', handleAnimationEnd); - node1.removeEventListener('animationend', handleAnimationEnd); - }; - } else // Transition to the unmounted state if the node is removed prematurely. - // We avoid doing so during cleanup as the node may change but still exist. - send('ANIMATION_END'); - }, [ - node1, - send - ]); - return { - isPresent: [ - 'mounted', - 'unmountSuspended' - ].includes(state), - ref: (0,external_React_.useCallback)((node)=>{ - if (node) stylesRef.current = getComputedStyle(node); - setNode(node); - }, []) - }; -} -/* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$getAnimationName(styles) { - return (styles === null || styles === void 0 ? void 0 : styles.animationName) || 'none'; -} - - - - - - -;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-roving-focus/dist/index.module.js - - - - - - + if (menuHasFocus(baseElement, items, event.currentTarget)) { + event.currentTarget.focus(); + return true; + } + return false; + }, + blurOnHoverEnd(event) { + if (typeof blurOnHoverEnd === "function") + return blurOnHoverEnd(event); + if (blurOnHoverEnd != null) + return blurOnHoverEnd; + return isWithinMenu; + } + })); + return props; + } +); +var Y6467XPW_MenuItem = createMemoComponent((props) => { + const htmlProps = useMenuItem(props); + return _3ORBWXWF_createElement("div", htmlProps); +}); +if (false) {} +;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/checkbox/checkbox-store.js +"use client"; +// src/checkbox/checkbox-store.ts +function createCheckboxStore(props = {}) { + var _a; + throwOnConflictingProps(props, props.store); + const syncState = (_a = props.store) == null ? void 0 : _a.getState(); + const initialState = { + value: defaultValue( + props.value, + syncState == null ? void 0 : syncState.value, + props.defaultValue, + false + ) + }; + const checkbox = createStore(initialState, props.store); + return _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, checkbox), { + setValue: (value) => checkbox.setState("value", value) + }); +} +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/JIZ5C2JK.js +"use client"; +// src/checkbox/checkbox-store.ts +function useCheckboxStoreProps(store, update, props) { + useUpdateEffect(update, [props.store]); + useStoreProps(store, props, "value", "setValue"); + return store; +} +function useCheckboxStore(props = {}) { + const [store, update] = EKQEJRUF_useStore(createCheckboxStore, props); + return useCheckboxStoreProps(store, update, props); +} +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/VPR2WHQV.js +"use client"; -const $d7bdfb9eb0fdf311$var$ENTRY_FOCUS = 'rovingFocusGroup.onEntryFocus'; -const $d7bdfb9eb0fdf311$var$EVENT_OPTIONS = { - bubbles: false, - cancelable: true -}; -/* ------------------------------------------------------------------------------------------------- - * RovingFocusGroup - * -----------------------------------------------------------------------------------------------*/ const $d7bdfb9eb0fdf311$var$GROUP_NAME = 'RovingFocusGroup'; -const [$d7bdfb9eb0fdf311$var$Collection, $d7bdfb9eb0fdf311$var$useCollection, $d7bdfb9eb0fdf311$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($d7bdfb9eb0fdf311$var$GROUP_NAME); -const [$d7bdfb9eb0fdf311$var$createRovingFocusGroupContext, $d7bdfb9eb0fdf311$export$c7109489551a4f4] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($d7bdfb9eb0fdf311$var$GROUP_NAME, [ - $d7bdfb9eb0fdf311$var$createCollectionScope -]); -const [$d7bdfb9eb0fdf311$var$RovingFocusProvider, $d7bdfb9eb0fdf311$var$useRovingFocusContext] = $d7bdfb9eb0fdf311$var$createRovingFocusGroupContext($d7bdfb9eb0fdf311$var$GROUP_NAME); -const $d7bdfb9eb0fdf311$export$8699f7c8af148338 = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - return /*#__PURE__*/ (0,external_React_.createElement)($d7bdfb9eb0fdf311$var$Collection.Provider, { - scope: props.__scopeRovingFocusGroup - }, /*#__PURE__*/ (0,external_React_.createElement)($d7bdfb9eb0fdf311$var$Collection.Slot, { - scope: props.__scopeRovingFocusGroup - }, /*#__PURE__*/ (0,external_React_.createElement)($d7bdfb9eb0fdf311$var$RovingFocusGroupImpl, extends_extends({}, props, { - ref: forwardedRef - })))); -}); -/*#__PURE__*/ Object.assign($d7bdfb9eb0fdf311$export$8699f7c8af148338, { - displayName: $d7bdfb9eb0fdf311$var$GROUP_NAME -}); -/* -----------------------------------------------------------------------------------------------*/ const $d7bdfb9eb0fdf311$var$RovingFocusGroupImpl = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { __scopeRovingFocusGroup: __scopeRovingFocusGroup , orientation: orientation , loop: loop = false , dir: dir , currentTabStopId: currentTabStopIdProp , defaultCurrentTabStopId: defaultCurrentTabStopId , onCurrentTabStopIdChange: onCurrentTabStopIdChange , onEntryFocus: onEntryFocus , ...groupProps } = props; - const ref = (0,external_React_.useRef)(null); - const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref); - const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir); - const [currentTabStopId = null, setCurrentTabStopId] = $71cd76cc60e0454e$export$6f32135080cb4c3({ - prop: currentTabStopIdProp, - defaultProp: defaultCurrentTabStopId, - onChange: onCurrentTabStopIdChange - }); - const [isTabbingBackOut, setIsTabbingBackOut] = (0,external_React_.useState)(false); - const handleEntryFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEntryFocus); - const getItems = $d7bdfb9eb0fdf311$var$useCollection(__scopeRovingFocusGroup); - const isClickFocusRef = (0,external_React_.useRef)(false); - const [focusableItemsCount, setFocusableItemsCount] = (0,external_React_.useState)(0); - (0,external_React_.useEffect)(()=>{ - const node = ref.current; - if (node) { - node.addEventListener($d7bdfb9eb0fdf311$var$ENTRY_FOCUS, handleEntryFocus); - return ()=>node.removeEventListener($d7bdfb9eb0fdf311$var$ENTRY_FOCUS, handleEntryFocus) - ; - } - }, [ - handleEntryFocus - ]); - return /*#__PURE__*/ (0,external_React_.createElement)($d7bdfb9eb0fdf311$var$RovingFocusProvider, { - scope: __scopeRovingFocusGroup, - orientation: orientation, - dir: direction, - loop: loop, - currentTabStopId: currentTabStopId, - onItemFocus: (0,external_React_.useCallback)((tabStopId)=>setCurrentTabStopId(tabStopId) - , [ - setCurrentTabStopId - ]), - onItemShiftTab: (0,external_React_.useCallback)(()=>setIsTabbingBackOut(true) - , []), - onFocusableItemAdd: (0,external_React_.useCallback)(()=>setFocusableItemsCount((prevCount)=>prevCount + 1 - ) - , []), - onFocusableItemRemove: (0,external_React_.useCallback)(()=>setFocusableItemsCount((prevCount)=>prevCount - 1 - ) - , []) - }, /*#__PURE__*/ (0,external_React_.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, extends_extends({ - tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0, - "data-orientation": orientation - }, groupProps, { - ref: composedRefs, - style: { - outline: 'none', - ...props.style - }, - onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onMouseDown, ()=>{ - isClickFocusRef.current = true; - }), - onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, (event)=>{ - // We normally wouldn't need this check, because we already check - // that the focus is on the current target and not bubbling to it. - // We do this because Safari doesn't focus buttons when clicked, and - // instead, the wrapper will get focused and not through a bubbling event. - const isKeyboardFocus = !isClickFocusRef.current; - if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) { - const entryFocusEvent = new CustomEvent($d7bdfb9eb0fdf311$var$ENTRY_FOCUS, $d7bdfb9eb0fdf311$var$EVENT_OPTIONS); - event.currentTarget.dispatchEvent(entryFocusEvent); - if (!entryFocusEvent.defaultPrevented) { - const items = getItems().filter((item)=>item.focusable - ); - const activeItem = items.find((item)=>item.active - ); - const currentItem = items.find((item)=>item.id === currentTabStopId - ); - const candidateItems = [ - activeItem, - currentItem, - ...items - ].filter(Boolean); - const candidateNodes = candidateItems.map((item)=>item.ref.current - ); - $d7bdfb9eb0fdf311$var$focusFirst(candidateNodes); - } - } - isClickFocusRef.current = false; - }), - onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlur, ()=>setIsTabbingBackOut(false) - ) - }))); -}); -/* ------------------------------------------------------------------------------------------------- - * RovingFocusGroupItem - * -----------------------------------------------------------------------------------------------*/ const $d7bdfb9eb0fdf311$var$ITEM_NAME = 'RovingFocusGroupItem'; -const $d7bdfb9eb0fdf311$export$ab9df7c53fe8454 = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { __scopeRovingFocusGroup: __scopeRovingFocusGroup , focusable: focusable = true , active: active = false , tabStopId: tabStopId , ...itemProps } = props; - const autoId = $1746a345f3d73bb7$export$f680877a34711e37(); - const id = tabStopId || autoId; - const context = $d7bdfb9eb0fdf311$var$useRovingFocusContext($d7bdfb9eb0fdf311$var$ITEM_NAME, __scopeRovingFocusGroup); - const isCurrentTabStop = context.currentTabStopId === id; - const getItems = $d7bdfb9eb0fdf311$var$useCollection(__scopeRovingFocusGroup); - const { onFocusableItemAdd: onFocusableItemAdd , onFocusableItemRemove: onFocusableItemRemove } = context; - (0,external_React_.useEffect)(()=>{ - if (focusable) { - onFocusableItemAdd(); - return ()=>onFocusableItemRemove() - ; - } - }, [ - focusable, - onFocusableItemAdd, - onFocusableItemRemove - ]); - return /*#__PURE__*/ (0,external_React_.createElement)($d7bdfb9eb0fdf311$var$Collection.ItemSlot, { - scope: __scopeRovingFocusGroup, - id: id, - focusable: focusable, - active: active - }, /*#__PURE__*/ (0,external_React_.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.span, extends_extends({ - tabIndex: isCurrentTabStop ? 0 : -1, - "data-orientation": context.orientation - }, itemProps, { - ref: forwardedRef, - onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onMouseDown, (event)=>{ - // We prevent focusing non-focusable items on `mousedown`. - // Even though the item has tabIndex={-1}, that only means take it out of the tab order. - if (!focusable) event.preventDefault(); // Safari doesn't focus a button when clicked so we run our logic on mousedown also - else context.onItemFocus(id); - }), - onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, ()=>context.onItemFocus(id) - ), - onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{ - if (event.key === 'Tab' && event.shiftKey) { - context.onItemShiftTab(); - return; - } - if (event.target !== event.currentTarget) return; - const focusIntent = $d7bdfb9eb0fdf311$var$getFocusIntent(event, context.orientation, context.dir); - if (focusIntent !== undefined) { - event.preventDefault(); - const items = getItems().filter((item)=>item.focusable - ); - let candidateNodes = items.map((item)=>item.ref.current - ); - if (focusIntent === 'last') candidateNodes.reverse(); - else if (focusIntent === 'prev' || focusIntent === 'next') { - if (focusIntent === 'prev') candidateNodes.reverse(); - const currentIndex = candidateNodes.indexOf(event.currentTarget); - candidateNodes = context.loop ? $d7bdfb9eb0fdf311$var$wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1); - } - /** - * Imperative focus during keydown is risky so we prevent React's batching updates - * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332 - */ setTimeout(()=>$d7bdfb9eb0fdf311$var$focusFirst(candidateNodes) - ); - } - }) - }))); -}); -/*#__PURE__*/ Object.assign($d7bdfb9eb0fdf311$export$ab9df7c53fe8454, { - displayName: $d7bdfb9eb0fdf311$var$ITEM_NAME -}); -/* -----------------------------------------------------------------------------------------------*/ // prettier-ignore -const $d7bdfb9eb0fdf311$var$MAP_KEY_TO_FOCUS_INTENT = { - ArrowLeft: 'prev', - ArrowUp: 'prev', - ArrowRight: 'next', - ArrowDown: 'next', - PageUp: 'first', - Home: 'first', - PageDown: 'last', - End: 'last' -}; -function $d7bdfb9eb0fdf311$var$getDirectionAwareKey(key, dir) { - if (dir !== 'rtl') return key; - return key === 'ArrowLeft' ? 'ArrowRight' : key === 'ArrowRight' ? 'ArrowLeft' : key; -} -function $d7bdfb9eb0fdf311$var$getFocusIntent(event, orientation, dir) { - const key = $d7bdfb9eb0fdf311$var$getDirectionAwareKey(event.key, dir); - if (orientation === 'vertical' && [ - 'ArrowLeft', - 'ArrowRight' - ].includes(key)) return undefined; - if (orientation === 'horizontal' && [ - 'ArrowUp', - 'ArrowDown' - ].includes(key)) return undefined; - return $d7bdfb9eb0fdf311$var$MAP_KEY_TO_FOCUS_INTENT[key]; -} -function $d7bdfb9eb0fdf311$var$focusFirst(candidates) { - const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement; - for (const candidate of candidates){ - // if focus is already where we want to go, we don't want to keep going through the candidates - if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return; - candidate.focus(); - if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return; - } -} -/** - * Wraps an array around itself at a given start index - * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']` - */ function $d7bdfb9eb0fdf311$var$wrapArray(array, startIndex) { - return array.map((_, index)=>array[(startIndex + index) % array.length] - ); -} -const $d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9 = $d7bdfb9eb0fdf311$export$8699f7c8af148338; -const $d7bdfb9eb0fdf311$export$6d08773d2e66f8f2 = $d7bdfb9eb0fdf311$export$ab9df7c53fe8454; +// src/checkbox/checkbox-context.tsx +var VPR2WHQV_ctx = createStoreContext(); +var useCheckboxContext = VPR2WHQV_ctx.useContext; +var useCheckboxScopedContext = VPR2WHQV_ctx.useScopedContext; +var useCheckboxProviderContext = VPR2WHQV_ctx.useProviderContext; +var CheckboxContextProvider = VPR2WHQV_ctx.ContextProvider; +var CheckboxScopedContextProvider = VPR2WHQV_ctx.ScopedContextProvider; +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/3AHQ6JCP.js +"use client"; -;// CONCATENATED MODULE: ./node_modules/aria-hidden/dist/es2015/index.js -var getDefaultParent = function (originalTarget) { - if (typeof document === 'undefined') { - return null; - } - var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget; - return sampleTarget.ownerDocument.body; -}; -var counterMap = new WeakMap(); -var uncontrolledNodes = new WeakMap(); -var markerMap = {}; -var lockCount = 0; -var unwrapHost = function (node) { - return node && (node.host || unwrapHost(node.parentNode)); -}; -var correctTargets = function (parent, targets) { - return targets - .map(function (target) { - if (parent.contains(target)) { - return target; - } - var correctedTarget = unwrapHost(target); - if (correctedTarget && parent.contains(correctedTarget)) { - return correctedTarget; - } - console.error('aria-hidden', target, 'in not contained inside', parent, '. Doing nothing'); - return null; - }) - .filter(function (x) { return Boolean(x); }); -}; -/** - * Marks everything except given node(or nodes) as aria-hidden - * @param {Element | Element[]} originalTarget - elements to keep on the page - * @param [parentNode] - top element, defaults to document.body - * @param {String} [markerName] - a special attribute to mark every node - * @param {String} [controlAttribute] - html Attribute to control - * @return {Undo} undo command - */ -var applyAttributeToOthers = function (originalTarget, parentNode, markerName, controlAttribute) { - var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]); - if (!markerMap[markerName]) { - markerMap[markerName] = new WeakMap(); - } - var markerCounter = markerMap[markerName]; - var hiddenNodes = []; - var elementsToKeep = new Set(); - var elementsToStop = new Set(targets); - var keep = function (el) { - if (!el || elementsToKeep.has(el)) { - return; - } - elementsToKeep.add(el); - keep(el.parentNode); - }; - targets.forEach(keep); - var deep = function (parent) { - if (!parent || elementsToStop.has(parent)) { - return; - } - Array.prototype.forEach.call(parent.children, function (node) { - if (elementsToKeep.has(node)) { - deep(node); - } - else { - var attr = node.getAttribute(controlAttribute); - var alreadyHidden = attr !== null && attr !== 'false'; - var counterValue = (counterMap.get(node) || 0) + 1; - var markerValue = (markerCounter.get(node) || 0) + 1; - counterMap.set(node, counterValue); - markerCounter.set(node, markerValue); - hiddenNodes.push(node); - if (counterValue === 1 && alreadyHidden) { - uncontrolledNodes.set(node, true); - } - if (markerValue === 1) { - node.setAttribute(markerName, 'true'); - } - if (!alreadyHidden) { - node.setAttribute(controlAttribute, 'true'); - } - } - }); - }; - deep(parentNode); - elementsToKeep.clear(); - lockCount++; - return function () { - hiddenNodes.forEach(function (node) { - var counterValue = counterMap.get(node) - 1; - var markerValue = markerCounter.get(node) - 1; - counterMap.set(node, counterValue); - markerCounter.set(node, markerValue); - if (!counterValue) { - if (!uncontrolledNodes.has(node)) { - node.removeAttribute(controlAttribute); - } - uncontrolledNodes.delete(node); - } - if (!markerValue) { - node.removeAttribute(markerName); - } - }); - lockCount--; - if (!lockCount) { - // clear - counterMap = new WeakMap(); - counterMap = new WeakMap(); - uncontrolledNodes = new WeakMap(); - markerMap = {}; - } - }; -}; -/** - * Marks everything except given node(or nodes) as aria-hidden - * @param {Element | Element[]} originalTarget - elements to keep on the page - * @param [parentNode] - top element, defaults to document.body - * @param {String} [markerName] - a special attribute to mark every node - * @return {Undo} undo command - */ -var hideOthers = function (originalTarget, parentNode, markerName) { - if (markerName === void 0) { markerName = 'data-aria-hidden'; } - var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]); - var activeParentNode = parentNode || getDefaultParent(originalTarget); - if (!activeParentNode) { - return function () { return null; }; - } - // we should not hide ariaLive elements - https://github.com/theKashey/aria-hidden/issues/10 - targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live]'))); - return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden'); -}; -/** - * Marks everything except given node(or nodes) as inert - * @param {Element | Element[]} originalTarget - elements to keep on the page - * @param [parentNode] - top element, defaults to document.body - * @param {String} [markerName] - a special attribute to mark every node - * @return {Undo} undo command - */ -var inertOthers = function (originalTarget, parentNode, markerName) { - if (markerName === void 0) { markerName = 'data-inert-ed'; } - var activeParentNode = parentNode || getDefaultParent(originalTarget); - if (!activeParentNode) { - return function () { return null; }; - } - return applyAttributeToOthers(originalTarget, activeParentNode, markerName, 'inert'); -}; -/** - * @returns if current browser supports inert - */ -var es2015_supportsInert = function () { - return typeof HTMLElement !== 'undefined' && HTMLElement.prototype.hasOwnProperty('inert'); -}; -/** - * Automatic function to "suppress" DOM elements - _hide_ or _inert_ in the best possible way - * @param {Element | Element[]} originalTarget - elements to keep on the page - * @param [parentNode] - top element, defaults to document.body - * @param {String} [markerName] - a special attribute to mark every node - * @return {Undo} undo command - */ -var suppressOthers = function (originalTarget, parentNode, markerName) { - if (markerName === void 0) { markerName = 'data-suppressed'; } - return (es2015_supportsInert() ? inertOthers : hideOthers)(originalTarget, parentNode, markerName); -}; -;// CONCATENATED MODULE: ./node_modules/react-remove-scroll-bar/dist/es2015/constants.js -var zeroRightClassName = 'right-scroll-bar-position'; -var fullWidthClassName = 'width-before-scroll-bar'; -var noScrollbarsClassName = 'with-scroll-bars-hidden'; -/** - * Name of a CSS variable containing the amount of "hidden" scrollbar - * ! might be undefined ! use will fallback! - */ -var removedBarSizeVariable = '--removed-body-scroll-bar-size'; -;// CONCATENATED MODULE: ./node_modules/use-callback-ref/dist/es2015/assignRef.js -/** - * Assigns a value for a given ref, no matter of the ref format - * @param {RefObject} ref - a callback function or ref object - * @param value - a new value - * - * @see https://github.com/theKashey/use-callback-ref#assignref - * @example - * const refObject = useRef(); - * const refFn = (ref) => {....} - * - * assignRef(refObject, "refValue"); - * assignRef(refFn, "refValue"); - */ -function assignRef(ref, value) { - if (typeof ref === 'function') { - ref(value); - } - else if (ref) { - ref.current = value; - } - return ref; -} -;// CONCATENATED MODULE: ./node_modules/use-callback-ref/dist/es2015/useRef.js -/** - * creates a MutableRef with ref change callback - * @param initialValue - initial ref value - * @param {Function} callback - a callback to run when value changes - * - * @example - * const ref = useCallbackRef(0, (newValue, oldValue) => console.log(oldValue, '->', newValue); - * ref.current = 1; - * // prints 0 -> 1 - * - * @see https://reactjs.org/docs/hooks-reference.html#useref - * @see https://github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref - * @returns {MutableRefObject} - */ -function useCallbackRef(initialValue, callback) { - var ref = (0,external_React_.useState)(function () { return ({ - // value - value: initialValue, - // last callback - callback: callback, - // "memoized" public interface - facade: { - get current() { - return ref.value; - }, - set current(value) { - var last = ref.value; - if (last !== value) { - ref.value = value; - ref.callback(value, last); - } - }, - }, - }); })[0]; - // update callback - ref.callback = callback; - return ref.facade; -} -;// CONCATENATED MODULE: ./node_modules/use-callback-ref/dist/es2015/useMergeRef.js +// src/checkbox/checkbox.tsx -/** - * Merges two or more refs together providing a single interface to set their value - * @param {RefObject|Ref} refs - * @returns {MutableRefObject} - a new ref, which translates all changes to {refs} - * - * @see {@link mergeRefs} a version without buit-in memoization - * @see https://github.com/theKashey/use-callback-ref#usemergerefs - * @example - * const Component = React.forwardRef((props, ref) => { - * const ownRef = useRef(); - * const domRef = useMergeRefs([ref, ownRef]); // 👈 merge together - * return <div ref={domRef}>...</div> - * } - */ -function useMergeRef_useMergeRefs(refs, defaultValue) { - return useCallbackRef(defaultValue || null, function (newValue) { return refs.forEach(function (ref) { return assignRef(ref, newValue); }); }); -} -;// CONCATENATED MODULE: ./node_modules/use-sidecar/dist/es2015/medium.js -function ItoI(a) { - return a; -} -function innerCreateMedium(defaults, middleware) { - if (middleware === void 0) { middleware = ItoI; } - var buffer = []; - var assigned = false; - var medium = { - read: function () { - if (assigned) { - throw new Error('Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.'); - } - if (buffer.length) { - return buffer[buffer.length - 1]; - } - return defaults; - }, - useMedium: function (data) { - var item = middleware(data, assigned); - buffer.push(item); - return function () { - buffer = buffer.filter(function (x) { return x !== item; }); - }; - }, - assignSyncMedium: function (cb) { - assigned = true; - while (buffer.length) { - var cbs = buffer; - buffer = []; - cbs.forEach(cb); - } - buffer = { - push: function (x) { return cb(x); }, - filter: function () { return buffer; }, - }; - }, - assignMedium: function (cb) { - assigned = true; - var pendingQueue = []; - if (buffer.length) { - var cbs = buffer; - buffer = []; - cbs.forEach(cb); - pendingQueue = buffer; - } - var executeQueue = function () { - var cbs = pendingQueue; - pendingQueue = []; - cbs.forEach(cb); - }; - var cycle = function () { return Promise.resolve().then(executeQueue); }; - cycle(); - buffer = { - push: function (x) { - pendingQueue.push(x); - cycle(); - }, - filter: function (filter) { - pendingQueue = pendingQueue.filter(filter); - return buffer; - }, - }; - }, - }; - return medium; +function setMixed(element, mixed) { + if (mixed) { + element.indeterminate = true; + } else if (element.indeterminate) { + element.indeterminate = false; + } } -function createMedium(defaults, middleware) { - if (middleware === void 0) { middleware = ItoI; } - return innerCreateMedium(defaults, middleware); +function isNativeCheckbox(tagName, type) { + return tagName === "input" && (!type || type === "checkbox"); } -// eslint-disable-next-line @typescript-eslint/ban-types -function createSidecarMedium(options) { - if (options === void 0) { options = {}; } - var medium = innerCreateMedium(null); - medium.options = __assign({ async: true, ssr: false }, options); - return medium; +function getPrimitiveValue(value) { + if (Array.isArray(value)) { + return value.toString(); + } + return value; } - -;// CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/medium.js - -var effectCar = createSidecarMedium(); - -;// CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/UI.js - - +var useCheckbox = createHook( + (_a) => { + var _b = _a, { + store, + name, + value: valueProp, + checked: checkedProp, + defaultChecked + } = _b, props = __objRest(_b, [ + "store", + "name", + "value", + "checked", + "defaultChecked" + ]); + const context = useCheckboxContext(); + store = store || context; + const [_checked, setChecked] = (0,external_React_.useState)(defaultChecked != null ? defaultChecked : false); + const checked = useStoreState(store, (state) => { + if (checkedProp !== void 0) + return checkedProp; + if ((state == null ? void 0 : state.value) === void 0) + return _checked; + if (valueProp != null) { + if (Array.isArray(state.value)) { + const primitiveValue = getPrimitiveValue(valueProp); + return state.value.includes(primitiveValue); + } + return state.value === valueProp; + } + if (Array.isArray(state.value)) + return false; + if (typeof state.value === "boolean") + return state.value; + return false; + }); + const ref = (0,external_React_.useRef)(null); + const tagName = useTagName(ref, props.as || "input"); + const nativeCheckbox = isNativeCheckbox(tagName, props.type); + const mixed = checked ? checked === "mixed" : void 0; + const isChecked = checked === "mixed" ? false : checked; + const disabled = disabledFromProps(props); + const [propertyUpdated, schedulePropertyUpdate] = useForceUpdate(); + (0,external_React_.useEffect)(() => { + const element = ref.current; + if (!element) + return; + setMixed(element, mixed); + if (nativeCheckbox) + return; + element.checked = isChecked; + if (name !== void 0) { + element.name = name; + } + if (valueProp !== void 0) { + element.value = `${valueProp}`; + } + }, [propertyUpdated, mixed, nativeCheckbox, isChecked, name, valueProp]); + const onChangeProp = props.onChange; + const onChange = useEvent((event) => { + if (disabled) { + event.stopPropagation(); + event.preventDefault(); + return; + } + setMixed(event.currentTarget, mixed); + if (!nativeCheckbox) { + event.currentTarget.checked = !event.currentTarget.checked; + schedulePropertyUpdate(); + } + onChangeProp == null ? void 0 : onChangeProp(event); + if (event.defaultPrevented) + return; + const elementChecked = event.currentTarget.checked; + setChecked(elementChecked); + store == null ? void 0 : store.setValue((prevValue) => { + if (valueProp == null) + return elementChecked; + const primitiveValue = getPrimitiveValue(valueProp); + if (!Array.isArray(prevValue)) { + return prevValue === primitiveValue ? false : primitiveValue; + } + if (elementChecked) { + if (prevValue.includes(primitiveValue)) { + return prevValue; + } + return [...prevValue, primitiveValue]; + } + return prevValue.filter((v) => v !== primitiveValue); + }); + }); + const onClickProp = props.onClick; + const onClick = useEvent((event) => { + onClickProp == null ? void 0 : onClickProp(event); + if (event.defaultPrevented) + return; + if (nativeCheckbox) + return; + onChange(event); + }); + props = useWrapElement( + props, + (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(CheckboxCheckedContext.Provider, { value: isChecked, children: element }), + [isChecked] + ); + props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ + role: !nativeCheckbox ? "checkbox" : void 0, + type: nativeCheckbox ? "checkbox" : void 0, + "aria-checked": checked + }, props), { + ref: useMergeRefs(ref, props.ref), + onChange, + onClick + }); + props = useCommand(_4R3V3JGP_spreadValues({ clickOnEnter: !nativeCheckbox }, props)); + return _4R3V3JGP_spreadValues({ + name: nativeCheckbox ? name : void 0, + value: nativeCheckbox ? valueProp : void 0, + checked: isChecked + }, props); + } +); +var Checkbox = createComponent((props) => { + const htmlProps = useCheckbox(props); + return _3ORBWXWF_createElement("input", htmlProps); +}); +if (false) {} -var nothing = function () { - return; -}; -/** - * Removes scrollbar from the page and contain the scroll within the Lock - */ -var RemoveScroll = external_React_.forwardRef(function (props, parentRef) { - var ref = external_React_.useRef(null); - var _a = external_React_.useState({ - onScrollCapture: nothing, - onWheelCapture: nothing, - onTouchMoveCapture: nothing, - }), callbacks = _a[0], setCallbacks = _a[1]; - var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? 'div' : _b, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]); - var SideCar = sideCar; - var containerRef = useMergeRef_useMergeRefs([ref, parentRef]); - var containerProps = __assign(__assign({}, rest), callbacks); - return (external_React_.createElement(external_React_.Fragment, null, - enabled && (external_React_.createElement(SideCar, { sideCar: effectCar, removeScrollBar: removeScrollBar, shards: shards, noIsolation: noIsolation, inert: inert, setCallbacks: setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref })), - forwardProps ? (external_React_.cloneElement(external_React_.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef }))) : (external_React_.createElement(Container, __assign({}, containerProps, { className: className, ref: containerRef }), children)))); -}); -RemoveScroll.defaultProps = { - enabled: true, - removeScrollBar: true, - inert: false, -}; -RemoveScroll.classNames = { - fullWidth: fullWidthClassName, - zeroRight: zeroRightClassName, -}; +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/menu/menu-item-checkbox.js +"use client"; -;// CONCATENATED MODULE: ./node_modules/use-sidecar/dist/es2015/exports.js -var SideCar = function (_a) { - var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]); - if (!sideCar) { - throw new Error('Sidecar: please provide `sideCar` property to import the right car'); - } - var Target = sideCar.read(); - if (!Target) { - throw new Error('Sidecar medium not found'); - } - return external_React_.createElement(Target, __assign({}, rest)); -}; -SideCar.isSideCarExport = true; -function exportSidecar(medium, exported) { - medium.useMedium(exported); - return SideCar; -} -;// CONCATENATED MODULE: ./node_modules/get-nonce/dist/es2015/index.js -var currentNonce; -var setNonce = function (nonce) { - currentNonce = nonce; -}; -var getNonce = function () { - if (currentNonce) { - return currentNonce; - } - if (true) { - return __webpack_require__.nc; - } - return undefined; -}; -;// CONCATENATED MODULE: ./node_modules/react-style-singleton/dist/es2015/singleton.js -function makeStyleTag() { - if (!document) - return null; - var tag = document.createElement('style'); - tag.type = 'text/css'; - var nonce = getNonce(); - if (nonce) { - tag.setAttribute('nonce', nonce); - } - return tag; -} -function injectStyles(tag, css) { - // @ts-ignore - if (tag.styleSheet) { - // @ts-ignore - tag.styleSheet.cssText = css; - } - else { - tag.appendChild(document.createTextNode(css)); - } -} -function insertStyleTag(tag) { - var head = document.head || document.getElementsByTagName('head')[0]; - head.appendChild(tag); -} -var stylesheetSingleton = function () { - var counter = 0; - var stylesheet = null; - return { - add: function (style) { - if (counter == 0) { - if ((stylesheet = makeStyleTag())) { - injectStyles(stylesheet, style); - insertStyleTag(stylesheet); - } - } - counter++; - }, - remove: function () { - counter--; - if (!counter && stylesheet) { - stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet); - stylesheet = null; - } - }, - }; -}; -;// CONCATENATED MODULE: ./node_modules/react-style-singleton/dist/es2015/hook.js -/** - * creates a hook to control style singleton - * @see {@link styleSingleton} for a safer component version - * @example - * ```tsx - * const useStyle = styleHookSingleton(); - * /// - * useStyle('body { overflow: hidden}'); - */ -var styleHookSingleton = function () { - var sheet = stylesheetSingleton(); - return function (styles, isDynamic) { - external_React_.useEffect(function () { - sheet.add(styles); - return function () { - sheet.remove(); - }; - }, [styles && isDynamic]); - }; -}; -;// CONCATENATED MODULE: ./node_modules/react-style-singleton/dist/es2015/component.js -/** - * create a Component to add styles on demand - * - styles are added when first instance is mounted - * - styles are removed when the last instance is unmounted - * - changing styles in runtime does nothing unless dynamic is set. But with multiple components that can lead to the undefined behavior - */ -var styleSingleton = function () { - var useStyle = styleHookSingleton(); - var Sheet = function (_a) { - var styles = _a.styles, dynamic = _a.dynamic; - useStyle(styles, dynamic); - return null; - }; - return Sheet; -}; -;// CONCATENATED MODULE: ./node_modules/react-style-singleton/dist/es2015/index.js -;// CONCATENATED MODULE: ./node_modules/react-remove-scroll-bar/dist/es2015/utils.js -var zeroGap = { - left: 0, - top: 0, - right: 0, - gap: 0, -}; -var utils_parse = function (x) { return parseInt(x || '', 10) || 0; }; -var getOffset = function (gapMode) { - var cs = window.getComputedStyle(document.body); - var left = cs[gapMode === 'padding' ? 'paddingLeft' : 'marginLeft']; - var top = cs[gapMode === 'padding' ? 'paddingTop' : 'marginTop']; - var right = cs[gapMode === 'padding' ? 'paddingRight' : 'marginRight']; - return [utils_parse(left), utils_parse(top), utils_parse(right)]; -}; -var getGapWidth = function (gapMode) { - if (gapMode === void 0) { gapMode = 'margin'; } - if (typeof window === 'undefined') { - return zeroGap; - } - var offsets = getOffset(gapMode); - var documentWidth = document.documentElement.clientWidth; - var windowWidth = window.innerWidth; - return { - left: offsets[0], - top: offsets[1], - right: offsets[2], - gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0]), - }; -}; -;// CONCATENATED MODULE: ./node_modules/react-remove-scroll-bar/dist/es2015/component.js -var Style = styleSingleton(); -// important tip - once we measure scrollBar width and remove them -// we could not repeat this operation -// thus we are using style-singleton - only the first "yet correct" style will be applied. -var getStyles = function (_a, allowRelative, gapMode, important) { - var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap; - if (gapMode === void 0) { gapMode = 'margin'; } - return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([ - allowRelative && "position: relative ".concat(important, ";"), - gapMode === 'margin' && - "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "), - gapMode === 'padding' && "padding-right: ".concat(gap, "px ").concat(important, ";"), - ] - .filter(Boolean) - .join(''), "\n }\n \n .").concat(zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body {\n ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n }\n"); -}; -/** - * Removes page scrollbar and blocks page scroll when mounted - */ -var RemoveScrollBar = function (props) { - var noRelative = props.noRelative, noImportant = props.noImportant, _a = props.gapMode, gapMode = _a === void 0 ? 'margin' : _a; - /* - gap will be measured on every component mount - however it will be used only by the "first" invocation - due to singleton nature of <Style - */ - var gap = external_React_.useMemo(function () { return getGapWidth(gapMode); }, [gapMode]); - return external_React_.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? '!important' : '') }); -}; -;// CONCATENATED MODULE: ./node_modules/react-remove-scroll-bar/dist/es2015/index.js +// src/menu/menu-item-checkbox.ts -;// CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js -var passiveSupported = false; -if (typeof window !== 'undefined') { - try { - var aggresiveCapture_options = Object.defineProperty({}, 'passive', { - get: function () { - passiveSupported = true; - return true; - }, - }); - // @ts-ignore - window.addEventListener('test', aggresiveCapture_options, aggresiveCapture_options); - // @ts-ignore - window.removeEventListener('test', aggresiveCapture_options, aggresiveCapture_options); +function menu_item_checkbox_getPrimitiveValue(value) { + if (Array.isArray(value)) { + return value.toString(); + } + return value; +} +function getValue(storeValue, value, checked) { + if (value === void 0) { + if (Array.isArray(storeValue)) + return storeValue; + return !!checked; + } + const primitiveValue = menu_item_checkbox_getPrimitiveValue(value); + if (!Array.isArray(storeValue)) { + if (checked) { + return primitiveValue; } - catch (err) { - passiveSupported = false; + return storeValue === primitiveValue ? false : storeValue; + } + if (checked) { + if (storeValue.includes(primitiveValue)) { + return storeValue; } + return [...storeValue, primitiveValue]; + } + return storeValue.filter((v) => v !== primitiveValue); } -var nonPassive = passiveSupported ? { passive: false } : false; - -;// CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/handleScroll.js -var alwaysContainsScroll = function (node) { - // textarea will always _contain_ scroll inside self. It only can be hidden - return node.tagName === 'TEXTAREA'; -}; -var elementCanBeScrolled = function (node, overflow) { - var styles = window.getComputedStyle(node); - return ( - // not-not-scrollable - styles[overflow] !== 'hidden' && - // contains scroll inside self - !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === 'visible')); -}; -var elementCouldBeVScrolled = function (node) { return elementCanBeScrolled(node, 'overflowY'); }; -var elementCouldBeHScrolled = function (node) { return elementCanBeScrolled(node, 'overflowX'); }; -var locationCouldBeScrolled = function (axis, node) { - var current = node; - do { - // Skip over shadow root - if (typeof ShadowRoot !== 'undefined' && current instanceof ShadowRoot) { - current = current.host; - } - var isScrollable = elementCouldBeScrolled(axis, current); - if (isScrollable) { - var _a = getScrollVariables(axis, current), s = _a[1], d = _a[2]; - if (s > d) { - return true; - } - } - current = current.parentNode; - } while (current && current !== document.body); - return false; -}; -var getVScrollVariables = function (_a) { - var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight; - return [ - scrollTop, - scrollHeight, - clientHeight, - ]; -}; -var getHScrollVariables = function (_a) { - var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth; - return [ - scrollLeft, - scrollWidth, - clientWidth, - ]; -}; -var elementCouldBeScrolled = function (axis, node) { - return axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node); -}; -var getScrollVariables = function (axis, node) { - return axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node); -}; -var getDirectionFactor = function (axis, direction) { - /** - * If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position, - * and then increasingly negative as you scroll towards the end of the content. - * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft - */ - return axis === 'h' && direction === 'rtl' ? -1 : 1; -}; -var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll) { - var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction); - var delta = directionFactor * sourceDelta; - // find scrollable target - var target = event.target; - var targetInLock = endTarget.contains(target); - var shouldCancelScroll = false; - var isDeltaPositive = delta > 0; - var availableScroll = 0; - var availableScrollTop = 0; - do { - var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2]; - var elementScroll = scroll_1 - capacity - directionFactor * position; - if (position || elementScroll) { - if (elementCouldBeScrolled(axis, target)) { - availableScroll += elementScroll; - availableScrollTop += position; - } - } - target = target.parentNode; - } while ( - // portaled content - (!targetInLock && target !== document.body) || - // self content - (targetInLock && (endTarget.contains(target) || endTarget === target))); - if (isDeltaPositive && ((noOverscroll && availableScroll === 0) || (!noOverscroll && delta > availableScroll))) { - shouldCancelScroll = true; - } - else if (!isDeltaPositive && - ((noOverscroll && availableScrollTop === 0) || (!noOverscroll && -delta > availableScrollTop))) { - shouldCancelScroll = true; - } - return shouldCancelScroll; -}; - -;// CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/SideEffect.js - - - - - - -var getTouchXY = function (event) { - return 'changedTouches' in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0]; -}; -var getDeltaXY = function (event) { return [event.deltaX, event.deltaY]; }; -var extractRef = function (ref) { - return ref && 'current' in ref ? ref.current : ref; -}; -var deltaCompare = function (x, y) { return x[0] === y[0] && x[1] === y[1]; }; -var generateStyle = function (id) { return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n"); }; -var SideEffect_idCounter = 0; -var lockStack = []; -function RemoveScrollSideCar(props) { - var shouldPreventQueue = external_React_.useRef([]); - var touchStartRef = external_React_.useRef([0, 0]); - var activeAxis = external_React_.useRef(); - var id = external_React_.useState(SideEffect_idCounter++)[0]; - var Style = external_React_.useState(function () { return styleSingleton(); })[0]; - var lastProps = external_React_.useRef(props); - external_React_.useEffect(function () { - lastProps.current = props; - }, [props]); - external_React_.useEffect(function () { - if (props.inert) { - document.body.classList.add("block-interactivity-".concat(id)); - var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean); - allow_1.forEach(function (el) { return el.classList.add("allow-interactivity-".concat(id)); }); - return function () { - document.body.classList.remove("block-interactivity-".concat(id)); - allow_1.forEach(function (el) { return el.classList.remove("allow-interactivity-".concat(id)); }); - }; - } +var useMenuItemCheckbox = createHook( + (_a) => { + var _b = _a, { + store, + name, + value, + checked, + defaultChecked: defaultCheckedProp, + hideOnClick = false + } = _b, props = __objRest(_b, [ + "store", + "name", + "value", + "checked", + "defaultChecked", + "hideOnClick" + ]); + const context = useMenuScopedContext(); + store = store || context; + invariant( + store, + false && 0 + ); + const defaultChecked = useInitialValue(defaultCheckedProp); + (0,external_React_.useEffect)(() => { + store == null ? void 0 : store.setValue(name, (prevValue = []) => { + if (!defaultChecked) + return prevValue; + return getValue(prevValue, value, true); + }); + }, [store, name, value, defaultChecked]); + (0,external_React_.useEffect)(() => { + if (checked === void 0) return; - }, [props.inert, props.lockRef.current, props.shards]); - var shouldCancelEvent = external_React_.useCallback(function (event, parent) { - if ('touches' in event && event.touches.length === 2) { - return !lastProps.current.allowPinchZoom; - } - var touch = getTouchXY(event); - var touchStart = touchStartRef.current; - var deltaX = 'deltaX' in event ? event.deltaX : touchStart[0] - touch[0]; - var deltaY = 'deltaY' in event ? event.deltaY : touchStart[1] - touch[1]; - var currentAxis; - var target = event.target; - var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'h' : 'v'; - // allow horizontal touch move on Range inputs. They will not cause any scroll - if ('touches' in event && moveDirection === 'h' && target.type === 'range') { - return false; - } - var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target); - if (!canBeScrolledInMainDirection) { - return true; - } - if (canBeScrolledInMainDirection) { - currentAxis = moveDirection; - } - else { - currentAxis = moveDirection === 'v' ? 'h' : 'v'; - canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target); - // other axis might be not scrollable - } - if (!canBeScrolledInMainDirection) { - return false; - } - if (!activeAxis.current && 'changedTouches' in event && (deltaX || deltaY)) { - activeAxis.current = currentAxis; - } - if (!currentAxis) { - return true; - } - var cancelingAxis = activeAxis.current || currentAxis; - return handleScroll(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY, true); - }, []); - var shouldPrevent = external_React_.useCallback(function (_event) { - var event = _event; - if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) { - // not the last active - return; - } - var delta = 'deltaY' in event ? getDeltaXY(event) : getTouchXY(event); - var sourceEvent = shouldPreventQueue.current.filter(function (e) { return e.name === event.type && e.target === event.target && deltaCompare(e.delta, delta); })[0]; - // self event, and should be canceled - if (sourceEvent && sourceEvent.should) { - if (event.cancelable) { - event.preventDefault(); - } - return; - } - // outside or shard event - if (!sourceEvent) { - var shardNodes = (lastProps.current.shards || []) - .map(extractRef) - .filter(Boolean) - .filter(function (node) { return node.contains(event.target); }); - var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation; - if (shouldStop) { - if (event.cancelable) { - event.preventDefault(); - } - } - } - }, []); - var shouldCancel = external_React_.useCallback(function (name, delta, target, should) { - var event = { name: name, delta: delta, target: target, should: should }; - shouldPreventQueue.current.push(event); - setTimeout(function () { - shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e) { return e !== event; }); - }, 1); - }, []); - var scrollTouchStart = external_React_.useCallback(function (event) { - touchStartRef.current = getTouchXY(event); - activeAxis.current = undefined; - }, []); - var scrollWheel = external_React_.useCallback(function (event) { - shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current)); - }, []); - var scrollTouchMove = external_React_.useCallback(function (event) { - shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current)); - }, []); - external_React_.useEffect(function () { - lockStack.push(Style); - props.setCallbacks({ - onScrollCapture: scrollWheel, - onWheelCapture: scrollWheel, - onTouchMoveCapture: scrollTouchMove, + store == null ? void 0 : store.setValue(name, (prevValue) => { + return getValue(prevValue, value, checked); + }); + }, [store, name, value, checked]); + const checkboxStore = useCheckboxStore({ + value: store.useState((state) => state.values[name]), + setValue(internalValue) { + store == null ? void 0 : store.setValue(name, () => { + if (checked === void 0) + return internalValue; + const nextValue = getValue(internalValue, value, checked); + if (!Array.isArray(nextValue)) + return nextValue; + if (!Array.isArray(internalValue)) + return nextValue; + if (shallowEqual(internalValue, nextValue)) + return internalValue; + return nextValue; }); - document.addEventListener('wheel', shouldPrevent, nonPassive); - document.addEventListener('touchmove', shouldPrevent, nonPassive); - document.addEventListener('touchstart', scrollTouchStart, nonPassive); - return function () { - lockStack = lockStack.filter(function (inst) { return inst !== Style; }); - document.removeEventListener('wheel', shouldPrevent, nonPassive); - document.removeEventListener('touchmove', shouldPrevent, nonPassive); - document.removeEventListener('touchstart', scrollTouchStart, nonPassive); - }; - }, []); - var removeScrollBar = props.removeScrollBar, inert = props.inert; - return (external_React_.createElement(external_React_.Fragment, null, - inert ? external_React_.createElement(Style, { styles: generateStyle(id) }) : null, - removeScrollBar ? external_React_.createElement(RemoveScrollBar, { gapMode: "margin" }) : null)); -} - -;// CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/sidecar.js - - - -/* harmony default export */ var sidecar = (exportSidecar(effectCar, RemoveScrollSideCar)); - -;// CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/Combination.js - - - - -var ReactRemoveScroll = external_React_.forwardRef(function (props, ref) { return (external_React_.createElement(RemoveScroll, __assign({}, props, { ref: ref, sideCar: sidecar }))); }); -ReactRemoveScroll.classNames = RemoveScroll.classNames; -/* harmony default export */ var Combination = (ReactRemoveScroll); - -;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-menu/dist/index.module.js - - - - + } + }); + props = _4R3V3JGP_spreadValues({ + role: "menuitemcheckbox" + }, props); + props = useCheckbox(_4R3V3JGP_spreadValues({ + store: checkboxStore, + name, + value, + checked + }, props)); + props = useMenuItem(_4R3V3JGP_spreadValues({ store, hideOnClick }, props)); + return props; + } +); +var MenuItemCheckbox = createMemoComponent( + (props) => { + const htmlProps = useMenuItemCheckbox(props); + return _3ORBWXWF_createElement("div", htmlProps); + } +); +if (false) {} +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/menu/menu-item-radio.js +"use client"; @@ -79546,11 +72436,91 @@ ReactRemoveScroll.classNames = RemoveScroll.classNames; +// src/menu/menu-item-radio.tsx +function menu_item_radio_getValue(prevValue, value, checked) { + if (checked === void 0) + return prevValue; + if (checked) + return value; + return prevValue; +} +var useMenuItemRadio = createHook( + (_a) => { + var _b = _a, { + store, + name, + value, + checked, + onChange: onChangeProp, + hideOnClick = false + } = _b, props = __objRest(_b, [ + "store", + "name", + "value", + "checked", + "onChange", + "hideOnClick" + ]); + const context = useMenuScopedContext(); + store = store || context; + invariant( + store, + false && 0 + ); + const defaultChecked = useInitialValue(props.defaultChecked); + (0,external_React_.useEffect)(() => { + store == null ? void 0 : store.setValue(name, (prevValue = false) => { + return menu_item_radio_getValue(prevValue, value, defaultChecked); + }); + }, [store, name, value, defaultChecked]); + (0,external_React_.useEffect)(() => { + if (checked === void 0) + return; + store == null ? void 0 : store.setValue(name, (prevValue) => { + return menu_item_radio_getValue(prevValue, value, checked); + }); + }, [store, name, value, checked]); + const isChecked = store.useState((state) => state.values[name] === value); + props = useWrapElement( + props, + (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(MenuItemCheckedContext.Provider, { value: !!isChecked, children: element }), + [isChecked] + ); + props = _4R3V3JGP_spreadValues({ + role: "menuitemradio" + }, props); + props = useRadio(_4R3V3JGP_spreadValues({ + name, + value, + checked: isChecked, + onChange: (event) => { + onChangeProp == null ? void 0 : onChangeProp(event); + if (event.defaultPrevented) + return; + const element = event.currentTarget; + store == null ? void 0 : store.setValue(name, (prevValue) => { + return menu_item_radio_getValue(prevValue, value, checked != null ? checked : element.checked); + }); + } + }, props)); + props = useMenuItem(_4R3V3JGP_spreadValues({ store, hideOnClick }, props)); + return props; + } +); +var MenuItemRadio = createMemoComponent( + (props) => { + const htmlProps = useMenuItemRadio(props); + return _3ORBWXWF_createElement("div", htmlProps); + } +); +if (false) {} +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/menu/menu-group.js +"use client"; @@ -79559,959 +72529,55 @@ ReactRemoveScroll.classNames = RemoveScroll.classNames; -const $6cc32821e9371a1c$var$SELECTION_KEYS = [ - 'Enter', - ' ' -]; -const $6cc32821e9371a1c$var$FIRST_KEYS = [ - 'ArrowDown', - 'PageUp', - 'Home' -]; -const $6cc32821e9371a1c$var$LAST_KEYS = [ - 'ArrowUp', - 'PageDown', - 'End' -]; -const $6cc32821e9371a1c$var$FIRST_LAST_KEYS = [ - ...$6cc32821e9371a1c$var$FIRST_KEYS, - ...$6cc32821e9371a1c$var$LAST_KEYS -]; -const $6cc32821e9371a1c$var$SUB_OPEN_KEYS = { - ltr: [ - ...$6cc32821e9371a1c$var$SELECTION_KEYS, - 'ArrowRight' - ], - rtl: [ - ...$6cc32821e9371a1c$var$SELECTION_KEYS, - 'ArrowLeft' - ] -}; -const $6cc32821e9371a1c$var$SUB_CLOSE_KEYS = { - ltr: [ - 'ArrowLeft' - ], - rtl: [ - 'ArrowRight' - ] -}; -/* ------------------------------------------------------------------------------------------------- - * Menu - * -----------------------------------------------------------------------------------------------*/ const $6cc32821e9371a1c$var$MENU_NAME = 'Menu'; -const [$6cc32821e9371a1c$var$Collection, $6cc32821e9371a1c$var$useCollection, $6cc32821e9371a1c$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($6cc32821e9371a1c$var$MENU_NAME); -const [$6cc32821e9371a1c$var$createMenuContext, $6cc32821e9371a1c$export$4027731b685e72eb] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($6cc32821e9371a1c$var$MENU_NAME, [ - $6cc32821e9371a1c$var$createCollectionScope, - $cf1ac5d9fe0e8206$export$722aac194ae923, - $d7bdfb9eb0fdf311$export$c7109489551a4f4 -]); -const $6cc32821e9371a1c$var$usePopperScope = $cf1ac5d9fe0e8206$export$722aac194ae923(); -const $6cc32821e9371a1c$var$useRovingFocusGroupScope = $d7bdfb9eb0fdf311$export$c7109489551a4f4(); -const [$6cc32821e9371a1c$var$MenuProvider, $6cc32821e9371a1c$var$useMenuContext] = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$MENU_NAME); -const [$6cc32821e9371a1c$var$MenuRootProvider, $6cc32821e9371a1c$var$useMenuRootContext] = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$MENU_NAME); -const $6cc32821e9371a1c$export$d9b273488cd8ce6f = (props)=>{ - const { __scopeMenu: __scopeMenu , open: open = false , children: children , dir: dir , onOpenChange: onOpenChange , modal: modal = true } = props; - const popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu); - const [content, setContent] = (0,external_React_.useState)(null); - const isUsingKeyboardRef = (0,external_React_.useRef)(false); - const handleOpenChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onOpenChange); - const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir); - (0,external_React_.useEffect)(()=>{ - // Capture phase ensures we set the boolean before any side effects execute - // in response to the key or pointer event as they might depend on this value. - const handleKeyDown = ()=>{ - isUsingKeyboardRef.current = true; - document.addEventListener('pointerdown', handlePointer, { - capture: true, - once: true - }); - document.addEventListener('pointermove', handlePointer, { - capture: true, - once: true - }); - }; - const handlePointer = ()=>isUsingKeyboardRef.current = false - ; - document.addEventListener('keydown', handleKeyDown, { - capture: true - }); - return ()=>{ - document.removeEventListener('keydown', handleKeyDown, { - capture: true - }); - document.removeEventListener('pointerdown', handlePointer, { - capture: true - }); - document.removeEventListener('pointermove', handlePointer, { - capture: true - }); - }; - }, []); - return /*#__PURE__*/ (0,external_React_.createElement)($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9, popperScope, /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$var$MenuProvider, { - scope: __scopeMenu, - open: open, - onOpenChange: handleOpenChange, - content: content, - onContentChange: setContent - }, /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$var$MenuRootProvider, { - scope: __scopeMenu, - onClose: (0,external_React_.useCallback)(()=>handleOpenChange(false) - , [ - handleOpenChange - ]), - isUsingKeyboardRef: isUsingKeyboardRef, - dir: direction, - modal: modal - }, children))); -}; -/*#__PURE__*/ Object.assign($6cc32821e9371a1c$export$d9b273488cd8ce6f, { - displayName: $6cc32821e9371a1c$var$MENU_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * MenuAnchor - * -----------------------------------------------------------------------------------------------*/ const $6cc32821e9371a1c$var$ANCHOR_NAME = 'MenuAnchor'; -const $6cc32821e9371a1c$export$9fa5ebd18bee4d43 = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { __scopeMenu: __scopeMenu , ...anchorProps } = props; - const popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu); - return /*#__PURE__*/ (0,external_React_.createElement)($cf1ac5d9fe0e8206$export$b688253958b8dfe7, extends_extends({}, popperScope, anchorProps, { - ref: forwardedRef - })); -}); -/*#__PURE__*/ Object.assign($6cc32821e9371a1c$export$9fa5ebd18bee4d43, { - displayName: $6cc32821e9371a1c$var$ANCHOR_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * MenuPortal - * -----------------------------------------------------------------------------------------------*/ const $6cc32821e9371a1c$var$PORTAL_NAME = 'MenuPortal'; -const [$6cc32821e9371a1c$var$PortalProvider, $6cc32821e9371a1c$var$usePortalContext] = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$PORTAL_NAME, { - forceMount: undefined -}); -const $6cc32821e9371a1c$export$793392f970497feb = (props)=>{ - const { __scopeMenu: __scopeMenu , forceMount: forceMount , children: children , container: container } = props; - const context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$PORTAL_NAME, __scopeMenu); - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$var$PortalProvider, { - scope: __scopeMenu, - forceMount: forceMount - }, /*#__PURE__*/ (0,external_React_.createElement)($921a889cee6df7e8$export$99c2b779aa4e8b8b, { - present: forceMount || context.open - }, /*#__PURE__*/ (0,external_React_.createElement)($f1701beae083dbae$export$602eac185826482c, { - asChild: true, - container: container - }, children))); -}; -/*#__PURE__*/ Object.assign($6cc32821e9371a1c$export$793392f970497feb, { - displayName: $6cc32821e9371a1c$var$PORTAL_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * MenuContent - * -----------------------------------------------------------------------------------------------*/ const $6cc32821e9371a1c$var$CONTENT_NAME = 'MenuContent'; -const [$6cc32821e9371a1c$var$MenuContentProvider, $6cc32821e9371a1c$var$useMenuContentContext] = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$CONTENT_NAME); -const $6cc32821e9371a1c$export$479f0f2f71193efe = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const portalContext = $6cc32821e9371a1c$var$usePortalContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu); - const { forceMount: forceMount = portalContext.forceMount , ...contentProps } = props; - const context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu); - const rootContext = $6cc32821e9371a1c$var$useMenuRootContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu); - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$var$Collection.Provider, { - scope: props.__scopeMenu - }, /*#__PURE__*/ (0,external_React_.createElement)($921a889cee6df7e8$export$99c2b779aa4e8b8b, { - present: forceMount || context.open - }, /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$var$Collection.Slot, { - scope: props.__scopeMenu - }, rootContext.modal ? /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$var$MenuRootContentModal, extends_extends({}, contentProps, { - ref: forwardedRef - })) : /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$var$MenuRootContentNonModal, extends_extends({}, contentProps, { - ref: forwardedRef - }))))); -}); -/* ---------------------------------------------------------------------------------------------- */ const $6cc32821e9371a1c$var$MenuRootContentModal = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu); - const ref = (0,external_React_.useRef)(null); - const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref); // Hide everything from ARIA except the `MenuContent` - (0,external_React_.useEffect)(()=>{ - const content = ref.current; - if (content) return hideOthers(content); - }, []); - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$var$MenuContentImpl, extends_extends({}, props, { - ref: composedRefs // we make sure we're not trapping once it's been closed - , - trapFocus: context.open // make sure to only disable pointer events when open - , - disableOutsidePointerEvents: context.open, - disableOutsideScroll: true // When focus is trapped, a `focusout` event may still happen. - , - onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusOutside, (event)=>event.preventDefault() - , { - checkForDefaultPrevented: false - }), - onDismiss: ()=>context.onOpenChange(false) - })); -}); -const $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu); - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$var$MenuContentImpl, extends_extends({}, props, { - ref: forwardedRef, - trapFocus: false, - disableOutsidePointerEvents: false, - disableOutsideScroll: false, - onDismiss: ()=>context.onOpenChange(false) - })); -}); -/* ---------------------------------------------------------------------------------------------- */ const $6cc32821e9371a1c$var$MenuContentImpl = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { __scopeMenu: __scopeMenu , loop: loop = false , trapFocus: trapFocus , onOpenAutoFocus: onOpenAutoFocus , onCloseAutoFocus: onCloseAutoFocus , disableOutsidePointerEvents: disableOutsidePointerEvents , onEntryFocus: onEntryFocus , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , disableOutsideScroll: disableOutsideScroll , ...contentProps } = props; - const context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$CONTENT_NAME, __scopeMenu); - const rootContext = $6cc32821e9371a1c$var$useMenuRootContext($6cc32821e9371a1c$var$CONTENT_NAME, __scopeMenu); - const popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu); - const rovingFocusGroupScope = $6cc32821e9371a1c$var$useRovingFocusGroupScope(__scopeMenu); - const getItems = $6cc32821e9371a1c$var$useCollection(__scopeMenu); - const [currentItemId, setCurrentItemId] = (0,external_React_.useState)(null); - const contentRef = (0,external_React_.useRef)(null); - const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentRef, context.onContentChange); - const timerRef = (0,external_React_.useRef)(0); - const searchRef = (0,external_React_.useRef)(''); - const pointerGraceTimerRef = (0,external_React_.useRef)(0); - const pointerGraceIntentRef = (0,external_React_.useRef)(null); - const pointerDirRef = (0,external_React_.useRef)('right'); - const lastPointerXRef = (0,external_React_.useRef)(0); - const ScrollLockWrapper = disableOutsideScroll ? Combination : external_React_.Fragment; - const scrollLockWrapperProps = disableOutsideScroll ? { - as: $5e63c961fc1ce211$export$8c6ed5c666ac1360, - allowPinchZoom: true - } : undefined; - const handleTypeaheadSearch = (key)=>{ - var _items$find, _items$find2; - const search = searchRef.current + key; - const items = getItems().filter((item)=>!item.disabled - ); - const currentItem = document.activeElement; - const currentMatch = (_items$find = items.find((item)=>item.ref.current === currentItem - )) === null || _items$find === void 0 ? void 0 : _items$find.textValue; - const values = items.map((item)=>item.textValue - ); - const nextMatch = $6cc32821e9371a1c$var$getNextMatch(values, search, currentMatch); - const newItem = (_items$find2 = items.find((item)=>item.textValue === nextMatch - )) === null || _items$find2 === void 0 ? void 0 : _items$find2.ref.current; // Reset `searchRef` 1 second after it was last updated - (function updateSearch(value) { - searchRef.current = value; - window.clearTimeout(timerRef.current); - if (value !== '') timerRef.current = window.setTimeout(()=>updateSearch('') - , 1000); - })(search); - if (newItem) /** - * Imperative focus during keydown is risky so we prevent React's batching updates - * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332 - */ setTimeout(()=>newItem.focus() - ); - }; - (0,external_React_.useEffect)(()=>{ - return ()=>window.clearTimeout(timerRef.current) - ; - }, []); // Make sure the whole tree has focus guards as our `MenuContent` may be - // the last element in the DOM (beacuse of the `Portal`) - $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c(); - const isPointerMovingToSubmenu = (0,external_React_.useCallback)((event)=>{ - var _pointerGraceIntentRe, _pointerGraceIntentRe2; - const isMovingTowards = pointerDirRef.current === ((_pointerGraceIntentRe = pointerGraceIntentRef.current) === null || _pointerGraceIntentRe === void 0 ? void 0 : _pointerGraceIntentRe.side); - return isMovingTowards && $6cc32821e9371a1c$var$isPointerInGraceArea(event, (_pointerGraceIntentRe2 = pointerGraceIntentRef.current) === null || _pointerGraceIntentRe2 === void 0 ? void 0 : _pointerGraceIntentRe2.area); - }, []); - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$var$MenuContentProvider, { - scope: __scopeMenu, - searchRef: searchRef, - onItemEnter: (0,external_React_.useCallback)((event)=>{ - if (isPointerMovingToSubmenu(event)) event.preventDefault(); - }, [ - isPointerMovingToSubmenu - ]), - onItemLeave: (0,external_React_.useCallback)((event)=>{ - var _contentRef$current; - if (isPointerMovingToSubmenu(event)) return; - (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 || _contentRef$current.focus(); - setCurrentItemId(null); - }, [ - isPointerMovingToSubmenu - ]), - onTriggerLeave: (0,external_React_.useCallback)((event)=>{ - if (isPointerMovingToSubmenu(event)) event.preventDefault(); - }, [ - isPointerMovingToSubmenu - ]), - pointerGraceTimerRef: pointerGraceTimerRef, - onPointerGraceIntentChange: (0,external_React_.useCallback)((intent)=>{ - pointerGraceIntentRef.current = intent; - }, []) - }, /*#__PURE__*/ (0,external_React_.createElement)(ScrollLockWrapper, scrollLockWrapperProps, /*#__PURE__*/ (0,external_React_.createElement)($d3863c46a17e8a28$export$20e40289641fbbb6, { - asChild: true, - trapped: trapFocus, - onMountAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(onOpenAutoFocus, (event)=>{ - var _contentRef$current2; - // when opening, explicitly focus the content area only and leave - // `onEntryFocus` in control of focusing first item - event.preventDefault(); - (_contentRef$current2 = contentRef.current) === null || _contentRef$current2 === void 0 || _contentRef$current2.focus(); - }), - onUnmountAutoFocus: onCloseAutoFocus - }, /*#__PURE__*/ (0,external_React_.createElement)($5cb92bef7577960e$export$177fb62ff3ec1f22, { - asChild: true, - disableOutsidePointerEvents: disableOutsidePointerEvents, - onEscapeKeyDown: onEscapeKeyDown, - onPointerDownOutside: onPointerDownOutside, - onFocusOutside: onFocusOutside, - onInteractOutside: onInteractOutside, - onDismiss: onDismiss - }, /*#__PURE__*/ (0,external_React_.createElement)($d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9, extends_extends({ - asChild: true - }, rovingFocusGroupScope, { - dir: rootContext.dir, - orientation: "vertical", - loop: loop, - currentTabStopId: currentItemId, - onCurrentTabStopIdChange: setCurrentItemId, - onEntryFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(onEntryFocus, (event)=>{ - // only focus first item when using keyboard - if (!rootContext.isUsingKeyboardRef.current) event.preventDefault(); - }) - }), /*#__PURE__*/ (0,external_React_.createElement)($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2, extends_extends({ - role: "menu", - "aria-orientation": "vertical", - "data-state": $6cc32821e9371a1c$var$getOpenState(context.open), - "data-radix-menu-content": "", - dir: rootContext.dir - }, popperScope, contentProps, { - ref: composedRefs, - style: { - outline: 'none', - ...contentProps.style - }, - onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(contentProps.onKeyDown, (event)=>{ - // submenu key events bubble through portals. We only care about keys in this menu. - const target = event.target; - const isKeyDownInside = target.closest('[data-radix-menu-content]') === event.currentTarget; - const isModifierKey = event.ctrlKey || event.altKey || event.metaKey; - const isCharacterKey = event.key.length === 1; - if (isKeyDownInside) { - // menus should not be navigated using tab key so we prevent it - if (event.key === 'Tab') event.preventDefault(); - if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key); - } // focus first/last item based on key pressed - const content = contentRef.current; - if (event.target !== content) return; - if (!$6cc32821e9371a1c$var$FIRST_LAST_KEYS.includes(event.key)) return; - event.preventDefault(); - const items = getItems().filter((item)=>!item.disabled - ); - const candidateNodes = items.map((item)=>item.ref.current - ); - if ($6cc32821e9371a1c$var$LAST_KEYS.includes(event.key)) candidateNodes.reverse(); - $6cc32821e9371a1c$var$focusFirst(candidateNodes); - }), - onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlur, (event)=>{ - // clear search buffer when leaving the menu - if (!event.currentTarget.contains(event.target)) { - window.clearTimeout(timerRef.current); - searchRef.current = ''; - } - }), - onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerMove, $6cc32821e9371a1c$var$whenMouse((event)=>{ - const target = event.target; - const pointerXHasChanged = lastPointerXRef.current !== event.clientX; // We don't use `event.movementX` for this check because Safari will - // always return `0` on a pointer event. - if (event.currentTarget.contains(target) && pointerXHasChanged) { - const newDir = event.clientX > lastPointerXRef.current ? 'right' : 'left'; - pointerDirRef.current = newDir; - lastPointerXRef.current = event.clientX; - } - })) - }))))))); -}); -/*#__PURE__*/ Object.assign($6cc32821e9371a1c$export$479f0f2f71193efe, { - displayName: $6cc32821e9371a1c$var$CONTENT_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * MenuGroup - * -----------------------------------------------------------------------------------------------*/ const $6cc32821e9371a1c$var$GROUP_NAME = 'MenuGroup'; -const $6cc32821e9371a1c$export$22a631d1f72787bb = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { __scopeMenu: __scopeMenu , ...groupProps } = props; - return /*#__PURE__*/ (0,external_React_.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, extends_extends({ - role: "group" - }, groupProps, { - ref: forwardedRef - })); -}); -/*#__PURE__*/ Object.assign($6cc32821e9371a1c$export$22a631d1f72787bb, { - displayName: $6cc32821e9371a1c$var$GROUP_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * MenuLabel - * -----------------------------------------------------------------------------------------------*/ const $6cc32821e9371a1c$var$LABEL_NAME = 'MenuLabel'; -const $6cc32821e9371a1c$export$dd37bec0e8a99143 = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { __scopeMenu: __scopeMenu , ...labelProps } = props; - return /*#__PURE__*/ (0,external_React_.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, extends_extends({}, labelProps, { - ref: forwardedRef - })); -}); -/*#__PURE__*/ Object.assign($6cc32821e9371a1c$export$dd37bec0e8a99143, { - displayName: $6cc32821e9371a1c$var$LABEL_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * MenuItem - * -----------------------------------------------------------------------------------------------*/ const $6cc32821e9371a1c$var$ITEM_NAME = 'MenuItem'; -const $6cc32821e9371a1c$var$ITEM_SELECT = 'menu.itemSelect'; -const $6cc32821e9371a1c$export$2ce376c2cc3355c8 = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { disabled: disabled = false , onSelect: onSelect , ...itemProps } = props; - const ref = (0,external_React_.useRef)(null); - const rootContext = $6cc32821e9371a1c$var$useMenuRootContext($6cc32821e9371a1c$var$ITEM_NAME, props.__scopeMenu); - const contentContext = $6cc32821e9371a1c$var$useMenuContentContext($6cc32821e9371a1c$var$ITEM_NAME, props.__scopeMenu); - const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref); - const isPointerDownRef = (0,external_React_.useRef)(false); - const handleSelect = ()=>{ - const menuItem = ref.current; - if (!disabled && menuItem) { - const itemSelectEvent = new CustomEvent($6cc32821e9371a1c$var$ITEM_SELECT, { - bubbles: true, - cancelable: true - }); - menuItem.addEventListener($6cc32821e9371a1c$var$ITEM_SELECT, (event)=>onSelect === null || onSelect === void 0 ? void 0 : onSelect(event) - , { - once: true - }); - $8927f6f2acc4f386$export$6d1a0317bde7de7f(menuItem, itemSelectEvent); - if (itemSelectEvent.defaultPrevented) isPointerDownRef.current = false; - else rootContext.onClose(); - } - }; - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$var$MenuItemImpl, extends_extends({}, itemProps, { - ref: composedRefs, - disabled: disabled, - onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, handleSelect), - onPointerDown: (event)=>{ - var _props$onPointerDown; - (_props$onPointerDown = props.onPointerDown) === null || _props$onPointerDown === void 0 || _props$onPointerDown.call(props, event); - isPointerDownRef.current = true; - }, - onPointerUp: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerUp, (event)=>{ - var _event$currentTarget; - // Pointer down can move to a different menu item which should activate it on pointer up. - // We dispatch a click for selection to allow composition with click based triggers and to - // prevent Firefox from getting stuck in text selection mode when the menu closes. - if (!isPointerDownRef.current) (_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 || _event$currentTarget.click(); - }), - onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{ - const isTypingAhead = contentContext.searchRef.current !== ''; - if (disabled || isTypingAhead && event.key === ' ') return; - if ($6cc32821e9371a1c$var$SELECTION_KEYS.includes(event.key)) { - event.currentTarget.click(); - /** - * We prevent default browser behaviour for selection keys as they should trigger - * a selection only: - * - prevents space from scrolling the page. - * - if keydown causes focus to move, prevents keydown from firing on the new target. - */ event.preventDefault(); - } - }) - })); -}); -/*#__PURE__*/ Object.assign($6cc32821e9371a1c$export$2ce376c2cc3355c8, { - displayName: $6cc32821e9371a1c$var$ITEM_NAME -}); -/* ---------------------------------------------------------------------------------------------- */ const $6cc32821e9371a1c$var$MenuItemImpl = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { __scopeMenu: __scopeMenu , disabled: disabled = false , textValue: textValue , ...itemProps } = props; - const contentContext = $6cc32821e9371a1c$var$useMenuContentContext($6cc32821e9371a1c$var$ITEM_NAME, __scopeMenu); - const rovingFocusGroupScope = $6cc32821e9371a1c$var$useRovingFocusGroupScope(__scopeMenu); - const ref = (0,external_React_.useRef)(null); - const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref); - const [isFocused, setIsFocused] = (0,external_React_.useState)(false); // get the item's `.textContent` as default strategy for typeahead `textValue` - const [textContent, setTextContent] = (0,external_React_.useState)(''); - (0,external_React_.useEffect)(()=>{ - const menuItem = ref.current; - if (menuItem) { - var _menuItem$textContent; - setTextContent(((_menuItem$textContent = menuItem.textContent) !== null && _menuItem$textContent !== void 0 ? _menuItem$textContent : '').trim()); - } - }, [ - itemProps.children - ]); - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$var$Collection.ItemSlot, { - scope: __scopeMenu, - disabled: disabled, - textValue: textValue !== null && textValue !== void 0 ? textValue : textContent - }, /*#__PURE__*/ (0,external_React_.createElement)($d7bdfb9eb0fdf311$export$6d08773d2e66f8f2, extends_extends({ - asChild: true - }, rovingFocusGroupScope, { - focusable: !disabled - }), /*#__PURE__*/ (0,external_React_.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, extends_extends({ - role: "menuitem", - "data-highlighted": isFocused ? '' : undefined, - "aria-disabled": disabled || undefined, - "data-disabled": disabled ? '' : undefined - }, itemProps, { - ref: composedRefs, - onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerMove, $6cc32821e9371a1c$var$whenMouse((event)=>{ - if (disabled) contentContext.onItemLeave(event); - else { - contentContext.onItemEnter(event); - if (!event.defaultPrevented) { - const item = event.currentTarget; - item.focus(); - } - } - })), - onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerLeave, $6cc32821e9371a1c$var$whenMouse((event)=>contentContext.onItemLeave(event) - )), - onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, ()=>setIsFocused(true) - ), - onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlur, ()=>setIsFocused(false) - ) - })))); -}); -/* ------------------------------------------------------------------------------------------------- - * MenuCheckboxItem - * -----------------------------------------------------------------------------------------------*/ const $6cc32821e9371a1c$var$CHECKBOX_ITEM_NAME = 'MenuCheckboxItem'; -const $6cc32821e9371a1c$export$f6f243521332502d = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { checked: checked = false , onCheckedChange: onCheckedChange , ...checkboxItemProps } = props; - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$var$ItemIndicatorProvider, { - scope: props.__scopeMenu, - checked: checked - }, /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$export$2ce376c2cc3355c8, extends_extends({ - role: "menuitemcheckbox", - "aria-checked": $6cc32821e9371a1c$var$isIndeterminate(checked) ? 'mixed' : checked - }, checkboxItemProps, { - ref: forwardedRef, - "data-state": $6cc32821e9371a1c$var$getCheckedState(checked), - onSelect: $e42e1063c40fb3ef$export$b9ecd428b558ff10(checkboxItemProps.onSelect, ()=>onCheckedChange === null || onCheckedChange === void 0 ? void 0 : onCheckedChange($6cc32821e9371a1c$var$isIndeterminate(checked) ? true : !checked) - , { - checkForDefaultPrevented: false - }) - }))); -}); -/*#__PURE__*/ Object.assign($6cc32821e9371a1c$export$f6f243521332502d, { - displayName: $6cc32821e9371a1c$var$CHECKBOX_ITEM_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * MenuRadioGroup - * -----------------------------------------------------------------------------------------------*/ const $6cc32821e9371a1c$var$RADIO_GROUP_NAME = 'MenuRadioGroup'; -const [$6cc32821e9371a1c$var$RadioGroupProvider, $6cc32821e9371a1c$var$useRadioGroupContext] = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$RADIO_GROUP_NAME, { - value: undefined, - onValueChange: ()=>{} -}); -const $6cc32821e9371a1c$export$ea2200c9eee416b3 = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { value: value , onValueChange: onValueChange , ...groupProps } = props; - const handleValueChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onValueChange); - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$var$RadioGroupProvider, { - scope: props.__scopeMenu, - value: value, - onValueChange: handleValueChange - }, /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$export$22a631d1f72787bb, extends_extends({}, groupProps, { - ref: forwardedRef - }))); -}); -/*#__PURE__*/ Object.assign($6cc32821e9371a1c$export$ea2200c9eee416b3, { - displayName: $6cc32821e9371a1c$var$RADIO_GROUP_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * MenuRadioItem - * -----------------------------------------------------------------------------------------------*/ const $6cc32821e9371a1c$var$RADIO_ITEM_NAME = 'MenuRadioItem'; -const $6cc32821e9371a1c$export$69bd225e9817f6d0 = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { value: value , ...radioItemProps } = props; - const context = $6cc32821e9371a1c$var$useRadioGroupContext($6cc32821e9371a1c$var$RADIO_ITEM_NAME, props.__scopeMenu); - const checked = value === context.value; - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$var$ItemIndicatorProvider, { - scope: props.__scopeMenu, - checked: checked - }, /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$export$2ce376c2cc3355c8, extends_extends({ - role: "menuitemradio", - "aria-checked": checked - }, radioItemProps, { - ref: forwardedRef, - "data-state": $6cc32821e9371a1c$var$getCheckedState(checked), - onSelect: $e42e1063c40fb3ef$export$b9ecd428b558ff10(radioItemProps.onSelect, ()=>{ - var _context$onValueChang; - return (_context$onValueChang = context.onValueChange) === null || _context$onValueChang === void 0 ? void 0 : _context$onValueChang.call(context, value); - }, { - checkForDefaultPrevented: false - }) - }))); -}); -/*#__PURE__*/ Object.assign($6cc32821e9371a1c$export$69bd225e9817f6d0, { - displayName: $6cc32821e9371a1c$var$RADIO_ITEM_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * MenuItemIndicator - * -----------------------------------------------------------------------------------------------*/ const $6cc32821e9371a1c$var$ITEM_INDICATOR_NAME = 'MenuItemIndicator'; -const [$6cc32821e9371a1c$var$ItemIndicatorProvider, $6cc32821e9371a1c$var$useItemIndicatorContext] = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$ITEM_INDICATOR_NAME, { - checked: false -}); -const $6cc32821e9371a1c$export$a2593e23056970a3 = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { __scopeMenu: __scopeMenu , forceMount: forceMount , ...itemIndicatorProps } = props; - const indicatorContext = $6cc32821e9371a1c$var$useItemIndicatorContext($6cc32821e9371a1c$var$ITEM_INDICATOR_NAME, __scopeMenu); - return /*#__PURE__*/ (0,external_React_.createElement)($921a889cee6df7e8$export$99c2b779aa4e8b8b, { - present: forceMount || $6cc32821e9371a1c$var$isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true - }, /*#__PURE__*/ (0,external_React_.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.span, extends_extends({}, itemIndicatorProps, { - ref: forwardedRef, - "data-state": $6cc32821e9371a1c$var$getCheckedState(indicatorContext.checked) - }))); -}); -/*#__PURE__*/ Object.assign($6cc32821e9371a1c$export$a2593e23056970a3, { - displayName: $6cc32821e9371a1c$var$ITEM_INDICATOR_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * MenuSeparator - * -----------------------------------------------------------------------------------------------*/ const $6cc32821e9371a1c$var$SEPARATOR_NAME = 'MenuSeparator'; -const $6cc32821e9371a1c$export$1cec7dcdd713e220 = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { __scopeMenu: __scopeMenu , ...separatorProps } = props; - return /*#__PURE__*/ (0,external_React_.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, extends_extends({ - role: "separator", - "aria-orientation": "horizontal" - }, separatorProps, { - ref: forwardedRef - })); -}); -/*#__PURE__*/ Object.assign($6cc32821e9371a1c$export$1cec7dcdd713e220, { - displayName: $6cc32821e9371a1c$var$SEPARATOR_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * MenuArrow - * -----------------------------------------------------------------------------------------------*/ const $6cc32821e9371a1c$var$ARROW_NAME = 'MenuArrow'; -const $6cc32821e9371a1c$export$bcdda4773debf5fa = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { __scopeMenu: __scopeMenu , ...arrowProps } = props; - const popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu); - return /*#__PURE__*/ (0,external_React_.createElement)($cf1ac5d9fe0e8206$export$21b07c8f274aebd5, extends_extends({}, popperScope, arrowProps, { - ref: forwardedRef - })); -}); -/*#__PURE__*/ Object.assign($6cc32821e9371a1c$export$bcdda4773debf5fa, { - displayName: $6cc32821e9371a1c$var$ARROW_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * MenuSub - * -----------------------------------------------------------------------------------------------*/ const $6cc32821e9371a1c$var$SUB_NAME = 'MenuSub'; -const [$6cc32821e9371a1c$var$MenuSubProvider, $6cc32821e9371a1c$var$useMenuSubContext] = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$SUB_NAME); -const $6cc32821e9371a1c$export$71bdb9d1e2909932 = (props)=>{ - const { __scopeMenu: __scopeMenu , children: children , open: open = false , onOpenChange: onOpenChange } = props; - const parentMenuContext = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$SUB_NAME, __scopeMenu); - const popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu); - const [trigger, setTrigger] = (0,external_React_.useState)(null); - const [content, setContent] = (0,external_React_.useState)(null); - const handleOpenChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onOpenChange); // Prevent the parent menu from reopening with open submenus. - (0,external_React_.useEffect)(()=>{ - if (parentMenuContext.open === false) handleOpenChange(false); - return ()=>handleOpenChange(false) - ; - }, [ - parentMenuContext.open, - handleOpenChange - ]); - return /*#__PURE__*/ (0,external_React_.createElement)($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9, popperScope, /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$var$MenuProvider, { - scope: __scopeMenu, - open: open, - onOpenChange: handleOpenChange, - content: content, - onContentChange: setContent - }, /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$var$MenuSubProvider, { - scope: __scopeMenu, - contentId: $1746a345f3d73bb7$export$f680877a34711e37(), - triggerId: $1746a345f3d73bb7$export$f680877a34711e37(), - trigger: trigger, - onTriggerChange: setTrigger - }, children))); -}; -/*#__PURE__*/ Object.assign($6cc32821e9371a1c$export$71bdb9d1e2909932, { - displayName: $6cc32821e9371a1c$var$SUB_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * MenuSubTrigger - * -----------------------------------------------------------------------------------------------*/ const $6cc32821e9371a1c$var$SUB_TRIGGER_NAME = 'MenuSubTrigger'; -const $6cc32821e9371a1c$export$5fbbb3ba7297405f = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$SUB_TRIGGER_NAME, props.__scopeMenu); - const rootContext = $6cc32821e9371a1c$var$useMenuRootContext($6cc32821e9371a1c$var$SUB_TRIGGER_NAME, props.__scopeMenu); - const subContext = $6cc32821e9371a1c$var$useMenuSubContext($6cc32821e9371a1c$var$SUB_TRIGGER_NAME, props.__scopeMenu); - const contentContext = $6cc32821e9371a1c$var$useMenuContentContext($6cc32821e9371a1c$var$SUB_TRIGGER_NAME, props.__scopeMenu); - const openTimerRef = (0,external_React_.useRef)(null); - const { pointerGraceTimerRef: pointerGraceTimerRef , onPointerGraceIntentChange: onPointerGraceIntentChange } = contentContext; - const scope = { - __scopeMenu: props.__scopeMenu - }; - const clearOpenTimer = (0,external_React_.useCallback)(()=>{ - if (openTimerRef.current) window.clearTimeout(openTimerRef.current); - openTimerRef.current = null; - }, []); - (0,external_React_.useEffect)(()=>clearOpenTimer - , [ - clearOpenTimer - ]); - (0,external_React_.useEffect)(()=>{ - const pointerGraceTimer = pointerGraceTimerRef.current; - return ()=>{ - window.clearTimeout(pointerGraceTimer); - onPointerGraceIntentChange(null); - }; - }, [ - pointerGraceTimerRef, - onPointerGraceIntentChange - ]); - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$export$9fa5ebd18bee4d43, extends_extends({ - asChild: true - }, scope), /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$var$MenuItemImpl, extends_extends({ - id: subContext.triggerId, - "aria-haspopup": "menu", - "aria-expanded": context.open, - "aria-controls": subContext.contentId, - "data-state": $6cc32821e9371a1c$var$getOpenState(context.open) - }, props, { - ref: $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, subContext.onTriggerChange) // This is redundant for mouse users but we cannot determine pointer type from - , - onClick: (event)=>{ - var _props$onClick; - (_props$onClick = props.onClick) === null || _props$onClick === void 0 || _props$onClick.call(props, event); - if (props.disabled || event.defaultPrevented) return; - /** - * We manually focus because iOS Safari doesn't always focus on click (e.g. buttons) - * and we rely heavily on `onFocusOutside` for submenus to close when switching - * between separate submenus. - */ event.currentTarget.focus(); - if (!context.open) context.onOpenChange(true); - }, - onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerMove, $6cc32821e9371a1c$var$whenMouse((event)=>{ - contentContext.onItemEnter(event); - if (event.defaultPrevented) return; - if (!props.disabled && !context.open && !openTimerRef.current) { - contentContext.onPointerGraceIntentChange(null); - openTimerRef.current = window.setTimeout(()=>{ - context.onOpenChange(true); - clearOpenTimer(); - }, 100); - } - })), - onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerLeave, $6cc32821e9371a1c$var$whenMouse((event)=>{ - var _context$content; - clearOpenTimer(); - const contentRect = (_context$content = context.content) === null || _context$content === void 0 ? void 0 : _context$content.getBoundingClientRect(); - if (contentRect) { - var _context$content2; - // TODO: make sure to update this when we change positioning logic - const side = (_context$content2 = context.content) === null || _context$content2 === void 0 ? void 0 : _context$content2.dataset.side; - const rightSide = side === 'right'; - const bleed = rightSide ? -5 : 5; - const contentNearEdge = contentRect[rightSide ? 'left' : 'right']; - const contentFarEdge = contentRect[rightSide ? 'right' : 'left']; - contentContext.onPointerGraceIntentChange({ - area: [ - // consistently within polygon bounds - { - x: event.clientX + bleed, - y: event.clientY - }, - { - x: contentNearEdge, - y: contentRect.top - }, - { - x: contentFarEdge, - y: contentRect.top - }, - { - x: contentFarEdge, - y: contentRect.bottom - }, - { - x: contentNearEdge, - y: contentRect.bottom - } - ], - side: side - }); - window.clearTimeout(pointerGraceTimerRef.current); - pointerGraceTimerRef.current = window.setTimeout(()=>contentContext.onPointerGraceIntentChange(null) - , 300); - } else { - contentContext.onTriggerLeave(event); - if (event.defaultPrevented) return; // There's 100ms where the user may leave an item before the submenu was opened. - contentContext.onPointerGraceIntentChange(null); - } - })), - onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{ - const isTypingAhead = contentContext.searchRef.current !== ''; - if (props.disabled || isTypingAhead && event.key === ' ') return; - if ($6cc32821e9371a1c$var$SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) { - var _context$content3; - context.onOpenChange(true); // The trigger may hold focus if opened via pointer interaction - // so we ensure content is given focus again when switching to keyboard. - (_context$content3 = context.content) === null || _context$content3 === void 0 || _context$content3.focus(); // prevent window from scrolling - event.preventDefault(); - } - }) - }))); -}); -/*#__PURE__*/ Object.assign($6cc32821e9371a1c$export$5fbbb3ba7297405f, { - displayName: $6cc32821e9371a1c$var$SUB_TRIGGER_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * MenuSubContent - * -----------------------------------------------------------------------------------------------*/ const $6cc32821e9371a1c$var$SUB_CONTENT_NAME = 'MenuSubContent'; -const $6cc32821e9371a1c$export$e7142ab31822bde6 = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const portalContext = $6cc32821e9371a1c$var$usePortalContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu); - const { forceMount: forceMount = portalContext.forceMount , ...subContentProps } = props; - const context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu); - const rootContext = $6cc32821e9371a1c$var$useMenuRootContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu); - const subContext = $6cc32821e9371a1c$var$useMenuSubContext($6cc32821e9371a1c$var$SUB_CONTENT_NAME, props.__scopeMenu); - const ref = (0,external_React_.useRef)(null); - const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref); - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$var$Collection.Provider, { - scope: props.__scopeMenu - }, /*#__PURE__*/ (0,external_React_.createElement)($921a889cee6df7e8$export$99c2b779aa4e8b8b, { - present: forceMount || context.open - }, /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$var$Collection.Slot, { - scope: props.__scopeMenu - }, /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$var$MenuContentImpl, extends_extends({ - id: subContext.contentId, - "aria-labelledby": subContext.triggerId - }, subContentProps, { - ref: composedRefs, - align: "start", - side: rootContext.dir === 'rtl' ? 'left' : 'right', - disableOutsidePointerEvents: false, - disableOutsideScroll: false, - trapFocus: false, - onOpenAutoFocus: (event)=>{ - var _ref$current; - // when opening a submenu, focus content for keyboard users only - if (rootContext.isUsingKeyboardRef.current) (_ref$current = ref.current) === null || _ref$current === void 0 || _ref$current.focus(); - event.preventDefault(); - } // The menu might close because of focusing another menu item in the parent menu. We - , - onCloseAutoFocus: (event)=>event.preventDefault() - , - onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusOutside, (event)=>{ - // We prevent closing when the trigger is focused to avoid triggering a re-open animation - // on pointer interaction. - if (event.target !== subContext.trigger) context.onOpenChange(false); - }), - onEscapeKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onEscapeKeyDown, (event)=>{ - rootContext.onClose(); // ensure pressing escape in submenu doesn't escape full screen mode - event.preventDefault(); - }), - onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{ - // Submenu key events bubble through portals. We only care about keys in this menu. - const isKeyDownInside = event.currentTarget.contains(event.target); - const isCloseKey = $6cc32821e9371a1c$var$SUB_CLOSE_KEYS[rootContext.dir].includes(event.key); - if (isKeyDownInside && isCloseKey) { - var _subContext$trigger; - context.onOpenChange(false); // We focus manually because we prevented it in `onCloseAutoFocus` - (_subContext$trigger = subContext.trigger) === null || _subContext$trigger === void 0 || _subContext$trigger.focus(); // prevent window from scrolling - event.preventDefault(); - } - }) - }))))); +// src/menu/menu-group.ts +var useMenuGroup = createHook((props) => { + props = useCompositeGroup(props); + return props; }); -/*#__PURE__*/ Object.assign($6cc32821e9371a1c$export$e7142ab31822bde6, { - displayName: $6cc32821e9371a1c$var$SUB_CONTENT_NAME +var menu_group_MenuGroup = createComponent((props) => { + const htmlProps = useMenuGroup(props); + return _3ORBWXWF_createElement("div", htmlProps); }); -/* -----------------------------------------------------------------------------------------------*/ function $6cc32821e9371a1c$var$getOpenState(open) { - return open ? 'open' : 'closed'; -} -function $6cc32821e9371a1c$var$isIndeterminate(checked) { - return checked === 'indeterminate'; -} -function $6cc32821e9371a1c$var$getCheckedState(checked) { - return $6cc32821e9371a1c$var$isIndeterminate(checked) ? 'indeterminate' : checked ? 'checked' : 'unchecked'; -} -function $6cc32821e9371a1c$var$focusFirst(candidates) { - const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement; - for (const candidate of candidates){ - // if focus is already where we want to go, we don't want to keep going through the candidates - if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return; - candidate.focus(); - if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return; - } -} -/** - * Wraps an array around itself at a given start index - * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']` - */ function $6cc32821e9371a1c$var$wrapArray(array, startIndex) { - return array.map((_, index)=>array[(startIndex + index) % array.length] - ); -} -/** - * This is the "meat" of the typeahead matching logic. It takes in all the values, - * the search and the current match, and returns the next match (or `undefined`). - * - * We normalize the search because if a user has repeatedly pressed a character, - * we want the exact same behavior as if we only had that one character - * (ie. cycle through options starting with that character) - * - * We also reorder the values by wrapping the array around the current match. - * This is so we always look forward from the current match, and picking the first - * match will always be the correct one. - * - * Finally, if the normalized search is exactly one character, we exclude the - * current match from the values because otherwise it would be the first to match always - * and focus would never move. This is as opposed to the regular case, where we - * don't want focus to move if the current match still matches. - */ function $6cc32821e9371a1c$var$getNextMatch(values, search, currentMatch) { - const isRepeated = search.length > 1 && Array.from(search).every((char)=>char === search[0] - ); - const normalizedSearch = isRepeated ? search[0] : search; - const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1; - let wrappedValues = $6cc32821e9371a1c$var$wrapArray(values, Math.max(currentMatchIndex, 0)); - const excludeCurrentMatch = normalizedSearch.length === 1; - if (excludeCurrentMatch) wrappedValues = wrappedValues.filter((v)=>v !== currentMatch - ); - const nextMatch = wrappedValues.find((value)=>value.toLowerCase().startsWith(normalizedSearch.toLowerCase()) - ); - return nextMatch !== currentMatch ? nextMatch : undefined; -} -// Determine if a point is inside of a polygon. -// Based on https://github.com/substack/point-in-polygon -function $6cc32821e9371a1c$var$isPointInPolygon(point, polygon) { - const { x: x , y: y } = point; - let inside = false; - for(let i = 0, j = polygon.length - 1; i < polygon.length; j = i++){ - const xi = polygon[i].x; - const yi = polygon[i].y; - const xj = polygon[j].x; - const yj = polygon[j].y; // prettier-ignore - const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi; - if (intersect) inside = !inside; - } - return inside; -} -function $6cc32821e9371a1c$var$isPointerInGraceArea(event, area) { - if (!area) return false; - const cursorPos = { - x: event.clientX, - y: event.clientY - }; - return $6cc32821e9371a1c$var$isPointInPolygon(cursorPos, area); -} -function $6cc32821e9371a1c$var$whenMouse(handler) { - return (event)=>event.pointerType === 'mouse' ? handler(event) : undefined - ; -} -const $6cc32821e9371a1c$export$be92b6f5f03c0fe9 = $6cc32821e9371a1c$export$d9b273488cd8ce6f; -const $6cc32821e9371a1c$export$b688253958b8dfe7 = $6cc32821e9371a1c$export$9fa5ebd18bee4d43; -const $6cc32821e9371a1c$export$602eac185826482c = $6cc32821e9371a1c$export$793392f970497feb; -const $6cc32821e9371a1c$export$7c6e2c02157bb7d2 = $6cc32821e9371a1c$export$479f0f2f71193efe; -const $6cc32821e9371a1c$export$eb2fcfdbd7ba97d4 = $6cc32821e9371a1c$export$22a631d1f72787bb; -const $6cc32821e9371a1c$export$b04be29aa201d4f5 = $6cc32821e9371a1c$export$dd37bec0e8a99143; -const $6cc32821e9371a1c$export$6d08773d2e66f8f2 = $6cc32821e9371a1c$export$2ce376c2cc3355c8; -const $6cc32821e9371a1c$export$16ce288f89fa631c = $6cc32821e9371a1c$export$f6f243521332502d; -const $6cc32821e9371a1c$export$a98f0dcb43a68a25 = $6cc32821e9371a1c$export$ea2200c9eee416b3; -const $6cc32821e9371a1c$export$371ab307eab489c0 = $6cc32821e9371a1c$export$69bd225e9817f6d0; -const $6cc32821e9371a1c$export$c3468e2714d175fa = $6cc32821e9371a1c$export$a2593e23056970a3; -const $6cc32821e9371a1c$export$1ff3c3f08ae963c0 = $6cc32821e9371a1c$export$1cec7dcdd713e220; -const $6cc32821e9371a1c$export$21b07c8f274aebd5 = $6cc32821e9371a1c$export$bcdda4773debf5fa; -const $6cc32821e9371a1c$export$d7a01e11500dfb6f = $6cc32821e9371a1c$export$71bdb9d1e2909932; -const $6cc32821e9371a1c$export$2ea8a7a591ac5eac = $6cc32821e9371a1c$export$5fbbb3ba7297405f; -const $6cc32821e9371a1c$export$6d4de93b380beddf = $6cc32821e9371a1c$export$e7142ab31822bde6; +if (false) {} +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/ENRQQ6LK.js +"use client"; -;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-dropdown-menu/dist/index.module.js +// src/composite/composite-separator.ts +var useCompositeSeparator = createHook( + (_a) => { + var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); + const context = useCompositeContext(); + store = store || context; + invariant( + store, + false && 0 + ); + const orientation = store.useState( + (state) => state.orientation === "horizontal" ? "vertical" : "horizontal" + ); + props = useSeparator(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { orientation })); + return props; + } +); +var CompositeSeparator = createComponent( + (props) => { + const htmlProps = useCompositeSeparator(props); + return _3ORBWXWF_createElement("hr", htmlProps); + } +); +if (false) {} +;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/menu/menu-separator.js +"use client"; @@ -80527,344 +72593,22 @@ const $6cc32821e9371a1c$export$6d4de93b380beddf = $6cc32821e9371a1c$export$e7142 -/* ------------------------------------------------------------------------------------------------- - * DropdownMenu - * -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$DROPDOWN_MENU_NAME = 'DropdownMenu'; -const [$d08ef79370b62062$var$createDropdownMenuContext, $d08ef79370b62062$export$c0623cd925aeb687] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($d08ef79370b62062$var$DROPDOWN_MENU_NAME, [ - $6cc32821e9371a1c$export$4027731b685e72eb -]); -const $d08ef79370b62062$var$useMenuScope = $6cc32821e9371a1c$export$4027731b685e72eb(); -const [$d08ef79370b62062$var$DropdownMenuProvider, $d08ef79370b62062$var$useDropdownMenuContext] = $d08ef79370b62062$var$createDropdownMenuContext($d08ef79370b62062$var$DROPDOWN_MENU_NAME); -const $d08ef79370b62062$export$e44a253a59704894 = (props)=>{ - const { __scopeDropdownMenu: __scopeDropdownMenu , children: children , dir: dir , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , modal: modal = true } = props; - const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu); - const triggerRef = (0,external_React_.useRef)(null); - const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({ - prop: openProp, - defaultProp: defaultOpen, - onChange: onOpenChange - }); - return /*#__PURE__*/ (0,external_React_.createElement)($d08ef79370b62062$var$DropdownMenuProvider, { - scope: __scopeDropdownMenu, - triggerId: $1746a345f3d73bb7$export$f680877a34711e37(), - triggerRef: triggerRef, - contentId: $1746a345f3d73bb7$export$f680877a34711e37(), - open: open, - onOpenChange: setOpen, - onOpenToggle: (0,external_React_.useCallback)(()=>setOpen((prevOpen)=>!prevOpen - ) - , [ - setOpen - ]), - modal: modal - }, /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$export$be92b6f5f03c0fe9, extends_extends({}, menuScope, { - open: open, - onOpenChange: setOpen, - dir: dir, - modal: modal - }), children)); -}; -/*#__PURE__*/ Object.assign($d08ef79370b62062$export$e44a253a59704894, { - displayName: $d08ef79370b62062$var$DROPDOWN_MENU_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * DropdownMenuTrigger - * -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$TRIGGER_NAME = 'DropdownMenuTrigger'; -const $d08ef79370b62062$export$d2469213b3befba9 = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { __scopeDropdownMenu: __scopeDropdownMenu , disabled: disabled = false , ...triggerProps } = props; - const context = $d08ef79370b62062$var$useDropdownMenuContext($d08ef79370b62062$var$TRIGGER_NAME, __scopeDropdownMenu); - const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu); - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$export$b688253958b8dfe7, extends_extends({ - asChild: true - }, menuScope), /*#__PURE__*/ (0,external_React_.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.button, extends_extends({ - type: "button", - id: context.triggerId, - "aria-haspopup": "menu", - "aria-expanded": context.open, - "aria-controls": context.open ? context.contentId : undefined, - "data-state": context.open ? 'open' : 'closed', - "data-disabled": disabled ? '' : undefined, - disabled: disabled - }, triggerProps, { - ref: $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, context.triggerRef), - onPointerDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDown, (event)=>{ - // only call handler if it's the left button (mousedown gets triggered by all mouse buttons) - // but not when the control key is pressed (avoiding MacOS right click) - if (!disabled && event.button === 0 && event.ctrlKey === false) { - context.onOpenToggle(); // prevent trigger focusing when opening - // this allows the content to be given focus without competition - if (!context.open) event.preventDefault(); - } - }), - onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{ - if (disabled) return; - if ([ - 'Enter', - ' ' - ].includes(event.key)) context.onOpenToggle(); - if (event.key === 'ArrowDown') context.onOpenChange(true); // prevent keydown from scrolling window / first focused item to execute - // that keydown (inadvertently closing the menu) - if ([ - 'Enter', - ' ', - 'ArrowDown' - ].includes(event.key)) event.preventDefault(); - }) - }))); -}); -/*#__PURE__*/ Object.assign($d08ef79370b62062$export$d2469213b3befba9, { - displayName: $d08ef79370b62062$var$TRIGGER_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * DropdownMenuPortal - * -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$PORTAL_NAME = 'DropdownMenuPortal'; -const $d08ef79370b62062$export$cd369b4d4d54efc9 = (props)=>{ - const { __scopeDropdownMenu: __scopeDropdownMenu , ...portalProps } = props; - const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu); - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$export$602eac185826482c, extends_extends({}, menuScope, portalProps)); -}; -/*#__PURE__*/ Object.assign($d08ef79370b62062$export$cd369b4d4d54efc9, { - displayName: $d08ef79370b62062$var$PORTAL_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * DropdownMenuContent - * -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$CONTENT_NAME = 'DropdownMenuContent'; -const $d08ef79370b62062$export$6e76d93a37c01248 = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { __scopeDropdownMenu: __scopeDropdownMenu , ...contentProps } = props; - const context = $d08ef79370b62062$var$useDropdownMenuContext($d08ef79370b62062$var$CONTENT_NAME, __scopeDropdownMenu); - const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu); - const hasInteractedOutsideRef = (0,external_React_.useRef)(false); - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$export$7c6e2c02157bb7d2, extends_extends({ - id: context.contentId, - "aria-labelledby": context.triggerId - }, menuScope, contentProps, { - ref: forwardedRef, - onCloseAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onCloseAutoFocus, (event)=>{ - var _context$triggerRef$c; - if (!hasInteractedOutsideRef.current) (_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus(); - hasInteractedOutsideRef.current = false; // Always prevent auto focus because we either focus manually or want user agent focus - event.preventDefault(); - }), - onInteractOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onInteractOutside, (event)=>{ - const originalEvent = event.detail.originalEvent; - const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true; - const isRightClick = originalEvent.button === 2 || ctrlLeftClick; - if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true; - }), - style: { - ...props.style, - '--radix-dropdown-menu-content-transform-origin': 'var(--radix-popper-transform-origin)', - '--radix-dropdown-menu-content-available-width': 'var(--radix-popper-available-width)', - '--radix-dropdown-menu-content-available-height': 'var(--radix-popper-available-height)', - '--radix-dropdown-menu-trigger-width': 'var(--radix-popper-anchor-width)', - '--radix-dropdown-menu-trigger-height': 'var(--radix-popper-anchor-height)' - } - })); -}); -/*#__PURE__*/ Object.assign($d08ef79370b62062$export$6e76d93a37c01248, { - displayName: $d08ef79370b62062$var$CONTENT_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * DropdownMenuGroup - * -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$GROUP_NAME = 'DropdownMenuGroup'; -const $d08ef79370b62062$export$246bebaba3a2f70e = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { __scopeDropdownMenu: __scopeDropdownMenu , ...groupProps } = props; - const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu); - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$export$eb2fcfdbd7ba97d4, extends_extends({}, menuScope, groupProps, { - ref: forwardedRef - })); -}); -/*#__PURE__*/ Object.assign($d08ef79370b62062$export$246bebaba3a2f70e, { - displayName: $d08ef79370b62062$var$GROUP_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * DropdownMenuLabel - * -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$LABEL_NAME = 'DropdownMenuLabel'; -const $d08ef79370b62062$export$76e48c5b57f24495 = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { __scopeDropdownMenu: __scopeDropdownMenu , ...labelProps } = props; - const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu); - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$export$b04be29aa201d4f5, extends_extends({}, menuScope, labelProps, { - ref: forwardedRef - })); -}); -/*#__PURE__*/ Object.assign($d08ef79370b62062$export$76e48c5b57f24495, { - displayName: $d08ef79370b62062$var$LABEL_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * DropdownMenuItem - * -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$ITEM_NAME = 'DropdownMenuItem'; -const $d08ef79370b62062$export$ed97964d1871885d = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { __scopeDropdownMenu: __scopeDropdownMenu , ...itemProps } = props; - const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu); - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$export$6d08773d2e66f8f2, extends_extends({}, menuScope, itemProps, { - ref: forwardedRef - })); -}); -/*#__PURE__*/ Object.assign($d08ef79370b62062$export$ed97964d1871885d, { - displayName: $d08ef79370b62062$var$ITEM_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * DropdownMenuCheckboxItem - * -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$CHECKBOX_ITEM_NAME = 'DropdownMenuCheckboxItem'; -const $d08ef79370b62062$export$53a69729da201fa9 = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { __scopeDropdownMenu: __scopeDropdownMenu , ...checkboxItemProps } = props; - const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu); - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$export$16ce288f89fa631c, extends_extends({}, menuScope, checkboxItemProps, { - ref: forwardedRef - })); -}); -/*#__PURE__*/ Object.assign($d08ef79370b62062$export$53a69729da201fa9, { - displayName: $d08ef79370b62062$var$CHECKBOX_ITEM_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * DropdownMenuRadioGroup - * -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$RADIO_GROUP_NAME = 'DropdownMenuRadioGroup'; -const $d08ef79370b62062$export$3323ad73d55f587e = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { __scopeDropdownMenu: __scopeDropdownMenu , ...radioGroupProps } = props; - const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu); - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$export$a98f0dcb43a68a25, extends_extends({}, menuScope, radioGroupProps, { - ref: forwardedRef - })); -}); -/*#__PURE__*/ Object.assign($d08ef79370b62062$export$3323ad73d55f587e, { - displayName: $d08ef79370b62062$var$RADIO_GROUP_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * DropdownMenuRadioItem - * -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$RADIO_ITEM_NAME = 'DropdownMenuRadioItem'; -const $d08ef79370b62062$export$e4f69b41b1637536 = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { __scopeDropdownMenu: __scopeDropdownMenu , ...radioItemProps } = props; - const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu); - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$export$371ab307eab489c0, extends_extends({}, menuScope, radioItemProps, { - ref: forwardedRef - })); -}); -/*#__PURE__*/ Object.assign($d08ef79370b62062$export$e4f69b41b1637536, { - displayName: $d08ef79370b62062$var$RADIO_ITEM_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * DropdownMenuItemIndicator - * -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$INDICATOR_NAME = 'DropdownMenuItemIndicator'; -const $d08ef79370b62062$export$42355ae145153fb6 = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { __scopeDropdownMenu: __scopeDropdownMenu , ...itemIndicatorProps } = props; - const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu); - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$export$c3468e2714d175fa, extends_extends({}, menuScope, itemIndicatorProps, { - ref: forwardedRef - })); -}); -/*#__PURE__*/ Object.assign($d08ef79370b62062$export$42355ae145153fb6, { - displayName: $d08ef79370b62062$var$INDICATOR_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * DropdownMenuSeparator - * -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$SEPARATOR_NAME = 'DropdownMenuSeparator'; -const $d08ef79370b62062$export$da160178fd3bc7e9 = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { __scopeDropdownMenu: __scopeDropdownMenu , ...separatorProps } = props; - const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu); - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$export$1ff3c3f08ae963c0, extends_extends({}, menuScope, separatorProps, { - ref: forwardedRef - })); -}); -/*#__PURE__*/ Object.assign($d08ef79370b62062$export$da160178fd3bc7e9, { - displayName: $d08ef79370b62062$var$SEPARATOR_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * DropdownMenuArrow - * -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$ARROW_NAME = 'DropdownMenuArrow'; -const $d08ef79370b62062$export$34b8980744021ec5 = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { __scopeDropdownMenu: __scopeDropdownMenu , ...arrowProps } = props; - const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu); - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$export$21b07c8f274aebd5, extends_extends({}, menuScope, arrowProps, { - ref: forwardedRef - })); -}); -/*#__PURE__*/ Object.assign($d08ef79370b62062$export$34b8980744021ec5, { - displayName: $d08ef79370b62062$var$ARROW_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * DropdownMenuSub - * -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$export$2f307d81a64f5442 = (props)=>{ - const { __scopeDropdownMenu: __scopeDropdownMenu , children: children , open: openProp , onOpenChange: onOpenChange , defaultOpen: defaultOpen } = props; - const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu); - const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({ - prop: openProp, - defaultProp: defaultOpen, - onChange: onOpenChange - }); - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$export$d7a01e11500dfb6f, extends_extends({}, menuScope, { - open: open, - onOpenChange: setOpen - }), children); -}; -/* ------------------------------------------------------------------------------------------------- - * DropdownMenuSubTrigger - * -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$SUB_TRIGGER_NAME = 'DropdownMenuSubTrigger'; -const $d08ef79370b62062$export$21dcb7ec56f874cf = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { __scopeDropdownMenu: __scopeDropdownMenu , ...subTriggerProps } = props; - const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu); - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$export$2ea8a7a591ac5eac, extends_extends({}, menuScope, subTriggerProps, { - ref: forwardedRef - })); -}); -/*#__PURE__*/ Object.assign($d08ef79370b62062$export$21dcb7ec56f874cf, { - displayName: $d08ef79370b62062$var$SUB_TRIGGER_NAME -}); -/* ------------------------------------------------------------------------------------------------- - * DropdownMenuSubContent - * -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$var$SUB_CONTENT_NAME = 'DropdownMenuSubContent'; -const $d08ef79370b62062$export$f34ec8bc2482cc5f = /*#__PURE__*/ (0,external_React_.forwardRef)((props, forwardedRef)=>{ - const { __scopeDropdownMenu: __scopeDropdownMenu , ...subContentProps } = props; - const menuScope = $d08ef79370b62062$var$useMenuScope(__scopeDropdownMenu); - return /*#__PURE__*/ (0,external_React_.createElement)($6cc32821e9371a1c$export$6d4de93b380beddf, extends_extends({}, menuScope, subContentProps, { - ref: forwardedRef, - style: { - ...props.style, - '--radix-dropdown-menu-content-transform-origin': 'var(--radix-popper-transform-origin)', - '--radix-dropdown-menu-content-available-width': 'var(--radix-popper-available-width)', - '--radix-dropdown-menu-content-available-height': 'var(--radix-popper-available-height)', - '--radix-dropdown-menu-trigger-width': 'var(--radix-popper-anchor-width)', - '--radix-dropdown-menu-trigger-height': 'var(--radix-popper-anchor-height)' - } - })); -}); -/*#__PURE__*/ Object.assign($d08ef79370b62062$export$f34ec8bc2482cc5f, { - displayName: $d08ef79370b62062$var$SUB_CONTENT_NAME +// src/menu/menu-separator.ts +var useMenuSeparator = createHook( + (_a) => { + var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); + const context = useMenuContext(); + store = store || context; + props = useCompositeSeparator(_4R3V3JGP_spreadValues({ store }, props)); + return props; + } +); +var MenuSeparator = createComponent((props) => { + const htmlProps = useMenuSeparator(props); + return _3ORBWXWF_createElement("hr", htmlProps); }); -/* -----------------------------------------------------------------------------------------------*/ const $d08ef79370b62062$export$be92b6f5f03c0fe9 = $d08ef79370b62062$export$e44a253a59704894; -const $d08ef79370b62062$export$41fb9f06171c75f4 = $d08ef79370b62062$export$d2469213b3befba9; -const $d08ef79370b62062$export$602eac185826482c = $d08ef79370b62062$export$cd369b4d4d54efc9; -const $d08ef79370b62062$export$7c6e2c02157bb7d2 = $d08ef79370b62062$export$6e76d93a37c01248; -const $d08ef79370b62062$export$eb2fcfdbd7ba97d4 = $d08ef79370b62062$export$246bebaba3a2f70e; -const $d08ef79370b62062$export$b04be29aa201d4f5 = $d08ef79370b62062$export$76e48c5b57f24495; -const $d08ef79370b62062$export$6d08773d2e66f8f2 = $d08ef79370b62062$export$ed97964d1871885d; -const $d08ef79370b62062$export$16ce288f89fa631c = $d08ef79370b62062$export$53a69729da201fa9; -const $d08ef79370b62062$export$a98f0dcb43a68a25 = $d08ef79370b62062$export$3323ad73d55f587e; -const $d08ef79370b62062$export$371ab307eab489c0 = $d08ef79370b62062$export$e4f69b41b1637536; -const $d08ef79370b62062$export$c3468e2714d175fa = $d08ef79370b62062$export$42355ae145153fb6; -const $d08ef79370b62062$export$1ff3c3f08ae963c0 = $d08ef79370b62062$export$da160178fd3bc7e9; -const $d08ef79370b62062$export$21b07c8f274aebd5 = (/* unused pure expression or super */ null && ($d08ef79370b62062$export$34b8980744021ec5)); -const $d08ef79370b62062$export$d7a01e11500dfb6f = $d08ef79370b62062$export$2f307d81a64f5442; -const $d08ef79370b62062$export$2ea8a7a591ac5eac = $d08ef79370b62062$export$21dcb7ec56f874cf; -const $d08ef79370b62062$export$6d4de93b380beddf = $d08ef79370b62062$export$f34ec8bc2482cc5f; - - - - - - -;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right-small.js - -/** - * WordPress dependencies - */ +if (false) {} -const chevronRightSmall = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, { - d: "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z" -})); -/* harmony default export */ var chevron_right_small = (chevronRightSmall); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/dropdown-menu-v2/styles.js @@ -80872,8 +72616,7 @@ function dropdown_menu_v2_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You /** * External dependencies */ - - +// eslint-disable-next-line no-restricted-imports /** @@ -80882,21 +72625,26 @@ function dropdown_menu_v2_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You + const ANIMATION_PARAMS = { SLIDE_AMOUNT: '2px', DURATION: '400ms', EASING: 'cubic-bezier( 0.16, 1, 0.3, 1 )' }; -const CONTENT_WRAPPER_PADDING = space(2); -const ITEM_PREFIX_WIDTH = space(7); -const ITEM_PADDING_INLINE_START = space(2); -const ITEM_PADDING_INLINE_END = space(2.5); - -// TODO: should bring this into the config, and make themeable -const DEFAULT_BORDER_COLOR = COLORS.ui.borderDisabled; +const CONTENT_WRAPPER_PADDING = space(1); +const ITEM_PADDING_BLOCK = space(2); +const ITEM_PADDING_INLINE = space(3); + +// TODO: +// - those values are different from saved variables? +// - should bring this into the config, and make themeable +// - border color and divider color are different? +const DEFAULT_BORDER_COLOR = COLORS.gray[300]; +const DIVIDER_COLOR = COLORS.gray[200]; const TOOLBAR_VARIANT_BORDER_COLOR = COLORS.gray['900']; const DEFAULT_BOX_SHADOW = `0 0 0 ${config_values.borderWidth} ${DEFAULT_BORDER_COLOR}, ${config_values.popoverShadow}`; const TOOLBAR_VARIANT_BOX_SHADOW = `0 0 0 ${config_values.borderWidth} ${TOOLBAR_VARIANT_BORDER_COLOR}`; +const GRID_TEMPLATE_COLS = 'minmax( 0, max-content ) 1fr'; const slideUpAndFade = emotion_react_browser_esm_keyframes({ '0%': { opacity: 0, @@ -80937,59 +72685,60 @@ const slideLeftAndFade = emotion_react_browser_esm_keyframes({ transform: 'translateX(0)' } }); -const baseContent = variant => /*#__PURE__*/emotion_react_browser_esm_css("min-width:220px;background-color:", COLORS.ui.background, ";border-radius:", config_values.radiusBlockUi, ";padding:", CONTENT_WRAPPER_PADDING, ";box-shadow:", variant === 'toolbar' ? TOOLBAR_VARIANT_BOX_SHADOW : DEFAULT_BOX_SHADOW, ";animation-duration:", ANIMATION_PARAMS.DURATION, ";animation-timing-function:", ANIMATION_PARAMS.EASING, ";will-change:transform,opacity;&[data-side='top']{animation-name:", slideDownAndFade, ";}&[data-side='right']{animation-name:", slideLeftAndFade, ";}&[data-side='bottom']{animation-name:", slideUpAndFade, ";}&[data-side='left']{animation-name:", slideRightAndFade, ";}@media ( prefers-reduced-motion ){animation-duration:0s;}" + ( true ? "" : 0), true ? "" : 0); -const itemPrefix = /*#__PURE__*/emotion_react_browser_esm_css("width:", ITEM_PREFIX_WIDTH, ";display:inline-flex;align-items:center;justify-content:center;margin-inline-start:calc( -1 * ", ITEM_PADDING_INLINE_START, " );margin-top:", space(-2), ";margin-bottom:", space(-2), ";" + ( true ? "" : 0), true ? "" : 0); -const itemSuffix = /*#__PURE__*/emotion_react_browser_esm_css("width:max-content;display:inline-flex;align-items:center;justify-content:center;margin-inline-start:auto;padding-inline-start:", space(6), ";margin-top:", space(-2), ";margin-bottom:", space(-2), ";opacity:0.6;[data-highlighted]>&,[data-state='open']>&,[data-disabled]>&{opacity:1;}" + ( true ? "" : 0), true ? "" : 0); -const ItemPrefixWrapper = emotion_styled_base_browser_esm("span", true ? { +const dropdown_menu_v2_styles_DropdownMenu = /*#__PURE__*/emotion_styled_base_browser_esm(Menu, true ? { + target: "e1kdzosf12" +} : 0)("position:relative;z-index:1000000;display:grid;grid-template-columns:", GRID_TEMPLATE_COLS, ";grid-template-rows:auto;box-sizing:border-box;min-width:160px;max-width:320px;max-height:var( --popover-available-height );padding:", CONTENT_WRAPPER_PADDING, ";background-color:", COLORS.ui.background, ";border-radius:4px;", props => /*#__PURE__*/emotion_react_browser_esm_css("box-shadow:", props.variant === 'toolbar' ? TOOLBAR_VARIANT_BOX_SHADOW : DEFAULT_BOX_SHADOW, ";" + ( true ? "" : 0), true ? "" : 0), " overscroll-behavior:contain;overflow:auto;outline:2px solid transparent!important;animation-duration:", ANIMATION_PARAMS.DURATION, ";animation-timing-function:", ANIMATION_PARAMS.EASING, ";will-change:transform,opacity;animation-name:", slideDownAndFade, ";&[data-side='right']{animation-name:", slideLeftAndFade, ";}&[data-side='bottom']{animation-name:", slideUpAndFade, ";}&[data-side='left']{animation-name:", slideRightAndFade, ";}@media ( prefers-reduced-motion ){animation-duration:0s;}" + ( true ? "" : 0)); +const baseItem = /*#__PURE__*/emotion_react_browser_esm_css("all:unset;position:relative;min-height:", space(10), ";box-sizing:border-box;grid-column:1/-1;display:grid;grid-template-columns:", GRID_TEMPLATE_COLS, ";align-items:center;@supports ( grid-template-columns: subgrid ){grid-template-columns:subgrid;}font-size:", font('default.fontSize'), ";font-family:inherit;font-weight:normal;line-height:20px;color:", COLORS.gray[900], ";border-radius:", config_values.radiusBlockUi, ";padding-block:", ITEM_PADDING_BLOCK, ";padding-inline:", ITEM_PADDING_INLINE, ";scroll-margin:", CONTENT_WRAPPER_PADDING, ";user-select:none;outline:none;&[aria-disabled='true']{color:", COLORS.ui.textDisabled, ";cursor:not-allowed;}&[data-active-item]:not( [data-focus-visible] ):not(\n\t\t\t[aria-disabled='true']\n\t\t){background-color:", COLORS.theme.accent, ";color:", COLORS.white, ";}&[data-focus-visible]{box-shadow:0 0 0 1.5px ", COLORS.theme.accent, ";outline:2px solid transparent;}&:active,&[data-active]{}", dropdown_menu_v2_styles_DropdownMenu, ":not(:focus) &:not(:focus)[aria-expanded=\"true\"]{background-color:", COLORS.gray[100], ";color:", COLORS.gray[900], ";}svg{fill:currentColor;}" + ( true ? "" : 0), true ? "" : 0); +const styles_DropdownMenuItem = /*#__PURE__*/emotion_styled_base_browser_esm(Y6467XPW_MenuItem, true ? { target: "e1kdzosf11" -} : 0)(itemPrefix, ";" + ( true ? "" : 0)); -const ItemSuffixWrapper = emotion_styled_base_browser_esm("span", true ? { +} : 0)(baseItem, ";" + ( true ? "" : 0)); +const styles_DropdownMenuCheckboxItem = /*#__PURE__*/emotion_styled_base_browser_esm(MenuItemCheckbox, true ? { target: "e1kdzosf10" -} : 0)(itemSuffix, ";" + ( true ? "" : 0)); -const baseItem = /*#__PURE__*/emotion_react_browser_esm_css("all:unset;font-size:", font('default.fontSize'), ";font-family:inherit;font-weight:normal;line-height:20px;color:", COLORS.gray[900], ";border-radius:", config_values.radiusBlockUi, ";display:flex;align-items:center;padding:", space(2), " ", ITEM_PADDING_INLINE_END, " ", space(2), " ", ITEM_PADDING_INLINE_START, ";position:relative;user-select:none;outline:none;&[data-disabled]{opacity:0.5;pointer-events:none;}&[data-highlighted]{background-color:", COLORS.gray['100'], ";outline:2px solid transparent;}svg{fill:currentColor;}&:not( :has( ", ItemPrefixWrapper, " ) ){padding-inline-start:", ITEM_PREFIX_WIDTH, ";}" + ( true ? "" : 0), true ? "" : 0); -const dropdown_menu_v2_styles_Content = /*#__PURE__*/emotion_styled_base_browser_esm($d08ef79370b62062$export$7c6e2c02157bb7d2, true ? { +} : 0)(baseItem, ";" + ( true ? "" : 0)); +const styles_DropdownMenuRadioItem = /*#__PURE__*/emotion_styled_base_browser_esm(MenuItemRadio, true ? { target: "e1kdzosf9" -} : 0)(props => baseContent(props.variant), ";" + ( true ? "" : 0)); -const SubContent = /*#__PURE__*/emotion_styled_base_browser_esm($d08ef79370b62062$export$6d4de93b380beddf, true ? { +} : 0)(baseItem, ";" + ( true ? "" : 0)); +const ItemPrefixWrapper = emotion_styled_base_browser_esm("span", true ? { target: "e1kdzosf8" -} : 0)(props => baseContent(props.variant), ";" + ( true ? "" : 0)); -const styles_Item = /*#__PURE__*/emotion_styled_base_browser_esm($d08ef79370b62062$export$6d08773d2e66f8f2, true ? { +} : 0)("grid-column:1;", styles_DropdownMenuCheckboxItem, ">&,", styles_DropdownMenuRadioItem, ">&{min-width:", space(6), ";}", styles_DropdownMenuCheckboxItem, ">&,", styles_DropdownMenuRadioItem, ">&,&:not( :empty ){margin-inline-end:", space(2), ";}display:flex;align-items:center;justify-content:center;color:", COLORS.gray['700'], ";[data-active-item]:not( [data-focus-visible] )>&,[aria-disabled='true']>&{color:inherit;}" + ( true ? "" : 0)); +const DropdownMenuItemContentWrapper = emotion_styled_base_browser_esm("div", true ? { target: "e1kdzosf7" -} : 0)(baseItem, ";" + ( true ? "" : 0)); -const CheckboxItem = /*#__PURE__*/emotion_styled_base_browser_esm($d08ef79370b62062$export$16ce288f89fa631c, true ? { +} : 0)("grid-column:2;display:flex;align-items:center;justify-content:space-between;gap:", space(3), ";pointer-events:none;" + ( true ? "" : 0)); +const DropdownMenuItemChildrenWrapper = emotion_styled_base_browser_esm("div", true ? { target: "e1kdzosf6" -} : 0)(baseItem, ";" + ( true ? "" : 0)); -const RadioItem = /*#__PURE__*/emotion_styled_base_browser_esm($d08ef79370b62062$export$371ab307eab489c0, true ? { +} : 0)("flex:1;display:inline-flex;flex-direction:column;gap:", space(1), ";" + ( true ? "" : 0)); +const ItemSuffixWrapper = emotion_styled_base_browser_esm("span", true ? { target: "e1kdzosf5" -} : 0)(baseItem, ";" + ( true ? "" : 0)); -const SubTrigger = /*#__PURE__*/emotion_styled_base_browser_esm($d08ef79370b62062$export$2ea8a7a591ac5eac, true ? { +} : 0)("flex:0 1 fit-content;min-width:0;width:fit-content;display:flex;align-items:center;justify-content:center;gap:", space(3), ";color:", COLORS.gray['700'], ";[data-active-item]:not( [data-focus-visible] ) *:not(", dropdown_menu_v2_styles_DropdownMenu, ") &,[aria-disabled='true'] *:not(", dropdown_menu_v2_styles_DropdownMenu, ") &{color:inherit;}" + ( true ? "" : 0)); +const styles_DropdownMenuGroup = /*#__PURE__*/emotion_styled_base_browser_esm(menu_group_MenuGroup, true ? { target: "e1kdzosf4" -} : 0)(baseItem, " &[data-state='open']{background-color:", COLORS.gray['100'], ";}" + ( true ? "" : 0)); -const styles_Label = /*#__PURE__*/emotion_styled_base_browser_esm($d08ef79370b62062$export$b04be29aa201d4f5, true ? { - target: "e1kdzosf3" -} : 0)("box-sizing:border-box;display:flex;align-items:center;min-height:", space(8), ";padding:", space(2), " ", ITEM_PADDING_INLINE_END, " ", space(2), " ", ITEM_PREFIX_WIDTH, ";color:", COLORS.gray[700], ";font-size:11px;line-height:1.4;font-weight:500;text-transform:uppercase;" + ( true ? "" : 0)); -const styles_Separator = /*#__PURE__*/emotion_styled_base_browser_esm($d08ef79370b62062$export$1ff3c3f08ae963c0, true ? { - target: "e1kdzosf2" -} : 0)("height:", config_values.borderWidth, ";background-color:", props => props.variant === 'toolbar' ? TOOLBAR_VARIANT_BORDER_COLOR : DEFAULT_BORDER_COLOR, ";margin:", space(2), " calc( -1 * ", CONTENT_WRAPPER_PADDING, " );" + ( true ? "" : 0)); -const ItemIndicator = /*#__PURE__*/emotion_styled_base_browser_esm($d08ef79370b62062$export$c3468e2714d175fa, true ? { - target: "e1kdzosf1" } : 0)( true ? { - name: "pl708y", - styles: "display:inline-flex;align-items:center;justify-content:center" + name: "49aokf", + styles: "display:contents" } : 0); -const SubmenuRtlChevronIcon = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_icon, true ? { - target: "e1kdzosf0" -} : 0)(rtl({ - transform: `scaleX(1) translateX(${space(2)})` +const styles_DropdownMenuSeparator = /*#__PURE__*/emotion_styled_base_browser_esm(MenuSeparator, true ? { + target: "e1kdzosf3" +} : 0)("grid-column:1/-1;border:none;height:", config_values.borderWidth, ";background-color:", props => props.variant === 'toolbar' ? TOOLBAR_VARIANT_BORDER_COLOR : DIVIDER_COLOR, ";margin-block:", space(2), ";margin-inline:", ITEM_PADDING_INLINE, ";outline:2px solid transparent;" + ( true ? "" : 0)); +const SubmenuChevronIcon = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_icon, true ? { + target: "e1kdzosf2" +} : 0)("width:", space(1.5), ";", rtl({ + transform: `scaleX(1)` }, { - transform: `scaleX(-1) translateX(${space(2)})` + transform: `scaleX(-1)` }), ";" + ( true ? "" : 0)); +const styles_DropdownMenuItemLabel = /*#__PURE__*/emotion_styled_base_browser_esm(truncate_component, true ? { + target: "e1kdzosf1" +} : 0)("font-size:", font('default.fontSize'), ";line-height:20px;color:inherit;" + ( true ? "" : 0)); +const styles_DropdownMenuItemHelpText = /*#__PURE__*/emotion_styled_base_browser_esm(truncate_component, true ? { + target: "e1kdzosf0" +} : 0)("font-size:", font('helpText.fontSize'), ";line-height:16px;color:", COLORS.gray['700'], ";[data-active-item]:not( [data-focus-visible] ) *:not( ", dropdown_menu_v2_styles_DropdownMenu, " ) &,[aria-disabled='true'] *:not( ", dropdown_menu_v2_styles_DropdownMenu, " ) &{color:inherit;}" + ( true ? "" : 0)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/dropdown-menu-v2/index.js /** * External dependencies */ +// eslint-disable-next-line no-restricted-imports /** @@ -81006,178 +72755,225 @@ const SubmenuRtlChevronIcon = /*#__PURE__*/emotion_styled_base_browser_esm(build - - -// Menu content's side padding + 4px -const SUB_MENU_OFFSET_SIDE = 16; -// Opposite amount of the top padding of the menu item -const SUB_MENU_OFFSET_ALIGN = -8; -const DropdownMenuPrivateContext = (0,external_wp_element_namespaceObject.createContext)({ - variant: undefined, - portalContainer: null -}); -const dropdown_menu_v2_UnconnectedDropdownMenu = props => { - const { - // Root props - defaultOpen, - open, - onOpenChange, - modal = true, - // Content positioning props - side = 'bottom', - sideOffset = 0, - align = 'center', - alignOffset = 0, - // Render props - children, - trigger, - // From internal components context - variant - } = useContextSystem(props, 'DropdownMenu'); - - // Render the portal in the default slot used by the legacy Popover component. - const slot = useSlot(SLOT_NAME); - const portalContainer = slot.ref?.current; - const privateContextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ - variant, - portalContainer - }), [variant, portalContainer]); - return (0,external_wp_element_namespaceObject.createElement)($d08ef79370b62062$export$be92b6f5f03c0fe9, { - defaultOpen: defaultOpen, - open: open, - onOpenChange: onOpenChange, - modal: modal, - dir: (0,external_wp_i18n_namespaceObject.isRTL)() ? 'rtl' : 'ltr' - }, (0,external_wp_element_namespaceObject.createElement)($d08ef79370b62062$export$41fb9f06171c75f4, { - asChild: true - }, trigger), (0,external_wp_element_namespaceObject.createElement)($d08ef79370b62062$export$602eac185826482c, { - container: portalContainer - }, (0,external_wp_element_namespaceObject.createElement)(dropdown_menu_v2_styles_Content, { - side: side, - align: align, - sideOffset: sideOffset, - alignOffset: alignOffset, - loop: true, - variant: variant - }, (0,external_wp_element_namespaceObject.createElement)(DropdownMenuPrivateContext.Provider, { - value: privateContextValue - }, children)))); -}; - -/** - * `DropdownMenu` displays a menu to the user (such as a set of actions - * or functions) triggered by a button. - */ -const dropdown_menu_v2_DropdownMenu = contextConnectWithoutRef(dropdown_menu_v2_UnconnectedDropdownMenu, 'DropdownMenu'); -const DropdownSubMenuTrigger = ({ - prefix, - suffix = (0,external_wp_element_namespaceObject.createElement)(SubmenuRtlChevronIcon, { - icon: chevron_right_small, - size: 24 - }), - children -}) => { - return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, prefix && (0,external_wp_element_namespaceObject.createElement)(ItemPrefixWrapper, null, prefix), children, suffix && (0,external_wp_element_namespaceObject.createElement)(ItemSuffixWrapper, null, suffix)); -}; -const DropdownSubMenu = ({ - // Sub props - defaultOpen, - open, - onOpenChange, - // Sub trigger props - disabled, - textValue, - // Render props - children, - trigger -}) => { - const { - variant, - portalContainer - } = (0,external_wp_element_namespaceObject.useContext)(DropdownMenuPrivateContext); - return (0,external_wp_element_namespaceObject.createElement)($d08ef79370b62062$export$d7a01e11500dfb6f, { - defaultOpen: defaultOpen, - open: open, - onOpenChange: onOpenChange - }, (0,external_wp_element_namespaceObject.createElement)(SubTrigger, { - disabled: disabled, - textValue: textValue - }, trigger), (0,external_wp_element_namespaceObject.createElement)($d08ef79370b62062$export$602eac185826482c, { - container: portalContainer - }, (0,external_wp_element_namespaceObject.createElement)(SubContent, { - loop: true, - sideOffset: SUB_MENU_OFFSET_SIDE, - alignOffset: SUB_MENU_OFFSET_ALIGN, - variant: variant - }, children))); -}; -const DropdownMenuLabel = props => (0,external_wp_element_namespaceObject.createElement)(styles_Label, { - ...props -}); -const DropdownMenuGroup = props => (0,external_wp_element_namespaceObject.createElement)($d08ef79370b62062$export$eb2fcfdbd7ba97d4, { - ...props -}); -const DropdownMenuItem = (0,external_wp_element_namespaceObject.forwardRef)(({ - children, +const DropdownMenuContext = (0,external_wp_element_namespaceObject.createContext)(undefined); +const DropdownMenuItem = (0,external_wp_element_namespaceObject.forwardRef)(function DropdownMenuItem({ prefix, suffix, + children, + hideOnClick = true, ...props -}, forwardedRef) => { - return (0,external_wp_element_namespaceObject.createElement)(styles_Item, { +}, ref) { + const dropdownMenuContext = (0,external_wp_element_namespaceObject.useContext)(DropdownMenuContext); + return (0,external_React_.createElement)(styles_DropdownMenuItem, { + ref: ref, ...props, - ref: forwardedRef - }, prefix && (0,external_wp_element_namespaceObject.createElement)(ItemPrefixWrapper, null, prefix), children, suffix && (0,external_wp_element_namespaceObject.createElement)(ItemSuffixWrapper, null, suffix)); + accessibleWhenDisabled: true, + hideOnClick: hideOnClick, + store: dropdownMenuContext?.store + }, (0,external_React_.createElement)(ItemPrefixWrapper, null, prefix), (0,external_React_.createElement)(DropdownMenuItemContentWrapper, null, (0,external_React_.createElement)(DropdownMenuItemChildrenWrapper, null, children), suffix && (0,external_React_.createElement)(ItemSuffixWrapper, null, suffix))); }); -const DropdownMenuCheckboxItem = ({ - children, - checked = false, +const DropdownMenuCheckboxItem = (0,external_wp_element_namespaceObject.forwardRef)(function DropdownMenuCheckboxItem({ suffix, + children, + hideOnClick = false, ...props -}) => { - return (0,external_wp_element_namespaceObject.createElement)(CheckboxItem, { +}, ref) { + const dropdownMenuContext = (0,external_wp_element_namespaceObject.useContext)(DropdownMenuContext); + return (0,external_React_.createElement)(styles_DropdownMenuCheckboxItem, { + ref: ref, ...props, - checked: checked - }, (0,external_wp_element_namespaceObject.createElement)(ItemPrefixWrapper, null, (0,external_wp_element_namespaceObject.createElement)(ItemIndicator, null, (checked === 'indeterminate' || checked === true) && (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { - icon: checked === 'indeterminate' ? line_solid : library_check, + accessibleWhenDisabled: true, + hideOnClick: hideOnClick, + store: dropdownMenuContext?.store + }, (0,external_React_.createElement)(MenuItemCheck, { + store: dropdownMenuContext?.store, + render: (0,external_React_.createElement)(ItemPrefixWrapper, null) + // Override some ariakit inline styles + , + style: { + width: 'auto', + height: 'auto' + } + }, (0,external_React_.createElement)(build_module_icon, { + icon: library_check, size: 24 - }))), children, suffix && (0,external_wp_element_namespaceObject.createElement)(ItemSuffixWrapper, null, suffix)); -}; -const DropdownMenuRadioGroup = props => (0,external_wp_element_namespaceObject.createElement)($d08ef79370b62062$export$a98f0dcb43a68a25, { - ...props + })), (0,external_React_.createElement)(DropdownMenuItemContentWrapper, null, (0,external_React_.createElement)(DropdownMenuItemChildrenWrapper, null, children), suffix && (0,external_React_.createElement)(ItemSuffixWrapper, null, suffix))); }); -const radioDot = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, { - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg" -}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Circle, { +const radioCheck = (0,external_React_.createElement)(external_wp_primitives_namespaceObject.SVG, { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24" +}, (0,external_React_.createElement)(external_wp_primitives_namespaceObject.Circle, { cx: 12, cy: 12, - r: 3, - fill: "currentColor" + r: 3 })); -const DropdownMenuRadioItem = ({ - children, +const DropdownMenuRadioItem = (0,external_wp_element_namespaceObject.forwardRef)(function DropdownMenuRadioItem({ suffix, + children, + hideOnClick = false, ...props -}) => { - return (0,external_wp_element_namespaceObject.createElement)(RadioItem, { - ...props - }, (0,external_wp_element_namespaceObject.createElement)(ItemPrefixWrapper, null, (0,external_wp_element_namespaceObject.createElement)(ItemIndicator, null, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, { - icon: radioDot, - size: 22 - }))), children, suffix && (0,external_wp_element_namespaceObject.createElement)(ItemSuffixWrapper, null, suffix)); -}; -const DropdownMenuSeparator = props => { +}, ref) { + const dropdownMenuContext = (0,external_wp_element_namespaceObject.useContext)(DropdownMenuContext); + return (0,external_React_.createElement)(styles_DropdownMenuRadioItem, { + ref: ref, + ...props, + accessibleWhenDisabled: true, + hideOnClick: hideOnClick, + store: dropdownMenuContext?.store + }, (0,external_React_.createElement)(MenuItemCheck, { + store: dropdownMenuContext?.store, + render: (0,external_React_.createElement)(ItemPrefixWrapper, null) + // Override some ariakit inline styles + , + style: { + width: 'auto', + height: 'auto' + } + }, (0,external_React_.createElement)(build_module_icon, { + icon: radioCheck, + size: 24 + })), (0,external_React_.createElement)(DropdownMenuItemContentWrapper, null, (0,external_React_.createElement)(DropdownMenuItemChildrenWrapper, null, children), suffix && (0,external_React_.createElement)(ItemSuffixWrapper, null, suffix))); +}); +const DropdownMenuGroup = (0,external_wp_element_namespaceObject.forwardRef)(function DropdownMenuGroup(props, ref) { + const dropdownMenuContext = (0,external_wp_element_namespaceObject.useContext)(DropdownMenuContext); + return (0,external_React_.createElement)(styles_DropdownMenuGroup, { + ref: ref, + ...props, + store: dropdownMenuContext?.store + }); +}); +const dropdown_menu_v2_UnconnectedDropdownMenu = (props, ref) => { + var _props$placement; const { + // Store props + open, + defaultOpen = false, + onOpenChange, + placement, + // Menu trigger props + trigger, + // Menu props + gutter, + children, + shift, + modal = true, + // From internal components context + variant, + // Rest + ...otherProps + } = useContextSystem(props, 'DropdownMenu'); + const parentContext = (0,external_wp_element_namespaceObject.useContext)(DropdownMenuContext); + const computedDirection = (0,external_wp_i18n_namespaceObject.isRTL)() ? 'rtl' : 'ltr'; + + // If an explicit value for the `placement` prop is not passed, + // apply a default placement of `bottom-start` for the root dropdown, + // and of `right-start` for nested dropdowns. + let computedPlacement = (_props$placement = props.placement) !== null && _props$placement !== void 0 ? _props$placement : parentContext?.store ? 'right-start' : 'bottom-start'; + // Swap left/right in case of RTL direction + if (computedDirection === 'rtl') { + if (/right/.test(computedPlacement)) { + computedPlacement = computedPlacement.replace('right', 'left'); + } else if (/left/.test(computedPlacement)) { + computedPlacement = computedPlacement.replace('left', 'right'); + } + } + const dropdownMenuStore = useMenuStore({ + parent: parentContext?.store, + open, + defaultOpen, + placement: computedPlacement, + focusLoop: true, + setOpen(willBeOpen) { + onOpenChange?.(willBeOpen); + }, + rtl: computedDirection === 'rtl' + }); + const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ + store: dropdownMenuStore, variant - } = (0,external_wp_element_namespaceObject.useContext)(DropdownMenuPrivateContext); - return (0,external_wp_element_namespaceObject.createElement)(styles_Separator, { + }), [dropdownMenuStore, variant]); + + // Extract the side from the applied placement — useful for animations. + const appliedPlacementSide = dropdownMenuStore.useState('placement').split('-')[0]; + if (dropdownMenuStore.parent && !((0,external_wp_element_namespaceObject.isValidElement)(trigger) && DropdownMenuItem === trigger.type)) { + // eslint-disable-next-line no-console + console.warn('For nested DropdownMenus, the `trigger` should always be a `DropdownMenuItem`.'); + } + const hideOnEscape = (0,external_wp_element_namespaceObject.useCallback)(event => { + // Pressing Escape can cause unexpected consequences (ie. exiting + // full screen mode on MacOs, close parent modals...). + event.preventDefault(); + // Returning `true` causes the menu to hide. + return true; + }, []); + const wrapperProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({ + dir: computedDirection, + style: { + direction: computedDirection + } + }), [computedDirection]); + return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(MenuButton, { + ref: ref, + store: dropdownMenuStore, + render: dropdownMenuStore.parent ? (0,external_wp_element_namespaceObject.cloneElement)(trigger, { + // Add submenu arrow, unless a `suffix` is explicitly specified + suffix: (0,external_React_.createElement)(external_React_.Fragment, null, trigger.props.suffix, (0,external_React_.createElement)(SubmenuChevronIcon, { + "aria-hidden": "true", + icon: chevron_right_small, + size: 24, + preserveAspectRatio: "xMidYMid slice" + })) + }) : trigger + }), (0,external_React_.createElement)(dropdown_menu_v2_styles_DropdownMenu, { + ...otherProps, + modal: modal, + store: dropdownMenuStore + // Root menu has an 8px distance from its trigger, + // otherwise 0 (which causes the submenu to slightly overlap) + , + gutter: gutter !== null && gutter !== void 0 ? gutter : dropdownMenuStore.parent ? 0 : 8 + // Align nested menu by the same (but opposite) amount + // as the menu container's padding. + , + shift: shift !== null && shift !== void 0 ? shift : dropdownMenuStore.parent ? -4 : 0, + hideOnHoverOutside: false, + "data-side": appliedPlacementSide, + variant: variant, + wrapperProps: wrapperProps, + hideOnEscape: hideOnEscape, + unmountOnHide: true + }, (0,external_React_.createElement)(DropdownMenuContext.Provider, { + value: contextValue + }, children))); +}; +const dropdown_menu_v2_DropdownMenu = contextConnect(dropdown_menu_v2_UnconnectedDropdownMenu, 'DropdownMenu'); +const DropdownMenuSeparator = (0,external_wp_element_namespaceObject.forwardRef)(function DropdownMenuSeparator(props, ref) { + const dropdownMenuContext = (0,external_wp_element_namespaceObject.useContext)(DropdownMenuContext); + return (0,external_React_.createElement)(styles_DropdownMenuSeparator, { + ref: ref, ...props, - variant: variant + store: dropdownMenuContext?.store, + variant: dropdownMenuContext?.variant }); -}; +}); +const DropdownMenuItemLabel = (0,external_wp_element_namespaceObject.forwardRef)(function DropdownMenuItemLabel(props, ref) { + return (0,external_React_.createElement)(styles_DropdownMenuItemLabel, { + numberOfLines: 1, + ref: ref, + ...props + }); +}); +const DropdownMenuItemHelpText = (0,external_wp_element_namespaceObject.forwardRef)(function DropdownMenuItemHelpText(props, ref) { + return (0,external_React_.createElement)(styles_DropdownMenuItemHelpText, { + numberOfLines: 2, + ref: ref, + ...props + }); +}); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/theme/styles.js +function theme_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /** * External dependencies */ @@ -81196,7 +72992,10 @@ const colorVariables = ({ }; const theme_styles_Wrapper = emotion_styled_base_browser_esm("div", true ? { target: "e1krjpvb0" -} : 0)( true ? "" : 0); +} : 0)( true ? { + name: "1a3idx0", + styles: "color:var( --wp-components-color-foreground, currentColor )" +} : 0); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/theme/color-algorithms.js /** @@ -81345,14 +73144,14 @@ function Theme({ accent, background })), className), [accent, background, className, cx]); - return (0,external_wp_element_namespaceObject.createElement)(theme_styles_Wrapper, { + return (0,external_React_.createElement)(theme_styles_Wrapper, { className: classes, ...props }); } -/* harmony default export */ var theme = (Theme); +/* harmony default export */ const theme = (Theme); -;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/private-apis.js +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tabs/context.js /** * WordPress dependencies */ @@ -81362,34 +73161,408 @@ function Theme({ * Internal dependencies */ +const TabsContext = (0,external_wp_element_namespaceObject.createContext)(undefined); +const useTabsContext = () => (0,external_wp_element_namespaceObject.useContext)(TabsContext); +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tabs/styles.js +function tabs_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } +/** + * External dependencies + */ +// eslint-disable-next-line no-restricted-imports +/** + * Internal dependencies + */ + + + +const TabListWrapper = emotion_styled_base_browser_esm("div", true ? { + target: "enfox0g2" +} : 0)( true ? { + name: "xbm4q1", + styles: "display:flex;align-items:stretch;flex-direction:row;&[aria-orientation='vertical']{flex-direction:column;}" +} : 0); +const styles_Tab = /*#__PURE__*/emotion_styled_base_browser_esm(Tab, true ? { + target: "enfox0g1" +} : 0)("&{display:inline-flex;align-items:center;position:relative;border-radius:0;height:", space(12), ";background:transparent;border:none;box-shadow:none;cursor:pointer;padding:3px ", space(4), ";margin-left:0;font-weight:500;&[aria-disabled='true']{cursor:default;opacity:0.3;}&:hover{color:", COLORS.theme.accent, ";}&:focus:not( :disabled ){position:relative;box-shadow:none;outline:none;}&::after{content:'';position:absolute;right:0;bottom:0;left:0;pointer-events:none;background:", COLORS.theme.accent, ";height:calc( 0 * var( --wp-admin-border-width-focus ) );border-radius:0;transition:all 0.1s linear;", reduceMotion('transition'), ";}&[aria-selected='true']::after{height:calc( 1 * var( --wp-admin-border-width-focus ) );outline:2px solid transparent;outline-offset:-1px;}&::before{content:'';position:absolute;top:", space(3), ";right:", space(3), ";bottom:", space(3), ";left:", space(3), ";pointer-events:none;box-shadow:0 0 0 0 transparent;border-radius:2px;transition:all 0.1s linear;", reduceMotion('transition'), ";}&:focus-visible::before{box-shadow:0 0 0 var( --wp-admin-border-width-focus ) ", COLORS.theme.accent, ";outline:2px solid transparent;}}" + ( true ? "" : 0)); +const styles_TabPanel = /*#__PURE__*/emotion_styled_base_browser_esm(TabPanel, true ? { + target: "enfox0g0" +} : 0)("&:focus{box-shadow:none;outline:none;}&:focus-visible{border-radius:2px;box-shadow:0 0 0 var( --wp-admin-border-width-focus ) ", COLORS.theme.accent, ";outline:2px solid transparent;outline-offset:0;}" + ( true ? "" : 0)); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tabs/tab.js + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + +const tab_Tab = (0,external_wp_element_namespaceObject.forwardRef)(function Tab({ + children, + tabId, + disabled, + render, + ...otherProps +}, ref) { + const context = useTabsContext(); + if (!context) { + true ? external_wp_warning_default()('`Tabs.Tab` must be wrapped in a `Tabs` component.') : 0; + return null; + } + const { + store, + instanceId + } = context; + const instancedTabId = `${instanceId}-${tabId}`; + return (0,external_React_.createElement)(styles_Tab, { + ref: ref, + store: store, + id: instancedTabId, + disabled: disabled, + render: render, + ...otherProps + }, children); +}); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tabs/tablist.js + +/** + * External dependencies + */ +// eslint-disable-next-line no-restricted-imports + + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + +const TabList = (0,external_wp_element_namespaceObject.forwardRef)(function TabList({ + children, + ...otherProps +}, ref) { + const context = useTabsContext(); + if (!context) { + true ? external_wp_warning_default()('`Tabs.TabList` must be wrapped in a `Tabs` component.') : 0; + return null; + } + const { + store + } = context; + const { + selectedId, + activeId, + selectOnMove + } = store.useState(); + const { + setActiveId + } = store; + const onBlur = () => { + if (!selectOnMove) { + return; + } + + // When automatic tab selection is on, make sure that the active tab is up + // to date with the selected tab when leaving the tablist. This makes sure + // that the selected tab will receive keyboard focus when tabbing back into + // the tablist. + if (selectedId !== activeId) { + setActiveId(selectedId); + } + }; + return (0,external_React_.createElement)(tab_list_TabList, { + ref: ref, + store: store, + render: (0,external_React_.createElement)(TabListWrapper, null), + onBlur: onBlur, + ...otherProps + }, children); +}); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tabs/tabpanel.js + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + +const tabpanel_TabPanel = (0,external_wp_element_namespaceObject.forwardRef)(function TabPanel({ + children, + tabId, + focusable = true, + ...otherProps +}, ref) { + const context = useTabsContext(); + if (!context) { + true ? external_wp_warning_default()('`Tabs.TabPanel` must be wrapped in a `Tabs` component.') : 0; + return null; + } + const { + store, + instanceId + } = context; + const instancedTabId = `${instanceId}-${tabId}`; + const selectedId = store.useState(state => state.selectedId); + return (0,external_React_.createElement)(styles_TabPanel, { + ref: ref, + store: store + // For TabPanel, the id passed here is the id attribute of the DOM + // element. + // `tabId` is the id of the tab that controls this panel. + , + id: `${instancedTabId}-view`, + tabId: instancedTabId, + focusable: focusable, + ...otherProps + }, selectedId === instancedTabId && children); +}); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tabs/index.js + +/** + * External dependencies + */ +// eslint-disable-next-line no-restricted-imports + + +/** + * WordPress dependencies + */ + + + +/** + * Internal dependencies + */ + + + + + +function Tabs({ + selectOnMove = true, + initialTabId, + orientation = 'horizontal', + onSelect, + children, + selectedTabId +}) { + const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(Tabs, 'tabs'); + const store = useTabStore({ + selectOnMove, + orientation, + defaultSelectedId: initialTabId && `${instanceId}-${initialTabId}`, + setSelectedId: selectedId => { + const strippedDownId = typeof selectedId === 'string' ? selectedId.replace(`${instanceId}-`, '') : selectedId; + onSelect?.(strippedDownId); + }, + selectedId: selectedTabId && `${instanceId}-${selectedTabId}` + }); + const isControlled = selectedTabId !== undefined; + const { + items, + selectedId, + activeId + } = store.useState(); + const { + setSelectedId, + setActiveId + } = store; + + // Keep track of whether tabs have been populated. This is used to prevent + // certain effects from firing too early while tab data and relevant + // variables are undefined during the initial render. + const tabsHavePopulated = (0,external_wp_element_namespaceObject.useRef)(false); + if (items.length > 0) { + tabsHavePopulated.current = true; + } + const selectedTab = items.find(item => item.id === selectedId); + const firstEnabledTab = items.find(item => { + // Ariakit internally refers to disabled tabs as `dimmed`. + return !item.dimmed; + }); + const initialTab = items.find(item => item.id === `${instanceId}-${initialTabId}`); + + // Handle selecting the initial tab. + (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { + if (isControlled) { + return; + } + + // Wait for the denoted initial tab to be declared before making a + // selection. This ensures that if a tab is declared lazily it can + // still receive initial selection, as well as ensuring no tab is + // selected if an invalid `initialTabId` is provided. + if (initialTabId && !initialTab) { + return; + } + + // If the currently selected tab is missing (i.e. removed from the DOM), + // fall back to the initial tab or the first enabled tab if there is + // one. Otherwise, no tab should be selected. + if (!items.find(item => item.id === selectedId)) { + if (initialTab && !initialTab.dimmed) { + setSelectedId(initialTab?.id); + return; + } + if (firstEnabledTab) { + setSelectedId(firstEnabledTab.id); + } else if (tabsHavePopulated.current) { + setSelectedId(null); + } + } + }, [firstEnabledTab, initialTab, initialTabId, isControlled, items, selectedId, setSelectedId]); + + // Handle the currently selected tab becoming disabled. + (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { + if (!selectedTab?.dimmed) { + return; + } + + // In controlled mode, we trust that disabling tabs is done + // intentionally, and don't select a new tab automatically. + if (isControlled) { + setSelectedId(null); + return; + } + + // If the currently selected tab becomes disabled, fall back to the + // `initialTabId` if possible. Otherwise select the first + // enabled tab (if there is one). + if (initialTab && !initialTab.dimmed) { + setSelectedId(initialTab.id); + return; + } + if (firstEnabledTab) { + setSelectedId(firstEnabledTab.id); + } + }, [firstEnabledTab, initialTab, isControlled, selectedTab?.dimmed, setSelectedId]); + + // Clear `selectedId` if the active tab is removed from the DOM in controlled mode. + (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { + if (!isControlled) { + return; + } + + // Once the tabs have populated, if the `selectedTabId` still can't be + // found, clear the selection. + if (tabsHavePopulated.current && !!selectedTabId && !selectedTab) { + setSelectedId(null); + } + }, [isControlled, selectedTab, selectedTabId, setSelectedId]); + (0,external_wp_element_namespaceObject.useEffect)(() => { + if (!isControlled) { + return; + } + requestAnimationFrame(() => { + const focusedElement = items?.[0]?.element?.ownerDocument.activeElement; + if (!focusedElement || !items.some(item => focusedElement === item.element)) { + return; // Return early if no tabs are focused. + } + + // If, after ariakit re-computes the active tab, that tab doesn't match + // the currently focused tab, then we force an update to ariakit to avoid + // any mismatches, especially when navigating to previous/next tab with + // arrow keys. + if (activeId !== focusedElement.id) { + setActiveId(focusedElement.id); + } + }); + }, [activeId, isControlled, items, setActiveId]); + const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ + store, + instanceId + }), [store, instanceId]); + return (0,external_React_.createElement)(TabsContext.Provider, { + value: contextValue + }, children); +} +Tabs.TabList = TabList; +Tabs.Tab = tab_Tab; +Tabs.TabPanel = tabpanel_TabPanel; +Tabs.Context = TabsContext; +/* harmony default export */ const tabs = (Tabs); + +;// CONCATENATED MODULE: external ["wp","privateApis"] +const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/lock-unlock.js +/** + * WordPress dependencies + */ const { lock, unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', '@wordpress/components'); + +;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/private-apis.js +/** + * WordPress dependencies + */ + +/** + * Internal dependencies + */ + + + + + + + + + + + const privateApis = {}; lock(privateApis, { + CompositeV2: Composite, + CompositeGroupV2: CompositeGroup, + CompositeItemV2: CompositeItem, + CompositeRowV2: CompositeRow, + useCompositeStoreV2: useCompositeStore, CustomSelectControl: CustomSelectControl, __experimentalPopoverLegacyPositionToPlacement: positionToPlacement, createPrivateSlotFill: createPrivateSlotFill, ComponentsContext: ComponentsContext, + ProgressBar: progress_bar, + Tabs: tabs, + Theme: theme, DropdownMenuV2: dropdown_menu_v2_DropdownMenu, - DropdownMenuCheckboxItemV2: DropdownMenuCheckboxItem, DropdownMenuGroupV2: DropdownMenuGroup, DropdownMenuItemV2: DropdownMenuItem, - DropdownMenuLabelV2: DropdownMenuLabel, - DropdownMenuRadioGroupV2: DropdownMenuRadioGroup, + DropdownMenuCheckboxItemV2: DropdownMenuCheckboxItem, DropdownMenuRadioItemV2: DropdownMenuRadioItem, DropdownMenuSeparatorV2: DropdownMenuSeparator, - DropdownSubMenuV2: DropdownSubMenu, - DropdownSubMenuTriggerV2: DropdownSubMenuTrigger, - ProgressBar: progress_bar, - Theme: theme + DropdownMenuItemLabelV2: DropdownMenuItemLabel, + DropdownMenuItemHelpTextV2: DropdownMenuItemHelpText, + kebabCase: kebabCase }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/index.js @@ -81528,7 +73701,8 @@ lock(privateApis, { // Private APIs. -}(); +})(); + (window.wp = window.wp || {}).components = __webpack_exports__; /******/ })() ;
\ No newline at end of file |