From fc2a390d57970c273b04cfb7e4e34bad8bacab36 Mon Sep 17 00:00:00 2001
From: Konstantin Obenland
Date: Thu, 20 Nov 2025 10:26:19 -0600
Subject: [PATCH 1/2] Add infinite scroll to Social Web feed
Implements infinite scroll functionality for the feed view, automatically loading more posts as users scroll to the bottom.
Key changes:
- Added data accumulation logic to append pages instead of replacing
- Enabled infinite scroll by default in view configuration
- Added infiniteScrollHandler to trigger next page load
- Implemented deduplication to prevent duplicate posts
- Added styles to clean up empty pagination footer
Based on WordPress DataViews infinite scroll pattern from Gutenberg.
---
build/command-palette/plugin.asset.php | 2 +-
build/command-palette/plugin.js | 480 +-
build/editor-plugin/plugin.asset.php | 2 +-
build/editor-plugin/plugin.js | 565 +-
build/extra-fields/index.asset.php | 2 +-
build/extra-fields/index.js | 738 +-
build/extra-fields/style-index-rtl.css | 143 +-
build/extra-fields/style-index.css | 145 +-
build/follow-me/index.asset.php | 2 +-
build/follow-me/index.js | 1252 +-
build/follow-me/style-index-rtl.css | 345 +-
build/follow-me/style-index.css | 347 +-
build/follow-me/view.asset.php | 2 +-
build/follow-me/view.js | 761 +-
build/followers/index.asset.php | 2 +-
build/followers/index.js | 1035 +-
build/followers/style-index-rtl.css | 242 +-
build/followers/style-index.css | 244 +-
build/followers/view.asset.php | 2 +-
build/followers/view.js | 235 +-
build/reactions/index.asset.php | 2 +-
build/reactions/index.js | 761 +-
build/reactions/style-index-rtl.css | 279 +-
build/reactions/style-index.css | 281 +-
build/reactions/view.asset.php | 2 +-
build/reactions/view.js | 519 +-
build/remote-reply/style-view.css | 98 +-
build/remote-reply/view.asset.php | 2 +-
build/remote-reply/view.js | 761 +-
build/reply-intent/plugin.asset.php | 2 +-
build/reply-intent/plugin.js | 182 +-
build/reply/index-rtl.css | 224 +-
build/reply/index.asset.php | 2 +-
build/reply/index.css | 226 +-
build/reply/index.js | 521 +-
build/social-web/feed-inspector.js | 237 +-
build/social-web/feed-stage.js | 1193 +-
build/social-web/index.asset.php | 2 +-
build/social-web/index.js | 1873 +-
build/social-web/style-feed-stage-rtl.css | 358 +-
build/social-web/style-feed-stage.css | 360 +-
build/social-web/style-index-rtl.css | 365 +-
build/social-web/style-index.css | 367 +-
build/social-web/vendors.asset.php | 2 +-
build/social-web/vendors.js | 22292 +++++++++++++++++++-
src/social-web/routes/feed/stage.tsx | 66 +-
src/social-web/routes/feed/style.scss | 6 +
47 files changed, 37344 insertions(+), 185 deletions(-)
diff --git a/build/command-palette/plugin.asset.php b/build/command-palette/plugin.asset.php
index e7a6350c6d..3179b074a5 100644
--- a/build/command-palette/plugin.asset.php
+++ b/build/command-palette/plugin.asset.php
@@ -1 +1 @@
- array('react', 'react-jsx-runtime', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'e39de7b99dcb1cb7d308');
+ array('react', 'react-jsx-runtime', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '33a55a0b3696a64e729c');
diff --git a/build/command-palette/plugin.js b/build/command-palette/plugin.js
index 79264d100d..7cc9d84b4e 100644
--- a/build/command-palette/plugin.js
+++ b/build/command-palette/plugin.js
@@ -1,3 +1,477 @@
-(()=>{"use strict";window.React;const e=window.wp.i18n,t=window.wp.data,i=window.wp.coreData,a=window.wp.element,o=window.ReactJSXRuntime,l=(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 80 80",width:"24",height:"24",children:[(0,o.jsx)("rect",{width:"80",height:"80",fill:"#f1027e"}),(0,o.jsx)("path",{d:"M42.9 19.8L72 36.6v6.7L42.9 60.2v-6.7L66.2 40 42.9 26.6v-6.8z",fillRule:"evenodd",clipRule:"evenodd",fill:"white"}),(0,o.jsx)("path",{d:"M42.9 33.3L54.5 40l-11.6 6.7V33.3z",fillRule:"evenodd",clipRule:"evenodd",fill:"white"}),(0,o.jsx)("path",{d:"M37.1 19.8L8 36.6v6.7l23.3-13.4v26.9l5.8 3.4V19.8zM25.5 40L13.8 46.7l11.6 6.7V40z",fillRule:"evenodd",clipRule:"evenodd",fill:"white"})]}),{actorMode:c,canManageOptions:n,followingEnabled:s}=window.activitypubCommandPalette||{followingEnabled:!1,actorMode:"actor",canManageOptions:!1},r=e=>{try{(0,t.dispatch)("core/commands").registerCommand(e)}catch(t){console.error("Failed to register ActivityPub command:",e.name,t)}},d=e=>{try{(0,t.dispatch)("core/commands").registerCommandLoader(e)}catch(t){console.error("Failed to register ActivityPub command loader:",e.name,t)}};"actor"!==c&&"actor_blog"!==c||(r({name:"activitypub/navigate-user-followers",label:(0,e.__)("ActivityPub: View Your Followers","activitypub"),icon:l,callback:({close:e})=>{document.location.href="users.php?page=activitypub-followers-list",e()}}),s&&r({name:"activitypub/navigate-user-following",label:(0,e.__)("ActivityPub: View Who You Follow","activitypub"),icon:l,callback:({close:e})=>{document.location.href="users.php?page=activitypub-following-list",e()}}),r({name:"activitypub/navigate-extra-fields",label:(0,e.__)("ActivityPub: View Extra Fields","activitypub"),icon:l,callback:({close:e})=>{document.location.href="edit.php?post_type=ap_extrafield",e()}}),r({name:"activitypub/add-extra-field",label:(0,e.__)("ActivityPub: Add New Extra Field","activitypub"),icon:l,callback:({close:e})=>{document.location.href="post-new.php?post_type=ap_extrafield",e()}}),d({name:"activitypub/extra-fields-search",hook:({search:o})=>{const{records:c,isLoading:n}=(0,t.useSelect)(e=>{const t=e(i.store),a=t.getCurrentUser(),l={search:o||void 0,per_page:10,orderby:o?"relevance":"date",status:"any",author:a?.id};return{records:t.getEntityRecords("postType","ap_extrafield",l),isLoading:!t.hasFinishedResolution("getEntityRecords",["postType","ap_extrafield",l])}},[o]);return{commands:(0,a.useMemo)(()=>(null!=c?c:[]).slice(0,10).map(t=>{const i=(t.title?.rendered||(0,e.__)("(no title)","activitypub")).replace(/["'`]/g,"");return{name:`activitypub/edit-extra-field/${t.id}`,label:(0,e.sprintf)(/* translators: %s: Extra field title */ /* translators: %s: Extra field title */
-(0,e.__)("ActivityPub: Edit - %s","activitypub"),i),icon:l,callback:({close:e})=>{document.location=`post.php?post=${t.id}&action=edit`,e()}}}),[c]),isLoading:n}}}),r({name:"activitypub/navigate-blocked-actors",label:(0,e.__)("ActivityPub: View Blocked Actors","activitypub"),icon:l,callback:({close:e})=>{document.location.href="users.php?page=activitypub-blocked-actors-list",e()}})),!n||"blog"!==c&&"actor_blog"!==c||(r({name:"activitypub/navigate-blog-followers",label:(0,e.__)("ActivityPub: View Blog Followers","activitypub"),icon:l,callback:({close:e})=>{document.location.href="options-general.php?page=activitypub&tab=followers",e()}}),s&&r({name:"activitypub/navigate-blog-following",label:(0,e.__)("ActivityPub: View Blog Following","activitypub"),icon:l,callback:({close:e})=>{document.location.href="options-general.php?page=activitypub&tab=following",e()}}),r({name:"activitypub/navigate-settings",label:(0,e.__)("ActivityPub: View Settings","activitypub"),icon:l,callback:({close:e})=>{document.location.href="options-general.php?page=activitypub&tab=settings",e()}}),r({name:"activitypub/navigate-blog-extra-fields",label:(0,e.__)("ActivityPub: View Blog Extra Fields","activitypub"),icon:l,callback:({close:e})=>{document.location.href="edit.php?post_type=ap_extrafield_blog",e()}}),r({name:"activitypub/add-blog-extra-field",label:(0,e.__)("ActivityPub: Add New Blog Extra Field","activitypub"),icon:l,callback:({close:e})=>{document.location.href="post-new.php?post_type=ap_extrafield_blog",e()}}),d({name:"activitypub/blog-extra-fields-search",hook:({search:o})=>{const{records:c,isLoading:n}=(0,t.useSelect)(e=>{const t=e(i.store),a={search:o||void 0,per_page:10,orderby:o?"relevance":"date",status:"any"};return{records:t.getEntityRecords("postType","ap_extrafield_blog",a),isLoading:!t.hasFinishedResolution("getEntityRecords",["postType","ap_extrafield_blog",a])}},[o]);return{commands:(0,a.useMemo)(()=>(null!=c?c:[]).slice(0,10).map(t=>{const i=(t.title?.rendered||(0,e.__)("(no title)","activitypub")).replace(/["'`]/g,"");return{name:`activitypub/edit-blog-extra-field/${t.id}`,label:(0,e.sprintf)(/* translators: %s: Blog extra field title */ /* translators: %s: Blog extra field title */
-(0,e.__)("ActivityPub: Edit Blog - %s","activitypub"),i),icon:l,callback:({close:e})=>{document.location=`post.php?post=${t.id}&action=edit`,e()}}}),[c]),isLoading:n}}}))})();
\ No newline at end of file
+/******/ (() => { // webpackBootstrap
+/******/ "use strict";
+/******/ var __webpack_modules__ = ({
+
+/***/ "@wordpress/core-data":
+/*!**********************************!*\
+ !*** external ["wp","coreData"] ***!
+ \**********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["coreData"];
+
+/***/ }),
+
+/***/ "@wordpress/data":
+/*!******************************!*\
+ !*** external ["wp","data"] ***!
+ \******************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["data"];
+
+/***/ }),
+
+/***/ "@wordpress/element":
+/*!*********************************!*\
+ !*** external ["wp","element"] ***!
+ \*********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["element"];
+
+/***/ }),
+
+/***/ "@wordpress/i18n":
+/*!******************************!*\
+ !*** external ["wp","i18n"] ***!
+ \******************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["i18n"];
+
+/***/ }),
+
+/***/ "react":
+/*!************************!*\
+ !*** external "React" ***!
+ \************************/
+/***/ ((module) => {
+
+module.exports = window["React"];
+
+/***/ }),
+
+/***/ "react/jsx-runtime":
+/*!**********************************!*\
+ !*** external "ReactJSXRuntime" ***!
+ \**********************************/
+/***/ ((module) => {
+
+module.exports = window["ReactJSXRuntime"];
+
+/***/ })
+
+/******/ });
+/************************************************************************/
+/******/ // The module cache
+/******/ var __webpack_module_cache__ = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/ // Check if module is in cache
+/******/ var cachedModule = __webpack_module_cache__[moduleId];
+/******/ if (cachedModule !== undefined) {
+/******/ return cachedModule.exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = __webpack_module_cache__[moduleId] = {
+/******/ // no module.id needed
+/******/ // no module.loaded needed
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/************************************************************************/
+/******/ /* webpack/runtime/compat get default export */
+/******/ (() => {
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = (module) => {
+/******/ var getter = module && module.__esModule ?
+/******/ () => (module['default']) :
+/******/ () => (module);
+/******/ __webpack_require__.d(getter, { a: getter });
+/******/ return getter;
+/******/ };
+/******/ })();
+/******/
+/******/ /* webpack/runtime/define property getters */
+/******/ (() => {
+/******/ // define getter functions for harmony exports
+/******/ __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 */
+/******/ (() => {
+/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
+/******/ })();
+/******/
+/******/ /* webpack/runtime/make namespace object */
+/******/ (() => {
+/******/ // define __esModule on exports
+/******/ __webpack_require__.r = (exports) => {
+/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
+/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
+/******/ }
+/******/ Object.defineProperty(exports, '__esModule', { value: true });
+/******/ };
+/******/ })();
+/******/
+/************************************************************************/
+var __webpack_exports__ = {};
+// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
+(() => {
+/*!****************************************!*\
+ !*** ./src/command-palette/plugin.tsx ***!
+ \****************************************/
+__webpack_require__.r(__webpack_exports__);
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data");
+/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
+/**
+ * ActivityPub Command Palette Integration
+ *
+ * Registers commands for the WordPress Command Palette (Cmd/Ctrl + K)
+ * to provide quick navigation to ActivityPub admin pages.
+ */
+
+
+
+
+
+
+
+// Icon for ActivityPub commands - using the official ActivityPub plugin icon.
+const activityPubIcon = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("svg", {
+ xmlns: "http://www.w3.org/2000/svg",
+ viewBox: "0 0 80 80",
+ width: "24",
+ height: "24",
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("rect", {
+ width: "80",
+ height: "80",
+ fill: "#f1027e"
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("path", {
+ d: "M42.9 19.8L72 36.6v6.7L42.9 60.2v-6.7L66.2 40 42.9 26.6v-6.8z",
+ fillRule: "evenodd",
+ clipRule: "evenodd",
+ fill: "white"
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("path", {
+ d: "M42.9 33.3L54.5 40l-11.6 6.7V33.3z",
+ fillRule: "evenodd",
+ clipRule: "evenodd",
+ fill: "white"
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("path", {
+ d: "M37.1 19.8L8 36.6v6.7l23.3-13.4v26.9l5.8 3.4V19.8zM25.5 40L13.8 46.7l11.6 6.7V40z",
+ fillRule: "evenodd",
+ clipRule: "evenodd",
+ fill: "white"
+ })]
+});
+
+// Get configuration from PHP.
+const {
+ actorMode,
+ canManageOptions,
+ followingEnabled
+} = window.activitypubCommandPalette || {
+ followingEnabled: false,
+ actorMode: 'actor',
+ canManageOptions: false
+};
+
+// Helper function to register a command.
+const registerCommand = command => {
+ try {
+ (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.dispatch)('core/commands').registerCommand(command);
+ } catch (error) {
+ console.error('Failed to register ActivityPub command:', command.name, error);
+ }
+};
+
+// Helper function to register a command loader for dynamic commands.
+const registerCommandLoader = loaderConfig => {
+ try {
+ (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.dispatch)('core/commands').registerCommandLoader(loaderConfig);
+ } catch (error) {
+ console.error('Failed to register ActivityPub command loader:', loaderConfig.name, error);
+ }
+};
+
+/**
+ * Hook to load user extra fields as dynamic commands.
+ */
+const useExtraFieldsCommandLoader = ({
+ search
+}) => {
+ // Retrieving the extra fields for the "search" term.
+ const {
+ records,
+ isLoading
+ } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
+ const store = select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_3__.store);
+ const currentUser = store.getCurrentUser();
+ const query = {
+ search: !!search ? search : undefined,
+ per_page: 10,
+ orderby: search ? 'relevance' : 'date',
+ status: 'any',
+ author: currentUser?.id
+ };
+ return {
+ records: store.getEntityRecords('postType', 'ap_extrafield', query),
+ isLoading: !store.hasFinishedResolution('getEntityRecords', ['postType', 'ap_extrafield', query])
+ };
+ }, [search]);
+
+ // Creating the commands.
+ const commands = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useMemo)(() => {
+ return (records !== null && records !== void 0 ? records : []).slice(0, 10).map(record => {
+ const title = record.title?.rendered || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('(no title)', 'activitypub');
+ // Remove all quotes and special characters that could break CSS selectors.
+ const sanitizedTitle = title.replace(/["'`]/g, '');
+ return {
+ // Use ID in the name to ensure uniqueness even with duplicate titles.
+ name: `activitypub/edit-extra-field/${record.id}`,
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %s: Extra field title */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('ActivityPub: Edit - %s', 'activitypub'), sanitizedTitle),
+ icon: activityPubIcon,
+ callback: ({
+ close
+ }) => {
+ document.location = `post.php?post=${record.id}&action=edit`;
+ close();
+ }
+ };
+ });
+ }, [records]);
+ return {
+ commands,
+ isLoading
+ };
+};
+
+/**
+ * Hook to load blog extra fields as dynamic commands.
+ */
+const useBlogExtraFieldsCommandLoader = ({
+ search
+}) => {
+ // Retrieving the blog extra fields for the "search" term.
+ const {
+ records,
+ isLoading
+ } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
+ const store = select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_3__.store);
+ const query = {
+ search: !!search ? search : undefined,
+ per_page: 10,
+ orderby: search ? 'relevance' : 'date',
+ status: 'any'
+ };
+ return {
+ records: store.getEntityRecords('postType', 'ap_extrafield_blog', query),
+ isLoading: !store.hasFinishedResolution('getEntityRecords', ['postType', 'ap_extrafield_blog', query])
+ };
+ }, [search]);
+
+ // Creating the commands.
+ const commands = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useMemo)(() => {
+ return (records !== null && records !== void 0 ? records : []).slice(0, 10).map(record => {
+ const title = record.title?.rendered || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('(no title)', 'activitypub');
+ // Remove all quotes and special characters that could break CSS selectors.
+ const sanitizedTitle = title.replace(/["'`]/g, '');
+ return {
+ // Use ID in the name to ensure uniqueness even with duplicate titles.
+ name: `activitypub/edit-blog-extra-field/${record.id}`,
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %s: Blog extra field title */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('ActivityPub: Edit Blog - %s', 'activitypub'), sanitizedTitle),
+ icon: activityPubIcon,
+ callback: ({
+ close
+ }) => {
+ document.location = `post.php?post=${record.id}&action=edit`;
+ close();
+ }
+ };
+ });
+ }, [records]);
+ return {
+ commands,
+ isLoading
+ };
+};
+
+// User-specific commands (for actor and actor_blog modes).
+if (actorMode === 'actor' || actorMode === 'actor_blog') {
+ // User Followers command.
+ registerCommand({
+ name: 'activitypub/navigate-user-followers',
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('ActivityPub: View Your Followers', 'activitypub'),
+ icon: activityPubIcon,
+ callback: ({
+ close
+ }) => {
+ document.location.href = 'users.php?page=activitypub-followers-list';
+ close();
+ }
+ });
+
+ // User Following command (only if enabled).
+ if (followingEnabled) {
+ registerCommand({
+ name: 'activitypub/navigate-user-following',
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('ActivityPub: View Who You Follow', 'activitypub'),
+ icon: activityPubIcon,
+ callback: ({
+ close
+ }) => {
+ document.location.href = 'users.php?page=activitypub-following-list';
+ close();
+ }
+ });
+ }
+
+ // User Extra Fields commands.
+ registerCommand({
+ name: 'activitypub/navigate-extra-fields',
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('ActivityPub: View Extra Fields', 'activitypub'),
+ icon: activityPubIcon,
+ callback: ({
+ close
+ }) => {
+ document.location.href = 'edit.php?post_type=ap_extrafield';
+ close();
+ }
+ });
+ registerCommand({
+ name: 'activitypub/add-extra-field',
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('ActivityPub: Add New Extra Field', 'activitypub'),
+ icon: activityPubIcon,
+ callback: ({
+ close
+ }) => {
+ document.location.href = 'post-new.php?post_type=ap_extrafield';
+ close();
+ }
+ });
+
+ // Dynamic command loader: Edit existing extra fields.
+ registerCommandLoader({
+ name: 'activitypub/extra-fields-search',
+ hook: useExtraFieldsCommandLoader
+ });
+
+ // Blocked Actors command (user-specific).
+ registerCommand({
+ name: 'activitypub/navigate-blocked-actors',
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('ActivityPub: View Blocked Actors', 'activitypub'),
+ icon: activityPubIcon,
+ callback: ({
+ close
+ }) => {
+ document.location.href = 'users.php?page=activitypub-blocked-actors-list';
+ close();
+ }
+ });
+}
+
+// Blog-related commands (for blog and actor_blog modes with manage_options capability).
+if (canManageOptions && (actorMode === 'blog' || actorMode === 'actor_blog')) {
+ // Blog Followers command.
+ registerCommand({
+ name: 'activitypub/navigate-blog-followers',
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('ActivityPub: View Blog Followers', 'activitypub'),
+ icon: activityPubIcon,
+ callback: ({
+ close
+ }) => {
+ document.location.href = 'options-general.php?page=activitypub&tab=followers';
+ close();
+ }
+ });
+
+ // Blog Following command (only if enabled).
+ if (followingEnabled) {
+ registerCommand({
+ name: 'activitypub/navigate-blog-following',
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('ActivityPub: View Blog Following', 'activitypub'),
+ icon: activityPubIcon,
+ callback: ({
+ close
+ }) => {
+ document.location.href = 'options-general.php?page=activitypub&tab=following';
+ close();
+ }
+ });
+ }
+
+ // Settings command (blog-related, requires manage_options).
+ registerCommand({
+ name: 'activitypub/navigate-settings',
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('ActivityPub: View Settings', 'activitypub'),
+ icon: activityPubIcon,
+ callback: ({
+ close
+ }) => {
+ document.location.href = 'options-general.php?page=activitypub&tab=settings';
+ close();
+ }
+ });
+
+ // Blog Extra Fields commands.
+ registerCommand({
+ name: 'activitypub/navigate-blog-extra-fields',
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('ActivityPub: View Blog Extra Fields', 'activitypub'),
+ icon: activityPubIcon,
+ callback: ({
+ close
+ }) => {
+ document.location.href = 'edit.php?post_type=ap_extrafield_blog';
+ close();
+ }
+ });
+ registerCommand({
+ name: 'activitypub/add-blog-extra-field',
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('ActivityPub: Add New Blog Extra Field', 'activitypub'),
+ icon: activityPubIcon,
+ callback: ({
+ close
+ }) => {
+ document.location.href = 'post-new.php?post_type=ap_extrafield_blog';
+ close();
+ }
+ });
+
+ // Dynamic command loader: Edit existing blog extra fields.
+ registerCommandLoader({
+ name: 'activitypub/blog-extra-fields-search',
+ hook: useBlogExtraFieldsCommandLoader
+ });
+}
+})();
+
+/******/ })()
+;
+//# sourceMappingURL=plugin.js.map
\ No newline at end of file
diff --git a/build/editor-plugin/plugin.asset.php b/build/editor-plugin/plugin.asset.php
index 2bc42a8252..94857c1386 100644
--- a/build/editor-plugin/plugin.asset.php
+++ b/build/editor-plugin/plugin.asset.php
@@ -1 +1 @@
- array('react-jsx-runtime', 'wp-components', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => '4371fba4c154ea1d6303');
+ array('react-jsx-runtime', 'wp-components', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => 'f9953da56803b8af4fdf');
diff --git a/build/editor-plugin/plugin.js b/build/editor-plugin/plugin.js
index b6ce964b64..bdfa585eae 100644
--- a/build/editor-plugin/plugin.js
+++ b/build/editor-plugin/plugin.js
@@ -1 +1,564 @@
-(()=>{"use strict";const t=window.wp.editor,e=window.wp.editPost,i=window.wp.plugins,n=window.wp.components,a=window.wp.element;var o=(0,a.forwardRef)(({icon:t,size:e=24,...i},n)=>(0,a.cloneElement)(t,{width:e,height:e,...i,ref:n}));const l=window.wp.primitives,c=window.ReactJSXRuntime;var s=(0,c.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(l.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8Zm6.5 8c0 .6 0 1.2-.2 1.8h-2.7c0-.6.2-1.1.2-1.8s0-1.2-.2-1.8h2.7c.2.6.2 1.1.2 1.8Zm-.9-3.2h-2.4c-.3-.9-.7-1.8-1.1-2.4-.1-.2-.2-.4-.3-.5 1.6.5 3 1.6 3.8 3ZM12.8 17c-.3.5-.6 1-.8 1.3-.2-.3-.5-.8-.8-1.3-.3-.5-.6-1.1-.8-1.7h3.3c-.2.6-.5 1.2-.8 1.7Zm-2.9-3.2c-.1-.6-.2-1.1-.2-1.8s0-1.2.2-1.8H14c.1.6.2 1.1.2 1.8s0 1.2-.2 1.8H9.9ZM11.2 7c.3-.5.6-1 .8-1.3.2.3.5.8.8 1.3.3.5.6 1.1.8 1.7h-3.3c.2-.6.5-1.2.8-1.7Zm-1-1.2c-.1.2-.2.3-.3.5-.4.7-.8 1.5-1.1 2.4H6.4c.8-1.4 2.2-2.5 3.8-3Zm-1.8 8H5.7c-.2-.6-.2-1.1-.2-1.8s0-1.2.2-1.8h2.7c0 .6-.2 1.1-.2 1.8s0 1.2.2 1.8Zm-2 1.4h2.4c.3.9.7 1.8 1.1 2.4.1.2.2.4.3.5-1.6-.5-3-1.6-3.8-3Zm7.4 3c.1-.2.2-.3.3-.5.4-.7.8-1.5 1.1-2.4h2.4c-.8 1.4-2.2 2.5-3.8 3Z"})}),u=(0,c.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(l.Path,{d:"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z",fillRule:"evenodd"})}),r=(0,c.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(l.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"})});const p=window.wp.data,v=window.wp.coreData,w=window.wp.url,_=window.wp.i18n,h=(t,e)=>t?.activitypub_content_visibility?t.activitypub_content_visibility:"federated"===t?.activitypub_status?"public":e&&new Date(e).getTime(){const i=(0,p.useSelect)(e=>e(t.store).getCurrentPostType(),[]),[a,r]=(0,v.useEntityProp)("postType",i,"meta"),w=(0,p.useSelect)(e=>e(t.store).getCurrentPost().date,[]);if("wp_block"===i)return null;const b=(0,c.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(l.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5A6.5 6.5 0 0 1 6.93 7.931l9.139 9.138A6.473 6.473 0 0 1 12 18.5Zm5.123-2.498a6.5 6.5 0 0 0-9.124-9.124l9.124 9.124ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z"})}),d={verticalAlign:"middle",gap:"4px",justifyContent:"start",display:"inline-flex",alignItems:"center"},m=(t,e,i)=>(0,c.jsx)(n.Tooltip,{text:i,children:(0,c.jsxs)(n.__experimentalText,{style:d,children:[(0,c.jsx)(o,{icon:t}),e]})}),y=t.PluginDocumentSettingPanel||e.PluginDocumentSettingPanel;return(0,c.jsxs)(y,{name:"activitypub",className:"block-editor-block-inspector",title:(0,_.__)("Fediverse ⁂","activitypub"),children:[(0,c.jsx)(n.TextControl,{label:(0,_.__)("Content Warning","activitypub"),value:a?.activitypub_content_warning,onChange:t=>{r({...a,activitypub_content_warning:t})},placeholder:(0,_.__)("Optional content warning","activitypub"),help:(0,_.__)("Content warnings do not change the content on your site, only in the fediverse.","activitypub"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),(0,c.jsx)(n.RangeControl,{label:(0,_.__)("Maximum Image Attachments","activitypub"),value:a?.activitypub_max_image_attachments,onChange:t=>{r({...a,activitypub_max_image_attachments:t})},min:0,max:10,help:(0,_.__)("Maximum number of image attachments to include when sharing to the fediverse.","activitypub"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),(0,c.jsx)(n.RadioControl,{label:(0,_.__)("Visibility","activitypub"),help:(0,_.__)("This adjusts the visibility of a post in the fediverse, but note that it won't affect how the post appears on the blog.","activitypub"),selected:h(a,w),options:[{label:m(s,(0,_.__)("Public","activitypub"),(0,_.__)("Post will be visible to everyone and appear in public timelines.","activitypub")),value:"public"},{label:m(u,(0,_.__)("Quiet public","activitypub"),(0,_.__)("Post will be visible to everyone but will not appear in public timelines.","activitypub")),value:"quiet_public"},{label:m(b,(0,_.__)("Do not federate","activitypub"),(0,_.__)("Post will not be shared to the Fediverse.","activitypub")),value:"local"}],onChange:t=>{r({...a,activitypub_content_visibility:t})},className:"activitypub-visibility"}),(0,c.jsx)(n.SelectControl,{label:(0,_.__)("Who can quote this post?","activitypub"),help:(0,_.__)("Quoting allows others to cite your post while adding their own commentary.","activitypub"),value:a?.activitypub_interaction_policy_quote,options:[{label:(0,_.__)("Anyone","activitypub"),value:"anyone"},{label:(0,_.__)("Followers only","activitypub"),value:"followers"},{label:(0,_.__)("Just me","activitypub"),value:"me"}],onChange:t=>{r({...a,activitypub_interaction_policy_quote:t})},__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})]})}}),(0,i.registerPlugin)("activitypub-editor-preview",{render:()=>{const e=(0,p.useSelect)(e=>e(t.store).getCurrentPost().status,[]);return(0,c.jsx)(c.Fragment,{children:t.PluginPreviewMenuItem?(0,c.jsx)(t.PluginPreviewMenuItem,{onClick:()=>{const e=(0,p.select)(t.store).getEditedPostPreviewLink(),i=(0,w.addQueryArgs)(e,{activitypub:"true"});window.open(i,"_blank")},icon:r,disabled:"auto-draft"===e,children:(0,_.__)("Fediverse preview ⁂","activitypub")}):null})}})})();
\ No newline at end of file
+/******/ (() => { // webpackBootstrap
+/******/ "use strict";
+/******/ var __webpack_modules__ = ({
+
+/***/ "./node_modules/@wordpress/icons/build-module/icon/index.js":
+/*!******************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/icon/index.js ***!
+ \******************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ icon_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
+// packages/icons/src/icon/index.ts
+
+var icon_default = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(
+ ({ icon, size = 24, ...props }, ref) => {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(icon, {
+ width: size,
+ height: size,
+ ...props,
+ ref
+ });
+ }
+);
+
+//# sourceMappingURL=index.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/external.js":
+/*!************************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/external.js ***!
+ \************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ external_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/external.tsx
+
+
+var external_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.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" }) });
+
+//# sourceMappingURL=external.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/globe.js":
+/*!*********************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/globe.js ***!
+ \*********************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ globe_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/globe.tsx
+
+
+var globe_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8Zm6.5 8c0 .6 0 1.2-.2 1.8h-2.7c0-.6.2-1.1.2-1.8s0-1.2-.2-1.8h2.7c.2.6.2 1.1.2 1.8Zm-.9-3.2h-2.4c-.3-.9-.7-1.8-1.1-2.4-.1-.2-.2-.4-.3-.5 1.6.5 3 1.6 3.8 3ZM12.8 17c-.3.5-.6 1-.8 1.3-.2-.3-.5-.8-.8-1.3-.3-.5-.6-1.1-.8-1.7h3.3c-.2.6-.5 1.2-.8 1.7Zm-2.9-3.2c-.1-.6-.2-1.1-.2-1.8s0-1.2.2-1.8H14c.1.6.2 1.1.2 1.8s0 1.2-.2 1.8H9.9ZM11.2 7c.3-.5.6-1 .8-1.3.2.3.5.8.8 1.3.3.5.6 1.1.8 1.7h-3.3c.2-.6.5-1.2.8-1.7Zm-1-1.2c-.1.2-.2.3-.3.5-.4.7-.8 1.5-1.1 2.4H6.4c.8-1.4 2.2-2.5 3.8-3Zm-1.8 8H5.7c-.2-.6-.2-1.1-.2-1.8s0-1.2.2-1.8h2.7c0 .6-.2 1.1-.2 1.8s0 1.2.2 1.8Zm-2 1.4h2.4c.3.9.7 1.8 1.1 2.4.1.2.2.4.3.5-1.6-.5-3-1.6-3.8-3Zm7.4 3c.1-.2.2-.3.3-.5.4-.7.8-1.5 1.1-2.4h2.4c-.8 1.4-2.2 2.5-3.8 3Z" }) });
+
+//# sourceMappingURL=globe.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/people.js":
+/*!**********************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/people.js ***!
+ \**********************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ people_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/people.tsx
+
+
+var people_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(
+ _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path,
+ {
+ d: "M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z",
+ fillRule: "evenodd"
+ }
+) });
+
+//# sourceMappingURL=people.js.map
+
+
+/***/ }),
+
+/***/ "./src/editor-plugin/utils.js":
+/*!************************************!*\
+ !*** ./src/editor-plugin/utils.js ***!
+ \************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ getDefaultVisibility: () => (/* binding */ getDefaultVisibility)
+/* harmony export */ });
+/**
+ * Calculates the default visibility for a post based on its metadata and age.
+ *
+ * Priority order:
+ * 1. Explicitly set visibility value
+ * 2. Federated posts default to public
+ * 3. Posts older than 1 month default to local
+ * 4. New posts default to public
+ *
+ * @param {Object} meta The post metadata object.
+ * @param {string|Date} postDate The post date.
+ *
+ * @return {string} The default visibility value ('public', 'quiet_public', or 'local').
+ */
+const getDefaultVisibility = (meta, postDate) => {
+ // If already set, use that value.
+ if (meta?.activitypub_content_visibility) {
+ return meta.activitypub_content_visibility;
+ }
+
+ // If post is federated, use public.
+ if (meta?.activitypub_status === 'federated') {
+ return 'public';
+ }
+
+ // If post is older than 1 month, default to local.
+ if (postDate) {
+ const postTimestamp = new Date(postDate).getTime();
+ const oneMonthAgo = Date.now() - 30 * 24 * 60 * 60 * 1000;
+ if (postTimestamp < oneMonthAgo) {
+ return 'local';
+ }
+ }
+
+ // Default to public for new posts.
+ return 'public';
+};
+
+/***/ }),
+
+/***/ "@wordpress/components":
+/*!************************************!*\
+ !*** external ["wp","components"] ***!
+ \************************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["components"];
+
+/***/ }),
+
+/***/ "@wordpress/core-data":
+/*!**********************************!*\
+ !*** external ["wp","coreData"] ***!
+ \**********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["coreData"];
+
+/***/ }),
+
+/***/ "@wordpress/data":
+/*!******************************!*\
+ !*** external ["wp","data"] ***!
+ \******************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["data"];
+
+/***/ }),
+
+/***/ "@wordpress/edit-post":
+/*!**********************************!*\
+ !*** external ["wp","editPost"] ***!
+ \**********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["editPost"];
+
+/***/ }),
+
+/***/ "@wordpress/editor":
+/*!********************************!*\
+ !*** external ["wp","editor"] ***!
+ \********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["editor"];
+
+/***/ }),
+
+/***/ "@wordpress/element":
+/*!*********************************!*\
+ !*** external ["wp","element"] ***!
+ \*********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["element"];
+
+/***/ }),
+
+/***/ "@wordpress/i18n":
+/*!******************************!*\
+ !*** external ["wp","i18n"] ***!
+ \******************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["i18n"];
+
+/***/ }),
+
+/***/ "@wordpress/plugins":
+/*!*********************************!*\
+ !*** external ["wp","plugins"] ***!
+ \*********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["plugins"];
+
+/***/ }),
+
+/***/ "@wordpress/primitives":
+/*!************************************!*\
+ !*** external ["wp","primitives"] ***!
+ \************************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["primitives"];
+
+/***/ }),
+
+/***/ "@wordpress/url":
+/*!*****************************!*\
+ !*** external ["wp","url"] ***!
+ \*****************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["url"];
+
+/***/ }),
+
+/***/ "react/jsx-runtime":
+/*!**********************************!*\
+ !*** external "ReactJSXRuntime" ***!
+ \**********************************/
+/***/ ((module) => {
+
+module.exports = window["ReactJSXRuntime"];
+
+/***/ })
+
+/******/ });
+/************************************************************************/
+/******/ // The module cache
+/******/ var __webpack_module_cache__ = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/ // Check if module is in cache
+/******/ var cachedModule = __webpack_module_cache__[moduleId];
+/******/ if (cachedModule !== undefined) {
+/******/ return cachedModule.exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = __webpack_module_cache__[moduleId] = {
+/******/ // no module.id needed
+/******/ // no module.loaded needed
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/************************************************************************/
+/******/ /* webpack/runtime/compat get default export */
+/******/ (() => {
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = (module) => {
+/******/ var getter = module && module.__esModule ?
+/******/ () => (module['default']) :
+/******/ () => (module);
+/******/ __webpack_require__.d(getter, { a: getter });
+/******/ return getter;
+/******/ };
+/******/ })();
+/******/
+/******/ /* webpack/runtime/define property getters */
+/******/ (() => {
+/******/ // define getter functions for harmony exports
+/******/ __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 */
+/******/ (() => {
+/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
+/******/ })();
+/******/
+/******/ /* webpack/runtime/make namespace object */
+/******/ (() => {
+/******/ // define __esModule on exports
+/******/ __webpack_require__.r = (exports) => {
+/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
+/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
+/******/ }
+/******/ Object.defineProperty(exports, '__esModule', { value: true });
+/******/ };
+/******/ })();
+/******/
+/************************************************************************/
+var __webpack_exports__ = {};
+// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
+(() => {
+/*!*************************************!*\
+ !*** ./src/editor-plugin/plugin.js ***!
+ \*************************************/
+__webpack_require__.r(__webpack_exports__);
+/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/editor */ "@wordpress/editor");
+/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_editor__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/edit-post */ "@wordpress/edit-post");
+/* harmony import */ var _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_edit_post__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/plugins */ "@wordpress/plugins");
+/* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_plugins__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/icon/index.js");
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/external.js");
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/globe.js");
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/people.js");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__);
+/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data");
+/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_9__);
+/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
+/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_10__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__);
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_12__);
+/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./utils */ "./src/editor-plugin/utils.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__);
+
+
+
+
+
+
+
+
+
+
+
+
+/**
+ * Editor plugin for ActivityPub settings in the block editor.
+ *
+ * @returns {React.JSX.Element|null} The settings panel for ActivityPub or null for sync blocks.
+ */
+
+const EditorPlugin = () => {
+ const postType = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_8__.useSelect)(select => select(_wordpress_editor__WEBPACK_IMPORTED_MODULE_0__.store).getCurrentPostType(), []);
+ const [meta, setMeta] = (0,_wordpress_core_data__WEBPACK_IMPORTED_MODULE_9__.useEntityProp)('postType', postType, 'meta');
+ const postDate = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_8__.useSelect)(select => select(_wordpress_editor__WEBPACK_IMPORTED_MODULE_0__.store).getCurrentPost().date, []);
+
+ // Don't show when editing sync blocks.
+ if ('wp_block' === postType) {
+ return null;
+ }
+
+ /**
+ * SVG for the not-allowed icon. Defining our own because it's too new in @wordpress/icons.
+ *
+ * @see https://github.com/WordPress/gutenberg/blob/trunk/packages/icons/src/library/not-allowed.js
+ *
+ * @var {React.JSX.Element} notAllowed The SVG for the not-allowed icon.
+ */
+ const notAllowed = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_12__.SVG, {
+ xmlns: "http://www.w3.org/2000/svg",
+ viewBox: "0 0 24 24",
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_12__.Path, {
+ fillRule: "evenodd",
+ clipRule: "evenodd",
+ d: "M12 18.5A6.5 6.5 0 0 1 6.93 7.931l9.139 9.138A6.473 6.473 0 0 1 12 18.5Zm5.123-2.498a6.5 6.5 0 0 0-9.124-9.124l9.124 9.124ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z"
+ })
+ });
+ const labelStyling = {
+ verticalAlign: 'middle',
+ gap: '4px',
+ justifyContent: 'start',
+ display: 'inline-flex',
+ alignItems: 'center'
+ };
+
+ /**
+ * Enhances a label with an icon and tooltip.
+ *
+ * @param {React.JSX.Element} icon The icon to display.
+ * @param {string} text The label text.
+ * @param {string} tooltip The tooltip text.
+ *
+ * @returns {React.JSX.Element} The enhanced label component.
+ */
+ const enhancedLabel = (icon, text, tooltip) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Tooltip, {
+ text: tooltip,
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.__experimentalText, {
+ style: labelStyling,
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_4__["default"], {
+ icon: icon
+ }), text]
+ })
+ });
+
+ /*
+ * Backwards compatibility with WordPress 6.5.
+ * @todo Remove when 6.5 is no longer supported.
+ */
+ const SettingsPanel = _wordpress_editor__WEBPACK_IMPORTED_MODULE_0__.PluginDocumentSettingPanel || _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_1__.PluginDocumentSettingPanel;
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)(SettingsPanel, {
+ name: "activitypub",
+ className: "block-editor-block-inspector",
+ title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Fediverse ⁂', 'activitypub'),
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.TextControl, {
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Content Warning', 'activitypub'),
+ value: meta?.activitypub_content_warning,
+ onChange: value => {
+ setMeta({
+ ...meta,
+ activitypub_content_warning: value
+ });
+ },
+ placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Optional content warning', 'activitypub'),
+ help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Content warnings do not change the content on your site, only in the fediverse.', 'activitypub'),
+ __next40pxDefaultSize: true,
+ __nextHasNoMarginBottom: true
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.RangeControl, {
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Maximum Image Attachments', 'activitypub'),
+ value: meta?.activitypub_max_image_attachments,
+ onChange: value => {
+ setMeta({
+ ...meta,
+ activitypub_max_image_attachments: value
+ });
+ },
+ min: 0,
+ max: 10,
+ help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Maximum number of image attachments to include when sharing to the fediverse.', 'activitypub'),
+ __next40pxDefaultSize: true,
+ __nextHasNoMarginBottom: true
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.RadioControl, {
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Visibility', 'activitypub'),
+ help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)("This adjusts the visibility of a post in the fediverse, but note that it won't affect how the post appears on the blog.", 'activitypub'),
+ selected: (0,_utils__WEBPACK_IMPORTED_MODULE_13__.getDefaultVisibility)(meta, postDate),
+ options: [{
+ label: enhancedLabel(_wordpress_icons__WEBPACK_IMPORTED_MODULE_6__["default"], (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Public', 'activitypub'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Post will be visible to everyone and appear in public timelines.', 'activitypub')),
+ value: 'public'
+ }, {
+ label: enhancedLabel(_wordpress_icons__WEBPACK_IMPORTED_MODULE_7__["default"], (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Quiet public', 'activitypub'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Post will be visible to everyone but will not appear in public timelines.', 'activitypub')),
+ value: 'quiet_public'
+ }, {
+ label: enhancedLabel(notAllowed, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Do not federate', 'activitypub'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Post will not be shared to the Fediverse.', 'activitypub')),
+ value: 'local'
+ }],
+ onChange: value => {
+ setMeta({
+ ...meta,
+ activitypub_content_visibility: value
+ });
+ },
+ className: "activitypub-visibility"
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.SelectControl, {
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Who can quote this post?', 'activitypub'),
+ help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Quoting allows others to cite your post while adding their own commentary.', 'activitypub'),
+ value: meta?.activitypub_interaction_policy_quote,
+ options: [{
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Anyone', 'activitypub'),
+ value: 'anyone'
+ }, {
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Followers only', 'activitypub'),
+ value: 'followers'
+ }, {
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Just me', 'activitypub'),
+ value: 'me'
+ }],
+ onChange: value => {
+ setMeta({
+ ...meta,
+ activitypub_interaction_policy_quote: value
+ });
+ },
+ __next40pxDefaultSize: true,
+ __nextHasNoMarginBottom: true
+ })]
+ });
+};
+
+/**
+ * Renders the preview menu item for Fediverse preview.
+ *
+ * @returns {React.JSX.Element} The preview menu item component.
+ */
+const EditorPreview = () => {
+ const post_status = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_8__.useSelect)(select => select(_wordpress_editor__WEBPACK_IMPORTED_MODULE_0__.store).getCurrentPost().status, []);
+
+ /**
+ * Opens the Fediverse preview for the current post in a new tab.
+ */
+ const onActivityPubPreview = () => {
+ const previewLink = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_8__.select)(_wordpress_editor__WEBPACK_IMPORTED_MODULE_0__.store).getEditedPostPreviewLink();
+ const fediversePreviewLink = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_10__.addQueryArgs)(previewLink, {
+ activitypub: 'true'
+ });
+ window.open(fediversePreviewLink, '_blank');
+ };
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.Fragment, {
+ children: _wordpress_editor__WEBPACK_IMPORTED_MODULE_0__.PluginPreviewMenuItem ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_editor__WEBPACK_IMPORTED_MODULE_0__.PluginPreviewMenuItem, {
+ onClick: onActivityPubPreview,
+ icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__["default"],
+ disabled: post_status === 'auto-draft',
+ children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Fediverse preview ⁂', 'activitypub')
+ }) : null
+ });
+};
+(0,_wordpress_plugins__WEBPACK_IMPORTED_MODULE_2__.registerPlugin)('activitypub-editor-plugin', {
+ render: EditorPlugin
+});
+(0,_wordpress_plugins__WEBPACK_IMPORTED_MODULE_2__.registerPlugin)('activitypub-editor-preview', {
+ render: EditorPreview
+});
+})();
+
+/******/ })()
+;
+//# sourceMappingURL=plugin.js.map
\ No newline at end of file
diff --git a/build/extra-fields/index.asset.php b/build/extra-fields/index.asset.php
index a2fa23f686..bcf3891318 100644
--- a/build/extra-fields/index.asset.php
+++ b/build/extra-fields/index.asset.php
@@ -1 +1 @@
- array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '6f7cc2955f584ad618ba');
+ array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '64ca4987a63ea444abd3');
diff --git a/build/extra-fields/index.js b/build/extra-fields/index.js
index c34ddc779f..a5679680ab 100644
--- a/build/extra-fields/index.js
+++ b/build/extra-fields/index.js
@@ -1,2 +1,736 @@
-(()=>{"use strict";var e,t={157:(e,t,i)=>{const r=window.wp.blocks,s=window.wp.i18n,l=window.wp.blockEditor,n=window.wp.components,a=window.wp.data,o=window.wp.element,c=window.wp.apiFetch;var d=i.n(c);function u(){return window._activityPubOptions||{}}const p=window.ReactJSXRuntime,h=JSON.parse('{"UU":"activitypub/extra-fields"}');(0,r.registerBlockType)(h.UU,{edit:function({attributes:e,setAttributes:t,context:i}){const{selectedUser:r,maxFields:c}=e,{postId:h,postType:v}=null!=i?i:{},[b,y]=(0,o.useState)([]),[f,x]=(0,o.useState)(!1),[g,w]=(0,o.useState)(null),m=(0,a.useSelect)(e=>{const t=e("core/editor"),i=e("core");if(h&&v&&i){var r,s;const e=null!==(r=i.getEditedEntityRecord?.("postType",v,h))&&void 0!==r?r:null;if(e?.author)return e.author;const t=null!==(s=i.getEntityRecord?.("postType",v,h))&&void 0!==s?s:null;if(t?.author)return t.author}return t&&t.getCurrentPostAttribute?t.getCurrentPostAttribute("author"):null},[h,v]),_="blog"===r?0:"inherit"===r?m||null:r,{namespace:j="activitypub/1.0",profileUrls:k={}}=u(),U="blog"===r?k.blog:k.user,F=(0,l.useBlockProps)({className:"activitypub-extra-fields-block-wrapper"}),C=function({withInherit:e=!1}){const{enabled:t,namespace:i}=u(),[r,l]=(0,o.useState)(!1),{fetchedUsers:n,isLoadingUsers:c}=(0,a.useSelect)(e=>{const{getUsers:i,getIsResolving:r}=e("core");return{fetchedUsers:t?.users?i({capabilities:"activitypub"}):null,isLoadingUsers:!!t?.users&&r("getUsers",[{capabilities:"activitypub"}])}},[]),p=(0,a.useSelect)(e=>n||c?null:e("core").getCurrentUser(),[n,c]);(0,o.useEffect)(()=>{n||c||!p||d()({path:`/${i}/actors/${p.id}`,method:"HEAD",headers:{Accept:"application/activity+json"},parse:!1}).then(()=>l(!0)).catch(()=>l(!1))},[n,c,p]);const h=n||(p&&r?[{id:p.id,name:p.name}]:[]);return(0,o.useMemo)(()=>{if(!h.length)return[];const i=[];return t?.blog&&n&&i.push({label:(0,s.__)("Blog","activitypub"),value:"blog"}),e&&t?.users&&n&&i.push({label:(0,s.__)("Dynamic User","activitypub"),value:"inherit"}),h.reduce((e,t)=>(e.push({label:t.name,value:`${t.id}`}),e),i)},[h])}({withInherit:!0});(0,o.useEffect)(()=>{null!==_?(x(!0),w(null),d()({path:`/${j}/actors/${_}`,headers:{Accept:"application/activity+json"}}).then(e=>{const t=(e.attachment||[]).filter(e=>"PropertyValue"===e.type);y(t),x(!1)}).catch(e=>{w(e.message),x(!1)})):y([])},[_,j]);const O=c>0?b.slice(0,c):b,E=(()=>{const t=e.className?.includes("is-style-cards");if(!t)return{};const i=e.style||{},r=e.backgroundColor,s=i.color?.background;return r?{backgroundColor:`var(--wp--preset--color--${r})`}:s?{backgroundColor:s}:{}})(),S=(0,p.jsx)(l.InspectorControls,{children:(0,p.jsxs)(n.PanelBody,{title:(0,s.__)("Settings","activitypub"),initialOpen:!0,children:[(0,p.jsx)(n.SelectControl,{label:(0,s.__)("User","activitypub"),value:r,options:C,onChange:e=>t({selectedUser:e})}),(0,p.jsx)(n.RangeControl,{label:(0,s.__)("Maximum Fields","activitypub"),value:c,onChange:e=>t({maxFields:e}),min:0,max:20,help:(0,s.__)("Limit the number of fields displayed. 0 = show all.","activitypub")})]})});return"inherit"!==r||m?f?(0,p.jsx)("div",{...F,children:(0,p.jsx)(n.Placeholder,{label:(0,s.__)("Fediverse Extra Fields","activitypub"),children:(0,p.jsx)(n.Spinner,{})})}):g?(0,p.jsx)("div",{...F,children:(0,p.jsx)(n.Placeholder,{label:(0,s.__)("Fediverse Extra Fields","activitypub"),children:(0,p.jsx)("p",{children:(0,s.sprintf)(/* translators: %s: Error message */ /* translators: %s: Error message */
-(0,s.__)("Error loading extra fields: %s","activitypub"),g)})})}):0===O.length?(0,p.jsxs)(p.Fragment,{children:[S,(0,p.jsx)("div",{...F,children:(0,p.jsx)(n.Placeholder,{label:(0,s.__)("Fediverse Extra Fields","activitypub"),children:(0,p.jsxs)("p",{children:[(0,s.__)("No extra fields found.","activitypub")," ",U&&(0,p.jsx)(n.Button,{variant:"link",onClick:()=>{window.location.href=U},children:(0,s.__)("Add fields in your profile settings","activitypub")})]})})})]}):(0,p.jsxs)(p.Fragment,{children:[S,(0,p.jsx)("div",{...F,children:(0,p.jsx)("dl",{className:"activitypub-extra-fields",children:O.map(e=>(0,p.jsxs)("div",{className:"activitypub-extra-field",style:E,children:[(0,p.jsx)("dt",{children:e.name}),(0,p.jsx)("dd",{dangerouslySetInnerHTML:{__html:e.value}})]},`${e.name}-${e.value}`))})})]}):(0,p.jsxs)(p.Fragment,{children:[S,(0,p.jsx)("div",{...F,children:(0,p.jsx)(n.Placeholder,{label:(0,s.__)("Fediverse Extra Fields","activitypub"),children:(0,p.jsx)("p",{children:(0,s.__)("This block will display extra fields based on the post author when published.","activitypub")})})})]})},save:()=>null})}},i={};function r(e){var s=i[e];if(void 0!==s)return s.exports;var l=i[e]={exports:{}};return t[e](l,l.exports,r),l.exports}r.m=t,e=[],r.O=(t,i,s,l)=>{if(!i){var n=1/0;for(d=0;d=l)&&Object.keys(r.O).every(e=>r.O[e](i[o]))?i.splice(o--,1):(a=!1,l0&&e[d-1][2]>l;d--)e[d]=e[d-1];e[d]=[i,s,l]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={914:0,678:0};r.O.j=t=>0===e[t];var t=(t,i)=>{var s,l,[n,a,o]=i,c=0;if(n.some(t=>0!==e[t])){for(s in a)r.o(a,s)&&(r.m[s]=a[s]);if(o)var d=o(r)}for(t&&t(i);cr(157));s=r.O(s)})();
\ No newline at end of file
+/******/ (() => { // webpackBootstrap
+/******/ "use strict";
+/******/ var __webpack_modules__ = ({
+
+/***/ "./src/extra-fields/block.json":
+/*!*************************************!*\
+ !*** ./src/extra-fields/block.json ***!
+ \*************************************/
+/***/ ((module) => {
+
+module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","name":"activitypub/extra-fields","apiVersion":3,"version":"1.0.0","title":"Fediverse Extra Fields","category":"widgets","description":"Display extra fields from ActivityPub user profiles","textdomain":"activitypub","icon":"list-view","supports":{"html":false,"align":["wide","full"],"color":{"gradients":true,"link":true,"__experimentalDefaultControls":{"background":true,"text":true,"link":true}},"__experimentalBorder":{"radius":true,"width":true,"color":true,"style":true},"shadow":true,"typography":{"fontSize":true,"__experimentalDefaultControls":{"fontSize":true}}},"styles":[{"name":"compact","label":"Compact","isDefault":true},{"name":"stacked","label":"Stacked"},{"name":"cards","label":"Cards"}],"attributes":{"selectedUser":{"type":"string","default":"blog"},"maxFields":{"type":"number","default":0}},"usesContext":["postType","postId"],"editorScript":"file:./index.js","style":"file:./style-index.css","render":"file:./render.php"}');
+
+/***/ }),
+
+/***/ "./src/extra-fields/edit.js":
+/*!**********************************!*\
+ !*** ./src/extra-fields/edit.js ***!
+ \**********************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ Edit)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
+/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__);
+/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
+/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_5__);
+/* harmony import */ var _shared_use_options__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../shared/use-options */ "./src/shared/use-options.js");
+/* harmony import */ var _shared_use_user_options__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../shared/use-user-options */ "./src/shared/use-user-options.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__);
+/**
+ * WordPress dependencies
+ */
+
+
+
+
+
+
+
+/**
+ * Internal dependencies
+ */
+
+
+
+/**
+ * Editor component for Extra Fields block.
+ *
+ * @param {Object} props Component props.
+ * @param {Object} props.attributes Block attributes.
+ * @param {Function} props.setAttributes Function to set attributes.
+ * @param {Object} props.context Block context.
+ * @return {Element} Component element.
+ */
+
+function Edit({
+ attributes,
+ setAttributes,
+ context
+}) {
+ const {
+ selectedUser,
+ maxFields
+ } = attributes;
+ const {
+ postId: contextPostId,
+ postType: contextPostType
+ } = context !== null && context !== void 0 ? context : {};
+ const [fields, setFields] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)([]);
+ const [isLoading, setIsLoading] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)(false);
+ const [error, setError] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)(null);
+
+ // Get author ID from context or current post depending on editor.
+ const authorId = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
+ const editorStore = select('core/editor');
+ const coreStore = select('core');
+ if (contextPostId && contextPostType && coreStore) {
+ var _coreStore$getEditedE, _coreStore$getEntityR;
+ const editedRecord = (_coreStore$getEditedE = coreStore.getEditedEntityRecord?.('postType', contextPostType, contextPostId)) !== null && _coreStore$getEditedE !== void 0 ? _coreStore$getEditedE : null;
+ if (editedRecord?.author) {
+ return editedRecord.author;
+ }
+ const record = (_coreStore$getEntityR = coreStore.getEntityRecord?.('postType', contextPostType, contextPostId)) !== null && _coreStore$getEntityR !== void 0 ? _coreStore$getEntityR : null;
+ if (record?.author) {
+ return record.author;
+ }
+ }
+ if (editorStore && editorStore.getCurrentPostAttribute) {
+ return editorStore.getCurrentPostAttribute('author');
+ }
+ return null;
+ }, [contextPostId, contextPostType]);
+
+ // Determine which user ID to fetch
+ const getUserId = () => {
+ if (selectedUser === 'blog') {
+ return 0;
+ }
+ if (selectedUser === 'inherit') {
+ if (authorId) {
+ return authorId;
+ }
+ return null;
+ }
+ return selectedUser;
+ };
+ const userId = getUserId();
+
+ // Get ActivityPub options
+ const {
+ namespace = 'activitypub/1.0',
+ profileUrls = {}
+ } = (0,_shared_use_options__WEBPACK_IMPORTED_MODULE_6__.useOptions)();
+
+ // Select profile settings URL based on user type
+ const profileUrl = selectedUser === 'blog' ? profileUrls.blog : profileUrls.user;
+ const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
+ className: 'activitypub-extra-fields-block-wrapper'
+ });
+
+ // Get user options for dropdown
+ const userOptions = (0,_shared_use_user_options__WEBPACK_IMPORTED_MODULE_7__.useUserOptions)({
+ withInherit: true
+ });
+
+ // Fetch extra fields
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
+ if (userId === null) {
+ setFields([]);
+ return;
+ }
+ setIsLoading(true);
+ setError(null);
+ _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_5___default()({
+ path: `/${namespace}/actors/${userId}`,
+ headers: {
+ Accept: 'application/activity+json'
+ }
+ }).then(actor => {
+ // Extract fields from attachment array
+ const attachments = actor.attachment || [];
+ // Filter to only PropertyValue types (the main format)
+ const propertyValues = attachments.filter(item => item.type === 'PropertyValue');
+ setFields(propertyValues);
+ setIsLoading(false);
+ }).catch(err => {
+ setError(err.message);
+ setIsLoading(false);
+ });
+ }, [userId, namespace]);
+
+ // Apply max fields limit for preview
+ const displayFields = maxFields > 0 ? fields.slice(0, maxFields) : fields;
+
+ // Extract background color for cards style
+ const getCardStyle = () => {
+ const isCardsStyle = attributes.className?.includes('is-style-cards');
+ if (!isCardsStyle) {
+ return {};
+ }
+
+ // Get background color from block attributes
+ const style = attributes.style || {};
+ const backgroundColor = attributes.backgroundColor;
+ const customColor = style.color?.background;
+ if (backgroundColor) {
+ return {
+ backgroundColor: `var(--wp--preset--color--${backgroundColor})`
+ };
+ } else if (customColor) {
+ return {
+ backgroundColor: customColor
+ };
+ }
+ return {};
+ };
+ const cardStyle = getCardStyle();
+ const settingsPanel = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, {
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, {
+ title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Settings', 'activitypub'),
+ initialOpen: true,
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.SelectControl, {
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('User', 'activitypub'),
+ value: selectedUser,
+ options: userOptions,
+ onChange: value => setAttributes({
+ selectedUser: value
+ })
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.RangeControl, {
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Maximum Fields', 'activitypub'),
+ value: maxFields,
+ onChange: value => setAttributes({
+ maxFields: value
+ }),
+ min: 0,
+ max: 20,
+ help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Limit the number of fields displayed. 0 = show all.', 'activitypub')
+ })]
+ })
+ });
+
+ // Render placeholder if inherit mode but no author. Keep controls mounted for recovery.
+ if (selectedUser === 'inherit' && !authorId) {
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.Fragment, {
+ children: [settingsPanel, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
+ ...blockProps,
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Placeholder, {
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Fediverse Extra Fields', 'activitypub'),
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("p", {
+ children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This block will display extra fields based on the post author when published.', 'activitypub')
+ })
+ })
+ })]
+ });
+ }
+
+ // Render loading state
+ if (isLoading) {
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
+ ...blockProps,
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Placeholder, {
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Fediverse Extra Fields', 'activitypub'),
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Spinner, {})
+ })
+ });
+ }
+
+ // Render error state
+ if (error) {
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
+ ...blockProps,
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Placeholder, {
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Fediverse Extra Fields', 'activitypub'),
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("p", {
+ children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %s: Error message */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Error loading extra fields: %s', 'activitypub'), error)
+ })
+ })
+ });
+ }
+
+ // Render empty state
+ if (displayFields.length === 0) {
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.Fragment, {
+ children: [settingsPanel, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
+ ...blockProps,
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Placeholder, {
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Fediverse Extra Fields', 'activitypub'),
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("p", {
+ children: [(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('No extra fields found.', 'activitypub'), ' ', profileUrl && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
+ variant: "link",
+ onClick: () => {
+ window.location.href = profileUrl;
+ },
+ children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add fields in your profile settings', 'activitypub')
+ })]
+ })
+ })
+ })]
+ });
+ }
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.Fragment, {
+ children: [settingsPanel, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
+ ...blockProps,
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("dl", {
+ className: "activitypub-extra-fields",
+ children: displayFields.map(field => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
+ className: "activitypub-extra-field",
+ style: cardStyle,
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("dt", {
+ children: field.name
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("dd", {
+ dangerouslySetInnerHTML: {
+ __html: field.value
+ }
+ })]
+ }, `${field.name}-${field.value}`))
+ })
+ })]
+ });
+}
+
+/***/ }),
+
+/***/ "./src/extra-fields/index.js":
+/*!***********************************!*\
+ !*** ./src/extra-fields/index.js ***!
+ \***********************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
+/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./edit */ "./src/extra-fields/edit.js");
+/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./block.json */ "./src/extra-fields/block.json");
+/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./style.scss */ "./src/extra-fields/style.scss");
+/**
+ * WordPress dependencies
+ */
+
+
+/**
+ * Internal dependencies
+ */
+
+
+
+
+/**
+ * Register the Extra Fields block.
+ *
+ * This block uses server-side rendering, so the save function returns null.
+ */
+(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_2__.name, {
+ edit: _edit__WEBPACK_IMPORTED_MODULE_1__["default"],
+ save: () => null
+});
+
+/***/ }),
+
+/***/ "./src/extra-fields/style.scss":
+/*!*************************************!*\
+ !*** ./src/extra-fields/style.scss ***!
+ \*************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+// extracted by mini-css-extract-plugin
+
+
+/***/ }),
+
+/***/ "./src/shared/use-options.js":
+/*!***********************************!*\
+ !*** ./src/shared/use-options.js ***!
+ \***********************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ useOptions: () => (/* binding */ useOptions)
+/* harmony export */ });
+/**
+ * React hook to return the ActivityPub options object from the global window.
+ *
+ * @returns {Object} The options object.
+ */
+function useOptions() {
+ return window._activityPubOptions || {};
+}
+
+/***/ }),
+
+/***/ "./src/shared/use-user-options.js":
+/*!****************************************!*\
+ !*** ./src/shared/use-user-options.js ***!
+ \****************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ useUserOptions: () => (/* binding */ useUserOptions)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
+/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _use_options__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./use-options */ "./src/shared/use-options.js");
+
+
+
+
+
+
+/**
+ * React hook providing user options for ActivityPub blocks.
+ *
+ * @param {Object} params
+ * @param {boolean} params.withInherit - Whether to include the inherit option.
+ * @returns {Array} List of user option objects.
+ */
+function useUserOptions({
+ withInherit = false
+}) {
+ /**
+ * ActivityPub options.
+ *
+ * @type {Object}
+ * @property {boolean} enabled.users - Whether users are enabled.
+ * @property {boolean} enabled.blog - Whether the blog user is enabled.
+ */
+ const {
+ enabled,
+ namespace
+ } = (0,_use_options__WEBPACK_IMPORTED_MODULE_4__.useOptions)();
+ const [currentUserCanActivityPub, setCurrentUserCanActivityPub] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
+ const {
+ fetchedUsers,
+ isLoadingUsers
+ } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
+ const {
+ getUsers,
+ getIsResolving
+ } = select('core');
+ return {
+ fetchedUsers: enabled?.users ? getUsers({
+ capabilities: 'activitypub'
+ }) : null,
+ isLoadingUsers: enabled?.users ? getIsResolving('getUsers', [{
+ capabilities: 'activitypub'
+ }]) : false
+ };
+ }, []);
+
+ // Only fetch current user if fetchedUsers is empty and we're not still loading.
+ const currentUser = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => fetchedUsers || isLoadingUsers ? null : select('core').getCurrentUser(), [fetchedUsers, isLoadingUsers]);
+
+ // Test if current user has activitypub capability by trying to access their actor endpoint.
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
+ if (fetchedUsers || isLoadingUsers || !currentUser) {
+ return;
+ }
+ _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3___default()({
+ path: `/${namespace}/actors/${currentUser.id}`,
+ method: 'HEAD',
+ headers: {
+ Accept: 'application/activity+json'
+ },
+ parse: false
+ }).then(() => setCurrentUserCanActivityPub(true)).catch(() => setCurrentUserCanActivityPub(false));
+ }, [fetchedUsers, isLoadingUsers, currentUser]);
+ const users = fetchedUsers || (currentUser && currentUserCanActivityPub ? [{
+ id: currentUser.id,
+ name: currentUser.name
+ }] : []);
+
+ /**
+ * Memoized computation of user options for block settings.
+ */
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
+ if (!users.length) {
+ return [];
+ }
+ const userKeywords = [];
+ if (enabled?.blog && fetchedUsers) {
+ userKeywords.push({
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Blog', 'activitypub'),
+ value: 'blog'
+ });
+ }
+
+ // Only show the inherit option when explicitly asked for and users are enabled.
+ if (withInherit && enabled?.users && fetchedUsers) {
+ userKeywords.push({
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Dynamic User', 'activitypub'),
+ value: 'inherit'
+ });
+ }
+
+ /**
+ * Reduce users into keyword/value pairs for options.
+ */
+ return users.reduce((acc, user) => {
+ acc.push({
+ label: user.name,
+ value: `${user.id}` // Casting to string because that's how Gutenberg stores the attribute.
+ });
+ return acc;
+ }, userKeywords);
+ }, [users]);
+}
+
+/***/ }),
+
+/***/ "@wordpress/api-fetch":
+/*!**********************************!*\
+ !*** external ["wp","apiFetch"] ***!
+ \**********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["apiFetch"];
+
+/***/ }),
+
+/***/ "@wordpress/block-editor":
+/*!*************************************!*\
+ !*** external ["wp","blockEditor"] ***!
+ \*************************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["blockEditor"];
+
+/***/ }),
+
+/***/ "@wordpress/blocks":
+/*!********************************!*\
+ !*** external ["wp","blocks"] ***!
+ \********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["blocks"];
+
+/***/ }),
+
+/***/ "@wordpress/components":
+/*!************************************!*\
+ !*** external ["wp","components"] ***!
+ \************************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["components"];
+
+/***/ }),
+
+/***/ "@wordpress/data":
+/*!******************************!*\
+ !*** external ["wp","data"] ***!
+ \******************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["data"];
+
+/***/ }),
+
+/***/ "@wordpress/element":
+/*!*********************************!*\
+ !*** external ["wp","element"] ***!
+ \*********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["element"];
+
+/***/ }),
+
+/***/ "@wordpress/i18n":
+/*!******************************!*\
+ !*** external ["wp","i18n"] ***!
+ \******************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["i18n"];
+
+/***/ }),
+
+/***/ "react/jsx-runtime":
+/*!**********************************!*\
+ !*** external "ReactJSXRuntime" ***!
+ \**********************************/
+/***/ ((module) => {
+
+module.exports = window["ReactJSXRuntime"];
+
+/***/ })
+
+/******/ });
+/************************************************************************/
+/******/ // The module cache
+/******/ var __webpack_module_cache__ = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/ // Check if module is in cache
+/******/ var cachedModule = __webpack_module_cache__[moduleId];
+/******/ if (cachedModule !== undefined) {
+/******/ return cachedModule.exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = __webpack_module_cache__[moduleId] = {
+/******/ // no module.id needed
+/******/ // no module.loaded needed
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = __webpack_modules__;
+/******/
+/************************************************************************/
+/******/ /* webpack/runtime/chunk loaded */
+/******/ (() => {
+/******/ var deferred = [];
+/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
+/******/ if(chunkIds) {
+/******/ priority = priority || 0;
+/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
+/******/ deferred[i] = [chunkIds, fn, priority];
+/******/ return;
+/******/ }
+/******/ var notFulfilled = Infinity;
+/******/ for (var i = 0; i < deferred.length; i++) {
+/******/ var [chunkIds, fn, priority] = deferred[i];
+/******/ var fulfilled = true;
+/******/ for (var j = 0; j < chunkIds.length; j++) {
+/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
+/******/ chunkIds.splice(j--, 1);
+/******/ } else {
+/******/ fulfilled = false;
+/******/ if(priority < notFulfilled) notFulfilled = priority;
+/******/ }
+/******/ }
+/******/ if(fulfilled) {
+/******/ deferred.splice(i--, 1)
+/******/ var r = fn();
+/******/ if (r !== undefined) result = r;
+/******/ }
+/******/ }
+/******/ return result;
+/******/ };
+/******/ })();
+/******/
+/******/ /* webpack/runtime/compat get default export */
+/******/ (() => {
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = (module) => {
+/******/ var getter = module && module.__esModule ?
+/******/ () => (module['default']) :
+/******/ () => (module);
+/******/ __webpack_require__.d(getter, { a: getter });
+/******/ return getter;
+/******/ };
+/******/ })();
+/******/
+/******/ /* webpack/runtime/define property getters */
+/******/ (() => {
+/******/ // define getter functions for harmony exports
+/******/ __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 */
+/******/ (() => {
+/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
+/******/ })();
+/******/
+/******/ /* webpack/runtime/make namespace object */
+/******/ (() => {
+/******/ // define __esModule on 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/jsonp chunk loading */
+/******/ (() => {
+/******/ // no baseURI
+/******/
+/******/ // object to store loaded and loading chunks
+/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
+/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
+/******/ var installedChunks = {
+/******/ "extra-fields/index": 0,
+/******/ "extra-fields/style-index": 0
+/******/ };
+/******/
+/******/ // no chunk on demand loading
+/******/
+/******/ // no prefetching
+/******/
+/******/ // no preloaded
+/******/
+/******/ // no HMR
+/******/
+/******/ // no HMR manifest
+/******/
+/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
+/******/
+/******/ // install a JSONP callback for chunk loading
+/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
+/******/ var [chunkIds, moreModules, runtime] = data;
+/******/ // add "moreModules" to the modules object,
+/******/ // then flag all "chunkIds" as loaded and fire callback
+/******/ var moduleId, chunkId, i = 0;
+/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
+/******/ for(moduleId in moreModules) {
+/******/ if(__webpack_require__.o(moreModules, moduleId)) {
+/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
+/******/ }
+/******/ }
+/******/ if(runtime) var result = runtime(__webpack_require__);
+/******/ }
+/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
+/******/ for(;i < chunkIds.length; i++) {
+/******/ chunkId = chunkIds[i];
+/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
+/******/ installedChunks[chunkId][0]();
+/******/ }
+/******/ installedChunks[chunkId] = 0;
+/******/ }
+/******/ return __webpack_require__.O(result);
+/******/ }
+/******/
+/******/ var chunkLoadingGlobal = globalThis["webpackChunkwordpress_activitypub"] = globalThis["webpackChunkwordpress_activitypub"] || [];
+/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
+/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
+/******/ })();
+/******/
+/************************************************************************/
+/******/
+/******/ // startup
+/******/ // Load entry module and return exports
+/******/ // This entry module depends on other loaded chunks and execution need to be delayed
+/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["extra-fields/style-index"], () => (__webpack_require__("./src/extra-fields/index.js")))
+/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
+/******/
+/******/ })()
+;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/build/extra-fields/style-index-rtl.css b/build/extra-fields/style-index-rtl.css
index 4f1e363b32..0232e06b2e 100644
--- a/build/extra-fields/style-index-rtl.css
+++ b/build/extra-fields/style-index-rtl.css
@@ -1 +1,142 @@
-.activitypub-extra-fields-block-wrapper.has-background .activitypub-extra-fields,.activitypub-extra-fields-block-wrapper.has-border .activitypub-extra-fields,.activitypub-extra-fields-block-wrapper.is-style-stacked.has-background .activitypub-extra-fields,.activitypub-extra-fields-block-wrapper.is-style-stacked.has-border .activitypub-extra-fields{padding:1rem}.activitypub-extra-fields-block-wrapper.is-style-cards.has-background .activitypub-extra-fields,.activitypub-extra-fields-block-wrapper.is-style-cards.has-border .activitypub-extra-fields{padding:0}.activitypub-extra-fields{display:table;list-style:none;margin:0;padding:0;table-layout:fixed}.activitypub-extra-field{display:table-row;margin-bottom:0}.activitypub-extra-field dt{color:inherit;display:table-cell;font-weight:600;margin-bottom:0;padding-bottom:.5em;padding-left:10px;text-overflow:ellipsis;vertical-align:baseline;white-space:nowrap}.activitypub-extra-field dt:after{content:":"}.activitypub-extra-field dd{color:inherit;display:table-cell;margin-bottom:0;margin-right:0;padding-bottom:.5em;vertical-align:baseline;word-break:break-word}.activitypub-extra-field dd p{margin-bottom:.5em;margin-top:0}.activitypub-extra-field dd p:last-child{margin-bottom:0}.activitypub-extra-field dd a{color:inherit;text-decoration:underline}.activitypub-extra-field dd a:hover{text-decoration:none}.is-style-stacked .activitypub-extra-fields{display:block;table-layout:auto}.is-style-stacked .activitypub-extra-field{display:block;margin-bottom:1em}.is-style-stacked .activitypub-extra-field:last-child{margin-bottom:0}.is-style-stacked .activitypub-extra-field dt{display:block;margin-bottom:.25em;padding-bottom:0;padding-left:0;text-overflow:clip;white-space:normal}.is-style-stacked .activitypub-extra-field dt:after{content:none}.is-style-stacked .activitypub-extra-field dd{display:block;padding-bottom:0}.is-style-cards.has-background{background:transparent!important}.is-style-cards.has-background .activitypub-extra-fields{padding:1rem}.is-style-cards .activitypub-extra-fields{display:block;table-layout:auto}.is-style-cards .activitypub-extra-field{background:var(--wp--preset--color--base,#fff);border:1px solid var(--wp--preset--color--contrast-2,#ddd);border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.05);display:block;margin-bottom:1em;padding:1em}.is-style-cards .activitypub-extra-field:last-child{margin-bottom:0}.is-style-cards .activitypub-extra-field dt{color:currentColor;display:block;font-size:.9em;letter-spacing:.5px;margin-bottom:.5em;padding-bottom:0;padding-left:0;text-transform:uppercase;white-space:normal}.is-style-cards .activitypub-extra-field dt:after{content:none}.is-style-cards .activitypub-extra-field dd{display:block;font-size:1em;padding-bottom:0}
+/*!****************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/extra-fields/style.scss ***!
+ \****************************************************************************************************************************************************************************************************************************************************/
+/**
+ * Styles for the Extra Fields block.
+ */
+.activitypub-extra-fields-block-wrapper.has-background .activitypub-extra-fields, .activitypub-extra-fields-block-wrapper.has-border .activitypub-extra-fields, .activitypub-extra-fields-block-wrapper.is-style-stacked.has-background .activitypub-extra-fields, .activitypub-extra-fields-block-wrapper.is-style-stacked.has-border .activitypub-extra-fields {
+ padding: 1rem;
+}
+.activitypub-extra-fields-block-wrapper.is-style-cards.has-background .activitypub-extra-fields, .activitypub-extra-fields-block-wrapper.is-style-cards.has-border .activitypub-extra-fields {
+ padding: 0;
+}
+.activitypub-extra-fields {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+/**
+ * Default Compact Style
+ * Displays fields in a table-like format with aligned labels and values.
+ * This is the default style, so it applies without a style class.
+ */
+.activitypub-extra-fields {
+ display: table;
+ table-layout: fixed;
+}
+.activitypub-extra-field {
+ display: table-row;
+ margin-bottom: 0;
+}
+.activitypub-extra-field dt {
+ display: table-cell;
+ padding-bottom: 0.5em;
+ margin-bottom: 0;
+ padding-left: 10px;
+ white-space: nowrap;
+ vertical-align: baseline;
+ text-overflow: ellipsis;
+ font-weight: 600;
+ color: inherit;
+}
+.activitypub-extra-field dt::after {
+ content: ":";
+}
+.activitypub-extra-field dd {
+ display: table-cell;
+ padding-bottom: 0.5em;
+ vertical-align: baseline;
+ word-break: break-word;
+ margin-right: 0;
+ margin-bottom: 0;
+ color: inherit;
+}
+.activitypub-extra-field dd p {
+ margin-top: 0;
+ margin-bottom: 0.5em;
+}
+.activitypub-extra-field dd p:last-child {
+ margin-bottom: 0;
+}
+.activitypub-extra-field dd a {
+ color: inherit;
+ text-decoration: underline;
+}
+.activitypub-extra-field dd a:hover {
+ text-decoration: none;
+}
+/**
+ * Stacked Style
+ * Displays fields in a stacked format with label on top and value below.
+ */
+.is-style-stacked .activitypub-extra-fields {
+ display: block;
+ table-layout: auto;
+}
+.is-style-stacked .activitypub-extra-field {
+ display: block;
+ margin-bottom: 1em;
+}
+.is-style-stacked .activitypub-extra-field:last-child {
+ margin-bottom: 0;
+}
+.is-style-stacked .activitypub-extra-field dt {
+ display: block;
+ padding-bottom: 0;
+ padding-left: 0;
+ margin-bottom: 0.25em;
+ white-space: normal;
+ text-overflow: clip;
+}
+.is-style-stacked .activitypub-extra-field dt::after {
+ content: none;
+}
+.is-style-stacked .activitypub-extra-field dd {
+ display: block;
+ padding-bottom: 0;
+}
+/**
+ * Cards Style
+ * Displays each field in its own bordered card with padding.
+ */
+.is-style-cards.has-background {
+ background: transparent !important;
+}
+.is-style-cards.has-background .activitypub-extra-fields {
+ padding: 1rem;
+}
+.is-style-cards .activitypub-extra-fields {
+ display: block;
+ table-layout: auto;
+}
+.is-style-cards .activitypub-extra-field {
+ display: block;
+ border: 1px solid var(--wp--preset--color--contrast-2, #ddd);
+ border-radius: 8px;
+ padding: 1em;
+ margin-bottom: 1em;
+ background: var(--wp--preset--color--base, #fff);
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
+}
+.is-style-cards .activitypub-extra-field:last-child {
+ margin-bottom: 0;
+}
+.is-style-cards .activitypub-extra-field dt {
+ display: block;
+ font-size: 0.9em;
+ text-transform: uppercase;
+ letter-spacing: 0.5px;
+ color: currentColor;
+ margin-bottom: 0.5em;
+ padding-bottom: 0;
+ padding-left: 0;
+ white-space: normal;
+}
+.is-style-cards .activitypub-extra-field dt::after {
+ content: none;
+}
+.is-style-cards .activitypub-extra-field dd {
+ display: block;
+ font-size: 1em;
+ padding-bottom: 0;
+}
diff --git a/build/extra-fields/style-index.css b/build/extra-fields/style-index.css
index 2c8cd64fa1..28022321be 100644
--- a/build/extra-fields/style-index.css
+++ b/build/extra-fields/style-index.css
@@ -1 +1,144 @@
-.activitypub-extra-fields-block-wrapper.has-background .activitypub-extra-fields,.activitypub-extra-fields-block-wrapper.has-border .activitypub-extra-fields,.activitypub-extra-fields-block-wrapper.is-style-stacked.has-background .activitypub-extra-fields,.activitypub-extra-fields-block-wrapper.is-style-stacked.has-border .activitypub-extra-fields{padding:1rem}.activitypub-extra-fields-block-wrapper.is-style-cards.has-background .activitypub-extra-fields,.activitypub-extra-fields-block-wrapper.is-style-cards.has-border .activitypub-extra-fields{padding:0}.activitypub-extra-fields{display:table;list-style:none;margin:0;padding:0;table-layout:fixed}.activitypub-extra-field{display:table-row;margin-bottom:0}.activitypub-extra-field dt{color:inherit;display:table-cell;font-weight:600;margin-bottom:0;padding-bottom:.5em;padding-right:10px;text-overflow:ellipsis;vertical-align:baseline;white-space:nowrap}.activitypub-extra-field dt:after{content:":"}.activitypub-extra-field dd{color:inherit;display:table-cell;margin-bottom:0;margin-left:0;padding-bottom:.5em;vertical-align:baseline;word-break:break-word}.activitypub-extra-field dd p{margin-bottom:.5em;margin-top:0}.activitypub-extra-field dd p:last-child{margin-bottom:0}.activitypub-extra-field dd a{color:inherit;text-decoration:underline}.activitypub-extra-field dd a:hover{text-decoration:none}.is-style-stacked .activitypub-extra-fields{display:block;table-layout:auto}.is-style-stacked .activitypub-extra-field{display:block;margin-bottom:1em}.is-style-stacked .activitypub-extra-field:last-child{margin-bottom:0}.is-style-stacked .activitypub-extra-field dt{display:block;margin-bottom:.25em;padding-bottom:0;padding-right:0;text-overflow:clip;white-space:normal}.is-style-stacked .activitypub-extra-field dt:after{content:none}.is-style-stacked .activitypub-extra-field dd{display:block;padding-bottom:0}.is-style-cards.has-background{background:transparent!important}.is-style-cards.has-background .activitypub-extra-fields{padding:1rem}.is-style-cards .activitypub-extra-fields{display:block;table-layout:auto}.is-style-cards .activitypub-extra-field{background:var(--wp--preset--color--base,#fff);border:1px solid var(--wp--preset--color--contrast-2,#ddd);border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.05);display:block;margin-bottom:1em;padding:1em}.is-style-cards .activitypub-extra-field:last-child{margin-bottom:0}.is-style-cards .activitypub-extra-field dt{color:currentColor;display:block;font-size:.9em;letter-spacing:.5px;margin-bottom:.5em;padding-bottom:0;padding-right:0;text-transform:uppercase;white-space:normal}.is-style-cards .activitypub-extra-field dt:after{content:none}.is-style-cards .activitypub-extra-field dd{display:block;font-size:1em;padding-bottom:0}
+/*!****************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/extra-fields/style.scss ***!
+ \****************************************************************************************************************************************************************************************************************************************************/
+/**
+ * Styles for the Extra Fields block.
+ */
+.activitypub-extra-fields-block-wrapper.has-background .activitypub-extra-fields, .activitypub-extra-fields-block-wrapper.has-border .activitypub-extra-fields, .activitypub-extra-fields-block-wrapper.is-style-stacked.has-background .activitypub-extra-fields, .activitypub-extra-fields-block-wrapper.is-style-stacked.has-border .activitypub-extra-fields {
+ padding: 1rem;
+}
+.activitypub-extra-fields-block-wrapper.is-style-cards.has-background .activitypub-extra-fields, .activitypub-extra-fields-block-wrapper.is-style-cards.has-border .activitypub-extra-fields {
+ padding: 0;
+}
+.activitypub-extra-fields {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+/**
+ * Default Compact Style
+ * Displays fields in a table-like format with aligned labels and values.
+ * This is the default style, so it applies without a style class.
+ */
+.activitypub-extra-fields {
+ display: table;
+ table-layout: fixed;
+}
+.activitypub-extra-field {
+ display: table-row;
+ margin-bottom: 0;
+}
+.activitypub-extra-field dt {
+ display: table-cell;
+ padding-bottom: 0.5em;
+ margin-bottom: 0;
+ padding-right: 10px;
+ white-space: nowrap;
+ vertical-align: baseline;
+ text-overflow: ellipsis;
+ font-weight: 600;
+ color: inherit;
+}
+.activitypub-extra-field dt::after {
+ content: ":";
+}
+.activitypub-extra-field dd {
+ display: table-cell;
+ padding-bottom: 0.5em;
+ vertical-align: baseline;
+ word-break: break-word;
+ margin-left: 0;
+ margin-bottom: 0;
+ color: inherit;
+}
+.activitypub-extra-field dd p {
+ margin-top: 0;
+ margin-bottom: 0.5em;
+}
+.activitypub-extra-field dd p:last-child {
+ margin-bottom: 0;
+}
+.activitypub-extra-field dd a {
+ color: inherit;
+ text-decoration: underline;
+}
+.activitypub-extra-field dd a:hover {
+ text-decoration: none;
+}
+/**
+ * Stacked Style
+ * Displays fields in a stacked format with label on top and value below.
+ */
+.is-style-stacked .activitypub-extra-fields {
+ display: block;
+ table-layout: auto;
+}
+.is-style-stacked .activitypub-extra-field {
+ display: block;
+ margin-bottom: 1em;
+}
+.is-style-stacked .activitypub-extra-field:last-child {
+ margin-bottom: 0;
+}
+.is-style-stacked .activitypub-extra-field dt {
+ display: block;
+ padding-bottom: 0;
+ padding-right: 0;
+ margin-bottom: 0.25em;
+ white-space: normal;
+ text-overflow: clip;
+}
+.is-style-stacked .activitypub-extra-field dt::after {
+ content: none;
+}
+.is-style-stacked .activitypub-extra-field dd {
+ display: block;
+ padding-bottom: 0;
+}
+/**
+ * Cards Style
+ * Displays each field in its own bordered card with padding.
+ */
+.is-style-cards.has-background {
+ background: transparent !important;
+}
+.is-style-cards.has-background .activitypub-extra-fields {
+ padding: 1rem;
+}
+.is-style-cards .activitypub-extra-fields {
+ display: block;
+ table-layout: auto;
+}
+.is-style-cards .activitypub-extra-field {
+ display: block;
+ border: 1px solid var(--wp--preset--color--contrast-2, #ddd);
+ border-radius: 8px;
+ padding: 1em;
+ margin-bottom: 1em;
+ background: var(--wp--preset--color--base, #fff);
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
+}
+.is-style-cards .activitypub-extra-field:last-child {
+ margin-bottom: 0;
+}
+.is-style-cards .activitypub-extra-field dt {
+ display: block;
+ font-size: 0.9em;
+ text-transform: uppercase;
+ letter-spacing: 0.5px;
+ color: currentColor;
+ margin-bottom: 0.5em;
+ padding-bottom: 0;
+ padding-right: 0;
+ white-space: normal;
+}
+.is-style-cards .activitypub-extra-field dt::after {
+ content: none;
+}
+.is-style-cards .activitypub-extra-field dd {
+ display: block;
+ font-size: 1em;
+ padding-bottom: 0;
+}
+
+/*# sourceMappingURL=style-index.css.map*/
\ No newline at end of file
diff --git a/build/follow-me/index.asset.php b/build/follow-me/index.asset.php
index 8c30a0aa73..64f270d7e5 100644
--- a/build/follow-me/index.asset.php
+++ b/build/follow-me/index.asset.php
@@ -1 +1 @@
- array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '3c6293a99ee2025acf0a');
+ array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '7bdcda8b5fc056455172');
diff --git a/build/follow-me/index.js b/build/follow-me/index.js
index 47ff3ffb4f..a78dcfa43a 100644
--- a/build/follow-me/index.js
+++ b/build/follow-me/index.js
@@ -1,2 +1,1250 @@
-(()=>{var e,t={768:(e,t,r)=>{"use strict";const o=window.wp.blocks,s=window.wp.primitives,i=window.ReactJSXRuntime;var n=(0,i.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(s.Path,{d:"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z",fillRule:"evenodd"})}),a=r(942),l=r.n(a);const c=window.wp.blockEditor,u=window.wp.i18n,p={html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},__experimentalBorder:{radius:!0,width:!0,color:!0,style:!0},typography:{fontSize:!0,__experimentalDefaultControls:{fontSize:!0}}},d=p;function v({buttonOnly:e=!1,className:t="",...r}){return r.className=l()(t,e?"is-style-button-only":"is-style-default"),r}const f={attributes:{buttonOnly:{type:"boolean",default:!1},buttonText:{type:"string",default:"Follow"},selectedUser:{type:"string",default:"blog"}},supports:p,isEligible:({buttonText:e,buttonOnly:t})=>!!e||!!t,migrate({buttonText:e,...t}){const r=(0,o.createBlock)("core/button",{text:e});return[v(t),[r]]}},b={attributes:{selectedUser:{type:"string",default:"blog"},buttonOnly:{type:"boolean",default:!1}},supports:d,isEligible:({buttonOnly:e})=>!!e,migrate:v,save(){const e=c.useBlockProps.save(),t=c.useInnerBlocksProps.save(e);return(0,i.jsx)("div",{...t})}},h=[{attributes:{selectedUser:{type:"string",default:"blog"}},supports:d,isEligible:(e,t)=>1===t.length&&"button"===t[0].attributes.tagName,migrate(e,t){var r;const{tagName:s,...i}=t[0].attributes,n=null!==(r=t[0].originalContent.replace(/<[^>]*>/g,""))&&void 0!==r?r:(0,u.__)("Follow","activitypub");return[e,[(0,o.createBlock)("core/button",{...i,text:n})]]},save(){const e=c.useBlockProps.save(),t=c.useInnerBlocksProps.save(e);return(0,i.jsx)("div",{...t})}},b,f],y=window.wp.apiFetch;var w=r.n(y);const m=window.wp.data,g=window.wp.coreData,_=window.wp.components,x=window.wp.element;function j(){return window._activityPubOptions||{}}function k({name:e}){const{enabled:t}=j(),r=t?.blog?"":(0,u.__)("It will be empty in other non-author contexts.","activitypub"),o=(0,u.sprintf)(/* translators: %1$s: block name, %2$s: extra information for non-author context */ /* translators: %1$s: block name, %2$s: extra information for non-author context */
-(0,u.__)("This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s","activitypub"),e,r).trim();return(0,i.jsx)(_.Card,{children:(0,i.jsx)(_.CardBody,{children:(0,x.createInterpolateElement)(o,{strong:(0,i.jsx)("strong",{})})})})}const B={avatar:"https://secure.gravatar.com/avatar/default?s=120",webfinger:"@well@hello.dolly",name:(0,u.__)("Hello Dolly Fan Account","activitypub"),url:"#",image:{url:""},summary:""};function S(e){if(!e)return B;const t={...B,...e};return t.avatar=t?.icon?.url,t.webfinger&&!t.webfinger.startsWith("@")&&(t.webfinger="@"+t.webfinger),t}function O({profile:e,className:t,innerBlocksProps:r}){const{webfinger:o,avatar:s,name:n,image:a,summary:l,followersCount:c,postsCount:p}=e,d=t&&t.includes("is-style-button-only"),v={posts:p||0,followers:c||0};return(0,i.jsxs)("div",{className:"activitypub-profile",children:[!d&&a?.url&&(0,i.jsx)("div",{className:"activitypub-profile__header",style:{backgroundImage:`url(${a.url})`}}),(0,i.jsxs)("div",{className:"activitypub-profile__body",children:[!d&&(0,i.jsx)("img",{className:"activitypub-profile__avatar",src:s,alt:n}),(0,i.jsxs)("div",{className:"activitypub-profile__content",children:[!d&&(0,i.jsxs)("div",{className:"activitypub-profile__info",children:[(0,i.jsx)("div",{className:"activitypub-profile__name",children:n}),(0,i.jsx)("div",{className:"activitypub-profile__handle",children:o})]}),(0,i.jsx)("div",{...r}),!d&&(0,i.jsx)("div",{className:"activitypub-profile__bio",dangerouslySetInnerHTML:{__html:l}}),!d&&(0,i.jsx)("div",{className:"activitypub-profile__stats",children:Object.entries(v).map(([e,t])=>(0,i.jsxs)("div",{children:[(0,i.jsx)("strong",{children:t})," ","posts"===e?(0,u._n)("post","posts",t,"activitypub"):"followers"===e?(0,u._n)("follower","followers",t,"activitypub"):(0,u._n)("following","following",t,"activitypub")]},e))})]})]})]})}const N=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","name":"activitypub/follow-me","apiVersion":3,"version":"2.2.0","title":"Follow me on the Fediverse","category":"widgets","description":"Display your Fediverse profile so that visitors can follow you.","textdomain":"activitypub","icon":"groups","example":{"attributes":{"className":"is-style-default"}},"supports":{"html":false,"interactivity":true,"color":{"gradients":true,"link":true,"__experimentalDefaultControls":{"background":true,"text":true,"link":true}},"__experimentalBorder":{"radius":true,"width":true,"color":true,"style":true},"shadow":true,"typography":{"fontSize":true,"__experimentalDefaultControls":{"fontSize":true}},"innerBlocks":{"allowedBlocks":["core/button"]}},"styles":[{"name":"default","label":"Default","isDefault":true},{"name":"button-only","label":"Button"},{"name":"profile","label":"Profile"}],"attributes":{"selectedUser":{"type":"string","default":"blog"}},"usesContext":["postType","postId"],"editorScript":"file:./index.js","viewScriptModule":"file:./view.js","viewScript":"wp-api-fetch","style":"file:./style-index.css","render":"file:./render.php"}');(0,o.registerBlockType)(N,{deprecated:h,edit:function({attributes:e,setAttributes:t,context:{postType:r,postId:o}}){const s=(0,c.useBlockProps)({className:"activitypub-follow-me-block-wrapper"}),n=function({withInherit:e=!1}){const{enabled:t,namespace:r}=j(),[o,s]=(0,x.useState)(!1),{fetchedUsers:i,isLoadingUsers:n}=(0,m.useSelect)(e=>{const{getUsers:r,getIsResolving:o}=e("core");return{fetchedUsers:t?.users?r({capabilities:"activitypub"}):null,isLoadingUsers:!!t?.users&&o("getUsers",[{capabilities:"activitypub"}])}},[]),a=(0,m.useSelect)(e=>i||n?null:e("core").getCurrentUser(),[i,n]);(0,x.useEffect)(()=>{i||n||!a||w()({path:`/${r}/actors/${a.id}`,method:"HEAD",headers:{Accept:"application/activity+json"},parse:!1}).then(()=>s(!0)).catch(()=>s(!1))},[i,n,a]);const l=i||(a&&o?[{id:a.id,name:a.name}]:[]);return(0,x.useMemo)(()=>{if(!l.length)return[];const r=[];return t?.blog&&i&&r.push({label:(0,u.__)("Blog","activitypub"),value:"blog"}),e&&t?.users&&i&&r.push({label:(0,u.__)("Dynamic User","activitypub"),value:"inherit"}),l.reduce((e,t)=>(e.push({label:t.name,value:`${t.id}`}),e),r)},[l])}({withInherit:!0}),{selectedUser:a,className:l="is-style-default"}=e,p="inherit"===a,[d,v]=(0,x.useState)(S(B)),f="blog"===a?0:a,b=[["core/button",{text:(0,u.__)("Follow","activitypub")}]],h=(0,c.useInnerBlocksProps)({},{allowedBlocks:["core/button"],template:b,templateLock:!1,renderAppender:!1}),y=(0,m.useSelect)(e=>{const{getEditedEntityRecord:t}=e(g.store),s=t("postType",r,o)?.author;return null!=s?s:null},[r,o]);return(0,x.useEffect)(()=>{if(p&&!y)return;const e=p?y:f;(function(e){const{namespace:t}=j(),r={headers:{Accept:"application/activity+json"},path:`/${t}/actors/${e}`};return w()(r)})(e).then(t=>{if(v(S(t)),t.followers)try{const{pathname:e}=new URL(t.followers);w()({path:e.replace("wp-json/","")}).then(({totalItems:e=0})=>{v(t=>({...t,followersCount:e}))}).catch(()=>{})}catch(e){}e?w()({path:`/wp/v2/users/${e}/?context=activitypub`}).then(({post_count:e})=>{v(t=>({...t,postsCount:e}))}).catch(()=>{}):w()({path:"/wp/v2/posts",method:"HEAD",parse:!1}).then(e=>{const t=e.headers.get("X-WP-Total");v(e=>({...e,postsCount:t}))}).catch(()=>{})}).catch(()=>{})},[f,y,p]),(0,x.useEffect)(()=>{n.length&&(n.find(({value:e})=>e===a)||t({selectedUser:n[0].value}))},[a,n]),(0,i.jsxs)("div",{...s,children:[(0,i.jsx)(c.InspectorControls,{children:n.length>1&&(0,i.jsx)(_.PanelBody,{title:(0,u.__)("Follow Me Options","activitypub"),children:(0,i.jsx)(_.SelectControl,{label:(0,u.__)("Select User","activitypub"),value:e.selectedUser,options:n,onChange:e=>t({selectedUser:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})})},"activitypub-follow-me"),p&&!y?(0,i.jsx)(k,{name:(0,u.__)("Follow Me","activitypub")}):(0,i.jsx)(O,{profile:d,className:l,innerBlocksProps:h})]})},icon:n,save:function(){const e=c.useBlockProps.save(),t=c.useInnerBlocksProps.save(e);return(0,i.jsx)("div",{...t})}})},942:(e,t)=>{var r;!function(){"use strict";var o={}.hasOwnProperty;function s(){for(var e="",t=0;t{if(!r){var n=1/0;for(u=0;u=i)&&Object.keys(o.O).every(e=>o.O[e](r[l]))?r.splice(l--,1):(a=!1,i0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[r,s,i]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={338:0,870:0};o.O.j=t=>0===e[t];var t=(t,r)=>{var s,i,[n,a,l]=r,c=0;if(n.some(t=>0!==e[t])){for(s in a)o.o(a,s)&&(o.m[s]=a[s]);if(l)var u=l(o)}for(t&&t(r);co(768));s=o.O(s)})();
\ No newline at end of file
+/******/ (() => { // webpackBootstrap
+/******/ var __webpack_modules__ = ({
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/people.js":
+/*!**********************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/people.js ***!
+ \**********************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ people_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/people.tsx
+
+
+var people_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(
+ _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path,
+ {
+ d: "M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z",
+ fillRule: "evenodd"
+ }
+) });
+
+//# sourceMappingURL=people.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/classnames/index.js":
+/*!******************************************!*\
+ !*** ./node_modules/classnames/index.js ***!
+ \******************************************/
+/***/ ((module, exports) => {
+
+var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
+ Copyright (c) 2018 Jed Watson.
+ Licensed under the MIT License (MIT), see
+ http://jedwatson.github.io/classnames
+*/
+/* global define */
+
+(function () {
+ 'use strict';
+
+ var hasOwn = {}.hasOwnProperty;
+
+ function classNames () {
+ var classes = '';
+
+ for (var i = 0; i < arguments.length; i++) {
+ var arg = arguments[i];
+ if (arg) {
+ classes = appendClass(classes, parseValue(arg));
+ }
+ }
+
+ return classes;
+ }
+
+ function parseValue (arg) {
+ if (typeof arg === 'string' || typeof arg === 'number') {
+ return arg;
+ }
+
+ if (typeof arg !== 'object') {
+ return '';
+ }
+
+ if (Array.isArray(arg)) {
+ return classNames.apply(null, arg);
+ }
+
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
+ return arg.toString();
+ }
+
+ var classes = '';
+
+ for (var key in arg) {
+ if (hasOwn.call(arg, key) && arg[key]) {
+ classes = appendClass(classes, key);
+ }
+ }
+
+ return classes;
+ }
+
+ function appendClass (value, newClass) {
+ if (!newClass) {
+ return value;
+ }
+
+ if (value) {
+ return value + ' ' + newClass;
+ }
+
+ return value + newClass;
+ }
+
+ if ( true && module.exports) {
+ classNames.default = classNames;
+ module.exports = classNames;
+ } else if (true) {
+ // register as 'classnames', consistent with npm package name
+ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
+ return classNames;
+ }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
+ } else // removed by dead control flow
+{}
+}());
+
+
+/***/ }),
+
+/***/ "./src/follow-me/block.json":
+/*!**********************************!*\
+ !*** ./src/follow-me/block.json ***!
+ \**********************************/
+/***/ ((module) => {
+
+"use strict";
+module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","name":"activitypub/follow-me","apiVersion":3,"version":"2.2.0","title":"Follow me on the Fediverse","category":"widgets","description":"Display your Fediverse profile so that visitors can follow you.","textdomain":"activitypub","icon":"groups","example":{"attributes":{"className":"is-style-default"}},"supports":{"html":false,"interactivity":true,"color":{"gradients":true,"link":true,"__experimentalDefaultControls":{"background":true,"text":true,"link":true}},"__experimentalBorder":{"radius":true,"width":true,"color":true,"style":true},"shadow":true,"typography":{"fontSize":true,"__experimentalDefaultControls":{"fontSize":true}},"innerBlocks":{"allowedBlocks":["core/button"]}},"styles":[{"name":"default","label":"Default","isDefault":true},{"name":"button-only","label":"Button"},{"name":"profile","label":"Profile"}],"attributes":{"selectedUser":{"type":"string","default":"blog"}},"usesContext":["postType","postId"],"editorScript":"file:./index.js","viewScriptModule":"file:./view.js","viewScript":"wp-api-fetch","style":"file:./style-index.css","render":"file:./render.php"}');
+
+/***/ }),
+
+/***/ "./src/follow-me/deprecation.js":
+/*!**************************************!*\
+ !*** ./src/follow-me/deprecation.js ***!
+ \**************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
+/* harmony export */ });
+/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
+/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
+/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
+/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
+
+
+
+
+
+/**
+ * The block supports for the Follow Me block in version 1.
+ *
+ * @type {{html: boolean, color: {gradients: boolean, link: boolean, __experimentalDefaultControls: {background: boolean, text: boolean, link: boolean}}, __experimentalBorder: {radius: boolean, width: boolean, color: boolean, style: boolean}, typography: {fontSize: boolean, __experimentalDefaultControls: {fontSize: boolean}}}}
+ */
+
+const v1BlockSupports = {
+ html: false,
+ color: {
+ gradients: true,
+ link: true,
+ __experimentalDefaultControls: {
+ background: true,
+ text: true,
+ link: true
+ }
+ },
+ __experimentalBorder: {
+ radius: true,
+ width: true,
+ color: true,
+ style: true
+ },
+ typography: {
+ fontSize: true,
+ __experimentalDefaultControls: {
+ fontSize: true
+ }
+ }
+};
+const v2BlockSupports = v1BlockSupports;
+
+/**
+ * Migrates the buttonOnly attribute to a block style for the Follow Me block.
+ *
+ * @param {Object} attributes The block attributes.
+ * @return {Object} The migrated block attributes.
+ */
+function migrateButtonOnly({
+ buttonOnly = false,
+ className = '',
+ ...newAttributes
+}) {
+ newAttributes.className = classnames__WEBPACK_IMPORTED_MODULE_0___default()(className, buttonOnly ? 'is-style-button-only' : 'is-style-default');
+ return newAttributes;
+}
+
+/**
+ * Deprecation for the Follow Me block to use a core button block instead of the custom button.
+ * This handles the migration of the buttonText and buttonSize attributes to the innerBlock.
+ */
+const v1 = {
+ attributes: {
+ buttonOnly: {
+ type: 'boolean',
+ default: false
+ },
+ buttonText: {
+ type: 'string',
+ default: 'Follow'
+ },
+ selectedUser: {
+ type: 'string',
+ default: 'blog'
+ }
+ },
+ supports: v1BlockSupports,
+ /**
+ * Checks if the block is eligible for migration.
+ *
+ * @param {Object} attributes The block attributes.
+ *
+ * @return {boolean} Whether the block is eligible for migration.
+ */
+ isEligible({
+ buttonText,
+ buttonOnly
+ }) {
+ // Run migration if buttonText or buttonOnly is set.
+ return !!buttonText || !!buttonOnly;
+ },
+ /**
+ * Migrates the Follow Me block to use a core button block instead of the custom button.
+ *
+ * @param {Object} attributes The block attributes.
+ *
+ * @return {[Object, Array]} An array with the new block attributes and inner blocks.
+ */
+ migrate({
+ buttonText,
+ ...newAttributes
+ }) {
+ const buttonBlock = (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__.createBlock)('core/button', {
+ text: buttonText
+ });
+ return [migrateButtonOnly(newAttributes), [buttonBlock]];
+ }
+};
+
+/**
+ * Deprecation for the Follow Me block.
+ * Handles the transition from using the buttonOnly attribute to using block styles.
+ */
+const v2 = {
+ attributes: {
+ selectedUser: {
+ type: 'string',
+ default: 'blog'
+ },
+ buttonOnly: {
+ type: 'boolean',
+ default: false
+ }
+ },
+ supports: v2BlockSupports,
+ /**
+ * Checks if the block is eligible for migration.
+ *
+ * @param {Object} attributes The block attributes.
+ *
+ * @return {boolean} Whether the block is eligible for migration.
+ */
+ isEligible({
+ buttonOnly
+ }) {
+ return !!buttonOnly;
+ },
+ /**
+ * Migrates the Follow Me block to use a block style instead of the buttonOnly attribute.
+ *
+ * @param {Object} attributes The block attributes.
+ *
+ * @return {[Object, Array]} An array with the new block attributes and inner blocks.
+ */
+ migrate: migrateButtonOnly,
+ /**
+ * Save function for the Follow Me block.
+ *
+ * @return {JSX.Element} React element to save.
+ */
+ save() {
+ const blockProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save();
+ const innerBlocksProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useInnerBlocksProps.save(blockProps);
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
+ ...innerBlocksProps
+ });
+ }
+};
+
+/**
+ * Deprecation for the Follow Me block.
+ * Handles the case where the button HTML is stripped due to unfiltered_html capability restrictions.
+ */
+const v3 = {
+ attributes: {
+ selectedUser: {
+ type: 'string',
+ default: 'blog'
+ }
+ },
+ supports: v2BlockSupports,
+ /**
+ * Checks if the block is eligible for migration.
+ *
+ * @param {Object} attributes The block attributes.
+ * @param {array} innerBlocks The inner blocks.
+ *
+ * @return {boolean} Whether the block is eligible for migration.
+ */
+ isEligible(attributes, innerBlocks) {
+ return innerBlocks.length === 1 && 'button' === innerBlocks[0].attributes.tagName;
+ },
+ /**
+ * Migrates the Follow Me block to fix the broken button.
+ *
+ * @param {Object} attributes The block attributes.
+ * @param {array} innerBlocks The inner blocks.
+ *
+ * @return {[Object, Array]} An array with the new block attributes and inner blocks.
+ */
+ migrate(attributes, innerBlocks) {
+ var _innerBlocks$0$origin;
+ const {
+ tagName,
+ ...buttonAttributes
+ } = innerBlocks[0].attributes;
+ const text = (_innerBlocks$0$origin = innerBlocks[0].originalContent.replace(/<[^>]*>/g, '')) !== null && _innerBlocks$0$origin !== void 0 ? _innerBlocks$0$origin : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Follow', 'activitypub');
+
+ // Create a proper button block with the correct structure and the extracted text
+ const buttonBlock = (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__.createBlock)('core/button', {
+ ...buttonAttributes,
+ text
+ });
+ return [attributes, [buttonBlock]];
+ },
+ /**
+ * Save function for the Follow Me block.
+ *
+ * @return {JSX.Element} React element to save.
+ */
+ save() {
+ const blockProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save();
+ const innerBlocksProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useInnerBlocksProps.save(blockProps);
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
+ ...innerBlocksProps
+ });
+ }
+};
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([v3, v2, v1]);
+
+/***/ }),
+
+/***/ "./src/follow-me/edit.js":
+/*!*******************************!*\
+ !*** ./src/follow-me/edit.js ***!
+ \*******************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ Edit)
+/* harmony export */ });
+/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
+/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
+/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data");
+/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_4__);
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
+/* harmony import */ var _shared_use_user_options__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../shared/use-user-options */ "./src/shared/use-user-options.js");
+/* harmony import */ var _shared_inherit_block_fallback__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../shared/inherit-block-fallback */ "./src/shared/inherit-block-fallback.js");
+/* harmony import */ var _shared_use_options__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../shared/use-options */ "./src/shared/use-options.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__);
+
+
+
+
+
+
+
+
+
+
+
+/**
+ * Default profile data.
+ *
+ * @type {Object}
+ */
+
+const DEFAULT_PROFILE_DATA = {
+ avatar: 'https://secure.gravatar.com/avatar/default?s=120',
+ webfinger: '@well@hello.dolly',
+ name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Hello Dolly Fan Account', 'activitypub'),
+ url: '#',
+ image: {
+ url: ''
+ },
+ summary: ''
+};
+
+/**
+ * Get normalized profile data.
+ *
+ * @param {Object} profile Profile data.
+ * @return {Object} Normalized profile data.
+ */
+function getNormalizedProfile(profile) {
+ if (!profile) {
+ return DEFAULT_PROFILE_DATA;
+ }
+ const data = {
+ ...DEFAULT_PROFILE_DATA,
+ ...profile
+ };
+ data.avatar = data?.icon?.url;
+
+ // Ensure webfinger always has the @ prefix.
+ if (data.webfinger && !data.webfinger.startsWith('@')) {
+ data.webfinger = '@' + data.webfinger;
+ }
+ return data;
+}
+
+/**
+ * Fetch profile data.
+ *
+ * @param {number} userId User ID.
+ * @return {Promise} Promise resolving with profile data.
+ */
+function fetchProfile(userId) {
+ const {
+ namespace
+ } = (0,_shared_use_options__WEBPACK_IMPORTED_MODULE_9__.useOptions)();
+ const fetchOptions = {
+ headers: {
+ Accept: 'application/activity+json'
+ },
+ path: `/${namespace}/actors/${userId}`
+ };
+ return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default()(fetchOptions);
+}
+
+/**
+ * Profile component for the editor.
+ *
+ * @param {Object} props Component props.
+ * @return {JSX.Element} Profile component.
+ */
+function EditorProfile({
+ profile,
+ className,
+ innerBlocksProps
+}) {
+ const {
+ webfinger,
+ avatar,
+ name,
+ image,
+ summary,
+ followersCount,
+ postsCount
+ } = profile;
+
+ // Ensure we're checking for the right className format
+ const isButtonOnly = className && className.includes('is-style-button-only');
+
+ // Stats for the editor preview - use real followers count if available
+ const stats = {
+ posts: postsCount || 0,
+ followers: followersCount || 0
+ };
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
+ className: "activitypub-profile",
+ children: [!isButtonOnly && image?.url && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
+ className: "activitypub-profile__header",
+ style: {
+ backgroundImage: `url(${image.url})`
+ }
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
+ className: "activitypub-profile__body",
+ children: [!isButtonOnly && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("img", {
+ className: "activitypub-profile__avatar",
+ src: avatar,
+ alt: name
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
+ className: "activitypub-profile__content",
+ children: [!isButtonOnly && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
+ className: "activitypub-profile__info",
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
+ className: "activitypub-profile__name",
+ children: name
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
+ className: "activitypub-profile__handle",
+ children: webfinger
+ })]
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
+ ...innerBlocksProps
+ }), !isButtonOnly && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
+ className: "activitypub-profile__bio",
+ dangerouslySetInnerHTML: {
+ __html: summary
+ }
+ }), !isButtonOnly && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
+ className: "activitypub-profile__stats",
+ children: Object.entries(stats).map(([key, count]) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("strong", {
+ children: count
+ }), ' ', key === 'posts' ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__._n)('post', 'posts', count, 'activitypub') : key === 'followers' ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__._n)('follower', 'followers', count, 'activitypub') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__._n)('following', 'following', count, 'activitypub')]
+ }, key))
+ })]
+ })]
+ })]
+ });
+}
+
+/**
+ * Edit component.
+ *
+ * @param {Object} props Component props.
+ * @param {Object} props.attributes Block attributes.
+ * @param {Function} props.setAttributes Set block attributes.
+ * @param {Object} props.context Block context.
+ * @param {string} props.context.postType Post type.
+ * @param {number} props.context.postId Post ID.
+ * @return {JSX.Element} Edit component.
+ */
+function Edit({
+ attributes,
+ setAttributes,
+ context: {
+ postType,
+ postId
+ }
+}) {
+ const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
+ className: 'activitypub-follow-me-block-wrapper'
+ });
+ const usersOptions = (0,_shared_use_user_options__WEBPACK_IMPORTED_MODULE_7__.useUserOptions)({
+ withInherit: true
+ });
+ const {
+ selectedUser,
+ className = 'is-style-default'
+ } = attributes;
+ const isInheritMode = selectedUser === 'inherit';
+ const [profile, setProfile] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useState)(getNormalizedProfile(DEFAULT_PROFILE_DATA));
+ const userId = selectedUser === 'blog' ? 0 : selectedUser;
+ const TEMPLATE = [['core/button', {
+ text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Follow', 'activitypub')
+ }]];
+ const innerBlocksProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useInnerBlocksProps)({}, {
+ allowedBlocks: ['core/button'],
+ template: TEMPLATE,
+ templateLock: false,
+ renderAppender: false
+ });
+ const authorId = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
+ const {
+ getEditedEntityRecord
+ } = select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_4__.store);
+ const _authorId = getEditedEntityRecord('postType', postType, postId)?.author;
+ return _authorId !== null && _authorId !== void 0 ? _authorId : null;
+ }, [postType, postId]);
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useEffect)(() => {
+ // Fetch profile data when userId changes.
+ if (isInheritMode && !authorId) {
+ return;
+ }
+ const effectiveUserId = isInheritMode ? authorId : userId;
+ fetchProfile(effectiveUserId).then(data => {
+ setProfile(getNormalizedProfile(data));
+
+ // Convert the full URL to a path if it's a local URL.
+ if (data.followers) {
+ try {
+ // Extract just the path portion from the URL
+ const {
+ pathname: path
+ } = new URL(data.followers);
+ _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default()({
+ path: path.replace('wp-json/', '')
+ }).then(({
+ totalItems = 0
+ }) => {
+ setProfile(prevProfile => ({
+ ...prevProfile,
+ followersCount: totalItems
+ }));
+ }).catch(() => {});
+ } catch (e) {
+ // If URL parsing fails, just continue without fetching followers.
+ }
+ }
+ if (effectiveUserId) {
+ _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default()({
+ path: `/wp/v2/users/${effectiveUserId}/?context=activitypub`
+ }).then(({
+ post_count
+ }) => {
+ setProfile(prevProfile => ({
+ ...prevProfile,
+ postsCount: post_count
+ }));
+ }).catch(() => {});
+ } else {
+ _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default()({
+ path: '/wp/v2/posts',
+ method: 'HEAD',
+ parse: false // Preserve headers.
+ }).then(response => {
+ const postsCount = response.headers.get('X-WP-Total');
+ setProfile(prevProfile => ({
+ ...prevProfile,
+ postsCount
+ }));
+ }).catch(() => {});
+ }
+ }).catch(() => {});
+ }, [userId, authorId, isInheritMode]);
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useEffect)(() => {
+ // If there are no users yet, do nothing.
+ if (!usersOptions.length) {
+ return;
+ }
+ // Ensure that the selected user is in the list of options, if not, select the first available user.
+ if (!usersOptions.find(({
+ value
+ }) => value === selectedUser)) {
+ setAttributes({
+ selectedUser: usersOptions[0].value
+ });
+ }
+ }, [selectedUser, usersOptions]);
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
+ ...blockProps,
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, {
+ children: usersOptions.length > 1 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.PanelBody, {
+ title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Follow Me Options', 'activitypub'),
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.SelectControl, {
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Select User', 'activitypub'),
+ value: attributes.selectedUser,
+ options: usersOptions,
+ onChange: value => setAttributes({
+ selectedUser: value
+ }),
+ __next40pxDefaultSize: true,
+ __nextHasNoMarginBottom: true
+ })
+ })
+ }, "activitypub-follow-me"), isInheritMode && !authorId ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_shared_inherit_block_fallback__WEBPACK_IMPORTED_MODULE_8__.InheritModeBlockFallback, {
+ name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Follow Me', 'activitypub')
+ }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(EditorProfile, {
+ profile: profile,
+ className: className,
+ innerBlocksProps: innerBlocksProps
+ })]
+ });
+}
+
+/***/ }),
+
+/***/ "./src/follow-me/index.js":
+/*!********************************!*\
+ !*** ./src/follow-me/index.js ***!
+ \********************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
+/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/people.js");
+/* harmony import */ var _deprecation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./deprecation */ "./src/follow-me/deprecation.js");
+/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./edit */ "./src/follow-me/edit.js");
+/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/follow-me/block.json");
+/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./save */ "./src/follow-me/save.js");
+/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./style.scss */ "./src/follow-me/style.scss");
+
+
+
+
+
+
+
+
+// Register the block.
+(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__, {
+ deprecated: _deprecation__WEBPACK_IMPORTED_MODULE_2__["default"],
+ edit: _edit__WEBPACK_IMPORTED_MODULE_3__["default"],
+ icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__["default"],
+ save: _save__WEBPACK_IMPORTED_MODULE_5__["default"]
+});
+
+/***/ }),
+
+/***/ "./src/follow-me/save.js":
+/*!*******************************!*\
+ !*** ./src/follow-me/save.js ***!
+ \*******************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
+/* harmony export */ });
+/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
+/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+
+
+/**
+ * Save component for the Follow Me block.
+ *
+ * This component ensures that inner blocks (the button) are properly saved.
+ *
+ * @return {JSX.Element|null} Save component.
+ */
+
+function save() {
+ const blockProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save();
+ const innerBlocksProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useInnerBlocksProps.save(blockProps);
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
+ ...innerBlocksProps
+ });
+}
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (save);
+
+/***/ }),
+
+/***/ "./src/follow-me/style.scss":
+/*!**********************************!*\
+ !*** ./src/follow-me/style.scss ***!
+ \**********************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+// extracted by mini-css-extract-plugin
+
+
+/***/ }),
+
+/***/ "./src/shared/inherit-block-fallback.js":
+/*!**********************************************!*\
+ !*** ./src/shared/inherit-block-fallback.js ***!
+ \**********************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ InheritModeBlockFallback: () => (/* binding */ InheritModeBlockFallback)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _use_options__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./use-options */ "./src/shared/use-options.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
+
+
+
+
+
+/**
+ * Block fallback component for inheriting user context in ActivityPub blocks.
+ *
+ * @param {Object} props
+ * @param {string} props.name - Name of the block.
+ * @returns {JSX.Element} Rendered fallback block.
+ */
+
+function InheritModeBlockFallback({
+ name
+}) {
+ const {
+ enabled
+ } = (0,_use_options__WEBPACK_IMPORTED_MODULE_3__.useOptions)();
+ const nonAuthorExtra = enabled?.blog ? '' : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('It will be empty in other non-author contexts.', 'activitypub');
+ const text = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %1$s: block name, %2$s: extra information for non-author context */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s', 'activitypub'), name, nonAuthorExtra).trim();
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Card, {
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.CardBody, {
+ children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createInterpolateElement)(text, {
+ strong: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("strong", {})
+ })
+ })
+ });
+}
+
+/***/ }),
+
+/***/ "./src/shared/use-options.js":
+/*!***********************************!*\
+ !*** ./src/shared/use-options.js ***!
+ \***********************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ useOptions: () => (/* binding */ useOptions)
+/* harmony export */ });
+/**
+ * React hook to return the ActivityPub options object from the global window.
+ *
+ * @returns {Object} The options object.
+ */
+function useOptions() {
+ return window._activityPubOptions || {};
+}
+
+/***/ }),
+
+/***/ "./src/shared/use-user-options.js":
+/*!****************************************!*\
+ !*** ./src/shared/use-user-options.js ***!
+ \****************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ useUserOptions: () => (/* binding */ useUserOptions)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
+/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _use_options__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./use-options */ "./src/shared/use-options.js");
+
+
+
+
+
+
+/**
+ * React hook providing user options for ActivityPub blocks.
+ *
+ * @param {Object} params
+ * @param {boolean} params.withInherit - Whether to include the inherit option.
+ * @returns {Array} List of user option objects.
+ */
+function useUserOptions({
+ withInherit = false
+}) {
+ /**
+ * ActivityPub options.
+ *
+ * @type {Object}
+ * @property {boolean} enabled.users - Whether users are enabled.
+ * @property {boolean} enabled.blog - Whether the blog user is enabled.
+ */
+ const {
+ enabled,
+ namespace
+ } = (0,_use_options__WEBPACK_IMPORTED_MODULE_4__.useOptions)();
+ const [currentUserCanActivityPub, setCurrentUserCanActivityPub] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
+ const {
+ fetchedUsers,
+ isLoadingUsers
+ } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
+ const {
+ getUsers,
+ getIsResolving
+ } = select('core');
+ return {
+ fetchedUsers: enabled?.users ? getUsers({
+ capabilities: 'activitypub'
+ }) : null,
+ isLoadingUsers: enabled?.users ? getIsResolving('getUsers', [{
+ capabilities: 'activitypub'
+ }]) : false
+ };
+ }, []);
+
+ // Only fetch current user if fetchedUsers is empty and we're not still loading.
+ const currentUser = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => fetchedUsers || isLoadingUsers ? null : select('core').getCurrentUser(), [fetchedUsers, isLoadingUsers]);
+
+ // Test if current user has activitypub capability by trying to access their actor endpoint.
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
+ if (fetchedUsers || isLoadingUsers || !currentUser) {
+ return;
+ }
+ _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3___default()({
+ path: `/${namespace}/actors/${currentUser.id}`,
+ method: 'HEAD',
+ headers: {
+ Accept: 'application/activity+json'
+ },
+ parse: false
+ }).then(() => setCurrentUserCanActivityPub(true)).catch(() => setCurrentUserCanActivityPub(false));
+ }, [fetchedUsers, isLoadingUsers, currentUser]);
+ const users = fetchedUsers || (currentUser && currentUserCanActivityPub ? [{
+ id: currentUser.id,
+ name: currentUser.name
+ }] : []);
+
+ /**
+ * Memoized computation of user options for block settings.
+ */
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
+ if (!users.length) {
+ return [];
+ }
+ const userKeywords = [];
+ if (enabled?.blog && fetchedUsers) {
+ userKeywords.push({
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Blog', 'activitypub'),
+ value: 'blog'
+ });
+ }
+
+ // Only show the inherit option when explicitly asked for and users are enabled.
+ if (withInherit && enabled?.users && fetchedUsers) {
+ userKeywords.push({
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Dynamic User', 'activitypub'),
+ value: 'inherit'
+ });
+ }
+
+ /**
+ * Reduce users into keyword/value pairs for options.
+ */
+ return users.reduce((acc, user) => {
+ acc.push({
+ label: user.name,
+ value: `${user.id}` // Casting to string because that's how Gutenberg stores the attribute.
+ });
+ return acc;
+ }, userKeywords);
+ }, [users]);
+}
+
+/***/ }),
+
+/***/ "@wordpress/api-fetch":
+/*!**********************************!*\
+ !*** external ["wp","apiFetch"] ***!
+ \**********************************/
+/***/ ((module) => {
+
+"use strict";
+module.exports = window["wp"]["apiFetch"];
+
+/***/ }),
+
+/***/ "@wordpress/block-editor":
+/*!*************************************!*\
+ !*** external ["wp","blockEditor"] ***!
+ \*************************************/
+/***/ ((module) => {
+
+"use strict";
+module.exports = window["wp"]["blockEditor"];
+
+/***/ }),
+
+/***/ "@wordpress/blocks":
+/*!********************************!*\
+ !*** external ["wp","blocks"] ***!
+ \********************************/
+/***/ ((module) => {
+
+"use strict";
+module.exports = window["wp"]["blocks"];
+
+/***/ }),
+
+/***/ "@wordpress/components":
+/*!************************************!*\
+ !*** external ["wp","components"] ***!
+ \************************************/
+/***/ ((module) => {
+
+"use strict";
+module.exports = window["wp"]["components"];
+
+/***/ }),
+
+/***/ "@wordpress/core-data":
+/*!**********************************!*\
+ !*** external ["wp","coreData"] ***!
+ \**********************************/
+/***/ ((module) => {
+
+"use strict";
+module.exports = window["wp"]["coreData"];
+
+/***/ }),
+
+/***/ "@wordpress/data":
+/*!******************************!*\
+ !*** external ["wp","data"] ***!
+ \******************************/
+/***/ ((module) => {
+
+"use strict";
+module.exports = window["wp"]["data"];
+
+/***/ }),
+
+/***/ "@wordpress/element":
+/*!*********************************!*\
+ !*** external ["wp","element"] ***!
+ \*********************************/
+/***/ ((module) => {
+
+"use strict";
+module.exports = window["wp"]["element"];
+
+/***/ }),
+
+/***/ "@wordpress/i18n":
+/*!******************************!*\
+ !*** external ["wp","i18n"] ***!
+ \******************************/
+/***/ ((module) => {
+
+"use strict";
+module.exports = window["wp"]["i18n"];
+
+/***/ }),
+
+/***/ "@wordpress/primitives":
+/*!************************************!*\
+ !*** external ["wp","primitives"] ***!
+ \************************************/
+/***/ ((module) => {
+
+"use strict";
+module.exports = window["wp"]["primitives"];
+
+/***/ }),
+
+/***/ "react/jsx-runtime":
+/*!**********************************!*\
+ !*** external "ReactJSXRuntime" ***!
+ \**********************************/
+/***/ ((module) => {
+
+"use strict";
+module.exports = window["ReactJSXRuntime"];
+
+/***/ })
+
+/******/ });
+/************************************************************************/
+/******/ // The module cache
+/******/ var __webpack_module_cache__ = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/ // Check if module is in cache
+/******/ var cachedModule = __webpack_module_cache__[moduleId];
+/******/ if (cachedModule !== undefined) {
+/******/ return cachedModule.exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = __webpack_module_cache__[moduleId] = {
+/******/ // no module.id needed
+/******/ // no module.loaded needed
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = __webpack_modules__;
+/******/
+/************************************************************************/
+/******/ /* webpack/runtime/chunk loaded */
+/******/ (() => {
+/******/ var deferred = [];
+/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
+/******/ if(chunkIds) {
+/******/ priority = priority || 0;
+/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
+/******/ deferred[i] = [chunkIds, fn, priority];
+/******/ return;
+/******/ }
+/******/ var notFulfilled = Infinity;
+/******/ for (var i = 0; i < deferred.length; i++) {
+/******/ var [chunkIds, fn, priority] = deferred[i];
+/******/ var fulfilled = true;
+/******/ for (var j = 0; j < chunkIds.length; j++) {
+/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
+/******/ chunkIds.splice(j--, 1);
+/******/ } else {
+/******/ fulfilled = false;
+/******/ if(priority < notFulfilled) notFulfilled = priority;
+/******/ }
+/******/ }
+/******/ if(fulfilled) {
+/******/ deferred.splice(i--, 1)
+/******/ var r = fn();
+/******/ if (r !== undefined) result = r;
+/******/ }
+/******/ }
+/******/ return result;
+/******/ };
+/******/ })();
+/******/
+/******/ /* webpack/runtime/compat get default export */
+/******/ (() => {
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = (module) => {
+/******/ var getter = module && module.__esModule ?
+/******/ () => (module['default']) :
+/******/ () => (module);
+/******/ __webpack_require__.d(getter, { a: getter });
+/******/ return getter;
+/******/ };
+/******/ })();
+/******/
+/******/ /* webpack/runtime/define property getters */
+/******/ (() => {
+/******/ // define getter functions for harmony exports
+/******/ __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 */
+/******/ (() => {
+/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
+/******/ })();
+/******/
+/******/ /* webpack/runtime/make namespace object */
+/******/ (() => {
+/******/ // define __esModule on 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/jsonp chunk loading */
+/******/ (() => {
+/******/ // no baseURI
+/******/
+/******/ // object to store loaded and loading chunks
+/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
+/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
+/******/ var installedChunks = {
+/******/ "follow-me/index": 0,
+/******/ "follow-me/style-index": 0
+/******/ };
+/******/
+/******/ // no chunk on demand loading
+/******/
+/******/ // no prefetching
+/******/
+/******/ // no preloaded
+/******/
+/******/ // no HMR
+/******/
+/******/ // no HMR manifest
+/******/
+/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
+/******/
+/******/ // install a JSONP callback for chunk loading
+/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
+/******/ var [chunkIds, moreModules, runtime] = data;
+/******/ // add "moreModules" to the modules object,
+/******/ // then flag all "chunkIds" as loaded and fire callback
+/******/ var moduleId, chunkId, i = 0;
+/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
+/******/ for(moduleId in moreModules) {
+/******/ if(__webpack_require__.o(moreModules, moduleId)) {
+/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
+/******/ }
+/******/ }
+/******/ if(runtime) var result = runtime(__webpack_require__);
+/******/ }
+/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
+/******/ for(;i < chunkIds.length; i++) {
+/******/ chunkId = chunkIds[i];
+/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
+/******/ installedChunks[chunkId][0]();
+/******/ }
+/******/ installedChunks[chunkId] = 0;
+/******/ }
+/******/ return __webpack_require__.O(result);
+/******/ }
+/******/
+/******/ var chunkLoadingGlobal = globalThis["webpackChunkwordpress_activitypub"] = globalThis["webpackChunkwordpress_activitypub"] || [];
+/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
+/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
+/******/ })();
+/******/
+/************************************************************************/
+/******/
+/******/ // startup
+/******/ // Load entry module and return exports
+/******/ // This entry module depends on other loaded chunks and execution need to be delayed
+/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["follow-me/style-index"], () => (__webpack_require__("./src/follow-me/index.js")))
+/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
+/******/
+/******/ })()
+;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/build/follow-me/style-index-rtl.css b/build/follow-me/style-index-rtl.css
index 5c9ec8c63b..0d426fb1d1 100644
--- a/build/follow-me/style-index-rtl.css
+++ b/build/follow-me/style-index-rtl.css
@@ -1 +1,344 @@
-body.modal-open{overflow:hidden}.activitypub-modal__overlay{align-items:center;background-color:rgba(0,0,0,.5);bottom:0;color:initial;display:flex;justify-content:center;right:0;padding:1rem;position:fixed;left:0;top:0;z-index:100000}.activitypub-modal__overlay.compact{align-items:flex-start;background-color:transparent;bottom:auto;justify-content:flex-start;right:auto;padding:0;position:absolute;left:auto;top:auto;z-index:100}.activitypub-modal__overlay[hidden]{display:none}.activitypub-modal__frame{animation:activitypub-modal-appear .2s ease-out;background-color:var(--wp--preset--color--white,#fff);border-radius:8px;box-shadow:0 5px 15px rgba(0,0,0,.3);display:flex;flex-direction:column;max-height:calc(100vh - 2rem);max-width:660px;overflow:hidden;width:100%}.compact .activitypub-modal__frame{box-shadow:0 2px 8px rgba(0,0,0,.1);max-height:300px;max-width:-moz-min-content;max-width:min-content;min-width:250px;width:auto}.activitypub-modal__header{align-items:center;border-bottom:1px solid var(--wp--preset--color--light-gray,#f0f0f0);display:flex;flex-shrink:0;justify-content:space-between;padding:2rem 2rem 1.5rem}.compact .activitypub-modal__header{display:none}.activitypub-modal__header .activitypub-modal__close{align-items:center;border:none;cursor:pointer;display:flex;justify-content:center;padding:.5rem;width:auto}.activitypub-modal__header .activitypub-modal__close:active{border:none;padding:.5rem}.activitypub-modal__title{font-size:130%;font-weight:600;line-height:1.4;margin:0!important}.activitypub-modal__content{overflow-y:auto}@keyframes activitypub-modal-appear{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.activitypub-follow-me-block-wrapper{display:block;margin:1rem 0;position:relative}.activitypub-follow-me-block-wrapper .activitypub-profile{padding:1rem 0}.activitypub-follow-me-block-wrapper .activitypub-profile__body{display:flex;flex-wrap:wrap}.activitypub-follow-me-block-wrapper .activitypub-profile__avatar{border-radius:50%;height:75px;margin-left:1rem;-o-object-fit:cover;object-fit:cover;width:75px}.activitypub-follow-me-block-wrapper .activitypub-profile__content{align-items:center;display:flex;flex:1;flex-wrap:wrap;justify-content:space-between;min-width:0}.activitypub-follow-me-block-wrapper .activitypub-profile__info{display:block;flex:1;min-width:0}.activitypub-follow-me-block-wrapper .activitypub-profile__name{font-size:1.25em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile__handle,.activitypub-follow-me-block-wrapper .activitypub-profile__name{color:inherit;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile div.wp-block-button{align-items:center;display:flex;margin:0 1rem 0 0}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button__link{margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .is-small{font-size:.8rem;padding:.25rem .5rem}.activitypub-follow-me-block-wrapper .activitypub-profile .is-compact{font-size:.9rem;padding:.4rem .8rem}.activitypub-follow-me-block-wrapper:not(.is-style-button-only):not(.is-style-profile) .activitypub-profile__bio,.activitypub-follow-me-block-wrapper:not(.is-style-button-only):not(.is-style-profile) .activitypub-profile__stats{display:none}.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile{padding:0}.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__body{display:block;padding:0}.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__content{display:inline}.activitypub-follow-me-block-wrapper.is-style-button-only div.wp-block-button{display:inline-block;margin:0}.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__avatar,.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__bio,.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__handle,.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__name,.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__stats{display:none}.activitypub-follow-me-block-wrapper.is-style-profile{border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,.1);overflow:hidden}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile,.activitypub-follow-me-block-wrapper.is-style-profile.has-background .activitypub-profile{padding:0}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__header{background-color:#ccc;background-position:50%;background-size:cover;height:120px;width:100%}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__body{padding:1rem}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__avatar{height:64px;width:64px}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__content{flex:1;min-width:0}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__name{margin-bottom:.25rem}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__bio{font-size:90%;line-height:1.4;margin-top:16px;width:100%}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__bio p{margin:0 0 .5rem}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__bio p:last-child{margin-bottom:0}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__stats{display:flex;font-size:.9em;gap:16px;margin-top:1rem;width:100%}.activitypub-follow-me-block-wrapper.has-background .activitypub-profile,.activitypub-follow-me-block-wrapper.has-border .activitypub-profile{padding-right:1rem;padding-left:1rem}.activitypub-dialog__section{border-bottom:1px solid var(--wp--preset--color--light-gray,#f0f0f0);padding:1.5rem 2rem}.activitypub-dialog__section:last-child{border-bottom:none;padding-bottom:2rem}.activitypub-dialog__section h4{font-size:110%;margin-bottom:.5rem;margin-top:0}.activitypub-dialog__description{color:inherit;font-size:95%;margin-bottom:1rem}.activitypub-dialog__button-group{display:flex;margin-bottom:.5rem;width:100%}.activitypub-dialog__button-group input[type]{border:1px solid var(--wp--preset--color--gray,#e2e4e7);border-radius:0 4px 4px 0;flex:1;line-height:1;margin:0}.activitypub-dialog__button-group input[type]::-moz-placeholder{opacity:.5}.activitypub-dialog__button-group input[type]::placeholder{opacity:.5}.activitypub-dialog__button-group input[type][aria-invalid=true]{border-color:var(--wp--preset--color--vivid-red)}.activitypub-dialog__button-group button{border-radius:4px 0 0 4px!important;margin-right:-1px!important;min-width:22.5%;width:auto}.activitypub-dialog__error{color:var(--wp--preset--color--vivid-red);font-size:90%;margin-top:.5rem}
+/*!*************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/follow-me/style.scss ***!
+ \*************************************************************************************************************************************************************************************************************************************************/
+body.modal-open {
+ overflow: hidden;
+}
+
+.activitypub-modal__overlay {
+ position: fixed;
+ top: 0;
+ right: 0;
+ left: 0;
+ bottom: 0;
+ background-color: rgba(0, 0, 0, 0.5);
+ color: initial;
+ z-index: 100000;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 1rem;
+}
+
+.activitypub-modal__overlay.compact {
+ position: absolute;
+ background-color: transparent;
+ padding: 0;
+ top: auto;
+ right: auto;
+ left: auto;
+ bottom: auto;
+ align-items: flex-start;
+ justify-content: flex-start;
+ z-index: 100;
+}
+
+.activitypub-modal__overlay[hidden] {
+ display: none;
+}
+
+.activitypub-modal__frame {
+ max-width: 660px;
+ width: 100%;
+ background-color: var(--wp--preset--color--white, #fff);
+ border-radius: 8px;
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
+ overflow: hidden;
+ display: flex;
+ flex-direction: column;
+ max-height: calc(100vh - 2rem);
+ animation: activitypub-modal-appear 0.2s ease-out;
+}
+
+.compact .activitypub-modal__frame {
+ width: auto;
+ max-width: -moz-min-content;
+ max-width: min-content;
+ min-width: 250px;
+ max-height: 300px;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+}
+
+.activitypub-modal__header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 2rem 2rem 1.5rem 2rem;
+ border-bottom: 1px solid var(--wp--preset--color--light-gray, #f0f0f0);
+ flex-shrink: 0;
+}
+
+.compact .activitypub-modal__header {
+ display: none;
+}
+
+.activitypub-modal__header .activitypub-modal__close {
+ border: none;
+ padding: 0.5rem;
+ cursor: pointer;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: auto;
+}
+
+.activitypub-modal__header .activitypub-modal__close:active {
+ border: none;
+ padding: 0.5rem;
+}
+
+.activitypub-modal__title {
+ margin: 0 !important;
+ font-size: 130%;
+ font-weight: 600;
+ line-height: 1.4;
+}
+
+.activitypub-modal__content {
+ overflow-y: auto;
+}
+
+@keyframes activitypub-modal-appear {
+ from {
+ opacity: 0;
+ transform: translateY(20px);
+ }
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+}
+
+.activitypub-follow-me-block-wrapper {
+ display: block;
+ margin: 1rem 0;
+ position: relative;
+}
+
+.activitypub-follow-me-block-wrapper .activitypub-profile {
+ padding: 1rem 0;
+}
+
+.activitypub-follow-me-block-wrapper .activitypub-profile__body {
+ display: flex;
+ flex-wrap: wrap;
+}
+
+.activitypub-follow-me-block-wrapper .activitypub-profile__avatar {
+ width: 75px;
+ height: 75px;
+ border-radius: 50%;
+ margin-left: 1rem;
+ -o-object-fit: cover;
+ object-fit: cover;
+}
+
+.activitypub-follow-me-block-wrapper .activitypub-profile__content {
+ display: flex;
+ flex: 1;
+ flex-wrap: wrap;
+ justify-content: space-between;
+ align-items: center;
+ min-width: 0;
+}
+
+.activitypub-follow-me-block-wrapper .activitypub-profile__info {
+ display: block;
+ flex: 1;
+ min-width: 0;
+}
+
+.activitypub-follow-me-block-wrapper .activitypub-profile__name {
+ font-size: 1.25em;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.activitypub-follow-me-block-wrapper .activitypub-profile__name, .activitypub-follow-me-block-wrapper .activitypub-profile__handle {
+ color: inherit;
+ line-height: 1.2;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.activitypub-follow-me-block-wrapper .activitypub-profile div.wp-block-button {
+ margin: 0 1rem 0 0;
+ display: flex;
+ align-items: center;
+}
+
+.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button__link {
+ margin: 0;
+}
+
+.activitypub-follow-me-block-wrapper .activitypub-profile .is-small {
+ padding: 0.25rem 0.5rem;
+ font-size: 0.8rem;
+}
+
+.activitypub-follow-me-block-wrapper .activitypub-profile .is-compact {
+ padding: 0.4rem 0.8rem;
+ font-size: 0.9rem;
+}
+
+.activitypub-follow-me-block-wrapper:not(.is-style-button-only):not(.is-style-profile) .activitypub-profile__bio,
+.activitypub-follow-me-block-wrapper:not(.is-style-button-only):not(.is-style-profile) .activitypub-profile__stats {
+ display: none;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile {
+ padding: 0;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__body {
+ display: block;
+ padding: 0;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__content {
+ display: inline;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-button-only div.wp-block-button {
+ display: inline-block;
+ margin: 0;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__avatar,
+.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__name,
+.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__handle,
+.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__bio,
+.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__stats {
+ display: none;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-profile {
+ border-radius: 8px;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+ overflow: hidden;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-profile.has-background .activitypub-profile {
+ padding: 0;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile {
+ padding: 0;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__header {
+ width: 100%;
+ height: 120px;
+ background-color: #ccc;
+ background-size: cover;
+ background-position: center;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__body {
+ padding: 1rem;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__avatar {
+ width: 64px;
+ height: 64px;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__content {
+ flex: 1;
+ min-width: 0;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__name {
+ margin-bottom: 0.25rem;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__bio {
+ margin-top: 16px;
+ font-size: 90%;
+ line-height: 1.4;
+ width: 100%;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__bio p {
+ margin: 0 0 0.5rem;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__bio p:last-child {
+ margin-bottom: 0;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__stats {
+ display: flex;
+ gap: 16px;
+ margin-top: 1rem;
+ font-size: 0.9em;
+ width: 100%;
+}
+
+.activitypub-follow-me-block-wrapper.has-background .activitypub-profile, .activitypub-follow-me-block-wrapper.has-border .activitypub-profile {
+ padding-right: 1rem;
+ padding-left: 1rem;
+}
+
+.activitypub-dialog__section {
+ padding: 1.5rem 2rem;
+ border-bottom: 1px solid var(--wp--preset--color--light-gray, #f0f0f0);
+}
+
+.activitypub-dialog__section:last-child {
+ border-bottom: none;
+ padding-bottom: 2rem;
+}
+
+.activitypub-dialog__section h4 {
+ margin-top: 0;
+ margin-bottom: 0.5rem;
+ font-size: 110%;
+}
+
+.activitypub-dialog__description {
+ margin-bottom: 1rem;
+ color: inherit;
+ font-size: 95%;
+}
+
+.activitypub-dialog__button-group {
+ display: flex;
+ width: 100%;
+ margin-bottom: 0.5rem;
+}
+
+.activitypub-dialog__button-group input[type] {
+ flex: 1;
+ border: 1px solid var(--wp--preset--color--gray, #e2e4e7);
+ border-radius: 0 4px 4px 0;
+ line-height: 1;
+ margin: 0;
+}
+
+.activitypub-dialog__button-group input[type]::-moz-placeholder {
+ opacity: 0.5;
+}
+
+.activitypub-dialog__button-group input[type]::placeholder {
+ opacity: 0.5;
+}
+
+.activitypub-dialog__button-group input[type][aria-invalid=true] {
+ border-color: var(--wp--preset--color--vivid-red);
+}
+
+.activitypub-dialog__button-group button {
+ border-radius: 4px 0 0 4px !important;
+ margin-right: -1px !important;
+ min-width: 22.5%;
+ width: auto;
+}
+
+.activitypub-dialog__error {
+ color: var(--wp--preset--color--vivid-red);
+ font-size: 90%;
+ margin-top: 0.5rem;
+}
diff --git a/build/follow-me/style-index.css b/build/follow-me/style-index.css
index 386060cdf8..dcf9a06b7a 100644
--- a/build/follow-me/style-index.css
+++ b/build/follow-me/style-index.css
@@ -1 +1,346 @@
-body.modal-open{overflow:hidden}.activitypub-modal__overlay{align-items:center;background-color:rgba(0,0,0,.5);bottom:0;color:initial;display:flex;justify-content:center;left:0;padding:1rem;position:fixed;right:0;top:0;z-index:100000}.activitypub-modal__overlay.compact{align-items:flex-start;background-color:transparent;bottom:auto;justify-content:flex-start;left:auto;padding:0;position:absolute;right:auto;top:auto;z-index:100}.activitypub-modal__overlay[hidden]{display:none}.activitypub-modal__frame{animation:activitypub-modal-appear .2s ease-out;background-color:var(--wp--preset--color--white,#fff);border-radius:8px;box-shadow:0 5px 15px rgba(0,0,0,.3);display:flex;flex-direction:column;max-height:calc(100vh - 2rem);max-width:660px;overflow:hidden;width:100%}.compact .activitypub-modal__frame{box-shadow:0 2px 8px rgba(0,0,0,.1);max-height:300px;max-width:-moz-min-content;max-width:min-content;min-width:250px;width:auto}.activitypub-modal__header{align-items:center;border-bottom:1px solid var(--wp--preset--color--light-gray,#f0f0f0);display:flex;flex-shrink:0;justify-content:space-between;padding:2rem 2rem 1.5rem}.compact .activitypub-modal__header{display:none}.activitypub-modal__header .activitypub-modal__close{align-items:center;border:none;cursor:pointer;display:flex;justify-content:center;padding:.5rem;width:auto}.activitypub-modal__header .activitypub-modal__close:active{border:none;padding:.5rem}.activitypub-modal__title{font-size:130%;font-weight:600;line-height:1.4;margin:0!important}.activitypub-modal__content{overflow-y:auto}@keyframes activitypub-modal-appear{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.activitypub-follow-me-block-wrapper{display:block;margin:1rem 0;position:relative}.activitypub-follow-me-block-wrapper .activitypub-profile{padding:1rem 0}.activitypub-follow-me-block-wrapper .activitypub-profile__body{display:flex;flex-wrap:wrap}.activitypub-follow-me-block-wrapper .activitypub-profile__avatar{border-radius:50%;height:75px;margin-right:1rem;-o-object-fit:cover;object-fit:cover;width:75px}.activitypub-follow-me-block-wrapper .activitypub-profile__content{align-items:center;display:flex;flex:1;flex-wrap:wrap;justify-content:space-between;min-width:0}.activitypub-follow-me-block-wrapper .activitypub-profile__info{display:block;flex:1;min-width:0}.activitypub-follow-me-block-wrapper .activitypub-profile__name{font-size:1.25em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile__handle,.activitypub-follow-me-block-wrapper .activitypub-profile__name{color:inherit;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile div.wp-block-button{align-items:center;display:flex;margin:0 0 0 1rem}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button__link{margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .is-small{font-size:.8rem;padding:.25rem .5rem}.activitypub-follow-me-block-wrapper .activitypub-profile .is-compact{font-size:.9rem;padding:.4rem .8rem}.activitypub-follow-me-block-wrapper:not(.is-style-button-only):not(.is-style-profile) .activitypub-profile__bio,.activitypub-follow-me-block-wrapper:not(.is-style-button-only):not(.is-style-profile) .activitypub-profile__stats{display:none}.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile{padding:0}.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__body{display:block;padding:0}.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__content{display:inline}.activitypub-follow-me-block-wrapper.is-style-button-only div.wp-block-button{display:inline-block;margin:0}.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__avatar,.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__bio,.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__handle,.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__name,.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__stats{display:none}.activitypub-follow-me-block-wrapper.is-style-profile{border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,.1);overflow:hidden}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile,.activitypub-follow-me-block-wrapper.is-style-profile.has-background .activitypub-profile{padding:0}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__header{background-color:#ccc;background-position:50%;background-size:cover;height:120px;width:100%}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__body{padding:1rem}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__avatar{height:64px;width:64px}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__content{flex:1;min-width:0}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__name{margin-bottom:.25rem}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__bio{font-size:90%;line-height:1.4;margin-top:16px;width:100%}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__bio p{margin:0 0 .5rem}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__bio p:last-child{margin-bottom:0}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__stats{display:flex;font-size:.9em;gap:16px;margin-top:1rem;width:100%}.activitypub-follow-me-block-wrapper.has-background .activitypub-profile,.activitypub-follow-me-block-wrapper.has-border .activitypub-profile{padding-left:1rem;padding-right:1rem}.activitypub-dialog__section{border-bottom:1px solid var(--wp--preset--color--light-gray,#f0f0f0);padding:1.5rem 2rem}.activitypub-dialog__section:last-child{border-bottom:none;padding-bottom:2rem}.activitypub-dialog__section h4{font-size:110%;margin-bottom:.5rem;margin-top:0}.activitypub-dialog__description{color:inherit;font-size:95%;margin-bottom:1rem}.activitypub-dialog__button-group{display:flex;margin-bottom:.5rem;width:100%}.activitypub-dialog__button-group input[type]{border:1px solid var(--wp--preset--color--gray,#e2e4e7);border-radius:4px 0 0 4px;flex:1;line-height:1;margin:0}.activitypub-dialog__button-group input[type]::-moz-placeholder{opacity:.5}.activitypub-dialog__button-group input[type]::placeholder{opacity:.5}.activitypub-dialog__button-group input[type][aria-invalid=true]{border-color:var(--wp--preset--color--vivid-red)}.activitypub-dialog__button-group button{border-radius:0 4px 4px 0!important;margin-left:-1px!important;min-width:22.5%;width:auto}.activitypub-dialog__error{color:var(--wp--preset--color--vivid-red);font-size:90%;margin-top:.5rem}
+/*!*************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/follow-me/style.scss ***!
+ \*************************************************************************************************************************************************************************************************************************************************/
+body.modal-open {
+ overflow: hidden;
+}
+
+.activitypub-modal__overlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-color: rgba(0, 0, 0, 0.5);
+ color: initial;
+ z-index: 100000;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 1rem;
+}
+
+.activitypub-modal__overlay.compact {
+ position: absolute;
+ background-color: transparent;
+ padding: 0;
+ top: auto;
+ left: auto;
+ right: auto;
+ bottom: auto;
+ align-items: flex-start;
+ justify-content: flex-start;
+ z-index: 100;
+}
+
+.activitypub-modal__overlay[hidden] {
+ display: none;
+}
+
+.activitypub-modal__frame {
+ max-width: 660px;
+ width: 100%;
+ background-color: var(--wp--preset--color--white, #fff);
+ border-radius: 8px;
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
+ overflow: hidden;
+ display: flex;
+ flex-direction: column;
+ max-height: calc(100vh - 2rem);
+ animation: activitypub-modal-appear 0.2s ease-out;
+}
+
+.compact .activitypub-modal__frame {
+ width: auto;
+ max-width: -moz-min-content;
+ max-width: min-content;
+ min-width: 250px;
+ max-height: 300px;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+}
+
+.activitypub-modal__header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 2rem 2rem 1.5rem 2rem;
+ border-bottom: 1px solid var(--wp--preset--color--light-gray, #f0f0f0);
+ flex-shrink: 0;
+}
+
+.compact .activitypub-modal__header {
+ display: none;
+}
+
+.activitypub-modal__header .activitypub-modal__close {
+ border: none;
+ padding: 0.5rem;
+ cursor: pointer;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: auto;
+}
+
+.activitypub-modal__header .activitypub-modal__close:active {
+ border: none;
+ padding: 0.5rem;
+}
+
+.activitypub-modal__title {
+ margin: 0 !important;
+ font-size: 130%;
+ font-weight: 600;
+ line-height: 1.4;
+}
+
+.activitypub-modal__content {
+ overflow-y: auto;
+}
+
+@keyframes activitypub-modal-appear {
+ from {
+ opacity: 0;
+ transform: translateY(20px);
+ }
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+}
+
+.activitypub-follow-me-block-wrapper {
+ display: block;
+ margin: 1rem 0;
+ position: relative;
+}
+
+.activitypub-follow-me-block-wrapper .activitypub-profile {
+ padding: 1rem 0;
+}
+
+.activitypub-follow-me-block-wrapper .activitypub-profile__body {
+ display: flex;
+ flex-wrap: wrap;
+}
+
+.activitypub-follow-me-block-wrapper .activitypub-profile__avatar {
+ width: 75px;
+ height: 75px;
+ border-radius: 50%;
+ margin-right: 1rem;
+ -o-object-fit: cover;
+ object-fit: cover;
+}
+
+.activitypub-follow-me-block-wrapper .activitypub-profile__content {
+ display: flex;
+ flex: 1;
+ flex-wrap: wrap;
+ justify-content: space-between;
+ align-items: center;
+ min-width: 0;
+}
+
+.activitypub-follow-me-block-wrapper .activitypub-profile__info {
+ display: block;
+ flex: 1;
+ min-width: 0;
+}
+
+.activitypub-follow-me-block-wrapper .activitypub-profile__name {
+ font-size: 1.25em;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.activitypub-follow-me-block-wrapper .activitypub-profile__name, .activitypub-follow-me-block-wrapper .activitypub-profile__handle {
+ color: inherit;
+ line-height: 1.2;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.activitypub-follow-me-block-wrapper .activitypub-profile div.wp-block-button {
+ margin: 0 0 0 1rem;
+ display: flex;
+ align-items: center;
+}
+
+.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button__link {
+ margin: 0;
+}
+
+.activitypub-follow-me-block-wrapper .activitypub-profile .is-small {
+ padding: 0.25rem 0.5rem;
+ font-size: 0.8rem;
+}
+
+.activitypub-follow-me-block-wrapper .activitypub-profile .is-compact {
+ padding: 0.4rem 0.8rem;
+ font-size: 0.9rem;
+}
+
+.activitypub-follow-me-block-wrapper:not(.is-style-button-only):not(.is-style-profile) .activitypub-profile__bio,
+.activitypub-follow-me-block-wrapper:not(.is-style-button-only):not(.is-style-profile) .activitypub-profile__stats {
+ display: none;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile {
+ padding: 0;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__body {
+ display: block;
+ padding: 0;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__content {
+ display: inline;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-button-only div.wp-block-button {
+ display: inline-block;
+ margin: 0;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__avatar,
+.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__name,
+.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__handle,
+.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__bio,
+.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__stats {
+ display: none;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-profile {
+ border-radius: 8px;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+ overflow: hidden;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-profile.has-background .activitypub-profile {
+ padding: 0;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile {
+ padding: 0;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__header {
+ width: 100%;
+ height: 120px;
+ background-color: #ccc;
+ background-size: cover;
+ background-position: center;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__body {
+ padding: 1rem;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__avatar {
+ width: 64px;
+ height: 64px;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__content {
+ flex: 1;
+ min-width: 0;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__name {
+ margin-bottom: 0.25rem;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__bio {
+ margin-top: 16px;
+ font-size: 90%;
+ line-height: 1.4;
+ width: 100%;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__bio p {
+ margin: 0 0 0.5rem;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__bio p:last-child {
+ margin-bottom: 0;
+}
+
+.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__stats {
+ display: flex;
+ gap: 16px;
+ margin-top: 1rem;
+ font-size: 0.9em;
+ width: 100%;
+}
+
+.activitypub-follow-me-block-wrapper.has-background .activitypub-profile, .activitypub-follow-me-block-wrapper.has-border .activitypub-profile {
+ padding-left: 1rem;
+ padding-right: 1rem;
+}
+
+.activitypub-dialog__section {
+ padding: 1.5rem 2rem;
+ border-bottom: 1px solid var(--wp--preset--color--light-gray, #f0f0f0);
+}
+
+.activitypub-dialog__section:last-child {
+ border-bottom: none;
+ padding-bottom: 2rem;
+}
+
+.activitypub-dialog__section h4 {
+ margin-top: 0;
+ margin-bottom: 0.5rem;
+ font-size: 110%;
+}
+
+.activitypub-dialog__description {
+ margin-bottom: 1rem;
+ color: inherit;
+ font-size: 95%;
+}
+
+.activitypub-dialog__button-group {
+ display: flex;
+ width: 100%;
+ margin-bottom: 0.5rem;
+}
+
+.activitypub-dialog__button-group input[type] {
+ flex: 1;
+ border: 1px solid var(--wp--preset--color--gray, #e2e4e7);
+ border-radius: 4px 0 0 4px;
+ line-height: 1;
+ margin: 0;
+}
+
+.activitypub-dialog__button-group input[type]::-moz-placeholder {
+ opacity: 0.5;
+}
+
+.activitypub-dialog__button-group input[type]::placeholder {
+ opacity: 0.5;
+}
+
+.activitypub-dialog__button-group input[type][aria-invalid=true] {
+ border-color: var(--wp--preset--color--vivid-red);
+}
+
+.activitypub-dialog__button-group button {
+ border-radius: 0 4px 4px 0 !important;
+ margin-left: -1px !important;
+ min-width: 22.5%;
+ width: auto;
+}
+
+.activitypub-dialog__error {
+ color: var(--wp--preset--color--vivid-red);
+ font-size: 90%;
+ margin-top: 0.5rem;
+}
+
+/*# sourceMappingURL=style-index.css.map*/
\ No newline at end of file
diff --git a/build/follow-me/view.asset.php b/build/follow-me/view.asset.php
index 3af44537ee..f4719dbace 100644
--- a/build/follow-me/view.asset.php
+++ b/build/follow-me/view.asset.php
@@ -1 +1 @@
- array('@wordpress/interactivity'), 'version' => 'dcfaf459c212f2047ad9', 'type' => 'module');
+ array('@wordpress/interactivity'), 'version' => '08d268be5b8e0ce2b032', 'type' => 'module');
diff --git a/build/follow-me/view.js b/build/follow-me/view.js
index d30475380f..8ee37a7baf 100644
--- a/build/follow-me/view.js
+++ b/build/follow-me/view.js
@@ -1 +1,760 @@
-import{getConfig as e,getContext as t,getElement as o,store as n}from"@wordpress/interactivity";const r={computedStyles:null,variables:{}};function l(e){if("undefined"==typeof window||!window.getComputedStyle)return!1;if(r.variables.hasOwnProperty(e))return r.variables[e];r.computedStyles||(r.computedStyles=window.getComputedStyle(document.documentElement));const t=r.computedStyles.getPropertyValue(e).trim();return r.variables[e]=""!==t,r.variables[e]}function c(e){if("string"!=typeof e)return null;if(e.match(/^#/))return e.substring(0,7);const[,,t]=e.split("|"),o=`--wp--preset--color--${t}`;return l(o)?`var(${o})`:null}function i(e,t,o=null,n=""){return o?`${e}${n} { ${t}: ${o}; }\n`:""}function s(e,t,o,n){return i(e,"background-color",t)+i(e,"color",o)+i(e,"background-color",n,":hover")+i(e,"background-color",n,":focus")}const{apiFetch:a}=window.wp;!function(){const{actions:e,callbacks:r}=n("activitypub/follow-me",{actions:{openModal(e){const o=t();o.modal.isOpen=!0,o.modal.isCompact?setTimeout(r.positionModal,0):setTimeout(()=>{const e=document.getElementById(o.blockId);if(e){const t=e.querySelector(".activitypub-modal__frame");t&&r.trapFocus(t)}},50),"function"==typeof r.onModalOpen&&r.onModalOpen(e)},closeModal(e){const n=t();n.modal.isOpen=!1;const l=o();if("actions.toggleModal"===l.ref.dataset["wpOn-Click"])l.ref.focus();else{const e=document.getElementById(n.blockId);if(e){const t=e.querySelector('[data-wp-on--click="actions.toggleModal"], [data-wp-on-async--click="actions.toggleModal"]');t&&t.focus()}}"function"==typeof r.onModalClose&&r.onModalClose(e)},toggleModal(o){const{modal:n}=t();n.isOpen?e.closeModal(o):e.openModal(o)}},callbacks:{_abortController:null,handleModalEffects(){const{modal:e}=t();if(e.isOpen&&!e.isCompact?document.body.classList.add("modal-open"):document.body.classList.remove("modal-open"),r._abortController&&(r._abortController.abort(),r._abortController=null),e.isOpen){r._abortController=new AbortController;const{signal:e}=r._abortController;document.addEventListener("keydown",r.documentKeydown,{signal:e}),document.addEventListener("click",r.documentClick,{signal:e})}},documentKeydown(o){const{modal:n}=t();n.isOpen&&"Escape"===o.key&&e.closeModal()},documentClick(o){const{blockId:n,modal:r}=t();if(!r.isOpen)return;const l=document.getElementById(n);if(!l)return;const c=l.querySelector('.wp-element-button[data-wp-on--click="actions.toggleModal"]');if(c&&(c===o.target||c.contains(o.target)))return;const i=l.querySelector(".activitypub-modal__frame");i&&!i.contains(o.target)&&e.closeModal()},positionModal(){const{blockId:e}=t(),n=document.getElementById(e);if(!n)return;const r=n.querySelector(".activitypub-modal__overlay");if(!r)return;r.style.top="",r.style.left="",r.style.right="",r.style.bottom="";const l=o().ref.getBoundingClientRect(),c=window.innerWidth,i=n.getBoundingClientRect();let s={top:l.bottom-i.top+8+"px",left:l.left-i.left-2+"px"};c-l.right<250&&(s.left="auto",s.right=i.right-l.right+"px"),Object.assign(r.style,s)},trapFocus(e){const t=e.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]):not([readonly]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),o=t[0],n=t[t.length-1];o&&o.classList.contains("activitypub-modal__close")&&t.length>1?t[1].focus():o.focus(),e.addEventListener("keydown",function(e){"Tab"!==e.key&&9!==e.keyCode||(e.shiftKey?document.activeElement===o&&(n.focus(),e.preventDefault()):document.activeElement===n&&(o.focus(),e.preventDefault()))})}}})}();const{actions:d,callbacks:u}=n("activitypub/follow-me",{actions:{copyToClipboard(){const o=t(),{i18n:n}=e();navigator.clipboard.writeText(o.webfinger).then(()=>{o.copyButtonText=n.copied,setTimeout(()=>{o.copyButtonText=n.copy},1e3)},e=>{console.error("Could not copy text: ",e)})},updateRemoteProfile(e){const o=t();o.remoteProfile=e.target.value,o.isError=!1,o.errorMessage=""},onKeydown(e){"A"!==o().ref.tagName||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),d.toggleModal(e))},handleKeyDown(e){"Enter"===e.key&&(e.preventDefault(),d.submitRemoteProfile())},submitRemoteProfile:function*(){const o=t(),{namespace:n,i18n:r}=e(),l=o.remoteProfile.trim();if(!l)return o.isError=!0,void(o.errorMessage=r.emptyProfileError);if(!u.isHandle(l))return o.isError=!0,void(o.errorMessage=r.invalidProfileError);o.isLoading=!0,o.isError=!1;const c=`/${n}/actors/${o.userId}/remote-follow?resource=${encodeURIComponent(l)}`;try{const e=yield a({path:c});o.isLoading=!1,window.open(e.url,"_blank"),d.closeModal(new Event("click"))}catch(e){console.error("Error submitting profile:",e),o.isLoading=!1,o.isError=!0,o.errorMessage=e.message||r.genericError}}},callbacks:{initButtonStyles:()=>{const{buttonStyle:e,backgroundColor:o,blockId:n}=t();if(n&&e){const t=document.createElement("style"),i=`#${n}`;t.textContent=function(e,t,o){const n=`${e} .wp-block-button__link`,r=function(e){if("string"==typeof e){const t=`--wp--preset--color--${e}`;return l(t)?`var(${t})`:null}return e?.color?.background||null}(o)||t?.color?.background;return s(n,c(t?.elements?.link?.color?.text),r,c(t?.elements?.link?.[":hover"]?.color?.text))}(i,e,o),document.head.appendChild(t);const a=document.createElement("style");a.textContent=(r=e,s(".activitypub-dialog__button-group .wp-block-button",c(r?.elements?.link?.color?.text)||"#111","#fff",c(r?.elements?.link?.[":hover"]?.color?.text)||"#333")),document.head.appendChild(a)}var r},isHandle(e){const t=e.replace(/^@/,"").split("@");return 2===t.length&&u.isUrl(`https://${t[1]}`)},isUrl(e){try{return new URL(e),!0}catch(e){return!1}},onModalClose(){t().isError=!1}}});
\ No newline at end of file
+import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity";
+/******/ var __webpack_modules__ = ({
+
+/***/ "./src/follow-me/button-style.js":
+/*!***************************************!*\
+ !*** ./src/follow-me/button-style.js ***!
+ \***************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ getBlockStyles: () => (/* binding */ getBlockStyles),
+/* harmony export */ getPopupStyles: () => (/* binding */ getPopupStyles)
+/* harmony export */ });
+/**
+ * Cache for computed styles and CSS variable checks.
+ */
+const cssCache = {
+ computedStyles: null,
+ variables: {}
+};
+
+/**
+ * Checks if a CSS variable is defined.
+ *
+ * Uses a caching mechanism to avoid frequent getComputedStyle calls,
+ * which can cause layout thrashing when called repeatedly.
+ *
+ * @param {string} variableName The CSS variable name to check.
+ * @return {boolean} Whether the variable is defined.
+ */
+function isCssVariableDefined(variableName) {
+ // Return false if we're in a server-side context.
+ if (typeof window === 'undefined' || !window.getComputedStyle) {
+ return false;
+ }
+
+ // Check if we've already cached this variable.
+ if (cssCache.variables.hasOwnProperty(variableName)) {
+ return cssCache.variables[variableName];
+ }
+
+ // Get the computed style of the root element (cached).
+ if (!cssCache.computedStyles) {
+ cssCache.computedStyles = window.getComputedStyle(document.documentElement);
+ }
+
+ // Get the value of the CSS variable.
+ const value = cssCache.computedStyles.getPropertyValue(variableName).trim();
+
+ // Cache the result.
+ cssCache.variables[variableName] = value !== '';
+
+ // If the value is empty, the variable is not defined or is set to an empty value.
+ return cssCache.variables[variableName];
+}
+
+/**
+ * Gets the background color from a style object.
+ *
+ * @param {Object|string} color Color object or string.
+ * @return {string|null} Background color.
+ */
+function getBackgroundColor(color) {
+ // If color is a string, it's a var like this.
+ if (typeof color === 'string') {
+ const varName = `--wp--preset--color--${color}`;
+ if (!isCssVariableDefined(varName)) {
+ return null;
+ }
+ return `var(${varName})`;
+ }
+ return color?.color?.background || null;
+}
+
+/**
+ * Gets the link color from a style object.
+ *
+ * @param {string} text Text color.
+ * @return {string|null} Link color.
+ */
+function getLinkColor(text) {
+ if (typeof text !== 'string') {
+ return null;
+ }
+ // If it starts with a hash, leave it be.
+ if (text.match(/^#/)) {
+ // We don't handle the alpha channel if present.
+ return text.substring(0, 7);
+ }
+ // var:preset|color|luminous-vivid-amber
+ // var(--wp--preset--color--luminous-vivid-amber)
+ // We will receive the top format, we need to output the bottom format.
+ const [,, color] = text.split('|');
+ const varName = `--wp--preset--color--${color}`;
+
+ // Check if the CSS variable is defined before using it.
+ if (!isCssVariableDefined(varName)) {
+ return null;
+ }
+ return `var(${varName})`;
+}
+
+/**
+ * Generates a CSS selector.
+ *
+ * @param {string} selector CSS selector.
+ * @param {string} prop CSS property.
+ * @param {string|null} value CSS value.
+ * @param {string} pseudo Pseudo-selector.
+ * @return {string} CSS selector.
+ */
+function generateSelector(selector, prop, value = null, pseudo = '') {
+ if (!value) {
+ return '';
+ }
+ return `${selector}${pseudo} { ${prop}: ${value}; }\n`;
+}
+
+/**
+ * Gets styles for a button.
+ *
+ * @param {string} selector CSS selector.
+ * @param {string} button Button color.
+ * @param {string} text Text color.
+ * @param {string} hover Hover color.
+ * @return {string} CSS styles.
+ */
+function getStyles(selector, button, text, hover) {
+ return generateSelector(selector, 'background-color', button) + generateSelector(selector, 'color', text) + generateSelector(selector, 'background-color', hover, ':hover') + generateSelector(selector, 'background-color', hover, ':focus');
+}
+
+/**
+ * Gets block styles.
+ *
+ * @param {string} base Base selector.
+ * @param {Object} style Style object.
+ * @param {Object|string} backgroundColor Background color.
+ * @return {string} CSS styles.
+ */
+function getBlockStyles(base, style, backgroundColor) {
+ const selector = `${base} .wp-block-button__link`;
+
+ // We grab the background color if set as a good color for our button text.
+ const buttonTextColor = getBackgroundColor(backgroundColor) ||
+ // Background might be in this form.
+ style?.color?.background;
+
+ // We misuse the link color for the button background.
+ const buttonColor = getLinkColor(style?.elements?.link?.color?.text);
+ const buttonHoverColor = getLinkColor(style?.elements?.link?.[':hover']?.color?.text);
+ return getStyles(selector, buttonColor, buttonTextColor, buttonHoverColor);
+}
+
+/**
+ * Gets popup styles.
+ *
+ * @param {Object} style Style object.
+ * @return {string} CSS styles.
+ */
+function getPopupStyles(style) {
+ // We don't accept backgroundColor because the popup is always white (right?).
+ const buttonColor = getLinkColor(style?.elements?.link?.color?.text) || '#111';
+ const buttonTextColor = '#fff';
+ const buttonHoverColor = getLinkColor(style?.elements?.link?.[':hover']?.color?.text) || '#333';
+ const selector = '.activitypub-dialog__button-group .wp-block-button';
+ return getStyles(selector, buttonColor, buttonTextColor, buttonHoverColor);
+}
+
+/***/ }),
+
+/***/ "./src/shared/modal/index.js":
+/*!***********************************!*\
+ !*** ./src/shared/modal/index.js ***!
+ \***********************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ createModalStore: () => (/* binding */ createModalStore)
+/* harmony export */ });
+/* harmony import */ var _wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/interactivity */ "@wordpress/interactivity");
+
+
+/**
+ * @typedef {Object} context
+ * @property {String} blockId - The ID of the block.
+ * @property {Object} modal - The modal state.
+ * @property {boolean} modal.isOpen - Whether the modal is open.
+ * @property {boolean} modal.isCompact - Whether the modal is compact.
+ */
+
+/**
+ * Set up a modal store with actions and callbacks.
+ *
+ * The Interactivity API merges all stores that share the same namespace,
+ * so these actions and callbacks are added directly to the importing block’s existing store.
+ *
+ * @param {string} namespace - The interactivity namespace for the block.
+ */
+function createModalStore(namespace) {
+ const {
+ actions,
+ callbacks
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.store)(namespace, {
+ actions: {
+ /**
+ * Open the modal.
+ *
+ * @param {Event} event Click event.
+ */
+ openModal(event) {
+ const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+
+ // Set modal properties
+ context.modal.isOpen = true;
+ if (context.modal.isCompact) {
+ // Position the compact modal relative to the button.
+ setTimeout(callbacks.positionModal, 0);
+ } else {
+ // Set up the focus trap after modal is open.
+ setTimeout(() => {
+ // Use the blockId to find the specific modal frame for this block
+ const blockWrapper = document.getElementById(context.blockId);
+ if (blockWrapper) {
+ const modalFrame = blockWrapper.querySelector('.activitypub-modal__frame');
+ if (modalFrame) {
+ callbacks.trapFocus(modalFrame);
+ }
+ }
+ }, 50);
+ }
+
+ // Call the onOpen callback if provided.
+ if (typeof callbacks.onModalOpen === 'function') {
+ callbacks.onModalOpen(event);
+ }
+ },
+ /**
+ * Close the modal.
+ *
+ * @param {Event} event Click event.
+ */
+ closeModal(event) {
+ const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+
+ // Reset modal state
+ context.modal.isOpen = false;
+
+ // Return focus to the button that opened the modal.
+ const button = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getElement)();
+ if (button.ref.dataset['wpOn-Click'] === 'actions.toggleModal') {
+ button.ref.focus();
+ } else {
+ const blockWrapper = document.getElementById(context.blockId);
+ if (blockWrapper) {
+ const openButton = blockWrapper.querySelector('[data-wp-on--click="actions.toggleModal"], [data-wp-on-async--click="actions.toggleModal"]');
+ if (openButton) {
+ openButton.focus();
+ }
+ }
+ }
+
+ // Call the onClose callback if provided.
+ if (typeof callbacks.onModalClose === 'function') {
+ callbacks.onModalClose(event);
+ }
+ },
+ /**
+ * Toggle the modal.
+ *
+ * @param {Event} event Click event.
+ */
+ toggleModal(event) {
+ const {
+ modal
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ modal.isOpen ? actions.closeModal(event) : actions.openModal(event);
+ }
+ },
+ callbacks: {
+ /**
+ * Abort controller for keydown and click event listeners.
+ *
+ * @type {AbortController | null} Abort controller.
+ */
+ _abortController: null,
+ /**
+ * Handles modal effects like body class and event listeners.
+ * This is called via data-wp-watch in the modal HTML.
+ */
+ handleModalEffects() {
+ const {
+ modal
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+
+ // Update body class.
+ if (modal.isOpen && !modal.isCompact) {
+ document.body.classList.add('modal-open');
+ } else {
+ document.body.classList.remove('modal-open');
+ }
+
+ // Remove all existing listeners.
+ if (callbacks._abortController) {
+ callbacks._abortController.abort();
+ callbacks._abortController = null;
+ }
+
+ // Add new listeners if modal is open.
+ if (modal.isOpen) {
+ callbacks._abortController = new AbortController();
+ const {
+ signal
+ } = callbacks._abortController;
+ document.addEventListener('keydown', callbacks.documentKeydown, {
+ signal
+ });
+ document.addEventListener('click', callbacks.documentClick, {
+ signal
+ });
+ }
+ return undefined;
+ },
+ /**
+ * Handles keydown events on the document.
+ *
+ * @param {Event} event Keydown event.
+ * @param {String} event.key The key that was pressed.
+ */
+ documentKeydown(event) {
+ const {
+ modal
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ if (modal.isOpen && event.key === 'Escape') {
+ actions.closeModal();
+ }
+ },
+ /**
+ * Handles click events on the document.
+ *
+ * @param {Event} event Click event.
+ */
+ documentClick(event) {
+ const {
+ blockId,
+ modal
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ if (!modal.isOpen) {
+ return;
+ }
+
+ // Get the block wrapper element.
+ const blockWrapper = document.getElementById(blockId);
+ if (!blockWrapper) {
+ return;
+ }
+
+ // If the click was on the button or its children, we should not close the modal.
+ const toggleButton = blockWrapper.querySelector('.wp-element-button[data-wp-on--click="actions.toggleModal"]');
+ if (toggleButton && (toggleButton === event.target || toggleButton.contains(event.target))) {
+ return;
+ }
+
+ // Check if the click was inside the modal frame.
+ const modalFrame = blockWrapper.querySelector('.activitypub-modal__frame');
+ if (!modalFrame || modalFrame.contains(event.target)) {
+ return;
+ }
+ actions.closeModal();
+ },
+ /**
+ * Positions the modal relative to the button that opened it.
+ */
+ positionModal() {
+ const {
+ blockId
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ const blockWrapper = document.getElementById(blockId);
+ if (!blockWrapper) {
+ return;
+ }
+ const modalOverlay = blockWrapper.querySelector('.activitypub-modal__overlay');
+ if (!modalOverlay) {
+ return;
+ }
+
+ // Reset any previously set positioning.
+ modalOverlay.style.top = '';
+ modalOverlay.style.left = '';
+ modalOverlay.style.right = '';
+ modalOverlay.style.bottom = '';
+
+ // Get button position relative to viewport.
+ const buttonRect = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getElement)().ref.getBoundingClientRect();
+
+ // Get viewport dimensions.
+ const viewportWidth = window.innerWidth;
+
+ // Get the block's position to calculate relative positioning.
+ const blockRect = blockWrapper.getBoundingClientRect();
+
+ // Calculate position relative to the block (our positioning context).
+ const relativeTop = buttonRect.bottom - blockRect.top;
+ const relativeLeft = buttonRect.left - blockRect.left;
+
+ // Calculate available space.
+ const spaceRight = viewportWidth - buttonRect.right;
+
+ // Default position (below button, relative to the block).
+ let position = {
+ top: `${relativeTop + 8}px`,
+ left: `${relativeLeft - 2}px` // -2 px to account for the button border.
+ };
+
+ // If not enough space to the right, align with the right edge.
+ if (spaceRight < 250) {
+ position.left = 'auto';
+ position.right = `${blockRect.right - buttonRect.right}px`;
+ }
+
+ // Apply the position.
+ Object.assign(modalOverlay.style, position);
+ },
+ /**
+ * Traps focus within the specified element.
+ *
+ * @param {Element} element The element to trap focus within.
+ */
+ trapFocus(element) {
+ const focusableElements = element.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]):not([readonly]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])');
+ const firstFocusableElement = focusableElements[0];
+ const lastFocusableElement = focusableElements[focusableElements.length - 1];
+
+ // If the first focusable element is the close button, set initial focus to the next element instead.
+ if (firstFocusableElement && firstFocusableElement.classList.contains('activitypub-modal__close') && focusableElements.length > 1) {
+ // Set initial focus to the second element, but keep firstFocusableElement as is for tab trapping.
+ focusableElements[1].focus();
+ } else {
+ // Otherwise focus the first element as usual.
+ firstFocusableElement.focus();
+ }
+ element.addEventListener('keydown', function (event) {
+ if (event.key !== 'Tab' && event.keyCode !== 9 /* KEYCODE_TAB */) {
+ return;
+ }
+ if (event.shiftKey) {
+ /* shift + tab */
+ if (document.activeElement === firstFocusableElement) {
+ lastFocusableElement.focus();
+ event.preventDefault();
+ }
+ } /* tab */else {
+ if (document.activeElement === lastFocusableElement) {
+ firstFocusableElement.focus();
+ event.preventDefault();
+ }
+ }
+ });
+ }
+ }
+ });
+}
+
+/***/ }),
+
+/***/ "@wordpress/interactivity":
+/*!*******************************************!*\
+ !*** external "@wordpress/interactivity" ***!
+ \*******************************************/
+/***/ ((module) => {
+
+module.exports = __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__;
+
+/***/ })
+
+/******/ });
+/************************************************************************/
+/******/ // The module cache
+/******/ var __webpack_module_cache__ = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/ // Check if module is in cache
+/******/ var cachedModule = __webpack_module_cache__[moduleId];
+/******/ if (cachedModule !== undefined) {
+/******/ return cachedModule.exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = __webpack_module_cache__[moduleId] = {
+/******/ // no module.id needed
+/******/ // no module.loaded needed
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/************************************************************************/
+/******/ /* webpack/runtime/define property getters */
+/******/ (() => {
+/******/ // define getter functions for harmony exports
+/******/ __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 */
+/******/ (() => {
+/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
+/******/ })();
+/******/
+/******/ /* webpack/runtime/make namespace object */
+/******/ (() => {
+/******/ // define __esModule on exports
+/******/ __webpack_require__.r = (exports) => {
+/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
+/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
+/******/ }
+/******/ Object.defineProperty(exports, '__esModule', { value: true });
+/******/ };
+/******/ })();
+/******/
+/************************************************************************/
+var __webpack_exports__ = {};
+// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
+(() => {
+/*!*******************************!*\
+ !*** ./src/follow-me/view.js ***!
+ \*******************************/
+__webpack_require__.r(__webpack_exports__);
+/* harmony import */ var _wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/interactivity */ "@wordpress/interactivity");
+/* harmony import */ var _button_style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./button-style */ "./src/follow-me/button-style.js");
+/* harmony import */ var _shared_modal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../shared/modal */ "./src/shared/modal/index.js");
+
+
+
+
+/** @var {object} wp WordPress global. */
+const {
+ apiFetch
+} = window.wp;
+(0,_shared_modal__WEBPACK_IMPORTED_MODULE_2__.createModalStore)('activitypub/follow-me');
+
+/**
+ * @typedef {Object} config
+ * @property {String} namespace ActivityPub REST Namespace.
+ * @property {Object} i18n Internationalization strings.
+ * @property {String} i18n.copy "Copy" button text.
+ * @property {String} i18n.copied "Copied" button text.
+ * @property {String} i18n.emptyProfileError Error message for empty remote profile.
+ * @property {String} i18n.genericError Generic error message.
+ * @property {String} i18n.invalidProfileError Error message for invalid remote profile.
+ */
+
+/**
+ * @typedef {Object} context
+ * @property {String} backgroundColor The background color for the button.
+ * @property {String} blockId The block ID.
+ * @property {String} buttonStyle The button style.
+ * @property {String} copyButtonText The copy button text.
+ * @property {String} errorMessage The error message.
+ * @property {boolean} isError Whether the remote profile input has an error.
+ * @property {boolean} isLoading Whether the remote profile is being submitted.
+ * @property {Object} modal The modal state.
+ * @property {boolean} modal.isOpen Whether the modal is open.
+ * @property {String} remoteProfile The remote profile.
+ * @property {String} template The template for the remote reply URL.
+ * @property {String} userId The user ID.
+ * @property {String} webfinger The webfinger of the user.
+ */
+
+const {
+ actions,
+ callbacks
+} = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.store)('activitypub/follow-me', {
+ actions: {
+ /**
+ * Copy the webfinger to clipboard.
+ */
+ copyToClipboard() {
+ const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ const {
+ i18n
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getConfig)();
+
+ // Use the Clipboard API to copy text.
+ navigator.clipboard.writeText(context.webfinger).then(() => {
+ // Update button text to show success.
+ context.copyButtonText = i18n.copied;
+
+ // Reset button text after 1 second.
+ setTimeout(() => {
+ context.copyButtonText = i18n.copy;
+ }, 1000);
+ }, error => {
+ // Log error if copying fails.
+ console.error('Could not copy text: ', error);
+ });
+ },
+ /**
+ * Update the remote profile value.
+ *
+ * @param {Event} event Input event.
+ */
+ updateRemoteProfile(event) {
+ const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ context.remoteProfile = event.target.value;
+ // Reset error state when input changes.
+ context.isError = false;
+ context.errorMessage = '';
+ },
+ /**
+ * Handle the opening of the modal.
+ *
+ * @param {Event} event The event that triggered the modal opening/closing.
+ * @param {String} event.key The key pressed, if any.
+ */
+ onKeydown(event) {
+ if ((0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getElement)().ref.tagName === 'A' && (event.key === 'Enter' || event.key === ' ')) {
+ event.preventDefault();
+ actions.toggleModal(event);
+ }
+ },
+ /**
+ * Handle keydown event for remote profile input.
+ *
+ * @param {Event} event Keydown event.
+ * @param {String} event.key The key pressed.
+ */
+ handleKeyDown(event) {
+ if (event.key === 'Enter') {
+ event.preventDefault();
+ actions.submitRemoteProfile();
+ }
+ },
+ /**
+ * Submit the remote profile.
+ */
+ submitRemoteProfile: function* () {
+ const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ const {
+ namespace,
+ i18n
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getConfig)();
+ const input = context.remoteProfile.trim();
+
+ // Validate input.
+ if (!input) {
+ context.isError = true;
+ context.errorMessage = i18n.emptyProfileError;
+ return;
+ }
+ if (!callbacks.isHandle(input)) {
+ context.isError = true;
+ context.errorMessage = i18n.invalidProfileError;
+ return;
+ }
+
+ // Set loading state.
+ context.isLoading = true;
+ context.isError = false;
+
+ // Construct the API path.
+ const path = `/${namespace}/actors/${context.userId}/remote-follow?resource=${encodeURIComponent(input)}`;
+ try {
+ // Make the API request.
+ const response = yield apiFetch({
+ path
+ });
+
+ // Set opening state.
+ context.isLoading = false;
+
+ // Open the remote follow URL in a new tab.
+ window.open(response.url, '_blank');
+
+ // Close the modal after opening the URL.
+ actions.closeModal(new Event('click'));
+ } catch (error) {
+ // Handle error.
+ console.error('Error submitting profile:', error);
+ context.isLoading = false;
+ context.isError = true;
+ context.errorMessage = error.message || i18n.genericError;
+ }
+ }
+ },
+ callbacks: {
+ /**
+ * Initialize button styles.
+ */
+ initButtonStyles: () => {
+ const {
+ buttonStyle,
+ backgroundColor,
+ blockId
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+
+ // Add dynamic button styles to the document.
+ if (blockId && buttonStyle) {
+ const styleElement = document.createElement('style');
+ const selector = `#${blockId}`;
+
+ // Use getBlockStyles from button-style.js to get the CSS string.
+ styleElement.textContent = (0,_button_style__WEBPACK_IMPORTED_MODULE_1__.getBlockStyles)(selector, buttonStyle, backgroundColor);
+ document.head.appendChild(styleElement);
+
+ // Add popup styles.
+ const popupStyleElement = document.createElement('style');
+ popupStyleElement.textContent = (0,_button_style__WEBPACK_IMPORTED_MODULE_1__.getPopupStyles)(buttonStyle);
+ document.head.appendChild(popupStyleElement);
+ }
+ },
+ /**
+ * Best guess whether a string is a valid ActivityPub handle.
+ *
+ * @param {string} string - String to check.
+ * @returns {boolean} True if string is a valid handle, false otherwise.
+ */
+ isHandle(string) {
+ // Check if the string starts with '@' and contains a valid URL.
+ const parts = string.replace(/^@/, '').split('@');
+ return parts.length === 2 && callbacks.isUrl(`https://${parts[1]}`);
+ },
+ /**
+ * Checks if a string is a valid URL.
+ *
+ * @param {string} string - String to check.
+ * @returns {boolean} True if string is a valid URL, false otherwise.
+ */
+ isUrl(string) {
+ try {
+ new URL(string);
+ return true;
+ } catch (_) {
+ return false;
+ }
+ },
+ /**
+ * Callback when modal is closed.
+ */
+ onModalClose() {
+ const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ context.isError = false;
+ }
+ }
+});
+})();
+
+
+//# sourceMappingURL=view.js.map
\ No newline at end of file
diff --git a/build/followers/index.asset.php b/build/followers/index.asset.php
index 1b7f5f7e96..d97018969b 100644
--- a/build/followers/index.asset.php
+++ b/build/followers/index.asset.php
@@ -1 +1 @@
- array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'd864454e562ad019ef94');
+ array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '2e0d2ddf4bc6053b238d');
diff --git a/build/followers/index.js b/build/followers/index.js
index ac81f553f6..5e9c4e7050 100644
--- a/build/followers/index.js
+++ b/build/followers/index.js
@@ -1,2 +1,1033 @@
-(()=>{"use strict";var e,t={454:(e,t,s)=>{const a=window.wp.blocks,r=window.wp.primitives,l=window.ReactJSXRuntime;var i=(0,l.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.jsx)(r.Path,{d:"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z",fillRule:"evenodd"})});const o=[{attributes:{title:{type:"string",default:"Fediverse Followers"},selectedUser:{type:"string",default:"blog"},per_page:{type:"number",default:10},order:{type:"string",default:"desc",enum:["asc","desc"]}},supports:{html:!1},isEligible:({title:e})=>!!e,migrate:({title:e,...t})=>[t,[(0,a.createBlock)("core/heading",{content:e,level:3})]]}],n=window.wp.apiFetch;var c=s.n(n);const p=window.wp.components,u=window.wp.blockEditor,d=window.wp.coreData,v=window.wp.data,h=window.wp.element,g=window.wp.url,w=window.wp.i18n;function f(){return window._activityPubOptions||{}}function b({name:e}){const{enabled:t}=f(),s=t?.blog?"":(0,w.__)("It will be empty in other non-author contexts.","activitypub"),a=(0,w.sprintf)(/* translators: %1$s: block name, %2$s: extra information for non-author context */ /* translators: %1$s: block name, %2$s: extra information for non-author context */
-(0,w.__)("This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s","activitypub"),e,s).trim();return(0,l.jsx)(p.Card,{children:(0,l.jsx)(p.CardBody,{children:(0,h.createInterpolateElement)(a,{strong:(0,l.jsx)("strong",{})})})})}function m({selectedUser:e,per_page:t,order:s,page:a,setPage:r,followerData:i=!1}){const o="blog"===e?0:e,[n,p]=(0,h.useState)([]),[u,d]=(0,h.useState)(0),[v,b]=(0,h.useState)(0),[m,y]=(0,h.useState)(1),j=a||m,N=r||y,k=(e,s)=>{p(e),b(s),d(Math.ceil(s/t))};return(0,h.useEffect)(()=>{if(i&&1===j)return k(i.followers,i.total);const e=function(e,t,s,a){const{namespace:r}=f(),l=`/${r}/actors/${e}/followers`,i={per_page:t,order:s,page:a,context:"full"};return(0,g.addQueryArgs)(l,i)}(o,t,s,j);c()({path:e}).then(({orderedItems:e,totalItems:t})=>k(e,t)).catch(()=>k([],0))},[o,t,s,j,i]),(0,l.jsxs)("div",{className:"followers-container",children:[n.length?(0,l.jsx)("ul",{className:"followers-list",children:n.map(e=>(0,l.jsx)("li",{className:"follower-item",children:(0,l.jsx)(_,{...e})},e.url))}):(0,l.jsx)("p",{className:"followers-placeholder",children:(0,w.__)("No followers found.","activitypub")}),(0,l.jsx)(x,{page:j,pages:u,setPage:N})]})}function x({page:e,pages:t,setPage:s}){if(t<=1)return null;const a=e<=1,r=e>=t;return(0,l.jsxs)("nav",{className:"followers-pagination",role:"navigation",children:[(0,l.jsx)("h1",{className:"screen-reader-text",children:(0,w.__)("Follower navigation","activitypub")}),(0,l.jsx)("a",{className:"pagination-previous","aria-disabled":a,"aria-label":(0,w.__)("Previous page","activitypub"),onClick:t=>{t.preventDefault(),s(e-1)},children:(0,w.__)("Previous","activitypub")}),(0,l.jsx)("div",{className:"pagination-info",children:`${e} / ${t}`}),(0,l.jsx)("a",{className:"pagination-next","aria-disabled":r,"aria-label":(0,w.__)("Next page","activitypub"),onClick:t=>{t.preventDefault(),s(e+1)},children:(0,w.__)("Next","activitypub")})]})}function _({name:e,icon:t,url:s,preferredUsername:a}){const r=`@${a}`,{defaultAvatarUrl:i}=f(),o=t?.url||i;return(0,l.jsxs)("a",{className:"follower-link",href:s,title:r,onClick:e=>e.preventDefault(),children:[(0,l.jsx)("img",{width:"48",height:"48",src:o,className:"follower-avatar",alt:e,onError:e=>{e.target.src=i}}),(0,l.jsxs)("div",{className:"follower-info",children:[(0,l.jsx)("span",{className:"follower-name",children:e}),(0,l.jsx)("span",{className:"follower-username",children:r})]}),(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",className:"external-link-icon","aria-hidden":"true",focusable:"false",fill:"currentColor",children:(0,l.jsx)("path",{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"})})]})}const y=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","name":"activitypub/followers","apiVersion":3,"version":"2.0.1","title":"Fediverse Followers","category":"widgets","description":"Display your followers from the Fediverse on your website.","textdomain":"activitypub","icon":"groups","supports":{"html":false,"interactivity":true},"attributes":{"selectedUser":{"type":"string","default":"blog"},"per_page":{"type":"number","default":10},"order":{"type":"string","default":"desc","enum":["asc","desc"]}},"usesContext":["postType","postId"],"styles":[{"name":"default","label":"Default","isDefault":true},{"name":"card","label":"Card"},{"name":"compact","label":"Compact"}],"editorScript":"file:./index.js","editorStyle":"file:./index.css","viewScriptModule":"file:./view.js","viewScript":"wp-api-fetch","style":["file:./style-index.css"],"render":"file:./render.php"}');(0,a.registerBlockType)(y,{deprecated:o,edit:function({attributes:e,setAttributes:t,context:{postType:s,postId:a}}){const{className:r="",order:i,per_page:o,selectedUser:n}=e,g=(0,u.useBlockProps)(),[x,_]=(0,h.useState)(1),y=[{label:(0,w.__)("New to old","activitypub"),value:"desc"},{label:(0,w.__)("Old to new","activitypub"),value:"asc"}],j=function({withInherit:e=!1}){const{enabled:t,namespace:s}=f(),[a,r]=(0,h.useState)(!1),{fetchedUsers:l,isLoadingUsers:i}=(0,v.useSelect)(e=>{const{getUsers:s,getIsResolving:a}=e("core");return{fetchedUsers:t?.users?s({capabilities:"activitypub"}):null,isLoadingUsers:!!t?.users&&a("getUsers",[{capabilities:"activitypub"}])}},[]),o=(0,v.useSelect)(e=>l||i?null:e("core").getCurrentUser(),[l,i]);(0,h.useEffect)(()=>{l||i||!o||c()({path:`/${s}/actors/${o.id}`,method:"HEAD",headers:{Accept:"application/activity+json"},parse:!1}).then(()=>r(!0)).catch(()=>r(!1))},[l,i,o]);const n=l||(o&&a?[{id:o.id,name:o.name}]:[]);return(0,h.useMemo)(()=>{if(!n.length)return[];const s=[];return t?.blog&&l&&s.push({label:(0,w.__)("Blog","activitypub"),value:"blog"}),e&&t?.users&&l&&s.push({label:(0,w.__)("Dynamic User","activitypub"),value:"inherit"}),n.reduce((e,t)=>(e.push({label:t.name,value:`${t.id}`}),e),s)},[n])}({withInherit:!0}),N=e=>s=>{_(1),t({[e]:s})},k=(0,v.useSelect)(e=>{const{getEditedEntityRecord:t}=e(d.store),r=t("postType",s,a)?.author;return null!=r?r:null},[s,a]);(0,h.useEffect)(()=>{j.length&&(j.find(({value:e})=>e===n)||t({selectedUser:j[0].value}))},[n,j]);const S=[["core/heading",{level:3,placeholder:(0,w.__)("Fediverse Followers","activitypub"),content:(0,w.__)("Fediverse Followers","activitypub")}]];return(0,l.jsxs)("div",{...g,children:[(0,l.jsx)(u.InspectorControls,{children:(0,l.jsxs)(p.PanelBody,{title:(0,w.__)("Followers Options","activitypub"),children:[j.length>1&&(0,l.jsx)(p.SelectControl,{label:(0,w.__)("Select User","activitypub"),value:n,options:j,onChange:N("selectedUser"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),(0,l.jsx)(p.SelectControl,{label:(0,w.__)("Sort","activitypub"),value:i,options:y,onChange:N("order"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),(0,l.jsx)(p.RangeControl,{label:(0,w.__)("Number of Followers","activitypub"),value:o,onChange:N("per_page"),min:1,max:10,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})]})},"setting"),(0,l.jsxs)("div",{className:"wp-block-activitypub-followers "+r,children:[(0,l.jsx)(u.InnerBlocks,{template:S,allowedBlocks:["core/heading"],templateLock:"all",renderAppender:!1}),"inherit"===n?k?(0,l.jsx)(m,{...e,page:x,setPage:_,selectedUser:k}):(0,l.jsx)(b,{name:(0,w.__)("Followers","activitypub")}):(0,l.jsx)(m,{...e,page:x,setPage:_})]})]})},save:function(){const e=u.useBlockProps.save(),t=u.useInnerBlocksProps.save(e);return(0,l.jsx)("div",{...t})},icon:i})}},s={};function a(e){var r=s[e];if(void 0!==r)return r.exports;var l=s[e]={exports:{}};return t[e](l,l.exports,a),l.exports}a.m=t,e=[],a.O=(t,s,r,l)=>{if(!s){var i=1/0;for(p=0;p=l)&&Object.keys(a.O).every(e=>a.O[e](s[n]))?s.splice(n--,1):(o=!1,l0&&e[p-1][2]>l;p--)e[p]=e[p-1];e[p]=[s,r,l]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var s in t)a.o(t,s)&&!a.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={149:0,17:0};a.O.j=t=>0===e[t];var t=(t,s)=>{var r,l,[i,o,n]=s,c=0;if(i.some(t=>0!==e[t])){for(r in o)a.o(o,r)&&(a.m[r]=o[r]);if(n)var p=n(a)}for(t&&t(s);ca(454));r=a.O(r)})();
\ No newline at end of file
+/******/ (() => { // webpackBootstrap
+/******/ "use strict";
+/******/ var __webpack_modules__ = ({
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/people.js":
+/*!**********************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/people.js ***!
+ \**********************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ people_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/people.tsx
+
+
+var people_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(
+ _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path,
+ {
+ d: "M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z",
+ fillRule: "evenodd"
+ }
+) });
+
+//# sourceMappingURL=people.js.map
+
+
+/***/ }),
+
+/***/ "./src/followers/block.json":
+/*!**********************************!*\
+ !*** ./src/followers/block.json ***!
+ \**********************************/
+/***/ ((module) => {
+
+module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","name":"activitypub/followers","apiVersion":3,"version":"2.0.1","title":"Fediverse Followers","category":"widgets","description":"Display your followers from the Fediverse on your website.","textdomain":"activitypub","icon":"groups","supports":{"html":false,"interactivity":true},"attributes":{"selectedUser":{"type":"string","default":"blog"},"per_page":{"type":"number","default":10},"order":{"type":"string","default":"desc","enum":["asc","desc"]}},"usesContext":["postType","postId"],"styles":[{"name":"default","label":"Default","isDefault":true},{"name":"card","label":"Card"},{"name":"compact","label":"Compact"}],"editorScript":"file:./index.js","editorStyle":"file:./index.css","viewScriptModule":"file:./view.js","viewScript":"wp-api-fetch","style":["file:./style-index.css"],"render":"file:./render.php"}');
+
+/***/ }),
+
+/***/ "./src/followers/deprecations.js":
+/*!***************************************!*\
+ !*** ./src/followers/deprecations.js ***!
+ \***************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
+/* harmony export */ });
+/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
+/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
+
+
+/**
+ * Deprecation for the followers block to handle the migration from custom title to InnerBlocks.
+ */
+const v1 = {
+ attributes: {
+ title: {
+ type: 'string',
+ default: 'Fediverse Followers'
+ },
+ selectedUser: {
+ type: 'string',
+ default: 'blog'
+ },
+ per_page: {
+ type: 'number',
+ default: 10
+ },
+ order: {
+ type: 'string',
+ default: 'desc',
+ enum: ['asc', 'desc']
+ }
+ },
+ supports: {
+ html: false
+ },
+ /**
+ * Checks if the block is eligible for migration.
+ *
+ * @param {Object} attributes The block attributes.
+ *
+ * @return {boolean} Whether the block is eligible for migration.
+ */
+ isEligible({
+ title
+ }) {
+ return !!title;
+ },
+ /**
+ * Migrates the block to use a core heading block instead of the custom heading attribute.
+ *
+ * @param {Object} attributes The attributes for the block.
+ *
+ * @return {[Object, Array]} An array with the new block attributes and inner blocks.
+ */
+ migrate: ({
+ title,
+ ...newAttributes
+ }) => {
+ const headingBlock = (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.createBlock)('core/heading', {
+ content: title,
+ level: 3
+ });
+ return [newAttributes, [headingBlock]];
+ }
+};
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([v1]);
+
+/***/ }),
+
+/***/ "./src/followers/edit.js":
+/*!*******************************!*\
+ !*** ./src/followers/edit.js ***!
+ \*******************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ Edit)
+/* harmony export */ });
+/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
+/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
+/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data");
+/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__);
+/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
+/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_6__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__);
+/* harmony import */ var _shared_use_options__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../shared/use-options */ "./src/shared/use-options.js");
+/* harmony import */ var _shared_use_user_options__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../shared/use-user-options */ "./src/shared/use-user-options.js");
+/* harmony import */ var _shared_inherit_block_fallback__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../shared/inherit-block-fallback */ "./src/shared/inherit-block-fallback.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__);
+
+
+
+
+
+
+
+
+
+
+
+
+/**
+ * Edit component.
+ *
+ * @param {Object} props Component props.
+ * @param {Object} props.attributes Block attributes.
+ * @param {Function} props.setAttributes Set block attributes.
+ * @param {Object} props.context Block context.
+ * @param {string} props.context.postType Post type.
+ * @param {number} props.context.postId Post ID.
+ *
+ * @return {JSX.Element} Edit component.
+ */
+
+function Edit({
+ attributes,
+ setAttributes,
+ context: {
+ postType,
+ postId
+ }
+}) {
+ const {
+ className = '',
+ order,
+ per_page,
+ selectedUser
+ } = attributes;
+ const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps)();
+ const [page, setPage] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useState)(1);
+ const orderOptions = [{
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('New to old', 'activitypub'),
+ value: 'desc'
+ }, {
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Old to new', 'activitypub'),
+ value: 'asc'
+ }];
+ const usersOptions = (0,_shared_use_user_options__WEBPACK_IMPORTED_MODULE_9__.useUserOptions)({
+ withInherit: true
+ });
+ const setAttributeWithPageReset = key => value => {
+ setPage(1);
+ setAttributes({
+ [key]: value
+ });
+ };
+ const authorId = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => {
+ const {
+ getEditedEntityRecord
+ } = select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_3__.store);
+ const _authorId = getEditedEntityRecord('postType', postType, postId)?.author;
+ return _authorId !== null && _authorId !== void 0 ? _authorId : null;
+ }, [postType, postId]);
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useEffect)(() => {
+ // if there are no users yet, do nothing
+ if (!usersOptions.length) {
+ return;
+ }
+ // ensure that the selected user is in the list of options, if not, select the first available user
+ if (!usersOptions.find(({
+ value
+ }) => value === selectedUser)) {
+ setAttributes({
+ selectedUser: usersOptions[0].value
+ });
+ }
+ }, [selectedUser, usersOptions]);
+
+ // Template for InnerBlocks - allows only a heading block.
+ const TEMPLATE = [['core/heading', {
+ level: 3,
+ placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Fediverse Followers', 'activitypub'),
+ content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Fediverse Followers', 'activitypub')
+ }]];
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
+ ...blockProps,
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.InspectorControls, {
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelBody, {
+ title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Followers Options', 'activitypub'),
+ children: [usersOptions.length > 1 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl, {
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Select User', 'activitypub'),
+ value: selectedUser,
+ options: usersOptions,
+ onChange: setAttributeWithPageReset('selectedUser'),
+ __next40pxDefaultSize: true,
+ __nextHasNoMarginBottom: true
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl, {
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Sort', 'activitypub'),
+ value: order,
+ options: orderOptions,
+ onChange: setAttributeWithPageReset('order'),
+ __next40pxDefaultSize: true,
+ __nextHasNoMarginBottom: true
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.RangeControl, {
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Number of Followers', 'activitypub'),
+ value: per_page,
+ onChange: setAttributeWithPageReset('per_page'),
+ min: 1,
+ max: 10,
+ __next40pxDefaultSize: true,
+ __nextHasNoMarginBottom: true
+ })]
+ })
+ }, "setting"), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
+ className: 'wp-block-activitypub-followers ' + className,
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.InnerBlocks, {
+ template: TEMPLATE,
+ allowedBlocks: ['core/heading'],
+ templateLock: 'all',
+ renderAppender: false
+ }), selectedUser === 'inherit' ? authorId ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(Followers, {
+ ...attributes,
+ page: page,
+ setPage: setPage,
+ selectedUser: authorId
+ }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_shared_inherit_block_fallback__WEBPACK_IMPORTED_MODULE_10__.InheritModeBlockFallback, {
+ name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Followers', 'activitypub')
+ }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(Followers, {
+ ...attributes,
+ page: page,
+ setPage: setPage
+ })]
+ })]
+ });
+}
+
+/**
+ * Builds the API path for fetching followers.
+ *
+ * @param {number} userId - The ID of the user whose followers are being fetched.
+ * @param {number} per_page - The number of followers to fetch per page.
+ * @param {string} order - The order in which to fetch followers ('asc' or 'desc').
+ * @param {number} page - The page number to fetch.
+ * @return {string} The API path with query arguments for fetching followers.
+ */
+function getPath(userId, per_page, order, page) {
+ const {
+ namespace
+ } = (0,_shared_use_options__WEBPACK_IMPORTED_MODULE_8__.useOptions)();
+ const path = `/${namespace}/actors/${userId}/followers`;
+ const args = {
+ per_page,
+ order,
+ page,
+ context: 'full'
+ };
+ return (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_6__.addQueryArgs)(path, args);
+}
+
+/**
+ * Component to display followers of a user.
+ *
+ * @param {Object} props - The component props.
+ * @param {String} props.selectedUser - The ID of the user whose followers are being fetched.
+ * @param {number} props.per_page - The number of followers to fetch per page.
+ * @param {string} props.order - The order in which to fetch followers ('asc' or 'desc').
+ * @param {number} props.page - The page number to fetch.
+ * @param {function} props.setPage - The function to set the page number.
+ * @param {Object} props.followerData - Optional pre-fetched follower data.
+ */
+function Followers({
+ selectedUser,
+ per_page,
+ order,
+ page: passedPage,
+ setPage: passedSetPage,
+ followerData = false
+}) {
+ const userId = selectedUser === 'blog' ? 0 : selectedUser;
+ const [followers, setFollowers] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useState)([]);
+ const [pages, setPages] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useState)(0);
+ const [total, setTotal] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useState)(0);
+ const [localPage, setLocalPage] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useState)(1);
+ const page = passedPage || localPage;
+ const setPage = passedSetPage || setLocalPage;
+ const setData = (followers, total) => {
+ setFollowers(followers);
+ setTotal(total);
+ setPages(Math.ceil(total / per_page));
+ };
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useEffect)(() => {
+ if (followerData && page === 1) {
+ return setData(followerData.followers, followerData.total);
+ }
+ const path = getPath(userId, per_page, order, page);
+ _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default()({
+ path
+ }).then(({
+ orderedItems,
+ totalItems
+ }) => setData(orderedItems, totalItems)).catch(() => setData([], 0));
+ }, [userId, per_page, order, page, followerData]);
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
+ className: "followers-container",
+ children: [followers.length ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("ul", {
+ className: "followers-list",
+ children: followers.map(follower => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("li", {
+ className: "follower-item",
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(Follower, {
+ ...follower
+ })
+ }, follower.url))
+ }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("p", {
+ className: "followers-placeholder",
+ children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('No followers found.', 'activitypub')
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(Pagination, {
+ page: page,
+ pages: pages,
+ setPage: setPage
+ })]
+ });
+}
+
+/**
+ * Component to display pagination navigation.
+ *
+ * @param {Object} props - The component props.
+ * @param {number} props.page - The current page number.
+ * @param {number} props.pages - The total number of pages.
+ * @param {function} props.setPage - The function to set the page number.
+ */
+function Pagination({
+ page,
+ pages,
+ setPage
+}) {
+ if (pages <= 1) {
+ return null;
+ }
+ const disablePreviousLink = page <= 1;
+ const disableNextLink = page >= pages;
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("nav", {
+ className: "followers-pagination",
+ role: "navigation",
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("h1", {
+ className: "screen-reader-text",
+ children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Follower navigation', 'activitypub')
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("a", {
+ className: "pagination-previous",
+ "aria-disabled": disablePreviousLink,
+ "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Previous page', 'activitypub'),
+ onClick: event => {
+ event.preventDefault();
+ setPage(page - 1);
+ },
+ children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Previous', 'activitypub')
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
+ className: "pagination-info",
+ children: `${page} / ${pages}`
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("a", {
+ className: "pagination-next",
+ "aria-disabled": disableNextLink,
+ "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Next page', 'activitypub'),
+ onClick: event => {
+ event.preventDefault();
+ setPage(page + 1);
+ },
+ children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Next', 'activitypub')
+ })]
+ });
+}
+
+/**
+ * Component to display a single follower.
+ *
+ * @param {Object} props - The component props.
+ * @param {string} props.name - The name of the follower.
+ * @param {Object} props.icon - The icon of the follower.
+ * @param {string} props.url - The URL of the follower.
+ * @param {string} props.preferredUsername - The preferred username of the follower.
+ */
+function Follower({
+ name,
+ icon,
+ url,
+ preferredUsername
+}) {
+ const handle = `@${preferredUsername}`;
+ const {
+ defaultAvatarUrl
+ } = (0,_shared_use_options__WEBPACK_IMPORTED_MODULE_8__.useOptions)();
+ const avatar = icon?.url || defaultAvatarUrl;
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("a", {
+ className: "follower-link",
+ href: url,
+ title: handle,
+ onClick: event => event.preventDefault(),
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("img", {
+ width: "48",
+ height: "48",
+ src: avatar,
+ className: "follower-avatar",
+ alt: name,
+ onError: event => {
+ event.target.src = defaultAvatarUrl;
+ }
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
+ className: "follower-info",
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
+ className: "follower-name",
+ children: name
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
+ className: "follower-username",
+ children: handle
+ })]
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("svg", {
+ xmlns: "http://www.w3.org/2000/svg",
+ viewBox: "0 0 24 24",
+ width: "24",
+ height: "24",
+ className: "external-link-icon",
+ "aria-hidden": "true",
+ focusable: "false",
+ fill: "currentColor",
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("path", {
+ d: "M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"
+ })
+ })]
+ });
+}
+
+/***/ }),
+
+/***/ "./src/followers/index.js":
+/*!********************************!*\
+ !*** ./src/followers/index.js ***!
+ \********************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
+/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/people.js");
+/* harmony import */ var _deprecations__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./deprecations */ "./src/followers/deprecations.js");
+/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./edit */ "./src/followers/edit.js");
+/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/followers/block.json");
+/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./save */ "./src/followers/save.js");
+/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./style.scss */ "./src/followers/style.scss");
+
+
+
+
+
+
+
+(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__, {
+ deprecated: _deprecations__WEBPACK_IMPORTED_MODULE_2__["default"],
+ edit: _edit__WEBPACK_IMPORTED_MODULE_3__["default"],
+ save: _save__WEBPACK_IMPORTED_MODULE_5__["default"],
+ icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__["default"]
+});
+
+/***/ }),
+
+/***/ "./src/followers/save.js":
+/*!*******************************!*\
+ !*** ./src/followers/save.js ***!
+ \*******************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ save)
+/* harmony export */ });
+/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
+/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+
+
+/**
+ * Save function for the Followers block.
+ *
+ * @return {JSX.Element} Element to render.
+ */
+
+function save() {
+ const blockProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save();
+ const innerBlocksProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useInnerBlocksProps.save(blockProps);
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
+ ...innerBlocksProps
+ });
+}
+
+/***/ }),
+
+/***/ "./src/followers/style.scss":
+/*!**********************************!*\
+ !*** ./src/followers/style.scss ***!
+ \**********************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+// extracted by mini-css-extract-plugin
+
+
+/***/ }),
+
+/***/ "./src/shared/inherit-block-fallback.js":
+/*!**********************************************!*\
+ !*** ./src/shared/inherit-block-fallback.js ***!
+ \**********************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ InheritModeBlockFallback: () => (/* binding */ InheritModeBlockFallback)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _use_options__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./use-options */ "./src/shared/use-options.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
+
+
+
+
+
+/**
+ * Block fallback component for inheriting user context in ActivityPub blocks.
+ *
+ * @param {Object} props
+ * @param {string} props.name - Name of the block.
+ * @returns {JSX.Element} Rendered fallback block.
+ */
+
+function InheritModeBlockFallback({
+ name
+}) {
+ const {
+ enabled
+ } = (0,_use_options__WEBPACK_IMPORTED_MODULE_3__.useOptions)();
+ const nonAuthorExtra = enabled?.blog ? '' : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('It will be empty in other non-author contexts.', 'activitypub');
+ const text = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %1$s: block name, %2$s: extra information for non-author context */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s', 'activitypub'), name, nonAuthorExtra).trim();
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Card, {
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.CardBody, {
+ children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createInterpolateElement)(text, {
+ strong: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("strong", {})
+ })
+ })
+ });
+}
+
+/***/ }),
+
+/***/ "./src/shared/use-options.js":
+/*!***********************************!*\
+ !*** ./src/shared/use-options.js ***!
+ \***********************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ useOptions: () => (/* binding */ useOptions)
+/* harmony export */ });
+/**
+ * React hook to return the ActivityPub options object from the global window.
+ *
+ * @returns {Object} The options object.
+ */
+function useOptions() {
+ return window._activityPubOptions || {};
+}
+
+/***/ }),
+
+/***/ "./src/shared/use-user-options.js":
+/*!****************************************!*\
+ !*** ./src/shared/use-user-options.js ***!
+ \****************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ useUserOptions: () => (/* binding */ useUserOptions)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
+/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _use_options__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./use-options */ "./src/shared/use-options.js");
+
+
+
+
+
+
+/**
+ * React hook providing user options for ActivityPub blocks.
+ *
+ * @param {Object} params
+ * @param {boolean} params.withInherit - Whether to include the inherit option.
+ * @returns {Array} List of user option objects.
+ */
+function useUserOptions({
+ withInherit = false
+}) {
+ /**
+ * ActivityPub options.
+ *
+ * @type {Object}
+ * @property {boolean} enabled.users - Whether users are enabled.
+ * @property {boolean} enabled.blog - Whether the blog user is enabled.
+ */
+ const {
+ enabled,
+ namespace
+ } = (0,_use_options__WEBPACK_IMPORTED_MODULE_4__.useOptions)();
+ const [currentUserCanActivityPub, setCurrentUserCanActivityPub] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
+ const {
+ fetchedUsers,
+ isLoadingUsers
+ } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
+ const {
+ getUsers,
+ getIsResolving
+ } = select('core');
+ return {
+ fetchedUsers: enabled?.users ? getUsers({
+ capabilities: 'activitypub'
+ }) : null,
+ isLoadingUsers: enabled?.users ? getIsResolving('getUsers', [{
+ capabilities: 'activitypub'
+ }]) : false
+ };
+ }, []);
+
+ // Only fetch current user if fetchedUsers is empty and we're not still loading.
+ const currentUser = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => fetchedUsers || isLoadingUsers ? null : select('core').getCurrentUser(), [fetchedUsers, isLoadingUsers]);
+
+ // Test if current user has activitypub capability by trying to access their actor endpoint.
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
+ if (fetchedUsers || isLoadingUsers || !currentUser) {
+ return;
+ }
+ _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3___default()({
+ path: `/${namespace}/actors/${currentUser.id}`,
+ method: 'HEAD',
+ headers: {
+ Accept: 'application/activity+json'
+ },
+ parse: false
+ }).then(() => setCurrentUserCanActivityPub(true)).catch(() => setCurrentUserCanActivityPub(false));
+ }, [fetchedUsers, isLoadingUsers, currentUser]);
+ const users = fetchedUsers || (currentUser && currentUserCanActivityPub ? [{
+ id: currentUser.id,
+ name: currentUser.name
+ }] : []);
+
+ /**
+ * Memoized computation of user options for block settings.
+ */
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
+ if (!users.length) {
+ return [];
+ }
+ const userKeywords = [];
+ if (enabled?.blog && fetchedUsers) {
+ userKeywords.push({
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Blog', 'activitypub'),
+ value: 'blog'
+ });
+ }
+
+ // Only show the inherit option when explicitly asked for and users are enabled.
+ if (withInherit && enabled?.users && fetchedUsers) {
+ userKeywords.push({
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Dynamic User', 'activitypub'),
+ value: 'inherit'
+ });
+ }
+
+ /**
+ * Reduce users into keyword/value pairs for options.
+ */
+ return users.reduce((acc, user) => {
+ acc.push({
+ label: user.name,
+ value: `${user.id}` // Casting to string because that's how Gutenberg stores the attribute.
+ });
+ return acc;
+ }, userKeywords);
+ }, [users]);
+}
+
+/***/ }),
+
+/***/ "@wordpress/api-fetch":
+/*!**********************************!*\
+ !*** external ["wp","apiFetch"] ***!
+ \**********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["apiFetch"];
+
+/***/ }),
+
+/***/ "@wordpress/block-editor":
+/*!*************************************!*\
+ !*** external ["wp","blockEditor"] ***!
+ \*************************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["blockEditor"];
+
+/***/ }),
+
+/***/ "@wordpress/blocks":
+/*!********************************!*\
+ !*** external ["wp","blocks"] ***!
+ \********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["blocks"];
+
+/***/ }),
+
+/***/ "@wordpress/components":
+/*!************************************!*\
+ !*** external ["wp","components"] ***!
+ \************************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["components"];
+
+/***/ }),
+
+/***/ "@wordpress/core-data":
+/*!**********************************!*\
+ !*** external ["wp","coreData"] ***!
+ \**********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["coreData"];
+
+/***/ }),
+
+/***/ "@wordpress/data":
+/*!******************************!*\
+ !*** external ["wp","data"] ***!
+ \******************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["data"];
+
+/***/ }),
+
+/***/ "@wordpress/element":
+/*!*********************************!*\
+ !*** external ["wp","element"] ***!
+ \*********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["element"];
+
+/***/ }),
+
+/***/ "@wordpress/i18n":
+/*!******************************!*\
+ !*** external ["wp","i18n"] ***!
+ \******************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["i18n"];
+
+/***/ }),
+
+/***/ "@wordpress/primitives":
+/*!************************************!*\
+ !*** external ["wp","primitives"] ***!
+ \************************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["primitives"];
+
+/***/ }),
+
+/***/ "@wordpress/url":
+/*!*****************************!*\
+ !*** external ["wp","url"] ***!
+ \*****************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["url"];
+
+/***/ }),
+
+/***/ "react/jsx-runtime":
+/*!**********************************!*\
+ !*** external "ReactJSXRuntime" ***!
+ \**********************************/
+/***/ ((module) => {
+
+module.exports = window["ReactJSXRuntime"];
+
+/***/ })
+
+/******/ });
+/************************************************************************/
+/******/ // The module cache
+/******/ var __webpack_module_cache__ = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/ // Check if module is in cache
+/******/ var cachedModule = __webpack_module_cache__[moduleId];
+/******/ if (cachedModule !== undefined) {
+/******/ return cachedModule.exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = __webpack_module_cache__[moduleId] = {
+/******/ // no module.id needed
+/******/ // no module.loaded needed
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = __webpack_modules__;
+/******/
+/************************************************************************/
+/******/ /* webpack/runtime/chunk loaded */
+/******/ (() => {
+/******/ var deferred = [];
+/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
+/******/ if(chunkIds) {
+/******/ priority = priority || 0;
+/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
+/******/ deferred[i] = [chunkIds, fn, priority];
+/******/ return;
+/******/ }
+/******/ var notFulfilled = Infinity;
+/******/ for (var i = 0; i < deferred.length; i++) {
+/******/ var [chunkIds, fn, priority] = deferred[i];
+/******/ var fulfilled = true;
+/******/ for (var j = 0; j < chunkIds.length; j++) {
+/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
+/******/ chunkIds.splice(j--, 1);
+/******/ } else {
+/******/ fulfilled = false;
+/******/ if(priority < notFulfilled) notFulfilled = priority;
+/******/ }
+/******/ }
+/******/ if(fulfilled) {
+/******/ deferred.splice(i--, 1)
+/******/ var r = fn();
+/******/ if (r !== undefined) result = r;
+/******/ }
+/******/ }
+/******/ return result;
+/******/ };
+/******/ })();
+/******/
+/******/ /* webpack/runtime/compat get default export */
+/******/ (() => {
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = (module) => {
+/******/ var getter = module && module.__esModule ?
+/******/ () => (module['default']) :
+/******/ () => (module);
+/******/ __webpack_require__.d(getter, { a: getter });
+/******/ return getter;
+/******/ };
+/******/ })();
+/******/
+/******/ /* webpack/runtime/define property getters */
+/******/ (() => {
+/******/ // define getter functions for harmony exports
+/******/ __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 */
+/******/ (() => {
+/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
+/******/ })();
+/******/
+/******/ /* webpack/runtime/make namespace object */
+/******/ (() => {
+/******/ // define __esModule on 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/jsonp chunk loading */
+/******/ (() => {
+/******/ // no baseURI
+/******/
+/******/ // object to store loaded and loading chunks
+/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
+/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
+/******/ var installedChunks = {
+/******/ "followers/index": 0,
+/******/ "followers/style-index": 0
+/******/ };
+/******/
+/******/ // no chunk on demand loading
+/******/
+/******/ // no prefetching
+/******/
+/******/ // no preloaded
+/******/
+/******/ // no HMR
+/******/
+/******/ // no HMR manifest
+/******/
+/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
+/******/
+/******/ // install a JSONP callback for chunk loading
+/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
+/******/ var [chunkIds, moreModules, runtime] = data;
+/******/ // add "moreModules" to the modules object,
+/******/ // then flag all "chunkIds" as loaded and fire callback
+/******/ var moduleId, chunkId, i = 0;
+/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
+/******/ for(moduleId in moreModules) {
+/******/ if(__webpack_require__.o(moreModules, moduleId)) {
+/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
+/******/ }
+/******/ }
+/******/ if(runtime) var result = runtime(__webpack_require__);
+/******/ }
+/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
+/******/ for(;i < chunkIds.length; i++) {
+/******/ chunkId = chunkIds[i];
+/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
+/******/ installedChunks[chunkId][0]();
+/******/ }
+/******/ installedChunks[chunkId] = 0;
+/******/ }
+/******/ return __webpack_require__.O(result);
+/******/ }
+/******/
+/******/ var chunkLoadingGlobal = globalThis["webpackChunkwordpress_activitypub"] = globalThis["webpackChunkwordpress_activitypub"] || [];
+/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
+/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
+/******/ })();
+/******/
+/************************************************************************/
+/******/
+/******/ // startup
+/******/ // Load entry module and return exports
+/******/ // This entry module depends on other loaded chunks and execution need to be delayed
+/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["followers/style-index"], () => (__webpack_require__("./src/followers/index.js")))
+/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
+/******/
+/******/ })()
+;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/build/followers/style-index-rtl.css b/build/followers/style-index-rtl.css
index 3173399f46..3a3c74a9bf 100644
--- a/build/followers/style-index-rtl.css
+++ b/build/followers/style-index-rtl.css
@@ -1 +1,241 @@
-button{border:none}.wp-block-activitypub-followers{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;margin:16px 0}.wp-block-activitypub-followers .wp-block-heading{border-bottom:1px solid;margin:0 0 16px;padding:0 0 8px}.wp-block-activitypub-followers .followers-pagination,.wp-block-activitypub-followers .wp-block-heading{border-color:var(--wp--preset--color--foreground,var(--wp--preset--color--primary,#e0e0e0))}.wp-block-activitypub-followers .followers-container{position:relative}.wp-block-activitypub-followers .followers-container .followers-list{list-style:none;margin:0;padding:0}.wp-block-activitypub-followers .followers-container .follower-item{margin:0 0 8px}.wp-block-activitypub-followers .followers-container .follower-item:last-child{margin-bottom:0}.wp-block-activitypub-followers .followers-container .follower-link{align-items:center;border:none;border-radius:8px;box-shadow:none;display:flex;padding:8px;transition:background-color .2s ease}.wp-block-activitypub-followers .followers-container .follower-link:focus,.wp-block-activitypub-followers .followers-container .follower-link:hover{background-color:var(--wp--preset--color--subtle-background,var(--wp--preset--color--accent-2,var(--wp--preset--color--tertiary,var(--wp--preset--color--secondary,#f0f0f0))));box-shadow:none;outline:none}.wp-block-activitypub-followers .followers-container .follower-link:focus .external-link-icon,.wp-block-activitypub-followers .followers-container .follower-link:hover .external-link-icon{opacity:1}.wp-block-activitypub-followers .followers-container .follower-avatar{border:1px solid #e0e0e0;border-radius:50%;height:48px;margin-left:16px;-o-object-fit:cover;object-fit:cover;width:48px}.wp-block-activitypub-followers .followers-container .follower-info{display:flex;flex:1;flex-direction:column;line-height:1.3;overflow:hidden}.wp-block-activitypub-followers .followers-container .follower-name{font-weight:600;margin-bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-block-activitypub-followers .followers-container .follower-username{color:var(--wp--preset--color--very-dark-gray,#666);font-size:90%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-block-activitypub-followers .followers-container .external-link-icon{height:16px;margin-right:8px;transition:opacity .2s ease;width:16px}.wp-block-activitypub-followers .followers-container .followers-pagination{align-items:center;border-top-style:solid;border-top-width:1px;display:grid;grid-template-columns:1fr auto 1fr;margin-top:16px;padding-top:8px!important}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-info{color:var(--wp--preset--color--very-dark-gray,#666);font-size:90%;justify-self:center}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next,.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous{border:none;box-shadow:none;cursor:pointer;display:inline-block;font-size:90%;min-width:60px;padding:8px 0}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next[hidden],.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous[hidden]{display:none!important}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next[aria-disabled=true],.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous[aria-disabled=true]{cursor:not-allowed;opacity:.3;pointer-events:none;text-decoration:none}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous{justify-self:start;padding-left:8px}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous:before{content:"←"}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next{justify-self:end;padding-right:8px;text-align:left}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next:after{content:"→"}@media(max-width:480px){.wp-block-activitypub-followers .followers-container .followers-pagination{grid-template-columns:1fr 1fr}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-info{display:none}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next,.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous{align-items:center;font-size:100%;min-height:44px}}.wp-block-activitypub-followers .followers-container .followers-loading{align-items:center;background-color:hsla(0,0%,100%,.5);border-radius:8px;bottom:0;display:flex;justify-content:center;right:0;position:absolute;left:0;top:0}.wp-block-activitypub-followers .followers-container .followers-loading[aria-hidden=true]{display:none}.wp-block-activitypub-followers .followers-container .loading-spinner{animation:spin 1s ease-in-out infinite;border:3px solid color-mix(in srgb,var(--wp--preset--color--primary,#0073aa) 30%,transparent);border-radius:50%;border-top-color:var(--wp--preset--color--primary,#0073aa);height:40px;width:40px}@keyframes spin{to{transform:rotate(-1turn)}}.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block){background-color:var(--wp--preset--color--white,#fff);border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,.1);box-sizing:border-box;padding:24px}@media(max-width:480px){.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block){margin-right:-12px;margin-left:-12px}}.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .wp-block-heading{border-bottom:none;margin-bottom:16px;text-align:center}.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .follower-link{border:1px solid #e0e0e0;margin-bottom:8px}.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .follower-link:focus,.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .follower-link:hover{border-color:#c7c7c7}.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .followers-pagination{border:none;padding-bottom:0!important}.wp-block-activitypub-followers.is-style-compact .follower-link{padding:4px}.wp-block-activitypub-followers.is-style-compact .follower-avatar{height:36px;margin-left:8px;width:36px}.wp-block-activitypub-followers.is-style-compact .follower-name{font-size:90%}.wp-block-activitypub-followers.is-style-compact .follower-username{font-size:80%}.wp-block-activitypub-followers.is-style-compact .followers-pagination{margin-top:8px;padding-top:4px}.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-next,.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-previous{font-size:80%;padding-bottom:4px;padding-top:4px}@media(max-width:480px){.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-next,.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-previous{font-size:100%}}.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-info{font-size:80%}
+/*!*************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/followers/style.scss ***!
+ \*************************************************************************************************************************************************************************************************************************************************/
+@charset "UTF-8";
+button {
+ border: none;
+}
+.wp-block-activitypub-followers {
+ margin: 16px 0;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
+}
+.wp-block-activitypub-followers .wp-block-heading {
+ margin: 0 0 16px;
+ padding: 0 0 8px;
+ border-bottom: 1px solid;
+}
+.wp-block-activitypub-followers .wp-block-heading,
+.wp-block-activitypub-followers .followers-pagination {
+ border-color: var(--wp--preset--color--foreground, var(--wp--preset--color--primary, #e0e0e0));
+}
+.wp-block-activitypub-followers .followers-container {
+ position: relative;
+}
+.wp-block-activitypub-followers .followers-container .followers-list {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+.wp-block-activitypub-followers .followers-container .follower-item {
+ margin: 0 0 8px;
+}
+.wp-block-activitypub-followers .followers-container .follower-item:last-child {
+ margin-bottom: 0;
+}
+.wp-block-activitypub-followers .followers-container .follower-link {
+ display: flex;
+ align-items: center;
+ padding: 8px;
+ border: none;
+ border-radius: 8px;
+ box-shadow: none;
+ transition: background-color 0.2s ease;
+}
+.wp-block-activitypub-followers .followers-container .follower-link:hover, .wp-block-activitypub-followers .followers-container .follower-link:focus {
+ background-color: var(--wp--preset--color--subtle-background, var(--wp--preset--color--accent-2, var(--wp--preset--color--tertiary, var(--wp--preset--color--secondary, #f0f0f0))));
+ box-shadow: none;
+ outline: none;
+}
+.wp-block-activitypub-followers .followers-container .follower-link:hover .external-link-icon, .wp-block-activitypub-followers .followers-container .follower-link:focus .external-link-icon {
+ opacity: 1;
+}
+.wp-block-activitypub-followers .followers-container .follower-avatar {
+ width: 48px;
+ height: 48px;
+ border-radius: 50%;
+ -o-object-fit: cover;
+ object-fit: cover;
+ margin-left: 16px;
+ border: 1px solid #e0e0e0;
+}
+.wp-block-activitypub-followers .followers-container .follower-info {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ overflow: hidden;
+ line-height: 1.3;
+}
+.wp-block-activitypub-followers .followers-container .follower-name {
+ font-weight: 600;
+ margin-bottom: 2px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+.wp-block-activitypub-followers .followers-container .follower-username {
+ color: var(--wp--preset--color--very-dark-gray, #666);
+ font-size: 90%;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+.wp-block-activitypub-followers .followers-container .external-link-icon {
+ width: 16px;
+ height: 16px;
+ margin-right: 8px;
+ transition: opacity 0.2s ease;
+}
+.wp-block-activitypub-followers .followers-container .followers-pagination {
+ display: grid;
+ grid-template-columns: 1fr auto 1fr;
+ align-items: center;
+ margin-top: 16px;
+ padding-top: 8px !important;
+ border-top-style: solid;
+ border-top-width: 1px;
+}
+.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-info {
+ color: var(--wp--preset--color--very-dark-gray, #666);
+ font-size: 90%;
+ justify-self: center;
+}
+.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous,
+.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next {
+ border: none;
+ box-shadow: none;
+ cursor: pointer;
+ font-size: 90%;
+ display: inline-block;
+ padding: 8px 0;
+ min-width: 60px;
+}
+.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous[hidden],
+.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next[hidden] {
+ display: none !important;
+}
+.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous[aria-disabled=true],
+.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next[aria-disabled=true] {
+ opacity: 0.3;
+ cursor: not-allowed;
+ pointer-events: none;
+ text-decoration: none;
+}
+.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous {
+ justify-self: start;
+ padding-left: 8px;
+}
+.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous::before {
+ content: "←";
+}
+.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next {
+ justify-self: end;
+ padding-right: 8px;
+ text-align: left;
+}
+.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next::after {
+ content: "→";
+}
+@media (max-width: 480px) {
+ .wp-block-activitypub-followers .followers-container .followers-pagination {
+ grid-template-columns: 1fr 1fr;
+ }
+ .wp-block-activitypub-followers .followers-container .followers-pagination .pagination-info {
+ display: none;
+ }
+ .wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous,
+ .wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next {
+ min-height: 44px;
+ font-size: 100%;
+ align-items: center;
+ }
+}
+.wp-block-activitypub-followers .followers-container .followers-loading {
+ position: absolute;
+ top: 0;
+ right: 0;
+ left: 0;
+ bottom: 0;
+ background-color: rgba(255, 255, 255, 0.5);
+ border-radius: 8px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.wp-block-activitypub-followers .followers-container .followers-loading[aria-hidden=true] {
+ display: none;
+}
+.wp-block-activitypub-followers .followers-container .loading-spinner {
+ width: 40px;
+ height: 40px;
+ border: 3px solid color-mix(in srgb, var(--wp--preset--color--primary, #0073aa) 30%, transparent);
+ border-radius: 50%;
+ border-top-color: var(--wp--preset--color--primary, #0073aa);
+ animation: spin 1s ease-in-out infinite;
+}
+@keyframes spin {
+ to {
+ transform: rotate(-360deg);
+ }
+}
+.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) {
+ background-color: var(--wp--preset--color--white, #fff);
+ border-radius: 8px;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+ box-sizing: border-box;
+ padding: 24px;
+}
+@media (max-width: 480px) {
+ .wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) {
+ margin-right: -12px;
+ margin-left: -12px;
+ }
+}
+.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .wp-block-heading {
+ text-align: center;
+ border-bottom: none;
+ margin-bottom: 16px;
+}
+.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .follower-link {
+ border: 1px solid #e0e0e0;
+ margin-bottom: 8px;
+}
+.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .follower-link:hover, .wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .follower-link:focus {
+ border-color: rgb(198.5, 198.5, 198.5);
+}
+.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .followers-pagination {
+ border: none;
+ padding-bottom: 0 !important;
+}
+.wp-block-activitypub-followers.is-style-compact .follower-link {
+ padding: 4px;
+}
+.wp-block-activitypub-followers.is-style-compact .follower-avatar {
+ width: 36px;
+ height: 36px;
+ margin-left: 8px;
+}
+.wp-block-activitypub-followers.is-style-compact .follower-name {
+ font-size: 90%;
+}
+.wp-block-activitypub-followers.is-style-compact .follower-username {
+ font-size: 80%;
+}
+.wp-block-activitypub-followers.is-style-compact .followers-pagination {
+ margin-top: 8px;
+ padding-top: 4px;
+}
+.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-previous,
+.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-next {
+ padding-top: 4px;
+ padding-bottom: 4px;
+ font-size: 80%;
+}
+@media (max-width: 480px) {
+ .wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-previous,
+ .wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-next {
+ font-size: 100%;
+ }
+}
+.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-info {
+ font-size: 80%;
+}
diff --git a/build/followers/style-index.css b/build/followers/style-index.css
index f1afc8a644..830a0ce622 100644
--- a/build/followers/style-index.css
+++ b/build/followers/style-index.css
@@ -1 +1,243 @@
-button{border:none}.wp-block-activitypub-followers{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;margin:16px 0}.wp-block-activitypub-followers .wp-block-heading{border-bottom:1px solid;margin:0 0 16px;padding:0 0 8px}.wp-block-activitypub-followers .followers-pagination,.wp-block-activitypub-followers .wp-block-heading{border-color:var(--wp--preset--color--foreground,var(--wp--preset--color--primary,#e0e0e0))}.wp-block-activitypub-followers .followers-container{position:relative}.wp-block-activitypub-followers .followers-container .followers-list{list-style:none;margin:0;padding:0}.wp-block-activitypub-followers .followers-container .follower-item{margin:0 0 8px}.wp-block-activitypub-followers .followers-container .follower-item:last-child{margin-bottom:0}.wp-block-activitypub-followers .followers-container .follower-link{align-items:center;border:none;border-radius:8px;box-shadow:none;display:flex;padding:8px;transition:background-color .2s ease}.wp-block-activitypub-followers .followers-container .follower-link:focus,.wp-block-activitypub-followers .followers-container .follower-link:hover{background-color:var(--wp--preset--color--subtle-background,var(--wp--preset--color--accent-2,var(--wp--preset--color--tertiary,var(--wp--preset--color--secondary,#f0f0f0))));box-shadow:none;outline:none}.wp-block-activitypub-followers .followers-container .follower-link:focus .external-link-icon,.wp-block-activitypub-followers .followers-container .follower-link:hover .external-link-icon{opacity:1}.wp-block-activitypub-followers .followers-container .follower-avatar{border:1px solid #e0e0e0;border-radius:50%;height:48px;margin-right:16px;-o-object-fit:cover;object-fit:cover;width:48px}.wp-block-activitypub-followers .followers-container .follower-info{display:flex;flex:1;flex-direction:column;line-height:1.3;overflow:hidden}.wp-block-activitypub-followers .followers-container .follower-name{font-weight:600;margin-bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-block-activitypub-followers .followers-container .follower-username{color:var(--wp--preset--color--very-dark-gray,#666);font-size:90%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-block-activitypub-followers .followers-container .external-link-icon{height:16px;margin-left:8px;transition:opacity .2s ease;width:16px}.wp-block-activitypub-followers .followers-container .followers-pagination{align-items:center;border-top-style:solid;border-top-width:1px;display:grid;grid-template-columns:1fr auto 1fr;margin-top:16px;padding-top:8px!important}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-info{color:var(--wp--preset--color--very-dark-gray,#666);font-size:90%;justify-self:center}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next,.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous{border:none;box-shadow:none;cursor:pointer;display:inline-block;font-size:90%;min-width:60px;padding:8px 0}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next[hidden],.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous[hidden]{display:none!important}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next[aria-disabled=true],.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous[aria-disabled=true]{cursor:not-allowed;opacity:.3;pointer-events:none;text-decoration:none}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous{justify-self:start;padding-right:8px}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous:before{content:"←"}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next{justify-self:end;padding-left:8px;text-align:right}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next:after{content:"→"}@media(max-width:480px){.wp-block-activitypub-followers .followers-container .followers-pagination{grid-template-columns:1fr 1fr}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-info{display:none}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next,.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous{align-items:center;font-size:100%;min-height:44px}}.wp-block-activitypub-followers .followers-container .followers-loading{align-items:center;background-color:hsla(0,0%,100%,.5);border-radius:8px;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}.wp-block-activitypub-followers .followers-container .followers-loading[aria-hidden=true]{display:none}.wp-block-activitypub-followers .followers-container .loading-spinner{animation:spin 1s ease-in-out infinite;border:3px solid color-mix(in srgb,var(--wp--preset--color--primary,#0073aa) 30%,transparent);border-radius:50%;border-top-color:var(--wp--preset--color--primary,#0073aa);height:40px;width:40px}@keyframes spin{to{transform:rotate(1turn)}}.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block){background-color:var(--wp--preset--color--white,#fff);border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,.1);box-sizing:border-box;padding:24px}@media(max-width:480px){.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block){margin-left:-12px;margin-right:-12px}}.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .wp-block-heading{border-bottom:none;margin-bottom:16px;text-align:center}.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .follower-link{border:1px solid #e0e0e0;margin-bottom:8px}.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .follower-link:focus,.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .follower-link:hover{border-color:#c7c7c7}.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .followers-pagination{border:none;padding-bottom:0!important}.wp-block-activitypub-followers.is-style-compact .follower-link{padding:4px}.wp-block-activitypub-followers.is-style-compact .follower-avatar{height:36px;margin-right:8px;width:36px}.wp-block-activitypub-followers.is-style-compact .follower-name{font-size:90%}.wp-block-activitypub-followers.is-style-compact .follower-username{font-size:80%}.wp-block-activitypub-followers.is-style-compact .followers-pagination{margin-top:8px;padding-top:4px}.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-next,.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-previous{font-size:80%;padding-bottom:4px;padding-top:4px}@media(max-width:480px){.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-next,.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-previous{font-size:100%}}.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-info{font-size:80%}
+/*!*************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/followers/style.scss ***!
+ \*************************************************************************************************************************************************************************************************************************************************/
+@charset "UTF-8";
+button {
+ border: none;
+}
+.wp-block-activitypub-followers {
+ margin: 16px 0;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
+}
+.wp-block-activitypub-followers .wp-block-heading {
+ margin: 0 0 16px;
+ padding: 0 0 8px;
+ border-bottom: 1px solid;
+}
+.wp-block-activitypub-followers .wp-block-heading,
+.wp-block-activitypub-followers .followers-pagination {
+ border-color: var(--wp--preset--color--foreground, var(--wp--preset--color--primary, #e0e0e0));
+}
+.wp-block-activitypub-followers .followers-container {
+ position: relative;
+}
+.wp-block-activitypub-followers .followers-container .followers-list {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+.wp-block-activitypub-followers .followers-container .follower-item {
+ margin: 0 0 8px;
+}
+.wp-block-activitypub-followers .followers-container .follower-item:last-child {
+ margin-bottom: 0;
+}
+.wp-block-activitypub-followers .followers-container .follower-link {
+ display: flex;
+ align-items: center;
+ padding: 8px;
+ border: none;
+ border-radius: 8px;
+ box-shadow: none;
+ transition: background-color 0.2s ease;
+}
+.wp-block-activitypub-followers .followers-container .follower-link:hover, .wp-block-activitypub-followers .followers-container .follower-link:focus {
+ background-color: var(--wp--preset--color--subtle-background, var(--wp--preset--color--accent-2, var(--wp--preset--color--tertiary, var(--wp--preset--color--secondary, #f0f0f0))));
+ box-shadow: none;
+ outline: none;
+}
+.wp-block-activitypub-followers .followers-container .follower-link:hover .external-link-icon, .wp-block-activitypub-followers .followers-container .follower-link:focus .external-link-icon {
+ opacity: 1;
+}
+.wp-block-activitypub-followers .followers-container .follower-avatar {
+ width: 48px;
+ height: 48px;
+ border-radius: 50%;
+ -o-object-fit: cover;
+ object-fit: cover;
+ margin-right: 16px;
+ border: 1px solid #e0e0e0;
+}
+.wp-block-activitypub-followers .followers-container .follower-info {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ overflow: hidden;
+ line-height: 1.3;
+}
+.wp-block-activitypub-followers .followers-container .follower-name {
+ font-weight: 600;
+ margin-bottom: 2px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+.wp-block-activitypub-followers .followers-container .follower-username {
+ color: var(--wp--preset--color--very-dark-gray, #666);
+ font-size: 90%;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+.wp-block-activitypub-followers .followers-container .external-link-icon {
+ width: 16px;
+ height: 16px;
+ margin-left: 8px;
+ transition: opacity 0.2s ease;
+}
+.wp-block-activitypub-followers .followers-container .followers-pagination {
+ display: grid;
+ grid-template-columns: 1fr auto 1fr;
+ align-items: center;
+ margin-top: 16px;
+ padding-top: 8px !important;
+ border-top-style: solid;
+ border-top-width: 1px;
+}
+.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-info {
+ color: var(--wp--preset--color--very-dark-gray, #666);
+ font-size: 90%;
+ justify-self: center;
+}
+.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous,
+.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next {
+ border: none;
+ box-shadow: none;
+ cursor: pointer;
+ font-size: 90%;
+ display: inline-block;
+ padding: 8px 0;
+ min-width: 60px;
+}
+.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous[hidden],
+.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next[hidden] {
+ display: none !important;
+}
+.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous[aria-disabled=true],
+.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next[aria-disabled=true] {
+ opacity: 0.3;
+ cursor: not-allowed;
+ pointer-events: none;
+ text-decoration: none;
+}
+.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous {
+ justify-self: start;
+ padding-right: 8px;
+}
+.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous::before {
+ content: "←";
+}
+.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next {
+ justify-self: end;
+ padding-left: 8px;
+ text-align: right;
+}
+.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next::after {
+ content: "→";
+}
+@media (max-width: 480px) {
+ .wp-block-activitypub-followers .followers-container .followers-pagination {
+ grid-template-columns: 1fr 1fr;
+ }
+ .wp-block-activitypub-followers .followers-container .followers-pagination .pagination-info {
+ display: none;
+ }
+ .wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous,
+ .wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next {
+ min-height: 44px;
+ font-size: 100%;
+ align-items: center;
+ }
+}
+.wp-block-activitypub-followers .followers-container .followers-loading {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-color: rgba(255, 255, 255, 0.5);
+ border-radius: 8px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.wp-block-activitypub-followers .followers-container .followers-loading[aria-hidden=true] {
+ display: none;
+}
+.wp-block-activitypub-followers .followers-container .loading-spinner {
+ width: 40px;
+ height: 40px;
+ border: 3px solid color-mix(in srgb, var(--wp--preset--color--primary, #0073aa) 30%, transparent);
+ border-radius: 50%;
+ border-top-color: var(--wp--preset--color--primary, #0073aa);
+ animation: spin 1s ease-in-out infinite;
+}
+@keyframes spin {
+ to {
+ transform: rotate(360deg);
+ }
+}
+.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) {
+ background-color: var(--wp--preset--color--white, #fff);
+ border-radius: 8px;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+ box-sizing: border-box;
+ padding: 24px;
+}
+@media (max-width: 480px) {
+ .wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) {
+ margin-left: -12px;
+ margin-right: -12px;
+ }
+}
+.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .wp-block-heading {
+ text-align: center;
+ border-bottom: none;
+ margin-bottom: 16px;
+}
+.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .follower-link {
+ border: 1px solid #e0e0e0;
+ margin-bottom: 8px;
+}
+.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .follower-link:hover, .wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .follower-link:focus {
+ border-color: rgb(198.5, 198.5, 198.5);
+}
+.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .followers-pagination {
+ border: none;
+ padding-bottom: 0 !important;
+}
+.wp-block-activitypub-followers.is-style-compact .follower-link {
+ padding: 4px;
+}
+.wp-block-activitypub-followers.is-style-compact .follower-avatar {
+ width: 36px;
+ height: 36px;
+ margin-right: 8px;
+}
+.wp-block-activitypub-followers.is-style-compact .follower-name {
+ font-size: 90%;
+}
+.wp-block-activitypub-followers.is-style-compact .follower-username {
+ font-size: 80%;
+}
+.wp-block-activitypub-followers.is-style-compact .followers-pagination {
+ margin-top: 8px;
+ padding-top: 4px;
+}
+.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-previous,
+.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-next {
+ padding-top: 4px;
+ padding-bottom: 4px;
+ font-size: 80%;
+}
+@media (max-width: 480px) {
+ .wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-previous,
+ .wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-next {
+ font-size: 100%;
+ }
+}
+.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-info {
+ font-size: 80%;
+}
+
+/*# sourceMappingURL=style-index.css.map*/
\ No newline at end of file
diff --git a/build/followers/view.asset.php b/build/followers/view.asset.php
index 211a93056d..753fa2c862 100644
--- a/build/followers/view.asset.php
+++ b/build/followers/view.asset.php
@@ -1 +1 @@
- array('@wordpress/interactivity'), 'version' => 'f0b102d4075c98757bf3', 'type' => 'module');
+ array('@wordpress/interactivity'), 'version' => '74b71e913f6a93cbcc9c', 'type' => 'module');
diff --git a/build/followers/view.js b/build/followers/view.js
index 76905b1b8f..3b4c77dd64 100644
--- a/build/followers/view.js
+++ b/build/followers/view.js
@@ -1 +1,234 @@
-import{getConfig as e,getContext as r,store as t}from"@wordpress/interactivity";const{apiFetch:a,url:o}=window.wp,{actions:s}=t("activitypub/followers",{state:{get paginationText(){const{page:e,pages:t}=r();return`${e} / ${t}`},get disablePreviousLink(){const{page:e}=r();return e<=1},get disableNextLink(){const{page:e,pages:t}=r();return e>=t}},actions:{async fetchFollowers(){const t=r(),{userId:s,page:n,per_page:l,order:c}=t;t.isLoading=!0;try{const{namespace:r}=e(),i=o.addQueryArgs(`/${r}/actors/${s}/followers`,{context:"full",per_page:l,order:c,page:n}),{orderedItems:g,totalItems:p}=await a({path:i});t.followers=g.map(e=>({handle:"@"+e.preferredUsername,icon:e.icon,name:e.name||e.preferredUsername,url:e.url||e.id})),t.total=p,t.pages=Math.ceil(p/l)}catch(e){console.error("Error fetching followers:",e)}finally{t.isLoading=!1}},previousPage(e){e.preventDefault();const t=r();t.page>1&&(t.page--,s.fetchFollowers().catch(e=>{console.error("Error fetching followers:",e)}))},nextPage(e){e.preventDefault();const t=r();t.page{console.error("Error fetching followers:",e)}))}},callbacks:{setDefaultAvatar(r){r.target.src=e().defaultAvatarUrl}}});
\ No newline at end of file
+import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity";
+/******/ var __webpack_modules__ = ({
+
+/***/ "@wordpress/interactivity":
+/*!*******************************************!*\
+ !*** external "@wordpress/interactivity" ***!
+ \*******************************************/
+/***/ ((module) => {
+
+module.exports = __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__;
+
+/***/ })
+
+/******/ });
+/************************************************************************/
+/******/ // The module cache
+/******/ var __webpack_module_cache__ = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/ // Check if module is in cache
+/******/ var cachedModule = __webpack_module_cache__[moduleId];
+/******/ if (cachedModule !== undefined) {
+/******/ return cachedModule.exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = __webpack_module_cache__[moduleId] = {
+/******/ // no module.id needed
+/******/ // no module.loaded needed
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/************************************************************************/
+/******/ /* webpack/runtime/make namespace object */
+/******/ (() => {
+/******/ // define __esModule on exports
+/******/ __webpack_require__.r = (exports) => {
+/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
+/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
+/******/ }
+/******/ Object.defineProperty(exports, '__esModule', { value: true });
+/******/ };
+/******/ })();
+/******/
+/************************************************************************/
+var __webpack_exports__ = {};
+// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
+(() => {
+/*!*******************************!*\
+ !*** ./src/followers/view.js ***!
+ \*******************************/
+__webpack_require__.r(__webpack_exports__);
+/* harmony import */ var _wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/interactivity */ "@wordpress/interactivity");
+
+
+/**
+ * @var {Object} window.wp WordPress global object
+ * @var {Function} url.addQueryArgs Function to add query arguments to a URL.
+ */
+const {
+ apiFetch,
+ url
+} = window.wp;
+
+/**
+ * @typedef {Object} config
+ * @property {String} defaultAvatarUrl Default avatar URL.
+ * @property {String} namespace ActivityPub REST Namespace.
+ */
+
+/**
+ * @typedef {Object} context
+ * @property {Array} followers The list of followers.
+ * @property {boolean} isLoading Whether the followers are currently being fetched.
+ * @property {String} order The order in which to fetch followers (e.g., 'asc', 'desc').
+ * @property {Number} page The current page of followers.
+ * @property {Number} pages The total number of pages of followers.
+ * @property {Number} per_page The number of followers per page.
+ * @property {Number} total The total number of followers.
+ * @property {String} userId The user ID for which to fetch followers.
+ */
+
+const {
+ actions
+} = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.store)('activitypub/followers', {
+ /**
+ * @typedef {Object} state
+ * @property {Function} paginationText Get the pagination text.
+ * @property {Function} disablePreviousLink Whether the previous link should be disabled.
+ * @property {Function} disableNextLink Whether the next link should be disabled.
+ */
+ state: {
+ /**
+ * Get the pagination text.
+ *
+ * @returns {string}
+ */
+ get paginationText() {
+ const {
+ page,
+ pages
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ return `${page} / ${pages}`;
+ },
+ /**
+ * Check if the previous link should be disabled.
+ *
+ * @returns {boolean}
+ */
+ get disablePreviousLink() {
+ const {
+ page
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ return page <= 1;
+ },
+ /**
+ * Check if the next link should be disabled.
+ *
+ * @returns {boolean}
+ */
+ get disableNextLink() {
+ const {
+ page,
+ pages
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ return page >= pages;
+ }
+ },
+ actions: {
+ /**
+ * Fetch followers for the current page.
+ *
+ * @return {Promise} Promise that resolves when followers are fetched.
+ */
+ async fetchFollowers() {
+ const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ const {
+ userId,
+ page,
+ per_page,
+ order
+ } = context;
+
+ // Set loading state.
+ context.isLoading = true;
+ try {
+ // Build the API path and parameters
+ const {
+ namespace
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getConfig)();
+ const path = url.addQueryArgs(`/${namespace}/actors/${userId}/followers`, {
+ context: 'full',
+ per_page,
+ order,
+ page
+ });
+
+ // Use apiFetch to get the Followers data.
+ const {
+ orderedItems,
+ totalItems
+ } = await apiFetch({
+ path
+ });
+
+ // Update the context with the new followers.
+ context.followers = orderedItems.map(follower => ({
+ handle: '@' + follower.preferredUsername,
+ icon: follower.icon,
+ name: follower.name || follower.preferredUsername,
+ url: follower.url || follower.id
+ }));
+ context.total = totalItems;
+ context.pages = Math.ceil(totalItems / per_page);
+ } catch (error) {
+ console.error('Error fetching followers:', error);
+ } finally {
+ // Clear loading state.
+ context.isLoading = false;
+ }
+ },
+ /**
+ * Navigate to the previous page.
+ *
+ * @param {Event} event - The click event.
+ */
+ previousPage(event) {
+ event.preventDefault();
+ const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ if (context.page > 1) {
+ context.page--;
+ actions.fetchFollowers().catch(error => {
+ console.error('Error fetching followers:', error);
+ });
+ }
+ },
+ /**
+ * Navigate to the next page.
+ *
+ * @param {Event} event - The click event.
+ */
+ nextPage(event) {
+ event.preventDefault();
+ const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ if (context.page < context.pages) {
+ context.page++;
+ actions.fetchFollowers().catch(error => {
+ console.error('Error fetching followers:', error);
+ });
+ }
+ }
+ },
+ callbacks: {
+ /**
+ * Sets the default avatar when the avatar image fails to load.
+ *
+ * @param {Object} event The error event.
+ */
+ setDefaultAvatar(event) {
+ event.target.src = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getConfig)().defaultAvatarUrl;
+ }
+ }
+});
+})();
+
+
+//# sourceMappingURL=view.js.map
\ No newline at end of file
diff --git a/build/reactions/index.asset.php b/build/reactions/index.asset.php
index 9d799d3b55..8a83a43445 100644
--- a/build/reactions/index.asset.php
+++ b/build/reactions/index.asset.php
@@ -1 +1 @@
- array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '19f79df5e0c04bf68777');
+ array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'b70b416ac23b593d6869');
diff --git a/build/reactions/index.js b/build/reactions/index.js
index 7b968fa923..e932bb8965 100644
--- a/build/reactions/index.js
+++ b/build/reactions/index.js
@@ -1,3 +1,758 @@
-(()=>{"use strict";var e,t={343:(e,t,r)=>{const n=window.wp.blocks,i=[{attributes:{title:{type:"string",default:"Fediverse reactions"}},supports:{html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},__experimentalBorder:{radius:!0,width:!0,color:!0,style:!0},typography:{fontSize:!0,__experimentalDefaultControls:{fontSize:!0}}},isEligible:({title:e})=>!!e,migrate:({title:e,...t})=>[t,[(0,n.createBlock)("core/heading",{content:e,level:6})]]}],s=window.wp.blockEditor,a=window.wp.i18n,o=window.wp.data,l=window.wp.element,c=window.wp.components,u=window.wp.apiFetch;var d=r.n(u);function p(){return window._activityPubOptions||{}}const f=window.ReactJSXRuntime,m=({reactions:e})=>{const{defaultAvatarUrl:t}=p();return(0,f.jsx)("ul",{className:"reaction-avatars",children:e.map((e,r)=>{const n=["reaction-avatar"].filter(Boolean).join(" "),i=e.avatar||t;return(0,f.jsx)("li",{children:(0,f.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",children:(0,f.jsx)("img",{src:i,alt:e.name,className:n,width:"32",height:"32",onError:e=>{e.target.src=t}})})},r)})})},h=({reactions:e})=>{const{defaultAvatarUrl:t}=p();return(0,f.jsx)("ul",{className:"reactions-list",children:e.map((e,r)=>{const n=e.avatar||t;return(0,f.jsx)("li",{className:"reaction-item",children:(0,f.jsxs)("a",{href:e.url,className:"reaction-item",target:"_blank",rel:"noopener noreferrer",children:[(0,f.jsx)("img",{src:n,alt:e.name,width:"32",height:"32",onError:e=>{e.target.src=t}}),(0,f.jsx)("span",{className:"reaction-name",children:e.name})]})},r)})})},v=({items:e,label:t})=>{const[r,n]=(0,l.useState)(!1),[i,s]=(0,l.useState)(null),a=(0,l.useRef)(null),o=e.slice(0,20);return(0,f.jsxs)("div",{className:"reaction-group",ref:a,children:[(0,f.jsx)(m,{reactions:o}),(0,f.jsx)(c.Button,{ref:s,className:"reaction-label is-link",onClick:()=>n(!r),"aria-expanded":r,children:t}),r&&i&&(0,f.jsx)(c.Popover,{anchor:i,onClose:()=>n(!1),children:(0,f.jsx)(h,{reactions:e})})]})};function w({postId:e=null,reactions:t=null,fallbackReactions:r=null}){const{namespace:n}=p(),[i,s]=(0,l.useState)(t),[a,o]=(0,l.useState)(!t),c=()=>{r&&s(r),o(!1)};return(0,l.useEffect)(()=>{if(t)return s(t),void o(!1);e&&"number"==typeof e?(o(!0),d()({path:`/${n}/posts/${e}/reactions`}).then(e=>{const t=Object.values(e).some(e=>e.items?.length>0);s(!t&&r?r:e),o(!1)}).catch(c)):c()},[e,t,r,n]),a?null:i&&Object.values(i).some(e=>e.items?.length>0)?(0,f.jsx)(f.Fragment,{children:Object.entries(i).map(([e,t])=>t.items?.length?(0,f.jsx)(v,{items:t.items,label:t.label},e):null)}):null}const g=(e,t,r,n)=>Array.from({length:e},(e,i)=>({name:`${t} ${i+1}`,url:"#",avatar:`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='32' cy='32' r='32' fill='%23${n[i%n.length]}'/%3E%3Ctext x='32' y='38' font-family='sans-serif' font-size='24' fill='white' text-anchor='middle'%3E${String.fromCharCode(r+i)}%3C/text%3E%3C/svg%3E`})),x=["FF6B6B","4ECDC4","45B7D1","96CEB4","D4A5A5","9B59B6","3498DB","E67E22"],b={likes:{label:(0,a.sprintf)(/* translators: %d: Number of likes */ /* translators: %d: Number of likes */
-(0,a._x)("%d likes","number of likes","activitypub"),9),items:g(9,"User",65,x)},reposts:{label:(0,a.sprintf)(/* translators: %d: Number of reposts */ /* translators: %d: Number of reposts */
-(0,a._x)("%d reposts","number of reposts","activitypub"),6),items:g(6,"Reposter",82,x)}},y=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","name":"activitypub/reactions","apiVersion":3,"version":"3.0.3","title":"Fediverse Reactions","category":"widgets","icon":"heart","description":"Display Fediverse likes and reposts","supports":{"align":["wide","full"],"color":{"gradients":true},"__experimentalBorder":{"radius":true,"width":true,"color":true,"style":true},"html":false,"interactivity":true,"layout":{"default":{"type":"constrained","orientation":"vertical","justifyContent":"center"},"allowEditing":false},"shadow":true,"typography":{"fontSize":true,"__experimentalDefaultControls":{"fontSize":true}}},"blockHooks":{"core/post-content":"after"},"textdomain":"activitypub","editorScript":"file:./index.js","style":"file:./style-index.css","viewScriptModule":"file:./view.js","viewScript":"wp-api-fetch","render":"file:./render.php"}');(0,n.registerBlockType)(y,{deprecated:i,edit:function({__unstableLayoutClassNames:e}){const t=(0,s.useBlockProps)({className:e}),{getCurrentPostId:r}=(0,o.select)("core/editor"),n=[["core/heading",{level:6,placeholder:(0,a.__)("Fediverse Reactions","activitypub"),content:(0,a.__)("Fediverse Reactions","activitypub")}]];return(0,f.jsxs)("div",{...t,children:[(0,f.jsx)(s.InnerBlocks,{template:n,allowedBlocks:["core/heading"],templateLock:"all",renderAppender:!1}),(0,f.jsx)(w,{postId:r(),fallbackReactions:b})]})},save:function(){return(0,f.jsx)("div",{...s.useBlockProps.save(),children:(0,f.jsx)(s.InnerBlocks.Content,{})})}})}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var s=r[e]={exports:{}};return t[e](s,s.exports,n),s.exports}n.m=t,e=[],n.O=(t,r,i,s)=>{if(!r){var a=1/0;for(u=0;u=s)&&Object.keys(n.O).every(e=>n.O[e](r[l]))?r.splice(l--,1):(o=!1,s0&&e[u-1][2]>s;u--)e[u]=e[u-1];e[u]=[r,i,s]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={608:0,104:0};n.O.j=t=>0===e[t];var t=(t,r)=>{var i,s,[a,o,l]=r,c=0;if(a.some(t=>0!==e[t])){for(i in o)n.o(o,i)&&(n.m[i]=o[i]);if(l)var u=l(n)}for(t&&t(r);cn(343));i=n.O(i)})();
\ No newline at end of file
+/******/ (() => { // webpackBootstrap
+/******/ "use strict";
+/******/ var __webpack_modules__ = ({
+
+/***/ "./src/reactions/block.json":
+/*!**********************************!*\
+ !*** ./src/reactions/block.json ***!
+ \**********************************/
+/***/ ((module) => {
+
+module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","name":"activitypub/reactions","apiVersion":3,"version":"3.0.3","title":"Fediverse Reactions","category":"widgets","icon":"heart","description":"Display Fediverse likes and reposts","supports":{"align":["wide","full"],"color":{"gradients":true},"__experimentalBorder":{"radius":true,"width":true,"color":true,"style":true},"html":false,"interactivity":true,"layout":{"default":{"type":"constrained","orientation":"vertical","justifyContent":"center"},"allowEditing":false},"shadow":true,"typography":{"fontSize":true,"__experimentalDefaultControls":{"fontSize":true}}},"blockHooks":{"core/post-content":"after"},"textdomain":"activitypub","editorScript":"file:./index.js","style":"file:./style-index.css","viewScriptModule":"file:./view.js","viewScript":"wp-api-fetch","render":"file:./render.php"}');
+
+/***/ }),
+
+/***/ "./src/reactions/deprecation.js":
+/*!**************************************!*\
+ !*** ./src/reactions/deprecation.js ***!
+ \**************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
+/* harmony export */ });
+/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
+/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
+
+const v1 = {
+ attributes: {
+ title: {
+ type: 'string',
+ default: 'Fediverse reactions'
+ }
+ },
+ supports: {
+ html: false,
+ color: {
+ gradients: true,
+ link: true,
+ __experimentalDefaultControls: {
+ background: true,
+ text: true,
+ link: true
+ }
+ },
+ __experimentalBorder: {
+ radius: true,
+ width: true,
+ color: true,
+ style: true
+ },
+ typography: {
+ fontSize: true,
+ __experimentalDefaultControls: {
+ fontSize: true
+ }
+ }
+ },
+ /**
+ * Checks if the block is eligible for migration.
+ *
+ * @param {Object} attributes The block attributes.
+ *
+ * @return {boolean} Whether the block is eligible for migration.
+ */
+ isEligible({
+ title
+ }) {
+ return !!title;
+ },
+ /**
+ * Migrates the block to use a core heading block instead of the custom heading attribute.
+ *
+ * @param {Object} attributes The attributes for the block.
+ *
+ * @return {Array} The new attributes and inner blocks.
+ */
+ migrate({
+ title,
+ ...newAttributes
+ }) {
+ const headingBlock = (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.createBlock)('core/heading', {
+ content: title,
+ level: 6
+ });
+ return [newAttributes, [headingBlock]];
+ }
+};
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([v1]);
+
+/***/ }),
+
+/***/ "./src/reactions/edit.js":
+/*!*******************************!*\
+ !*** ./src/reactions/edit.js ***!
+ \*******************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ Edit)
+/* harmony export */ });
+/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
+/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _reactions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./reactions */ "./src/reactions/reactions.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
+
+
+
+
+
+// Generate reaction items with SVG avatars.
+
+const generateReactionItems = (count, prefix, startChar, colors) => Array.from({
+ length: count
+}, (_, i) => ({
+ name: `${prefix} ${i + 1}`,
+ url: '#',
+ avatar: `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='32' cy='32' r='32' fill='%23${colors[i % colors.length]}'/%3E%3Ctext x='32' y='38' font-family='sans-serif' font-size='24' fill='white' text-anchor='middle'%3E${String.fromCharCode(startChar + i)}%3C/text%3E%3C/svg%3E`
+}));
+
+// Colors for avatars.
+const COLORS = ['FF6B6B', '4ECDC4', '45B7D1', '96CEB4', 'D4A5A5', '9B59B6', '3498DB', 'E67E22'];
+
+// Simple predefined dummy Reactions data.
+const DUMMY_REACTIONS = {
+ likes: {
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %d: Number of likes */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x)('%d likes', 'number of likes', 'activitypub'), 9),
+ items: generateReactionItems(9, 'User', 65, COLORS) // 65 is ASCII for 'A'
+ },
+ reposts: {
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %d: Number of reposts */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x)('%d reposts', 'number of reposts', 'activitypub'), 6),
+ items: generateReactionItems(6, 'Reposter', 82, COLORS) // 82 is ASCII for 'R'
+ }
+};
+
+/**
+ * Edit component for the Reactions block.
+ *
+ * @param {Object} props Block props.
+ * @param props.__unstableLayoutClassNames Layout class names.
+ * @return {JSX.Element} Component to render.
+ */
+function Edit({
+ __unstableLayoutClassNames
+}) {
+ const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps)({
+ className: __unstableLayoutClassNames
+ });
+ const {
+ getCurrentPostId
+ } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.select)('core/editor');
+
+ // Template for InnerBlocks - allows only a heading block.
+ const TEMPLATE = [['core/heading', {
+ level: 6,
+ placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Fediverse Reactions', 'activitypub'),
+ content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Fediverse Reactions', 'activitypub')
+ }]];
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
+ ...blockProps,
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.InnerBlocks, {
+ template: TEMPLATE,
+ allowedBlocks: ['core/heading'],
+ templateLock: 'all',
+ renderAppender: false
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_reactions__WEBPACK_IMPORTED_MODULE_3__.Reactions, {
+ postId: getCurrentPostId(),
+ fallbackReactions: DUMMY_REACTIONS
+ })]
+ });
+}
+
+/***/ }),
+
+/***/ "./src/reactions/index.js":
+/*!********************************!*\
+ !*** ./src/reactions/index.js ***!
+ \********************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
+/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _deprecation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./deprecation */ "./src/reactions/deprecation.js");
+/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/reactions/edit.js");
+/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block.json */ "./src/reactions/block.json");
+/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./save */ "./src/reactions/save.js");
+/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./style.scss */ "./src/reactions/style.scss");
+
+
+
+
+
+
+(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_3__, {
+ deprecated: _deprecation__WEBPACK_IMPORTED_MODULE_1__["default"],
+ edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"],
+ save: _save__WEBPACK_IMPORTED_MODULE_4__["default"]
+});
+
+/***/ }),
+
+/***/ "./src/reactions/reactions.js":
+/*!************************************!*\
+ !*** ./src/reactions/reactions.js ***!
+ \************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ FacepileRow: () => (/* binding */ FacepileRow),
+/* harmony export */ Reactions: () => (/* binding */ Reactions)
+/* harmony export */ });
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
+/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _shared_use_options__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../shared/use-options */ "./src/shared/use-options.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
+
+
+
+
+
+/**
+ * @typedef {Object} JSX
+ * @typedef {import('react').ReactElement} JSX.Element
+ */
+
+/**
+ * A component that renders a row of user avatars for a given set of reactions.
+ *
+ * @param {Object} props Component props.
+ * @param {Array} props.reactions Array of reaction objects.
+ * @return {JSX.Element} The rendered component.
+ */
+
+const FacepileRow = ({
+ reactions
+}) => {
+ const {
+ defaultAvatarUrl
+ } = (0,_shared_use_options__WEBPACK_IMPORTED_MODULE_3__.useOptions)();
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("ul", {
+ className: "reaction-avatars",
+ children: reactions.map((reaction, index) => {
+ const classes = ['reaction-avatar'].filter(Boolean).join(' ');
+ const avatar = reaction.avatar || defaultAvatarUrl;
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("li", {
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", {
+ href: reaction.url,
+ target: "_blank",
+ rel: "noopener noreferrer",
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("img", {
+ src: avatar,
+ alt: reaction.name,
+ className: classes,
+ width: "32",
+ height: "32",
+ onError: e => {
+ e.target.src = defaultAvatarUrl;
+ }
+ })
+ })
+ }, index);
+ })
+ });
+};
+
+/**
+ * A component that renders a dropdown list of reactions.
+ *
+ * @param {Object} props Component props.
+ * @param {Array} props.reactions Array of reaction objects.
+ * @return {JSX.Element} The rendered component.
+ */
+const ReactionList = ({
+ reactions
+}) => {
+ const {
+ defaultAvatarUrl
+ } = (0,_shared_use_options__WEBPACK_IMPORTED_MODULE_3__.useOptions)();
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("ul", {
+ className: "reactions-list",
+ children: reactions.map((reaction, index) => {
+ const avatar = reaction.avatar || defaultAvatarUrl;
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("li", {
+ className: "reaction-item",
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("a", {
+ href: reaction.url,
+ className: "reaction-item",
+ target: "_blank",
+ rel: "noopener noreferrer",
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("img", {
+ src: avatar,
+ alt: reaction.name,
+ width: "32",
+ height: "32",
+ onError: e => {
+ e.target.src = defaultAvatarUrl;
+ }
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
+ className: "reaction-name",
+ children: reaction.name
+ })]
+ })
+ }, index);
+ })
+ });
+};
+
+/**
+ * A component that renders a reaction group with facepile and dropdown.
+ *
+ * @param {Object} props Component props.
+ * @param {Array} props.items Array of reaction objects.
+ * @param {string} props.label Label for the reaction group.
+ * @return {JSX.Element} The rendered component.
+ */
+const ReactionGroup = ({
+ items,
+ label
+}) => {
+ const [isOpen, setIsOpen] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
+ const [buttonRef, setButtonRef] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
+ const containerRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
+ const visibleItems = items.slice(0, 20);
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
+ className: "reaction-group",
+ ref: containerRef,
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(FacepileRow, {
+ reactions: visibleItems
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
+ ref: setButtonRef,
+ className: "reaction-label is-link",
+ onClick: () => setIsOpen(!isOpen),
+ "aria-expanded": isOpen,
+ children: label
+ }), isOpen && buttonRef && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Popover, {
+ anchor: buttonRef,
+ onClose: () => setIsOpen(false),
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ReactionList, {
+ reactions: items
+ })
+ })]
+ });
+};
+
+/**
+ * The Reactions component.
+ *
+ * @param {Object} props Component props.
+ * @param {?number} props.postId The Post ID.
+ * @param {?Object} props.reactions Optional reactions data.
+ * @param {?Object} props.fallbackReactions Optional fallback reactions data to use if no real reactions are found.
+ * @return {?JSX.Element} The rendered component.
+ */
+function Reactions({
+ postId = null,
+ reactions: providedReactions = null,
+ fallbackReactions = null
+}) {
+ const {
+ namespace
+ } = (0,_shared_use_options__WEBPACK_IMPORTED_MODULE_3__.useOptions)();
+ const [reactions, setReactions] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(providedReactions);
+ const [loading, setLoading] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(!providedReactions);
+ const onError = () => {
+ // On error, use fallback reactions if provided
+ if (fallbackReactions) {
+ setReactions(fallbackReactions);
+ }
+ setLoading(false);
+ };
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
+ if (providedReactions) {
+ setReactions(providedReactions);
+ setLoading(false);
+ return;
+ }
+
+ // if no postId is provided or it's not a number (Site Editor), return early.
+ if (!postId || typeof postId !== 'number') {
+ onError();
+ return;
+ }
+ setLoading(true);
+ _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default()({
+ path: `/${namespace}/posts/${postId}/reactions`
+ }).then(response => {
+ // Check if the response has any actual reactions
+ const hasReactions = Object.values(response).some(group => group.items?.length > 0);
+
+ // If there are no real reactions and fallback is provided, use the fallback.
+ if (!hasReactions && fallbackReactions) {
+ setReactions(fallbackReactions);
+ } else {
+ setReactions(response);
+ }
+ setLoading(false);
+ }).catch(onError);
+ }, [postId, providedReactions, fallbackReactions, namespace]);
+ if (loading) {
+ return null;
+ }
+
+ // Return null if there are no reactions
+ if (!reactions || !Object.values(reactions).some(group => group.items?.length > 0)) {
+ return null;
+ }
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, {
+ children: Object.entries(reactions).map(([key, group]) => {
+ if (!group.items?.length) {
+ return null;
+ }
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ReactionGroup, {
+ items: group.items,
+ label: group.label
+ }, key);
+ })
+ });
+}
+
+// Export for testing
+
+
+/***/ }),
+
+/***/ "./src/reactions/save.js":
+/*!*******************************!*\
+ !*** ./src/reactions/save.js ***!
+ \*******************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ save)
+/* harmony export */ });
+/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
+/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+
+
+/**
+ * @typedef {Object} InnerBlocks
+ * @property {function(): JSX.Element} Content - The InnerBlocks.Content component.
+ */
+
+/**
+ * Save function for the reactions block.
+ *
+ * With server-side rendering via render.php, we only need to output
+ * the InnerBlocks content and a placeholder div.
+ *
+ * @return {JSX.Element} React element to save.
+ */
+
+function save() {
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
+ ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save(),
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.InnerBlocks.Content, {})
+ });
+}
+
+/***/ }),
+
+/***/ "./src/reactions/style.scss":
+/*!**********************************!*\
+ !*** ./src/reactions/style.scss ***!
+ \**********************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+// extracted by mini-css-extract-plugin
+
+
+/***/ }),
+
+/***/ "./src/shared/use-options.js":
+/*!***********************************!*\
+ !*** ./src/shared/use-options.js ***!
+ \***********************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ useOptions: () => (/* binding */ useOptions)
+/* harmony export */ });
+/**
+ * React hook to return the ActivityPub options object from the global window.
+ *
+ * @returns {Object} The options object.
+ */
+function useOptions() {
+ return window._activityPubOptions || {};
+}
+
+/***/ }),
+
+/***/ "@wordpress/api-fetch":
+/*!**********************************!*\
+ !*** external ["wp","apiFetch"] ***!
+ \**********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["apiFetch"];
+
+/***/ }),
+
+/***/ "@wordpress/block-editor":
+/*!*************************************!*\
+ !*** external ["wp","blockEditor"] ***!
+ \*************************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["blockEditor"];
+
+/***/ }),
+
+/***/ "@wordpress/blocks":
+/*!********************************!*\
+ !*** external ["wp","blocks"] ***!
+ \********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["blocks"];
+
+/***/ }),
+
+/***/ "@wordpress/components":
+/*!************************************!*\
+ !*** external ["wp","components"] ***!
+ \************************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["components"];
+
+/***/ }),
+
+/***/ "@wordpress/data":
+/*!******************************!*\
+ !*** external ["wp","data"] ***!
+ \******************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["data"];
+
+/***/ }),
+
+/***/ "@wordpress/element":
+/*!*********************************!*\
+ !*** external ["wp","element"] ***!
+ \*********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["element"];
+
+/***/ }),
+
+/***/ "@wordpress/i18n":
+/*!******************************!*\
+ !*** external ["wp","i18n"] ***!
+ \******************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["i18n"];
+
+/***/ }),
+
+/***/ "react/jsx-runtime":
+/*!**********************************!*\
+ !*** external "ReactJSXRuntime" ***!
+ \**********************************/
+/***/ ((module) => {
+
+module.exports = window["ReactJSXRuntime"];
+
+/***/ })
+
+/******/ });
+/************************************************************************/
+/******/ // The module cache
+/******/ var __webpack_module_cache__ = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/ // Check if module is in cache
+/******/ var cachedModule = __webpack_module_cache__[moduleId];
+/******/ if (cachedModule !== undefined) {
+/******/ return cachedModule.exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = __webpack_module_cache__[moduleId] = {
+/******/ // no module.id needed
+/******/ // no module.loaded needed
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = __webpack_modules__;
+/******/
+/************************************************************************/
+/******/ /* webpack/runtime/chunk loaded */
+/******/ (() => {
+/******/ var deferred = [];
+/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
+/******/ if(chunkIds) {
+/******/ priority = priority || 0;
+/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
+/******/ deferred[i] = [chunkIds, fn, priority];
+/******/ return;
+/******/ }
+/******/ var notFulfilled = Infinity;
+/******/ for (var i = 0; i < deferred.length; i++) {
+/******/ var [chunkIds, fn, priority] = deferred[i];
+/******/ var fulfilled = true;
+/******/ for (var j = 0; j < chunkIds.length; j++) {
+/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
+/******/ chunkIds.splice(j--, 1);
+/******/ } else {
+/******/ fulfilled = false;
+/******/ if(priority < notFulfilled) notFulfilled = priority;
+/******/ }
+/******/ }
+/******/ if(fulfilled) {
+/******/ deferred.splice(i--, 1)
+/******/ var r = fn();
+/******/ if (r !== undefined) result = r;
+/******/ }
+/******/ }
+/******/ return result;
+/******/ };
+/******/ })();
+/******/
+/******/ /* webpack/runtime/compat get default export */
+/******/ (() => {
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = (module) => {
+/******/ var getter = module && module.__esModule ?
+/******/ () => (module['default']) :
+/******/ () => (module);
+/******/ __webpack_require__.d(getter, { a: getter });
+/******/ return getter;
+/******/ };
+/******/ })();
+/******/
+/******/ /* webpack/runtime/define property getters */
+/******/ (() => {
+/******/ // define getter functions for harmony exports
+/******/ __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 */
+/******/ (() => {
+/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
+/******/ })();
+/******/
+/******/ /* webpack/runtime/make namespace object */
+/******/ (() => {
+/******/ // define __esModule on 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/jsonp chunk loading */
+/******/ (() => {
+/******/ // no baseURI
+/******/
+/******/ // object to store loaded and loading chunks
+/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
+/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
+/******/ var installedChunks = {
+/******/ "reactions/index": 0,
+/******/ "reactions/style-index": 0
+/******/ };
+/******/
+/******/ // no chunk on demand loading
+/******/
+/******/ // no prefetching
+/******/
+/******/ // no preloaded
+/******/
+/******/ // no HMR
+/******/
+/******/ // no HMR manifest
+/******/
+/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
+/******/
+/******/ // install a JSONP callback for chunk loading
+/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
+/******/ var [chunkIds, moreModules, runtime] = data;
+/******/ // add "moreModules" to the modules object,
+/******/ // then flag all "chunkIds" as loaded and fire callback
+/******/ var moduleId, chunkId, i = 0;
+/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
+/******/ for(moduleId in moreModules) {
+/******/ if(__webpack_require__.o(moreModules, moduleId)) {
+/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
+/******/ }
+/******/ }
+/******/ if(runtime) var result = runtime(__webpack_require__);
+/******/ }
+/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
+/******/ for(;i < chunkIds.length; i++) {
+/******/ chunkId = chunkIds[i];
+/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
+/******/ installedChunks[chunkId][0]();
+/******/ }
+/******/ installedChunks[chunkId] = 0;
+/******/ }
+/******/ return __webpack_require__.O(result);
+/******/ }
+/******/
+/******/ var chunkLoadingGlobal = globalThis["webpackChunkwordpress_activitypub"] = globalThis["webpackChunkwordpress_activitypub"] || [];
+/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
+/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
+/******/ })();
+/******/
+/************************************************************************/
+/******/
+/******/ // startup
+/******/ // Load entry module and return exports
+/******/ // This entry module depends on other loaded chunks and execution need to be delayed
+/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["reactions/style-index"], () => (__webpack_require__("./src/reactions/index.js")))
+/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
+/******/
+/******/ })()
+;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/build/reactions/style-index-rtl.css b/build/reactions/style-index-rtl.css
index 54a50cff24..4d8bc4197a 100644
--- a/build/reactions/style-index-rtl.css
+++ b/build/reactions/style-index-rtl.css
@@ -1 +1,278 @@
-body.modal-open{overflow:hidden}.activitypub-modal__overlay{align-items:center;background-color:rgba(0,0,0,.5);bottom:0;color:initial;display:flex;justify-content:center;right:0;padding:1rem;position:fixed;left:0;top:0;z-index:100000}.activitypub-modal__overlay.compact{align-items:flex-start;background-color:transparent;bottom:auto;justify-content:flex-start;right:auto;padding:0;position:absolute;left:auto;top:auto;z-index:100}.activitypub-modal__overlay[hidden]{display:none}.activitypub-modal__frame{animation:activitypub-modal-appear .2s ease-out;background-color:var(--wp--preset--color--white,#fff);border-radius:8px;box-shadow:0 5px 15px rgba(0,0,0,.3);display:flex;flex-direction:column;max-height:calc(100vh - 2rem);max-width:660px;overflow:hidden;width:100%}.compact .activitypub-modal__frame{box-shadow:0 2px 8px rgba(0,0,0,.1);max-height:300px;max-width:-moz-min-content;max-width:min-content;min-width:250px;width:auto}.activitypub-modal__header{align-items:center;border-bottom:1px solid var(--wp--preset--color--light-gray,#f0f0f0);display:flex;flex-shrink:0;justify-content:space-between;padding:2rem 2rem 1.5rem}.compact .activitypub-modal__header{display:none}.activitypub-modal__header .activitypub-modal__close{align-items:center;border:none;cursor:pointer;display:flex;justify-content:center;padding:.5rem;width:auto}.activitypub-modal__header .activitypub-modal__close:active{border:none;padding:.5rem}.activitypub-modal__title{font-size:130%;font-weight:600;line-height:1.4;margin:0!important}.activitypub-modal__content{overflow-y:auto}@keyframes activitypub-modal-appear{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.wp-block-activitypub-reactions{margin-bottom:2rem;margin-top:2rem;position:relative}.wp-block-activitypub-reactions.has-background,.wp-block-activitypub-reactions.has-border{box-sizing:border-box;padding:2rem}.wp-block-activitypub-reactions .activitypub-reactions{display:flex;flex-direction:column;flex-wrap:wrap}.wp-block-activitypub-reactions .reaction-group{align-items:center;display:flex;gap:.75rem;justify-content:flex-start;margin:.5em 0;position:relative;width:100%}@media(max-width:782px){.wp-block-activitypub-reactions .reaction-group:has(.reaction-avatars:not(:empty)){justify-content:space-between}}.wp-block-activitypub-reactions .reaction-group .reaction-avatars{align-items:center;display:flex;flex-direction:row;list-style:none;margin:0!important;padding:0}.wp-block-activitypub-reactions .reaction-group .reaction-avatars li{margin:0 0 0 -10px;padding:0;transition:transform .2s ease}.wp-block-activitypub-reactions .reaction-group .reaction-avatars li:not([hidden]):not(:has(~li:not([hidden]))){margin-left:0}.wp-block-activitypub-reactions .reaction-group .reaction-avatars li:hover{transform:translateY(-2px);z-index:2}.wp-block-activitypub-reactions .reaction-group .reaction-avatars li a{border-radius:50%;box-shadow:none;display:block;line-height:1;text-decoration:none}.wp-block-activitypub-reactions .reaction-group .reaction-avatar{max-height:32px;max-width:32px;overflow:hidden;-moz-force-broken-image-icon:1;border:.5px solid var(--wp--preset--color--contrast,hsla(0,0%,100%,.8));border-radius:50%;box-shadow:0 0 0 .5px hsla(0,0%,100%,.8),0 1px 3px rgba(0,0,0,.2);transition:transform .6s cubic-bezier(.34,1.56,.64,1);will-change:transform}.wp-block-activitypub-reactions .reaction-group .reaction-avatar:focus-visible,.wp-block-activitypub-reactions .reaction-group .reaction-avatar:hover{position:relative;transform:translateY(-5px);z-index:1}.wp-block-activitypub-reactions .reaction-group .reaction-label{align-items:center;background:none;border:none;border-radius:4px;color:currentColor;display:flex;flex:0 0 auto;font-size:70%;gap:.25rem;padding:.25rem .5rem;text-decoration:none;transition:background-color .2s ease;white-space:nowrap}.wp-block-activitypub-reactions .reaction-group .reaction-label:hover{background-color:rgba(0,0,0,.05);color:currentColor}.wp-block-activitypub-reactions .reaction-group .reaction-label:focus:not(:disabled){box-shadow:none;outline:1px solid currentColor;outline-offset:2px}.reactions-list{list-style:none;margin:0!important;padding:.5rem}.components-popover__content>.reactions-list{padding:0}.reactions-list .reaction-item{margin:0 0 .5rem}.reactions-list .reaction-item:last-child{margin-bottom:0}.reactions-list .reaction-item a{align-items:center;border-radius:4px;box-shadow:none;color:inherit;display:flex;gap:.75rem;padding:.5rem;text-decoration:none;transition:background-color .2s ease}.reactions-list .reaction-item a:hover{background-color:rgba(0,0,0,.03)}.reactions-list .reaction-item img{border:1px solid var(--wp--preset--color--light-gray,#f0f0f0);border-radius:50%;box-shadow:none;height:36px;width:36px}.reactions-list .reaction-item .reaction-name{font-size:75%}.components-popover__content{box-shadow:0 2px 8px rgba(0,0,0,.1);max-height:300px;max-width:-moz-min-content;max-width:min-content;min-width:250px;padding:.5rem;width:auto}
+/*!*************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/reactions/style.scss ***!
+ \*************************************************************************************************************************************************************************************************************************************************/
+body.modal-open {
+ overflow: hidden;
+}
+
+.activitypub-modal__overlay {
+ position: fixed;
+ top: 0;
+ right: 0;
+ left: 0;
+ bottom: 0;
+ background-color: rgba(0, 0, 0, 0.5);
+ color: initial;
+ z-index: 100000;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 1rem;
+}
+
+.activitypub-modal__overlay.compact {
+ position: absolute;
+ background-color: transparent;
+ padding: 0;
+ top: auto;
+ right: auto;
+ left: auto;
+ bottom: auto;
+ align-items: flex-start;
+ justify-content: flex-start;
+ z-index: 100;
+}
+
+.activitypub-modal__overlay[hidden] {
+ display: none;
+}
+
+.activitypub-modal__frame {
+ max-width: 660px;
+ width: 100%;
+ background-color: var(--wp--preset--color--white, #fff);
+ border-radius: 8px;
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
+ overflow: hidden;
+ display: flex;
+ flex-direction: column;
+ max-height: calc(100vh - 2rem);
+ animation: activitypub-modal-appear 0.2s ease-out;
+}
+
+.compact .activitypub-modal__frame {
+ width: auto;
+ max-width: -moz-min-content;
+ max-width: min-content;
+ min-width: 250px;
+ max-height: 300px;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+}
+
+.activitypub-modal__header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 2rem 2rem 1.5rem 2rem;
+ border-bottom: 1px solid var(--wp--preset--color--light-gray, #f0f0f0);
+ flex-shrink: 0;
+}
+
+.compact .activitypub-modal__header {
+ display: none;
+}
+
+.activitypub-modal__header .activitypub-modal__close {
+ border: none;
+ padding: 0.5rem;
+ cursor: pointer;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: auto;
+}
+
+.activitypub-modal__header .activitypub-modal__close:active {
+ border: none;
+ padding: 0.5rem;
+}
+
+.activitypub-modal__title {
+ margin: 0 !important;
+ font-size: 130%;
+ font-weight: 600;
+ line-height: 1.4;
+}
+
+.activitypub-modal__content {
+ overflow-y: auto;
+}
+
+@keyframes activitypub-modal-appear {
+ from {
+ opacity: 0;
+ transform: translateY(20px);
+ }
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+}
+
+.wp-block-activitypub-reactions {
+ margin-top: 2rem;
+ margin-bottom: 2rem;
+ position: relative;
+}
+
+.wp-block-activitypub-reactions.has-background, .wp-block-activitypub-reactions.has-border {
+ box-sizing: border-box;
+ padding: 2rem;
+}
+
+.wp-block-activitypub-reactions .activitypub-reactions {
+ display: flex;
+ flex-direction: column;
+ flex-wrap: wrap;
+}
+
+.wp-block-activitypub-reactions .reaction-group {
+ display: flex;
+ align-items: center;
+ margin: 0.5em 0;
+ position: relative;
+ width: 100%;
+ gap: 0.75rem;
+ justify-content: flex-start;
+}
+
+@media (max-width: 782px) {
+ .wp-block-activitypub-reactions .reaction-group:has(.reaction-avatars:not(:empty)) {
+ justify-content: space-between;
+ }
+}
+
+.wp-block-activitypub-reactions .reaction-group .reaction-avatars {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ list-style: none;
+ margin: 0 !important;
+ padding: 0;
+}
+
+.wp-block-activitypub-reactions .reaction-group .reaction-avatars li {
+ padding: 0;
+ margin: 0 0 0 -10px;
+ transition: transform 0.2s ease;
+}
+
+.wp-block-activitypub-reactions .reaction-group .reaction-avatars li:not([hidden]):not(:has(~ li:not([hidden]))) {
+ margin-left: 0;
+}
+
+.wp-block-activitypub-reactions .reaction-group .reaction-avatars li:hover {
+ z-index: 2;
+ transform: translateY(-2px);
+}
+
+.wp-block-activitypub-reactions .reaction-group .reaction-avatars li a {
+ box-shadow: none;
+ border-radius: 50%;
+ display: block;
+ line-height: 1;
+ text-decoration: none;
+}
+
+.wp-block-activitypub-reactions .reaction-group .reaction-avatar {
+ max-width: 32px;
+ max-height: 32px;
+ overflow: hidden;
+ -moz-force-broken-image-icon: 1;
+ border-radius: 50%;
+ border: 0.5px solid var(--wp--preset--color--contrast, rgba(255, 255, 255, 0.8));
+ box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.8), 0 1px 3px rgba(0, 0, 0, 0.2);
+ transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
+ will-change: transform;
+}
+
+.wp-block-activitypub-reactions .reaction-group .reaction-avatar:hover, .wp-block-activitypub-reactions .reaction-group .reaction-avatar:focus-visible {
+ z-index: 1;
+ position: relative;
+ transform: translateY(-5px);
+}
+
+.wp-block-activitypub-reactions .reaction-group .reaction-label {
+ background: none;
+ border: none;
+ border-radius: 4px;
+ display: flex;
+ align-items: center;
+ gap: 0.25rem;
+ flex: 0 0 auto;
+ padding: 0.25rem 0.5rem;
+ font-size: 70%;
+ color: currentColor;
+ transition: background-color 0.2s ease;
+ white-space: nowrap;
+ text-decoration: none;
+}
+
+.wp-block-activitypub-reactions .reaction-group .reaction-label:hover {
+ background-color: rgba(0, 0, 0, 0.05);
+ color: currentColor;
+}
+
+.wp-block-activitypub-reactions .reaction-group .reaction-label:focus:not(:disabled) {
+ box-shadow: none;
+ outline: 1px solid currentColor;
+ outline-offset: 2px;
+}
+
+/* Reactions list styles */
+
+.reactions-list {
+ list-style: none;
+ margin: 0 !important;
+ padding: 0.5rem;
+}
+
+.components-popover__content > .reactions-list {
+ padding: 0;
+}
+
+.reactions-list .reaction-item {
+ margin: 0 0 0.5rem 0;
+}
+
+.reactions-list .reaction-item:last-child {
+ margin-bottom: 0;
+}
+
+.reactions-list .reaction-item a {
+ box-shadow: none;
+ display: flex;
+ align-items: center;
+ gap: 0.75rem;
+ text-decoration: none;
+ color: inherit;
+ transition: background-color 0.2s ease;
+ padding: 0.5rem;
+ border-radius: 4px;
+}
+
+.reactions-list .reaction-item a:hover {
+ background-color: rgba(0, 0, 0, 0.03);
+}
+
+.reactions-list .reaction-item img {
+ box-shadow: none;
+ width: 36px;
+ height: 36px;
+ border-radius: 50%;
+ border: 1px solid var(--wp--preset--color--light-gray, #f0f0f0);
+}
+
+.reactions-list .reaction-item .reaction-name {
+ font-size: 75%;
+}
+
+.components-popover__content {
+ width: auto;
+ max-width: -moz-min-content;
+ max-width: min-content;
+ min-width: 250px;
+ max-height: 300px;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+ padding: 0.5rem;
+}
diff --git a/build/reactions/style-index.css b/build/reactions/style-index.css
index 5b2fbf3f5c..0e4080ed0a 100644
--- a/build/reactions/style-index.css
+++ b/build/reactions/style-index.css
@@ -1 +1,280 @@
-body.modal-open{overflow:hidden}.activitypub-modal__overlay{align-items:center;background-color:rgba(0,0,0,.5);bottom:0;color:initial;display:flex;justify-content:center;left:0;padding:1rem;position:fixed;right:0;top:0;z-index:100000}.activitypub-modal__overlay.compact{align-items:flex-start;background-color:transparent;bottom:auto;justify-content:flex-start;left:auto;padding:0;position:absolute;right:auto;top:auto;z-index:100}.activitypub-modal__overlay[hidden]{display:none}.activitypub-modal__frame{animation:activitypub-modal-appear .2s ease-out;background-color:var(--wp--preset--color--white,#fff);border-radius:8px;box-shadow:0 5px 15px rgba(0,0,0,.3);display:flex;flex-direction:column;max-height:calc(100vh - 2rem);max-width:660px;overflow:hidden;width:100%}.compact .activitypub-modal__frame{box-shadow:0 2px 8px rgba(0,0,0,.1);max-height:300px;max-width:-moz-min-content;max-width:min-content;min-width:250px;width:auto}.activitypub-modal__header{align-items:center;border-bottom:1px solid var(--wp--preset--color--light-gray,#f0f0f0);display:flex;flex-shrink:0;justify-content:space-between;padding:2rem 2rem 1.5rem}.compact .activitypub-modal__header{display:none}.activitypub-modal__header .activitypub-modal__close{align-items:center;border:none;cursor:pointer;display:flex;justify-content:center;padding:.5rem;width:auto}.activitypub-modal__header .activitypub-modal__close:active{border:none;padding:.5rem}.activitypub-modal__title{font-size:130%;font-weight:600;line-height:1.4;margin:0!important}.activitypub-modal__content{overflow-y:auto}@keyframes activitypub-modal-appear{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.wp-block-activitypub-reactions{margin-bottom:2rem;margin-top:2rem;position:relative}.wp-block-activitypub-reactions.has-background,.wp-block-activitypub-reactions.has-border{box-sizing:border-box;padding:2rem}.wp-block-activitypub-reactions .activitypub-reactions{display:flex;flex-direction:column;flex-wrap:wrap}.wp-block-activitypub-reactions .reaction-group{align-items:center;display:flex;gap:.75rem;justify-content:flex-start;margin:.5em 0;position:relative;width:100%}@media(max-width:782px){.wp-block-activitypub-reactions .reaction-group:has(.reaction-avatars:not(:empty)){justify-content:space-between}}.wp-block-activitypub-reactions .reaction-group .reaction-avatars{align-items:center;display:flex;flex-direction:row;list-style:none;margin:0!important;padding:0}.wp-block-activitypub-reactions .reaction-group .reaction-avatars li{margin:0 -10px 0 0;padding:0;transition:transform .2s ease}.wp-block-activitypub-reactions .reaction-group .reaction-avatars li:not([hidden]):not(:has(~li:not([hidden]))){margin-right:0}.wp-block-activitypub-reactions .reaction-group .reaction-avatars li:hover{transform:translateY(-2px);z-index:2}.wp-block-activitypub-reactions .reaction-group .reaction-avatars li a{border-radius:50%;box-shadow:none;display:block;line-height:1;text-decoration:none}.wp-block-activitypub-reactions .reaction-group .reaction-avatar{max-height:32px;max-width:32px;overflow:hidden;-moz-force-broken-image-icon:1;border:.5px solid var(--wp--preset--color--contrast,hsla(0,0%,100%,.8));border-radius:50%;box-shadow:0 0 0 .5px hsla(0,0%,100%,.8),0 1px 3px rgba(0,0,0,.2);transition:transform .6s cubic-bezier(.34,1.56,.64,1);will-change:transform}.wp-block-activitypub-reactions .reaction-group .reaction-avatar:focus-visible,.wp-block-activitypub-reactions .reaction-group .reaction-avatar:hover{position:relative;transform:translateY(-5px);z-index:1}.wp-block-activitypub-reactions .reaction-group .reaction-label{align-items:center;background:none;border:none;border-radius:4px;color:currentColor;display:flex;flex:0 0 auto;font-size:70%;gap:.25rem;padding:.25rem .5rem;text-decoration:none;transition:background-color .2s ease;white-space:nowrap}.wp-block-activitypub-reactions .reaction-group .reaction-label:hover{background-color:rgba(0,0,0,.05);color:currentColor}.wp-block-activitypub-reactions .reaction-group .reaction-label:focus:not(:disabled){box-shadow:none;outline:1px solid currentColor;outline-offset:2px}.reactions-list{list-style:none;margin:0!important;padding:.5rem}.components-popover__content>.reactions-list{padding:0}.reactions-list .reaction-item{margin:0 0 .5rem}.reactions-list .reaction-item:last-child{margin-bottom:0}.reactions-list .reaction-item a{align-items:center;border-radius:4px;box-shadow:none;color:inherit;display:flex;gap:.75rem;padding:.5rem;text-decoration:none;transition:background-color .2s ease}.reactions-list .reaction-item a:hover{background-color:rgba(0,0,0,.03)}.reactions-list .reaction-item img{border:1px solid var(--wp--preset--color--light-gray,#f0f0f0);border-radius:50%;box-shadow:none;height:36px;width:36px}.reactions-list .reaction-item .reaction-name{font-size:75%}.components-popover__content{box-shadow:0 2px 8px rgba(0,0,0,.1);max-height:300px;max-width:-moz-min-content;max-width:min-content;min-width:250px;padding:.5rem;width:auto}
+/*!*************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/reactions/style.scss ***!
+ \*************************************************************************************************************************************************************************************************************************************************/
+body.modal-open {
+ overflow: hidden;
+}
+
+.activitypub-modal__overlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-color: rgba(0, 0, 0, 0.5);
+ color: initial;
+ z-index: 100000;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 1rem;
+}
+
+.activitypub-modal__overlay.compact {
+ position: absolute;
+ background-color: transparent;
+ padding: 0;
+ top: auto;
+ left: auto;
+ right: auto;
+ bottom: auto;
+ align-items: flex-start;
+ justify-content: flex-start;
+ z-index: 100;
+}
+
+.activitypub-modal__overlay[hidden] {
+ display: none;
+}
+
+.activitypub-modal__frame {
+ max-width: 660px;
+ width: 100%;
+ background-color: var(--wp--preset--color--white, #fff);
+ border-radius: 8px;
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
+ overflow: hidden;
+ display: flex;
+ flex-direction: column;
+ max-height: calc(100vh - 2rem);
+ animation: activitypub-modal-appear 0.2s ease-out;
+}
+
+.compact .activitypub-modal__frame {
+ width: auto;
+ max-width: -moz-min-content;
+ max-width: min-content;
+ min-width: 250px;
+ max-height: 300px;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+}
+
+.activitypub-modal__header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 2rem 2rem 1.5rem 2rem;
+ border-bottom: 1px solid var(--wp--preset--color--light-gray, #f0f0f0);
+ flex-shrink: 0;
+}
+
+.compact .activitypub-modal__header {
+ display: none;
+}
+
+.activitypub-modal__header .activitypub-modal__close {
+ border: none;
+ padding: 0.5rem;
+ cursor: pointer;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: auto;
+}
+
+.activitypub-modal__header .activitypub-modal__close:active {
+ border: none;
+ padding: 0.5rem;
+}
+
+.activitypub-modal__title {
+ margin: 0 !important;
+ font-size: 130%;
+ font-weight: 600;
+ line-height: 1.4;
+}
+
+.activitypub-modal__content {
+ overflow-y: auto;
+}
+
+@keyframes activitypub-modal-appear {
+ from {
+ opacity: 0;
+ transform: translateY(20px);
+ }
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+}
+
+.wp-block-activitypub-reactions {
+ margin-top: 2rem;
+ margin-bottom: 2rem;
+ position: relative;
+}
+
+.wp-block-activitypub-reactions.has-background, .wp-block-activitypub-reactions.has-border {
+ box-sizing: border-box;
+ padding: 2rem;
+}
+
+.wp-block-activitypub-reactions .activitypub-reactions {
+ display: flex;
+ flex-direction: column;
+ flex-wrap: wrap;
+}
+
+.wp-block-activitypub-reactions .reaction-group {
+ display: flex;
+ align-items: center;
+ margin: 0.5em 0;
+ position: relative;
+ width: 100%;
+ gap: 0.75rem;
+ justify-content: flex-start;
+}
+
+@media (max-width: 782px) {
+ .wp-block-activitypub-reactions .reaction-group:has(.reaction-avatars:not(:empty)) {
+ justify-content: space-between;
+ }
+}
+
+.wp-block-activitypub-reactions .reaction-group .reaction-avatars {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ list-style: none;
+ margin: 0 !important;
+ padding: 0;
+}
+
+.wp-block-activitypub-reactions .reaction-group .reaction-avatars li {
+ padding: 0;
+ margin: 0 -10px 0 0;
+ transition: transform 0.2s ease;
+}
+
+.wp-block-activitypub-reactions .reaction-group .reaction-avatars li:not([hidden]):not(:has(~ li:not([hidden]))) {
+ margin-right: 0;
+}
+
+.wp-block-activitypub-reactions .reaction-group .reaction-avatars li:hover {
+ z-index: 2;
+ transform: translateY(-2px);
+}
+
+.wp-block-activitypub-reactions .reaction-group .reaction-avatars li a {
+ box-shadow: none;
+ border-radius: 50%;
+ display: block;
+ line-height: 1;
+ text-decoration: none;
+}
+
+.wp-block-activitypub-reactions .reaction-group .reaction-avatar {
+ max-width: 32px;
+ max-height: 32px;
+ overflow: hidden;
+ -moz-force-broken-image-icon: 1;
+ border-radius: 50%;
+ border: 0.5px solid var(--wp--preset--color--contrast, rgba(255, 255, 255, 0.8));
+ box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.8), 0 1px 3px rgba(0, 0, 0, 0.2);
+ transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
+ will-change: transform;
+}
+
+.wp-block-activitypub-reactions .reaction-group .reaction-avatar:hover, .wp-block-activitypub-reactions .reaction-group .reaction-avatar:focus-visible {
+ z-index: 1;
+ position: relative;
+ transform: translateY(-5px);
+}
+
+.wp-block-activitypub-reactions .reaction-group .reaction-label {
+ background: none;
+ border: none;
+ border-radius: 4px;
+ display: flex;
+ align-items: center;
+ gap: 0.25rem;
+ flex: 0 0 auto;
+ padding: 0.25rem 0.5rem;
+ font-size: 70%;
+ color: currentColor;
+ transition: background-color 0.2s ease;
+ white-space: nowrap;
+ text-decoration: none;
+}
+
+.wp-block-activitypub-reactions .reaction-group .reaction-label:hover {
+ background-color: rgba(0, 0, 0, 0.05);
+ color: currentColor;
+}
+
+.wp-block-activitypub-reactions .reaction-group .reaction-label:focus:not(:disabled) {
+ box-shadow: none;
+ outline: 1px solid currentColor;
+ outline-offset: 2px;
+}
+
+/* Reactions list styles */
+
+.reactions-list {
+ list-style: none;
+ margin: 0 !important;
+ padding: 0.5rem;
+}
+
+.components-popover__content > .reactions-list {
+ padding: 0;
+}
+
+.reactions-list .reaction-item {
+ margin: 0 0 0.5rem 0;
+}
+
+.reactions-list .reaction-item:last-child {
+ margin-bottom: 0;
+}
+
+.reactions-list .reaction-item a {
+ box-shadow: none;
+ display: flex;
+ align-items: center;
+ gap: 0.75rem;
+ text-decoration: none;
+ color: inherit;
+ transition: background-color 0.2s ease;
+ padding: 0.5rem;
+ border-radius: 4px;
+}
+
+.reactions-list .reaction-item a:hover {
+ background-color: rgba(0, 0, 0, 0.03);
+}
+
+.reactions-list .reaction-item img {
+ box-shadow: none;
+ width: 36px;
+ height: 36px;
+ border-radius: 50%;
+ border: 1px solid var(--wp--preset--color--light-gray, #f0f0f0);
+}
+
+.reactions-list .reaction-item .reaction-name {
+ font-size: 75%;
+}
+
+.components-popover__content {
+ width: auto;
+ max-width: -moz-min-content;
+ max-width: min-content;
+ min-width: 250px;
+ max-height: 300px;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+ padding: 0.5rem;
+}
+
+/*# sourceMappingURL=style-index.css.map*/
\ No newline at end of file
diff --git a/build/reactions/view.asset.php b/build/reactions/view.asset.php
index c2b4f3ccbb..7d55725c6d 100644
--- a/build/reactions/view.asset.php
+++ b/build/reactions/view.asset.php
@@ -1 +1 @@
- array('@wordpress/interactivity'), 'version' => '97fae96804d06a1889ca', 'type' => 'module');
+ array('@wordpress/interactivity'), 'version' => 'a5d139a946fab697928c', 'type' => 'module');
diff --git a/build/reactions/view.js b/build/reactions/view.js
index 684e25b3f9..1a26e64d53 100644
--- a/build/reactions/view.js
+++ b/build/reactions/view.js
@@ -1 +1,518 @@
-import{getConfig as t,getContext as e,getElement as o,store as n,withScope as a}from"@wordpress/interactivity";const{apiFetch:c}=window.wp;!function(){const{actions:t,callbacks:a}=n("activitypub/reactions",{actions:{openModal(t){const o=e();o.modal.isOpen=!0,o.modal.isCompact?setTimeout(a.positionModal,0):setTimeout(()=>{const t=document.getElementById(o.blockId);if(t){const e=t.querySelector(".activitypub-modal__frame");e&&a.trapFocus(e)}},50),"function"==typeof a.onModalOpen&&a.onModalOpen(t)},closeModal(t){const n=e();n.modal.isOpen=!1;const c=o();if("actions.toggleModal"===c.ref.dataset["wpOn-Click"])c.ref.focus();else{const t=document.getElementById(n.blockId);if(t){const e=t.querySelector('[data-wp-on--click="actions.toggleModal"], [data-wp-on-async--click="actions.toggleModal"]');e&&e.focus()}}"function"==typeof a.onModalClose&&a.onModalClose(t)},toggleModal(o){const{modal:n}=e();n.isOpen?t.closeModal(o):t.openModal(o)}},callbacks:{_abortController:null,handleModalEffects(){const{modal:t}=e();if(t.isOpen&&!t.isCompact?document.body.classList.add("modal-open"):document.body.classList.remove("modal-open"),a._abortController&&(a._abortController.abort(),a._abortController=null),t.isOpen){a._abortController=new AbortController;const{signal:t}=a._abortController;document.addEventListener("keydown",a.documentKeydown,{signal:t}),document.addEventListener("click",a.documentClick,{signal:t})}},documentKeydown(o){const{modal:n}=e();n.isOpen&&"Escape"===o.key&&t.closeModal()},documentClick(o){const{blockId:n,modal:a}=e();if(!a.isOpen)return;const c=document.getElementById(n);if(!c)return;const l=c.querySelector('.wp-element-button[data-wp-on--click="actions.toggleModal"]');if(l&&(l===o.target||l.contains(o.target)))return;const s=c.querySelector(".activitypub-modal__frame");s&&!s.contains(o.target)&&t.closeModal()},positionModal(){const{blockId:t}=e(),n=document.getElementById(t);if(!n)return;const a=n.querySelector(".activitypub-modal__overlay");if(!a)return;a.style.top="",a.style.left="",a.style.right="",a.style.bottom="";const c=o().ref.getBoundingClientRect(),l=window.innerWidth,s=n.getBoundingClientRect();let i={top:c.bottom-s.top+8+"px",left:c.left-s.left-2+"px"};l-c.right<250&&(i.left="auto",i.right=s.right-c.right+"px"),Object.assign(a.style,i)},trapFocus(t){const e=t.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]):not([readonly]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),o=e[0],n=e[e.length-1];o&&o.classList.contains("activitypub-modal__close")&&e.length>1?e[1].focus():o.focus(),t.addEventListener("keydown",function(t){"Tab"!==t.key&&9!==t.keyCode||(t.shiftKey?document.activeElement===o&&(n.focus(),t.preventDefault()):document.activeElement===n&&(o.focus(),t.preventDefault()))})}}})}();const{callbacks:l,state:s}=n("activitypub/reactions",{actions:{async fetchReactions(){const o=e(),{namespace:n}=t();if(o.postId)try{o.reactions=await c({path:`/${n}/posts/${o.postId}/reactions`})}catch(t){console.error("Error fetching reactions:",t)}}},callbacks:{initReactions(){const t=new ResizeObserver(a(l.calculateVisibleAvatars));return o().ref.querySelectorAll(".reaction-group").forEach(e=>{t.observe(e)}),()=>{t.disconnect()}},calculateVisibleAvatars(){const{postId:t}=e();(s.reactions&&s.reactions[t]?Object.keys(s.reactions[t]):[]).forEach(e=>{s.reactions?.[t][e]?.items?.length&&o().ref.querySelectorAll(`.reaction-group[data-reaction-type="${e}"]`).forEach(o=>{const n=o.querySelector(".reaction-label").offsetWidth||0,a=o.offsetWidth-n-12;let c=1;a>32&&(c+=Math.floor((a-32)/22));const l=s.reactions[t][e].items,i=Math.min(c,l.length),r=o.querySelector(".reaction-avatars");r&&r.querySelectorAll("li").forEach((t,e)=>{e {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ createModalStore: () => (/* binding */ createModalStore)
+/* harmony export */ });
+/* harmony import */ var _wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/interactivity */ "@wordpress/interactivity");
+
+
+/**
+ * @typedef {Object} context
+ * @property {String} blockId - The ID of the block.
+ * @property {Object} modal - The modal state.
+ * @property {boolean} modal.isOpen - Whether the modal is open.
+ * @property {boolean} modal.isCompact - Whether the modal is compact.
+ */
+
+/**
+ * Set up a modal store with actions and callbacks.
+ *
+ * The Interactivity API merges all stores that share the same namespace,
+ * so these actions and callbacks are added directly to the importing block’s existing store.
+ *
+ * @param {string} namespace - The interactivity namespace for the block.
+ */
+function createModalStore(namespace) {
+ const {
+ actions,
+ callbacks
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.store)(namespace, {
+ actions: {
+ /**
+ * Open the modal.
+ *
+ * @param {Event} event Click event.
+ */
+ openModal(event) {
+ const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+
+ // Set modal properties
+ context.modal.isOpen = true;
+ if (context.modal.isCompact) {
+ // Position the compact modal relative to the button.
+ setTimeout(callbacks.positionModal, 0);
+ } else {
+ // Set up the focus trap after modal is open.
+ setTimeout(() => {
+ // Use the blockId to find the specific modal frame for this block
+ const blockWrapper = document.getElementById(context.blockId);
+ if (blockWrapper) {
+ const modalFrame = blockWrapper.querySelector('.activitypub-modal__frame');
+ if (modalFrame) {
+ callbacks.trapFocus(modalFrame);
+ }
+ }
+ }, 50);
+ }
+
+ // Call the onOpen callback if provided.
+ if (typeof callbacks.onModalOpen === 'function') {
+ callbacks.onModalOpen(event);
+ }
+ },
+ /**
+ * Close the modal.
+ *
+ * @param {Event} event Click event.
+ */
+ closeModal(event) {
+ const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+
+ // Reset modal state
+ context.modal.isOpen = false;
+
+ // Return focus to the button that opened the modal.
+ const button = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getElement)();
+ if (button.ref.dataset['wpOn-Click'] === 'actions.toggleModal') {
+ button.ref.focus();
+ } else {
+ const blockWrapper = document.getElementById(context.blockId);
+ if (blockWrapper) {
+ const openButton = blockWrapper.querySelector('[data-wp-on--click="actions.toggleModal"], [data-wp-on-async--click="actions.toggleModal"]');
+ if (openButton) {
+ openButton.focus();
+ }
+ }
+ }
+
+ // Call the onClose callback if provided.
+ if (typeof callbacks.onModalClose === 'function') {
+ callbacks.onModalClose(event);
+ }
+ },
+ /**
+ * Toggle the modal.
+ *
+ * @param {Event} event Click event.
+ */
+ toggleModal(event) {
+ const {
+ modal
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ modal.isOpen ? actions.closeModal(event) : actions.openModal(event);
+ }
+ },
+ callbacks: {
+ /**
+ * Abort controller for keydown and click event listeners.
+ *
+ * @type {AbortController | null} Abort controller.
+ */
+ _abortController: null,
+ /**
+ * Handles modal effects like body class and event listeners.
+ * This is called via data-wp-watch in the modal HTML.
+ */
+ handleModalEffects() {
+ const {
+ modal
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+
+ // Update body class.
+ if (modal.isOpen && !modal.isCompact) {
+ document.body.classList.add('modal-open');
+ } else {
+ document.body.classList.remove('modal-open');
+ }
+
+ // Remove all existing listeners.
+ if (callbacks._abortController) {
+ callbacks._abortController.abort();
+ callbacks._abortController = null;
+ }
+
+ // Add new listeners if modal is open.
+ if (modal.isOpen) {
+ callbacks._abortController = new AbortController();
+ const {
+ signal
+ } = callbacks._abortController;
+ document.addEventListener('keydown', callbacks.documentKeydown, {
+ signal
+ });
+ document.addEventListener('click', callbacks.documentClick, {
+ signal
+ });
+ }
+ return undefined;
+ },
+ /**
+ * Handles keydown events on the document.
+ *
+ * @param {Event} event Keydown event.
+ * @param {String} event.key The key that was pressed.
+ */
+ documentKeydown(event) {
+ const {
+ modal
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ if (modal.isOpen && event.key === 'Escape') {
+ actions.closeModal();
+ }
+ },
+ /**
+ * Handles click events on the document.
+ *
+ * @param {Event} event Click event.
+ */
+ documentClick(event) {
+ const {
+ blockId,
+ modal
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ if (!modal.isOpen) {
+ return;
+ }
+
+ // Get the block wrapper element.
+ const blockWrapper = document.getElementById(blockId);
+ if (!blockWrapper) {
+ return;
+ }
+
+ // If the click was on the button or its children, we should not close the modal.
+ const toggleButton = blockWrapper.querySelector('.wp-element-button[data-wp-on--click="actions.toggleModal"]');
+ if (toggleButton && (toggleButton === event.target || toggleButton.contains(event.target))) {
+ return;
+ }
+
+ // Check if the click was inside the modal frame.
+ const modalFrame = blockWrapper.querySelector('.activitypub-modal__frame');
+ if (!modalFrame || modalFrame.contains(event.target)) {
+ return;
+ }
+ actions.closeModal();
+ },
+ /**
+ * Positions the modal relative to the button that opened it.
+ */
+ positionModal() {
+ const {
+ blockId
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ const blockWrapper = document.getElementById(blockId);
+ if (!blockWrapper) {
+ return;
+ }
+ const modalOverlay = blockWrapper.querySelector('.activitypub-modal__overlay');
+ if (!modalOverlay) {
+ return;
+ }
+
+ // Reset any previously set positioning.
+ modalOverlay.style.top = '';
+ modalOverlay.style.left = '';
+ modalOverlay.style.right = '';
+ modalOverlay.style.bottom = '';
+
+ // Get button position relative to viewport.
+ const buttonRect = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getElement)().ref.getBoundingClientRect();
+
+ // Get viewport dimensions.
+ const viewportWidth = window.innerWidth;
+
+ // Get the block's position to calculate relative positioning.
+ const blockRect = blockWrapper.getBoundingClientRect();
+
+ // Calculate position relative to the block (our positioning context).
+ const relativeTop = buttonRect.bottom - blockRect.top;
+ const relativeLeft = buttonRect.left - blockRect.left;
+
+ // Calculate available space.
+ const spaceRight = viewportWidth - buttonRect.right;
+
+ // Default position (below button, relative to the block).
+ let position = {
+ top: `${relativeTop + 8}px`,
+ left: `${relativeLeft - 2}px` // -2 px to account for the button border.
+ };
+
+ // If not enough space to the right, align with the right edge.
+ if (spaceRight < 250) {
+ position.left = 'auto';
+ position.right = `${blockRect.right - buttonRect.right}px`;
+ }
+
+ // Apply the position.
+ Object.assign(modalOverlay.style, position);
+ },
+ /**
+ * Traps focus within the specified element.
+ *
+ * @param {Element} element The element to trap focus within.
+ */
+ trapFocus(element) {
+ const focusableElements = element.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]):not([readonly]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])');
+ const firstFocusableElement = focusableElements[0];
+ const lastFocusableElement = focusableElements[focusableElements.length - 1];
+
+ // If the first focusable element is the close button, set initial focus to the next element instead.
+ if (firstFocusableElement && firstFocusableElement.classList.contains('activitypub-modal__close') && focusableElements.length > 1) {
+ // Set initial focus to the second element, but keep firstFocusableElement as is for tab trapping.
+ focusableElements[1].focus();
+ } else {
+ // Otherwise focus the first element as usual.
+ firstFocusableElement.focus();
+ }
+ element.addEventListener('keydown', function (event) {
+ if (event.key !== 'Tab' && event.keyCode !== 9 /* KEYCODE_TAB */) {
+ return;
+ }
+ if (event.shiftKey) {
+ /* shift + tab */
+ if (document.activeElement === firstFocusableElement) {
+ lastFocusableElement.focus();
+ event.preventDefault();
+ }
+ } /* tab */else {
+ if (document.activeElement === lastFocusableElement) {
+ firstFocusableElement.focus();
+ event.preventDefault();
+ }
+ }
+ });
+ }
+ }
+ });
+}
+
+/***/ }),
+
+/***/ "@wordpress/interactivity":
+/*!*******************************************!*\
+ !*** external "@wordpress/interactivity" ***!
+ \*******************************************/
+/***/ ((module) => {
+
+module.exports = __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__;
+
+/***/ })
+
+/******/ });
+/************************************************************************/
+/******/ // The module cache
+/******/ var __webpack_module_cache__ = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/ // Check if module is in cache
+/******/ var cachedModule = __webpack_module_cache__[moduleId];
+/******/ if (cachedModule !== undefined) {
+/******/ return cachedModule.exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = __webpack_module_cache__[moduleId] = {
+/******/ // no module.id needed
+/******/ // no module.loaded needed
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/************************************************************************/
+/******/ /* webpack/runtime/define property getters */
+/******/ (() => {
+/******/ // define getter functions for harmony exports
+/******/ __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 */
+/******/ (() => {
+/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
+/******/ })();
+/******/
+/******/ /* webpack/runtime/make namespace object */
+/******/ (() => {
+/******/ // define __esModule on exports
+/******/ __webpack_require__.r = (exports) => {
+/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
+/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
+/******/ }
+/******/ Object.defineProperty(exports, '__esModule', { value: true });
+/******/ };
+/******/ })();
+/******/
+/************************************************************************/
+var __webpack_exports__ = {};
+// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
+(() => {
+/*!*******************************!*\
+ !*** ./src/reactions/view.js ***!
+ \*******************************/
+__webpack_require__.r(__webpack_exports__);
+/* harmony import */ var _wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/interactivity */ "@wordpress/interactivity");
+/* harmony import */ var _shared_modal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/modal */ "./src/shared/modal/index.js");
+
+
+
+/** @var {Object} window.wp WordPress global object */
+const {
+ apiFetch
+} = window.wp;
+(0,_shared_modal__WEBPACK_IMPORTED_MODULE_1__.createModalStore)('activitypub/reactions');
+
+/**
+ * @typedef {Object} state
+ * @property {Object} reactions Reactions data, keyed by post ID.
+ */
+
+/**
+ * @typedef {Object} context
+ * @property {String} blockId The block ID.
+ * @property {Object} modal The modal state.
+ * @property {boolean} modal.isCompact Whether the modal is compact.
+ * @property {boolean} modal.isOpen Whether the modal is open.
+ * @property {Object} modal.items The items to display in the modal.
+ * @property {String} postId The post ID.
+ * @property {Object} reactions Reactions data, keyed by reaction type.
+ */
+
+const {
+ callbacks,
+ state
+} = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.store)('activitypub/reactions', {
+ actions: {
+ /**
+ * Fetches reactions for a post.
+ */
+ async fetchReactions() {
+ const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ const {
+ namespace
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getConfig)();
+ if (!context.postId) return;
+ try {
+ // Update the state with the new Reactions data.
+ context.reactions = await apiFetch({
+ path: `/${namespace}/posts/${context.postId}/reactions`
+ });
+ } catch (error) {
+ console.error('Error fetching reactions:', error);
+ }
+ }
+ },
+ callbacks: {
+ /**
+ * Initializes the Reactions component.
+ */
+ initReactions() {
+ // Set up resize observer to recalculate on window resize.
+ const resizeObserver = new ResizeObserver((0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.withScope)(callbacks.calculateVisibleAvatars));
+ (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getElement)().ref.querySelectorAll('.reaction-group').forEach(group => {
+ resizeObserver.observe(group);
+ });
+
+ // Return a cleanup function to disconnect the observer when the block is unmounted.
+ return () => {
+ resizeObserver.disconnect();
+ };
+ },
+ /**
+ * Calculates and sets the number of visible avatars based on container width.
+ */
+ calculateVisibleAvatars() {
+ const {
+ postId
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+
+ // Constants for calculations
+ const AVATAR_WIDTH = 32; // Width of each avatar
+ const AVATAR_OVERLAP = 10; // How much each avatar overlaps
+ const EFFECTIVE_AVATAR_WIDTH = AVATAR_WIDTH - AVATAR_OVERLAP; // Width each additional avatar takes
+ const BUTTON_GAP = 12; // Gap between avatars and button (0.75em)
+
+ // Get all reaction types from the state.
+ const reactionTypes = state.reactions && state.reactions[postId] ? Object.keys(state.reactions[postId]) : [];
+
+ // Process each reaction group.
+ reactionTypes.forEach(reactionType => {
+ if (!state.reactions?.[postId][reactionType]?.items?.length) {
+ return;
+ }
+ (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getElement)().ref.querySelectorAll(`.reaction-group[data-reaction-type="${reactionType}"]`).forEach(container => {
+ const label = container.querySelector('.reaction-label');
+ const labelWidth = label.offsetWidth || 0;
+ const availableWidth = container.offsetWidth - labelWidth - BUTTON_GAP;
+
+ // Calculate how many avatars can fit.
+ // The first avatar takes full width, the rest take effective width.
+ let maxAvatars = 1; // Start with 1 for the first avatar.
+
+ // If we have space for more than one avatar.
+ if (availableWidth > AVATAR_WIDTH) {
+ // Calculate how many additional avatars can fit in the remaining space.
+ maxAvatars += Math.floor((availableWidth - AVATAR_WIDTH) / EFFECTIVE_AVATAR_WIDTH);
+ }
+
+ // Ensure we don't show more than we have.
+ const items = state.reactions[postId][reactionType].items;
+ const visibleCount = Math.min(maxAvatars, items.length);
+
+ // Update the DOM to show only the calculated number of avatars.
+ const avatarsList = container.querySelector('.reaction-avatars');
+ if (avatarsList) {
+ const avatarItems = avatarsList.querySelectorAll('li');
+ avatarItems.forEach((item, index) => {
+ if (index < visibleCount) {
+ item.removeAttribute('hidden');
+ } else {
+ item.setAttribute('hidden', 'hidden');
+ }
+ });
+ }
+ });
+ });
+ },
+ /**
+ * Sets the default avatar when the avatar image fails to load.
+ *
+ * @param {Object} event The error event.
+ */
+ setDefaultAvatar(event) {
+ event.target.src = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getConfig)().defaultAvatarUrl;
+ },
+ /**
+ * Opens the modal with the specified reaction type.
+ */
+ onModalOpen() {
+ const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ const reactionType = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getElement)().ref.dataset.reactionType;
+
+ // Set modal properties.
+ context.modal.items = state.reactions[context.postId][reactionType].items;
+ }
+ }
+});
+})();
+
+
+//# sourceMappingURL=view.js.map
\ No newline at end of file
diff --git a/build/remote-reply/style-view.css b/build/remote-reply/style-view.css
index 73723b11b2..c700475305 100644
--- a/build/remote-reply/style-view.css
+++ b/build/remote-reply/style-view.css
@@ -1 +1,97 @@
-.activitypub-remote-reply{margin-top:24px}.activitypub-remote-reply .activitypub-remote-profile{align-items:center;display:flex;gap:1rem}.activitypub-remote-reply .activitypub-remote-profile__close{align-items:center;border-radius:50%;display:inline-flex;height:24px;justify-content:center;line-height:1;padding:0;width:24px}.activitypub-remote-reply .activitypub-remote-profile__link,.activitypub-remote-reply__link{cursor:pointer;display:inline-block;margin:0!important}.activitypub-remote-profile[hidden],.activitypub-remote-reply__link[hidden]{display:none!important}.activitypub-dialog__section{border-bottom:1px solid var(--wp--preset--color--light-gray,#f0f0f0);padding:1.5rem 2rem}.activitypub-dialog__section:last-child{border-bottom:none;padding-bottom:2rem}.activitypub-dialog__section h4{font-size:110%;margin-bottom:.5rem;margin-top:0}.activitypub-dialog__description{color:inherit;font-size:95%;margin-bottom:1rem}.activitypub-dialog__button-group{display:flex;margin-bottom:.5rem;width:100%}.activitypub-dialog__button-group input[type]{border:1px solid var(--wp--preset--color--gray,#e2e4e7);border-radius:4px 0 0 4px;flex:1;line-height:1;margin:0}.activitypub-dialog__button-group input[type]::-moz-placeholder{opacity:.5}.activitypub-dialog__button-group input[type]::placeholder{opacity:.5}.activitypub-dialog__button-group input[type][aria-invalid=true]{border-color:var(--wp--preset--color--vivid-red)}.activitypub-dialog__button-group button{border-radius:0 4px 4px 0!important;margin-left:-1px!important;min-width:22.5%;width:auto}.activitypub-dialog__error{color:var(--wp--preset--color--vivid-red);font-size:90%;margin-top:.5rem}.activitypub-dialog__remember{font-size:90%;margin-top:1rem}.activitypub-dialog__remember label{align-items:center;display:flex;gap:.5rem}.activitypub-dialog__remember input[type=checkbox]{margin:0;position:relative;top:0}
+/*!****************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/remote-reply/style.scss ***!
+ \****************************************************************************************************************************************************************************************************************************************************/
+.activitypub-remote-reply {
+ margin-top: 24px;
+}
+.activitypub-remote-reply .activitypub-remote-profile {
+ align-items: center;
+ display: flex;
+ gap: 1rem;
+}
+.activitypub-remote-reply .activitypub-remote-profile__close {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ padding: 0;
+ width: 24px;
+ height: 24px;
+ line-height: 1;
+ border-radius: 50%;
+}
+.activitypub-remote-reply__link,
+.activitypub-remote-reply .activitypub-remote-profile__link {
+ cursor: pointer;
+ display: inline-block;
+ margin: 0 !important;
+}
+.activitypub-remote-profile[hidden],
+.activitypub-remote-reply__link[hidden] {
+ display: none !important;
+}
+.activitypub-dialog__section {
+ padding: 1.5rem 2rem;
+ border-bottom: 1px solid var(--wp--preset--color--light-gray, #f0f0f0);
+}
+.activitypub-dialog__section:last-child {
+ border-bottom: none;
+ padding-bottom: 2rem;
+}
+.activitypub-dialog__section h4 {
+ margin-top: 0;
+ margin-bottom: 0.5rem;
+ font-size: 110%;
+}
+.activitypub-dialog__description {
+ margin-bottom: 1rem;
+ color: inherit;
+ font-size: 95%;
+}
+.activitypub-dialog__button-group {
+ display: flex;
+ width: 100%;
+ margin-bottom: 0.5rem;
+}
+.activitypub-dialog__button-group input[type] {
+ flex: 1;
+ border: 1px solid var(--wp--preset--color--gray, #e2e4e7);
+ border-radius: 4px 0 0 4px;
+ line-height: 1;
+ margin: 0;
+}
+.activitypub-dialog__button-group input[type]::-moz-placeholder {
+ opacity: 0.5;
+}
+.activitypub-dialog__button-group input[type]::placeholder {
+ opacity: 0.5;
+}
+.activitypub-dialog__button-group input[type][aria-invalid=true] {
+ border-color: var(--wp--preset--color--vivid-red);
+}
+.activitypub-dialog__button-group button {
+ border-radius: 0 4px 4px 0 !important;
+ margin-left: -1px !important;
+ min-width: 22.5%;
+ width: auto;
+}
+.activitypub-dialog__error {
+ color: var(--wp--preset--color--vivid-red);
+ font-size: 90%;
+ margin-top: 0.5rem;
+}
+.activitypub-dialog__remember {
+ margin-top: 1rem;
+ font-size: 90%;
+}
+.activitypub-dialog__remember label {
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+}
+.activitypub-dialog__remember input[type=checkbox] {
+ margin: 0;
+ position: relative;
+ top: 0;
+}
+
+/*# sourceMappingURL=style-view.css.map*/
\ No newline at end of file
diff --git a/build/remote-reply/view.asset.php b/build/remote-reply/view.asset.php
index b6e78b434b..7b9c6d2a8e 100644
--- a/build/remote-reply/view.asset.php
+++ b/build/remote-reply/view.asset.php
@@ -1 +1 @@
- array('@wordpress/interactivity'), 'version' => 'bb8eb819b949d4c63e53', 'type' => 'module');
+ array('@wordpress/interactivity'), 'version' => '219b38d5a72506d5d5bb', 'type' => 'module');
diff --git a/build/remote-reply/view.js b/build/remote-reply/view.js
index aed57a024a..285426addb 100644
--- a/build/remote-reply/view.js
+++ b/build/remote-reply/view.js
@@ -1 +1,760 @@
-import{getConfig as e,getContext as t,getElement as o,store as r}from"@wordpress/interactivity";var n,l={764:()=>{const{apiFetch:n}=window.wp;!function(){const{actions:e,callbacks:n}=r("activitypub/remote-reply",{actions:{openModal(e){const o=t();o.modal.isOpen=!0,o.modal.isCompact?setTimeout(n.positionModal,0):setTimeout(()=>{const e=document.getElementById(o.blockId);if(e){const t=e.querySelector(".activitypub-modal__frame");t&&n.trapFocus(t)}},50),"function"==typeof n.onModalOpen&&n.onModalOpen(e)},closeModal(e){const r=t();r.modal.isOpen=!1;const l=o();if("actions.toggleModal"===l.ref.dataset["wpOn-Click"])l.ref.focus();else{const e=document.getElementById(r.blockId);if(e){const t=e.querySelector('[data-wp-on--click="actions.toggleModal"], [data-wp-on-async--click="actions.toggleModal"]');t&&t.focus()}}"function"==typeof n.onModalClose&&n.onModalClose(e)},toggleModal(o){const{modal:r}=t();r.isOpen?e.closeModal(o):e.openModal(o)}},callbacks:{_abortController:null,handleModalEffects(){const{modal:e}=t();if(e.isOpen&&!e.isCompact?document.body.classList.add("modal-open"):document.body.classList.remove("modal-open"),n._abortController&&(n._abortController.abort(),n._abortController=null),e.isOpen){n._abortController=new AbortController;const{signal:e}=n._abortController;document.addEventListener("keydown",n.documentKeydown,{signal:e}),document.addEventListener("click",n.documentClick,{signal:e})}},documentKeydown(o){const{modal:r}=t();r.isOpen&&"Escape"===o.key&&e.closeModal()},documentClick(o){const{blockId:r,modal:n}=t();if(!n.isOpen)return;const l=document.getElementById(r);if(!l)return;const s=l.querySelector('.wp-element-button[data-wp-on--click="actions.toggleModal"]');if(s&&(s===o.target||s.contains(o.target)))return;const a=l.querySelector(".activitypub-modal__frame");a&&!a.contains(o.target)&&e.closeModal()},positionModal(){const{blockId:e}=t(),r=document.getElementById(e);if(!r)return;const n=r.querySelector(".activitypub-modal__overlay");if(!n)return;n.style.top="",n.style.left="",n.style.right="",n.style.bottom="";const l=o().ref.getBoundingClientRect(),s=window.innerWidth,a=r.getBoundingClientRect();let i={top:l.bottom-a.top+8+"px",left:l.left-a.left-2+"px"};s-l.right<250&&(i.left="auto",i.right=a.right-l.right+"px"),Object.assign(n.style,i)},trapFocus(e){const t=e.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]):not([readonly]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),o=t[0],r=t[t.length-1];o&&o.classList.contains("activitypub-modal__close")&&t.length>1?t[1].focus():o.focus(),e.addEventListener("keydown",function(e){"Tab"!==e.key&&9!==e.keyCode||(e.shiftKey?document.activeElement===o&&(r.focus(),e.preventDefault()):document.activeElement===r&&(o.focus(),e.preventDefault()))})}}})}();const{actions:l,callbacks:s,state:a}=r("activitypub/remote-reply",{state:{get remoteProfileUrl(){const{commentURL:e}=t();return a.template.replace("{uri}",encodeURIComponent(e))}},actions:{onReplyLinkKeydown(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),l.toggleModal(e))},copyToClipboard(){const o=t(),{i18n:r}=e();navigator.clipboard.writeText(o.commentURL).then(()=>{o.copyButtonText=r.copied,setTimeout(()=>{o.copyButtonText=r.copy},1e3)},e=>{console.error("Could not copy text: ",e)})},updateRemoteProfile(e){const o=t();o.remoteProfile=e.target.value,o.isError=!1,o.errorMessage=""},onInputKeydown(e){if("Enter"===e.key)return e.preventDefault(),l.submitRemoteProfile()},*submitRemoteProfile(){const o=t(),{namespace:r,i18n:i}=e(),c=o.remoteProfile.trim();if(!c)return o.isError=!0,void(o.errorMessage=i.emptyProfileError);if(!s.isHandle(c)&&!s.isUrl(c))return o.isError=!0,void(o.errorMessage=i.invalidProfileError);o.isLoading=!0,o.isError=!1,o.errorMessage="";const d=`/${r}/comments/${o.commentId}/remote-reply?resource=${encodeURIComponent(c)}`;try{const{template:e,url:t}=yield n({path:d});o.isLoading=!1,window.open(t,"_blank"),l.closeModal(),o.shouldSaveProfile&&(s.setStore({profileURL:c,template:e}),Object.assign(a,{hasRemoteUser:!0,profileURL:c,template:e}))}catch(e){console.error("Error submitting profile:",e),o.isLoading=!1,o.isError=!0,o.errorMessage=e.message||i.genericError}},toggleRememberProfile(){const e=t();e.shouldSaveProfile=!e.shouldSaveProfile},deleteRemoteUser(){s.deleteStore(),a.hasRemoteUser=!1,a.profileURL="",a.template=""}},callbacks:{storageKey:"fediverse-remote-user",init(){const{profileURL:e,template:t}=s.getStore();e&&t&&Object.assign(a,{hasRemoteUser:!0,profileURL:e,template:t})},getStore(){const e=localStorage.getItem(s.storageKey);return e?JSON.parse(e):{}},setStore(e){localStorage.setItem(s.storageKey,JSON.stringify(e))},deleteStore(){localStorage.removeItem(s.storageKey)},isHandle(e){const t=e.replace(/^@/,"").split("@");return 2===t.length&&s.isUrl(`https://${t[1]}`)},isUrl(e){try{return new URL(e),!0}catch(e){return!1}}}})}},s={};function a(e){var t=s[e];if(void 0!==t)return t.exports;var o=s[e]={exports:{}};return l[e](o,o.exports,a),o.exports}a.m=l,n=[],a.O=(e,t,o,r)=>{if(!t){var l=1/0;for(d=0;d=r)&&Object.keys(a.O).every(e=>a.O[e](t[i]))?t.splice(i--,1):(s=!1,r0&&n[d-1][2]>r;d--)n[d]=n[d-1];n[d]=[t,o,r]},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i,c=a;export{c as __webpack_require__};i={466:0,354:0},a.C=e=>{var t,o,{__webpack_esm_ids__:r,__webpack_esm_modules__:n,__webpack_esm_runtime__:l}=e,s=0;for(t in n)a.o(n,t)&&(a.m[t]=n[t]);for(l&&l(a);s0===i[e];var d=a.O(void 0,[354],()=>a(764));d=a.O(d);
\ No newline at end of file
+import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity";
+/******/ var __webpack_modules__ = ({
+
+/***/ "./src/remote-reply/style.scss":
+/*!*************************************!*\
+ !*** ./src/remote-reply/style.scss ***!
+ \*************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+// extracted by mini-css-extract-plugin
+
+
+/***/ }),
+
+/***/ "./src/remote-reply/view.js":
+/*!**********************************!*\
+ !*** ./src/remote-reply/view.js ***!
+ \**********************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony import */ var _wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/interactivity */ "@wordpress/interactivity");
+/* harmony import */ var _shared_modal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/modal */ "./src/shared/modal/index.js");
+/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ "./src/remote-reply/style.scss");
+
+
+
+
+/** @var {object} wp WordPress global. */
+const {
+ apiFetch
+} = window.wp;
+(0,_shared_modal__WEBPACK_IMPORTED_MODULE_1__.createModalStore)('activitypub/remote-reply');
+
+/**
+ * @typedef {Object} config
+ * @property {String} namespace ActivityPub REST Namespace.
+ * @property {Object} i18n Internationalization strings.
+ * @property {String} i18n.copy "Copy" button text.
+ * @property {String} i18n.copied "Copied" button text.
+ * @property {String} i18n.emptyProfileError Error message for empty remote profile.
+ * @property {String} i18n.invalidProfileError Error message for invalid remote profile.
+ * @property {String} i18n.genericError Generic error message.
+ */
+
+/**
+ * @typedef {Object} context
+ * @property {String} blockId The block ID.
+ * @property {String} commentId The comment ID.
+ * @property {String} commentURL The comment URL.
+ * @property {String} copyButtonText The copy button text.
+ * @property {String} errorMessage The error message.
+ * @property {boolean} isError Whether there is an error.
+ * @property {boolean} isLoading Whether the remote profile is being submitted.
+ * @property {Object} modal The modal state.
+ * @property {boolean} modal.isOpen Whether the modal is open.
+ * @property {String} remoteProfile The remote profile.
+ * @property {boolean} shouldSaveProfile Whether to save the profile.
+ */
+
+const {
+ actions,
+ callbacks,
+ state
+} = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.store)('activitypub/remote-reply', {
+ state: {
+ /**
+ * Get the remote profile URL.
+ *
+ * @returns {String} The remote profile URL.
+ */
+ get remoteProfileUrl() {
+ const {
+ commentURL
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ return state.template.replace('{uri}', encodeURIComponent(commentURL));
+ }
+ },
+ actions: {
+ /**
+ * Handle the opening of the modal.
+ *
+ * @param {Event} event The event that triggered the modal opening/closing.
+ * @param {String} event.key The key pressed, if any.
+ */
+ onReplyLinkKeydown(event) {
+ // Handle Enter key to open the modal.
+ if (event.key === 'Enter' || event.key === ' ') {
+ event.preventDefault();
+ actions.toggleModal(event);
+ }
+ },
+ /**
+ * Copy the comment URL to the clipboard.
+ */
+ copyToClipboard() {
+ const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ const {
+ i18n
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getConfig)();
+
+ // Use the Clipboard API to copy text.
+ navigator.clipboard.writeText(context.commentURL).then(() => {
+ // Update button text to show success.
+ context.copyButtonText = i18n.copied;
+
+ // Reset button text after 1 second.
+ setTimeout(() => {
+ context.copyButtonText = i18n.copy;
+ }, 1000);
+ }, error => {
+ // Log error if copying fails.
+ console.error('Could not copy text: ', error);
+ });
+ },
+ /**
+ * Update the remote profile value.
+ *
+ * @param {Event} event Input event.
+ * @param {String} event.target.value The remote profile value.
+ */
+ updateRemoteProfile(event) {
+ const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ context.remoteProfile = event.target.value;
+
+ // Reset error state when input changes.
+ context.isError = false;
+ context.errorMessage = '';
+ },
+ /**
+ * Handle keydown event for remote profile input.
+ *
+ * @param {Event} event Keydown event.
+ * @param {String} event.key Key pressed.
+ */
+ onInputKeydown(event) {
+ if (event.key === 'Enter') {
+ event.preventDefault();
+ return actions.submitRemoteProfile();
+ }
+ },
+ /**
+ * Submit the remote profile.
+ */
+ *submitRemoteProfile() {
+ const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ const {
+ namespace,
+ i18n
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getConfig)();
+ const profileURL = context.remoteProfile.trim();
+
+ // Validate input.
+ if (!profileURL) {
+ context.isError = true;
+ context.errorMessage = i18n.emptyProfileError;
+ return;
+ }
+ if (!callbacks.isHandle(profileURL) && !callbacks.isUrl(profileURL)) {
+ context.isError = true;
+ context.errorMessage = i18n.invalidProfileError;
+ return;
+ }
+
+ // Set loading state.
+ context.isLoading = true;
+ context.isError = false;
+ context.errorMessage = '';
+
+ // Construct the API path.
+ const path = `/${namespace}/comments/${context.commentId}/remote-reply?resource=${encodeURIComponent(profileURL)}`;
+ try {
+ // Make the API request.
+ const {
+ template,
+ url
+ } = yield apiFetch({
+ path
+ });
+
+ // Set opening state.
+ context.isLoading = false;
+
+ // Open the remote reply URL in a new tab.
+ window.open(url, '_blank');
+
+ // Close the modal after opening the URL.
+ actions.closeModal();
+
+ // Save the remote user if the remember option is checked.
+ if (context.shouldSaveProfile) {
+ callbacks.setStore({
+ profileURL,
+ template
+ });
+ Object.assign(state, {
+ hasRemoteUser: true,
+ profileURL,
+ template
+ });
+ }
+ } catch (error) {
+ // Handle error.
+ console.error('Error submitting profile:', error);
+ context.isLoading = false;
+ context.isError = true;
+ context.errorMessage = error.message || i18n.genericError;
+ }
+ },
+ /**
+ * Toggle the remember profile checkbox.
+ */
+ toggleRememberProfile() {
+ const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ context.shouldSaveProfile = !context.shouldSaveProfile;
+ },
+ /**
+ * Delete the saved remote user profile.
+ */
+ deleteRemoteUser() {
+ callbacks.deleteStore();
+ state.hasRemoteUser = false;
+ state.profileURL = '';
+ state.template = '';
+ }
+ },
+ callbacks: {
+ /**
+ * The storage key for the remote user data.
+ */
+ storageKey: 'fediverse-remote-user',
+ /**
+ * Initialize the component.
+ */
+ init() {
+ const {
+ profileURL,
+ template
+ } = callbacks.getStore();
+
+ // Set the remote user data from localStorage if available.
+ if (profileURL && template) {
+ Object.assign(state, {
+ hasRemoteUser: true,
+ profileURL,
+ template
+ });
+ }
+ },
+ /**
+ * Retrieve the remote user data from localStorage.
+ *
+ * @returns {Object} Remote user data or empty object, if not set.
+ */
+ getStore() {
+ const data = localStorage.getItem(callbacks.storageKey);
+ return data ? JSON.parse(data) : {};
+ },
+ /**
+ * Store remote user data in localStorage.
+ *
+ * @param {Object} data - Remote user data to store.
+ */
+ setStore(data) {
+ localStorage.setItem(callbacks.storageKey, JSON.stringify(data));
+ },
+ /**
+ * Remove remote user data from localStorage.
+ */
+ deleteStore() {
+ localStorage.removeItem(callbacks.storageKey);
+ },
+ /**
+ * Best guess whether a string is a valid ActivityPub handle.
+ *
+ * @param {string} string - String to check.
+ * @returns {boolean} True if string is a valid handle, false otherwise.
+ */
+ isHandle(string) {
+ // Check if the string starts with '@' and contains a valid URL.
+ const parts = string.replace(/^@/, '').split('@');
+ return parts.length === 2 && callbacks.isUrl(`https://${parts[1]}`);
+ },
+ /**
+ * Checks if a string is a valid URL.
+ *
+ * @param {string} string - String to check.
+ * @returns {boolean} True if string is a valid URL, false otherwise.
+ */
+ isUrl(string) {
+ try {
+ new URL(string);
+ return true;
+ } catch (_) {
+ return false;
+ }
+ }
+ }
+});
+
+/***/ }),
+
+/***/ "./src/shared/modal/index.js":
+/*!***********************************!*\
+ !*** ./src/shared/modal/index.js ***!
+ \***********************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ createModalStore: () => (/* binding */ createModalStore)
+/* harmony export */ });
+/* harmony import */ var _wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/interactivity */ "@wordpress/interactivity");
+
+
+/**
+ * @typedef {Object} context
+ * @property {String} blockId - The ID of the block.
+ * @property {Object} modal - The modal state.
+ * @property {boolean} modal.isOpen - Whether the modal is open.
+ * @property {boolean} modal.isCompact - Whether the modal is compact.
+ */
+
+/**
+ * Set up a modal store with actions and callbacks.
+ *
+ * The Interactivity API merges all stores that share the same namespace,
+ * so these actions and callbacks are added directly to the importing block’s existing store.
+ *
+ * @param {string} namespace - The interactivity namespace for the block.
+ */
+function createModalStore(namespace) {
+ const {
+ actions,
+ callbacks
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.store)(namespace, {
+ actions: {
+ /**
+ * Open the modal.
+ *
+ * @param {Event} event Click event.
+ */
+ openModal(event) {
+ const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+
+ // Set modal properties
+ context.modal.isOpen = true;
+ if (context.modal.isCompact) {
+ // Position the compact modal relative to the button.
+ setTimeout(callbacks.positionModal, 0);
+ } else {
+ // Set up the focus trap after modal is open.
+ setTimeout(() => {
+ // Use the blockId to find the specific modal frame for this block
+ const blockWrapper = document.getElementById(context.blockId);
+ if (blockWrapper) {
+ const modalFrame = blockWrapper.querySelector('.activitypub-modal__frame');
+ if (modalFrame) {
+ callbacks.trapFocus(modalFrame);
+ }
+ }
+ }, 50);
+ }
+
+ // Call the onOpen callback if provided.
+ if (typeof callbacks.onModalOpen === 'function') {
+ callbacks.onModalOpen(event);
+ }
+ },
+ /**
+ * Close the modal.
+ *
+ * @param {Event} event Click event.
+ */
+ closeModal(event) {
+ const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+
+ // Reset modal state
+ context.modal.isOpen = false;
+
+ // Return focus to the button that opened the modal.
+ const button = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getElement)();
+ if (button.ref.dataset['wpOn-Click'] === 'actions.toggleModal') {
+ button.ref.focus();
+ } else {
+ const blockWrapper = document.getElementById(context.blockId);
+ if (blockWrapper) {
+ const openButton = blockWrapper.querySelector('[data-wp-on--click="actions.toggleModal"], [data-wp-on-async--click="actions.toggleModal"]');
+ if (openButton) {
+ openButton.focus();
+ }
+ }
+ }
+
+ // Call the onClose callback if provided.
+ if (typeof callbacks.onModalClose === 'function') {
+ callbacks.onModalClose(event);
+ }
+ },
+ /**
+ * Toggle the modal.
+ *
+ * @param {Event} event Click event.
+ */
+ toggleModal(event) {
+ const {
+ modal
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ modal.isOpen ? actions.closeModal(event) : actions.openModal(event);
+ }
+ },
+ callbacks: {
+ /**
+ * Abort controller for keydown and click event listeners.
+ *
+ * @type {AbortController | null} Abort controller.
+ */
+ _abortController: null,
+ /**
+ * Handles modal effects like body class and event listeners.
+ * This is called via data-wp-watch in the modal HTML.
+ */
+ handleModalEffects() {
+ const {
+ modal
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+
+ // Update body class.
+ if (modal.isOpen && !modal.isCompact) {
+ document.body.classList.add('modal-open');
+ } else {
+ document.body.classList.remove('modal-open');
+ }
+
+ // Remove all existing listeners.
+ if (callbacks._abortController) {
+ callbacks._abortController.abort();
+ callbacks._abortController = null;
+ }
+
+ // Add new listeners if modal is open.
+ if (modal.isOpen) {
+ callbacks._abortController = new AbortController();
+ const {
+ signal
+ } = callbacks._abortController;
+ document.addEventListener('keydown', callbacks.documentKeydown, {
+ signal
+ });
+ document.addEventListener('click', callbacks.documentClick, {
+ signal
+ });
+ }
+ return undefined;
+ },
+ /**
+ * Handles keydown events on the document.
+ *
+ * @param {Event} event Keydown event.
+ * @param {String} event.key The key that was pressed.
+ */
+ documentKeydown(event) {
+ const {
+ modal
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ if (modal.isOpen && event.key === 'Escape') {
+ actions.closeModal();
+ }
+ },
+ /**
+ * Handles click events on the document.
+ *
+ * @param {Event} event Click event.
+ */
+ documentClick(event) {
+ const {
+ blockId,
+ modal
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ if (!modal.isOpen) {
+ return;
+ }
+
+ // Get the block wrapper element.
+ const blockWrapper = document.getElementById(blockId);
+ if (!blockWrapper) {
+ return;
+ }
+
+ // If the click was on the button or its children, we should not close the modal.
+ const toggleButton = blockWrapper.querySelector('.wp-element-button[data-wp-on--click="actions.toggleModal"]');
+ if (toggleButton && (toggleButton === event.target || toggleButton.contains(event.target))) {
+ return;
+ }
+
+ // Check if the click was inside the modal frame.
+ const modalFrame = blockWrapper.querySelector('.activitypub-modal__frame');
+ if (!modalFrame || modalFrame.contains(event.target)) {
+ return;
+ }
+ actions.closeModal();
+ },
+ /**
+ * Positions the modal relative to the button that opened it.
+ */
+ positionModal() {
+ const {
+ blockId
+ } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
+ const blockWrapper = document.getElementById(blockId);
+ if (!blockWrapper) {
+ return;
+ }
+ const modalOverlay = blockWrapper.querySelector('.activitypub-modal__overlay');
+ if (!modalOverlay) {
+ return;
+ }
+
+ // Reset any previously set positioning.
+ modalOverlay.style.top = '';
+ modalOverlay.style.left = '';
+ modalOverlay.style.right = '';
+ modalOverlay.style.bottom = '';
+
+ // Get button position relative to viewport.
+ const buttonRect = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getElement)().ref.getBoundingClientRect();
+
+ // Get viewport dimensions.
+ const viewportWidth = window.innerWidth;
+
+ // Get the block's position to calculate relative positioning.
+ const blockRect = blockWrapper.getBoundingClientRect();
+
+ // Calculate position relative to the block (our positioning context).
+ const relativeTop = buttonRect.bottom - blockRect.top;
+ const relativeLeft = buttonRect.left - blockRect.left;
+
+ // Calculate available space.
+ const spaceRight = viewportWidth - buttonRect.right;
+
+ // Default position (below button, relative to the block).
+ let position = {
+ top: `${relativeTop + 8}px`,
+ left: `${relativeLeft - 2}px` // -2 px to account for the button border.
+ };
+
+ // If not enough space to the right, align with the right edge.
+ if (spaceRight < 250) {
+ position.left = 'auto';
+ position.right = `${blockRect.right - buttonRect.right}px`;
+ }
+
+ // Apply the position.
+ Object.assign(modalOverlay.style, position);
+ },
+ /**
+ * Traps focus within the specified element.
+ *
+ * @param {Element} element The element to trap focus within.
+ */
+ trapFocus(element) {
+ const focusableElements = element.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]):not([readonly]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])');
+ const firstFocusableElement = focusableElements[0];
+ const lastFocusableElement = focusableElements[focusableElements.length - 1];
+
+ // If the first focusable element is the close button, set initial focus to the next element instead.
+ if (firstFocusableElement && firstFocusableElement.classList.contains('activitypub-modal__close') && focusableElements.length > 1) {
+ // Set initial focus to the second element, but keep firstFocusableElement as is for tab trapping.
+ focusableElements[1].focus();
+ } else {
+ // Otherwise focus the first element as usual.
+ firstFocusableElement.focus();
+ }
+ element.addEventListener('keydown', function (event) {
+ if (event.key !== 'Tab' && event.keyCode !== 9 /* KEYCODE_TAB */) {
+ return;
+ }
+ if (event.shiftKey) {
+ /* shift + tab */
+ if (document.activeElement === firstFocusableElement) {
+ lastFocusableElement.focus();
+ event.preventDefault();
+ }
+ } /* tab */else {
+ if (document.activeElement === lastFocusableElement) {
+ firstFocusableElement.focus();
+ event.preventDefault();
+ }
+ }
+ });
+ }
+ }
+ });
+}
+
+/***/ }),
+
+/***/ "@wordpress/interactivity":
+/*!*******************************************!*\
+ !*** external "@wordpress/interactivity" ***!
+ \*******************************************/
+/***/ ((module) => {
+
+module.exports = __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__;
+
+/***/ })
+
+/******/ });
+/************************************************************************/
+/******/ // The module cache
+/******/ var __webpack_module_cache__ = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/ // Check if module is in cache
+/******/ var cachedModule = __webpack_module_cache__[moduleId];
+/******/ if (cachedModule !== undefined) {
+/******/ return cachedModule.exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = __webpack_module_cache__[moduleId] = {
+/******/ // no module.id needed
+/******/ // no module.loaded needed
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = __webpack_modules__;
+/******/
+/************************************************************************/
+/******/ /* webpack/runtime/chunk loaded */
+/******/ (() => {
+/******/ var deferred = [];
+/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
+/******/ if(chunkIds) {
+/******/ priority = priority || 0;
+/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
+/******/ deferred[i] = [chunkIds, fn, priority];
+/******/ return;
+/******/ }
+/******/ var notFulfilled = Infinity;
+/******/ for (var i = 0; i < deferred.length; i++) {
+/******/ var [chunkIds, fn, priority] = deferred[i];
+/******/ var fulfilled = true;
+/******/ for (var j = 0; j < chunkIds.length; j++) {
+/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
+/******/ chunkIds.splice(j--, 1);
+/******/ } else {
+/******/ fulfilled = false;
+/******/ if(priority < notFulfilled) notFulfilled = priority;
+/******/ }
+/******/ }
+/******/ if(fulfilled) {
+/******/ deferred.splice(i--, 1)
+/******/ var r = fn();
+/******/ if (r !== undefined) result = r;
+/******/ }
+/******/ }
+/******/ return result;
+/******/ };
+/******/ })();
+/******/
+/******/ /* webpack/runtime/define property getters */
+/******/ (() => {
+/******/ // define getter functions for harmony exports
+/******/ __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 */
+/******/ (() => {
+/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
+/******/ })();
+/******/
+/******/ /* webpack/runtime/make namespace object */
+/******/ (() => {
+/******/ // define __esModule on 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/export webpack runtime */
+/******/ var __webpack_require_temp__ = __webpack_require__;
+/******/ export { __webpack_require_temp__ as __webpack_require__ };
+/******/
+/******/ /* webpack/runtime/import chunk loading */
+/******/ (() => {
+/******/ // no baseURI
+/******/
+/******/ // object to store loaded and loading chunks
+/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
+/******/ // [resolve, Promise] = chunk loading, 0 = chunk loaded
+/******/ var installedChunks = {
+/******/ "remote-reply/view": 0,
+/******/ "remote-reply/style-view": 0
+/******/ };
+/******/
+/******/ var installChunk = (data) => {
+/******/ var {__webpack_esm_ids__, __webpack_esm_modules__, __webpack_esm_runtime__} = data;
+/******/ // add "modules" to the modules object,
+/******/ // then flag all "ids" as loaded and fire callback
+/******/ var moduleId, chunkId, i = 0;
+/******/ for(moduleId in __webpack_esm_modules__) {
+/******/ if(__webpack_require__.o(__webpack_esm_modules__, moduleId)) {
+/******/ __webpack_require__.m[moduleId] = __webpack_esm_modules__[moduleId];
+/******/ }
+/******/ }
+/******/ if(__webpack_esm_runtime__) __webpack_esm_runtime__(__webpack_require__);
+/******/ for(;i < __webpack_esm_ids__.length; i++) {
+/******/ chunkId = __webpack_esm_ids__[i];
+/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
+/******/ installedChunks[chunkId][0]();
+/******/ }
+/******/ installedChunks[__webpack_esm_ids__[i]] = 0;
+/******/ }
+/******/ __webpack_require__.O();
+/******/ }
+/******/
+/******/ // no chunk on demand loading
+/******/
+/******/ // no prefetching
+/******/
+/******/ // no preloaded
+/******/
+/******/ __webpack_require__.C = installChunk;
+/******/
+/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
+/******/ // no HMR
+/******/
+/******/ // no HMR manifest
+/******/ })();
+/******/
+/************************************************************************/
+/******/
+/******/
+/******/ // startup
+/******/ // Load entry module and return exports
+/******/ // This entry module depends on other loaded chunks and execution need to be delayed
+/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["remote-reply/style-view"], () => (__webpack_require__("./src/remote-reply/view.js")))
+/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
+/******/
+
+//# sourceMappingURL=view.js.map
\ No newline at end of file
diff --git a/build/reply-intent/plugin.asset.php b/build/reply-intent/plugin.asset.php
index 2bb3bb5fa4..5a003ec4c0 100644
--- a/build/reply-intent/plugin.asset.php
+++ b/build/reply-intent/plugin.asset.php
@@ -1 +1 @@
- array('wp-block-editor', 'wp-blocks', 'wp-data', 'wp-element', 'wp-plugins'), 'version' => 'ee563d746b20aabb037a');
+ array('wp-block-editor', 'wp-blocks', 'wp-data', 'wp-element', 'wp-plugins'), 'version' => 'a0ec149271af9882bd8b');
diff --git a/build/reply-intent/plugin.js b/build/reply-intent/plugin.js
index b0183a39b7..d8cc69f81b 100644
--- a/build/reply-intent/plugin.js
+++ b/build/reply-intent/plugin.js
@@ -1 +1,181 @@
-(()=>{"use strict";const e=window.wp.plugins,t=window.wp.blocks,i=window.wp.data,n=window.wp.blockEditor,o=window.wp.element;let r=!1;(0,e.registerPlugin)("activitypub-reply-intent",{render:()=>((0,o.useEffect)(()=>{if(r)return;const e=new URLSearchParams(window.location.search).get("in_reply_to");e&&!r&&setTimeout(()=>{const o=(0,t.createBlock)("activitypub/reply",{url:e,embedPost:!0}),r=(0,i.dispatch)(n.store);r.insertBlock(o),r.insertAfterBlock(o.clientId)},200),r=!0}),null)})})();
\ No newline at end of file
+/******/ (() => { // webpackBootstrap
+/******/ "use strict";
+/******/ var __webpack_modules__ = ({
+
+/***/ "@wordpress/block-editor":
+/*!*************************************!*\
+ !*** external ["wp","blockEditor"] ***!
+ \*************************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["blockEditor"];
+
+/***/ }),
+
+/***/ "@wordpress/blocks":
+/*!********************************!*\
+ !*** external ["wp","blocks"] ***!
+ \********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["blocks"];
+
+/***/ }),
+
+/***/ "@wordpress/data":
+/*!******************************!*\
+ !*** external ["wp","data"] ***!
+ \******************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["data"];
+
+/***/ }),
+
+/***/ "@wordpress/element":
+/*!*********************************!*\
+ !*** external ["wp","element"] ***!
+ \*********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["element"];
+
+/***/ }),
+
+/***/ "@wordpress/plugins":
+/*!*********************************!*\
+ !*** external ["wp","plugins"] ***!
+ \*********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["plugins"];
+
+/***/ })
+
+/******/ });
+/************************************************************************/
+/******/ // The module cache
+/******/ var __webpack_module_cache__ = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/ // Check if module is in cache
+/******/ var cachedModule = __webpack_module_cache__[moduleId];
+/******/ if (cachedModule !== undefined) {
+/******/ return cachedModule.exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = __webpack_module_cache__[moduleId] = {
+/******/ // no module.id needed
+/******/ // no module.loaded needed
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/************************************************************************/
+/******/ /* webpack/runtime/compat get default export */
+/******/ (() => {
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = (module) => {
+/******/ var getter = module && module.__esModule ?
+/******/ () => (module['default']) :
+/******/ () => (module);
+/******/ __webpack_require__.d(getter, { a: getter });
+/******/ return getter;
+/******/ };
+/******/ })();
+/******/
+/******/ /* webpack/runtime/define property getters */
+/******/ (() => {
+/******/ // define getter functions for harmony exports
+/******/ __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 */
+/******/ (() => {
+/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
+/******/ })();
+/******/
+/******/ /* webpack/runtime/make namespace object */
+/******/ (() => {
+/******/ // define __esModule on exports
+/******/ __webpack_require__.r = (exports) => {
+/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
+/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
+/******/ }
+/******/ Object.defineProperty(exports, '__esModule', { value: true });
+/******/ };
+/******/ })();
+/******/
+/************************************************************************/
+var __webpack_exports__ = {};
+// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
+(() => {
+/*!************************************!*\
+ !*** ./src/reply-intent/plugin.js ***!
+ \************************************/
+__webpack_require__.r(__webpack_exports__);
+/* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/plugins */ "@wordpress/plugins");
+/* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_plugins__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
+/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
+/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__);
+
+
+
+
+
+
+// We use a kind of global state to ensure only a single embed is rendered across component re-renders.
+let didHandleEmbed = false;
+const HandleReplyIntent = () => {
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
+ if (didHandleEmbed) {
+ return;
+ }
+ // Get the GET['in_reply_to'] value from the URL
+ const urlParams = new URLSearchParams(window.location.search);
+ const inReplyTo = urlParams.get('in_reply_to');
+ if (inReplyTo && !didHandleEmbed) {
+ // prepend an activitypub/reply block to the editor
+ // it appears to need a slight delay
+ setTimeout(() => {
+ const block = (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.createBlock)('activitypub/reply', {
+ url: inReplyTo,
+ embedPost: true
+ });
+ const store = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.dispatch)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.store);
+ store.insertBlock(block);
+ // add a new block after it so the user can just type
+ store.insertAfterBlock(block.clientId);
+ }, 200);
+ }
+ didHandleEmbed = true;
+ });
+ return null;
+};
+(0,_wordpress_plugins__WEBPACK_IMPORTED_MODULE_0__.registerPlugin)('activitypub-reply-intent', {
+ render: HandleReplyIntent
+});
+})();
+
+/******/ })()
+;
+//# sourceMappingURL=plugin.js.map
\ No newline at end of file
diff --git a/build/reply/index-rtl.css b/build/reply/index-rtl.css
index 6ee6d1b0ae..c04d0763a0 100644
--- a/build/reply/index-rtl.css
+++ b/build/reply/index-rtl.css
@@ -1 +1,223 @@
-.activitypub-embed-container{min-height:100px;pointer-events:none;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.activitypub-embed-loading{align-items:center;display:flex;justify-content:center}.activitypub-embed-container .wp-block-embed{pointer-events:none!important}.activitypub-embed-preview,.activitypub-embed-preview iframe{pointer-events:none}.activitypub-reply-display{margin:1em 0}.activitypub-reply-display p{margin:0}.activitypub-reply-display a{color:#2271b1;text-decoration:none}.activitypub-reply-display a:hover{color:#135e96;text-decoration:underline}.activitypub-embed{background:#fff;border:1px solid #e6e6e6;border-radius:12px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;max-width:100%;padding:0}.activitypub-reply-block .activitypub-embed{margin:1em 0}.activitypub-embed-header{align-items:center;display:flex;gap:10px;padding:15px}.activitypub-embed-header img{border-radius:50%;height:48px;width:48px}.activitypub-embed-header-text{flex-grow:1}.activitypub-embed-header-text h2{color:#000;font-size:15px;font-weight:600;margin:0;padding:0}.activitypub-embed-header-text .ap-account{color:#687684;font-size:14px;text-decoration:none}.activitypub-embed-content{padding:0 15px 15px}.activitypub-embed-content .ap-title{color:#000;font-size:23px;font-weight:600;margin:0 0 10px;padding:0}.activitypub-embed-content .ap-subtitle{color:#000;font-size:15px;margin:0 0 15px}.activitypub-embed-content .ap-preview{border:1px solid #e6e6e6}.activitypub-embed-content .ap-preview img{display:block;height:auto}.activitypub-embed-content .ap-preview{border-radius:8px;box-sizing:border-box;display:grid;gap:2px;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;margin:1em 0 0;min-height:64px;overflow:hidden;position:relative;width:100%}.activitypub-embed-content .ap-preview.layout-1{grid-template-columns:1fr;grid-template-rows:1fr}.activitypub-embed-content .ap-preview.layout-2{aspect-ratio:auto;grid-template-rows:1fr;height:auto}.activitypub-embed-content .ap-preview.layout-3>img:first-child{grid-row:span 2}.activitypub-embed-content .ap-preview img{border:0;box-sizing:border-box;display:inline-block;height:100%;-o-object-fit:cover;object-fit:cover;overflow:hidden;position:relative;width:100%}.activitypub-embed-content .ap-preview audio,.activitypub-embed-content .ap-preview video{display:block;grid-column:1/span 2;max-width:100%}.activitypub-embed-content .ap-preview audio{width:100%}.activitypub-embed-content .ap-preview-text{padding:15px}.activitypub-embed-meta{border-top:1px solid #e6e6e6;color:#687684;display:flex;font-size:13px;gap:15px;padding:15px}.activitypub-embed-meta .ap-stat{align-items:center;display:flex;gap:5px}@media only screen and (max-width:399px){.activitypub-embed-meta span.ap-stat{display:none!important}}.activitypub-embed-meta a.ap-stat{color:inherit;text-decoration:none}.activitypub-embed-meta strong{color:#000;font-weight:600}.activitypub-embed-meta .ap-stat-label{color:#687684}.wp-block-activitypub-reply .components-spinner{height:12px;margin-bottom:0;margin-top:0;width:12px}
+/*!**********************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/reply/editor.scss ***!
+ \**********************************************************************************************************************************************************************************************************************************************/
+.activitypub-embed-container {
+ position: relative;
+ min-height: 100px;
+ pointer-events: none;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ user-select: none;
+}
+
+.activitypub-embed-loading {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.activitypub-embed-container .wp-block-embed {
+ pointer-events: none !important;
+}
+
+.activitypub-embed-preview {
+ pointer-events: none;
+}
+
+.activitypub-embed-preview iframe {
+ pointer-events: none;
+}
+
+.activitypub-reply-display {
+ margin: 1em 0;
+}
+
+.activitypub-reply-display p {
+ margin: 0;
+}
+
+.activitypub-reply-display a {
+ color: #2271b1;
+ text-decoration: none;
+}
+
+.activitypub-reply-display a:hover {
+ color: #135e96;
+ text-decoration: underline;
+}
+
+/**
+ * ActivityPub embed styles.
+ */
+
+.activitypub-embed {
+ background: #fff;
+ border: 1px solid #e6e6e6;
+ border-radius: 12px;
+ padding: 0;
+ max-width: 100%;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
+}
+
+.activitypub-reply-block .activitypub-embed {
+ margin: 1em 0;
+}
+
+.activitypub-embed-header {
+ padding: 15px;
+ display: flex;
+ align-items: center;
+ gap: 10px;
+}
+
+.activitypub-embed-header img {
+ width: 48px;
+ height: 48px;
+ border-radius: 50%;
+}
+
+.activitypub-embed-header-text {
+ flex-grow: 1;
+}
+
+.activitypub-embed-header-text h2 {
+ color: #000;
+ font-size: 15px;
+ font-weight: 600;
+ margin: 0;
+ padding: 0;
+}
+
+.activitypub-embed-header-text .ap-account {
+ color: #687684;
+ font-size: 14px;
+ text-decoration: none;
+}
+
+.activitypub-embed-content {
+ padding: 0 15px 15px;
+}
+
+.activitypub-embed-content .ap-title {
+ font-size: 23px;
+ font-weight: 600;
+ margin: 0 0 10px;
+ padding: 0;
+ color: #000;
+}
+
+.activitypub-embed-content .ap-subtitle {
+ font-size: 15px;
+ color: #000;
+ margin: 0 0 15px;
+}
+
+.activitypub-embed-content .ap-preview {
+ border: 1px solid #e6e6e6;
+ border-radius: 8px;
+ overflow: hidden;
+}
+
+.activitypub-embed-content .ap-preview img {
+ width: 100%;
+ height: auto;
+ display: block;
+}
+
+.activitypub-embed-content .ap-preview {
+ border-radius: 8px;
+ box-sizing: border-box;
+ display: grid;
+ gap: 2px;
+ grid-template-columns: 1fr 1fr;
+ grid-template-rows: 1fr 1fr;
+ margin: 1em 0 0;
+ min-height: 64px;
+ overflow: hidden;
+ position: relative;
+ width: 100%;
+}
+
+.activitypub-embed-content .ap-preview.layout-1 {
+ grid-template-columns: 1fr;
+ grid-template-rows: 1fr;
+}
+
+.activitypub-embed-content .ap-preview.layout-2 {
+ aspect-ratio: auto;
+ grid-template-rows: 1fr;
+ height: auto;
+}
+
+.activitypub-embed-content .ap-preview.layout-3 > img:first-child {
+ grid-row: span 2;
+}
+
+.activitypub-embed-content .ap-preview img {
+ border: 0;
+ box-sizing: border-box;
+ display: inline-block;
+ height: 100%;
+ -o-object-fit: cover;
+ object-fit: cover;
+ overflow: hidden;
+ position: relative;
+ width: 100%;
+}
+
+.activitypub-embed-content .ap-preview video,
+.activitypub-embed-content .ap-preview audio {
+ max-width: 100%;
+ display: block;
+ grid-column: 1/span 2;
+}
+
+.activitypub-embed-content .ap-preview audio {
+ width: 100%;
+}
+
+.activitypub-embed-content .ap-preview-text {
+ padding: 15px;
+}
+
+.activitypub-embed-meta {
+ padding: 15px;
+ border-top: 1px solid #e6e6e6;
+ color: #687684;
+ font-size: 13px;
+ display: flex;
+ gap: 15px;
+}
+
+.activitypub-embed-meta .ap-stat {
+ display: flex;
+ align-items: center;
+ gap: 5px;
+}
+
+@media only screen and (max-width: 399px) {
+ .activitypub-embed-meta span.ap-stat {
+ display: none !important;
+ }
+}
+
+.activitypub-embed-meta a.ap-stat {
+ color: inherit;
+ text-decoration: none;
+}
+
+.activitypub-embed-meta strong {
+ font-weight: 600;
+ color: #000;
+}
+
+.activitypub-embed-meta .ap-stat-label {
+ color: #687684;
+}
+
+.wp-block-activitypub-reply .components-spinner {
+ margin-top: 0;
+ margin-bottom: 0;
+ width: 12px;
+ height: 12px;
+}
diff --git a/build/reply/index.asset.php b/build/reply/index.asset.php
index e40056b538..0504a1ea4d 100644
--- a/build/reply/index.asset.php
+++ b/build/reply/index.asset.php
@@ -1 +1 @@
- array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '81c54476cf58b65cc4fd');
+ array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '7563ea251176a9893ca6');
diff --git a/build/reply/index.css b/build/reply/index.css
index 6ee6d1b0ae..9d5a0ed037 100644
--- a/build/reply/index.css
+++ b/build/reply/index.css
@@ -1 +1,225 @@
-.activitypub-embed-container{min-height:100px;pointer-events:none;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.activitypub-embed-loading{align-items:center;display:flex;justify-content:center}.activitypub-embed-container .wp-block-embed{pointer-events:none!important}.activitypub-embed-preview,.activitypub-embed-preview iframe{pointer-events:none}.activitypub-reply-display{margin:1em 0}.activitypub-reply-display p{margin:0}.activitypub-reply-display a{color:#2271b1;text-decoration:none}.activitypub-reply-display a:hover{color:#135e96;text-decoration:underline}.activitypub-embed{background:#fff;border:1px solid #e6e6e6;border-radius:12px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;max-width:100%;padding:0}.activitypub-reply-block .activitypub-embed{margin:1em 0}.activitypub-embed-header{align-items:center;display:flex;gap:10px;padding:15px}.activitypub-embed-header img{border-radius:50%;height:48px;width:48px}.activitypub-embed-header-text{flex-grow:1}.activitypub-embed-header-text h2{color:#000;font-size:15px;font-weight:600;margin:0;padding:0}.activitypub-embed-header-text .ap-account{color:#687684;font-size:14px;text-decoration:none}.activitypub-embed-content{padding:0 15px 15px}.activitypub-embed-content .ap-title{color:#000;font-size:23px;font-weight:600;margin:0 0 10px;padding:0}.activitypub-embed-content .ap-subtitle{color:#000;font-size:15px;margin:0 0 15px}.activitypub-embed-content .ap-preview{border:1px solid #e6e6e6}.activitypub-embed-content .ap-preview img{display:block;height:auto}.activitypub-embed-content .ap-preview{border-radius:8px;box-sizing:border-box;display:grid;gap:2px;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;margin:1em 0 0;min-height:64px;overflow:hidden;position:relative;width:100%}.activitypub-embed-content .ap-preview.layout-1{grid-template-columns:1fr;grid-template-rows:1fr}.activitypub-embed-content .ap-preview.layout-2{aspect-ratio:auto;grid-template-rows:1fr;height:auto}.activitypub-embed-content .ap-preview.layout-3>img:first-child{grid-row:span 2}.activitypub-embed-content .ap-preview img{border:0;box-sizing:border-box;display:inline-block;height:100%;-o-object-fit:cover;object-fit:cover;overflow:hidden;position:relative;width:100%}.activitypub-embed-content .ap-preview audio,.activitypub-embed-content .ap-preview video{display:block;grid-column:1/span 2;max-width:100%}.activitypub-embed-content .ap-preview audio{width:100%}.activitypub-embed-content .ap-preview-text{padding:15px}.activitypub-embed-meta{border-top:1px solid #e6e6e6;color:#687684;display:flex;font-size:13px;gap:15px;padding:15px}.activitypub-embed-meta .ap-stat{align-items:center;display:flex;gap:5px}@media only screen and (max-width:399px){.activitypub-embed-meta span.ap-stat{display:none!important}}.activitypub-embed-meta a.ap-stat{color:inherit;text-decoration:none}.activitypub-embed-meta strong{color:#000;font-weight:600}.activitypub-embed-meta .ap-stat-label{color:#687684}.wp-block-activitypub-reply .components-spinner{height:12px;margin-bottom:0;margin-top:0;width:12px}
+/*!**********************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/reply/editor.scss ***!
+ \**********************************************************************************************************************************************************************************************************************************************/
+.activitypub-embed-container {
+ position: relative;
+ min-height: 100px;
+ pointer-events: none;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ user-select: none;
+}
+
+.activitypub-embed-loading {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.activitypub-embed-container .wp-block-embed {
+ pointer-events: none !important;
+}
+
+.activitypub-embed-preview {
+ pointer-events: none;
+}
+
+.activitypub-embed-preview iframe {
+ pointer-events: none;
+}
+
+.activitypub-reply-display {
+ margin: 1em 0;
+}
+
+.activitypub-reply-display p {
+ margin: 0;
+}
+
+.activitypub-reply-display a {
+ color: #2271b1;
+ text-decoration: none;
+}
+
+.activitypub-reply-display a:hover {
+ color: #135e96;
+ text-decoration: underline;
+}
+
+/**
+ * ActivityPub embed styles.
+ */
+
+.activitypub-embed {
+ background: #fff;
+ border: 1px solid #e6e6e6;
+ border-radius: 12px;
+ padding: 0;
+ max-width: 100%;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
+}
+
+.activitypub-reply-block .activitypub-embed {
+ margin: 1em 0;
+}
+
+.activitypub-embed-header {
+ padding: 15px;
+ display: flex;
+ align-items: center;
+ gap: 10px;
+}
+
+.activitypub-embed-header img {
+ width: 48px;
+ height: 48px;
+ border-radius: 50%;
+}
+
+.activitypub-embed-header-text {
+ flex-grow: 1;
+}
+
+.activitypub-embed-header-text h2 {
+ color: #000;
+ font-size: 15px;
+ font-weight: 600;
+ margin: 0;
+ padding: 0;
+}
+
+.activitypub-embed-header-text .ap-account {
+ color: #687684;
+ font-size: 14px;
+ text-decoration: none;
+}
+
+.activitypub-embed-content {
+ padding: 0 15px 15px;
+}
+
+.activitypub-embed-content .ap-title {
+ font-size: 23px;
+ font-weight: 600;
+ margin: 0 0 10px;
+ padding: 0;
+ color: #000;
+}
+
+.activitypub-embed-content .ap-subtitle {
+ font-size: 15px;
+ color: #000;
+ margin: 0 0 15px;
+}
+
+.activitypub-embed-content .ap-preview {
+ border: 1px solid #e6e6e6;
+ border-radius: 8px;
+ overflow: hidden;
+}
+
+.activitypub-embed-content .ap-preview img {
+ width: 100%;
+ height: auto;
+ display: block;
+}
+
+.activitypub-embed-content .ap-preview {
+ border-radius: 8px;
+ box-sizing: border-box;
+ display: grid;
+ gap: 2px;
+ grid-template-columns: 1fr 1fr;
+ grid-template-rows: 1fr 1fr;
+ margin: 1em 0 0;
+ min-height: 64px;
+ overflow: hidden;
+ position: relative;
+ width: 100%;
+}
+
+.activitypub-embed-content .ap-preview.layout-1 {
+ grid-template-columns: 1fr;
+ grid-template-rows: 1fr;
+}
+
+.activitypub-embed-content .ap-preview.layout-2 {
+ aspect-ratio: auto;
+ grid-template-rows: 1fr;
+ height: auto;
+}
+
+.activitypub-embed-content .ap-preview.layout-3 > img:first-child {
+ grid-row: span 2;
+}
+
+.activitypub-embed-content .ap-preview img {
+ border: 0;
+ box-sizing: border-box;
+ display: inline-block;
+ height: 100%;
+ -o-object-fit: cover;
+ object-fit: cover;
+ overflow: hidden;
+ position: relative;
+ width: 100%;
+}
+
+.activitypub-embed-content .ap-preview video,
+.activitypub-embed-content .ap-preview audio {
+ max-width: 100%;
+ display: block;
+ grid-column: 1/span 2;
+}
+
+.activitypub-embed-content .ap-preview audio {
+ width: 100%;
+}
+
+.activitypub-embed-content .ap-preview-text {
+ padding: 15px;
+}
+
+.activitypub-embed-meta {
+ padding: 15px;
+ border-top: 1px solid #e6e6e6;
+ color: #687684;
+ font-size: 13px;
+ display: flex;
+ gap: 15px;
+}
+
+.activitypub-embed-meta .ap-stat {
+ display: flex;
+ align-items: center;
+ gap: 5px;
+}
+
+@media only screen and (max-width: 399px) {
+ .activitypub-embed-meta span.ap-stat {
+ display: none !important;
+ }
+}
+
+.activitypub-embed-meta a.ap-stat {
+ color: inherit;
+ text-decoration: none;
+}
+
+.activitypub-embed-meta strong {
+ font-weight: 600;
+ color: #000;
+}
+
+.activitypub-embed-meta .ap-stat-label {
+ color: #687684;
+}
+
+.wp-block-activitypub-reply .components-spinner {
+ margin-top: 0;
+ margin-bottom: 0;
+ width: 12px;
+ height: 12px;
+}
+
+/*# sourceMappingURL=index.css.map*/
\ No newline at end of file
diff --git a/build/reply/index.js b/build/reply/index.js
index d7dbd5e256..c4628a633b 100644
--- a/build/reply/index.js
+++ b/build/reply/index.js
@@ -1 +1,520 @@
-(()=>{"use strict";var e={n:t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var r in o)e.o(o,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.blocks,o=window.wp.primitives,r=window.ReactJSXRuntime;var i=(0,r.jsx)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)(o.Path,{d:"M6.68822 10.625L6.24878 11.0649L5.5 11.8145L5.5 5.5L12.5 5.5V8L14 6.5V5C14 4.44772 13.5523 4 13 4H5C4.44772 4 4 4.44771 4 5V13.5247C4 13.8173 4.16123 14.086 4.41935 14.2237C4.72711 14.3878 5.10601 14.3313 5.35252 14.0845L7.31 12.125H8.375L9.875 10.625H7.31H6.68822ZM14.5605 10.4983L11.6701 13.75H16.9975C17.9963 13.75 18.7796 14.1104 19.3553 14.7048C19.9095 15.2771 20.2299 16.0224 20.4224 16.7443C20.7645 18.0276 20.7543 19.4618 20.7487 20.2544C20.7481 20.345 20.7475 20.4272 20.7475 20.4999L19.2475 20.5001C19.2475 20.4191 19.248 20.3319 19.2484 20.2394V20.2394C19.2526 19.4274 19.259 18.2035 18.973 17.1307C18.8156 16.5401 18.586 16.0666 18.2778 15.7483C17.9909 15.4521 17.5991 15.25 16.9975 15.25H11.8106L14.5303 17.9697L13.4696 19.0303L8.96956 14.5303L13.4394 9.50171L14.5605 10.4983Z"})});const c=window.wp.blockEditor,l=window.wp.components,n=window.wp.i18n,s=window.wp.element,a=window.wp.compose,d=window.wp.data,u=window.wp.apiFetch;var p=e.n(u);const b=window.wp.url,w={default:(0,n.__)("Enter the URL of a post from the Fediverse (Mastodon, Pixelfed, etc.) that you want to reply to.","activitypub"),checking:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.Spinner,{})," "+(0,n.__)("Checking URL...","activitypub")]}),valid:(0,n.__)("The author will be notified of your response.","activitypub"),error:(0,n.__)("This site doesn’t have ActivityPub enabled and won’t receive your reply.","activitypub")};(0,t.registerBlockType)("activitypub/reply",{edit:function({attributes:e,setAttributes:o,clientId:i,isSelected:u}){const{url:y="",embedPost:m=!1}=e,[v,h]=(0,s.useState)(w.default),[f,k]=(0,s.useState)(!1),[_,x]=(0,s.useState)(!1),C=(0,s.useRef)(),{insertAfterBlock:g,removeBlock:L,replaceInnerBlocks:P}=(0,d.useDispatch)("core/block-editor"),j=m&&!_&&f,B=(0,c.useInnerBlocksProps)({className:"activitypub-embed-container"},{allowedBlocks:["core/embed"],template:y&&j?[["core/embed",{url:y}]]:[],templateLock:"all"});(0,s.useEffect)(()=>{P(i,y&&j?[(0,t.createBlock)("core/embed",{url:y})]:[])},[y,j,i,P]),(0,s.useEffect)(()=>{h(y?_?w.checking():f?w.valid:w.error:w.default)},[y,_,f]);const S=()=>{setTimeout(()=>C.current?.focus(),50)},V=(0,s.useCallback)(async e=>{if(e)try{x(!0),new URL(e);try{const t=await p()({path:(0,b.addQueryArgs)("/oembed/1.0/proxy",{url:e,activitypub:!0})});t&&t.provider_name?(o({embedPost:!0,isValidActivityPub:!0}),k(!0)):(o({isValidActivityPub:!1}),k(!1))}catch(e){console.log("Could not fetch embed:",e),o({isValidActivityPub:!1}),k(!1)}}catch(e){o({isValidActivityPub:!1}),k(!1)}finally{x(!1)}else k(!1)},[m,o]),A=(0,a.useDebounce)(V,250);return(0,s.useEffect)(()=>{y&&A(y)},[y]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.InspectorControls,{children:(0,r.jsx)(l.PanelBody,{title:(0,n.__)("Settings","activitypub"),children:(0,r.jsx)(l.ToggleControl,{label:(0,n.__)("Embed Post","activitypub"),checked:!!m,onChange:e=>o({embedPost:e}),disabled:!f,help:(0,n.__)("Show embedded content from the URL.","activitypub"),__nextHasNoMarginBottom:!0})})}),(0,r.jsxs)("div",{onClick:S,...(0,c.useBlockProps)(),children:[u&&(0,r.jsx)(l.TextControl,{label:(0,n.__)("Your post is a reply to the following URL","activitypub"),value:y,onChange:e=>o({url:e}),help:v,onKeyDown:e=>{"Enter"===e.key&&g(i),!y&&["Backspace","Delete"].includes(e.key)&&L(i)},ref:C,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),j&&(0,r.jsx)("div",{...B}),y&&!j&&!u&&(0,r.jsx)("div",{className:"activitypub-reply-block-editor__preview",contentEditable:!1,onClick:S,style:{cursor:"pointer"},children:(0,r.jsx)("a",{href:y,className:"u-in-reply-to",target:"_blank",rel:"noreferrer",children:"↬"+y.replace(/^https?:\/\//,"")})})]})]})},save:()=>null,icon:i,transforms:{from:[{type:"block",blocks:["core/embed"],transform:e=>(0,t.createBlock)("activitypub/reply",{url:e.url||"",embedPost:!0})}],to:[{type:"block",blocks:["core/embed"],transform:e=>(0,t.createBlock)("core/embed",{url:e.url||""})}]}})})();
\ No newline at end of file
+/******/ (() => { // webpackBootstrap
+/******/ "use strict";
+/******/ var __webpack_modules__ = ({
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/comment-reply-link.js":
+/*!**********************************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/comment-reply-link.js ***!
+ \**********************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ comment_reply_link_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/comment-reply-link.tsx
+
+
+var comment_reply_link_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M6.68822 10.625L6.24878 11.0649L5.5 11.8145L5.5 5.5L12.5 5.5V8L14 6.5V5C14 4.44772 13.5523 4 13 4H5C4.44772 4 4 4.44771 4 5V13.5247C4 13.8173 4.16123 14.086 4.41935 14.2237C4.72711 14.3878 5.10601 14.3313 5.35252 14.0845L7.31 12.125H8.375L9.875 10.625H7.31H6.68822ZM14.5605 10.4983L11.6701 13.75H16.9975C17.9963 13.75 18.7796 14.1104 19.3553 14.7048C19.9095 15.2771 20.2299 16.0224 20.4224 16.7443C20.7645 18.0276 20.7543 19.4618 20.7487 20.2544C20.7481 20.345 20.7475 20.4272 20.7475 20.4999L19.2475 20.5001C19.2475 20.4191 19.248 20.3319 19.2484 20.2394V20.2394C19.2526 19.4274 19.259 18.2035 18.973 17.1307C18.8156 16.5401 18.586 16.0666 18.2778 15.7483C17.9909 15.4521 17.5991 15.25 16.9975 15.25H11.8106L14.5303 17.9697L13.4696 19.0303L8.96956 14.5303L13.4394 9.50171L14.5605 10.4983Z" }) });
+
+//# sourceMappingURL=comment-reply-link.js.map
+
+
+/***/ }),
+
+/***/ "./src/reply/edit.js":
+/*!***************************!*\
+ !*** ./src/reply/edit.js ***!
+ \***************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ Edit)
+/* harmony export */ });
+/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
+/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
+/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__);
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__);
+/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
+/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_6__);
+/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
+/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_7__);
+/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
+/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_8__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__);
+
+
+
+
+
+
+
+
+
+
+/**
+ * Help text messages for different reply states.
+ */
+
+const HELP_TEXT = {
+ default: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Enter the URL of a post from the Fediverse (Mastodon, Pixelfed, etc.) that you want to reply to.', 'activitypub'),
+ checking: () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.Fragment, {
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Spinner, {}), ' ' + (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Checking URL...', 'activitypub')]
+ }),
+ valid: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('The author will be notified of your response.', 'activitypub'),
+ error: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('This site doesn\u2019t have ActivityPub enabled and won\u2019t receive your reply.', 'activitypub')
+};
+
+/**
+ * Edit component for the ActivityPub Reply block.
+ *
+ * @param {Object} props - Component props.
+ * @param {Object} props.attributes - Block attributes.
+ * @param {Function} props.setAttributes - Function to update block attributes.
+ * @param {string} props.clientId - Block client ID.
+ * @param {boolean} props.isSelected - Whether the block is selected.
+ */
+function Edit({
+ attributes,
+ setAttributes,
+ clientId,
+ isSelected
+}) {
+ const {
+ url = '',
+ embedPost = false
+ } = attributes;
+ const [helpText, setHelpText] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(HELP_TEXT.default);
+ const [isValidEmbed, setIsValidEmbed] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(false);
+ const [isCheckingEmbed, setIsCheckingEmbed] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(false);
+ const urlInputRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)();
+ const {
+ insertAfterBlock,
+ removeBlock,
+ replaceInnerBlocks
+ } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_5__.useDispatch)('core/block-editor');
+
+ // Show embed in both selected and non-selected states when embedPost is true.
+ const showEmbed = embedPost && !isCheckingEmbed && isValidEmbed;
+
+ // Setup inner blocks.
+ const innerBlocksProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useInnerBlocksProps)({
+ className: 'activitypub-embed-container'
+ }, {
+ allowedBlocks: ['core/embed'],
+ template: url && showEmbed ? [['core/embed', {
+ url
+ }]] : [],
+ templateLock: 'all'
+ });
+
+ // Update inner blocks when URL, embedPost, or isValidEmbed changes.
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
+ if (url && showEmbed) {
+ replaceInnerBlocks(clientId, [(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_8__.createBlock)('core/embed', {
+ url
+ })]);
+ } else {
+ // Remove all inner blocks if embedding is disabled or URL is not embeddable.
+ replaceInnerBlocks(clientId, []);
+ }
+ }, [url, showEmbed, clientId, replaceInnerBlocks]);
+
+ // Update help text based on state changes.
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
+ if (!url) {
+ setHelpText(HELP_TEXT.default);
+ } else if (isCheckingEmbed) {
+ setHelpText(HELP_TEXT.checking());
+ } else if (isValidEmbed) {
+ setHelpText(HELP_TEXT.valid);
+ } else {
+ setHelpText(HELP_TEXT.error);
+ }
+ }, [url, isCheckingEmbed, isValidEmbed]);
+ const focusInput = () => {
+ setTimeout(() => urlInputRef.current?.focus(), 50);
+ };
+
+ // Check URL when it changes.
+ const checkUrl = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(async urlToCheck => {
+ if (!urlToCheck) {
+ setIsValidEmbed(false);
+ return;
+ }
+ try {
+ setIsCheckingEmbed(true);
+
+ // Simple URL validation.
+ new URL(urlToCheck); // Will throw if invalid.
+
+ try {
+ /**
+ * Fetch the embed information using the WordPress oEmbed API.
+ *
+ * @typedef {Object} OEmbedResponse
+ * @property {string} [provider_name] The name of the oEmbed provider.
+ * @property {string} [html] The HTML content to embed.
+ * @property {string} [title] The title of the embedded content.
+ * @property {string} [author_name] The author of the embedded content.
+ * @property {string} [author_url] The URL of the author.
+ * @property {number} [width] The width of the embedded content.
+ * @property {number} [height] The height of the embedded content.
+ * @property {string} [type] The type of the embedded content (rich, video, photo).
+ */
+ const response = await _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_6___default()({
+ path: (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_7__.addQueryArgs)('/oembed/1.0/proxy', {
+ url: urlToCheck,
+ activitypub: true
+ })
+ });
+ if (response && response.provider_name) {
+ setAttributes({
+ embedPost: true,
+ isValidActivityPub: true
+ }); // Auto-enable embedding when we get valid embed info.
+ setIsValidEmbed(true);
+ } else {
+ setAttributes({
+ isValidActivityPub: false
+ });
+ setIsValidEmbed(false);
+ }
+ } catch (error) {
+ console.log('Could not fetch embed:', error);
+ setAttributes({
+ isValidActivityPub: false
+ });
+ setIsValidEmbed(false);
+ }
+ } catch (error) {
+ setAttributes({
+ isValidActivityPub: false
+ });
+ setIsValidEmbed(false);
+ } finally {
+ setIsCheckingEmbed(false);
+ }
+ }, [embedPost, setAttributes]);
+
+ // Debounce the URL check to avoid too many requests.
+ const debouncedCheckUrl = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__.useDebounce)(checkUrl, 250);
+
+ // Check URL when it changes.
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
+ if (url) {
+ debouncedCheckUrl(url);
+ }
+ }, [url]);
+ const onKeyDown = event => {
+ if (event.key === 'Enter') {
+ insertAfterBlock(clientId);
+ }
+ if (!url && ['Backspace', 'Delete'].includes(event.key)) {
+ removeBlock(clientId);
+ }
+ };
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.Fragment, {
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.InspectorControls, {
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelBody, {
+ title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Settings', 'activitypub'),
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.ToggleControl, {
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Embed Post', 'activitypub'),
+ checked: !!embedPost,
+ onChange: value => setAttributes({
+ embedPost: value
+ }),
+ disabled: !isValidEmbed,
+ help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Show embedded content from the URL.', 'activitypub'),
+ __nextHasNoMarginBottom: true
+ })
+ })
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
+ onClick: focusInput,
+ ...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps)(),
+ children: [isSelected && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.TextControl, {
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Your post is a reply to the following URL', 'activitypub'),
+ value: url,
+ onChange: value => setAttributes({
+ url: value
+ }),
+ help: helpText,
+ onKeyDown: onKeyDown,
+ ref: urlInputRef,
+ __next40pxDefaultSize: true,
+ __nextHasNoMarginBottom: true
+ }), showEmbed && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
+ ...innerBlocksProps
+ }), url && !showEmbed && !isSelected && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
+ className: "activitypub-reply-block-editor__preview",
+ contentEditable: false,
+ onClick: focusInput,
+ style: {
+ cursor: 'pointer'
+ },
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("a", {
+ href: url,
+ className: "u-in-reply-to",
+ target: "_blank",
+ rel: "noreferrer",
+ children: '↬' + url.replace(/^https?:\/\//, '')
+ })
+ })]
+ })]
+ });
+}
+
+/***/ }),
+
+/***/ "./src/reply/editor.scss":
+/*!*******************************!*\
+ !*** ./src/reply/editor.scss ***!
+ \*******************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+// extracted by mini-css-extract-plugin
+
+
+/***/ }),
+
+/***/ "@wordpress/api-fetch":
+/*!**********************************!*\
+ !*** external ["wp","apiFetch"] ***!
+ \**********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["apiFetch"];
+
+/***/ }),
+
+/***/ "@wordpress/block-editor":
+/*!*************************************!*\
+ !*** external ["wp","blockEditor"] ***!
+ \*************************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["blockEditor"];
+
+/***/ }),
+
+/***/ "@wordpress/blocks":
+/*!********************************!*\
+ !*** external ["wp","blocks"] ***!
+ \********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["blocks"];
+
+/***/ }),
+
+/***/ "@wordpress/components":
+/*!************************************!*\
+ !*** external ["wp","components"] ***!
+ \************************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["components"];
+
+/***/ }),
+
+/***/ "@wordpress/compose":
+/*!*********************************!*\
+ !*** external ["wp","compose"] ***!
+ \*********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["compose"];
+
+/***/ }),
+
+/***/ "@wordpress/data":
+/*!******************************!*\
+ !*** external ["wp","data"] ***!
+ \******************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["data"];
+
+/***/ }),
+
+/***/ "@wordpress/element":
+/*!*********************************!*\
+ !*** external ["wp","element"] ***!
+ \*********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["element"];
+
+/***/ }),
+
+/***/ "@wordpress/i18n":
+/*!******************************!*\
+ !*** external ["wp","i18n"] ***!
+ \******************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["i18n"];
+
+/***/ }),
+
+/***/ "@wordpress/primitives":
+/*!************************************!*\
+ !*** external ["wp","primitives"] ***!
+ \************************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["primitives"];
+
+/***/ }),
+
+/***/ "@wordpress/url":
+/*!*****************************!*\
+ !*** external ["wp","url"] ***!
+ \*****************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["url"];
+
+/***/ }),
+
+/***/ "react/jsx-runtime":
+/*!**********************************!*\
+ !*** external "ReactJSXRuntime" ***!
+ \**********************************/
+/***/ ((module) => {
+
+module.exports = window["ReactJSXRuntime"];
+
+/***/ })
+
+/******/ });
+/************************************************************************/
+/******/ // The module cache
+/******/ var __webpack_module_cache__ = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/ // Check if module is in cache
+/******/ var cachedModule = __webpack_module_cache__[moduleId];
+/******/ if (cachedModule !== undefined) {
+/******/ return cachedModule.exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = __webpack_module_cache__[moduleId] = {
+/******/ // no module.id needed
+/******/ // no module.loaded needed
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/************************************************************************/
+/******/ /* webpack/runtime/compat get default export */
+/******/ (() => {
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = (module) => {
+/******/ var getter = module && module.__esModule ?
+/******/ () => (module['default']) :
+/******/ () => (module);
+/******/ __webpack_require__.d(getter, { a: getter });
+/******/ return getter;
+/******/ };
+/******/ })();
+/******/
+/******/ /* webpack/runtime/define property getters */
+/******/ (() => {
+/******/ // define getter functions for harmony exports
+/******/ __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 */
+/******/ (() => {
+/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
+/******/ })();
+/******/
+/******/ /* webpack/runtime/make namespace object */
+/******/ (() => {
+/******/ // define __esModule on exports
+/******/ __webpack_require__.r = (exports) => {
+/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
+/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
+/******/ }
+/******/ Object.defineProperty(exports, '__esModule', { value: true });
+/******/ };
+/******/ })();
+/******/
+/************************************************************************/
+var __webpack_exports__ = {};
+// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
+(() => {
+/*!****************************!*\
+ !*** ./src/reply/index.js ***!
+ \****************************/
+__webpack_require__.r(__webpack_exports__);
+/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
+/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/comment-reply-link.js");
+/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/reply/edit.js");
+/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editor.scss */ "./src/reply/editor.scss");
+
+
+
+
+const save = () => null;
+(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)('activitypub/reply', {
+ edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"],
+ save,
+ icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__["default"],
+ transforms: {
+ from: [{
+ type: 'block',
+ blocks: ['core/embed'],
+ transform: attributes => {
+ return (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.createBlock)('activitypub/reply', {
+ url: attributes.url || '',
+ embedPost: true
+ });
+ }
+ }],
+ to: [{
+ type: 'block',
+ blocks: ['core/embed'],
+ transform: attributes => {
+ return (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.createBlock)('core/embed', {
+ url: attributes.url || ''
+ });
+ }
+ }]
+ }
+});
+})();
+
+/******/ })()
+;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/build/social-web/feed-inspector.js b/build/social-web/feed-inspector.js
index 74476eb3db..02f8edb699 100644
--- a/build/social-web/feed-inspector.js
+++ b/build/social-web/feed-inspector.js
@@ -1,4 +1,233 @@
-"use strict";(globalThis.webpackChunkwordpress_activitypub=globalThis.webpackChunkwordpress_activitypub||[]).push([[322],{42:(e,t,r)=>{r.r(t),r.d(t,{default:()=>h});var i=r(427),s=r(582),n=r(723),a=r(537),c=r(707),o=r(375),d=r(230),l=r(790);const p=({html:e})=>{const t=e.replace(/\\(.)/g,"$1"),r=(0,a.decodeEntities)(t);return(0,l.jsx)("div",{dangerouslySetInnerHTML:{__html:r}})};function h({id:e,onClose:t}){const{defaultAvatar:r}=(0,o.t)(),{record:h,isResolving:m}=(0,s.useEntityRecord)("postType","ap_post",e),{records:u,isResolving:v}=(0,s.useEntityRecords)("root","comment",{post:e,per_page:100,order:"asc",orderby:"date"});if(m)return(0,l.jsx)("div",{className:"activitypub-inspector-loading",children:(0,l.jsx)(i.Spinner,{})});if(!h)return(0,l.jsx)("div",{className:"activitypub-inspector-loading",children:(0,n.__)("Post not found","activitypub")});const b=h.actor_info,x=(0,a.decodeEntities)(b?.name||(0,n.__)("Unknown author","activitypub")),y=b?.webfinger||"",j=b?.url||"",g=b?.icon||"",f=h.link||"",_=h.date?(0,d.g)(h.date):"";return(0,l.jsxs)("div",{className:"activitypub-inspector",children:[(0,l.jsxs)(i.Card,{className:"activitypub-inspector-card",children:[(0,l.jsx)(i.CardHeader,{children:(0,l.jsxs)("div",{className:"activitypub-inspector-header",children:[(0,l.jsx)("img",{src:g,alt:x,className:"activitypub-inspector-avatar",onError:e=>{e.target.src=r}}),(0,l.jsxs)("div",{className:"activitypub-inspector-author",children:[(0,l.jsx)("a",{href:j,target:"_blank",rel:"noopener noreferrer",className:"activitypub-inspector-author-name",children:x}),(0,l.jsxs)("div",{className:"activitypub-inspector-meta",children:[y&&(0,l.jsx)("span",{className:"activitypub-inspector-webfinger",children:y}),_&&f&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"activitypub-inspector-separator",children:"·"}),(0,l.jsx)("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"activitypub-inspector-timestamp",children:_})]})]})]}),(0,l.jsx)(i.Button,{icon:c.A,label:(0,n.__)("Close","activitypub"),onClick:t,className:"activitypub-inspector-close"})]})}),(0,l.jsxs)(i.CardBody,{children:[h.title?.rendered&&(0,l.jsx)("h2",{children:(0,l.jsx)(p,{html:h.title.rendered})}),(h.content?.rendered||h.excerpt?.rendered)&&(0,l.jsx)(p,{html:h.content?.rendered||h.excerpt?.rendered||""})]})]}),(v||u&&u.length>0)&&(0,l.jsxs)(i.Card,{className:"activitypub-inspector-card activitypub-inspector-comments-card",children:[(0,l.jsxs)(i.CardHeader,{children:[(0,n.__)("Comments","activitypub"),u&&u.length>0&&` (${u.length})`]}),(0,l.jsxs)(i.CardBody,{children:[v&&(0,l.jsx)(i.Spinner,{}),!v&&u&&u.length>0&&(0,l.jsx)("div",{children:u.map(e=>(0,l.jsxs)("div",{className:"activitypub-inspector-comment",children:[(0,l.jsxs)("div",{className:"activitypub-inspector-comment-meta",children:[(0,l.jsx)("strong",{children:(0,a.decodeEntities)(e.author_name)}),(0,l.jsx)("span",{className:"activitypub-inspector-comment-date",children:new Date(e.date).toLocaleString()})]}),(0,l.jsx)(p,{html:e.content.rendered})]},e.id))}),!v&&(!u||0===u.length)&&(0,l.jsx)("p",{children:(0,n.__)("No comments yet.","activitypub")})]})]})]})}},230:(e,t,r)=>{r.d(t,{g:()=>n});var i=r(723),s=r(443);function n(e){const t=new Date(e.endsWith("Z")?e:e+"Z"),r=Date.now()-t.getTime(),n=Math.floor(r/6e4),a=Math.floor(r/36e5),c=Math.floor(r/864e5);return n<60?(0,i.sprintf)(/* translators: %d: number of minutes */ /* translators: %d: number of minutes */
-(0,i._x)("%dm","short time format: minutes","activitypub"),n):a<24?(0,i.sprintf)(/* translators: %d: number of hours */ /* translators: %d: number of hours */
-(0,i._x)("%dh","short time format: hours","activitypub"),a):c<7?(0,i.sprintf)(/* translators: %d: number of days */ /* translators: %d: number of days */
-(0,i._x)("%dd","short time format: days","activitypub"),c):(0,s.dateI18n)((0,s.getSettings)().formats.date,e)}}}]);
\ No newline at end of file
+"use strict";
+(globalThis["webpackChunkwordpress_activitypub"] = globalThis["webpackChunkwordpress_activitypub"] || []).push([["social-web/feed-inspector"],{
+
+/***/ "./src/social-web/routes/feed/inspector.tsx":
+/*!**************************************************!*\
+ !*** ./src/social-web/routes/feed/inspector.tsx ***!
+ \**************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ FeedInspector)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data");
+/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities");
+/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/close.js");
+/* harmony import */ var _contexts_settings_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../contexts/settings-context */ "./src/social-web/contexts/settings-context.tsx");
+/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils */ "./src/social-web/utils.ts");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__);
+/**
+ * Feed Post Inspector
+ *
+ * Detail view for a single feed post in the side panel
+ */
+
+
+
+
+
+
+
+
+
+// Helper to render HTML content with proper entity decoding and unescape
+const RenderHTML = ({
+ html
+}) => {
+ // Remove backslash escapes (e.g., \! becomes !)
+ const unescaped = html.replace(/\\(.)/g, '$1');
+ const decoded = (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_3__.decodeEntities)(unescaped);
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
+ dangerouslySetInnerHTML: {
+ __html: decoded
+ }
+ });
+};
+function FeedInspector({
+ id,
+ onClose
+}) {
+ const {
+ defaultAvatar
+ } = (0,_contexts_settings_context__WEBPACK_IMPORTED_MODULE_5__.useSettings)();
+ const {
+ record: post,
+ isResolving: isLoading
+ } = (0,_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__.useEntityRecord)('postType', 'ap_post', id);
+ const {
+ records: comments,
+ isResolving: isLoadingComments
+ } = (0,_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__.useEntityRecords)('root', 'comment', {
+ post: id,
+ per_page: 100,
+ order: 'asc',
+ orderby: 'date'
+ });
+ if (isLoading) {
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
+ className: "activitypub-inspector-loading",
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Spinner, {})
+ });
+ }
+ if (!post) {
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
+ className: "activitypub-inspector-loading",
+ children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Post not found', 'activitypub')
+ });
+ }
+ const actor = post.actor_info;
+ const author = (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_3__.decodeEntities)(actor?.name || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Unknown author', 'activitypub'));
+ const webfinger = actor?.webfinger || '';
+ const profileUrl = actor?.url || '';
+ const avatarUrl = actor?.icon || '';
+ const postLink = post.link || '';
+ const relativeTime = post.date ? (0,_utils__WEBPACK_IMPORTED_MODULE_6__.getRelativeTime)(post.date) : '';
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
+ className: "activitypub-inspector",
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Card, {
+ className: "activitypub-inspector-card",
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.CardHeader, {
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
+ className: "activitypub-inspector-header",
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("img", {
+ src: avatarUrl,
+ alt: author,
+ className: "activitypub-inspector-avatar",
+ onError: e => {
+ e.target.src = defaultAvatar;
+ }
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
+ className: "activitypub-inspector-author",
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("a", {
+ href: profileUrl,
+ target: "_blank",
+ rel: "noopener noreferrer",
+ className: "activitypub-inspector-author-name",
+ children: author
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
+ className: "activitypub-inspector-meta",
+ children: [webfinger && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("span", {
+ className: "activitypub-inspector-webfinger",
+ children: webfinger
+ }), relativeTime && postLink && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment, {
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("span", {
+ className: "activitypub-inspector-separator",
+ children: "\xB7"
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("a", {
+ href: postLink,
+ target: "_blank",
+ rel: "noopener noreferrer",
+ className: "activitypub-inspector-timestamp",
+ children: relativeTime
+ })]
+ })]
+ })]
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button, {
+ icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__["default"],
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Close', 'activitypub'),
+ onClick: onClose,
+ className: "activitypub-inspector-close"
+ })]
+ })
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.CardBody, {
+ children: [post.title?.rendered && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("h2", {
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(RenderHTML, {
+ html: post.title.rendered
+ })
+ }), (post.content?.rendered || post.excerpt?.rendered) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(RenderHTML, {
+ html: post.content?.rendered || post.excerpt?.rendered || ''
+ })]
+ })]
+ }), (isLoadingComments || comments && comments.length > 0) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Card, {
+ className: "activitypub-inspector-card activitypub-inspector-comments-card",
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.CardHeader, {
+ children: [(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Comments', 'activitypub'), comments && comments.length > 0 && ` (${comments.length})`]
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.CardBody, {
+ children: [isLoadingComments && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Spinner, {}), !isLoadingComments && comments && comments.length > 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
+ children: comments.map(comment => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
+ className: "activitypub-inspector-comment",
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
+ className: "activitypub-inspector-comment-meta",
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("strong", {
+ children: (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_3__.decodeEntities)(comment.author_name)
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("span", {
+ className: "activitypub-inspector-comment-date",
+ children: new Date(comment.date).toLocaleString()
+ })]
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(RenderHTML, {
+ html: comment.content.rendered
+ })]
+ }, comment.id))
+ }), !isLoadingComments && (!comments || comments.length === 0) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("p", {
+ children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('No comments yet.', 'activitypub')
+ })]
+ })]
+ })]
+ });
+}
+
+/***/ }),
+
+/***/ "./src/social-web/utils.ts":
+/*!*********************************!*\
+ !*** ./src/social-web/utils.ts ***!
+ \*********************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ getRelativeTime: () => (/* binding */ getRelativeTime)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/date */ "@wordpress/date");
+/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_1__);
+/**
+ * Utility functions for Social Web
+ */
+
+
+
+
+/**
+ * Format relative time in short format (5m, 2h, 6d)
+ * For dates older than a week, returns the site's date format
+ *
+ * @param dateString - The date string to format
+ * @return The formatted relative time string
+ */
+function getRelativeTime(dateString) {
+ // Ensure the date string is parsed as UTC by adding 'Z' if not present
+ const date = new Date(dateString.endsWith('Z') ? dateString : dateString + 'Z');
+ const now = Date.now();
+ const diffMs = now - date.getTime();
+ const diffMinutes = Math.floor(diffMs / (1000 * 60));
+ const diffHours = Math.floor(diffMs / (1000 * 60 * 60));
+ const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
+ if (diffMinutes < 60) {
+ return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %d: number of minutes */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('%dm', 'short time format: minutes', 'activitypub'), diffMinutes);
+ } else if (diffHours < 24) {
+ return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %d: number of hours */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('%dh', 'short time format: hours', 'activitypub'), diffHours);
+ } else if (diffDays < 7) {
+ return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %d: number of days */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('%dd', 'short time format: days', 'activitypub'), diffDays);
+ }
+
+ // Use site's date format for dates older than a week
+ return (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_1__.dateI18n)((0,_wordpress_date__WEBPACK_IMPORTED_MODULE_1__.getSettings)().formats.date, dateString);
+}
+
+/***/ })
+
+}]);
+//# sourceMappingURL=feed-inspector.js.map
\ No newline at end of file
diff --git a/build/social-web/feed-stage.js b/build/social-web/feed-stage.js
index b4080e6e2e..6363797698 100644
--- a/build/social-web/feed-stage.js
+++ b/build/social-web/feed-stage.js
@@ -1,4 +1,1189 @@
-"use strict";(globalThis.webpackChunkwordpress_activitypub=globalThis.webpackChunkwordpress_activitypub||[]).push([[303],{230:(e,t,i)=>{i.d(t,{g:()=>n});var a=i(723),r=i(443);function n(e){const t=new Date(e.endsWith("Z")?e:e+"Z"),i=Date.now()-t.getTime(),n=Math.floor(i/6e4),s=Math.floor(i/36e5),d=Math.floor(i/864e5);return n<60?(0,a.sprintf)(/* translators: %d: number of minutes */ /* translators: %d: number of minutes */
-(0,a._x)("%dm","short time format: minutes","activitypub"),n):s<24?(0,a.sprintf)(/* translators: %d: number of hours */ /* translators: %d: number of hours */
-(0,a._x)("%dh","short time format: hours","activitypub"),s):d<7?(0,a.sprintf)(/* translators: %d: number of days */ /* translators: %d: number of days */
-(0,a._x)("%dd","short time format: days","activitypub"),d):(0,r.dateI18n)((0,r.getSettings)().formats.date,e)}},658:(e,t,i)=>{i.r(t),i.d(t,{default:()=>E});var a=i(87),r=i(371),n=i(510),s=i(723),d=i(832),o=i(143),c=i(164),l=i(790);function u({title:e,subTitle:t,badges:i,actions:a,breadcrumbs:r,hasPadding:n=!0,hasBorder:s=!1,contentWidth:d="default",children:o}){return(0,l.jsxs)("div",{className:"page",children:[(0,l.jsxs)("header",{className:(0,c.A)("header",{"has-border":s}),children:[r&&(0,l.jsx)("div",{className:"breadcrumbs",children:r}),(0,l.jsxs)("div",{className:"title-row",children:[(0,l.jsxs)("div",{className:"title-group",children:[(0,l.jsx)("h1",{className:"title",children:e}),i&&(0,l.jsx)("div",{className:"badges",children:i})]}),a&&(0,l.jsx)("div",{className:"actions",children:a})]}),t&&(0,l.jsx)("p",{className:"sub-title",children:t})]}),(0,l.jsx)("div",{className:(0,c.A)("content",{padded:n,constrained:"constrained"===d,full:"full"===d}),children:o})]})}var p=i(582),g=i(375);(0,s.__)("Avatar","activitypub");var h=i(537),m=i(107);const f={id:"content",label:(0,s.__)("Content","activitypub"),enableHiding:!0,enableSorting:!1,getValue:({item:e})=>{const t=e.excerpt?.rendered||e.content?.rendered||"";return(0,h.decodeEntities)((0,m.__unstableStripHTML)(t))},render:({item:e})=>{const t=(0,m.safeHTML)((0,h.decodeEntities)(e.content?.rendered||""));return t.trim().replace(/<\/?p>/g,"").replace(/ /g,"").trim().length>0?(0,l.jsx)("div",{className:"activitypub-feed-post",children:(0,l.jsx)("div",{className:"activitypub-feed-content",dangerouslySetInnerHTML:{__html:t}})}):null}},v={id:"date",label:(0,s.__)("Date","activitypub"),enableHiding:!1,enableSorting:!0,getValue:({item:e})=>e.date||"",render:({item:e})=>e.date?new Date(e.date).toLocaleDateString():""},b=e=>{const t=e.excerpt?.rendered||e.content?.rendered||"";return(0,h.decodeEntities)((0,m.__unstableStripHTML)(t))},_={id:"excerpt.rendered",label:(0,s.__)("Excerpt","activitypub"),enableHiding:!0,enableSorting:!1,getValue:({item:e})=>b(e),render:({item:e})=>{const t=b(e).trim();return t?(0,l.jsx)("div",{className:"activitypub-feed-excerpt",children:t}):null}};(0,s.__)("Following","activitypub");var y=i(230);const x={id:"metadata",label:(0,s.__)("Metadata","activitypub"),enableHiding:!0,enableSorting:!1,getValue:({item:e})=>`${e.actor_info?.name||""} · ${e.date?(0,y.g)(e.date):""}`,render:({item:e})=>{const{defaultAvatar:t}=(0,g.t)(),i=(0,h.decodeEntities)(e.actor_info?.name||(0,s.__)("Unknown author","activitypub")),a=e.actor_info?.icon||"",r=e.date?(0,y.g)(e.date):"";return(0,l.jsxs)("div",{className:"activitypub-feed-post-meta",children:[(0,l.jsx)("img",{src:a,alt:i,className:"activitypub-feed-avatar",onError:e=>{e.target.src=t}}),(0,l.jsx)("span",{className:"author",children:i}),r&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"separator",children:"·"}),(0,l.jsx)("span",{className:"date",children:r})]})]})}};i(443),(0,s.__)("Last Updated","activitypub"),(0,s.__)("Name","activitypub"),(0,s.__)("Status","activitypub");const w={id:"title.rendered",label:(0,s.__)("Title","activitypub"),enableHiding:!0,enableSorting:!1,enableGlobalSearch:!0,getValue:({item:e})=>(0,h.decodeEntities)(e.title?.rendered||""),render:({item:e})=>{if(!e.title?.rendered)return null;const t=e.title.rendered.replace(/\\(.)/g,"$1");return(0,l.jsx)("div",{className:"activitypub-feed-post-title",children:(0,h.decodeEntities)(t)})}};(0,s.__)("Profile","activitypub");var N=i(17);const j={type:"list",perPage:20,page:1,sort:{field:"date",direction:"desc"},search:"",filters:[],fields:["metadata","title.rendered","excerpt.rendered"]},S={list:{primaryField:"metadata",fields:["metadata","title.rendered","excerpt.rendered"],mediaField:void 0}};function E({onSelectItem:e}){const t=(0,o.useSelect)(e=>e(N.E).getActiveActorId(),[]),[i,c]=(0,a.useState)(()=>{const e=(0,d.getQueryArgs)(window.location.href);return{page:e.paged?Number(e.paged):void 0,search:e.search||void 0}});(0,a.useEffect)(()=>{const e=()=>{const e=(0,d.getQueryArgs)(window.location.href);c({page:e.paged?Number(e.paged):void 0,search:e.search||void 0})};return window.addEventListener("popstate",e),window.addEventListener("hashchange",e),()=>{window.removeEventListener("popstate",e),window.removeEventListener("hashchange",e)}},[]);const{view:g,updateView:h}=(0,n.l)({kind:"postType",name:"ap_post",slug:"feed",defaultView:j,queryParams:i,onChangeQueryParams:e=>{const t=window.location.href,i=(0,d.getQueryArgs)(t),a=(0,d.addQueryArgs)(t,{...i,paged:e.page||void 0,search:e.search||void 0});window.history.pushState(null,"",a),c({page:e.page,search:e.search})}}),m=(0,a.useCallback)(e=>{const t=function(e,t){const i=t.includes("content")&&!e.includes("content"),a=t.includes("excerpt.rendered")&&!e.includes("excerpt.rendered"),r=!t.includes("content")&&e.includes("content"),n=!t.includes("excerpt.rendered")&&e.includes("excerpt.rendered");return i?t.filter(e=>"excerpt.rendered"!==e):a?t.filter(e=>"content"!==e):r&&!t.includes("excerpt.rendered")?[...t,"excerpt.rendered"]:n&&!t.includes("content")?[...t,"content"]:t}(g.fields||[],e.fields||[]);h({...e,fields:t})},[g.fields,h]),{feed:b,isResolving:y,totalItems:E,totalPages:P}=function({perPage:e=20,page:t=1,orderBy:i="date",order:r="desc",search:n="",userId:s,fields:d=["id","date","modified","title","excerpt","content","actor_info","status","link"]}={}){const o=null!=s,c=(0,a.useMemo)(()=>{const a={per_page:e,page:t,orderby:i,order:r,search:n,_fields:d};return o&&(a.user_id=s),a},[e,t,i,r,n,s,d,o]),{records:l,hasResolved:u,isResolving:g,totalItems:h,totalPages:m}=(0,p.useEntityRecords)("postType","ap_post",o?c:void 0);return{feed:o&&l||[],hasResolved:u,isResolving:g,totalItems:o?h:null,totalPages:o?m:null}}({perPage:g.perPage||20,page:g.page||1,orderBy:g.sort?.field||"date",order:g.sort?.direction||"desc",search:g.search||"",userId:t}),I=(0,a.useMemo)(()=>[x,w,_,f,v],[]),A=(0,a.useMemo)(()=>function(e,t){if(!e.fields)return e;const i=new Map(t.map((e,t)=>[e.id,t])),a=[...e.fields].sort((e,t)=>{var a,r;return(null!==(a=i.get(e))&&void 0!==a?a:1/0)-(null!==(r=i.get(t))&&void 0!==r?r:1/0)});return{...e,fields:a}}(g,I),[g,I]),[k,L]=(0,a.useState)([]);(0,a.useEffect)(()=>{if(0===k.length)return;const e=k[0];b.some(t=>t.id.toString()===e)||L([])},[b,k]);const M=(0,a.useCallback)(t=>{if(L(t),0===t.length)return;const i=t[0],a=b.find(e=>e.id.toString()===i);a&&e(a.id)},[b,e]);return(0,l.jsx)(u,{title:(0,s.__)("Feed","activitypub"),subTitle:(0,s.__)("ActivityPub posts from your network","activitypub"),hasPadding:!1,children:(0,l.jsx)(r.A,{data:b,fields:I,view:A,onChangeView:m,isLoading:y,onClickItem:t=>e(t.id),isItemClickable:()=>!0,getItemId:e=>e.id.toString(),selection:k,onChangeSelection:M,empty:(0,l.jsx)("p",{children:A.search?(0,s.__)("No posts found.","activitypub"):(0,s.__)("No posts found in your feed. Posts from ActivityPub actors you follow will appear here.","activitypub")}),paginationInfo:{totalItems:E,totalPages:P},defaultLayouts:S})})}}}]);
\ No newline at end of file
+"use strict";
+(globalThis["webpackChunkwordpress_activitypub"] = globalThis["webpackChunkwordpress_activitypub"] || []).push([["social-web/feed-stage"],{
+
+/***/ "./src/social-web/components/fields/avatar/avatar.tsx":
+/*!************************************************************!*\
+ !*** ./src/social-web/components/fields/avatar/avatar.tsx ***!
+ \************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ Avatar)
+/* harmony export */ });
+/* harmony import */ var _contexts_settings_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../contexts/settings-context */ "./src/social-web/contexts/settings-context.tsx");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+/**
+ * Avatar component that displays an actor's avatar with fallback support.
+ */
+
+
+
+function Avatar({
+ item
+}) {
+ const {
+ defaultAvatar
+ } = (0,_contexts_settings_context__WEBPACK_IMPORTED_MODULE_0__.useSettings)();
+ const avatarUrl = item.actor_info?.icon || defaultAvatar;
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("img", {
+ alt: item.actor_info?.username || '',
+ src: avatarUrl,
+ className: "activitypub-avatar-field__image",
+ onError: e => {
+ e.target.src = defaultAvatar;
+ }
+ });
+}
+
+/***/ }),
+
+/***/ "./src/social-web/components/fields/avatar/index.tsx":
+/*!***********************************************************!*\
+ !*** ./src/social-web/components/fields/avatar/index.tsx ***!
+ \***********************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ avatarField: () => (/* binding */ avatarField)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _avatar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./avatar */ "./src/social-web/components/fields/avatar/avatar.tsx");
+/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ "./src/social-web/components/fields/avatar/style.scss");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
+/**
+ * Avatar field for DataViews.
+ */
+
+
+
+
+
+const avatarField = {
+ id: 'avatar',
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Avatar', 'activitypub'),
+ type: 'media',
+ enableHiding: false,
+ enableSorting: false,
+ getValue: ({
+ item
+ }) => item.actor_info?.icon || '',
+ render: ({
+ item
+ }) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_avatar__WEBPACK_IMPORTED_MODULE_1__["default"], {
+ item: item
+ })
+};
+
+/***/ }),
+
+/***/ "./src/social-web/components/fields/avatar/style.scss":
+/*!************************************************************!*\
+ !*** ./src/social-web/components/fields/avatar/style.scss ***!
+ \************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+// extracted by mini-css-extract-plugin
+
+
+/***/ }),
+
+/***/ "./src/social-web/components/fields/content/index.tsx":
+/*!************************************************************!*\
+ !*** ./src/social-web/components/fields/content/index.tsx ***!
+ \************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ contentField: () => (/* binding */ contentField)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities");
+/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom");
+/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
+
+
+
+
+/**
+ * Content field for reader-style view
+ * Displays rich content with HTML formatting
+ */
+const contentField = {
+ id: 'content',
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Content', 'activitypub'),
+ enableHiding: true,
+ enableSorting: false,
+ getValue: ({
+ item
+ }) => {
+ // Strip HTML tags for plain text value (used for search/sort)
+ const text = item.excerpt?.rendered || item.content?.rendered || '';
+ return (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__.decodeEntities)((0,_wordpress_dom__WEBPACK_IMPORTED_MODULE_2__.__unstableStripHTML)(text));
+ },
+ render: ({
+ item
+ }) => {
+ const content = (0,_wordpress_dom__WEBPACK_IMPORTED_MODULE_2__.safeHTML)((0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__.decodeEntities)(item.content?.rendered || ''));
+
+ // Check if content is actually empty (not just whitespace)
+ const hasRealContent = content.trim().replace(/<\/?p>/g, '').replace(/ /g, '').trim().length > 0;
+ if (!hasRealContent) {
+ return null;
+ }
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
+ className: "activitypub-feed-post",
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
+ className: "activitypub-feed-content",
+ dangerouslySetInnerHTML: {
+ __html: content
+ }
+ })
+ });
+ }
+};
+
+/***/ }),
+
+/***/ "./src/social-web/components/fields/date/index.tsx":
+/*!*********************************************************!*\
+ !*** ./src/social-web/components/fields/date/index.tsx ***!
+ \*********************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ dateField: () => (/* binding */ dateField)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+
+const dateField = {
+ id: 'date',
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Date', 'activitypub'),
+ enableHiding: false,
+ enableSorting: true,
+ getValue: ({
+ item
+ }) => item.date || '',
+ render: ({
+ item
+ }) => {
+ if (!item.date) {
+ return '';
+ }
+ return new Date(item.date).toLocaleDateString();
+ }
+};
+
+/***/ }),
+
+/***/ "./src/social-web/components/fields/excerpt/index.tsx":
+/*!************************************************************!*\
+ !*** ./src/social-web/components/fields/excerpt/index.tsx ***!
+ \************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ excerptField: () => (/* binding */ excerptField)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities");
+/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom");
+/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
+
+
+
+
+/**
+ * Get plain text excerpt from post.
+ */
+const getPlainTextExcerpt = item => {
+ const text = item.excerpt?.rendered || item.content?.rendered || '';
+ return (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__.decodeEntities)((0,_wordpress_dom__WEBPACK_IMPORTED_MODULE_2__.__unstableStripHTML)(text));
+};
+const excerptField = {
+ id: 'excerpt.rendered',
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Excerpt', 'activitypub'),
+ enableHiding: true,
+ enableSorting: false,
+ getValue: ({
+ item
+ }) => getPlainTextExcerpt(item),
+ render: ({
+ item
+ }) => {
+ const plainText = getPlainTextExcerpt(item).trim();
+ if (!plainText) {
+ return null;
+ }
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
+ className: "activitypub-feed-excerpt",
+ children: plainText
+ });
+ }
+};
+
+/***/ }),
+
+/***/ "./src/social-web/components/fields/follow-status/index.tsx":
+/*!******************************************************************!*\
+ !*** ./src/social-web/components/fields/follow-status/index.tsx ***!
+ \******************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ followStatusField: () => (/* binding */ followStatusField)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/social-web/components/fields/follow-status/style.scss");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
+/**
+ * Follow Status field for DataViews.
+ */
+
+
+
+
+const followStatusField = {
+ id: 'follow_status',
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Following', 'activitypub'),
+ enableHiding: true,
+ getValue: ({
+ item
+ }) => item.follow_status?.follows_back,
+ render: ({
+ item
+ }) => {
+ if (item.follow_status?.follows_back) {
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {
+ className: "activitypub-mutual",
+ children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('Mutual', 'Follow status', 'activitypub')
+ });
+ }
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {
+ children: "\u2014"
+ });
+ }
+};
+
+/***/ }),
+
+/***/ "./src/social-web/components/fields/follow-status/style.scss":
+/*!*******************************************************************!*\
+ !*** ./src/social-web/components/fields/follow-status/style.scss ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+// extracted by mini-css-extract-plugin
+
+
+/***/ }),
+
+/***/ "./src/social-web/components/fields/index.ts":
+/*!***************************************************!*\
+ !*** ./src/social-web/components/fields/index.ts ***!
+ \***************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ avatarField: () => (/* reexport safe */ _avatar__WEBPACK_IMPORTED_MODULE_0__.avatarField),
+/* harmony export */ contentField: () => (/* reexport safe */ _content__WEBPACK_IMPORTED_MODULE_1__.contentField),
+/* harmony export */ dateField: () => (/* reexport safe */ _date__WEBPACK_IMPORTED_MODULE_2__.dateField),
+/* harmony export */ excerptField: () => (/* reexport safe */ _excerpt__WEBPACK_IMPORTED_MODULE_3__.excerptField),
+/* harmony export */ followStatusField: () => (/* reexport safe */ _follow_status__WEBPACK_IMPORTED_MODULE_4__.followStatusField),
+/* harmony export */ metadataField: () => (/* reexport safe */ _metadata__WEBPACK_IMPORTED_MODULE_5__.metadataField),
+/* harmony export */ modifiedField: () => (/* reexport safe */ _modified__WEBPACK_IMPORTED_MODULE_6__.modifiedField),
+/* harmony export */ nameField: () => (/* reexport safe */ _name__WEBPACK_IMPORTED_MODULE_7__.nameField),
+/* harmony export */ statusField: () => (/* reexport safe */ _status__WEBPACK_IMPORTED_MODULE_8__.statusField),
+/* harmony export */ titleField: () => (/* reexport safe */ _title__WEBPACK_IMPORTED_MODULE_9__.titleField),
+/* harmony export */ webfingerField: () => (/* reexport safe */ _webfinger__WEBPACK_IMPORTED_MODULE_10__.webfingerField)
+/* harmony export */ });
+/* harmony import */ var _avatar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./avatar */ "./src/social-web/components/fields/avatar/index.tsx");
+/* harmony import */ var _content__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./content */ "./src/social-web/components/fields/content/index.tsx");
+/* harmony import */ var _date__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./date */ "./src/social-web/components/fields/date/index.tsx");
+/* harmony import */ var _excerpt__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./excerpt */ "./src/social-web/components/fields/excerpt/index.tsx");
+/* harmony import */ var _follow_status__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./follow-status */ "./src/social-web/components/fields/follow-status/index.tsx");
+/* harmony import */ var _metadata__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./metadata */ "./src/social-web/components/fields/metadata/index.tsx");
+/* harmony import */ var _modified__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./modified */ "./src/social-web/components/fields/modified/index.tsx");
+/* harmony import */ var _name__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./name */ "./src/social-web/components/fields/name/index.tsx");
+/* harmony import */ var _status__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./status */ "./src/social-web/components/fields/status/index.tsx");
+/* harmony import */ var _title__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./title */ "./src/social-web/components/fields/title/index.tsx");
+/* harmony import */ var _webfinger__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./webfinger */ "./src/social-web/components/fields/webfinger/index.tsx");
+
+
+
+
+
+
+
+
+
+
+
+
+/***/ }),
+
+/***/ "./src/social-web/components/fields/metadata/index.tsx":
+/*!*************************************************************!*\
+ !*** ./src/social-web/components/fields/metadata/index.tsx ***!
+ \*************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ metadataField: () => (/* binding */ metadataField)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities");
+/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _contexts_settings_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../contexts/settings-context */ "./src/social-web/contexts/settings-context.tsx");
+/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../utils */ "./src/social-web/utils.ts");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
+
+
+
+
+
+const metadataField = {
+ id: 'metadata',
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Metadata', 'activitypub'),
+ enableHiding: true,
+ enableSorting: false,
+ getValue: ({
+ item
+ }) => {
+ const author = item.actor_info?.name || '';
+ const relativeTime = item.date ? (0,_utils__WEBPACK_IMPORTED_MODULE_3__.getRelativeTime)(item.date) : '';
+ return `${author} · ${relativeTime}`;
+ },
+ render: ({
+ item
+ }) => {
+ const {
+ defaultAvatar
+ } = (0,_contexts_settings_context__WEBPACK_IMPORTED_MODULE_2__.useSettings)();
+ const name = (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__.decodeEntities)(item.actor_info?.name || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Unknown author', 'activitypub'));
+ const avatarUrl = item.actor_info?.icon || '';
+ const relativeTime = item.date ? (0,_utils__WEBPACK_IMPORTED_MODULE_3__.getRelativeTime)(item.date) : '';
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
+ className: "activitypub-feed-post-meta",
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("img", {
+ src: avatarUrl,
+ alt: name,
+ className: "activitypub-feed-avatar",
+ onError: e => {
+ e.target.src = defaultAvatar;
+ }
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
+ className: "author",
+ children: name
+ }), relativeTime && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, {
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
+ className: "separator",
+ children: "\xB7"
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
+ className: "date",
+ children: relativeTime
+ })]
+ })]
+ });
+ }
+};
+
+/***/ }),
+
+/***/ "./src/social-web/components/fields/modified/index.tsx":
+/*!*************************************************************!*\
+ !*** ./src/social-web/components/fields/modified/index.tsx ***!
+ \*************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ modifiedField: () => (/* binding */ modifiedField)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/date */ "@wordpress/date");
+/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
+/**
+ * Modified/Last Updated field for DataViews.
+ */
+
+
+
+
+const modifiedField = {
+ id: 'modified',
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Last Updated', 'activitypub'),
+ enableHiding: true,
+ enableSorting: true,
+ getValue: ({
+ item
+ }) => item.modified_gmt || item.modified,
+ render: ({
+ item
+ }) => {
+ const date = item.modified_gmt || item.modified;
+ if (!date) {
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {
+ children: "\u2014"
+ });
+ }
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("time", {
+ dateTime: date,
+ children: (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_1__.dateI18n)('M j, Y', date)
+ });
+ },
+ filterBy: {
+ operators: ['after', 'before']
+ }
+};
+
+/***/ }),
+
+/***/ "./src/social-web/components/fields/name/index.tsx":
+/*!*********************************************************!*\
+ !*** ./src/social-web/components/fields/name/index.tsx ***!
+ \*********************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ nameField: () => (/* binding */ nameField)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+/**
+ * Name field for DataViews.
+ */
+
+
+
+const nameField = {
+ id: 'name',
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Name', 'activitypub'),
+ enableHiding: false,
+ enableSorting: true,
+ getValue: ({
+ item
+ }) => item.actor_info?.name || '',
+ render: ({
+ item
+ }) => {
+ const name = item.actor_info?.name || '';
+ const url = item.actor_info?.url || '#';
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("a", {
+ href: url,
+ target: "_blank",
+ rel: "noopener noreferrer",
+ className: "activitypub-name-field__link",
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong", {
+ children: name
+ })
+ });
+ }
+};
+
+/***/ }),
+
+/***/ "./src/social-web/components/fields/status/index.tsx":
+/*!***********************************************************!*\
+ !*** ./src/social-web/components/fields/status/index.tsx ***!
+ \***********************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ statusField: () => (/* binding */ statusField)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+
+const statusField = {
+ id: 'status',
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Status', 'activitypub'),
+ enableHiding: true,
+ enableSorting: true,
+ getValue: ({
+ item
+ }) => item.status || ''
+};
+
+/***/ }),
+
+/***/ "./src/social-web/components/fields/title/index.tsx":
+/*!**********************************************************!*\
+ !*** ./src/social-web/components/fields/title/index.tsx ***!
+ \**********************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ titleField: () => (/* binding */ titleField)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities");
+/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
+
+
+
+const titleField = {
+ id: 'title.rendered',
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Title', 'activitypub'),
+ enableHiding: true,
+ enableSorting: false,
+ enableGlobalSearch: true,
+ getValue: ({
+ item
+ }) => (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__.decodeEntities)(item.title?.rendered || ''),
+ render: ({
+ item
+ }) => {
+ if (!item.title?.rendered) {
+ return null;
+ }
+
+ // Remove backslash escapes and decode entities
+ const unescaped = item.title.rendered.replace(/\\(.)/g, '$1');
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
+ className: "activitypub-feed-post-title",
+ children: (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__.decodeEntities)(unescaped)
+ });
+ }
+};
+
+/***/ }),
+
+/***/ "./src/social-web/components/fields/webfinger/index.tsx":
+/*!**************************************************************!*\
+ !*** ./src/social-web/components/fields/webfinger/index.tsx ***!
+ \**************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ webfingerField: () => (/* binding */ webfingerField)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+/**
+ * Webfinger/Profile field for DataViews.
+ */
+
+
+
+const webfingerField = {
+ id: 'webfinger',
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Profile', 'activitypub'),
+ enableHiding: true,
+ getValue: ({
+ item
+ }) => item.actor_info?.webfinger || '',
+ render: ({
+ item
+ }) => {
+ const webfinger = item.actor_info?.webfinger || '';
+ const url = item.actor_info?.url || '#';
+ if (!webfinger) {
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("span", {
+ children: "\u2014"
+ });
+ }
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("a", {
+ href: url,
+ target: "_blank",
+ rel: "noopener noreferrer",
+ title: webfinger,
+ children: ["@", webfinger]
+ });
+ }
+};
+
+/***/ }),
+
+/***/ "./src/social-web/components/page/index.tsx":
+/*!**************************************************!*\
+ !*** ./src/social-web/components/page/index.tsx ***!
+ \**************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ Page: () => (/* binding */ Page)
+/* harmony export */ });
+/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
+/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/social-web/components/page/style.scss");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
+/**
+ * Page Component
+ *
+ * A reusable page wrapper that provides consistent header layout and content structure.
+ */
+
+
+
+
+function Page({
+ title,
+ subTitle,
+ badges,
+ actions,
+ breadcrumbs,
+ hasPadding = true,
+ hasBorder = false,
+ contentWidth = 'default',
+ children
+}) {
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
+ className: "page",
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("header", {
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])('header', {
+ 'has-border': hasBorder
+ }),
+ children: [breadcrumbs && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
+ className: "breadcrumbs",
+ children: breadcrumbs
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
+ className: "title-row",
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
+ className: "title-group",
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("h1", {
+ className: "title",
+ children: title
+ }), badges && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
+ className: "badges",
+ children: badges
+ })]
+ }), actions && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
+ className: "actions",
+ children: actions
+ })]
+ }), subTitle && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("p", {
+ className: "sub-title",
+ children: subTitle
+ })]
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])('content', {
+ padded: hasPadding,
+ constrained: contentWidth === 'constrained',
+ full: contentWidth === 'full'
+ }),
+ children: children
+ })]
+ });
+}
+
+/***/ }),
+
+/***/ "./src/social-web/components/page/style.scss":
+/*!***************************************************!*\
+ !*** ./src/social-web/components/page/style.scss ***!
+ \***************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+// extracted by mini-css-extract-plugin
+
+
+/***/ }),
+
+/***/ "./src/social-web/hooks/use-feed.ts":
+/*!******************************************!*\
+ !*** ./src/social-web/hooks/use-feed.ts ***!
+ \******************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ useFeed: () => (/* binding */ useFeed)
+/* harmony export */ });
+/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data");
+/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
+
+
+function useFeed({
+ perPage = 20,
+ page = 1,
+ orderBy = 'date',
+ order = 'desc',
+ search = '',
+ userId,
+ fields = ['id', 'date', 'modified', 'title', 'excerpt', 'content', 'actor_info', 'status', 'link']
+} = {}) {
+ // Don't fetch if userId is not set
+ const enabled = userId !== null && userId !== undefined;
+ const queryArgs = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
+ const args = {
+ per_page: perPage,
+ page,
+ orderby: orderBy,
+ order,
+ search,
+ _fields: fields
+ };
+
+ // Only add user_id if we have a valid userId
+ if (enabled) {
+ args.user_id = userId;
+ }
+ return args;
+ }, [perPage, page, orderBy, order, search, userId, fields, enabled]);
+ const {
+ records,
+ hasResolved,
+ isResolving,
+ totalItems,
+ totalPages
+ } = (0,_wordpress_core_data__WEBPACK_IMPORTED_MODULE_0__.useEntityRecords)('postType', 'ap_post', enabled ? queryArgs : undefined);
+ return {
+ feed: enabled ? records || [] : [],
+ hasResolved,
+ isResolving,
+ totalItems: enabled ? totalItems : null,
+ totalPages: enabled ? totalPages : null
+ };
+}
+
+/***/ }),
+
+/***/ "./src/social-web/routes/feed/stage.tsx":
+/*!**********************************************!*\
+ !*** ./src/social-web/routes/feed/stage.tsx ***!
+ \**********************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ FeedStage)
+/* harmony export */ });
+/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./style.scss */ "./src/social-web/routes/feed/style.scss");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_dataviews__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/dataviews */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews/index.js");
+/* harmony import */ var _wordpress_views__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/views */ "./node_modules/@wordpress/views/build-module/index.js");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
+/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
+/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_5__);
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__);
+/* harmony import */ var _components_page__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../components/page */ "./src/social-web/components/page/index.tsx");
+/* harmony import */ var _hooks_use_feed__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../hooks/use-feed */ "./src/social-web/hooks/use-feed.ts");
+/* harmony import */ var _components_fields__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../components/fields */ "./src/social-web/components/fields/index.ts");
+/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils */ "./src/social-web/routes/feed/utils.ts");
+/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../store */ "./src/social-web/store/index.ts");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__);
+/**
+ * Feed Stage
+ *
+ * Main feed list view with DataViews
+ */
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+const DEFAULT_VIEW = {
+ type: 'list',
+ perPage: 20,
+ page: 1,
+ sort: {
+ field: 'date',
+ direction: 'desc'
+ },
+ search: '',
+ filters: [],
+ fields: ['metadata', 'title.rendered', 'excerpt.rendered'],
+ infiniteScrollEnabled: true
+};
+const defaultLayouts = {
+ list: {
+ primaryField: 'metadata',
+ fields: ['metadata', 'title.rendered', 'excerpt.rendered'],
+ mediaField: undefined
+ }
+};
+function FeedStage({
+ onSelectItem
+}) {
+ // Get active actor ID from store
+ const activeActorId = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_6__.useSelect)(select => select(_store__WEBPACK_IMPORTED_MODULE_11__.STORE_NAME).getActiveActorId(), []);
+
+ // Track URL query parameters as state for reactivity
+ const [urlQueryParams, setUrlQueryParams] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(() => {
+ const args = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_5__.getQueryArgs)(window.location.href);
+ return {
+ page: args.paged ? Number(args.paged) : undefined,
+ search: args.search || undefined
+ };
+ });
+
+ // Listen for URL changes (browser back/forward).
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
+ const updateQueryParams = () => {
+ const args = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_5__.getQueryArgs)(window.location.href);
+ setUrlQueryParams({
+ page: args.paged ? Number(args.paged) : undefined,
+ search: args.search || undefined
+ });
+ };
+ window.addEventListener('popstate', updateQueryParams);
+ window.addEventListener('hashchange', updateQueryParams);
+ return () => {
+ window.removeEventListener('popstate', updateQueryParams);
+ window.removeEventListener('hashchange', updateQueryParams);
+ };
+ }, []);
+
+ // Use the views hook to persist user preferences
+ const {
+ view,
+ updateView
+ } = (0,_wordpress_views__WEBPACK_IMPORTED_MODULE_3__.useView)({
+ kind: 'postType',
+ name: 'ap_post',
+ slug: 'feed',
+ defaultView: DEFAULT_VIEW,
+ queryParams: urlQueryParams,
+ onChangeQueryParams: params => {
+ const currentUrl = window.location.href;
+ const currentArgs = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_5__.getQueryArgs)(currentUrl);
+ const newUrl = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_5__.addQueryArgs)(currentUrl, {
+ ...currentArgs,
+ paged: params.page || undefined,
+ search: params.search || undefined
+ });
+ window.history.pushState(null, '', newUrl);
+ setUrlQueryParams({
+ page: params.page,
+ search: params.search
+ });
+ }
+ });
+
+ // Wrap updateView to enforce mutual exclusion between excerpt and content fields
+ const updateFeedView = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(updatedView => {
+ const oldFields = view.fields || [];
+ const newFields = updatedView.fields || [];
+ const fields = (0,_utils__WEBPACK_IMPORTED_MODULE_10__.enforceContentExcerptMutualExclusion)(oldFields, newFields);
+ updateView({
+ ...updatedView,
+ fields
+ });
+ }, [view.fields, updateView]);
+ const {
+ feed,
+ isResolving,
+ totalItems,
+ totalPages
+ } = (0,_hooks_use_feed__WEBPACK_IMPORTED_MODULE_8__.useFeed)({
+ perPage: view.perPage || 20,
+ page: view.page || 1,
+ orderBy: view.sort?.field || 'date',
+ order: view.sort?.direction || 'desc',
+ search: view.search || '',
+ userId: activeActorId
+ });
+ const fields = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => [_components_fields__WEBPACK_IMPORTED_MODULE_9__.metadataField, _components_fields__WEBPACK_IMPORTED_MODULE_9__.titleField, _components_fields__WEBPACK_IMPORTED_MODULE_9__.excerptField, _components_fields__WEBPACK_IMPORTED_MODULE_9__.contentField, _components_fields__WEBPACK_IMPORTED_MODULE_9__.dateField], []);
+
+ // Normalize view.fields to maintain the canonical order defined in fields array
+ const normalizedView = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => (0,_utils__WEBPACK_IMPORTED_MODULE_10__.normalizeFieldOrder)(view, fields), [view, fields]);
+ const [selection, setSelection] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
+
+ // State for infinite scroll
+ const [allLoadedRecords, setAllLoadedRecords] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
+ const [isLoadingMore, setIsLoadingMore] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
+ const lastProcessedPage = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(0);
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
+ if (selection.length === 0) {
+ return;
+ }
+ const selectedId = selection[0];
+ const exists = feed.some(item => item.id.toString() === selectedId);
+ if (!exists) {
+ setSelection([]);
+ }
+ }, [feed, selection]);
+ const changeSelection = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(nextSelection => {
+ setSelection(nextSelection);
+ if (nextSelection.length === 0) {
+ return;
+ }
+ const selectedId = nextSelection[0];
+ const selectedItem = feed.find(item => item.id.toString() === selectedId);
+ if (selectedItem) {
+ onSelectItem(selectedItem.id);
+ }
+ }, [feed, onSelectItem]);
+
+ // Infinite scroll handler
+ const infiniteScrollHandler = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
+ const currentPage = view.page || 1;
+
+ // Prevent concurrent requests or loading beyond available pages
+ if (isLoadingMore || currentPage >= (totalPages || 1)) {
+ return;
+ }
+ setIsLoadingMore(true);
+ updateFeedView({
+ ...view,
+ page: currentPage + 1
+ });
+ }, [isLoadingMore, view, totalPages, updateFeedView]);
+
+ // Accumulate data across pages for infinite scroll
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
+ const currentPage = normalizedView.page || 1;
+ const infiniteScrollEnabled = normalizedView.infiniteScrollEnabled;
+
+ // Don't process until feed data is available
+ if (feed.length === 0) {
+ return;
+ }
+
+ // Skip if we've already processed this page (but always process page 1 for search/initial load)
+ if (currentPage > 1 && lastProcessedPage.current === currentPage) {
+ return;
+ }
+
+ // Reset to new data on first page or when infinite scroll is disabled
+ if (currentPage === 1 || !infiniteScrollEnabled) {
+ setAllLoadedRecords(feed);
+ lastProcessedPage.current = currentPage;
+ setIsLoadingMore(false);
+ } else {
+ // Append new records while avoiding duplicates
+ setAllLoadedRecords(prev => {
+ const existingIds = new Set(prev.map(item => item.id));
+ const newRecords = feed.filter(record => !existingIds.has(record.id));
+ return newRecords.length > 0 ? [...prev, ...newRecords] : prev;
+ });
+ lastProcessedPage.current = currentPage;
+ setIsLoadingMore(false);
+ }
+ }, [feed, normalizedView.page, normalizedView.search, normalizedView.infiniteScrollEnabled]);
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_components_page__WEBPACK_IMPORTED_MODULE_7__.Page, {
+ title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Feed', 'activitypub'),
+ subTitle: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('ActivityPub posts from your network', 'activitypub'),
+ hasPadding: false,
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_wordpress_dataviews__WEBPACK_IMPORTED_MODULE_2__["default"], {
+ data: allLoadedRecords,
+ fields: fields,
+ view: normalizedView,
+ onChangeView: updateFeedView,
+ isLoading: isResolving || isLoadingMore,
+ onClickItem: item => onSelectItem(item.id),
+ isItemClickable: () => true,
+ getItemId: item => item.id.toString(),
+ selection: selection,
+ onChangeSelection: changeSelection,
+ empty: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("p", {
+ children: normalizedView.search ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('No posts found.', 'activitypub') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('No posts found in your feed. Posts from ActivityPub actors you follow will appear here.', 'activitypub')
+ }),
+ paginationInfo: {
+ totalItems,
+ totalPages,
+ infiniteScrollHandler
+ },
+ defaultLayouts: defaultLayouts
+ })
+ });
+}
+
+/***/ }),
+
+/***/ "./src/social-web/routes/feed/style.scss":
+/*!***********************************************!*\
+ !*** ./src/social-web/routes/feed/style.scss ***!
+ \***********************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+// extracted by mini-css-extract-plugin
+
+
+/***/ }),
+
+/***/ "./src/social-web/routes/feed/utils.ts":
+/*!*********************************************!*\
+ !*** ./src/social-web/routes/feed/utils.ts ***!
+ \*********************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ enforceContentExcerptMutualExclusion: () => (/* binding */ enforceContentExcerptMutualExclusion),
+/* harmony export */ normalizeFieldOrder: () => (/* binding */ normalizeFieldOrder)
+/* harmony export */ });
+/**
+ * Utility functions for feed view management
+ */
+
+/**
+ * Enforces mutual exclusion between excerpt and content fields.
+ * Ensures that only one of these fields is visible at a time, and at least one is always selected.
+ *
+ * @param oldFields - The previous array of visible field IDs
+ * @param newFields - The new array of visible field IDs
+ * @return The adjusted array of field IDs with enforcement applied
+ */
+function enforceContentExcerptMutualExclusion(oldFields, newFields) {
+ // Check if content was just added
+ const contentAdded = newFields.includes('content') && !oldFields.includes('content');
+ // Check if excerpt was just added
+ const excerptAdded = newFields.includes('excerpt.rendered') && !oldFields.includes('excerpt.rendered');
+ // Check if content was just removed
+ const contentRemoved = !newFields.includes('content') && oldFields.includes('content');
+ // Check if excerpt was just removed
+ const excerptRemoved = !newFields.includes('excerpt.rendered') && oldFields.includes('excerpt.rendered');
+ if (contentAdded) {
+ // Remove excerpt when content is added
+ return newFields.filter(field => field !== 'excerpt.rendered');
+ }
+ if (excerptAdded) {
+ // Remove content when excerpt is added
+ return newFields.filter(field => field !== 'content');
+ }
+ if (contentRemoved && !newFields.includes('excerpt.rendered')) {
+ // Add excerpt when content is removed and excerpt is not already present
+ return [...newFields, 'excerpt.rendered'];
+ }
+ if (excerptRemoved && !newFields.includes('content')) {
+ // Add content when excerpt is removed and content is not already present
+ return [...newFields, 'content'];
+ }
+ return newFields;
+}
+
+/**
+ * Normalizes view fields to maintain canonical order.
+ * Sorts the visible fields according to the order defined in the fields array.
+ *
+ * @param view - The current view configuration
+ * @param fields - Array of field objects with their canonical order
+ * @return The view with fields sorted in canonical order
+ */
+function normalizeFieldOrder(view, fields) {
+ if (!view.fields) {
+ return view;
+ }
+
+ // Create a map of field IDs to their canonical order
+ const fieldOrder = new Map(fields.map((field, index) => [field.id, index]));
+
+ // Sort view.fields according to the canonical order
+ const sortedFields = [...view.fields].sort((a, b) => {
+ var _fieldOrder$get, _fieldOrder$get2;
+ const orderA = (_fieldOrder$get = fieldOrder.get(a)) !== null && _fieldOrder$get !== void 0 ? _fieldOrder$get : Infinity;
+ const orderB = (_fieldOrder$get2 = fieldOrder.get(b)) !== null && _fieldOrder$get2 !== void 0 ? _fieldOrder$get2 : Infinity;
+ return orderA - orderB;
+ });
+ return {
+ ...view,
+ fields: sortedFields
+ };
+}
+
+/***/ }),
+
+/***/ "./src/social-web/utils.ts":
+/*!*********************************!*\
+ !*** ./src/social-web/utils.ts ***!
+ \*********************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ getRelativeTime: () => (/* binding */ getRelativeTime)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/date */ "@wordpress/date");
+/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_1__);
+/**
+ * Utility functions for Social Web
+ */
+
+
+
+
+/**
+ * Format relative time in short format (5m, 2h, 6d)
+ * For dates older than a week, returns the site's date format
+ *
+ * @param dateString - The date string to format
+ * @return The formatted relative time string
+ */
+function getRelativeTime(dateString) {
+ // Ensure the date string is parsed as UTC by adding 'Z' if not present
+ const date = new Date(dateString.endsWith('Z') ? dateString : dateString + 'Z');
+ const now = Date.now();
+ const diffMs = now - date.getTime();
+ const diffMinutes = Math.floor(diffMs / (1000 * 60));
+ const diffHours = Math.floor(diffMs / (1000 * 60 * 60));
+ const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
+ if (diffMinutes < 60) {
+ return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %d: number of minutes */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('%dm', 'short time format: minutes', 'activitypub'), diffMinutes);
+ } else if (diffHours < 24) {
+ return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %d: number of hours */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('%dh', 'short time format: hours', 'activitypub'), diffHours);
+ } else if (diffDays < 7) {
+ return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %d: number of days */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('%dd', 'short time format: days', 'activitypub'), diffDays);
+ }
+
+ // Use site's date format for dates older than a week
+ return (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_1__.dateI18n)((0,_wordpress_date__WEBPACK_IMPORTED_MODULE_1__.getSettings)().formats.date, dateString);
+}
+
+/***/ })
+
+}]);
+//# sourceMappingURL=feed-stage.js.map
\ No newline at end of file
diff --git a/build/social-web/index.asset.php b/build/social-web/index.asset.php
index 5ad8a84213..7cf136da20 100644
--- a/build/social-web/index.asset.php
+++ b/build/social-web/index.asset.php
@@ -1 +1 @@
- array('react', 'react-dom', 'react-jsx-runtime', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-url', 'wp-warning'), 'version' => '658866a5e77c1bf57d37');
+ array('react', 'react-dom', 'react-jsx-runtime', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-url', 'wp-warning'), 'version' => '79951448730011de2dd8');
diff --git a/build/social-web/index.js b/build/social-web/index.js
index b4a7ca6e69..4e1f409344 100644
--- a/build/social-web/index.js
+++ b/build/social-web/index.js
@@ -1,2 +1,1871 @@
-(()=>{"use strict";var e,t,r,n,i,s={17:(e,t,r)=>{r.d(t,{E:()=>u});var n=r(143);const i=window.wp.dataControls;var s=r(233);const o="SET_ACTIVE_ACTOR",a={activeActorId:null},c={*setActiveActor(e){return yield(0,n.dispatch)(s.store).set("activitypub/social-web","activeActorId",e),{type:o,actorId:e}}};var l=r(582);const d={getActiveActorId:function*(){const e=(0,n.select)(s.store).get("activitypub/social-web","activeActorId");if(null!=e)yield(0,n.dispatch)(u).setActiveActor(e);else{const e=(0,n.select)(l.store).getCurrentUser();e?.id&&(yield(0,n.dispatch)(u).setActiveActor(e.id))}}},u="activitypub/social-web",p={reducer:function(e=a,t){return t.type===o?{...e,activeActorId:t.actorId}:e},actions:c,selectors:{getActiveActorId:e=>e.activeActorId},resolvers:d,controls:i.controls},h=(0,n.createReduxStore)(u,p);(0,n.register)(h)},53:e=>{e.exports=window.wp.privateApis},87:e=>{e.exports=window.wp.element},107:e=>{e.exports=window.wp.dom},143:e=>{e.exports=window.wp.data},217:(e,t,r)=>{r(609);var n=r(87),i=r(427);const s=window.wp.keyboardShortcuts,o=window.wp.commands;var a=r(143);const c=window.wp.notices;var l=r(655),d=r(988),u=r(684),p=r(723),h=r(375),m=r(582),v=r(537),f=r(307),w=r(558),b=r(832),g=r(164),x=r(644),_=r(790);const y=function({className:e}){const{isRequestingSite:t,siteIconUrl:r}=(0,a.useSelect)(e=>{const{getEntityRecord:t}=e(m.store),r=t("root","__unstableBase",void 0);return{isRequestingSite:!r,siteIconUrl:r?.site_icon_url}},[]);let n=null;return n=t?(0,_.jsx)("div",{className:"site-icon__image"}):r?(0,_.jsx)("img",{className:"site-icon__image",alt:(0,p.__)("Site Icon","activitypub"),src:r}):(0,_.jsx)(i.Icon,{className:"site-icon__icon",icon:x.A,size:48}),(0,_.jsx)("div",{className:(0,g.A)(e,"site-icon"),children:n})},j=function(){const{homeUrl:e,siteTitle:t}=(0,a.useSelect)(e=>{const{getEntityRecord:t}=e(m.store),r=t("root","__unstableBase");return{homeUrl:r?.home,siteTitle:!r?.name&&r?.url?(0,b.filterURLForDisplay)(r?.url):r?.name}},[]),{open:r}=(0,a.useDispatch)(o.store);return(0,_.jsx)("div",{className:"site-hub",children:(0,_.jsxs)(i.__experimentalHStack,{justify:"flex-start",spacing:"0",children:[(0,_.jsx)("div",{className:"site-hub__icon-container",children:(0,_.jsx)(i.Button,{__next40pxDefaultSize:!0,href:"/wp-admin/",label:(0,p.__)("Go to the Dashboard","activitypub"),className:"site-hub__icon-button",style:{transform:"scale(0.5333) translateX(-4px)",borderRadius:4},children:(0,_.jsx)(y,{className:"site-hub__icon"})})}),(0,_.jsxs)(i.__experimentalHStack,{children:[(0,_.jsx)("div",{className:"site-hub__title",children:(0,_.jsxs)(i.Button,{variant:"link",href:e,target:"_blank",children:[(0,v.decodeEntities)(t),(0,_.jsx)(i.VisuallyHidden,{as:"span",children:/* translators: accessibility text */ /* translators: accessibility text */
-(0,p.__)("(opens in a new tab)","activitypub")})]})}),(0,_.jsx)(i.__experimentalHStack,{spacing:0,expanded:!1,className:"site-hub__actions",children:(0,_.jsx)(i.Button,{size:"compact",className:"site-hub__command-button",icon:f.A,onClick:()=>r(),label:(0,p.__)("Open command palette","activitypub"),shortcut:w.displayShortcut.primary("k")})})]})]})})};var S=r(17);function N(){const{defaultAvatar:e,adminUrl:t}=(0,h.t)(),{setActiveActor:r}=(0,a.useDispatch)(S.E),{currentUser:n,activeActorId:s,canManageSite:o}=(0,a.useSelect)(e=>({currentUser:e(m.store).getCurrentUser(),activeActorId:e(S.E).getActiveActorId(),canManageSite:e(m.store).canUser("read",{kind:"root",name:"site"})}),[]),c=n?.id,l=0===s,d=n?.avatar_urls?.[48]||e,u=l?(0,p.__)("Site","activitypub"):n?.name||"";return(0,_.jsx)(i.Button,{...o?{onClick:()=>{o&&c&&r(0===s?c:0)}}:{href:`${t}profile.php`},className:"actor-switcher",label:o?(0,p.__)("Switch Actor","activitypub"):(0,p.__)("Profile","activitypub"),children:(0,_.jsxs)(i.__experimentalHStack,{spacing:2,alignment:"center",children:[l?(0,_.jsx)(y,{className:"actor-switcher__avatar"}):(0,_.jsx)("img",{src:d,alt:u,className:"actor-switcher__avatar",onError:t=>{t.target.src=e}}),(0,_.jsx)("span",{className:"actor-switcher__name",children:u})]})})}const A=[{id:"feed",label:(0,p.__)("Feed","activitypub")}];function k({activeSection:e,onNavigate:t}){const{adminUrl:r}=(0,h.t)();return(0,_.jsxs)("div",{className:"sidebar",children:[(0,_.jsx)(j,{}),(0,_.jsxs)("nav",{className:"nav",children:[(0,_.jsxs)(i.__experimentalHStack,{spacing:3,alignment:"flex-start",className:"sidebar-navigation__icon-title",children:[(0,_.jsx)(i.Button,{className:"sidebar-navigation__button",size:"compact",icon:(0,p.isRTL)()?l.A:d.A,href:"/wp-admin/",label:(0,p.__)("Go to the Dashboard","activitypub")}),(0,_.jsx)(i.__experimentalHeading,{className:"sidebar-navigation__title",level:1,size:20,children:(0,p.__)("Social Web","activitypub")})]}),(0,_.jsx)(i.NavigableMenu,{children:(0,_.jsx)(i.MenuGroup,{children:A.map(r=>(0,_.jsxs)(i.MenuItem,{isSelected:e===r.id,onClick:()=>t(r.id),className:"menu-item",children:[r.icon&&(0,_.jsx)(i.Icon,{icon:r.icon,size:20}),(0,_.jsx)("span",{children:r.label})]},r.id))})})]}),(0,_.jsx)("div",{className:"footer",children:(0,_.jsxs)(i.__experimentalHStack,{justify:"space-between",alignment:"center",children:[(0,_.jsx)(N,{}),(0,_.jsx)(i.Button,{icon:u.A,iconSize:20,size:"compact",href:`${r}admin.php?page=activitypub`,target:"_blank",label:(0,p.__)("Settings","activitypub"),className:"footer-settings-button"})]})})]})}function E({className:e,children:t}){return(0,_.jsx)("div",{className:(0,g.A)("themed-surface",e),children:t})}function I({className:e,children:t}){return(0,_.jsx)("div",{className:(0,g.A)("panel",e),children:(0,_.jsx)(E,{children:t})})}const C=(0,n.lazy)(()=>Promise.all([r.e(803),r.e(755),r.e(303)]).then(r.bind(r,658))),O=(0,n.lazy)(()=>Promise.all([r.e(803),r.e(322)]).then(r.bind(r,42)));function P(){const e=window.location.hash.slice(1);if(!e||"/"===e)return{section:"feed",itemId:null};const t=e.split("/").filter(Boolean),r=t[0]||"feed",n=t[1]||null;return"feed"===r&&n?{section:r,itemId:parseInt(n,10)}:{section:r,itemId:n}}function T(e,t){const r=t?`#/${e}/${t}`:`#/${e}`;window.history.pushState(null,"",r)}function R(){const[e,t]=(0,n.useState)("feed"),[r,s]=(0,n.useState)(null),l=(0,a.useSelect)(e=>e(S.E).getActiveActorId(),[]),d=(0,n.useRef)(l),u=(0,a.useSelect)(e=>e(c.store).getNotices().filter(e=>"snackbar"===e.type),[]),{removeNotice:p}=(0,a.useDispatch)(c.store);(0,n.useEffect)(()=>{const{section:e,itemId:r}=P();t(e),s(r)},[]),(0,n.useEffect)(()=>{d.current!==l&&r&&(s(null),T(e)),d.current=l},[l,r,e]),(0,n.useEffect)(()=>{const e=()=>{const{section:e,itemId:r}=P();t(e),s(r)};return window.addEventListener("hashchange",e),()=>{window.removeEventListener("hashchange",e)}},[]);const h=t=>{s(t),T(e,t)},m=()=>{s(null),T(e)},v=!!r;return(0,_.jsxs)("div",{className:"app-layout","data-section":e,children:[(0,_.jsx)(o.CommandMenu,{}),(0,_.jsxs)("div",{className:"app-content",children:[(0,_.jsx)("div",{className:"sidebar-region",children:(0,_.jsx)(k,{activeSection:e,onNavigate:e=>{t(e),s(null),T(e)}})}),(0,_.jsx)("div",{className:"stage-region",children:(0,_.jsx)(I,{children:(()=>{const e={onSelectItem:h};let t;return t=C,(0,_.jsx)(n.Suspense,{fallback:(0,_.jsx)("div",{style:{padding:"20px",textAlign:"center"},children:(0,_.jsx)(i.Spinner,{})}),children:(0,_.jsx)(t,{...e})})})()})}),v&&(0,_.jsx)("div",{className:"inspector-region",children:(0,_.jsx)(I,{children:(()=>{if(!r)return null;let e,t;return"number"!=typeof r?null:(e=O,t={id:r,onClose:m},(0,_.jsx)(n.Suspense,{fallback:(0,_.jsx)("div",{style:{padding:"20px",textAlign:"center"},children:(0,_.jsx)(i.Spinner,{})}),children:(0,_.jsx)(e,{...t})}))})()})})]}),(0,_.jsx)(i.SnackbarList,{notices:u,onRemove:p})]})}window.wp=window.wp||{},window.wp.activitypubSocialWeb={initialize:function(e,t){const r=document.getElementById(e);r&&(0,n.createRoot)(r).render((0,_.jsx)(h.Z,{settings:t,children:(0,_.jsx)(s.ShortcutProvider,{children:(0,_.jsx)(i.SlotFillProvider,{children:(0,_.jsx)(R,{})})})}))}}},233:e=>{e.exports=window.wp.preferences},375:(e,t,r)=>{r.d(t,{Z:()=>o,t:()=>a});var n=r(87),i=r(790);const s=(0,n.createContext)(void 0);function o({children:e,settings:t}){return(0,i.jsx)(s.Provider,{value:t,children:e})}function a(){const e=(0,n.useContext)(s);if(!e)throw new Error("useSettings must be used within a SettingsProvider");return e}},427:e=>{e.exports=window.wp.components},443:e=>{e.exports=window.wp.date},491:e=>{e.exports=window.wp.compose},537:e=>{e.exports=window.wp.htmlEntities},558:e=>{e.exports=window.wp.keycodes},573:e=>{e.exports=window.wp.primitives},582:e=>{e.exports=window.wp.coreData},609:e=>{e.exports=window.React},723:e=>{e.exports=window.wp.i18n},790:e=>{e.exports=window.ReactJSXRuntime},795:e=>{e.exports=window.ReactDOM},832:e=>{e.exports=window.wp.url},979:e=>{e.exports=window.wp.warning}},o={};function a(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}};return s[e](r,r.exports,a),r.exports}a.m=s,e=[],a.O=(t,r,n,i)=>{if(!r){var s=1/0;for(d=0;d=i)&&Object.keys(a.O).every(e=>a.O[e](r[c]))?r.splice(c--,1):(o=!1,i0&&e[d-1][2]>i;d--)e[d]=e[d-1];e[d]=[r,n,i]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(e,n){if(1&n&&(e=this(e)),8&n)return e;if("object"==typeof e&&e){if(4&n&&e.__esModule)return e;if(16&n&&"function"==typeof e.then)return e}var i=Object.create(null);a.r(i);var s={};t=t||[null,r({}),r([]),r(r)];for(var o=2&n&&e;("object"==typeof o||"function"==typeof o)&&!~t.indexOf(o);o=r(o))Object.getOwnPropertyNames(o).forEach(t=>s[t]=()=>e[t]);return s.default=()=>e,a.d(i,s),i},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((t,r)=>(a.f[r](e,t),t),[])),a.u=e=>303===e?"social-web/feed-stage.js":322===e?"social-web/feed-inspector.js":void 0,a.miniCssF=e=>"social-web/style-feed-stage.css",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},i="wordpress-activitypub:",a.l=(e,t,r,s)=>{if(n[e])n[e].push(t);else{var o,c;if(void 0!==r)for(var l=document.getElementsByTagName("script"),d=0;d{o.onerror=o.onload=null,clearTimeout(h);var i=n[e];if(delete n[e],o.parentNode&&o.parentNode.removeChild(o),i&&i.forEach(e=>e(r)),t)return t(r)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=p.bind(null,o.onerror),o.onload=p.bind(null,o.onload),c&&document.head.appendChild(o)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e+"../"})(),(()=>{if("undefined"!=typeof document){var e={994:0};a.f.miniCss=(t,r)=>{e[t]?r.push(e[t]):0!==e[t]&&{755:1}[t]&&r.push(e[t]=(e=>new Promise((t,r)=>{var n=a.miniCssF(e),i=a.p+n;if(((e,t)=>{for(var r=document.getElementsByTagName("link"),n=0;n{var s=document.createElement("link");s.rel="stylesheet",s.type="text/css",a.nc&&(s.nonce=a.nc),s.onerror=s.onload=r=>{if(s.onerror=s.onload=null,"load"===r.type)n();else{var o=r&&r.type,a=r&&r.target&&r.target.href||t,c=new Error("Loading CSS chunk "+e+" failed.\n("+o+": "+a+")");c.name="ChunkLoadError",c.code="CSS_CHUNK_LOAD_FAILED",c.type=o,c.request=a,s.parentNode&&s.parentNode.removeChild(s),i(c)}},s.href=t,document.head.appendChild(s)})(e,i,0,t,r)}))(t).then(()=>{e[t]=0},r=>{throw delete e[t],r}))}}})(),(()=>{var e={994:0,982:0};a.f.j=(t,r)=>{var n=a.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else if(/^(755|982)$/.test(t))e[t]=0;else{var i=new Promise((r,i)=>n=e[t]=[r,i]);r.push(n[2]=i);var s=a.p+a.u(t),o=new Error;a.l(s,r=>{if(a.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),s=r&&r.target&&r.target.src;o.message="Loading chunk "+t+" failed.\n("+i+": "+s+")",o.name="ChunkLoadError",o.type=i,o.request=s,n[1](o)}},"chunk-"+t,t)}},a.O.j=t=>0===e[t];var t=(t,r)=>{var n,i,[s,o,c]=r,l=0;if(s.some(t=>0!==e[t])){for(n in o)a.o(o,n)&&(a.m[n]=o[n]);if(c)var d=c(a)}for(t&&t(r);la(217));c=a.O(c)})();
\ No newline at end of file
+/******/ (() => { // webpackBootstrap
+/******/ "use strict";
+/******/ var __webpack_modules__ = ({
+
+/***/ "./src/social-web/components/actor-switcher/index.tsx":
+/*!************************************************************!*\
+ !*** ./src/social-web/components/actor-switcher/index.tsx ***!
+ \************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ ActorSwitcher)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data");
+/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _contexts_settings_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../contexts/settings-context */ "./src/social-web/contexts/settings-context.tsx");
+/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../store */ "./src/social-web/store/index.ts");
+/* harmony import */ var _site_icon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../site-icon */ "./src/social-web/components/site-icon/index.tsx");
+/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./style.scss */ "./src/social-web/components/actor-switcher/style.scss");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__);
+/**
+ * Actor Switcher Component
+ *
+ * Displays current actor (user or site) and allows admins to toggle between them
+ */
+
+
+
+
+
+
+
+
+
+
+function ActorSwitcher() {
+ const {
+ defaultAvatar,
+ adminUrl
+ } = (0,_contexts_settings_context__WEBPACK_IMPORTED_MODULE_4__.useSettings)();
+ const {
+ setActiveActor
+ } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_store__WEBPACK_IMPORTED_MODULE_5__.STORE_NAME);
+ const {
+ currentUser,
+ activeActorId,
+ canManageSite
+ } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => ({
+ currentUser: select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__.store).getCurrentUser(),
+ activeActorId: select(_store__WEBPACK_IMPORTED_MODULE_5__.STORE_NAME).getActiveActorId(),
+ canManageSite: select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__.store).canUser('read', {
+ kind: 'root',
+ name: 'site'
+ })
+ }), []);
+ const currentUserId = currentUser?.id;
+
+ // Determine which actor info to display
+ const isSiteActor = activeActorId === 0;
+ const userAvatarUrl = currentUser?.avatar_urls?.[48] || defaultAvatar;
+ const displayName = isSiteActor ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Site', 'activitypub') : currentUser?.name || '';
+
+ // Toggle between user and site actor
+ const toggleActor = () => {
+ if (canManageSite && currentUserId) {
+ const newActorId = activeActorId === 0 ? currentUserId : 0;
+ setActiveActor(newActorId);
+ }
+ };
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button, {
+ ...(canManageSite ? {
+ onClick: toggleActor
+ } : {
+ href: `${adminUrl}profile.php`
+ }),
+ className: "actor-switcher",
+ label: canManageSite ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Switch Actor', 'activitypub') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Profile', 'activitypub'),
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack, {
+ spacing: 2,
+ alignment: "center",
+ children: [isSiteActor ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_site_icon__WEBPACK_IMPORTED_MODULE_6__["default"], {
+ className: "actor-switcher__avatar"
+ }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("img", {
+ src: userAvatarUrl,
+ alt: displayName,
+ className: "actor-switcher__avatar",
+ onError: e => {
+ e.target.src = defaultAvatar;
+ }
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("span", {
+ className: "actor-switcher__name",
+ children: displayName
+ })]
+ })
+ });
+}
+
+/***/ }),
+
+/***/ "./src/social-web/components/actor-switcher/style.scss":
+/*!*************************************************************!*\
+ !*** ./src/social-web/components/actor-switcher/style.scss ***!
+ \*************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+// extracted by mini-css-extract-plugin
+
+
+/***/ }),
+
+/***/ "./src/social-web/components/layout/index.tsx":
+/*!****************************************************!*\
+ !*** ./src/social-web/components/layout/index.tsx ***!
+ \****************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ Layout: () => (/* binding */ Layout)
+/* harmony export */ });
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/commands */ "@wordpress/commands");
+/* harmony import */ var _wordpress_commands__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_commands__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _wordpress_notices__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/notices */ "@wordpress/notices");
+/* harmony import */ var _wordpress_notices__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_notices__WEBPACK_IMPORTED_MODULE_4__);
+/* harmony import */ var _sidebar__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../sidebar */ "./src/social-web/components/sidebar/index.tsx");
+/* harmony import */ var _panel__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../panel */ "./src/social-web/components/panel/index.tsx");
+/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../store */ "./src/social-web/store/index.ts");
+/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./style.scss */ "./src/social-web/components/layout/style.scss");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__);
+/**
+ * Layout Component
+ *
+ * Three-panel layout system:
+ * - Sidebar (300px fixed) - Navigation
+ * - Stage (flexible) - Main content
+ * - Inspector (380px fixed, optional) - Detail panel
+ */
+
+
+
+
+
+
+
+
+
+
+
+// Lazy load route stages for better performance
+// Use magic comments to give chunks proper names
+
+const FeedStage = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.lazy)(() => Promise.all(/*! import() | social-web/feed-stage */[__webpack_require__.e("social-web/vendors"), __webpack_require__.e("social-web/style-feed-stage"), __webpack_require__.e("social-web/feed-stage")]).then(__webpack_require__.bind(__webpack_require__, /*! ../../routes/feed/stage */ "./src/social-web/routes/feed/stage.tsx")));
+
+// Lazy load inspector components
+const FeedInspector = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.lazy)(() => Promise.all(/*! import() | social-web/feed-inspector */[__webpack_require__.e("social-web/vendors"), __webpack_require__.e("social-web/feed-inspector")]).then(__webpack_require__.bind(__webpack_require__, /*! ../../routes/feed/inspector */ "./src/social-web/routes/feed/inspector.tsx")));
+
+/**
+ * Parse the URL hash to extract section and item ID
+ * Format: #/section or #/section/itemId
+ */
+function parseHash() {
+ const hash = window.location.hash.slice(1); // Remove #
+ if (!hash || hash === '/') {
+ return {
+ section: 'feed',
+ itemId: null
+ };
+ }
+ const parts = hash.split('/').filter(Boolean);
+ const section = parts[0] || 'feed';
+ const itemId = parts[1] || null;
+
+ // Convert itemId to number for feed
+ if (section === 'feed' && itemId) {
+ return {
+ section,
+ itemId: parseInt(itemId, 10)
+ };
+ }
+ return {
+ section,
+ itemId
+ };
+}
+
+/**
+ * Update the URL hash without triggering a page reload
+ *
+ * @param {string} section Section name
+ * @param {string|number|null} itemId Optional item ID
+ */
+function updateHash(section, itemId) {
+ const hash = itemId ? `#/${section}/${itemId}` : `#/${section}`;
+ window.history.pushState(null, '', hash);
+}
+function Layout() {
+ const [activeSection, setActiveSection] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)('feed');
+ const [selectedItemId, setSelectedItemId] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
+
+ // Get active actor ID
+ const activeActorId = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_store__WEBPACK_IMPORTED_MODULE_7__.STORE_NAME).getActiveActorId(), []);
+
+ // Track previous actor ID to detect changes
+ const prevActiveActorId = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(activeActorId);
+
+ // Get notices for the snackbar
+ const notices = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
+ const store = select(_wordpress_notices__WEBPACK_IMPORTED_MODULE_4__.store);
+ return store.getNotices().filter(notice => notice.type === 'snackbar');
+ }, []);
+ const {
+ removeNotice
+ } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_wordpress_notices__WEBPACK_IMPORTED_MODULE_4__.store);
+
+ // Initialize from URL hash on mount
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
+ const {
+ section,
+ itemId
+ } = parseHash();
+ setActiveSection(section);
+ setSelectedItemId(itemId);
+ }, []);
+
+ // Close inspector when actor changes
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
+ if (prevActiveActorId.current !== activeActorId && selectedItemId) {
+ setSelectedItemId(null);
+ updateHash(activeSection);
+ }
+ prevActiveActorId.current = activeActorId;
+ }, [activeActorId, selectedItemId, activeSection]);
+
+ // Listen for hash changes (back/forward navigation).
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
+ const syncUrlToState = () => {
+ const {
+ section,
+ itemId
+ } = parseHash();
+ setActiveSection(section);
+ setSelectedItemId(itemId);
+ };
+ window.addEventListener('hashchange', syncUrlToState);
+ return () => {
+ window.removeEventListener('hashchange', syncUrlToState);
+ };
+ }, []);
+ const selectItem = id => {
+ setSelectedItemId(id);
+ updateHash(activeSection, id);
+ };
+ const closeInspector = () => {
+ setSelectedItemId(null);
+ updateHash(activeSection);
+ };
+ const navigate = section => {
+ setActiveSection(section);
+ setSelectedItemId(null);
+ updateHash(section);
+ };
+
+ // Render main content (stage) with Suspense for lazy loading
+ const renderStage = () => {
+ const props = {
+ onSelectItem: selectItem
+ };
+ let StageComponent;
+ switch (activeSection) {
+ case 'feed':
+ default:
+ StageComponent = FeedStage;
+ }
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Suspense, {
+ fallback: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
+ style: {
+ padding: '20px',
+ textAlign: 'center'
+ },
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Spinner, {})
+ }),
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(StageComponent, {
+ ...props
+ })
+ });
+ };
+
+ // Render detail panel (inspector) with Suspense for lazy loading
+ const renderInspector = () => {
+ if (!selectedItemId) {
+ return null;
+ }
+ let InspectorComponent;
+ let props;
+ switch (activeSection) {
+ case 'feed':
+ default:
+ // Feed inspector expects number type
+ if (typeof selectedItemId !== 'number') {
+ return null;
+ }
+ InspectorComponent = FeedInspector;
+ props = {
+ id: selectedItemId,
+ onClose: closeInspector
+ };
+ }
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Suspense, {
+ fallback: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
+ style: {
+ padding: '20px',
+ textAlign: 'center'
+ },
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Spinner, {})
+ }),
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(InspectorComponent, {
+ ...props
+ })
+ });
+ };
+ const showInspector = !!selectedItemId;
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
+ className: "app-layout",
+ "data-section": activeSection,
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_commands__WEBPACK_IMPORTED_MODULE_1__.CommandMenu, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
+ className: "app-content",
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
+ className: "sidebar-region",
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_sidebar__WEBPACK_IMPORTED_MODULE_5__["default"], {
+ activeSection: activeSection,
+ onNavigate: navigate
+ })
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
+ className: "stage-region",
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_panel__WEBPACK_IMPORTED_MODULE_6__["default"], {
+ children: renderStage()
+ })
+ }), showInspector && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
+ className: "inspector-region",
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_panel__WEBPACK_IMPORTED_MODULE_6__["default"], {
+ children: renderInspector()
+ })
+ })]
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.SnackbarList, {
+ notices: notices,
+ onRemove: removeNotice
+ })]
+ });
+}
+
+/***/ }),
+
+/***/ "./src/social-web/components/layout/style.scss":
+/*!*****************************************************!*\
+ !*** ./src/social-web/components/layout/style.scss ***!
+ \*****************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+// extracted by mini-css-extract-plugin
+
+
+/***/ }),
+
+/***/ "./src/social-web/components/panel/index.tsx":
+/*!***************************************************!*\
+ !*** ./src/social-web/components/panel/index.tsx ***!
+ \***************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ Panel)
+/* harmony export */ });
+/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
+/* harmony import */ var _themed_surface__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../themed-surface */ "./src/social-web/components/themed-surface/index.tsx");
+/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ "./src/social-web/components/panel/style.scss");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
+/**
+ * Panel Component
+ *
+ * A reusable surface wrapper for themed content areas.
+ * Uses ThemedSurface component with margin spacing.
+ */
+
+
+
+
+
+function Panel({
+ className,
+ children
+}) {
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])('panel', className),
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_themed_surface__WEBPACK_IMPORTED_MODULE_1__["default"], {
+ children: children
+ })
+ });
+}
+
+/***/ }),
+
+/***/ "./src/social-web/components/panel/style.scss":
+/*!****************************************************!*\
+ !*** ./src/social-web/components/panel/style.scss ***!
+ \****************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+// extracted by mini-css-extract-plugin
+
+
+/***/ }),
+
+/***/ "./src/social-web/components/sidebar/index.tsx":
+/*!*****************************************************!*\
+ !*** ./src/social-web/components/sidebar/index.tsx ***!
+ \*****************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ Sidebar)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/chevron-left.js");
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/chevron-right.js");
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/cog.js");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
+/* harmony import */ var _contexts_settings_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../contexts/settings-context */ "./src/social-web/contexts/settings-context.tsx");
+/* harmony import */ var _site_hub__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../site-hub */ "./src/social-web/components/site-hub/index.tsx");
+/* harmony import */ var _actor_switcher__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../actor-switcher */ "./src/social-web/components/actor-switcher/index.tsx");
+/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./style.scss */ "./src/social-web/components/sidebar/style.scss");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__);
+/**
+ * Sidebar Component
+ *
+ * Navigation sidebar with menu items for different sections
+ */
+
+
+
+
+
+
+
+
+
+const menuItems = [{
+ id: 'feed',
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Feed', 'activitypub')
+}];
+function Sidebar({
+ activeSection,
+ onNavigate
+}) {
+ const {
+ adminUrl
+ } = (0,_contexts_settings_context__WEBPACK_IMPORTED_MODULE_5__.useSettings)();
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
+ className: "sidebar",
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_site_hub__WEBPACK_IMPORTED_MODULE_6__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("nav", {
+ className: "nav",
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack, {
+ spacing: 3,
+ alignment: "flex-start",
+ className: "sidebar-navigation__icon-title",
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button, {
+ className: "sidebar-navigation__button",
+ size: "compact",
+ icon: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.isRTL)() ? _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"] : _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__["default"],
+ href: "/wp-admin/",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Go to the Dashboard', 'activitypub')
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHeading, {
+ className: "sidebar-navigation__title",
+ level: 1,
+ size: 20,
+ children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Social Web', 'activitypub')
+ })]
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.NavigableMenu, {
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.MenuGroup, {
+ children: menuItems.map(item => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.MenuItem, {
+ isSelected: activeSection === item.id,
+ onClick: () => onNavigate(item.id),
+ className: "menu-item",
+ children: [item.icon && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Icon, {
+ icon: item.icon,
+ size: 20
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("span", {
+ children: item.label
+ })]
+ }, item.id))
+ })
+ })]
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
+ className: "footer",
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack, {
+ justify: "space-between",
+ alignment: "center",
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_actor_switcher__WEBPACK_IMPORTED_MODULE_7__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button, {
+ icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"],
+ iconSize: 20,
+ size: "compact",
+ href: `${adminUrl}admin.php?page=activitypub`,
+ target: "_blank",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Settings', 'activitypub'),
+ className: "footer-settings-button"
+ })]
+ })
+ })]
+ });
+}
+
+/***/ }),
+
+/***/ "./src/social-web/components/sidebar/style.scss":
+/*!******************************************************!*\
+ !*** ./src/social-web/components/sidebar/style.scss ***!
+ \******************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+// extracted by mini-css-extract-plugin
+
+
+/***/ }),
+
+/***/ "./src/social-web/components/site-hub/index.tsx":
+/*!******************************************************!*\
+ !*** ./src/social-web/components/site-hub/index.tsx ***!
+ \******************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
+/* harmony export */ });
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data");
+/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities");
+/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__);
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/search.js");
+/* harmony import */ var _wordpress_commands__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/commands */ "@wordpress/commands");
+/* harmony import */ var _wordpress_commands__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_commands__WEBPACK_IMPORTED_MODULE_6__);
+/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes");
+/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_7__);
+/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
+/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_8__);
+/* harmony import */ var _site_icon__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../site-icon */ "./src/social-web/components/site-icon/index.tsx");
+/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./style.scss */ "./src/social-web/components/site-hub/style.scss");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__);
+/**
+ * Site Hub Component
+ *
+ * Displays site icon, title, and command palette toggle
+ */
+
+/**
+ * WordPress dependencies
+ */
+
+
+
+
+
+
+
+
+
+/**
+ * Internal dependencies
+ */
+
+
+
+function SiteHub() {
+ const {
+ homeUrl,
+ siteTitle
+ } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
+ const {
+ getEntityRecord
+ } = select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_3__.store);
+ const _base = getEntityRecord('root', '__unstableBase');
+ return {
+ homeUrl: _base?.home,
+ siteTitle: !_base?.name && !!_base?.url ? (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_8__.filterURLForDisplay)(_base?.url) : _base?.name
+ };
+ }, []);
+ const {
+ open: openCommandCenter
+ } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch)(_wordpress_commands__WEBPACK_IMPORTED_MODULE_6__.store);
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
+ className: "site-hub",
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHStack, {
+ justify: "flex-start",
+ spacing: "0",
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
+ className: "site-hub__icon-container",
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
+ __next40pxDefaultSize: true,
+ href: "/wp-admin/",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Go to the Dashboard', 'activitypub'),
+ className: "site-hub__icon-button",
+ style: {
+ transform: 'scale(0.5333) translateX(-4px)',
+ // Offset to position the icon 12px from viewport edge
+ borderRadius: 4
+ },
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_site_icon__WEBPACK_IMPORTED_MODULE_9__["default"], {
+ className: "site-hub__icon"
+ })
+ })
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHStack, {
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
+ className: "site-hub__title",
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
+ variant: "link",
+ href: homeUrl,
+ target: "_blank",
+ children: [(0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__.decodeEntities)(siteTitle), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.VisuallyHidden, {
+ as: "span",
+ children: /* translators: accessibility text */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('(opens in a new tab)', 'activitypub')
+ })]
+ })
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHStack, {
+ spacing: 0,
+ expanded: false,
+ className: "site-hub__actions",
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
+ size: "compact",
+ className: "site-hub__command-button",
+ icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__["default"],
+ onClick: () => openCommandCenter(),
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Open command palette', 'activitypub'),
+ shortcut: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_7__.displayShortcut.primary('k')
+ })
+ })]
+ })]
+ })
+ });
+}
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SiteHub);
+
+/***/ }),
+
+/***/ "./src/social-web/components/site-hub/style.scss":
+/*!*******************************************************!*\
+ !*** ./src/social-web/components/site-hub/style.scss ***!
+ \*******************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+// extracted by mini-css-extract-plugin
+
+
+/***/ }),
+
+/***/ "./src/social-web/components/site-icon/index.tsx":
+/*!*******************************************************!*\
+ !*** ./src/social-web/components/site-icon/index.tsx ***!
+ \*******************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
+/* harmony export */ });
+/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/wordpress.js");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
+/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data");
+/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_5__);
+/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./style.scss */ "./src/social-web/components/site-icon/style.scss");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__);
+/**
+ * External dependencies
+ */
+
+
+/**
+ * WordPress dependencies
+ */
+
+
+
+
+
+/**
+ * Internal dependencies
+ */
+
+
+function SiteIcon({
+ className
+}) {
+ const {
+ isRequestingSite,
+ siteIconUrl
+ } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
+ const {
+ getEntityRecord
+ } = select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_5__.store);
+ const siteData = getEntityRecord('root', '__unstableBase', undefined);
+ return {
+ isRequestingSite: !siteData,
+ siteIconUrl: siteData?.site_icon_url
+ };
+ }, []);
+ let icon = null;
+ if (isRequestingSite) {
+ icon = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
+ className: "site-icon__image"
+ });
+ } else if (siteIconUrl) {
+ icon = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("img", {
+ className: "site-icon__image",
+ alt: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Site Icon', 'activitypub'),
+ src: siteIconUrl
+ });
+ } else {
+ icon = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Icon, {
+ className: "site-icon__icon",
+ icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"],
+ size: 48
+ });
+ }
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])(className, 'site-icon'),
+ children: icon
+ });
+}
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SiteIcon);
+
+/***/ }),
+
+/***/ "./src/social-web/components/site-icon/style.scss":
+/*!********************************************************!*\
+ !*** ./src/social-web/components/site-icon/style.scss ***!
+ \********************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+// extracted by mini-css-extract-plugin
+
+
+/***/ }),
+
+/***/ "./src/social-web/components/themed-surface/index.tsx":
+/*!************************************************************!*\
+ !*** ./src/social-web/components/themed-surface/index.tsx ***!
+ \************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ ThemedSurface)
+/* harmony export */ });
+/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
+/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/social-web/components/themed-surface/style.scss");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
+/**
+ * ThemedSurface Component
+ *
+ * This component wraps content with appropriate theme context for consistent styling.
+ */
+
+
+
+
+/**
+ * ThemedSurface component
+ *
+ * Wraps content in a themed surface with light background.
+ * Uses wpds design tokens that are provided by ThemeProvider context.
+ */
+function ThemedSurface({
+ className,
+ children
+}) {
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])('themed-surface', className),
+ children: children
+ });
+}
+
+/***/ }),
+
+/***/ "./src/social-web/components/themed-surface/style.scss":
+/*!*************************************************************!*\
+ !*** ./src/social-web/components/themed-surface/style.scss ***!
+ \*************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+// extracted by mini-css-extract-plugin
+
+
+/***/ }),
+
+/***/ "./src/social-web/contexts/settings-context.tsx":
+/*!******************************************************!*\
+ !*** ./src/social-web/contexts/settings-context.tsx ***!
+ \******************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ SettingsProvider: () => (/* binding */ SettingsProvider),
+/* harmony export */ useSettings: () => (/* binding */ useSettings)
+/* harmony export */ });
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+/**
+ * WordPress dependencies
+ */
+
+
+/**
+ * Internal dependencies
+ */
+
+const SettingsContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createContext)(undefined);
+function SettingsProvider({
+ children,
+ settings
+}) {
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(SettingsContext.Provider, {
+ value: settings,
+ children: children
+ });
+}
+function useSettings() {
+ const settings = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useContext)(SettingsContext);
+ if (!settings) {
+ throw new Error('useSettings must be used within a SettingsProvider');
+ }
+ return settings;
+}
+
+/***/ }),
+
+/***/ "./src/social-web/index.tsx":
+/*!**********************************!*\
+ !*** ./src/social-web/index.tsx ***!
+ \**********************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ initialize: () => (/* binding */ initialize)
+/* harmony export */ });
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/keyboard-shortcuts */ "@wordpress/keyboard-shortcuts");
+/* harmony import */ var _wordpress_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _components_layout__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/layout */ "./src/social-web/components/layout/index.tsx");
+/* harmony import */ var _contexts_settings_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./contexts/settings-context */ "./src/social-web/contexts/settings-context.tsx");
+/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./store */ "./src/social-web/store/index.ts");
+/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./style.scss */ "./src/social-web/style.scss");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__);
+/**
+ * WordPress dependencies
+ */
+
+
+
+
+
+/**
+ * Internal dependencies
+ */
+
+
+ // Import to register the store
+ // Import all styles
+
+/**
+ * Initialize the Social Web application.
+ *
+ * @param id The ID of the root element.
+ * @param settings The editor settings.
+ */
+
+function initialize(id, settings) {
+ const target = document.getElementById(id);
+ if (!target) {
+ return;
+ }
+ const root = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createRoot)(target);
+ root.render(/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_contexts_settings_context__WEBPACK_IMPORTED_MODULE_5__.SettingsProvider, {
+ settings: settings,
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_3__.ShortcutProvider, {
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.SlotFillProvider, {
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_components_layout__WEBPACK_IMPORTED_MODULE_4__.Layout, {})
+ })
+ })
+ }));
+}
+
+// Extend Window interface for type safety.
+
+// Export to window for inline script access.
+window.wp = window.wp || {};
+window.wp.activitypubSocialWeb = {
+ initialize
+};
+
+/***/ }),
+
+/***/ "./src/social-web/store/actions.ts":
+/*!*****************************************!*\
+ !*** ./src/social-web/store/actions.ts ***!
+ \*****************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ actions: () => (/* binding */ actions)
+/* harmony export */ });
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_preferences__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/preferences */ "@wordpress/preferences");
+/* harmony import */ var _wordpress_preferences__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_preferences__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./types */ "./src/social-web/store/types.ts");
+/**
+ * WordPress dependencies
+ */
+
+
+
+/**
+ * Internal dependencies
+ */
+
+
+
+/**
+ * Store actions
+ */
+const actions = {
+ *setActiveActor(actorId) {
+ // Save to preferences
+ yield (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)(_wordpress_preferences__WEBPACK_IMPORTED_MODULE_1__.store).set('activitypub/social-web', 'activeActorId', actorId);
+
+ // Update state
+ return {
+ type: _types__WEBPACK_IMPORTED_MODULE_2__.SET_ACTIVE_ACTOR,
+ actorId
+ };
+ }
+};
+
+/***/ }),
+
+/***/ "./src/social-web/store/index.ts":
+/*!***************************************!*\
+ !*** ./src/social-web/store/index.ts ***!
+ \***************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ STORE_NAME: () => (/* binding */ STORE_NAME),
+/* harmony export */ store: () => (/* binding */ store)
+/* harmony export */ });
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_data_controls__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data-controls */ "@wordpress/data-controls");
+/* harmony import */ var _wordpress_data_controls__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data_controls__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./actions */ "./src/social-web/store/actions.ts");
+/* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./selectors */ "./src/social-web/store/selectors.ts");
+/* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./reducer */ "./src/social-web/store/reducer.ts");
+/* harmony import */ var _resolvers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./resolvers */ "./src/social-web/store/resolvers.ts");
+/**
+ * WordPress dependencies
+ */
+
+
+
+/**
+ * Internal dependencies
+ */
+
+
+
+
+/**
+ * Store name
+ */
+const STORE_NAME = 'activitypub/social-web';
+
+/**
+ * Store configuration
+ */
+const storeConfig = {
+ reducer: _reducer__WEBPACK_IMPORTED_MODULE_4__.reducer,
+ actions: _actions__WEBPACK_IMPORTED_MODULE_2__.actions,
+ selectors: _selectors__WEBPACK_IMPORTED_MODULE_3__.selectors,
+ resolvers: _resolvers__WEBPACK_IMPORTED_MODULE_5__.resolvers,
+ controls: _wordpress_data_controls__WEBPACK_IMPORTED_MODULE_1__.controls
+};
+
+/**
+ * Create and register the store
+ */
+const store = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.createReduxStore)(STORE_NAME, storeConfig);
+(0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.register)(store);
+
+/**
+ * Re-export types for convenience
+ */
+
+/**
+ * Store types for TypeScript
+ */
+
+/**
+ * Type helpers for using the store
+ */
+
+/***/ }),
+
+/***/ "./src/social-web/store/reducer.ts":
+/*!*****************************************!*\
+ !*** ./src/social-web/store/reducer.ts ***!
+ \*****************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ reducer: () => (/* binding */ reducer)
+/* harmony export */ });
+/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./src/social-web/store/types.ts");
+/**
+ * Internal dependencies
+ */
+
+
+
+/**
+ * Store reducer
+ */
+function reducer(state = _types__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_STATE, action) {
+ switch (action.type) {
+ case _types__WEBPACK_IMPORTED_MODULE_0__.SET_ACTIVE_ACTOR:
+ return {
+ ...state,
+ activeActorId: action.actorId
+ };
+ default:
+ return state;
+ }
+}
+
+/***/ }),
+
+/***/ "./src/social-web/store/resolvers.ts":
+/*!*******************************************!*\
+ !*** ./src/social-web/store/resolvers.ts ***!
+ \*******************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ getActiveActorId: () => (/* binding */ getActiveActorId),
+/* harmony export */ resolvers: () => (/* binding */ resolvers)
+/* harmony export */ });
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_preferences__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/preferences */ "@wordpress/preferences");
+/* harmony import */ var _wordpress_preferences__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_preferences__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data");
+/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./index */ "./src/social-web/store/index.ts");
+/**
+ * WordPress dependencies
+ */
+
+
+
+
+/**
+ * Internal dependencies
+ */
+
+
+/**
+ * Resolver to initialize the active actor from preferences
+ */
+function* getActiveActorId() {
+ const preferences = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_wordpress_preferences__WEBPACK_IMPORTED_MODULE_1__.store);
+ const savedActorId = preferences.get('activitypub/social-web', 'activeActorId');
+ if (savedActorId !== undefined && savedActorId !== null) {
+ // Restore saved actor ID
+ yield (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)(_index__WEBPACK_IMPORTED_MODULE_3__.STORE_NAME).setActiveActor(savedActorId);
+ } else {
+ // No saved preference, initialize with current user ID
+ const currentUser = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__.store).getCurrentUser();
+ if (currentUser?.id) {
+ yield (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)(_index__WEBPACK_IMPORTED_MODULE_3__.STORE_NAME).setActiveActor(currentUser.id);
+ }
+ }
+}
+const resolvers = {
+ getActiveActorId
+};
+
+/***/ }),
+
+/***/ "./src/social-web/store/selectors.ts":
+/*!*******************************************!*\
+ !*** ./src/social-web/store/selectors.ts ***!
+ \*******************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ selectors: () => (/* binding */ selectors)
+/* harmony export */ });
+/**
+ * Internal dependencies
+ */
+
+/**
+ * Store selectors
+ */
+const selectors = {
+ getActiveActorId(state) {
+ return state.activeActorId;
+ }
+};
+
+/***/ }),
+
+/***/ "./src/social-web/store/types.ts":
+/*!***************************************!*\
+ !*** ./src/social-web/store/types.ts ***!
+ \***************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ DEFAULT_STATE: () => (/* binding */ DEFAULT_STATE),
+/* harmony export */ SET_ACTIVE_ACTOR: () => (/* binding */ SET_ACTIVE_ACTOR)
+/* harmony export */ });
+/**
+ * Store state interface
+ */
+
+/**
+ * Action Types
+ */
+const SET_ACTIVE_ACTOR = 'SET_ACTIVE_ACTOR';
+/**
+ * Initial state
+ */
+const DEFAULT_STATE = {
+ activeActorId: null
+};
+
+/***/ }),
+
+/***/ "./src/social-web/style.scss":
+/*!***********************************!*\
+ !*** ./src/social-web/style.scss ***!
+ \***********************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+// extracted by mini-css-extract-plugin
+
+
+/***/ }),
+
+/***/ "@wordpress/commands":
+/*!**********************************!*\
+ !*** external ["wp","commands"] ***!
+ \**********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["commands"];
+
+/***/ }),
+
+/***/ "@wordpress/components":
+/*!************************************!*\
+ !*** external ["wp","components"] ***!
+ \************************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["components"];
+
+/***/ }),
+
+/***/ "@wordpress/compose":
+/*!*********************************!*\
+ !*** external ["wp","compose"] ***!
+ \*********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["compose"];
+
+/***/ }),
+
+/***/ "@wordpress/core-data":
+/*!**********************************!*\
+ !*** external ["wp","coreData"] ***!
+ \**********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["coreData"];
+
+/***/ }),
+
+/***/ "@wordpress/data":
+/*!******************************!*\
+ !*** external ["wp","data"] ***!
+ \******************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["data"];
+
+/***/ }),
+
+/***/ "@wordpress/data-controls":
+/*!**************************************!*\
+ !*** external ["wp","dataControls"] ***!
+ \**************************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["dataControls"];
+
+/***/ }),
+
+/***/ "@wordpress/date":
+/*!******************************!*\
+ !*** external ["wp","date"] ***!
+ \******************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["date"];
+
+/***/ }),
+
+/***/ "@wordpress/dom":
+/*!*****************************!*\
+ !*** external ["wp","dom"] ***!
+ \*****************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["dom"];
+
+/***/ }),
+
+/***/ "@wordpress/element":
+/*!*********************************!*\
+ !*** external ["wp","element"] ***!
+ \*********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["element"];
+
+/***/ }),
+
+/***/ "@wordpress/html-entities":
+/*!**************************************!*\
+ !*** external ["wp","htmlEntities"] ***!
+ \**************************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["htmlEntities"];
+
+/***/ }),
+
+/***/ "@wordpress/i18n":
+/*!******************************!*\
+ !*** external ["wp","i18n"] ***!
+ \******************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["i18n"];
+
+/***/ }),
+
+/***/ "@wordpress/keyboard-shortcuts":
+/*!*******************************************!*\
+ !*** external ["wp","keyboardShortcuts"] ***!
+ \*******************************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["keyboardShortcuts"];
+
+/***/ }),
+
+/***/ "@wordpress/keycodes":
+/*!**********************************!*\
+ !*** external ["wp","keycodes"] ***!
+ \**********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["keycodes"];
+
+/***/ }),
+
+/***/ "@wordpress/notices":
+/*!*********************************!*\
+ !*** external ["wp","notices"] ***!
+ \*********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["notices"];
+
+/***/ }),
+
+/***/ "@wordpress/preferences":
+/*!*************************************!*\
+ !*** external ["wp","preferences"] ***!
+ \*************************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["preferences"];
+
+/***/ }),
+
+/***/ "@wordpress/primitives":
+/*!************************************!*\
+ !*** external ["wp","primitives"] ***!
+ \************************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["primitives"];
+
+/***/ }),
+
+/***/ "@wordpress/private-apis":
+/*!*************************************!*\
+ !*** external ["wp","privateApis"] ***!
+ \*************************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["privateApis"];
+
+/***/ }),
+
+/***/ "@wordpress/url":
+/*!*****************************!*\
+ !*** external ["wp","url"] ***!
+ \*****************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["url"];
+
+/***/ }),
+
+/***/ "@wordpress/warning":
+/*!*********************************!*\
+ !*** external ["wp","warning"] ***!
+ \*********************************/
+/***/ ((module) => {
+
+module.exports = window["wp"]["warning"];
+
+/***/ }),
+
+/***/ "react":
+/*!************************!*\
+ !*** external "React" ***!
+ \************************/
+/***/ ((module) => {
+
+module.exports = window["React"];
+
+/***/ }),
+
+/***/ "react-dom":
+/*!***************************!*\
+ !*** external "ReactDOM" ***!
+ \***************************/
+/***/ ((module) => {
+
+module.exports = window["ReactDOM"];
+
+/***/ }),
+
+/***/ "react/jsx-runtime":
+/*!**********************************!*\
+ !*** external "ReactJSXRuntime" ***!
+ \**********************************/
+/***/ ((module) => {
+
+module.exports = window["ReactJSXRuntime"];
+
+/***/ })
+
+/******/ });
+/************************************************************************/
+/******/ // The module cache
+/******/ var __webpack_module_cache__ = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/ // Check if module is in cache
+/******/ var cachedModule = __webpack_module_cache__[moduleId];
+/******/ if (cachedModule !== undefined) {
+/******/ return cachedModule.exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = __webpack_module_cache__[moduleId] = {
+/******/ // no module.id needed
+/******/ // no module.loaded needed
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = __webpack_modules__;
+/******/
+/************************************************************************/
+/******/ /* webpack/runtime/chunk loaded */
+/******/ (() => {
+/******/ var deferred = [];
+/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
+/******/ if(chunkIds) {
+/******/ priority = priority || 0;
+/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
+/******/ deferred[i] = [chunkIds, fn, priority];
+/******/ return;
+/******/ }
+/******/ var notFulfilled = Infinity;
+/******/ for (var i = 0; i < deferred.length; i++) {
+/******/ var [chunkIds, fn, priority] = deferred[i];
+/******/ var fulfilled = true;
+/******/ for (var j = 0; j < chunkIds.length; j++) {
+/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
+/******/ chunkIds.splice(j--, 1);
+/******/ } else {
+/******/ fulfilled = false;
+/******/ if(priority < notFulfilled) notFulfilled = priority;
+/******/ }
+/******/ }
+/******/ if(fulfilled) {
+/******/ deferred.splice(i--, 1)
+/******/ var r = fn();
+/******/ if (r !== undefined) result = r;
+/******/ }
+/******/ }
+/******/ return result;
+/******/ };
+/******/ })();
+/******/
+/******/ /* webpack/runtime/compat get default export */
+/******/ (() => {
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = (module) => {
+/******/ var getter = module && module.__esModule ?
+/******/ () => (module['default']) :
+/******/ () => (module);
+/******/ __webpack_require__.d(getter, { a: getter });
+/******/ return getter;
+/******/ };
+/******/ })();
+/******/
+/******/ /* webpack/runtime/create fake namespace object */
+/******/ (() => {
+/******/ 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
+/******/ // mode & 2: merge all properties of value into the ns
+/******/ // mode & 4: return value when already ns object
+/******/ // mode & 16: return value when it's Promise-like
+/******/ // mode & 8|1: behave like require
+/******/ __webpack_require__.t = function(value, mode) {
+/******/ if(mode & 1) value = this(value);
+/******/ if(mode & 8) return value;
+/******/ if(typeof value === 'object' && value) {
+/******/ if((mode & 4) && value.__esModule) return value;
+/******/ if((mode & 16) && typeof value.then === 'function') return value;
+/******/ }
+/******/ var ns = Object.create(null);
+/******/ __webpack_require__.r(ns);
+/******/ var def = {};
+/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
+/******/ for(var current = mode & 2 && value; (typeof current == 'object' || typeof current == 'function') && !~leafPrototypes.indexOf(current); current = getProto(current)) {
+/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
+/******/ }
+/******/ def['default'] = () => (value);
+/******/ __webpack_require__.d(ns, def);
+/******/ return ns;
+/******/ };
+/******/ })();
+/******/
+/******/ /* webpack/runtime/define property getters */
+/******/ (() => {
+/******/ // define getter functions for harmony exports
+/******/ __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/ensure chunk */
+/******/ (() => {
+/******/ __webpack_require__.f = {};
+/******/ // This file contains only the entry chunk.
+/******/ // The chunk loading function for additional chunks
+/******/ __webpack_require__.e = (chunkId) => {
+/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
+/******/ __webpack_require__.f[key](chunkId, promises);
+/******/ return promises;
+/******/ }, []));
+/******/ };
+/******/ })();
+/******/
+/******/ /* webpack/runtime/get javascript chunk filename */
+/******/ (() => {
+/******/ // This function allow to reference async chunks
+/******/ __webpack_require__.u = (chunkId) => {
+/******/ // return url for filenames not based on template
+/******/ if ({"social-web/feed-stage":1,"social-web/feed-inspector":1}[chunkId]) return "" + chunkId + ".js";
+/******/ // return url for filenames based on template
+/******/ return undefined;
+/******/ };
+/******/ })();
+/******/
+/******/ /* webpack/runtime/get mini-css chunk filename */
+/******/ (() => {
+/******/ // This function allow to reference async chunks
+/******/ __webpack_require__.miniCssF = (chunkId) => {
+/******/ // return url for filenames based on template
+/******/ return "" + chunkId + ".css";
+/******/ };
+/******/ })();
+/******/
+/******/ /* webpack/runtime/global */
+/******/ (() => {
+/******/ __webpack_require__.g = (function() {
+/******/ if (typeof globalThis === 'object') return globalThis;
+/******/ try {
+/******/ return this || new Function('return this')();
+/******/ } catch (e) {
+/******/ if (typeof window === 'object') return window;
+/******/ }
+/******/ })();
+/******/ })();
+/******/
+/******/ /* webpack/runtime/hasOwnProperty shorthand */
+/******/ (() => {
+/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
+/******/ })();
+/******/
+/******/ /* webpack/runtime/load script */
+/******/ (() => {
+/******/ var inProgress = {};
+/******/ var dataWebpackPrefix = "wordpress-activitypub:";
+/******/ // loadScript function to load a script via script tag
+/******/ __webpack_require__.l = (url, done, key, chunkId) => {
+/******/ if(inProgress[url]) { inProgress[url].push(done); return; }
+/******/ var script, needAttach;
+/******/ if(key !== undefined) {
+/******/ var scripts = document.getElementsByTagName("script");
+/******/ for(var i = 0; i < scripts.length; i++) {
+/******/ var s = scripts[i];
+/******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
+/******/ }
+/******/ }
+/******/ if(!script) {
+/******/ needAttach = true;
+/******/ script = document.createElement('script');
+/******/
+/******/ script.charset = 'utf-8';
+/******/ if (__webpack_require__.nc) {
+/******/ script.setAttribute("nonce", __webpack_require__.nc);
+/******/ }
+/******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
+/******/
+/******/ script.src = url;
+/******/ }
+/******/ inProgress[url] = [done];
+/******/ var onScriptComplete = (prev, event) => {
+/******/ // avoid mem leaks in IE.
+/******/ script.onerror = script.onload = null;
+/******/ clearTimeout(timeout);
+/******/ var doneFns = inProgress[url];
+/******/ delete inProgress[url];
+/******/ script.parentNode && script.parentNode.removeChild(script);
+/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
+/******/ if(prev) return prev(event);
+/******/ }
+/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
+/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
+/******/ script.onload = onScriptComplete.bind(null, script.onload);
+/******/ needAttach && document.head.appendChild(script);
+/******/ };
+/******/ })();
+/******/
+/******/ /* webpack/runtime/make namespace object */
+/******/ (() => {
+/******/ // define __esModule on 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/publicPath */
+/******/ (() => {
+/******/ var scriptUrl;
+/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
+/******/ var document = __webpack_require__.g.document;
+/******/ if (!scriptUrl && document) {
+/******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
+/******/ scriptUrl = document.currentScript.src;
+/******/ if (!scriptUrl) {
+/******/ var scripts = document.getElementsByTagName("script");
+/******/ if(scripts.length) {
+/******/ var i = scripts.length - 1;
+/******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
+/******/ }
+/******/ }
+/******/ }
+/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
+/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
+/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
+/******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
+/******/ __webpack_require__.p = scriptUrl + "../";
+/******/ })();
+/******/
+/******/ /* webpack/runtime/css loading */
+/******/ (() => {
+/******/ if (typeof document === "undefined") return;
+/******/ var createStylesheet = (chunkId, fullhref, oldTag, resolve, reject) => {
+/******/ var linkTag = document.createElement("link");
+/******/
+/******/ linkTag.rel = "stylesheet";
+/******/ linkTag.type = "text/css";
+/******/ if (__webpack_require__.nc) {
+/******/ linkTag.nonce = __webpack_require__.nc;
+/******/ }
+/******/ var onLinkComplete = (event) => {
+/******/ // avoid mem leaks.
+/******/ linkTag.onerror = linkTag.onload = null;
+/******/ if (event.type === 'load') {
+/******/ resolve();
+/******/ } else {
+/******/ var errorType = event && event.type;
+/******/ var realHref = event && event.target && event.target.href || fullhref;
+/******/ var err = new Error("Loading CSS chunk " + chunkId + " failed.\n(" + errorType + ": " + realHref + ")");
+/******/ err.name = "ChunkLoadError";
+/******/ err.code = "CSS_CHUNK_LOAD_FAILED";
+/******/ err.type = errorType;
+/******/ err.request = realHref;
+/******/ if (linkTag.parentNode) linkTag.parentNode.removeChild(linkTag)
+/******/ reject(err);
+/******/ }
+/******/ }
+/******/ linkTag.onerror = linkTag.onload = onLinkComplete;
+/******/ linkTag.href = fullhref;
+/******/
+/******/
+/******/ if (oldTag) {
+/******/ oldTag.parentNode.insertBefore(linkTag, oldTag.nextSibling);
+/******/ } else {
+/******/ document.head.appendChild(linkTag);
+/******/ }
+/******/ return linkTag;
+/******/ };
+/******/ var findStylesheet = (href, fullhref) => {
+/******/ var existingLinkTags = document.getElementsByTagName("link");
+/******/ for(var i = 0; i < existingLinkTags.length; i++) {
+/******/ var tag = existingLinkTags[i];
+/******/ var dataHref = tag.getAttribute("data-href") || tag.getAttribute("href");
+/******/ if(tag.rel === "stylesheet" && (dataHref === href || dataHref === fullhref)) return tag;
+/******/ }
+/******/ var existingStyleTags = document.getElementsByTagName("style");
+/******/ for(var i = 0; i < existingStyleTags.length; i++) {
+/******/ var tag = existingStyleTags[i];
+/******/ var dataHref = tag.getAttribute("data-href");
+/******/ if(dataHref === href || dataHref === fullhref) return tag;
+/******/ }
+/******/ };
+/******/ var loadStylesheet = (chunkId) => {
+/******/ return new Promise((resolve, reject) => {
+/******/ var href = __webpack_require__.miniCssF(chunkId);
+/******/ var fullhref = __webpack_require__.p + href;
+/******/ if(findStylesheet(href, fullhref)) return resolve();
+/******/ createStylesheet(chunkId, fullhref, null, resolve, reject);
+/******/ });
+/******/ }
+/******/ // object to store loaded CSS chunks
+/******/ var installedCssChunks = {
+/******/ "social-web/index": 0
+/******/ };
+/******/
+/******/ __webpack_require__.f.miniCss = (chunkId, promises) => {
+/******/ var cssChunks = {"social-web/style-feed-stage":1};
+/******/ if(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);
+/******/ else if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {
+/******/ promises.push(installedCssChunks[chunkId] = loadStylesheet(chunkId).then(() => {
+/******/ installedCssChunks[chunkId] = 0;
+/******/ }, (e) => {
+/******/ delete installedCssChunks[chunkId];
+/******/ throw e;
+/******/ }));
+/******/ }
+/******/ };
+/******/
+/******/ // no hmr
+/******/
+/******/ // no prefetching
+/******/
+/******/ // no preloaded
+/******/ })();
+/******/
+/******/ /* webpack/runtime/jsonp chunk loading */
+/******/ (() => {
+/******/ // no baseURI
+/******/
+/******/ // object to store loaded and loading chunks
+/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
+/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
+/******/ var installedChunks = {
+/******/ "social-web/index": 0,
+/******/ "social-web/style-index": 0
+/******/ };
+/******/
+/******/ __webpack_require__.f.j = (chunkId, promises) => {
+/******/ // JSONP chunk loading for javascript
+/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
+/******/ if(installedChunkData !== 0) { // 0 means "already installed".
+/******/
+/******/ // a Promise means "currently loading".
+/******/ if(installedChunkData) {
+/******/ promises.push(installedChunkData[2]);
+/******/ } else {
+/******/ if(!/^social\-web\/style\-(feed\-stage|index)$/.test(chunkId)) {
+/******/ // setup Promise in chunk cache
+/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
+/******/ promises.push(installedChunkData[2] = promise);
+/******/
+/******/ // start chunk loading
+/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
+/******/ // create error before stack unwound to get useful stacktrace later
+/******/ var error = new Error();
+/******/ var loadingEnded = (event) => {
+/******/ if(__webpack_require__.o(installedChunks, chunkId)) {
+/******/ installedChunkData = installedChunks[chunkId];
+/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
+/******/ if(installedChunkData) {
+/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
+/******/ var realSrc = event && event.target && event.target.src;
+/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
+/******/ error.name = 'ChunkLoadError';
+/******/ error.type = errorType;
+/******/ error.request = realSrc;
+/******/ installedChunkData[1](error);
+/******/ }
+/******/ }
+/******/ };
+/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
+/******/ } else installedChunks[chunkId] = 0;
+/******/ }
+/******/ }
+/******/ };
+/******/
+/******/ // no prefetching
+/******/
+/******/ // no preloaded
+/******/
+/******/ // no HMR
+/******/
+/******/ // no HMR manifest
+/******/
+/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
+/******/
+/******/ // install a JSONP callback for chunk loading
+/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
+/******/ var [chunkIds, moreModules, runtime] = data;
+/******/ // add "moreModules" to the modules object,
+/******/ // then flag all "chunkIds" as loaded and fire callback
+/******/ var moduleId, chunkId, i = 0;
+/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
+/******/ for(moduleId in moreModules) {
+/******/ if(__webpack_require__.o(moreModules, moduleId)) {
+/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
+/******/ }
+/******/ }
+/******/ if(runtime) var result = runtime(__webpack_require__);
+/******/ }
+/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
+/******/ for(;i < chunkIds.length; i++) {
+/******/ chunkId = chunkIds[i];
+/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
+/******/ installedChunks[chunkId][0]();
+/******/ }
+/******/ installedChunks[chunkId] = 0;
+/******/ }
+/******/ return __webpack_require__.O(result);
+/******/ }
+/******/
+/******/ var chunkLoadingGlobal = globalThis["webpackChunkwordpress_activitypub"] = globalThis["webpackChunkwordpress_activitypub"] || [];
+/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
+/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
+/******/ })();
+/******/
+/************************************************************************/
+/******/
+/******/ // startup
+/******/ // Load entry module and return exports
+/******/ // This entry module depends on other loaded chunks and execution need to be delayed
+/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["social-web/vendors","social-web/style-index"], () => (__webpack_require__("./src/social-web/index.tsx")))
+/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
+/******/
+/******/ })()
+;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/build/social-web/style-feed-stage-rtl.css b/build/social-web/style-feed-stage-rtl.css
index ee5d8e0ed5..0002636269 100644
--- a/build/social-web/style-feed-stage-rtl.css
+++ b/build/social-web/style-feed-stage-rtl.css
@@ -1,4 +1,354 @@
-.app-layout[data-section=feed] .inspector-region{width:50%}.dataviews-view-list .dataviews-view-list__item{cursor:pointer}.dataviews-view-list .dataviews-view-list__field{width:100%}.activitypub-feed-post{border-bottom:var(--wpds-border-width-control,1px) solid var(--wpds-color-stroke-neutral-weak,#dcdcde);max-width:100%;min-width:0}.activitypub-feed-post:last-child{border-bottom:none}.activitypub-feed-post-meta{align-items:center;color:var(--wpds-color-fg-secondary,#646970);display:flex;font-size:var(--wpds-font-size-small,13px);gap:var(--wpds-spacing-20,8px);margin-bottom:var(--wpds-spacing-30,12px)}.activitypub-feed-post-meta .activitypub-feed-avatar{background-color:var(--wpds-color-bg-neutral-weak,#f0f0f1);border-radius:50%;flex-shrink:0;height:var(--wpds-spacing-50,20px);-o-object-fit:cover;object-fit:cover;width:var(--wpds-spacing-50,20px)}.activitypub-feed-post-meta .author{color:var(--wpds-color-fg-primary,#1d2327);font-weight:var(--wpds-font-weight-medium,500)}.activitypub-feed-post-meta .separator{color:var(--wpds-color-fg-tertiary,#c3c4c7)}.activitypub-feed-post-meta .date{color:var(--wpds-color-fg-secondary,#646970)}.activitypub-feed-post-title{color:var(--wpds-color-fg-primary,#1d2327);font-size:inherit;font-weight:400;line-height:1.4;margin:0 0 var(--wpds-spacing-30,12px);max-width:100%;overflow-wrap:break-word;word-wrap:break-word}.activitypub-feed-post-title>*{margin:0}.activitypub-feed-excerpt{color:var(--wpds-color-fg-secondary,#50575e);font-size:var(--wpds-font-size-small,13px);line-height:1.6;margin-top:var(--wpds-spacing-15,6px);max-width:100%;overflow-wrap:break-word;word-wrap:break-word}.dataviews-view-list .activitypub-feed-post-title{font-size:1.3em;font-weight:var(--wpds-font-weight-semibold,600)}.activitypub-feed-content{color:var(--wpds-color-fg-primary,#2c3338);line-height:1.6;max-width:100%;min-width:0;overflow-wrap:break-word;word-wrap:break-word}.activitypub-feed-content>:first-child{margin-top:0}.activitypub-feed-content>:last-child{margin-bottom:0}.activitypub-feed-content img{border-radius:var(--wpds-border-radius-small,4px);height:auto;margin:var(--wpds-spacing-30,12px) 0;max-width:100%}.activitypub-feed-content img.alignleft{float:right;margin:0 0 var(--wpds-spacing-30,12px) var(--wpds-spacing-40,16px);max-width:50%}.activitypub-feed-content img.alignright{float:left;margin:0 var(--wpds-spacing-40,16px) var(--wpds-spacing-30,12px) 0;max-width:50%}.activitypub-feed-content img.aligncenter{display:block;margin-right:auto;margin-left:auto}.activitypub-feed-content:after{clear:both;content:"";display:table}.activitypub-inspector{height:100%;overflow:auto}.activitypub-inspector-loading{padding:var(--wpds-spacing-50,20px);text-align:center}.activitypub-inspector-card{background:transparent!important;border:none!important;border-radius:0!important;box-shadow:none!important;margin-bottom:var(--wpds-spacing-60,24px)!important;padding:0!important}.activitypub-inspector-card .components-card__header{border:none!important;border-bottom:var(--wpds-border-width-control,1px) solid var(--wpds-color-stroke-neutral-weak,#dcdcde)!important;border-radius:0!important;padding:var(--wpds-spacing-60,24px) var(--wpds-spacing-60,24px) var(--wpds-spacing-40,16px)!important}.activitypub-inspector-card .components-card__body{padding:var(--wpds-spacing-40,16px) var(--wpds-spacing-60,24px) 0!important}.activitypub-inspector-comments-card{border-top:var(--wpds-border-width-control,1px) solid var(--wpds-color-stroke-neutral-weak,#dcdcde)!important;margin-top:var(--wpds-spacing-60,24px)!important;padding-top:var(--wpds-spacing-60,24px)!important}.activitypub-inspector-comments-card .components-card__header{border-bottom:none!important;font-size:var(--wpds-font-size-medium,16px);font-weight:var(--wpds-font-weight-semibold,600);padding-bottom:var(--wpds-spacing-30,12px)!important}.activitypub-inspector-header{align-items:center;display:flex;gap:var(--wpds-spacing-30,12px);width:100%}.activitypub-inspector-close{flex-shrink:0;margin-right:auto}.activitypub-inspector-avatar{background-color:var(--wpds-color-bg-neutral-weak,#f0f0f1);border-radius:50%;flex-shrink:0;height:var(--wpds-spacing-120,48px);-o-object-fit:cover;object-fit:cover;width:var(--wpds-spacing-120,48px)}.activitypub-inspector-author{display:flex;flex-direction:column;gap:var(--wpds-spacing-10,4px)}.activitypub-inspector-author-name{color:var(--wpds-color-fg-primary,#1d2327);font-size:var(--wpds-font-size-small,14px);font-weight:var(--wpds-font-weight-semibold,600);text-decoration:none}.activitypub-inspector-author-name:hover{color:var(--wpds-color-fg-brand,#135e96);text-decoration:underline}.activitypub-inspector-meta{align-items:center;display:flex;font-size:var(--wpds-font-size-small,13px);gap:var(--wpds-spacing-15,6px)}.activitypub-inspector-webfinger{color:var(--wpds-color-fg-secondary,#646970)}.activitypub-inspector-separator{color:var(--wpds-color-fg-tertiary,#c3c4c7)}.activitypub-inspector-timestamp{color:var(--wpds-color-fg-secondary,#646970);text-decoration:none}.activitypub-inspector-timestamp:hover{color:var(--wpds-color-fg-brand,#135e96);text-decoration:underline}.activitypub-inspector-card .components-card__body h2{color:var(--wpds-color-fg-primary,#1d2327);font-size:var(--wpds-font-size-large,20px);font-weight:var(--wpds-font-weight-semibold,600);line-height:1.4;margin:0 0 var(--wpds-spacing-40,16px)}.activitypub-inspector-card .components-card__body>div{color:var(--wpds-color-fg-primary,#2c3338);line-height:1.6;margin-bottom:var(--wpds-spacing-40,16px)}.activitypub-inspector-card .components-card__body>div img{height:auto;max-width:100%}.activitypub-inspector-card .components-card__body>div a{color:var(--wpds-color-fg-brand,#135e96);text-decoration:none;word-wrap:break-word;overflow-wrap:break-word}.activitypub-inspector-card .components-card__body>div a:hover{text-decoration:underline}.activitypub-inspector-card .components-card__body>div a .invisible{display:none}.activitypub-inspector-card .components-card__body>div a .ellipsis:after{content:"…"}.activitypub-inspector-link{margin-top:var(--wpds-spacing-40,16px)}.activitypub-inspector-comment{border-bottom:var(--wpds-border-width-control,1px) solid var(--wpds-color-stroke-neutral-weak,#f0f0f1);margin-bottom:var(--wpds-spacing-50,20px);padding-bottom:var(--wpds-spacing-50,20px)}.activitypub-inspector-comment:last-child{border-bottom:none;margin-bottom:0;padding-bottom:0}.activitypub-inspector-comment-meta{margin-bottom:var(--wpds-spacing-20,8px)}.activitypub-inspector-comment-meta strong{color:var(--wpds-color-fg-primary,#1d2327);font-size:var(--wpds-font-size-small,14px)}.activitypub-inspector-comment-date{color:var(--wpds-color-fg-secondary,#646970);font-size:var(--wpds-font-size-small,13px);margin-right:var(--wpds-spacing-20,8px)}
-.page{display:flex;flex-direction:column;height:100%;min-width:0}.header{flex-shrink:0;padding:var(--wpds-spacing-60,24px)}.header.has-border{border-bottom:var(--wpds-border-width-focus,1px) solid var(--wpds-color-stroke-surface-neutral,#ddd)}.title-row{gap:var(--wpds-spacing-40,16px);justify-content:space-between}.title-group,.title-row{align-items:center;display:flex}.title-group{gap:var(--wpds-spacing-30,12px)}.title{color:var(--wpds-color-fg-primary,#1e1e1e);font-size:var(--wpds-font-size-large,20px);font-weight:500;margin:0}.sub-title{color:var(--wpds-color-fg-secondary,#757575);font-size:var(--wpds-font-size-small,13px);margin:var(--wpds-spacing-20,8px) 0 0}.content{display:flex;flex:1;flex-direction:column;gap:var(--wpds-spacing-60,24px);overflow:auto}.content.padded{padding:var(--wpds-spacing-60,24px)}.content.constrained{margin:0 auto;max-width:960px;width:100%}.content.full{padding:0}
-.dataviews-view-table .activitypub-avatar-field__image{height:32px;width:32px}
-.activitypub-mutual{background:#dcdcde;border-radius:3px;color:#50575e;display:inline-block;font-size:11px;font-weight:600;padding:2px 8px;text-transform:uppercase}
+/*!**************************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/routes/feed/style.scss ***!
+ \**************************************************************************************************************************************************************************************************************************************************************/
+@charset "UTF-8";
+/**
+ * Feed view styles
+ * Minimal styling - relies on WordPress/DataViews defaults
+ */
+.app-layout[data-section=feed] .inspector-region {
+ width: 50%;
+}
+.dataviews-footer:empty {
+ border: 0;
+ padding: 0;
+}
+.dataviews-view-list .dataviews-view-list__item {
+ cursor: pointer;
+}
+.dataviews-view-list .dataviews-view-list__field {
+ width: 100%;
+}
+.activitypub-feed-post {
+ border-bottom: var(--wpds-border-width-control, 1px) solid var(--wpds-color-stroke-neutral-weak, #dcdcde);
+ min-width: 0;
+ max-width: 100%;
+}
+.activitypub-feed-post:last-child {
+ border-bottom: none;
+}
+.activitypub-feed-post-meta {
+ display: flex;
+ align-items: center;
+ gap: var(--wpds-spacing-20, 8px);
+ margin-bottom: var(--wpds-spacing-30, 12px);
+ font-size: var(--wpds-font-size-small, 13px);
+ color: var(--wpds-color-fg-secondary, #646970);
+}
+.activitypub-feed-post-meta .activitypub-feed-avatar {
+ width: var(--wpds-spacing-50, 20px);
+ height: var(--wpds-spacing-50, 20px);
+ border-radius: 50%;
+ -o-object-fit: cover;
+ object-fit: cover;
+ background-color: var(--wpds-color-bg-neutral-weak, #f0f0f1);
+ flex-shrink: 0;
+}
+.activitypub-feed-post-meta .author {
+ font-weight: var(--wpds-font-weight-medium, 500);
+ color: var(--wpds-color-fg-primary, #1d2327);
+}
+.activitypub-feed-post-meta .separator {
+ color: var(--wpds-color-fg-tertiary, #c3c4c7);
+}
+.activitypub-feed-post-meta .date {
+ color: var(--wpds-color-fg-secondary, #646970);
+}
+.activitypub-feed-post-title {
+ margin: 0 0 var(--wpds-spacing-30, 12px);
+ font-size: inherit;
+ font-weight: normal;
+ line-height: 1.4;
+ color: var(--wpds-color-fg-primary, #1d2327);
+ max-width: 100%;
+ overflow-wrap: break-word;
+ word-wrap: break-word;
+}
+.activitypub-feed-post-title > * {
+ margin: 0;
+}
+.activitypub-feed-excerpt {
+ color: var(--wpds-color-fg-secondary, #50575e);
+ font-size: var(--wpds-font-size-small, 13px);
+ line-height: 1.6;
+ margin-top: var(--wpds-spacing-15, 6px);
+ max-width: 100%;
+ overflow-wrap: break-word;
+ word-wrap: break-word;
+}
+.dataviews-view-list .activitypub-feed-post-title {
+ font-size: 1.3em;
+ font-weight: var(--wpds-font-weight-semibold, 600);
+}
+.activitypub-feed-content {
+ line-height: 1.6;
+ color: var(--wpds-color-fg-primary, #2c3338);
+ min-width: 0;
+ max-width: 100%;
+ overflow-wrap: break-word;
+ word-wrap: break-word;
+}
+.activitypub-feed-content > *:first-child {
+ margin-top: 0;
+}
+.activitypub-feed-content > *:last-child {
+ margin-bottom: 0;
+}
+.activitypub-feed-content img {
+ max-width: 100%;
+ height: auto;
+ border-radius: var(--wpds-border-radius-small, 4px);
+ margin: var(--wpds-spacing-30, 12px) 0;
+}
+.activitypub-feed-content img.alignleft {
+ float: right;
+ margin: 0 0 var(--wpds-spacing-30, 12px) var(--wpds-spacing-40, 16px);
+ max-width: 50%;
+}
+.activitypub-feed-content img.alignright {
+ float: left;
+ margin: 0 var(--wpds-spacing-40, 16px) var(--wpds-spacing-30, 12px) 0;
+ max-width: 50%;
+}
+.activitypub-feed-content img.aligncenter {
+ display: block;
+ margin-right: auto;
+ margin-left: auto;
+}
+.activitypub-feed-content::after {
+ content: "";
+ display: table;
+ clear: both;
+}
+.activitypub-inspector {
+ height: 100%;
+ overflow: auto;
+}
+.activitypub-inspector-loading {
+ padding: var(--wpds-spacing-50, 20px);
+ text-align: center;
+}
+.activitypub-inspector-card {
+ border: none !important;
+ border-radius: 0 !important;
+ box-shadow: none !important;
+ background: transparent !important;
+ padding: 0 !important;
+ margin-bottom: var(--wpds-spacing-60, 24px) !important;
+}
+.activitypub-inspector-card .components-card__header {
+ border: none !important;
+ border-radius: 0 !important;
+ padding: var(--wpds-spacing-60, 24px) var(--wpds-spacing-60, 24px) var(--wpds-spacing-40, 16px) !important;
+ border-bottom: var(--wpds-border-width-control, 1px) solid var(--wpds-color-stroke-neutral-weak, #dcdcde) !important;
+}
+.activitypub-inspector-card .components-card__body {
+ padding: var(--wpds-spacing-40, 16px) var(--wpds-spacing-60, 24px) 0 !important;
+}
+.activitypub-inspector-comments-card {
+ margin-top: var(--wpds-spacing-60, 24px) !important;
+ padding-top: var(--wpds-spacing-60, 24px) !important;
+ border-top: var(--wpds-border-width-control, 1px) solid var(--wpds-color-stroke-neutral-weak, #dcdcde) !important;
+}
+.activitypub-inspector-comments-card .components-card__header {
+ border-bottom: none !important;
+ padding-bottom: var(--wpds-spacing-30, 12px) !important;
+ font-size: var(--wpds-font-size-medium, 16px);
+ font-weight: var(--wpds-font-weight-semibold, 600);
+}
+.activitypub-inspector-header {
+ display: flex;
+ align-items: center;
+ gap: var(--wpds-spacing-30, 12px);
+ width: 100%;
+}
+.activitypub-inspector-close {
+ margin-right: auto;
+ flex-shrink: 0;
+}
+.activitypub-inspector-avatar {
+ width: var(--wpds-spacing-120, 48px);
+ height: var(--wpds-spacing-120, 48px);
+ border-radius: 50%;
+ -o-object-fit: cover;
+ object-fit: cover;
+ background-color: var(--wpds-color-bg-neutral-weak, #f0f0f1);
+ flex-shrink: 0;
+}
+.activitypub-inspector-author {
+ display: flex;
+ flex-direction: column;
+ gap: var(--wpds-spacing-10, 4px);
+}
+.activitypub-inspector-author-name {
+ font-size: var(--wpds-font-size-small, 14px);
+ font-weight: var(--wpds-font-weight-semibold, 600);
+ color: var(--wpds-color-fg-primary, #1d2327);
+ text-decoration: none;
+}
+.activitypub-inspector-author-name:hover {
+ color: var(--wpds-color-fg-brand, #135e96);
+ text-decoration: underline;
+}
+.activitypub-inspector-meta {
+ display: flex;
+ align-items: center;
+ gap: var(--wpds-spacing-15, 6px);
+ font-size: var(--wpds-font-size-small, 13px);
+}
+.activitypub-inspector-webfinger {
+ color: var(--wpds-color-fg-secondary, #646970);
+}
+.activitypub-inspector-separator {
+ color: var(--wpds-color-fg-tertiary, #c3c4c7);
+}
+.activitypub-inspector-timestamp {
+ color: var(--wpds-color-fg-secondary, #646970);
+ text-decoration: none;
+}
+.activitypub-inspector-timestamp:hover {
+ color: var(--wpds-color-fg-brand, #135e96);
+ text-decoration: underline;
+}
+.activitypub-inspector-card .components-card__body h2 {
+ margin: 0 0 var(--wpds-spacing-40, 16px);
+ font-size: var(--wpds-font-size-large, 20px);
+ font-weight: var(--wpds-font-weight-semibold, 600);
+ line-height: 1.4;
+ color: var(--wpds-color-fg-primary, #1d2327);
+}
+.activitypub-inspector-card .components-card__body > div {
+ line-height: 1.6;
+ color: var(--wpds-color-fg-primary, #2c3338);
+ margin-bottom: var(--wpds-spacing-40, 16px);
+}
+.activitypub-inspector-card .components-card__body > div img {
+ max-width: 100%;
+ height: auto;
+}
+.activitypub-inspector-card .components-card__body > div a {
+ color: var(--wpds-color-fg-brand, #135e96);
+ text-decoration: none;
+ word-wrap: break-word;
+ overflow-wrap: break-word;
+}
+.activitypub-inspector-card .components-card__body > div a:hover {
+ text-decoration: underline;
+}
+.activitypub-inspector-card .components-card__body > div a .invisible {
+ display: none;
+}
+.activitypub-inspector-card .components-card__body > div a .ellipsis::after {
+ content: "…";
+}
+.activitypub-inspector-link {
+ margin-top: var(--wpds-spacing-40, 16px);
+}
+.activitypub-inspector-comment {
+ margin-bottom: var(--wpds-spacing-50, 20px);
+ padding-bottom: var(--wpds-spacing-50, 20px);
+ border-bottom: var(--wpds-border-width-control, 1px) solid var(--wpds-color-stroke-neutral-weak, #f0f0f1);
+}
+.activitypub-inspector-comment:last-child {
+ border-bottom: none;
+ margin-bottom: 0;
+ padding-bottom: 0;
+}
+.activitypub-inspector-comment-meta {
+ margin-bottom: var(--wpds-spacing-20, 8px);
+}
+.activitypub-inspector-comment-meta strong {
+ font-size: var(--wpds-font-size-small, 14px);
+ color: var(--wpds-color-fg-primary, #1d2327);
+}
+.activitypub-inspector-comment-date {
+ margin-right: var(--wpds-spacing-20, 8px);
+ font-size: var(--wpds-font-size-small, 13px);
+ color: var(--wpds-color-fg-secondary, #646970);
+}
+/*!******************************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/page/style.scss ***!
+ \******************************************************************************************************************************************************************************************************************************************************************/
+.page {
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+ min-width: 0;
+}
+
+.header {
+ padding: var(--wpds-spacing-60, 24px);
+ flex-shrink: 0;
+}
+
+.header.has-border {
+ border-bottom: var(--wpds-border-width-focus, 1px) solid var(--wpds-color-stroke-surface-neutral, #ddd);
+}
+
+.title-row {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: var(--wpds-spacing-40, 16px);
+}
+
+.title-group {
+ display: flex;
+ align-items: center;
+ gap: var(--wpds-spacing-30, 12px);
+}
+
+.title {
+ margin: 0;
+ font-size: var(--wpds-font-size-large, 20px);
+ font-weight: 500;
+ color: var(--wpds-color-fg-primary, #1e1e1e);
+}
+
+.sub-title {
+ margin: var(--wpds-spacing-20, 8px) 0 0;
+ color: var(--wpds-color-fg-secondary, #757575);
+ font-size: var(--wpds-font-size-small, 13px);
+}
+
+.content {
+ flex: 1;
+ overflow: auto;
+ display: flex;
+ flex-direction: column;
+ gap: var(--wpds-spacing-60, 24px);
+}
+
+.content.padded {
+ padding: var(--wpds-spacing-60, 24px);
+}
+
+.content.constrained {
+ max-width: 960px;
+ margin: 0 auto;
+ width: 100%;
+}
+
+.content.full {
+ padding: 0;
+}
+/*!***************************************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/fields/avatar/style.scss ***!
+ \***************************************************************************************************************************************************************************************************************************************************************************/
+.dataviews-view-table .activitypub-avatar-field__image {
+ height: 32px;
+ width: 32px;
+}
+/*!**********************************************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/fields/follow-status/style.scss ***!
+ \**********************************************************************************************************************************************************************************************************************************************************************************/
+.activitypub-mutual {
+ display: inline-block;
+ padding: 2px 8px;
+ background: #dcdcde;
+ border-radius: 3px;
+ font-size: 11px;
+ font-weight: 600;
+ text-transform: uppercase;
+ color: #50575e;
+}
diff --git a/build/social-web/style-feed-stage.css b/build/social-web/style-feed-stage.css
index 34dfaa8e46..b68892ad3e 100644
--- a/build/social-web/style-feed-stage.css
+++ b/build/social-web/style-feed-stage.css
@@ -1,4 +1,356 @@
-.app-layout[data-section=feed] .inspector-region{width:50%}.dataviews-view-list .dataviews-view-list__item{cursor:pointer}.dataviews-view-list .dataviews-view-list__field{width:100%}.activitypub-feed-post{border-bottom:var(--wpds-border-width-control,1px) solid var(--wpds-color-stroke-neutral-weak,#dcdcde);max-width:100%;min-width:0}.activitypub-feed-post:last-child{border-bottom:none}.activitypub-feed-post-meta{align-items:center;color:var(--wpds-color-fg-secondary,#646970);display:flex;font-size:var(--wpds-font-size-small,13px);gap:var(--wpds-spacing-20,8px);margin-bottom:var(--wpds-spacing-30,12px)}.activitypub-feed-post-meta .activitypub-feed-avatar{background-color:var(--wpds-color-bg-neutral-weak,#f0f0f1);border-radius:50%;flex-shrink:0;height:var(--wpds-spacing-50,20px);-o-object-fit:cover;object-fit:cover;width:var(--wpds-spacing-50,20px)}.activitypub-feed-post-meta .author{color:var(--wpds-color-fg-primary,#1d2327);font-weight:var(--wpds-font-weight-medium,500)}.activitypub-feed-post-meta .separator{color:var(--wpds-color-fg-tertiary,#c3c4c7)}.activitypub-feed-post-meta .date{color:var(--wpds-color-fg-secondary,#646970)}.activitypub-feed-post-title{color:var(--wpds-color-fg-primary,#1d2327);font-size:inherit;font-weight:400;line-height:1.4;margin:0 0 var(--wpds-spacing-30,12px);max-width:100%;overflow-wrap:break-word;word-wrap:break-word}.activitypub-feed-post-title>*{margin:0}.activitypub-feed-excerpt{color:var(--wpds-color-fg-secondary,#50575e);font-size:var(--wpds-font-size-small,13px);line-height:1.6;margin-top:var(--wpds-spacing-15,6px);max-width:100%;overflow-wrap:break-word;word-wrap:break-word}.dataviews-view-list .activitypub-feed-post-title{font-size:1.3em;font-weight:var(--wpds-font-weight-semibold,600)}.activitypub-feed-content{color:var(--wpds-color-fg-primary,#2c3338);line-height:1.6;max-width:100%;min-width:0;overflow-wrap:break-word;word-wrap:break-word}.activitypub-feed-content>:first-child{margin-top:0}.activitypub-feed-content>:last-child{margin-bottom:0}.activitypub-feed-content img{border-radius:var(--wpds-border-radius-small,4px);height:auto;margin:var(--wpds-spacing-30,12px) 0;max-width:100%}.activitypub-feed-content img.alignleft{float:left;margin:0 var(--wpds-spacing-40,16px) var(--wpds-spacing-30,12px) 0;max-width:50%}.activitypub-feed-content img.alignright{float:right;margin:0 0 var(--wpds-spacing-30,12px) var(--wpds-spacing-40,16px);max-width:50%}.activitypub-feed-content img.aligncenter{display:block;margin-left:auto;margin-right:auto}.activitypub-feed-content:after{clear:both;content:"";display:table}.activitypub-inspector{height:100%;overflow:auto}.activitypub-inspector-loading{padding:var(--wpds-spacing-50,20px);text-align:center}.activitypub-inspector-card{background:transparent!important;border:none!important;border-radius:0!important;box-shadow:none!important;margin-bottom:var(--wpds-spacing-60,24px)!important;padding:0!important}.activitypub-inspector-card .components-card__header{border:none!important;border-bottom:var(--wpds-border-width-control,1px) solid var(--wpds-color-stroke-neutral-weak,#dcdcde)!important;border-radius:0!important;padding:var(--wpds-spacing-60,24px) var(--wpds-spacing-60,24px) var(--wpds-spacing-40,16px)!important}.activitypub-inspector-card .components-card__body{padding:var(--wpds-spacing-40,16px) var(--wpds-spacing-60,24px) 0!important}.activitypub-inspector-comments-card{border-top:var(--wpds-border-width-control,1px) solid var(--wpds-color-stroke-neutral-weak,#dcdcde)!important;margin-top:var(--wpds-spacing-60,24px)!important;padding-top:var(--wpds-spacing-60,24px)!important}.activitypub-inspector-comments-card .components-card__header{border-bottom:none!important;font-size:var(--wpds-font-size-medium,16px);font-weight:var(--wpds-font-weight-semibold,600);padding-bottom:var(--wpds-spacing-30,12px)!important}.activitypub-inspector-header{align-items:center;display:flex;gap:var(--wpds-spacing-30,12px);width:100%}.activitypub-inspector-close{flex-shrink:0;margin-left:auto}.activitypub-inspector-avatar{background-color:var(--wpds-color-bg-neutral-weak,#f0f0f1);border-radius:50%;flex-shrink:0;height:var(--wpds-spacing-120,48px);-o-object-fit:cover;object-fit:cover;width:var(--wpds-spacing-120,48px)}.activitypub-inspector-author{display:flex;flex-direction:column;gap:var(--wpds-spacing-10,4px)}.activitypub-inspector-author-name{color:var(--wpds-color-fg-primary,#1d2327);font-size:var(--wpds-font-size-small,14px);font-weight:var(--wpds-font-weight-semibold,600);text-decoration:none}.activitypub-inspector-author-name:hover{color:var(--wpds-color-fg-brand,#135e96);text-decoration:underline}.activitypub-inspector-meta{align-items:center;display:flex;font-size:var(--wpds-font-size-small,13px);gap:var(--wpds-spacing-15,6px)}.activitypub-inspector-webfinger{color:var(--wpds-color-fg-secondary,#646970)}.activitypub-inspector-separator{color:var(--wpds-color-fg-tertiary,#c3c4c7)}.activitypub-inspector-timestamp{color:var(--wpds-color-fg-secondary,#646970);text-decoration:none}.activitypub-inspector-timestamp:hover{color:var(--wpds-color-fg-brand,#135e96);text-decoration:underline}.activitypub-inspector-card .components-card__body h2{color:var(--wpds-color-fg-primary,#1d2327);font-size:var(--wpds-font-size-large,20px);font-weight:var(--wpds-font-weight-semibold,600);line-height:1.4;margin:0 0 var(--wpds-spacing-40,16px)}.activitypub-inspector-card .components-card__body>div{color:var(--wpds-color-fg-primary,#2c3338);line-height:1.6;margin-bottom:var(--wpds-spacing-40,16px)}.activitypub-inspector-card .components-card__body>div img{height:auto;max-width:100%}.activitypub-inspector-card .components-card__body>div a{color:var(--wpds-color-fg-brand,#135e96);text-decoration:none;word-wrap:break-word;overflow-wrap:break-word}.activitypub-inspector-card .components-card__body>div a:hover{text-decoration:underline}.activitypub-inspector-card .components-card__body>div a .invisible{display:none}.activitypub-inspector-card .components-card__body>div a .ellipsis:after{content:"…"}.activitypub-inspector-link{margin-top:var(--wpds-spacing-40,16px)}.activitypub-inspector-comment{border-bottom:var(--wpds-border-width-control,1px) solid var(--wpds-color-stroke-neutral-weak,#f0f0f1);margin-bottom:var(--wpds-spacing-50,20px);padding-bottom:var(--wpds-spacing-50,20px)}.activitypub-inspector-comment:last-child{border-bottom:none;margin-bottom:0;padding-bottom:0}.activitypub-inspector-comment-meta{margin-bottom:var(--wpds-spacing-20,8px)}.activitypub-inspector-comment-meta strong{color:var(--wpds-color-fg-primary,#1d2327);font-size:var(--wpds-font-size-small,14px)}.activitypub-inspector-comment-date{color:var(--wpds-color-fg-secondary,#646970);font-size:var(--wpds-font-size-small,13px);margin-left:var(--wpds-spacing-20,8px)}
-.page{display:flex;flex-direction:column;height:100%;min-width:0}.header{flex-shrink:0;padding:var(--wpds-spacing-60,24px)}.header.has-border{border-bottom:var(--wpds-border-width-focus,1px) solid var(--wpds-color-stroke-surface-neutral,#ddd)}.title-row{gap:var(--wpds-spacing-40,16px);justify-content:space-between}.title-group,.title-row{align-items:center;display:flex}.title-group{gap:var(--wpds-spacing-30,12px)}.title{color:var(--wpds-color-fg-primary,#1e1e1e);font-size:var(--wpds-font-size-large,20px);font-weight:500;margin:0}.sub-title{color:var(--wpds-color-fg-secondary,#757575);font-size:var(--wpds-font-size-small,13px);margin:var(--wpds-spacing-20,8px) 0 0}.content{display:flex;flex:1;flex-direction:column;gap:var(--wpds-spacing-60,24px);overflow:auto}.content.padded{padding:var(--wpds-spacing-60,24px)}.content.constrained{margin:0 auto;max-width:960px;width:100%}.content.full{padding:0}
-.dataviews-view-table .activitypub-avatar-field__image{height:32px;width:32px}
-.activitypub-mutual{background:#dcdcde;border-radius:3px;color:#50575e;display:inline-block;font-size:11px;font-weight:600;padding:2px 8px;text-transform:uppercase}
+/*!**************************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/routes/feed/style.scss ***!
+ \**************************************************************************************************************************************************************************************************************************************************************/
+@charset "UTF-8";
+/**
+ * Feed view styles
+ * Minimal styling - relies on WordPress/DataViews defaults
+ */
+.app-layout[data-section=feed] .inspector-region {
+ width: 50%;
+}
+.dataviews-footer:empty {
+ border: 0;
+ padding: 0;
+}
+.dataviews-view-list .dataviews-view-list__item {
+ cursor: pointer;
+}
+.dataviews-view-list .dataviews-view-list__field {
+ width: 100%;
+}
+.activitypub-feed-post {
+ border-bottom: var(--wpds-border-width-control, 1px) solid var(--wpds-color-stroke-neutral-weak, #dcdcde);
+ min-width: 0;
+ max-width: 100%;
+}
+.activitypub-feed-post:last-child {
+ border-bottom: none;
+}
+.activitypub-feed-post-meta {
+ display: flex;
+ align-items: center;
+ gap: var(--wpds-spacing-20, 8px);
+ margin-bottom: var(--wpds-spacing-30, 12px);
+ font-size: var(--wpds-font-size-small, 13px);
+ color: var(--wpds-color-fg-secondary, #646970);
+}
+.activitypub-feed-post-meta .activitypub-feed-avatar {
+ width: var(--wpds-spacing-50, 20px);
+ height: var(--wpds-spacing-50, 20px);
+ border-radius: 50%;
+ -o-object-fit: cover;
+ object-fit: cover;
+ background-color: var(--wpds-color-bg-neutral-weak, #f0f0f1);
+ flex-shrink: 0;
+}
+.activitypub-feed-post-meta .author {
+ font-weight: var(--wpds-font-weight-medium, 500);
+ color: var(--wpds-color-fg-primary, #1d2327);
+}
+.activitypub-feed-post-meta .separator {
+ color: var(--wpds-color-fg-tertiary, #c3c4c7);
+}
+.activitypub-feed-post-meta .date {
+ color: var(--wpds-color-fg-secondary, #646970);
+}
+.activitypub-feed-post-title {
+ margin: 0 0 var(--wpds-spacing-30, 12px);
+ font-size: inherit;
+ font-weight: normal;
+ line-height: 1.4;
+ color: var(--wpds-color-fg-primary, #1d2327);
+ max-width: 100%;
+ overflow-wrap: break-word;
+ word-wrap: break-word;
+}
+.activitypub-feed-post-title > * {
+ margin: 0;
+}
+.activitypub-feed-excerpt {
+ color: var(--wpds-color-fg-secondary, #50575e);
+ font-size: var(--wpds-font-size-small, 13px);
+ line-height: 1.6;
+ margin-top: var(--wpds-spacing-15, 6px);
+ max-width: 100%;
+ overflow-wrap: break-word;
+ word-wrap: break-word;
+}
+.dataviews-view-list .activitypub-feed-post-title {
+ font-size: 1.3em;
+ font-weight: var(--wpds-font-weight-semibold, 600);
+}
+.activitypub-feed-content {
+ line-height: 1.6;
+ color: var(--wpds-color-fg-primary, #2c3338);
+ min-width: 0;
+ max-width: 100%;
+ overflow-wrap: break-word;
+ word-wrap: break-word;
+}
+.activitypub-feed-content > *:first-child {
+ margin-top: 0;
+}
+.activitypub-feed-content > *:last-child {
+ margin-bottom: 0;
+}
+.activitypub-feed-content img {
+ max-width: 100%;
+ height: auto;
+ border-radius: var(--wpds-border-radius-small, 4px);
+ margin: var(--wpds-spacing-30, 12px) 0;
+}
+.activitypub-feed-content img.alignleft {
+ float: left;
+ margin: 0 var(--wpds-spacing-40, 16px) var(--wpds-spacing-30, 12px) 0;
+ max-width: 50%;
+}
+.activitypub-feed-content img.alignright {
+ float: right;
+ margin: 0 0 var(--wpds-spacing-30, 12px) var(--wpds-spacing-40, 16px);
+ max-width: 50%;
+}
+.activitypub-feed-content img.aligncenter {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+.activitypub-feed-content::after {
+ content: "";
+ display: table;
+ clear: both;
+}
+.activitypub-inspector {
+ height: 100%;
+ overflow: auto;
+}
+.activitypub-inspector-loading {
+ padding: var(--wpds-spacing-50, 20px);
+ text-align: center;
+}
+.activitypub-inspector-card {
+ border: none !important;
+ border-radius: 0 !important;
+ box-shadow: none !important;
+ background: transparent !important;
+ padding: 0 !important;
+ margin-bottom: var(--wpds-spacing-60, 24px) !important;
+}
+.activitypub-inspector-card .components-card__header {
+ border: none !important;
+ border-radius: 0 !important;
+ padding: var(--wpds-spacing-60, 24px) var(--wpds-spacing-60, 24px) var(--wpds-spacing-40, 16px) !important;
+ border-bottom: var(--wpds-border-width-control, 1px) solid var(--wpds-color-stroke-neutral-weak, #dcdcde) !important;
+}
+.activitypub-inspector-card .components-card__body {
+ padding: var(--wpds-spacing-40, 16px) var(--wpds-spacing-60, 24px) 0 !important;
+}
+.activitypub-inspector-comments-card {
+ margin-top: var(--wpds-spacing-60, 24px) !important;
+ padding-top: var(--wpds-spacing-60, 24px) !important;
+ border-top: var(--wpds-border-width-control, 1px) solid var(--wpds-color-stroke-neutral-weak, #dcdcde) !important;
+}
+.activitypub-inspector-comments-card .components-card__header {
+ border-bottom: none !important;
+ padding-bottom: var(--wpds-spacing-30, 12px) !important;
+ font-size: var(--wpds-font-size-medium, 16px);
+ font-weight: var(--wpds-font-weight-semibold, 600);
+}
+.activitypub-inspector-header {
+ display: flex;
+ align-items: center;
+ gap: var(--wpds-spacing-30, 12px);
+ width: 100%;
+}
+.activitypub-inspector-close {
+ margin-left: auto;
+ flex-shrink: 0;
+}
+.activitypub-inspector-avatar {
+ width: var(--wpds-spacing-120, 48px);
+ height: var(--wpds-spacing-120, 48px);
+ border-radius: 50%;
+ -o-object-fit: cover;
+ object-fit: cover;
+ background-color: var(--wpds-color-bg-neutral-weak, #f0f0f1);
+ flex-shrink: 0;
+}
+.activitypub-inspector-author {
+ display: flex;
+ flex-direction: column;
+ gap: var(--wpds-spacing-10, 4px);
+}
+.activitypub-inspector-author-name {
+ font-size: var(--wpds-font-size-small, 14px);
+ font-weight: var(--wpds-font-weight-semibold, 600);
+ color: var(--wpds-color-fg-primary, #1d2327);
+ text-decoration: none;
+}
+.activitypub-inspector-author-name:hover {
+ color: var(--wpds-color-fg-brand, #135e96);
+ text-decoration: underline;
+}
+.activitypub-inspector-meta {
+ display: flex;
+ align-items: center;
+ gap: var(--wpds-spacing-15, 6px);
+ font-size: var(--wpds-font-size-small, 13px);
+}
+.activitypub-inspector-webfinger {
+ color: var(--wpds-color-fg-secondary, #646970);
+}
+.activitypub-inspector-separator {
+ color: var(--wpds-color-fg-tertiary, #c3c4c7);
+}
+.activitypub-inspector-timestamp {
+ color: var(--wpds-color-fg-secondary, #646970);
+ text-decoration: none;
+}
+.activitypub-inspector-timestamp:hover {
+ color: var(--wpds-color-fg-brand, #135e96);
+ text-decoration: underline;
+}
+.activitypub-inspector-card .components-card__body h2 {
+ margin: 0 0 var(--wpds-spacing-40, 16px);
+ font-size: var(--wpds-font-size-large, 20px);
+ font-weight: var(--wpds-font-weight-semibold, 600);
+ line-height: 1.4;
+ color: var(--wpds-color-fg-primary, #1d2327);
+}
+.activitypub-inspector-card .components-card__body > div {
+ line-height: 1.6;
+ color: var(--wpds-color-fg-primary, #2c3338);
+ margin-bottom: var(--wpds-spacing-40, 16px);
+}
+.activitypub-inspector-card .components-card__body > div img {
+ max-width: 100%;
+ height: auto;
+}
+.activitypub-inspector-card .components-card__body > div a {
+ color: var(--wpds-color-fg-brand, #135e96);
+ text-decoration: none;
+ word-wrap: break-word;
+ overflow-wrap: break-word;
+}
+.activitypub-inspector-card .components-card__body > div a:hover {
+ text-decoration: underline;
+}
+.activitypub-inspector-card .components-card__body > div a .invisible {
+ display: none;
+}
+.activitypub-inspector-card .components-card__body > div a .ellipsis::after {
+ content: "…";
+}
+.activitypub-inspector-link {
+ margin-top: var(--wpds-spacing-40, 16px);
+}
+.activitypub-inspector-comment {
+ margin-bottom: var(--wpds-spacing-50, 20px);
+ padding-bottom: var(--wpds-spacing-50, 20px);
+ border-bottom: var(--wpds-border-width-control, 1px) solid var(--wpds-color-stroke-neutral-weak, #f0f0f1);
+}
+.activitypub-inspector-comment:last-child {
+ border-bottom: none;
+ margin-bottom: 0;
+ padding-bottom: 0;
+}
+.activitypub-inspector-comment-meta {
+ margin-bottom: var(--wpds-spacing-20, 8px);
+}
+.activitypub-inspector-comment-meta strong {
+ font-size: var(--wpds-font-size-small, 14px);
+ color: var(--wpds-color-fg-primary, #1d2327);
+}
+.activitypub-inspector-comment-date {
+ margin-left: var(--wpds-spacing-20, 8px);
+ font-size: var(--wpds-font-size-small, 13px);
+ color: var(--wpds-color-fg-secondary, #646970);
+}
+/*!******************************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/page/style.scss ***!
+ \******************************************************************************************************************************************************************************************************************************************************************/
+.page {
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+ min-width: 0;
+}
+
+.header {
+ padding: var(--wpds-spacing-60, 24px);
+ flex-shrink: 0;
+}
+
+.header.has-border {
+ border-bottom: var(--wpds-border-width-focus, 1px) solid var(--wpds-color-stroke-surface-neutral, #ddd);
+}
+
+.title-row {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: var(--wpds-spacing-40, 16px);
+}
+
+.title-group {
+ display: flex;
+ align-items: center;
+ gap: var(--wpds-spacing-30, 12px);
+}
+
+.title {
+ margin: 0;
+ font-size: var(--wpds-font-size-large, 20px);
+ font-weight: 500;
+ color: var(--wpds-color-fg-primary, #1e1e1e);
+}
+
+.sub-title {
+ margin: var(--wpds-spacing-20, 8px) 0 0;
+ color: var(--wpds-color-fg-secondary, #757575);
+ font-size: var(--wpds-font-size-small, 13px);
+}
+
+.content {
+ flex: 1;
+ overflow: auto;
+ display: flex;
+ flex-direction: column;
+ gap: var(--wpds-spacing-60, 24px);
+}
+
+.content.padded {
+ padding: var(--wpds-spacing-60, 24px);
+}
+
+.content.constrained {
+ max-width: 960px;
+ margin: 0 auto;
+ width: 100%;
+}
+
+.content.full {
+ padding: 0;
+}
+/*!***************************************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/fields/avatar/style.scss ***!
+ \***************************************************************************************************************************************************************************************************************************************************************************/
+.dataviews-view-table .activitypub-avatar-field__image {
+ height: 32px;
+ width: 32px;
+}
+/*!**********************************************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/fields/follow-status/style.scss ***!
+ \**********************************************************************************************************************************************************************************************************************************************************************************/
+.activitypub-mutual {
+ display: inline-block;
+ padding: 2px 8px;
+ background: #dcdcde;
+ border-radius: 3px;
+ font-size: 11px;
+ font-weight: 600;
+ text-transform: uppercase;
+ color: #50575e;
+}
+
+/*# sourceMappingURL=style-feed-stage.css.map*/
\ No newline at end of file
diff --git a/build/social-web/style-index-rtl.css b/build/social-web/style-index-rtl.css
index b765d58f3f..70a9f5eb59 100644
--- a/build/social-web/style-index-rtl.css
+++ b/build/social-web/style-index-rtl.css
@@ -1,8 +1,357 @@
-.site-icon{align-items:center;display:flex;justify-content:center}.site-icon__image{-o-object-fit:cover;object-fit:cover}.site-icon__icon{fill:currentColor}
-.site-hub{align-items:center;display:flex;gap:var(--wpds-spacing-20,8px);height:var(--wpds-spacing-160,64px);justify-content:space-between;margin-left:var(--wpds-spacing-30,12px)}.site-hub__actions{flex-shrink:0}.site-hub__icon-container{flex-shrink:0;height:var(--wpds-spacing-160,64px);width:var(--wpds-spacing-160,64px)}.site-hub__icon-container.has-transparent-background .site-hub__icon-container{background:transparent}.site-hub__icon-button.components-button{align-items:center;background:var(--wpds-color-bg-surface-neutral-weak,#1e1e1e);border-radius:0;display:flex;height:var(--wpds-spacing-160,64px);justify-content:center;overflow:hidden;padding:0;position:relative;view-transition-name:toggle;width:var(--wpds-spacing-160,64px)}.site-hub__icon-button.components-button,.site-hub__icon-button.components-button:active,.site-hub__icon-button.components-button:hover{color:var(--wpds-color-fg-inverted-primary,#fff)}.site-hub__icon-button.components-button:focus,.site-hub__icon-button.components-button:focus-visible{box-shadow:0 0 0 3px #1e1e1e,0 0 0 6px var(--wp-admin-theme-color);outline:4px solid transparent;outline-offset:4px}.site-hub__icon-button.components-button:before{border-radius:var(--wpds-border-radius-large,8px);bottom:calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));box-shadow:none;content:"";display:block;right:calc(var(--wpds-spacing-40, 16px) + var(--wpds-border-width-focus, 1px));position:absolute;left:calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));top:calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px))}@media not (prefers-reduced-motion){.site-hub__icon-button.components-button:before{transition:box-shadow .1s ease}}.site-hub__icon-button.components-button .site-icon{height:var(--wpds-spacing-160,64px);width:var(--wpds-spacing-160,64px)}.site-hub__icon-button.components-button .site-icon__icon{height:100%;width:100%}.site-hub__title .components-button{display:block;flex-grow:1;font-size:var(--wpds-font-size-medium,15px);font-weight:var(--wpds-font-weight-medium,500);margin-right:-4px;overflow:hidden;padding-left:var(--wpds-spacing-40,16px);position:relative;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.site-hub__title .components-button,.site-hub__title .components-button:active,.site-hub__title .components-button:focus,.site-hub__title .components-button:hover{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0)}.site-hub__title .components-button:focus{box-shadow:none;outline:none}.site-hub__title .components-button:focus-visible{box-shadow:0 0 0 var(--wp-admin-border-width-focus) #1e1e1e,0 0 0 calc(var(--wp-admin-border-width-focus)*2) var(--wpds-color-stroke-focus-brand,#0675c4);outline:2px solid transparent;outline-offset:2px}.site-hub__title .components-button:after{content:"↗";font-weight:400;opacity:0;position:absolute;left:0}@media not (prefers-reduced-motion){.site-hub__title .components-button:after{transition:opacity .1s linear}}.site-hub__title .components-button:active:after,.site-hub__title .components-button:focus:after,.site-hub__title .components-button:hover:after{opacity:1}.site-hub__command-button{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0)}.site-hub__command-button:active svg,.site-hub__command-button:hover svg{fill:var(--wpds-color-private-bg-fg-fill,#f0f0f0)}
-.actor-switcher{align-items:center;color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);display:flex;min-width:0;padding-right:2px;text-decoration:none;transition:color .2s ease}.actor-switcher:hover:not(:disabled){color:var(--wpds-color-fg-inverted-primary,#fff)}.actor-switcher__avatar{border-radius:50%;flex-shrink:0;height:32px;width:32px}.actor-switcher__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
-.sidebar{color:var(--wpds-color-fg-inverted-secondary,#ccc);display:flex;flex:1;flex-direction:column}.sidebar .nav{flex:1;overflow-y:auto;padding:0 var(--wpds-spacing-30,12px)}.sidebar .sidebar-navigation__icon-title{background:var(--wpds-color-bg-surface-neutral-weak,#1e1e1e);margin-bottom:var(--wpds-spacing-20,8px);padding-bottom:var(--wpds-spacing-20,8px);padding-top:var(--wpds-spacing-120,48px);position:sticky;top:0}.sidebar .sidebar-navigation__button{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);flex-shrink:0}.sidebar .sidebar-navigation__button:focus:not(:disabled){box-shadow:none;outline:none}.sidebar .sidebar-navigation__button:focus-visible:not(:disabled){box-shadow:0 0 0 var(--wpds-border-width-focus,1.5px) var(--wp-admin-theme-color);outline:3px solid transparent}.sidebar .sidebar-navigation__button:focus,.sidebar .sidebar-navigation__button:focus-visible,.sidebar .sidebar-navigation__button:hover:not(:disabled,[aria-disabled=true]),.sidebar .sidebar-navigation__button:not(:disabled,[aria-disabled=true]):active,.sidebar .sidebar-navigation__button[aria-expanded=true]{color:var(--wpds-color-private-bg-fg-fill,#f0f0f0)}.sidebar .sidebar-navigation__title{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);flex-grow:1;line-height:var(--wpds-spacing-80,32px);overflow-wrap:break-word}.sidebar .menu-item{align-items:center;color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);display:flex;gap:var(--wpds-spacing-20,8px)}.sidebar .menu-item:hover{background-color:var(--wpds-color-bg-interactive-neutral-hover,hsla(0,0%,100%,.1));color:var(--wpds-color-fg-inverted-primary,#fff)}.sidebar .menu-item.is-selected{background-color:var(--wpds-color-bg-interactive-neutral-active,hsla(0,0%,100%,.15));color:var(--wpds-color-fg-inverted-primary,#fff)}.sidebar .menu-item svg{flex-shrink:0}.sidebar .footer{border-top:1px solid var(--wpds-color-stroke-inverted,hsla(0,0%,100%,.1));padding:var(--wpds-spacing-40,16px)}.sidebar .footer>.components-h-stack{padding:2px 0}.sidebar .footer .footer-settings-button{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);flex-shrink:0}.sidebar .footer .footer-settings-button:hover:not(:disabled){color:var(--wpds-color-fg-inverted-primary,#fff)}
-.themed-surface{background:var(--wpds-color-bg-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-large,8px);display:flex;flex:1;flex-direction:column;min-height:0;overflow:hidden}
-.panel{display:flex;flex:1;flex-direction:column;margin:var(--wpds-spacing-40,16px) 0 var(--wpds-spacing-40,16px) var(--wpds-spacing-40,16px);min-height:0}
-#activitypub-social-web-root>div{height:100%}.app-layout{flex-direction:column}.app-content,.app-layout{background-color:var(--wpds-color-bg-surface-neutral-weak,#1e1e1e);display:flex;height:100%;overflow:hidden;width:100%}.app-content{flex-grow:1}.sidebar-region{flex-shrink:0;width:300px}.sidebar-region,.stage-region{display:flex;flex-direction:column}.stage-region{flex-grow:1;min-width:0;overflow:hidden}.inspector-region{display:flex;flex-direction:column;flex-shrink:0;width:var(--sw-inspector-width)}.components-snackbar-list{bottom:20px;right:20px;position:fixed;z-index:100000}@media(max-width:782px){.app-content{flex-direction:column}.inspector-region,.sidebar-region{width:100%}.components-snackbar-list{bottom:10px;right:10px;left:10px}}
-:root{--sw-sidebar-width:300px;--sw-inspector-width:380px}.activitypub-social-web-layout{bottom:0;right:0;position:fixed;left:0;top:0}#wpfooter{display:none}
+/*!***********************************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/site-icon/style.scss ***!
+ \***********************************************************************************************************************************************************************************************************************************************************************/
+/**
+ * Site Icon Component Styles
+ */
+.site-icon {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+.site-icon__image {
+ -o-object-fit: cover;
+ object-fit: cover;
+}
+.site-icon__icon {
+ fill: currentColor;
+}
+/*!**********************************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/site-hub/style.scss ***!
+ \**********************************************************************************************************************************************************************************************************************************************************************/
+@charset "UTF-8";
+/**
+ * Site Hub Component Styles
+ */
+.site-hub {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: var(--wpds-spacing-20, 8px);
+ margin-left: var(--wpds-spacing-30, 12px);
+ height: var(--wpds-spacing-160, 64px);
+}
+.site-hub__actions {
+ flex-shrink: 0;
+}
+.site-hub__icon-container {
+ height: var(--wpds-spacing-160, 64px);
+ width: var(--wpds-spacing-160, 64px);
+ flex-shrink: 0;
+}
+.site-hub__icon-container.has-transparent-background .site-hub__icon-container {
+ background: transparent;
+}
+.site-hub__icon-button.components-button {
+ /* stylelint-disable -- Disable reason: View Transitions not supported properly by stylelint. */
+ view-transition-name: toggle;
+ /* stylelint-enable */
+ position: relative;
+ color: var(--wpds-color-fg-inverted-primary, #ffffff);
+ height: var(--wpds-spacing-160, 64px);
+ width: var(--wpds-spacing-160, 64px);
+ overflow: hidden;
+ padding: 0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: var(--wpds-color-bg-surface-neutral-weak, #1e1e1e);
+ border-radius: 0;
+}
+.site-hub__icon-button.components-button:hover, .site-hub__icon-button.components-button:active {
+ color: var(--wpds-color-fg-inverted-primary, #ffffff);
+}
+.site-hub__icon-button.components-button:focus-visible, .site-hub__icon-button.components-button:focus {
+ box-shadow: 0 0 0 3px #1e1e1e, 0 0 0 6px var(--wp-admin-theme-color);
+ outline: 4px solid rgba(0, 0, 0, 0);
+ outline-offset: 4px;
+}
+.site-hub__icon-button.components-button::before {
+ content: "";
+ display: block;
+ position: absolute;
+ top: calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));
+ left: calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));
+ bottom: calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));
+ right: calc(var(--wpds-spacing-40, 16px) + var(--wpds-border-width-focus, 1px));
+ border-radius: var(--wpds-border-radius-large, 8px);
+ box-shadow: none;
+}
+@media not (prefers-reduced-motion) {
+ .site-hub__icon-button.components-button::before {
+ transition: box-shadow 0.1s ease;
+ }
+}
+.site-hub__icon-button.components-button .site-icon {
+ height: var(--wpds-spacing-160, 64px);
+ width: var(--wpds-spacing-160, 64px);
+}
+.site-hub__icon-button.components-button .site-icon__icon {
+ height: 100%;
+ width: 100%;
+}
+.site-hub__title .components-button {
+ color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
+ display: block;
+ flex-grow: 1;
+ font-size: var(--wpds-font-size-medium, 15px);
+ font-weight: var(--wpds-font-weight-medium, 500);
+ overflow: hidden;
+ padding-left: var(--wpds-spacing-40, 16px);
+ margin-right: -4px;
+ position: relative;
+ text-decoration: none;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.site-hub__title .components-button:hover, .site-hub__title .components-button:focus, .site-hub__title .components-button:active {
+ color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
+}
+.site-hub__title .components-button:focus {
+ box-shadow: none;
+ outline: none;
+}
+.site-hub__title .components-button:focus-visible {
+ box-shadow: 0 0 0 var(--wp-admin-border-width-focus) #1e1e1e, 0 0 0 calc(2 * var(--wp-admin-border-width-focus)) var(--wpds-color-stroke-focus-brand, #0675c4);
+ outline: 2px solid transparent;
+ outline-offset: 2px;
+}
+.site-hub__title .components-button::after {
+ content: "↗";
+ font-weight: 400;
+ opacity: 0;
+ position: absolute;
+ left: 0;
+}
+@media not (prefers-reduced-motion) {
+ .site-hub__title .components-button::after {
+ transition: opacity 0.1s linear;
+ }
+}
+.site-hub__title .components-button:hover::after, .site-hub__title .components-button:focus::after, .site-hub__title .components-button:active::after {
+ opacity: 1;
+}
+.site-hub__command-button {
+ color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
+}
+.site-hub__command-button:hover svg, .site-hub__command-button:active svg {
+ fill: var(--wpds-color-private-bg-fg-fill, #f0f0f0);
+}
+/*!****************************************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/actor-switcher/style.scss ***!
+ \****************************************************************************************************************************************************************************************************************************************************************************/
+.actor-switcher {
+ display: flex;
+ align-items: center;
+ text-decoration: none;
+ color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
+ transition: color 0.2s ease;
+ min-width: 0;
+ padding-right: 2px;
+}
+.actor-switcher:hover:not(:disabled) {
+ color: var(--wpds-color-fg-inverted-primary, #ffffff);
+}
+.actor-switcher__avatar {
+ width: 32px;
+ height: 32px;
+ border-radius: 50%;
+ flex-shrink: 0;
+}
+.actor-switcher__name {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+/*!*********************************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/sidebar/style.scss ***!
+ \*********************************************************************************************************************************************************************************************************************************************************************/
+.sidebar {
+ display: flex;
+ flex-direction: column;
+ flex: 1;
+ color: var(--wpds-color-fg-inverted-secondary, #cccccc);
+}
+.sidebar .nav {
+ flex: 1;
+ padding: 0 var(--wpds-spacing-30, 12px);
+ overflow-y: auto;
+}
+.sidebar .sidebar-navigation__icon-title {
+ position: sticky;
+ top: 0;
+ background: var(--wpds-color-bg-surface-neutral-weak, #1e1e1e);
+ padding-top: var(--wpds-spacing-120, 48px);
+ margin-bottom: var(--wpds-spacing-20, 8px);
+ padding-bottom: var(--wpds-spacing-20, 8px);
+}
+.sidebar .sidebar-navigation__button {
+ color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
+ flex-shrink: 0;
+}
+.sidebar .sidebar-navigation__button:focus:not(:disabled) {
+ box-shadow: none;
+ outline: none;
+}
+.sidebar .sidebar-navigation__button:focus-visible:not(:disabled) {
+ box-shadow: 0 0 0 var(--wpds-border-width-focus, 1.5px) var(--wp-admin-theme-color);
+ outline: 3px solid transparent;
+}
+.sidebar .sidebar-navigation__button:hover:not(:disabled, [aria-disabled=true]), .sidebar .sidebar-navigation__button:focus-visible, .sidebar .sidebar-navigation__button:focus, .sidebar .sidebar-navigation__button:not(:disabled, [aria-disabled=true]):active, .sidebar .sidebar-navigation__button[aria-expanded=true] {
+ color: var(--wpds-color-private-bg-fg-fill, #f0f0f0);
+}
+.sidebar .sidebar-navigation__title {
+ color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
+ flex-grow: 1;
+ overflow-wrap: break-word;
+ line-height: var(--wpds-spacing-80, 32px);
+}
+.sidebar .menu-item {
+ display: flex;
+ align-items: center;
+ gap: var(--wpds-spacing-20, 8px);
+ color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
+}
+.sidebar .menu-item:hover {
+ background-color: var(--wpds-color-bg-interactive-neutral-hover, rgba(255, 255, 255, 0.1));
+ color: var(--wpds-color-fg-inverted-primary, #ffffff);
+}
+.sidebar .menu-item.is-selected {
+ background-color: var(--wpds-color-bg-interactive-neutral-active, rgba(255, 255, 255, 0.15));
+ color: var(--wpds-color-fg-inverted-primary, #ffffff);
+}
+.sidebar .menu-item svg {
+ flex-shrink: 0;
+}
+.sidebar .footer {
+ padding: var(--wpds-spacing-40, 16px);
+ border-top: 1px solid var(--wpds-color-stroke-inverted, rgba(255, 255, 255, 0.1));
+}
+.sidebar .footer > .components-h-stack {
+ padding: 2px 0;
+}
+.sidebar .footer .footer-settings-button {
+ color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
+ flex-shrink: 0;
+}
+.sidebar .footer .footer-settings-button:hover:not(:disabled) {
+ color: var(--wpds-color-fg-inverted-primary, #ffffff);
+}
+/*!****************************************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/themed-surface/style.scss ***!
+ \****************************************************************************************************************************************************************************************************************************************************************************/
+/**
+ * ThemedSurface styles
+ *
+ * Provides themed container for light content areas.
+ * Uses wpds tokens directly for consistent theming.
+ */
+.themed-surface {
+ background: var(--wpds-color-bg-surface-neutral-strong, #ffffff);
+ border-radius: var(--wpds-border-radius-large, 8px);
+ overflow: hidden;
+ display: flex;
+ flex-direction: column;
+ flex: 1;
+ min-height: 0;
+}
+/*!*******************************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/panel/style.scss ***!
+ \*******************************************************************************************************************************************************************************************************************************************************************/
+.panel {
+ margin: var(--wpds-spacing-40, 16px) 0 var(--wpds-spacing-40, 16px) var(--wpds-spacing-40, 16px);
+ flex: 1;
+ min-height: 0;
+ display: flex;
+ flex-direction: column;
+}
+/*!********************************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/layout/style.scss ***!
+ \********************************************************************************************************************************************************************************************************************************************************************/
+/* Ensure provider wrappers (SlotFillProvider, ShortcutProvider) fill height */
+#activitypub-social-web-root > div {
+ height: 100%;
+}
+.app-layout {
+ display: flex;
+ flex-direction: column;
+ width: 100%;
+ height: 100%;
+ background-color: var(--wpds-color-bg-surface-neutral-weak, #1e1e1e);
+ overflow: hidden;
+}
+.app-content {
+ width: 100%;
+ height: 100%;
+ flex-grow: 1;
+ display: flex;
+ background-color: var(--wpds-color-bg-surface-neutral-weak, #1e1e1e);
+ overflow: hidden;
+}
+.sidebar-region {
+ flex-shrink: 0;
+ width: 300px;
+ display: flex;
+ flex-direction: column;
+}
+.stage-region {
+ flex-grow: 1;
+ min-width: 0;
+ display: flex;
+ flex-direction: column;
+ overflow: hidden;
+}
+.inspector-region {
+ width: var(--sw-inspector-width);
+ flex-shrink: 0;
+ display: flex;
+ flex-direction: column;
+}
+.components-snackbar-list {
+ position: fixed;
+ bottom: 20px;
+ right: 20px;
+ z-index: 100000;
+}
+@media (max-width: 782px) {
+ .app-content {
+ flex-direction: column;
+ }
+ .sidebar-region,
+ .inspector-region {
+ width: 100%;
+ }
+ .components-snackbar-list {
+ right: 10px;
+ left: 10px;
+ bottom: 10px;
+ }
+}
+/*!**************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/style.scss ***!
+ \**************************************************************************************************************************************************************************************************************************************************/
+/**
+ * Main stylesheet entry point for Social Web
+ * This compiles to style-index.css
+ */
+/**
+ * Design Tokens for ActivityPub Social Web
+ *
+ * Uses wpds design tokens directly for colors, spacing, typography, etc.
+ * Only defines app-specific layout dimensions.
+ */
+:root {
+ /* Layout dimensions (app-specific) */
+ --sw-sidebar-width: 300px;
+ --sw-inspector-width: 380px;
+}
+.activitypub-social-web-layout {
+ position: fixed;
+ top: 0;
+ right: 0;
+ left: 0;
+ bottom: 0;
+}
+#wpfooter {
+ display: none;
+}
diff --git a/build/social-web/style-index.css b/build/social-web/style-index.css
index eb2b7dd569..0d96978893 100644
--- a/build/social-web/style-index.css
+++ b/build/social-web/style-index.css
@@ -1,8 +1,359 @@
-.site-icon{align-items:center;display:flex;justify-content:center}.site-icon__image{-o-object-fit:cover;object-fit:cover}.site-icon__icon{fill:currentColor}
-.site-hub{align-items:center;display:flex;gap:var(--wpds-spacing-20,8px);height:var(--wpds-spacing-160,64px);justify-content:space-between;margin-right:var(--wpds-spacing-30,12px)}.site-hub__actions{flex-shrink:0}.site-hub__icon-container{flex-shrink:0;height:var(--wpds-spacing-160,64px);width:var(--wpds-spacing-160,64px)}.site-hub__icon-container.has-transparent-background .site-hub__icon-container{background:transparent}.site-hub__icon-button.components-button{align-items:center;background:var(--wpds-color-bg-surface-neutral-weak,#1e1e1e);border-radius:0;display:flex;height:var(--wpds-spacing-160,64px);justify-content:center;overflow:hidden;padding:0;position:relative;view-transition-name:toggle;width:var(--wpds-spacing-160,64px)}.site-hub__icon-button.components-button,.site-hub__icon-button.components-button:active,.site-hub__icon-button.components-button:hover{color:var(--wpds-color-fg-inverted-primary,#fff)}.site-hub__icon-button.components-button:focus,.site-hub__icon-button.components-button:focus-visible{box-shadow:0 0 0 3px #1e1e1e,0 0 0 6px var(--wp-admin-theme-color);outline:4px solid transparent;outline-offset:4px}.site-hub__icon-button.components-button:before{border-radius:var(--wpds-border-radius-large,8px);bottom:calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));box-shadow:none;content:"";display:block;left:calc(var(--wpds-spacing-40, 16px) + var(--wpds-border-width-focus, 1px));position:absolute;right:calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));top:calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px))}@media not (prefers-reduced-motion){.site-hub__icon-button.components-button:before{transition:box-shadow .1s ease}}.site-hub__icon-button.components-button .site-icon{height:var(--wpds-spacing-160,64px);width:var(--wpds-spacing-160,64px)}.site-hub__icon-button.components-button .site-icon__icon{height:100%;width:100%}.site-hub__title .components-button{display:block;flex-grow:1;font-size:var(--wpds-font-size-medium,15px);font-weight:var(--wpds-font-weight-medium,500);margin-left:-4px;overflow:hidden;padding-right:var(--wpds-spacing-40,16px);position:relative;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.site-hub__title .components-button,.site-hub__title .components-button:active,.site-hub__title .components-button:focus,.site-hub__title .components-button:hover{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0)}.site-hub__title .components-button:focus{box-shadow:none;outline:none}.site-hub__title .components-button:focus-visible{box-shadow:0 0 0 var(--wp-admin-border-width-focus) #1e1e1e,0 0 0 calc(var(--wp-admin-border-width-focus)*2) var(--wpds-color-stroke-focus-brand,#0675c4);outline:2px solid transparent;outline-offset:2px}.site-hub__title .components-button:after{content:"↗";font-weight:400;opacity:0;position:absolute;right:0}@media not (prefers-reduced-motion){.site-hub__title .components-button:after{transition:opacity .1s linear}}.site-hub__title .components-button:active:after,.site-hub__title .components-button:focus:after,.site-hub__title .components-button:hover:after{opacity:1}.site-hub__command-button{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0)}.site-hub__command-button:active svg,.site-hub__command-button:hover svg{fill:var(--wpds-color-private-bg-fg-fill,#f0f0f0)}
-.actor-switcher{align-items:center;color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);display:flex;min-width:0;padding-left:2px;text-decoration:none;transition:color .2s ease}.actor-switcher:hover:not(:disabled){color:var(--wpds-color-fg-inverted-primary,#fff)}.actor-switcher__avatar{border-radius:50%;flex-shrink:0;height:32px;width:32px}.actor-switcher__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
-.sidebar{color:var(--wpds-color-fg-inverted-secondary,#ccc);display:flex;flex:1;flex-direction:column}.sidebar .nav{flex:1;overflow-y:auto;padding:0 var(--wpds-spacing-30,12px)}.sidebar .sidebar-navigation__icon-title{background:var(--wpds-color-bg-surface-neutral-weak,#1e1e1e);margin-bottom:var(--wpds-spacing-20,8px);padding-bottom:var(--wpds-spacing-20,8px);padding-top:var(--wpds-spacing-120,48px);position:sticky;top:0}.sidebar .sidebar-navigation__button{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);flex-shrink:0}.sidebar .sidebar-navigation__button:focus:not(:disabled){box-shadow:none;outline:none}.sidebar .sidebar-navigation__button:focus-visible:not(:disabled){box-shadow:0 0 0 var(--wpds-border-width-focus,1.5px) var(--wp-admin-theme-color);outline:3px solid transparent}.sidebar .sidebar-navigation__button:focus,.sidebar .sidebar-navigation__button:focus-visible,.sidebar .sidebar-navigation__button:hover:not(:disabled,[aria-disabled=true]),.sidebar .sidebar-navigation__button:not(:disabled,[aria-disabled=true]):active,.sidebar .sidebar-navigation__button[aria-expanded=true]{color:var(--wpds-color-private-bg-fg-fill,#f0f0f0)}.sidebar .sidebar-navigation__title{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);flex-grow:1;line-height:var(--wpds-spacing-80,32px);overflow-wrap:break-word}.sidebar .menu-item{align-items:center;color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);display:flex;gap:var(--wpds-spacing-20,8px)}.sidebar .menu-item:hover{background-color:var(--wpds-color-bg-interactive-neutral-hover,hsla(0,0%,100%,.1));color:var(--wpds-color-fg-inverted-primary,#fff)}.sidebar .menu-item.is-selected{background-color:var(--wpds-color-bg-interactive-neutral-active,hsla(0,0%,100%,.15));color:var(--wpds-color-fg-inverted-primary,#fff)}.sidebar .menu-item svg{flex-shrink:0}.sidebar .footer{border-top:1px solid var(--wpds-color-stroke-inverted,hsla(0,0%,100%,.1));padding:var(--wpds-spacing-40,16px)}.sidebar .footer>.components-h-stack{padding:2px 0}.sidebar .footer .footer-settings-button{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);flex-shrink:0}.sidebar .footer .footer-settings-button:hover:not(:disabled){color:var(--wpds-color-fg-inverted-primary,#fff)}
-.themed-surface{background:var(--wpds-color-bg-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-large,8px);display:flex;flex:1;flex-direction:column;min-height:0;overflow:hidden}
-.panel{display:flex;flex:1;flex-direction:column;margin:var(--wpds-spacing-40,16px) var(--wpds-spacing-40,16px) var(--wpds-spacing-40,16px) 0;min-height:0}
-#activitypub-social-web-root>div{height:100%}.app-layout{flex-direction:column}.app-content,.app-layout{background-color:var(--wpds-color-bg-surface-neutral-weak,#1e1e1e);display:flex;height:100%;overflow:hidden;width:100%}.app-content{flex-grow:1}.sidebar-region{flex-shrink:0;width:300px}.sidebar-region,.stage-region{display:flex;flex-direction:column}.stage-region{flex-grow:1;min-width:0;overflow:hidden}.inspector-region{display:flex;flex-direction:column;flex-shrink:0;width:var(--sw-inspector-width)}.components-snackbar-list{bottom:20px;left:20px;position:fixed;z-index:100000}@media(max-width:782px){.app-content{flex-direction:column}.inspector-region,.sidebar-region{width:100%}.components-snackbar-list{bottom:10px;left:10px;right:10px}}
-:root{--sw-sidebar-width:300px;--sw-inspector-width:380px}.activitypub-social-web-layout{bottom:0;left:0;position:fixed;right:0;top:0}#wpfooter{display:none}
+/*!***********************************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/site-icon/style.scss ***!
+ \***********************************************************************************************************************************************************************************************************************************************************************/
+/**
+ * Site Icon Component Styles
+ */
+.site-icon {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+.site-icon__image {
+ -o-object-fit: cover;
+ object-fit: cover;
+}
+.site-icon__icon {
+ fill: currentColor;
+}
+/*!**********************************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/site-hub/style.scss ***!
+ \**********************************************************************************************************************************************************************************************************************************************************************/
+@charset "UTF-8";
+/**
+ * Site Hub Component Styles
+ */
+.site-hub {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: var(--wpds-spacing-20, 8px);
+ margin-right: var(--wpds-spacing-30, 12px);
+ height: var(--wpds-spacing-160, 64px);
+}
+.site-hub__actions {
+ flex-shrink: 0;
+}
+.site-hub__icon-container {
+ height: var(--wpds-spacing-160, 64px);
+ width: var(--wpds-spacing-160, 64px);
+ flex-shrink: 0;
+}
+.site-hub__icon-container.has-transparent-background .site-hub__icon-container {
+ background: transparent;
+}
+.site-hub__icon-button.components-button {
+ /* stylelint-disable -- Disable reason: View Transitions not supported properly by stylelint. */
+ view-transition-name: toggle;
+ /* stylelint-enable */
+ position: relative;
+ color: var(--wpds-color-fg-inverted-primary, #ffffff);
+ height: var(--wpds-spacing-160, 64px);
+ width: var(--wpds-spacing-160, 64px);
+ overflow: hidden;
+ padding: 0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: var(--wpds-color-bg-surface-neutral-weak, #1e1e1e);
+ border-radius: 0;
+}
+.site-hub__icon-button.components-button:hover, .site-hub__icon-button.components-button:active {
+ color: var(--wpds-color-fg-inverted-primary, #ffffff);
+}
+.site-hub__icon-button.components-button:focus-visible, .site-hub__icon-button.components-button:focus {
+ box-shadow: 0 0 0 3px #1e1e1e, 0 0 0 6px var(--wp-admin-theme-color);
+ outline: 4px solid rgba(0, 0, 0, 0);
+ outline-offset: 4px;
+}
+.site-hub__icon-button.components-button::before {
+ content: "";
+ display: block;
+ position: absolute;
+ top: calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));
+ right: calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));
+ bottom: calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));
+ left: calc(var(--wpds-spacing-40, 16px) + var(--wpds-border-width-focus, 1px));
+ border-radius: var(--wpds-border-radius-large, 8px);
+ box-shadow: none;
+}
+@media not (prefers-reduced-motion) {
+ .site-hub__icon-button.components-button::before {
+ transition: box-shadow 0.1s ease;
+ }
+}
+.site-hub__icon-button.components-button .site-icon {
+ height: var(--wpds-spacing-160, 64px);
+ width: var(--wpds-spacing-160, 64px);
+}
+.site-hub__icon-button.components-button .site-icon__icon {
+ height: 100%;
+ width: 100%;
+}
+.site-hub__title .components-button {
+ color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
+ display: block;
+ flex-grow: 1;
+ font-size: var(--wpds-font-size-medium, 15px);
+ font-weight: var(--wpds-font-weight-medium, 500);
+ overflow: hidden;
+ padding-right: var(--wpds-spacing-40, 16px);
+ margin-left: -4px;
+ position: relative;
+ text-decoration: none;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.site-hub__title .components-button:hover, .site-hub__title .components-button:focus, .site-hub__title .components-button:active {
+ color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
+}
+.site-hub__title .components-button:focus {
+ box-shadow: none;
+ outline: none;
+}
+.site-hub__title .components-button:focus-visible {
+ box-shadow: 0 0 0 var(--wp-admin-border-width-focus) #1e1e1e, 0 0 0 calc(2 * var(--wp-admin-border-width-focus)) var(--wpds-color-stroke-focus-brand, #0675c4);
+ outline: 2px solid transparent;
+ outline-offset: 2px;
+}
+.site-hub__title .components-button::after {
+ content: "↗";
+ font-weight: 400;
+ opacity: 0;
+ position: absolute;
+ right: 0;
+}
+@media not (prefers-reduced-motion) {
+ .site-hub__title .components-button::after {
+ transition: opacity 0.1s linear;
+ }
+}
+.site-hub__title .components-button:hover::after, .site-hub__title .components-button:focus::after, .site-hub__title .components-button:active::after {
+ opacity: 1;
+}
+.site-hub__command-button {
+ color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
+}
+.site-hub__command-button:hover svg, .site-hub__command-button:active svg {
+ fill: var(--wpds-color-private-bg-fg-fill, #f0f0f0);
+}
+/*!****************************************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/actor-switcher/style.scss ***!
+ \****************************************************************************************************************************************************************************************************************************************************************************/
+.actor-switcher {
+ display: flex;
+ align-items: center;
+ text-decoration: none;
+ color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
+ transition: color 0.2s ease;
+ min-width: 0;
+ padding-left: 2px;
+}
+.actor-switcher:hover:not(:disabled) {
+ color: var(--wpds-color-fg-inverted-primary, #ffffff);
+}
+.actor-switcher__avatar {
+ width: 32px;
+ height: 32px;
+ border-radius: 50%;
+ flex-shrink: 0;
+}
+.actor-switcher__name {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+/*!*********************************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/sidebar/style.scss ***!
+ \*********************************************************************************************************************************************************************************************************************************************************************/
+.sidebar {
+ display: flex;
+ flex-direction: column;
+ flex: 1;
+ color: var(--wpds-color-fg-inverted-secondary, #cccccc);
+}
+.sidebar .nav {
+ flex: 1;
+ padding: 0 var(--wpds-spacing-30, 12px);
+ overflow-y: auto;
+}
+.sidebar .sidebar-navigation__icon-title {
+ position: sticky;
+ top: 0;
+ background: var(--wpds-color-bg-surface-neutral-weak, #1e1e1e);
+ padding-top: var(--wpds-spacing-120, 48px);
+ margin-bottom: var(--wpds-spacing-20, 8px);
+ padding-bottom: var(--wpds-spacing-20, 8px);
+}
+.sidebar .sidebar-navigation__button {
+ color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
+ flex-shrink: 0;
+}
+.sidebar .sidebar-navigation__button:focus:not(:disabled) {
+ box-shadow: none;
+ outline: none;
+}
+.sidebar .sidebar-navigation__button:focus-visible:not(:disabled) {
+ box-shadow: 0 0 0 var(--wpds-border-width-focus, 1.5px) var(--wp-admin-theme-color);
+ outline: 3px solid transparent;
+}
+.sidebar .sidebar-navigation__button:hover:not(:disabled, [aria-disabled=true]), .sidebar .sidebar-navigation__button:focus-visible, .sidebar .sidebar-navigation__button:focus, .sidebar .sidebar-navigation__button:not(:disabled, [aria-disabled=true]):active, .sidebar .sidebar-navigation__button[aria-expanded=true] {
+ color: var(--wpds-color-private-bg-fg-fill, #f0f0f0);
+}
+.sidebar .sidebar-navigation__title {
+ color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
+ flex-grow: 1;
+ overflow-wrap: break-word;
+ line-height: var(--wpds-spacing-80, 32px);
+}
+.sidebar .menu-item {
+ display: flex;
+ align-items: center;
+ gap: var(--wpds-spacing-20, 8px);
+ color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
+}
+.sidebar .menu-item:hover {
+ background-color: var(--wpds-color-bg-interactive-neutral-hover, rgba(255, 255, 255, 0.1));
+ color: var(--wpds-color-fg-inverted-primary, #ffffff);
+}
+.sidebar .menu-item.is-selected {
+ background-color: var(--wpds-color-bg-interactive-neutral-active, rgba(255, 255, 255, 0.15));
+ color: var(--wpds-color-fg-inverted-primary, #ffffff);
+}
+.sidebar .menu-item svg {
+ flex-shrink: 0;
+}
+.sidebar .footer {
+ padding: var(--wpds-spacing-40, 16px);
+ border-top: 1px solid var(--wpds-color-stroke-inverted, rgba(255, 255, 255, 0.1));
+}
+.sidebar .footer > .components-h-stack {
+ padding: 2px 0;
+}
+.sidebar .footer .footer-settings-button {
+ color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
+ flex-shrink: 0;
+}
+.sidebar .footer .footer-settings-button:hover:not(:disabled) {
+ color: var(--wpds-color-fg-inverted-primary, #ffffff);
+}
+/*!****************************************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/themed-surface/style.scss ***!
+ \****************************************************************************************************************************************************************************************************************************************************************************/
+/**
+ * ThemedSurface styles
+ *
+ * Provides themed container for light content areas.
+ * Uses wpds tokens directly for consistent theming.
+ */
+.themed-surface {
+ background: var(--wpds-color-bg-surface-neutral-strong, #ffffff);
+ border-radius: var(--wpds-border-radius-large, 8px);
+ overflow: hidden;
+ display: flex;
+ flex-direction: column;
+ flex: 1;
+ min-height: 0;
+}
+/*!*******************************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/panel/style.scss ***!
+ \*******************************************************************************************************************************************************************************************************************************************************************/
+.panel {
+ margin: var(--wpds-spacing-40, 16px) var(--wpds-spacing-40, 16px) var(--wpds-spacing-40, 16px) 0;
+ flex: 1;
+ min-height: 0;
+ display: flex;
+ flex-direction: column;
+}
+/*!********************************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/layout/style.scss ***!
+ \********************************************************************************************************************************************************************************************************************************************************************/
+/* Ensure provider wrappers (SlotFillProvider, ShortcutProvider) fill height */
+#activitypub-social-web-root > div {
+ height: 100%;
+}
+.app-layout {
+ display: flex;
+ flex-direction: column;
+ width: 100%;
+ height: 100%;
+ background-color: var(--wpds-color-bg-surface-neutral-weak, #1e1e1e);
+ overflow: hidden;
+}
+.app-content {
+ width: 100%;
+ height: 100%;
+ flex-grow: 1;
+ display: flex;
+ background-color: var(--wpds-color-bg-surface-neutral-weak, #1e1e1e);
+ overflow: hidden;
+}
+.sidebar-region {
+ flex-shrink: 0;
+ width: 300px;
+ display: flex;
+ flex-direction: column;
+}
+.stage-region {
+ flex-grow: 1;
+ min-width: 0;
+ display: flex;
+ flex-direction: column;
+ overflow: hidden;
+}
+.inspector-region {
+ width: var(--sw-inspector-width);
+ flex-shrink: 0;
+ display: flex;
+ flex-direction: column;
+}
+.components-snackbar-list {
+ position: fixed;
+ bottom: 20px;
+ left: 20px;
+ z-index: 100000;
+}
+@media (max-width: 782px) {
+ .app-content {
+ flex-direction: column;
+ }
+ .sidebar-region,
+ .inspector-region {
+ width: 100%;
+ }
+ .components-snackbar-list {
+ left: 10px;
+ right: 10px;
+ bottom: 10px;
+ }
+}
+/*!**************************************************************************************************************************************************************************************************************************************************!*\
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/style.scss ***!
+ \**************************************************************************************************************************************************************************************************************************************************/
+/**
+ * Main stylesheet entry point for Social Web
+ * This compiles to style-index.css
+ */
+/**
+ * Design Tokens for ActivityPub Social Web
+ *
+ * Uses wpds design tokens directly for colors, spacing, typography, etc.
+ * Only defines app-specific layout dimensions.
+ */
+:root {
+ /* Layout dimensions (app-specific) */
+ --sw-sidebar-width: 300px;
+ --sw-inspector-width: 380px;
+}
+.activitypub-social-web-layout {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+}
+#wpfooter {
+ display: none;
+}
+
+/*# sourceMappingURL=style-index.css.map*/
\ No newline at end of file
diff --git a/build/social-web/vendors.asset.php b/build/social-web/vendors.asset.php
index 63f2690385..215385aaa3 100644
--- a/build/social-web/vendors.asset.php
+++ b/build/social-web/vendors.asset.php
@@ -1 +1 @@
- array(), 'version' => '75855a84b95a5c8323d7');
+ array(), 'version' => '38e63120ab50ddcf3954');
diff --git a/build/social-web/vendors.js b/build/social-web/vendors.js
index 3a811787d3..9396ae83c3 100644
--- a/build/social-web/vendors.js
+++ b/build/social-web/vendors.js
@@ -1,103 +1,22189 @@
-(globalThis.webpackChunkwordpress_activitypub=globalThis.webpackChunkwordpress_activitypub||[]).push([[803],{164:(e,t,n)=>{"use strict";function i(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;tr});const r=function(){for(var e,t,n=0,r="",a=arguments.length;n{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var i,r,a;if(Array.isArray(t)){if((i=t.length)!=n.length)return!1;for(r=i;0!==r--;)if(!e(t[r],n[r]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(r of t.entries())if(!n.has(r[0]))return!1;for(r of t.entries())if(!e(r[1],n.get(r[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(r of t.entries())if(!n.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((i=t.length)!=n.length)return!1;for(r=i;0!==r--;)if(t[r]!==n[r])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((i=(a=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=i;0!==r--;)if(!Object.prototype.hasOwnProperty.call(n,a[r]))return!1;for(r=i;0!==r--;){var s=a[r];if(!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n}},307:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(573),r=n(790),a=(0,r.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(i.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"})})},371:(e,t,n)=>{"use strict";n.d(t,{A:()=>uo});var i=n(427),r=n(87),a=n(491),s=n(723),l=n(573),o=n(790),u=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.Path,{d:"M12 3.9 6.5 9.5l1 1 3.8-3.7V20h1.5V6.8l3.7 3.7 1-1z"})}),c=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.Path,{d:"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"})}),d="is",f="isNot",m="isAny",v="isNone",p="isAll",h="isNotAll",g="lessThan",b="greaterThan",x="lessThanOrEqual",w="greaterThanOrEqual",y="before",_="after",C="beforeInc",j="afterInc",S="contains",k="notContains",V="startsWith",I="between",E="on",N="notOn",F="inThePast",M="over",A=[d,f,m,v,p,h,g,b,x,w,y,_,C,j,S,k,V,I,E,N,F,M],O=[d,f,g,b,x,w,y,_,C,j,S,k,V,E,N],P={[d]:{key:"is-filter",label:(0,s.__)("Is")},[f]:{key:"is-not-filter",label:(0,s.__)("Is not")},[m]:{key:"is-any-filter",label:(0,s.__)("Is any")},[v]:{key:"is-none-filter",label:(0,s.__)("Is none")},[p]:{key:"is-all-filter",label:(0,s.__)("Is all")},[h]:{key:"is-not-all-filter",label:(0,s.__)("Is not all")},[g]:{key:"less-than-filter",label:(0,s.__)("Less than")},[b]:{key:"greater-than-filter",label:(0,s.__)("Greater than")},[x]:{key:"less-than-or-equal-filter",label:(0,s.__)("Less than or equal")},[w]:{key:"greater-than-or-equal-filter",label:(0,s.__)("Greater than or equal")},[y]:{key:"before-filter",label:(0,s.__)("Before")},[_]:{key:"after-filter",label:(0,s.__)("After")},[C]:{key:"before-inc-filter",label:(0,s.__)("Before (inc)")},[j]:{key:"after-inc-filter",label:(0,s.__)("After (inc)")},[S]:{key:"contains-filter",label:(0,s.__)("Contains")},[k]:{key:"not-contains-filter",label:(0,s.__)("Doesn't contain")},[V]:{key:"starts-with-filter",label:(0,s.__)("Starts with")},[I]:{key:"between-filter",label:(0,s.__)("Between (inc)")},[E]:{key:"on-filter",label:(0,s.__)("On")},[N]:{key:"not-on-filter",label:(0,s.__)("Not on")},[F]:{key:"in-the-past-filter",label:(0,s.__)("In the past")},[M]:{key:"over-filter",label:(0,s.__)("Over")}},L=["asc","desc"],D={asc:"↑",desc:"↓"},T={asc:"ascending",desc:"descending"},B={asc:(0,s.__)("Sort ascending"),desc:(0,s.__)("Sort descending")},z={asc:u,desc:c},H="table",R="grid",$=(0,r.createContext)({view:{type:H},onChangeView:()=>{},fields:[],data:[],paginationInfo:{totalItems:0,totalPages:0},selection:[],onChangeSelection:()=>{},setOpenedFilter:()=>{},openedFilter:null,getItemId:e=>e.id,isItemClickable:()=>!0,renderItemLink:void 0,containerWidth:0,containerRef:(0,r.createRef)(),resizeObserverRef:()=>{},defaultLayouts:{list:{},grid:{},table:{}},filters:[],isShowingFilter:!1,setIsShowingFilter:()=>{},hasInfiniteScrollHandler:!1,config:{perPageSizes:[]}});$.displayName="DataViewsContext";var W=$,q=(0,o.jsx)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(l.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z"})}),K=(0,o.jsx)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(l.Path,{d:"M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",fillRule:"evenodd",clipRule:"evenodd"})}),G=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.Path,{d:"M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"})}),Y=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})}),U=n(164),Z=n(558);function X({selection:e,onChangeSelection:t,item:n,getItemId:r,titleField:a,disabled:l,...u}){const c=r(n),d=!l&&e.includes(c),f=a?.getValue?.({item:n})||(0,s.__)("(no title)");return(0,o.jsx)(i.CheckboxControl,{className:"dataviews-selection-checkbox",__nextHasNoMarginBottom:!0,"aria-label":f,"aria-disabled":l,checked:d,onChange:()=>{l||t(e.includes(c)?e.filter(e=>c!==e):[...e,c])},...u})}var Q=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})}),J=n(143),ee=n(53),{lock:te,unlock:ne}=(0,ee.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/dataviews"),{Menu:ie,kebabCase:re}=ne(i.privateApis);function ae({action:e,onClick:t,items:n}){const r="string"==typeof e.label?e.label:e.label(n);return(0,o.jsx)(i.Button,{disabled:!!e.disabled,accessibleWhenDisabled:!0,size:"compact",onClick:t,children:r})}function se({action:e,onClick:t,items:n}){const i="string"==typeof e.label?e.label:e.label(n);return(0,o.jsx)(ie.Item,{disabled:e.disabled,onClick:t,children:(0,o.jsx)(ie.ItemLabel,{children:i})})}function le({action:e,items:t,closeModal:n}){const r="string"==typeof e.label?e.label:e.label(t),a="function"==typeof e.modalHeader?e.modalHeader(t):e.modalHeader;return(0,o.jsx)(i.Modal,{title:a||r,__experimentalHideHeader:!!e.hideModalHeader,onRequestClose:n,focusOnMount:e.modalFocusOnMount??!0,size:e.modalSize||"medium",overlayClassName:`dataviews-action-modal dataviews-action-modal__${re(e.id)}`,children:(0,o.jsx)(e.RenderModal,{items:t,closeModal:n})})}function oe({actions:e,item:t,registry:n,setActiveModalAction:i}){const{primaryActions:a,regularActions:s}=(0,r.useMemo)(()=>e.reduce((e,t)=>((t.isPrimary?e.primaryActions:e.regularActions).push(t),e),{primaryActions:[],regularActions:[]}),[e]),l=e=>e.map(e=>(0,o.jsx)(se,{action:e,onClick:()=>{"RenderModal"in e?i(e):e.callback([t],{registry:n})},items:[t]},e.id));return(0,o.jsxs)(ie.Group,{children:[l(a),a.length>0&&s.length>0&&(0,o.jsx)(ie.Separator,{}),l(s)]})}function ue({item:e,actions:t,isCompact:n}){const a=(0,J.useRegistry)(),{primaryActions:s,eligibleActions:l}=(0,r.useMemo)(()=>{const n=t.filter(t=>!t.isEligible||t.isEligible(e));return{primaryActions:n.filter(e=>e.isPrimary),eligibleActions:n}},[t,e]);return n?(0,o.jsx)(ce,{item:e,actions:l,isSmall:!0,registry:a}):(0,o.jsxs)(i.__experimentalHStack,{spacing:0,justify:"flex-end",className:"dataviews-item-actions",style:{flexShrink:0,width:"auto"},children:[(0,o.jsx)(de,{item:e,actions:s,registry:a}),s.lengthu(null)})]})}function de({item:e,actions:t,registry:n}){const[i,s]=(0,r.useState)(null);return(0,a.useViewportMatch)("medium","<")?null:Array.isArray(t)&&0!==t.length?(0,o.jsxs)(o.Fragment,{children:[t.map(t=>(0,o.jsx)(ae,{action:t,onClick:()=>{"RenderModal"in t?s(t):t.callback([e],{registry:n})},items:[e]},t.id)),!!i&&(0,o.jsx)(le,{action:i,items:[e],closeModal:()=>s(null)})]}):null}var fe=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.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"})});function me({action:e,items:t,ActionTriggerComponent:n}){const[i,a]=(0,r.useState)(!1),s={action:e,onClick:()=>{a(!0)},items:t};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n,{...s}),i&&(0,o.jsx)(le,{action:e,items:t,closeModal:()=>a(!1)})]})}function ve(e,t){return(0,r.useMemo)(()=>e.some(e=>e.supportsBulk&&(!e.isEligible||e.isEligible(t))),[e,t])}function pe(e,t){return(0,r.useMemo)(()=>t.some(t=>e.some(e=>e.supportsBulk&&(!e.isEligible||e.isEligible(t)))),[e,t])}function he({selection:e,onChangeSelection:t,data:n,actions:a,getItemId:l}){const u=(0,r.useMemo)(()=>n.filter(e=>a.some(t=>t.supportsBulk&&(!t.isEligible||t.isEligible(e)))),[n,a]),c=n.filter(t=>e.includes(l(t))&&u.includes(t)),d=c.length===u.length;return(0,o.jsx)(i.CheckboxControl,{className:"dataviews-view-table-selection-checkbox",__nextHasNoMarginBottom:!0,checked:d,indeterminate:!d&&!!c.length,onChange:()=>{t(d?[]:u.map(e=>l(e)))},"aria-label":d?(0,s.__)("Deselect all"):(0,s.__)("Select all")})}function ge({action:e,onClick:t,isBusy:n,items:r}){const s="string"==typeof e.label?e.label:e.label(r);return(0,a.useViewportMatch)("medium","<")?(0,o.jsx)(i.Button,{disabled:n,accessibleWhenDisabled:!0,label:s,icon:e.icon,size:"compact",onClick:t,isBusy:n}):(0,o.jsx)(i.Button,{disabled:n,accessibleWhenDisabled:!0,size:"compact",onClick:t,isBusy:n,children:s})}var be=[];function xe({action:e,selectedItems:t,actionInProgress:n,setActionInProgress:i}){const a=(0,J.useRegistry)(),s=(0,r.useMemo)(()=>t.filter(t=>!e.isEligible||e.isEligible(t)),[e,t]);return"RenderModal"in e?(0,o.jsx)(me,{action:e,items:s,ActionTriggerComponent:ge},e.id):(0,o.jsx)(ge,{action:e,onClick:async()=>{i(e.id),await e.callback(t,{registry:a}),i(null)},items:s,isBusy:n===e.id},e.id)}function we(e,t,n,r,a,l,u,c,d){const f=l.length>0?(0,s.sprintf)(
-/* translators: %d: number of items. */
-/* translators: %d: number of items. */
-(0,s._n)("%d Item selected","%d Items selected",l.length),l.length):(0,s.sprintf)(
-/* translators: %d: number of items. */
-/* translators: %d: number of items. */
-(0,s._n)("%d Item","%d Items",e.length),e.length);return(0,o.jsxs)(i.__experimentalHStack,{expanded:!1,className:"dataviews-bulk-actions-footer__container",spacing:3,children:[(0,o.jsx)(he,{selection:r,onChangeSelection:d,data:e,actions:t,getItemId:n}),(0,o.jsx)("span",{className:"dataviews-bulk-actions-footer__item-count",children:f}),(0,o.jsxs)(i.__experimentalHStack,{className:"dataviews-bulk-actions-footer__action-buttons",expanded:!1,spacing:1,children:[a.map(e=>(0,o.jsx)(xe,{action:e,selectedItems:l,actionInProgress:u,setActionInProgress:c},e.id)),l.length>0&&(0,o.jsx)(i.Button,{icon:fe,showTooltip:!0,tooltipPosition:"top",size:"compact",label:(0,s.__)("Cancel"),disabled:!!u,accessibleWhenDisabled:!1,onClick:()=>{d(be)}})]})]})}function ye({selection:e,actions:t,onChangeSelection:n,data:i,getItemId:s}){const[l,o]=(0,r.useState)(null),u=(0,r.useRef)(null),c=(0,a.useViewportMatch)("medium","<"),d=(0,r.useMemo)(()=>t.filter(e=>e.supportsBulk),[t]),f=(0,r.useMemo)(()=>i.filter(e=>d.some(t=>!t.isEligible||t.isEligible(e))),[i,d]),m=(0,r.useMemo)(()=>i.filter(t=>e.includes(s(t))&&f.includes(t)),[e,i,s,f]),v=(0,r.useMemo)(()=>t.filter(e=>e.supportsBulk&&(!c||e.icon)&&m.some(t=>!e.isEligible||e.isEligible(t))),[t,m,c]);return l?(u.current||(u.current=we(i,t,s,e,v,m,l,o,n)),u.current):(u.current&&(u.current=null),we(i,t,s,e,v,m,l,o,n))}function _e(){const{data:e,selection:t,actions:n=be,onChangeSelection:i,getItemId:a}=(0,r.useContext)(W);return(0,o.jsx)(ye,{selection:t,onChangeSelection:i,data:e,actions:n,getItemId:a})}var Ce=(0,o.jsx)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(l.Path,{d:"M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z"})}),je=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"})}),Se=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})}),ke=(0,o.jsx)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(l.Path,{d:"M20.7 12.7s0-.1-.1-.2c0-.2-.2-.4-.4-.6-.3-.5-.9-1.2-1.6-1.8-.7-.6-1.5-1.3-2.6-1.8l-.6 1.4c.9.4 1.6 1 2.1 1.5.6.6 1.1 1.2 1.4 1.6.1.2.3.4.3.5v.1l.7-.3.7-.3Zm-5.2-9.3-1.8 4c-.5-.1-1.1-.2-1.7-.2-3 0-5.2 1.4-6.6 2.7-.7.7-1.2 1.3-1.6 1.8-.2.3-.3.5-.4.6 0 0 0 .1-.1.2s0 0 .7.3l.7.3V13c0-.1.2-.3.3-.5.3-.4.7-1 1.4-1.6 1.2-1.2 3-2.3 5.5-2.3H13v.3c-.4 0-.8-.1-1.1-.1-1.9 0-3.5 1.6-3.5 3.5s.6 2.3 1.6 2.9l-2 4.4.9.4 7.6-16.2-.9-.4Zm-3 12.6c1.7-.2 3-1.7 3-3.5s-.2-1.4-.6-1.9L12.4 16Z"})}),{Menu:Ve}=ne(i.privateApis);function Ie({children:e}){return r.Children.toArray(e).filter(Boolean).map((e,t)=>(0,o.jsxs)(r.Fragment,{children:[t>0&&(0,o.jsx)(Ve.Separator,{}),e]},t))}var Ee=(0,r.forwardRef)(function({fieldId:e,view:t,fields:n,onChangeView:r,onHide:a,setOpenedFilter:l,canMove:u=!0},c){const d=t.fields??[],f=d?.indexOf(e),m=t.sort?.field===e;let v=!1,p=!1,h=!1,g=[];const b=n.find(t=>t.id===e);if(!b)return null;v=!1!==b.enableHiding,p=!1!==b.enableSorting;const x=b.header;return g=!!b.filterBy&&b.filterBy?.operators||[],h=!(t.filters?.some(t=>e===t.field)||!b.hasElements&&!b.Edit||!1===b.filterBy||b.filterBy?.isPrimary),p||u||v||h?(0,o.jsxs)(Ve,{children:[(0,o.jsxs)(Ve.TriggerButton,{render:(0,o.jsx)(i.Button,{size:"compact",className:"dataviews-view-table-header-button",ref:c,variant:"tertiary"}),children:[x,t.sort&&m&&(0,o.jsx)("span",{"aria-hidden":"true",children:D[t.sort.direction]})]}),(0,o.jsx)(Ve.Popover,{style:{minWidth:"240px"},children:(0,o.jsxs)(Ie,{children:[p&&(0,o.jsx)(Ve.Group,{children:L.map(n=>{const i=t.sort&&m&&t.sort.direction===n,a=`${e}-${n}`;return(0,o.jsx)(Ve.RadioItem,{name:"view-table-sorting",value:a,checked:i,onChange:()=>{r({...t,sort:{field:e,direction:n},showLevels:!1})},children:(0,o.jsx)(Ve.ItemLabel,{children:B[n]})},a)})}),h&&(0,o.jsx)(Ve.Group,{children:(0,o.jsx)(Ve.Item,{prefix:(0,o.jsx)(i.Icon,{icon:Ce}),onClick:()=>{l(e),r({...t,page:1,filters:[...t.filters||[],{field:e,value:void 0,operator:g[0]}]})},children:(0,o.jsx)(Ve.ItemLabel,{children:(0,s.__)("Add filter")})})}),(u||v)&&b&&(0,o.jsxs)(Ve.Group,{children:[u&&(0,o.jsx)(Ve.Item,{prefix:(0,o.jsx)(i.Icon,{icon:je}),disabled:f<1,onClick:()=>{r({...t,fields:[...d.slice(0,f-1)??[],e,d[f-1],...d.slice(f+1)]})},children:(0,o.jsx)(Ve.ItemLabel,{children:(0,s.__)("Move left")})}),u&&(0,o.jsx)(Ve.Item,{prefix:(0,o.jsx)(i.Icon,{icon:Se}),disabled:f>=d.length-1,onClick:()=>{r({...t,fields:[...d.slice(0,f)??[],d[f+1],e,...d.slice(f+2)]})},children:(0,o.jsx)(Ve.ItemLabel,{children:(0,s.__)("Move right")})}),v&&b&&(0,o.jsx)(Ve.Item,{prefix:(0,o.jsx)(i.Icon,{icon:ke}),onClick:()=>{a(b),r({...t,fields:d.filter(t=>t!==e)})},children:(0,o.jsx)(Ve.ItemLabel,{children:(0,s.__)("Hide column")})})]})]})})]}):x}),Ne=Ee;function Fe({item:e,isItemClickable:t,onClickItem:n,renderItemLink:i,className:a,children:s,...l}){if(!t(e))return(0,o.jsx)("div",{className:a,...l,children:s});if(i){const t=i({item:e,className:`${a} ${a}--clickable`,...l,children:s});return(0,r.cloneElement)(t,{onClick:e=>{e.stopPropagation(),t.props.onClick&&t.props.onClick(e)},onKeyDown:e=>{"Enter"!==e.key&&""!==e.key&&" "!==e.key||(e.stopPropagation(),t.props.onKeyDown&&t.props.onKeyDown(e))}})}const u=function({item:e,isItemClickable:t,onClickItem:n,className:i}){return t(e)&&n?{className:i?`${i} ${i}--clickable`:void 0,role:"button",tabIndex:0,onClick:t=>{t.stopPropagation(),n(e)},onKeyDown:t=>{"Enter"!==t.key&&""!==t.key&&" "!==t.key||(t.stopPropagation(),n(e))}}:{className:i}}({item:e,isItemClickable:t,onClickItem:n,className:a});return(0,o.jsx)("div",{...u,...l,children:s})}var Me=function({item:e,level:t,titleField:n,mediaField:r,descriptionField:a,onClickItem:s,renderItemLink:l,isItemClickable:u}){return(0,o.jsxs)(i.__experimentalHStack,{spacing:3,justify:"flex-start",children:[r&&(0,o.jsx)(Fe,{item:e,isItemClickable:u,onClickItem:s,renderItemLink:l,className:"dataviews-view-table__cell-content-wrapper dataviews-column-primary__media","aria-label":u(e)&&(s||l)&&n?n.getValue?.({item:e}):void 0,children:(0,o.jsx)(r.render,{item:e,field:r,config:{sizes:"32px"}})}),(0,o.jsxs)(i.__experimentalVStack,{spacing:0,alignment:"flex-start",className:"dataviews-view-table__primary-column-content",children:[n&&(0,o.jsxs)(Fe,{item:e,isItemClickable:u,onClickItem:s,renderItemLink:l,className:"dataviews-view-table__cell-content-wrapper dataviews-title-field",children:[void 0!==t&&t>0&&(0,o.jsxs)("span",{className:"dataviews-view-table__level",children:["—".repeat(t)," "]}),(0,o.jsx)(n.render,{item:e,field:n})]}),a&&(0,o.jsx)(a.render,{item:e,field:a})]})]})};function Ae(e,t){return e.reduce((e,n)=>{const i=t.getValue({item:n});return e.has(i)||e.set(i,[]),e.get(i)?.push(n),e},new Map)}var Oe=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.Path,{d:"M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z"})});function Pe({field:e,isVisible:t,onToggleVisibility:n}){return(0,o.jsx)(i.__experimentalItem,{onClick:e.enableHiding?n:void 0,children:(0,o.jsxs)(i.__experimentalHStack,{expanded:!0,justify:"flex-start",alignment:"center",children:[(0,o.jsx)("div",{style:{height:24,width:24},children:t&&(0,o.jsx)(i.Icon,{icon:Oe})}),(0,o.jsx)("span",{className:"dataviews-view-config__label",children:e.label})]})})}function Le(e){return!!e}function De({showLabel:e=!0}){const{view:t,fields:n,onChangeView:a}=(0,r.useContext)(W),l=[t?.titleField,t?.mediaField,t?.descriptionField].filter(Boolean),u=n.filter(e=>!l.includes(e.id)&&"media"!==e.type&&!1!==e.enableHiding);if(!u?.length)return null;const c=n.find(e=>e.id===t.titleField),d=n.find(e=>e.id===t.mediaField),f=n.find(e=>e.id===t.descriptionField),m=[{field:c,isVisibleFlag:"showTitle"},{field:d,isVisibleFlag:"showMedia"},{field:f,isVisibleFlag:"showDescription"}].filter(({field:e})=>Le(e)),v=t.fields??[],p=u.filter(e=>v.includes(e.id)).length;let h=m.filter(({field:e,isVisibleFlag:n})=>Le(e)&&(t[n]??!0));const g=h.length+p;1===g&&1===h.length&&(h=h.map(e=>({...e,field:{...e.field,enableHiding:!1}})));const b=m.filter(({field:e,isVisibleFlag:n})=>Le(e)&&!(t[n]??1));return(0,o.jsxs)(i.__experimentalVStack,{className:"dataviews-field-control",spacing:0,children:[e&&(0,o.jsx)(i.BaseControl.VisualLabel,{children:(0,s.__)("Properties")}),(0,o.jsx)(i.__experimentalVStack,{className:"dataviews-view-config__properties",spacing:0,children:(0,o.jsxs)(i.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,size:"medium",children:[h.map(({field:e,isVisibleFlag:n})=>(0,o.jsx)(Pe,{field:e,isVisible:!0,onToggleVisibility:()=>{a({...t,[n]:!1})}},e.id)),b.map(({field:e,isVisibleFlag:n})=>(0,o.jsx)(Pe,{field:e,isVisible:!1,onToggleVisibility:()=>{a({...t,[n]:!0})}},e.id)),u.map(e=>{const n=v.includes(e.id),i=1===g&&n?{...e,enableHiding:!1}:e;return(0,o.jsx)(Pe,{field:i,isVisible:n,onToggleVisibility:()=>{a({...t,fields:n?v.filter(t=>t!==e.id):[...v,e.id]})}},e.id)})]})})]})}function Te({item:e,fields:t,column:n,align:i}){const r=t.find(e=>e.id===n);if(!r)return null;const a=(0,U.A)("dataviews-view-table__cell-content-wrapper",{"dataviews-view-table__cell-align-end":"end"===i,"dataviews-view-table__cell-align-center":"center"===i});return(0,o.jsx)("div",{className:a,children:(0,o.jsx)(r.render,{item:e,field:r})})}function Be({hasBulkActions:e,item:t,level:n,actions:i,fields:a,id:s,view:l,titleField:u,mediaField:c,descriptionField:d,selection:f,getItemId:m,isItemClickable:v,onClickItem:p,renderItemLink:h,onChangeSelection:g,isActionsColumnSticky:b,posinset:x}){const{paginationInfo:w}=(0,r.useContext)(W),y=ve(i,t),_=y&&f.includes(s),[C,j]=(0,r.useState)(!1),{showTitle:S=!0,showMedia:k=!0,showDescription:V=!0,infiniteScrollEnabled:I}=l,E=(0,r.useRef)(!1),N=l.fields??[],F=u&&S||c&&k||d&&V;return(0,o.jsxs)("tr",{className:(0,U.A)("dataviews-view-table__row",{"is-selected":y&&_,"is-hovered":C,"has-bulk-actions":y}),onMouseEnter:()=>{j(!0)},onMouseLeave:()=>{j(!1)},onTouchStart:()=>{E.current=!0},"aria-setsize":I?w.totalItems:void 0,"aria-posinset":x,role:I?"article":void 0,onClick:e=>{y&&(E.current||"Range"===document.getSelection()?.type||(((0,Z.isAppleOS)()?e.metaKey:e.ctrlKey)?g(f.includes(s)?f.filter(e=>s!==e):[...f,s]):g(f.includes(s)?f.filter(e=>s!==e):[s])))},children:[e&&(0,o.jsx)("td",{className:"dataviews-view-table__checkbox-column",children:(0,o.jsx)("div",{className:"dataviews-view-table__cell-content-wrapper",children:(0,o.jsx)(X,{item:t,selection:f,onChangeSelection:g,getItemId:m,titleField:u,disabled:!y})})}),F&&(0,o.jsx)("td",{children:(0,o.jsx)(Me,{item:t,level:n,titleField:S?u:void 0,mediaField:k?c:void 0,descriptionField:V?d:void 0,isItemClickable:v,onClickItem:p,renderItemLink:h})}),N.map(e=>{const{width:n,maxWidth:i,minWidth:r,align:s}=l.layout?.styles?.[e]??{};return(0,o.jsx)("td",{style:{width:n,maxWidth:i,minWidth:r},children:(0,o.jsx)(Te,{fields:a,item:t,column:e,align:s})},e)}),!!i?.length&&(0,o.jsx)("td",{className:(0,U.A)("dataviews-view-table__actions-column",{"dataviews-view-table__actions-column--sticky":!0,"dataviews-view-table__actions-column--stuck":b}),onClick:e=>e.stopPropagation(),children:(0,o.jsx)(ue,{item:t,actions:i})})]})}var ze=(0,r.forwardRef)(({className:e,previewSize:t,...n},i)=>(0,o.jsx)("div",{ref:i,className:(0,U.A)("dataviews-view-grid-items",e),style:{gridTemplateColumns:t&&`repeat(auto-fill, minmax(${t}px, 1fr))`},...n})),{Badge:He}=ne(i.privateApis);function Re({view:e,selection:t,onChangeSelection:n,onClickItem:l,isItemClickable:u,renderItemLink:c,getItemId:d,item:f,actions:m,mediaField:v,titleField:p,descriptionField:h,regularFields:g,badgeFields:b,hasBulkActions:x,config:w,posinset:y}){const{showTitle:_=!0,showMedia:C=!0,showDescription:j=!0,infiniteScrollEnabled:S}=e,k=ve(m,f),V=d(f),I=(0,a.useInstanceId)(Re),E=t.includes(V),N=v?.render?(0,o.jsx)(v.render,{item:f,field:v,config:w}):null,F=_&&p?.render?(0,o.jsx)(p.render,{item:f,field:p}):null,M=C&&N;let A,O;u(f)&&l&&(F?(A={"aria-labelledby":`dataviews-view-grid__title-field-${I}`},O={id:`dataviews-view-grid__title-field-${I}`}):A={"aria-label":(0,s.__)("Navigate to item")});const{paginationInfo:P}=(0,r.useContext)(W);return(0,o.jsxs)(i.__experimentalVStack,{spacing:0,className:(0,U.A)("dataviews-view-grid__card",{"is-selected":k&&E}),onClickCapture:e=>{if((0,Z.isAppleOS)()?e.metaKey:e.ctrlKey){if(e.stopPropagation(),e.preventDefault(),!k)return;n(t.includes(V)?t.filter(e=>V!==e):[...t,V])}},role:S?"article":void 0,"aria-setsize":S?P.totalItems:void 0,"aria-posinset":y,children:[M&&(0,o.jsx)(Fe,{item:f,isItemClickable:u,onClickItem:l,renderItemLink:c,className:"dataviews-view-grid__media",...A,children:N}),x&&M&&(0,o.jsx)(X,{item:f,selection:t,onChangeSelection:n,getItemId:d,titleField:p,disabled:!k}),!_&&M&&!!m?.length&&(0,o.jsx)("div",{className:"dataviews-view-grid__media-actions",children:(0,o.jsx)(ue,{item:f,actions:m,isCompact:!0})}),_&&(0,o.jsxs)(i.__experimentalHStack,{justify:"space-between",className:"dataviews-view-grid__title-actions",children:[(0,o.jsx)(Fe,{item:f,isItemClickable:u,onClickItem:l,renderItemLink:c,className:"dataviews-view-grid__title-field dataviews-title-field",...O,children:F}),!!m?.length&&(0,o.jsx)(ue,{item:f,actions:m,isCompact:!0})]}),(0,o.jsxs)(i.__experimentalVStack,{spacing:1,children:[j&&h?.render&&(0,o.jsx)(h.render,{item:f,field:h}),!!b?.length&&(0,o.jsx)(i.__experimentalHStack,{className:"dataviews-view-grid__badge-fields",spacing:2,wrap:!0,alignment:"top",justify:"flex-start",children:b.map(e=>(0,o.jsx)(He,{className:"dataviews-view-grid__field-value",children:(0,o.jsx)(e.render,{item:f,field:e})},e.id))}),!!g?.length&&(0,o.jsx)(i.__experimentalVStack,{className:"dataviews-view-grid__fields",spacing:1,children:g.map(e=>(0,o.jsx)(i.Flex,{className:"dataviews-view-grid__field",gap:1,justify:"flex-start",expanded:!0,style:{height:"auto"},direction:"row",children:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i.Tooltip,{text:e.label,children:(0,o.jsx)(i.FlexItem,{className:"dataviews-view-grid__field-name",children:e.header})}),(0,o.jsx)(i.FlexItem,{className:"dataviews-view-grid__field-value",style:{maxHeight:"none"},children:(0,o.jsx)(e.render,{item:f,field:e})})]})},e.id))})]})]},V)}var{Menu:$e}=ne(i.privateApis);function We(e){return`${e}-item-wrapper`}function qe(e){return`${e}-dropdown`}function Ke({idPrefix:e,primaryAction:t,item:n}){const a=(0,J.useRegistry)(),[s,l]=(0,r.useState)(!1),u=function(e,t){return`${e}-primary-action-${t}`}(e,t.id),c="string"==typeof t.label?t.label:t.label([n]);return"RenderModal"in t?(0,o.jsx)("div",{role:"gridcell",children:(0,o.jsx)(i.Composite.Item,{id:u,render:(0,o.jsx)(i.Button,{disabled:!!t.disabled,accessibleWhenDisabled:!0,text:c,size:"small",onClick:()=>l(!0)}),children:s&&(0,o.jsx)(le,{action:t,items:[n],closeModal:()=>l(!1)})})},t.id):(0,o.jsx)("div",{role:"gridcell",children:(0,o.jsx)(i.Composite.Item,{id:u,render:(0,o.jsx)(i.Button,{disabled:!!t.disabled,accessibleWhenDisabled:!0,size:"small",onClick:()=>{t.callback([n],{registry:a})},children:c})})},t.id)}function Ge({view:e,actions:t,idPrefix:n,isSelected:a,item:l,titleField:u,mediaField:c,descriptionField:d,onSelect:f,otherFields:m,onDropdownTriggerKeyDown:v,posinset:p}){const{showTitle:h=!0,showMedia:g=!0,showDescription:b=!0,infiniteScrollEnabled:x}=e,w=(0,r.useRef)(null),y=`${n}-label`,_=`${n}-description`,C=(0,J.useRegistry)(),[j,S]=(0,r.useState)(!1),[k,V]=(0,r.useState)(null),I=({type:e})=>{S("mouseenter"===e)},{paginationInfo:E}=(0,r.useContext)(W);(0,r.useEffect)(()=>{a&&w.current?.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"})},[a]);const{primaryAction:N,eligibleActions:F}=(0,r.useMemo)(()=>{const e=t.filter(e=>!e.isEligible||e.isEligible(l));return{primaryAction:e.filter(e=>e.isPrimary)[0],eligibleActions:e}},[t,l]),M=N&&1===t.length,A=g&&c?.render?(0,o.jsx)("div",{className:"dataviews-view-list__media-wrapper",children:(0,o.jsx)(c.render,{item:l,field:c,config:{sizes:"52px"}})}):null,O=h&&u?.render?(0,o.jsx)(u.render,{item:l,field:u}):null,P=F?.length>0&&(0,o.jsxs)(i.__experimentalHStack,{spacing:3,className:"dataviews-view-list__item-actions",children:[N&&(0,o.jsx)(Ke,{idPrefix:n,primaryAction:N,item:l}),!M&&(0,o.jsxs)("div",{role:"gridcell",children:[(0,o.jsxs)($e,{placement:"bottom-end",children:[(0,o.jsx)($e.TriggerButton,{render:(0,o.jsx)(i.Composite.Item,{id:qe(n),render:(0,o.jsx)(i.Button,{size:"small",icon:Q,label:(0,s.__)("Actions"),accessibleWhenDisabled:!0,disabled:!t.length,onKeyDown:v})})}),(0,o.jsx)($e.Popover,{children:(0,o.jsx)(oe,{actions:F,item:l,registry:C,setActiveModalAction:V})})]}),!!k&&(0,o.jsx)(le,{action:k,items:[l],closeModal:()=>V(null)})]})]});return(0,o.jsx)(i.Composite.Row,{ref:w,render:(0,o.jsx)("div",{"aria-posinset":p,"aria-setsize":x?E.totalItems:void 0}),role:x?"article":"row",className:(0,U.A)({"is-selected":a,"is-hovered":j}),onMouseEnter:I,onMouseLeave:I,children:(0,o.jsxs)(i.__experimentalHStack,{className:"dataviews-view-list__item-wrapper",spacing:0,children:[(0,o.jsx)("div",{role:"gridcell",children:(0,o.jsx)(i.Composite.Item,{id:We(n),"aria-pressed":a,"aria-labelledby":y,"aria-describedby":_,className:"dataviews-view-list__item",onClick:()=>f(l)})}),(0,o.jsxs)(i.__experimentalHStack,{spacing:3,justify:"start",alignment:"flex-start",children:[A,(0,o.jsxs)(i.__experimentalVStack,{spacing:1,className:"dataviews-view-list__field-wrapper",children:[(0,o.jsxs)(i.__experimentalHStack,{spacing:0,children:[(0,o.jsx)("div",{className:"dataviews-title-field",id:y,children:O}),P]}),b&&d?.render&&(0,o.jsx)("div",{className:"dataviews-view-list__field",children:(0,o.jsx)(d.render,{item:l,field:d})}),(0,o.jsx)("div",{className:"dataviews-view-list__fields",id:_,children:m.map(e=>(0,o.jsxs)("div",{className:"dataviews-view-list__field",children:[(0,o.jsx)(i.VisuallyHidden,{as:"span",className:"dataviews-view-list__field-label",children:e.label}),(0,o.jsx)("span",{className:"dataviews-view-list__field-value",children:(0,o.jsx)(e.render,{item:l,field:e})})]},e.id))})]})]})]})})}function Ye(e){return!!e}function Ue(e){return(0,r.useMemo)(()=>e?.every(e=>e.supportsBulk),[e])}var{Badge:Ze}=ne(i.privateApis);function Xe({view:e,multiselect:t,selection:n,onChangeSelection:r,getItemId:a,item:l,mediaField:u,titleField:c,descriptionField:d,regularFields:f,badgeFields:m,config:v,posinset:p,setsize:h}){const{showTitle:g=!0,showMedia:b=!0,showDescription:x=!0}=e,w=a(l),y=n.includes(w),_=u?.render?(0,o.jsx)(u.render,{item:l,field:u,config:v}):null,C=g&&c?.render?(0,o.jsx)(c.render,{item:l,field:c}):null;return(0,o.jsxs)(i.Composite.Item,{"aria-label":c?c.getValue({item:l})||(0,s.__)("(no title)"):void 0,render:({children:e,...t})=>(0,o.jsx)(i.__experimentalVStack,{spacing:0,children:e,...t}),role:"option","aria-posinset":p,"aria-setsize":h,className:(0,U.A)("dataviews-view-picker-grid__card",{"is-selected":y}),"aria-selected":y,onClick:()=>{if(y)r(n.filter(e=>w!==e));else{const e=t?[...n,w]:[w];r(e)}},children:[b&&_&&(0,o.jsx)("div",{className:"dataviews-view-picker-grid__media",children:_}),b&&_&&(0,o.jsx)(X,{item:l,selection:n,onChangeSelection:r,getItemId:a,titleField:c,disabled:!1,"aria-hidden":!0,tabIndex:-1}),g&&(0,o.jsx)(i.__experimentalHStack,{justify:"space-between",className:"dataviews-view-picker-grid__title-actions",children:(0,o.jsx)("div",{className:"dataviews-view-picker-grid__title-field dataviews-title-field",children:C})}),(0,o.jsxs)(i.__experimentalVStack,{spacing:1,children:[x&&d?.render&&(0,o.jsx)(d.render,{item:l,field:d}),!!m?.length&&(0,o.jsx)(i.__experimentalHStack,{className:"dataviews-view-picker-grid__badge-fields",spacing:2,wrap:!0,alignment:"top",justify:"flex-start",children:m.map(e=>(0,o.jsx)(Ze,{className:"dataviews-view-picker-grid__field-value",children:(0,o.jsx)(e.render,{item:l,field:e})},e.id))}),!!f?.length&&(0,o.jsx)(i.__experimentalVStack,{className:"dataviews-view-picker-grid__fields",spacing:1,children:f.map(e=>(0,o.jsx)(i.Flex,{className:"dataviews-view-picker-grid__field",gap:1,justify:"flex-start",expanded:!0,style:{height:"auto"},direction:"row",children:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i.FlexItem,{className:"dataviews-view-picker-grid__field-name",children:e.header}),(0,o.jsx)(i.FlexItem,{className:"dataviews-view-picker-grid__field-value",style:{maxHeight:"none"},children:(0,o.jsx)(e.render,{item:l,field:e})})]})},e.id))})]})]},w)}function Qe({groupName:e,groupField:t,children:n}){const r=(0,a.useInstanceId)(Qe,"dataviews-view-picker-grid-group__header");return(0,o.jsxs)(i.__experimentalVStack,{spacing:2,role:"group","aria-labelledby":r,children:[(0,o.jsx)("h3",{className:"dataviews-view-picker-grid-group__header",id:r,children:(0,s.sprintf)(
-// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
-// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
-(0,s.__)("%1$s: %2$s"),t.label,e)}),n]},e)}function Je({item:e,fields:t,column:n,align:i}){const r=t.find(e=>e.id===n);if(!r)return null;const a=(0,U.A)("dataviews-view-table__cell-content-wrapper",{"dataviews-view-table__cell-align-end":"end"===i,"dataviews-view-table__cell-align-center":"center"===i});return(0,o.jsx)("div",{className:a,children:(0,o.jsx)(r.render,{item:e,field:r})})}function et({item:e,fields:t,id:n,view:a,titleField:s,mediaField:l,descriptionField:u,selection:c,getItemId:d,onChangeSelection:f,multiselect:m,posinset:v}){const{paginationInfo:p}=(0,r.useContext)(W),h=c.includes(n),[g,b]=(0,r.useState)(!1),{showTitle:x=!0,showMedia:w=!0,showDescription:y=!0,infiniteScrollEnabled:_}=a,C=()=>{b(!0)},j=()=>{b(!1)},S=a.fields??[],k=s&&x||l&&w||u&&y;return(0,o.jsxs)(i.Composite.Item,{render:({children:e,...t})=>(0,o.jsx)("tr",{className:(0,U.A)("dataviews-view-table__row",{"is-selected":h,"is-hovered":g}),onMouseEnter:C,onMouseLeave:j,children:e,...t}),"aria-selected":h,"aria-setsize":p.totalItems||void 0,"aria-posinset":v,role:_?"article":"option",onClick:()=>{if(h)f(c.filter(e=>n!==e));else{const e=m?[...c,n]:[n];f(e)}},children:[(0,o.jsx)("td",{className:"dataviews-view-table__checkbox-column",role:"presentation",children:(0,o.jsx)("div",{className:"dataviews-view-table__cell-content-wrapper",children:(0,o.jsx)(X,{item:e,selection:c,onChangeSelection:f,getItemId:d,titleField:s,disabled:!1,"aria-hidden":!0,tabIndex:-1})})}),k&&(0,o.jsx)("td",{role:"presentation",children:(0,o.jsx)(Me,{item:e,titleField:x?s:void 0,mediaField:w?l:void 0,descriptionField:y?u:void 0,isItemClickable:()=>!1})}),S.map(n=>{const{width:i,maxWidth:r,minWidth:s,align:l}=a.layout?.styles?.[n]??{};return(0,o.jsx)("td",{style:{width:i,maxWidth:r,minWidth:s},role:"presentation",children:(0,o.jsx)(Je,{fields:t,item:e,column:n,align:l})},n)})]},n)}var tt=[{value:120,breakpoint:1},{value:170,breakpoint:1},{value:230,breakpoint:1},{value:290,breakpoint:1112},{value:350,breakpoint:1636},{value:430,breakpoint:588}];function nt(){const e=(0,r.useContext)(W),t=e.view,n=tt.filter(t=>e.containerWidth>=t.breakpoint),a=t.layout?.previewSize??230,l=n.map((e,t)=>({...e,index:t})).filter(e=>e.value<=a).sort((e,t)=>t.value-e.value)[0]?.index??0,u=n.map((e,t)=>({value:t}));return(0,o.jsx)(i.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,showTooltip:!1,label:(0,s.__)("Preview size"),value:l,min:0,max:n.length-1,withInputField:!1,onChange:(i=0)=>{e.onChangeView({...t,layout:{...t.layout,previewSize:n[i].value}})},step:1,marks:u})}function it(){const e=(0,r.useContext)(W),t=e.view;return(0,o.jsxs)(i.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:(0,s.__)("Density"),value:t.layout?.density||"balanced",onChange:n=>{e.onChangeView({...t,layout:{...t.layout,density:n}})},isBlock:!0,children:[(0,o.jsx)(i.__experimentalToggleGroupControlOption,{value:"comfortable",label:(0,s._x)("Comfortable","Density option for DataView layout")},"comfortable"),(0,o.jsx)(i.__experimentalToggleGroupControlOption,{value:"balanced",label:(0,s._x)("Balanced","Density option for DataView layout")},"balanced"),(0,o.jsx)(i.__experimentalToggleGroupControlOption,{value:"compact",label:(0,s._x)("Compact","Density option for DataView layout")},"compact")]})}var rt=[{type:H,label:(0,s.__)("Table"),component:function({actions:e,data:t,fields:n,getItemId:l,getItemLevel:u,isLoading:c=!1,onChangeView:d,onChangeSelection:f,selection:m,setOpenedFilter:v,onClickItem:p,isItemClickable:h,renderItemLink:g,view:b,className:x,empty:w}){const{containerRef:y}=(0,r.useContext)(W),_=(0,r.useRef)(new Map),C=(0,r.useRef)(),[j,S]=(0,r.useState)(),k=pe(e,t),[V,I]=(0,r.useState)(null);(0,r.useEffect)(()=>{C.current&&(C.current.focus(),C.current=void 0)});const E=(0,r.useId)(),N=function({scrollContainerRef:e,enabled:t=!1}){const[n,i]=(0,r.useState)(!1),l=(0,a.useDebounce)((0,r.useCallback)(()=>{const t=e.current;var n;t&&i((n=t,(0,s.isRTL)()?Math.abs(n.scrollLeft)<=1:n.scrollLeft+n.clientWidth>=n.scrollWidth-1))},[e,i]),200);return(0,r.useEffect)(()=>"undefined"!=typeof window&&t&&e.current?(l(),e.current.addEventListener("scroll",l),window.addEventListener("resize",l),()=>{e.current?.removeEventListener("scroll",l),window.removeEventListener("resize",l)}):()=>{},[e,t]),n}({scrollContainerRef:y,enabled:!!e?.length});if(j)return C.current=j,void S(void 0);const F=e=>{const t=_.current.get(e.id),n=t?_.current.get(t.fallback):void 0;S(n?.node)},M=e=>{e.preventDefault(),e.stopPropagation();const t={getBoundingClientRect:()=>({x:e.clientX,y:e.clientY,top:e.clientY,left:e.clientX,right:e.clientX,bottom:e.clientY,width:0,height:0,toJSON:()=>({})})};window.requestAnimationFrame(()=>{I(t)})},A=!!t?.length,O=n.find(e=>e.id===b.titleField),P=n.find(e=>e.id===b.mediaField),L=n.find(e=>e.id===b.descriptionField),D=b.groupByField?n.find(e=>e.id===b.groupByField):null,B=D?Ae(t,D):null,{showTitle:z=!0,showMedia:H=!0,showDescription:R=!0}=b,$=O&&z||P&&H||L&&R,q=b.fields??[],K=(e,t)=>n=>{n?_.current.set(e,{node:n,fallback:q[t>0?t-1:1]}):_.current.delete(e)},G=b.infiniteScrollEnabled&&!B;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("table",{className:(0,U.A)("dataviews-view-table",x,{[`has-${b.layout?.density}-density`]:b.layout?.density&&["compact","comfortable"].includes(b.layout.density)}),"aria-busy":c,"aria-describedby":E,role:G?"feed":void 0,children:[(0,o.jsxs)("colgroup",{children:[k&&(0,o.jsx)("col",{className:"dataviews-view-table__col-checkbox"}),$&&(0,o.jsx)("col",{className:"dataviews-view-table__col-primary"}),q.map(e=>(0,o.jsx)("col",{className:`dataviews-view-table__col-${e}`},`col-${e}`)),!!e?.length&&(0,o.jsx)("col",{className:"dataviews-view-table__col-actions"})]}),V&&(0,o.jsx)(i.Popover,{anchor:V,onClose:()=>I(null),placement:"bottom-start",children:(0,o.jsx)(De,{showLabel:!1})}),(0,o.jsx)("thead",{onContextMenu:M,children:(0,o.jsxs)("tr",{className:"dataviews-view-table__row",children:[k&&(0,o.jsx)("th",{className:"dataviews-view-table__checkbox-column",scope:"col",onContextMenu:M,children:(0,o.jsx)(he,{selection:m,onChangeSelection:f,data:t,actions:e,getItemId:l})}),$&&(0,o.jsx)("th",{scope:"col",children:O&&(0,o.jsx)(Ne,{ref:K(O.id,0),fieldId:O.id,view:b,fields:n,onChangeView:d,onHide:F,setOpenedFilter:v,canMove:!1})}),q.map((e,t)=>{const{width:i,maxWidth:r,minWidth:a,align:s}=b.layout?.styles?.[e]??{};return(0,o.jsx)("th",{style:{width:i,maxWidth:r,minWidth:a,textAlign:s},"aria-sort":b.sort?.direction&&b.sort?.field===e?T[b.sort.direction]:void 0,scope:"col",children:(0,o.jsx)(Ne,{ref:K(e,t),fieldId:e,view:b,fields:n,onChangeView:d,onHide:F,setOpenedFilter:v,canMove:b.layout?.enableMoving??!0})},e)}),!!e?.length&&(0,o.jsx)("th",{className:(0,U.A)("dataviews-view-table__actions-column",{"dataviews-view-table__actions-column--sticky":!0,"dataviews-view-table__actions-column--stuck":!N}),children:(0,o.jsx)("span",{className:"dataviews-view-table-header",children:(0,s.__)("Actions")})})]})}),A&&D&&B?Array.from(B.entries()).map(([t,i])=>(0,o.jsxs)("tbody",{children:[(0,o.jsx)("tr",{className:"dataviews-view-table__group-header-row",children:(0,o.jsx)("td",{colSpan:q.length+($?1:0)+(k?1:0)+(e?.length?1:0),className:"dataviews-view-table__group-header-cell",children:(0,s.sprintf)(
-// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
-// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
-(0,s.__)("%1$s: %2$s"),D.label,t)})}),i.map((t,i)=>(0,o.jsx)(Be,{item:t,level:b.showLevels&&"function"==typeof u?u(t):void 0,hasBulkActions:k,actions:e,fields:n,id:l(t)||i.toString(),view:b,titleField:O,mediaField:P,descriptionField:L,selection:m,getItemId:l,onChangeSelection:f,onClickItem:p,renderItemLink:g,isItemClickable:h,isActionsColumnSticky:!N},l(t)))]},`group-${t}`)):(0,o.jsx)("tbody",{children:A&&t.map((t,i)=>(0,o.jsx)(Be,{item:t,level:b.showLevels&&"function"==typeof u?u(t):void 0,hasBulkActions:k,actions:e,fields:n,id:l(t)||i.toString(),view:b,titleField:O,mediaField:P,descriptionField:L,selection:m,getItemId:l,onChangeSelection:f,onClickItem:p,renderItemLink:g,isItemClickable:h,isActionsColumnSticky:!N,posinset:G?i+1:void 0},l(t)))})]}),(0,o.jsxs)("div",{className:(0,U.A)({"dataviews-loading":c,"dataviews-no-results":!A&&!c}),id:E,children:[!A&&(c?(0,o.jsx)("p",{children:(0,o.jsx)(i.Spinner,{})}):w),A&&c&&(0,o.jsx)("p",{className:"dataviews-loading-more",children:(0,o.jsx)(i.Spinner,{})})]})]})},icon:q,viewConfigOptions:it},{type:R,label:(0,s.__)("Grid"),component:function({actions:e,data:t,fields:n,getItemId:a,isLoading:l,onChangeSelection:u,onClickItem:c,isItemClickable:d,renderItemLink:f,selection:m,view:v,className:p,empty:h}){const{resizeObserverRef:g}=(0,r.useContext)(W),b=n.find(e=>e.id===v?.titleField),x=n.find(e=>e.id===v?.mediaField),w=n.find(e=>e.id===v?.descriptionField),y=v.fields??[],{regularFields:_,badgeFields:C}=y.reduce((e,t)=>{const i=n.find(e=>e.id===t);return i?(e[v.layout?.badgeFields?.includes(t)?"badgeFields":"regularFields"].push(i),e):e},{regularFields:[],badgeFields:[]}),j=!!t?.length,S=pe(e,t),k=v.layout?.previewSize,V="900px",I=v.groupByField?n.find(e=>e.id===v.groupByField):null,E=I?Ae(t,I):null,N=v.infiniteScrollEnabled&&!E;return(0,o.jsxs)(o.Fragment,{children:[j&&I&&E&&(0,o.jsx)(i.__experimentalVStack,{spacing:4,children:Array.from(E.entries()).map(([t,n])=>(0,o.jsxs)(i.__experimentalVStack,{spacing:2,children:[(0,o.jsx)("h3",{className:"dataviews-view-grid__group-header",children:(0,s.sprintf)(
-// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
-// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
-(0,s.__)("%1$s: %2$s"),I.label,t)}),(0,o.jsx)(ze,{className:(0,U.A)("dataviews-view-grid",p),previewSize:k,"aria-busy":l,ref:g,children:n.map(t=>(0,o.jsx)(Re,{view:v,selection:m,onChangeSelection:u,onClickItem:c,isItemClickable:d,renderItemLink:f,getItemId:a,item:t,actions:e,mediaField:x,titleField:b,descriptionField:w,regularFields:_,badgeFields:C,hasBulkActions:S,config:{sizes:V}},a(t)))})]},t))}),j&&!E&&(0,o.jsx)(ze,{className:(0,U.A)("dataviews-view-grid",p),previewSize:k,"aria-busy":l,ref:g,role:N?"feed":void 0,children:t.map((t,n)=>(0,o.jsx)(Re,{view:v,selection:m,onChangeSelection:u,onClickItem:c,isItemClickable:d,renderItemLink:f,getItemId:a,item:t,actions:e,mediaField:x,titleField:b,descriptionField:w,regularFields:_,badgeFields:C,hasBulkActions:S,config:{sizes:V},posinset:N?n+1:void 0},a(t)))}),!j&&(0,o.jsx)("div",{className:(0,U.A)({"dataviews-loading":l,"dataviews-no-results":!l}),children:l?(0,o.jsx)("p",{children:(0,o.jsx)(i.Spinner,{})}):h}),j&&l&&(0,o.jsx)("p",{className:"dataviews-loading-more",children:(0,o.jsx)(i.Spinner,{})})]})},icon:K,viewConfigOptions:nt},{type:"list",label:(0,s.__)("List"),component:function e(t){const{actions:n,data:l,fields:u,getItemId:c,isLoading:d,onChangeSelection:f,selection:m,view:v,className:p,empty:h}=t,g=(0,a.useInstanceId)(e,"view-list"),b=l?.findLast(e=>m.includes(c(e))),x=u.find(e=>e.id===v.titleField),w=u.find(e=>e.id===v.mediaField),y=u.find(e=>e.id===v.descriptionField),_=(v?.fields??[]).map(e=>u.find(t=>e===t.id)).filter(Ye),C=e=>f([c(e)]),j=(0,r.useCallback)(e=>`${g}-${c(e)}`,[g,c]),S=(0,r.useCallback)((e,t)=>t.startsWith(j(e)),[j]),[k,V]=(0,r.useState)(void 0);(0,r.useEffect)(()=>{b&&V(We(j(b)))},[b,j]);const I=l.findIndex(e=>S(e,k??"")),E=(0,a.usePrevious)(I),N=-1!==I,F=(0,r.useCallback)((e,t)=>{const n=Math.min(l.length-1,Math.max(0,e));if(!l[n])return;const i=t(j(l[n]));V(i),document.getElementById(i)?.focus()},[l,j]);(0,r.useEffect)(()=>{!N&&void 0!==E&&-1!==E&&F(E,We)},[N,F,E]);const M=(0,r.useCallback)(e=>{"ArrowDown"===e.key&&(e.preventDefault(),F(I+1,qe)),"ArrowUp"===e.key&&(e.preventDefault(),F(I-1,qe))},[F,I]),A=l?.length;if(!A)return(0,o.jsx)("div",{className:(0,U.A)({"dataviews-loading":d,"dataviews-no-results":!A&&!d}),children:!A&&(d?(0,o.jsx)("p",{children:(0,o.jsx)(i.Spinner,{})}):h)});const O=v.groupByField?u.find(e=>e.id===v.groupByField):null,P=O?Ae(l,O):null;return A&&O&&P?(0,o.jsx)(i.Composite,{id:`${g}`,render:(0,o.jsx)("div",{}),className:"dataviews-view-list__group",role:"grid",activeId:k,setActiveId:V,children:(0,o.jsx)(i.__experimentalVStack,{spacing:4,className:(0,U.A)("dataviews-view-list",p),children:Array.from(P.entries()).map(([e,t])=>(0,o.jsxs)(i.__experimentalVStack,{spacing:2,children:[(0,o.jsx)("h3",{className:"dataviews-view-list__group-header",children:(0,s.sprintf)(
-// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
-// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
-(0,s.__)("%1$s: %2$s"),O.label,e)}),t.map(e=>{const t=j(e);return(0,o.jsx)(Ge,{view:v,idPrefix:t,actions:n,item:e,isSelected:e===b,onSelect:C,mediaField:w,titleField:x,descriptionField:y,otherFields:_,onDropdownTriggerKeyDown:M},t)})]},e))})}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i.Composite,{id:g,render:(0,o.jsx)("div",{}),className:(0,U.A)("dataviews-view-list",p),role:v.infiniteScrollEnabled?"feed":"grid",activeId:k,setActiveId:V,children:l.map((e,t)=>{const i=j(e);return(0,o.jsx)(Ge,{view:v,idPrefix:i,actions:n,item:e,isSelected:e===b,onSelect:C,mediaField:w,titleField:x,descriptionField:y,otherFields:_,onDropdownTriggerKeyDown:M,posinset:v.infiniteScrollEnabled?t+1:void 0},i)})}),A&&d&&(0,o.jsx)("p",{className:"dataviews-loading-more",children:(0,o.jsx)(i.Spinner,{})})]})},icon:(0,s.isRTL)()?G:Y},{type:"pickerGrid",label:(0,s.__)("Grid"),component:function({actions:e,data:t,fields:n,getItemId:a,isLoading:s,onChangeSelection:l,selection:u,view:c,className:d,empty:f}){const{resizeObserverRef:m,paginationInfo:v,itemListLabel:p}=(0,r.useContext)(W),h=n.find(e=>e.id===c?.titleField),g=n.find(e=>e.id===c?.mediaField),b=n.find(e=>e.id===c?.descriptionField),x=c.fields??[],{regularFields:w,badgeFields:y}=x.reduce((e,t)=>{const i=n.find(e=>e.id===t);return i?(e[c.layout?.badgeFields?.includes(t)?"badgeFields":"regularFields"].push(i),e):e},{regularFields:[],badgeFields:[]}),_=!!t?.length,C=c.layout?.previewSize,j=Ue(e),S="900px",k=c.groupByField?n.find(e=>e.id===c.groupByField):null,V=k?Ae(t,k):null,I=c.infiniteScrollEnabled&&!V,E=c?.page??1,N=c?.perPage??0,F=I?v?.totalItems:void 0;return(0,o.jsxs)(o.Fragment,{children:[_&&k&&V&&(0,o.jsx)(i.Composite,{virtualFocus:!0,orientation:"horizontal",role:"listbox","aria-multiselectable":j,className:(0,U.A)("dataviews-view-picker-grid",d),"aria-label":p,render:({children:e,...t})=>(0,o.jsx)(i.__experimentalVStack,{spacing:4,children:e,...t}),children:Array.from(V.entries()).map(([e,n])=>(0,o.jsx)(Qe,{groupName:e,groupField:k,children:(0,o.jsx)(ze,{previewSize:C,style:{gridTemplateColumns:C&&`repeat(auto-fill, minmax(${C}px, 1fr))`},"aria-busy":s,ref:m,children:n.map(e=>{const n=(E-1)*N+t.indexOf(e)+1;return(0,o.jsx)(Xe,{view:c,multiselect:j,selection:u,onChangeSelection:l,getItemId:a,item:e,mediaField:g,titleField:h,descriptionField:b,regularFields:w,badgeFields:y,config:{sizes:S},posinset:n,setsize:F},a(e))})})},e))}),_&&!V&&(0,o.jsx)(i.Composite,{render:(0,o.jsx)(ze,{className:(0,U.A)("dataviews-view-picker-grid",d),previewSize:C,"aria-busy":s,ref:m}),virtualFocus:!0,orientation:"horizontal",role:"listbox","aria-multiselectable":j,"aria-label":p,children:t.map((e,t)=>{let n=I?t+1:void 0;return I||(n=(E-1)*N+t+1),(0,o.jsx)(Xe,{view:c,multiselect:j,selection:u,onChangeSelection:l,getItemId:a,item:e,mediaField:g,titleField:h,descriptionField:b,regularFields:w,badgeFields:y,config:{sizes:S},posinset:n,setsize:F},a(e))})}),!_&&(0,o.jsx)("div",{className:(0,U.A)({"dataviews-loading":s,"dataviews-no-results":!s}),children:s?(0,o.jsx)("p",{children:(0,o.jsx)(i.Spinner,{})}):f}),_&&s&&(0,o.jsx)("p",{className:"dataviews-loading-more",children:(0,o.jsx)(i.Spinner,{})})]})},icon:K,viewConfigOptions:nt,isPicker:!0},{type:"pickerTable",label:(0,s.__)("Table"),component:function({actions:e,data:t,fields:n,getItemId:a,isLoading:l=!1,onChangeView:u,onChangeSelection:c,selection:d,setOpenedFilter:f,view:m,className:v,empty:p}){const h=(0,r.useRef)(new Map),g=(0,r.useRef)(),[b,x]=(0,r.useState)(),w=Ue(e)??!1;(0,r.useEffect)(()=>{g.current&&(g.current.focus(),g.current=void 0)});const y=(0,r.useId)();if(b)return g.current=b,void x(void 0);const _=e=>{const t=h.current.get(e.id),n=t?h.current.get(t.fallback):void 0;x(n?.node)},C=!!t?.length,j=n.find(e=>e.id===m.titleField),S=n.find(e=>e.id===m.mediaField),k=n.find(e=>e.id===m.descriptionField),V=m.groupByField?n.find(e=>e.id===m.groupByField):null,I=V?Ae(t,V):null,{showTitle:E=!0,showMedia:N=!0,showDescription:F=!0}=m,M=j&&E||S&&N||k&&F,A=m.fields??[],O=(e,t)=>n=>{n?h.current.set(e,{node:n,fallback:A[t>0?t-1:1]}):h.current.delete(e)},P=m.infiniteScrollEnabled&&!I;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("table",{className:(0,U.A)("dataviews-view-table","dataviews-view-picker-table",v,{[`has-${m.layout?.density}-density`]:m.layout?.density&&["compact","comfortable"].includes(m.layout.density)}),"aria-busy":l,"aria-describedby":y,role:P?"feed":"listbox",children:[(0,o.jsx)("thead",{role:"presentation",children:(0,o.jsxs)("tr",{className:"dataviews-view-table__row",role:"presentation",children:[(0,o.jsx)("th",{className:"dataviews-view-table__checkbox-column",children:w&&(0,o.jsx)(he,{selection:d,onChangeSelection:c,data:t,actions:e,getItemId:a})}),M&&(0,o.jsx)("th",{children:j&&(0,o.jsx)(Ne,{ref:O(j.id,0),fieldId:j.id,view:m,fields:n,onChangeView:u,onHide:_,setOpenedFilter:f,canMove:!1})}),A.map((e,t)=>{const{width:i,maxWidth:r,minWidth:a,align:s}=m.layout?.styles?.[e]??{};return(0,o.jsx)("th",{style:{width:i,maxWidth:r,minWidth:a,textAlign:s},"aria-sort":m.sort?.direction&&m.sort?.field===e?T[m.sort.direction]:void 0,scope:"col",children:(0,o.jsx)(Ne,{ref:O(e,t),fieldId:e,view:m,fields:n,onChangeView:u,onHide:_,setOpenedFilter:f,canMove:m.layout?.enableMoving??!0})},e)})]})}),C&&V&&I?Array.from(I.entries()).map(([e,t])=>(0,o.jsxs)(i.Composite,{virtualFocus:!0,orientation:"vertical",render:(0,o.jsx)("tbody",{role:"group"}),children:[(0,o.jsx)("tr",{className:"dataviews-view-table__group-header-row",role:"presentation",children:(0,o.jsx)("td",{colSpan:A.length+(M?1:0)+1,className:"dataviews-view-table__group-header-cell",role:"presentation",children:(0,s.sprintf)(
-// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
-// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
-(0,s.__)("%1$s: %2$s"),V.label,e)})}),t.map((e,t)=>(0,o.jsx)(et,{item:e,fields:n,id:a(e)||t.toString(),view:m,titleField:j,mediaField:S,descriptionField:k,selection:d,getItemId:a,onChangeSelection:c,multiselect:w},a(e)))]},`group-${e}`)):(0,o.jsx)(i.Composite,{render:(0,o.jsx)("tbody",{role:"presentation"}),virtualFocus:!0,orientation:"vertical",children:C&&t.map((e,t)=>(0,o.jsx)(et,{item:e,fields:n,id:a(e)||t.toString(),view:m,titleField:j,mediaField:S,descriptionField:k,selection:d,getItemId:a,onChangeSelection:c,multiselect:w,posinset:t+1},a(e)))})]}),(0,o.jsxs)("div",{className:(0,U.A)({"dataviews-loading":l,"dataviews-no-results":!C&&!l}),id:y,children:[!C&&(l?(0,o.jsx)("p",{children:(0,o.jsx)(i.Spinner,{})}):p),C&&l&&(0,o.jsx)("p",{className:"dataviews-loading-more",children:(0,o.jsx)(i.Spinner,{})})]})]})},icon:q,viewConfigOptions:it,isPicker:!0}],{Menu:at}=ne(i.privateApis);function st({filters:e,view:t,onChangeView:n,setOpenedFilter:i,triggerProps:r}){const a=e.filter(e=>!e.isVisible);return(0,o.jsxs)(at,{children:[(0,o.jsx)(at.TriggerButton,{...r}),(0,o.jsx)(at.Popover,{children:a.map(e=>(0,o.jsx)(at.Item,{onClick:()=>{i(e.field),n({...t,page:1,filters:[...t.filters||[],{field:e.field,value:void 0,operator:e.operators[0]}]})},children:(0,o.jsx)(at.ItemLabel,{children:e.name})},e.field))})]})}var lt=(0,r.forwardRef)(function({filters:e,view:t,onChangeView:n,setOpenedFilter:r},a){if(!e.length||e.every(({isPrimary:e})=>e))return null;const l=e.filter(e=>!e.isVisible);return(0,o.jsx)(st,{triggerProps:{render:(0,o.jsx)(i.Button,{accessibleWhenDisabled:!0,size:"compact",className:"dataviews-filters-button",variant:"tertiary",disabled:!l.length,ref:a}),children:(0,s.__)("Add filter")},filters:e,view:t,onChangeView:n,setOpenedFilter:r})});function ot({buttonRef:e,filtersCount:t,children:n}){return(0,r.useEffect)(()=>()=>{e.current?.focus()},[e]),(0,o.jsxs)(o.Fragment,{children:[n,!!t&&(0,o.jsx)("span",{className:"dataviews-filters-toggle__count",children:t})]})}var ut=function(){const{filters:e,view:t,onChangeView:n,setOpenedFilter:a,isShowingFilter:l,setIsShowingFilter:u}=(0,r.useContext)(W),c=(0,r.useRef)(null),d=(0,r.useCallback)(e=>{n(e),u(!0)},[n,u]),f=!!e.filter(e=>e.isVisible).length;if(0===e.length)return null;const m={label:(0,s.__)("Add filter"),"aria-expanded":!1,isPressed:!1},v={label:(0,s._x)("Filter","verb"),"aria-expanded":l,isPressed:l,onClick:()=>{l||a(null),u(!l)}},p=(0,o.jsx)(i.Button,{ref:c,className:"dataviews-filters__visibility-toggle",size:"compact",icon:Ce,...f?v:m});return(0,o.jsx)("div",{className:"dataviews-filters__container-visibility-toggle",children:f?(0,o.jsx)(ot,{buttonRef:c,filtersCount:t.filters?.length,children:p}):(0,o.jsx)(st,{filters:e,view:t,onChangeView:d,setOpenedFilter:a,triggerProps:{render:p}})})},ct=Object.defineProperty,dt=Object.defineProperties,ft=Object.getOwnPropertyDescriptors,mt=Object.getOwnPropertySymbols,vt=Object.prototype.hasOwnProperty,pt=Object.prototype.propertyIsEnumerable,ht=(e,t,n)=>t in e?ct(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gt=(e,t)=>{for(var n in t||(t={}))vt.call(t,n)&&ht(e,n,t[n]);if(mt)for(var n of mt(t))pt.call(t,n)&&ht(e,n,t[n]);return e},bt=(e,t)=>dt(e,ft(t)),xt=(e,t)=>{var n={};for(var i in e)vt.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&mt)for(var i of mt(e))t.indexOf(i)<0&&pt.call(e,i)&&(n[i]=e[i]);return n},wt=Object.defineProperty,yt=Object.defineProperties,_t=Object.getOwnPropertyDescriptors,Ct=Object.getOwnPropertySymbols,jt=Object.prototype.hasOwnProperty,St=Object.prototype.propertyIsEnumerable,kt=(e,t,n)=>t in e?wt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Vt=(e,t)=>{for(var n in t||(t={}))jt.call(t,n)&&kt(e,n,t[n]);if(Ct)for(var n of Ct(t))St.call(t,n)&&kt(e,n,t[n]);return e},It=(e,t)=>yt(e,_t(t)),Et=(e,t)=>{var n={};for(var i in e)jt.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&Ct)for(var i of Ct(e))t.indexOf(i)<0&&St.call(e,i)&&(n[i]=e[i]);return n};function Nt(...e){}function Ft(e,t){return"function"==typeof Object.hasOwn?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function Mt(...e){return(...t)=>{for(const n of e)"function"==typeof n&&n(...t)}}function At(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function Ot(e){return e}function Pt(e,t){if(!e){if("string"!=typeof t)throw new Error("Invariant failed");throw new Error(t)}}function Lt(e){return e.disabled||!0===e["aria-disabled"]||"true"===e["aria-disabled"]}function Dt(e){const t={};for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}function Tt(...e){for(const t of e)if(void 0!==t)return t}var Bt=n(609),zt=n.t(Bt,2);function Ht(e,t){"function"==typeof e?e(t):e&&(e.current=t)}var Rt,$t="undefined"!=typeof window&&!!(null==(Rt=window.document)?void 0:Rt.createElement);function Wt(e){return e?"self"in e?e.document:e.ownerDocument||document:document}function qt(e,t=!1){const{activeElement:n}=Wt(e);if(!(null==n?void 0:n.nodeName))return null;if("IFRAME"===n.tagName&&n.contentDocument)return qt(n.contentDocument.body,t);if(t){const e=n.getAttribute("aria-activedescendant");if(e){const t=Wt(n).getElementById(e);if(t)return t}}return n}function Kt(e,t){return e===t||e.contains(t)}function Gt(e){const t=e.tagName.toLowerCase();return"button"===t||!("input"!==t||!e.type)&&-1!==Yt.indexOf(e.type)}var Yt=["button","color","file","image","reset","submit"];function Ut(e){try{const t=e instanceof HTMLInputElement&&null!==e.selectionStart,n="TEXTAREA"===e.tagName;return t||n||!1}catch(e){return!1}}function Zt(e){return e.isContentEditable||Ut(e)}function Xt(e){let t=0,n=0;if(Ut(e))t=e.selectionStart||0,n=e.selectionEnd||0;else if(e.isContentEditable){const i=Wt(e).getSelection();if((null==i?void 0:i.rangeCount)&&i.anchorNode&&Kt(e,i.anchorNode)&&i.focusNode&&Kt(e,i.focusNode)){const r=i.getRangeAt(0),a=r.cloneRange();a.selectNodeContents(e),a.setEnd(r.startContainer,r.startOffset),t=a.toString().length,a.setEnd(r.endContainer,r.endOffset),n=a.toString().length}}return{start:t,end:n}}function Qt(e,t){const n=null==e?void 0:e.getAttribute("role");return n&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(n)?n:t}function Jt(e){if(!e)return null;const t=e=>"auto"===e||"scroll"===e;if(e.clientHeight&&e.scrollHeight>e.clientHeight){const{overflowY:n}=getComputedStyle(e);if(t(n))return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){const{overflowX:n}=getComputedStyle(e);if(t(n))return e}return Jt(e.parentElement)||document.scrollingElement||document.body}function en(e,...t){/text|search|password|tel|url/i.test(e.type)&&e.setSelectionRange(...t)}function tn(){return!!$t&&/mac|iphone|ipad|ipod/i.test(navigator.platform)}function nn(){return $t&&tn()&&/apple/i.test(navigator.vendor)}function rn(e){return Boolean(e.currentTarget&&!Kt(e.currentTarget,e.target))}function an(e){return e.target===e.currentTarget}function sn(e,t){const n=new FocusEvent("blur",t),i=e.dispatchEvent(n),r=It(Vt({},t),{bubbles:!0});return e.dispatchEvent(new FocusEvent("focusout",r)),i}function ln(e,t){const n=new MouseEvent("click",t);return e.dispatchEvent(n)}function on(e,t){const n=t||e.currentTarget,i=e.relatedTarget;return!i||!Kt(n,i)}function un(e,t,n,i){const r=(e=>{if(i){const t=setTimeout(e,i);return()=>clearTimeout(t)}const t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})(()=>{e.removeEventListener(t,a,!0),n()}),a=()=>{r(),n()};return e.addEventListener(t,a,{once:!0,capture:!0}),r}function cn(e,t,n,i=window){const r=[];try{i.document.addEventListener(e,t,n);for(const a of Array.from(i.frames))r.push(cn(e,t,n,a))}catch(e){}return()=>{try{i.document.removeEventListener(e,t,n)}catch(e){}for(const e of r)e()}}var dn=gt({},zt),fn=dn.useId,mn=(dn.useDeferredValue,dn.useInsertionEffect),vn=$t?Bt.useLayoutEffect:Bt.useEffect;function pn(e){const t=(0,Bt.useRef)(()=>{throw new Error("Cannot call an event handler while rendering.")});return mn?mn(()=>{t.current=e}):t.current=e,(0,Bt.useCallback)((...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)},[])}function hn(...e){return(0,Bt.useMemo)(()=>{if(e.some(Boolean))return t=>{for(const n of e)Ht(n,t)}},e)}function gn(e){if(fn){const t=fn();return e||t}const[t,n]=(0,Bt.useState)(e);return vn(()=>{if(e||t)return;const i=Math.random().toString(36).slice(2,8);n(`id-${i}`)},[e,t]),e||t}function bn(e,t){const n=(0,Bt.useRef)(!1);(0,Bt.useEffect)(()=>{if(n.current)return e();n.current=!0},t),(0,Bt.useEffect)(()=>()=>{n.current=!1},[])}function xn(e){return pn("function"==typeof e?e:()=>e)}function wn(e,t,n=[]){const i=(0,Bt.useCallback)(n=>(e.wrapElement&&(n=e.wrapElement(n)),t(n)),[...n,e.wrapElement]);return bt(gt({},e),{wrapElement:i})}var yn=!1,Cn=!1,jn=0,Sn=0;function kn(e){(function(e){const t=e.movementX||e.screenX-jn,n=e.movementY||e.screenY-Sn;return jn=e.screenX,Sn=e.screenY,t||n||!1})(e)&&(Cn=!0)}function Vn(){Cn=!1}function In(e){const t=Bt.forwardRef((t,n)=>e(bt(gt({},t),{ref:n})));return t.displayName=e.displayName||e.name,t}function En(e,t){return Bt.memo(e,t)}function Nn(e,t){const n=t,{wrapElement:i,render:r}=n,a=xt(n,["wrapElement","render"]),s=hn(t.ref,function(e){return function(e){return!!e&&!!(0,Bt.isValidElement)(e)&&("ref"in e.props||"ref"in e)}(e)?gt({},e.props).ref||e.ref:null}(r));let l;if(Bt.isValidElement(r)){const e=bt(gt({},r.props),{ref:s});l=Bt.cloneElement(r,function(e,t){const n=gt({},e);for(const i in t){if(!Ft(t,i))continue;if("className"===i){const i="className";n[i]=e[i]?`${e[i]} ${t[i]}`:t[i];continue}if("style"===i){const i="style";n[i]=e[i]?gt(gt({},e[i]),t[i]):t[i];continue}const r=t[i];if("function"==typeof r&&i.startsWith("on")){const t=e[i];if("function"==typeof t){n[i]=(...e)=>{r(...e),t(...e)};continue}}n[i]=r}return n}(a,e))}else l=r?r(a):(0,o.jsx)(e,gt({},a));return i?i(l):l}function Fn(e){const t=(t={})=>e(t);return t.displayName=e.name,t}function Mn(e=[],t=[]){const n=Bt.createContext(void 0),i=Bt.createContext(void 0),r=()=>Bt.useContext(n),a=t=>e.reduceRight((e,n)=>(0,o.jsx)(n,bt(gt({},t),{children:e})),(0,o.jsx)(n.Provider,gt({},t)));return{context:n,scopedContext:i,useContext:r,useScopedContext:(e=!1)=>{const t=Bt.useContext(i),n=r();return e?t:t||n},useProviderContext:()=>{const e=Bt.useContext(i),t=r();if(!e||e!==t)return t},ContextProvider:a,ScopedContextProvider:e=>(0,o.jsx)(a,bt(gt({},e),{children:t.reduceRight((t,n)=>(0,o.jsx)(n,bt(gt({},e),{children:t})),(0,o.jsx)(i.Provider,gt({},e)))}))}}var An=Mn(),On=An.useContext,Pn=(An.useScopedContext,An.useProviderContext,Mn([An.ContextProvider],[An.ScopedContextProvider])),Ln=Pn.useContext,Dn=(Pn.useScopedContext,Pn.useProviderContext),Tn=Pn.ContextProvider,Bn=Pn.ScopedContextProvider,zn=(0,Bt.createContext)(void 0),Hn=(0,Bt.createContext)(void 0),Rn=((0,Bt.createContext)(null),(0,Bt.createContext)(null),Mn([Tn],[Bn])),$n=Rn.useContext;function Wn(e,t){const n=e.__unstableInternals;return Pt(n,"Invalid store"),n[t]}function qn(e,...t){let n=e,i=n,r=Symbol(),a=Nt;const s=new Set,l=new Set,o=new Set,u=new Set,c=new Set,d=new WeakMap,f=new WeakMap,m=(e,t,n=u)=>(n.add(t),f.set(t,e),()=>{var e;null==(e=d.get(t))||e(),d.delete(t),f.delete(t),n.delete(t)}),v=(e,a,s=!1)=>{var o;if(!Ft(n,e))return;const m=(v=a,p=n[e],function(e){return"function"==typeof e}(v)?v(function(e){return"function"==typeof e}(p)?p():p):v);var v,p;if(m===n[e])return;if(!s)for(const n of t)null==(o=null==n?void 0:n.setState)||o.call(n,e,m);const h=n;n=It(Vt({},n),{[e]:m});const g=Symbol();r=g,l.add(e);const b=(t,i,r)=>{var a;const s=f.get(t);s&&!s.some(t=>r?r.has(t):t===e)||(null==(a=d.get(t))||a(),d.set(t,t(n,i)))};for(const e of u)b(e,h);queueMicrotask(()=>{if(r!==g)return;const e=n;for(const e of c)b(e,i,l);i=e,l.clear()})},p={getState:()=>n,setState:v,__unstableInternals:{setup:e=>(o.add(e),()=>o.delete(e)),init:()=>{const e=s.size,i=Symbol();s.add(i);const r=()=>{s.delete(i),s.size||a()};if(e)return r;const l=(u=n,Object.keys(u)).map(e=>Mt(...t.map(t=>{var n;const i=null==(n=null==t?void 0:t.getState)?void 0:n.call(t);if(i&&Ft(i,e))return Un(t,[e],t=>{v(e,t[e],!0)})})));var u;const c=[];for(const e of o)c.push(e());const d=t.map(Gn);return a=Mt(...l,...c,...d),r},subscribe:(e,t)=>m(e,t),sync:(e,t)=>(d.set(t,t(n,n)),m(e,t)),batch:(e,t)=>(d.set(t,t(n,i)),m(e,t,c)),pick:e=>qn(function(e,t){const n={};for(const i of t)Ft(e,i)&&(n[i]=e[i]);return n}(n,e),p),omit:e=>qn(function(e,t){const n=Vt({},e);for(const e of t)Ft(n,e)&&delete n[e];return n}(n,e),p)}};return p}function Kn(e,...t){if(e)return Wn(e,"setup")(...t)}function Gn(e,...t){if(e)return Wn(e,"init")(...t)}function Yn(e,...t){if(e)return Wn(e,"subscribe")(...t)}function Un(e,...t){if(e)return Wn(e,"sync")(...t)}function Zn(e,...t){if(e)return Wn(e,"batch")(...t)}function Xn(e,...t){if(e)return Wn(e,"omit")(...t)}function Qn(...e){var t;const n={};for(const i of e){const e=null==(t=null==i?void 0:i.getState)?void 0:t.call(i);e&&Object.assign(n,e)}const i=qn(n,...e);return Object.assign({},...e,i)}Rn.useScopedContext,Rn.useProviderContext,Rn.ContextProvider,Rn.ScopedContextProvider;var Jn=n(888),{useSyncExternalStore:ei}=Jn;function ti(e,t=Ot){const n=Bt.useCallback(t=>e?Yn(e,null,t):()=>{},[e]),i=()=>{const n="string"==typeof t?t:null,i="function"==typeof t?t:null,r=null==e?void 0:e.getState();return i?i(r):r&&n&&Ft(r,n)?r[n]:void 0};return ei(n,i,i)}function ni(e,t){const n=Bt.useRef({}),i=Bt.useCallback(t=>e?Yn(e,null,t):()=>{},[e]),r=()=>{const i=null==e?void 0:e.getState();let r=!1;const a=n.current;for(const e in t){const n=t[e];if("function"==typeof n){const t=n(i);t!==a[e]&&(a[e]=t,r=!0)}if("string"==typeof n){if(!i)continue;if(!Ft(i,n))continue;const t=i[n];t!==a[e]&&(a[e]=t,r=!0)}}return r&&(n.current=gt({},a)),n.current};return ei(i,r,r)}function ii(e,t,n,i){const r=Ft(t,n)?t[n]:void 0,a=i?t[i]:void 0,s=function(e){const t=(0,Bt.useRef)(e);return vn(()=>{t.current=e}),t}({value:r,setValue:a});vn(()=>Un(e,[n],(e,t)=>{const{value:i,setValue:r}=s.current;r&&e[n]!==t[n]&&e[n]!==i&&r(e[n])}),[e,n]),vn(()=>{if(void 0!==r)return e.setState(n,r),Zn(e,[n],()=>{void 0!==r&&e.setState(n,r)})})}function ri(e,t,n){return function(e,t,n){return bn(t,[n.store,n.disclosure]),ii(e,n,"open","setOpen"),ii(e,n,"mounted","setMounted"),ii(e,n,"animated"),Object.assign(e,{disclosure:n.disclosure})}(e,t,n)}function ai(e,t,n){return ii(e=function(e,t,n){return bn(t,[n.store]),ii(e,n,"items","setItems"),e}(e,t,n),n,"activeId","setActiveId"),ii(e,n,"includesBaseElement"),ii(e,n,"virtualFocus"),ii(e,n,"orientation"),ii(e,n,"rtl"),ii(e,n,"focusLoop"),ii(e,n,"focusWrap"),ii(e,n,"focusShift"),e}function si(e){const t=[];for(const n of e)t.push(...n);return t}function li(e){return e.slice().reverse()}function oi(e={}){var t;e.store;const n=null==(t=e.store)?void 0:t.getState(),i=Tt(e.items,null==n?void 0:n.items,e.defaultItems,[]),r=new Map(i.map(e=>[e.id,e])),a={items:i,renderedItems:Tt(null==n?void 0:n.renderedItems,[])},s=null==(l=e.store)?void 0:l.__unstablePrivateStore;var l;const o=qn({items:i,renderedItems:a.renderedItems},s),u=qn(a,e.store),c=e=>{const t=function(e,t){const n=e.map((e,t)=>[t,e]);let i=!1;return n.sort(([e,n],[r,a])=>{const s=t(n),l=t(a);return s===l?0:s&&l?function(e,t){return Boolean(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}(s,l)?(e>r&&(i=!0),-1):(et):e}(e,e=>e.element);o.setState("renderedItems",t),u.setState("renderedItems",t)};Kn(u,()=>Gn(o)),Kn(o,()=>Zn(o,["items"],e=>{u.setState("items",e.items)})),Kn(o,()=>Zn(o,["renderedItems"],e=>{let t=!0,n=requestAnimationFrame(()=>{const{renderedItems:t}=u.getState();e.renderedItems!==t&&c(e.renderedItems)});if("function"!=typeof IntersectionObserver)return()=>cancelAnimationFrame(n);const i=function(e){var t;const n=e.find(e=>!!e.element),i=[...e].reverse().find(e=>!!e.element);let r=null==(t=null==n?void 0:n.element)?void 0:t.parentElement;for(;r&&(null==i?void 0:i.element);){if(i&&r.contains(i.element))return r;r=r.parentElement}return Wt(r).body}(e.renderedItems),r=new IntersectionObserver(()=>{t?t=!1:(cancelAnimationFrame(n),n=requestAnimationFrame(()=>c(e.renderedItems)))},{root:i});for(const t of e.renderedItems)t.element&&r.observe(t.element);return()=>{cancelAnimationFrame(n),r.disconnect()}}));const d=(e,t,n=!1)=>{let i;return t(t=>{const n=t.findIndex(({id:t})=>t===e.id),a=t.slice();if(-1!==n){i=t[n];const s=Vt(Vt({},i),e);a[n]=s,r.set(e.id,s)}else a.push(e),r.set(e.id,e);return a}),()=>{t(t=>{if(!i)return n&&r.delete(e.id),t.filter(({id:t})=>t!==e.id);const a=t.findIndex(({id:t})=>t===e.id);if(-1===a)return t;const s=t.slice();return s[a]=i,r.set(e.id,i),s})}},f=e=>d(e,e=>o.setState("items",e),!0);return It(Vt({},u),{registerItem:f,renderItem:e=>Mt(f(e),d(e,e=>o.setState("renderedItems",e))),item:e=>{if(!e)return null;let t=r.get(e);if(!t){const{items:n}=o.getState();t=n.find(t=>t.id===e),t&&r.set(e,t)}return t||null},__unstablePrivateStore:o})}var ui={id:null};function ci(e,t){return e.find(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function di(e,t){return e.filter(e=>e.rowId===t)}function fi(e){const t=[];for(const n of e){const e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===n.rowId});e?e.push(n):t.push([n])}return t}function mi(e){let t=0;for(const{length:n}of e)n>t&&(t=n);return t}function vi(e){return{id:"__EMPTY_ITEM__",disabled:!0,rowId:e}}var pi=nn()&&$t&&!!navigator.maxTouchPoints;function hi(e={}){var t=e,{tag:n}=t,i=Et(t,["tag"]);const r=Qn(i.store,function(e,...t){if(e)return Wn(e,"pick")(...t)}(n,["value","rtl"])),a=null==n?void 0:n.getState(),s=null==r?void 0:r.getState(),l=Tt(i.activeId,null==s?void 0:s.activeId,i.defaultActiveId,null),o=function(e={}){var t;const n=null==(t=e.store)?void 0:t.getState(),i=oi(e),r=Tt(e.activeId,null==n?void 0:n.activeId,e.defaultActiveId),a=qn(It(Vt({},i.getState()),{id:Tt(e.id,null==n?void 0:n.id,`id-${Math.random().toString(36).slice(2,8)}`),activeId:r,baseElement:Tt(null==n?void 0:n.baseElement,null),includesBaseElement:Tt(e.includesBaseElement,null==n?void 0:n.includesBaseElement,null===r),moves:Tt(null==n?void 0:n.moves,0),orientation:Tt(e.orientation,null==n?void 0:n.orientation,"both"),rtl:Tt(e.rtl,null==n?void 0:n.rtl,!1),virtualFocus:Tt(e.virtualFocus,null==n?void 0:n.virtualFocus,!1),focusLoop:Tt(e.focusLoop,null==n?void 0:n.focusLoop,!1),focusWrap:Tt(e.focusWrap,null==n?void 0:n.focusWrap,!1),focusShift:Tt(e.focusShift,null==n?void 0:n.focusShift,!1)}),i,e.store);Kn(a,()=>Un(a,["renderedItems","activeId"],e=>{a.setState("activeId",t=>{var n;return void 0!==t?t:null==(n=ci(e.renderedItems))?void 0:n.id})}));const s=(e="next",t={})=>{var n,i;const r=a.getState(),{skip:s=0,activeId:l=r.activeId,focusShift:o=r.focusShift,focusLoop:u=r.focusLoop,focusWrap:c=r.focusWrap,includesBaseElement:d=r.includesBaseElement,renderedItems:f=r.renderedItems,rtl:m=r.rtl}=t,v="up"===e||"down"===e,p="next"===e||"down"===e,h=p?m&&!v:!m||v,g=o&&!s;let b=v?si(function(e,t,n){const i=mi(e);for(const r of e)for(let e=0;ee.id===l);if(!x)return null==(i=ci(b))?void 0:i.id;const w=b.some(e=>e.rowId),y=b.indexOf(x),_=b.slice(y+1),C=di(_,x.rowId);if(s){const e=function(e,t){return e.filter(e=>t?!e.disabled&&e.id!==t:!e.disabled)}(C,l),t=e.slice(s)[0]||e[e.length-1];return null==t?void 0:t.id}const j=u&&(v?"horizontal"!==u:"vertical"!==u),S=w&&c&&(v?"horizontal"!==c:"vertical"!==c),k=p?(!w||v)&&j&&d:!!v&&d;if(j){const e=function(e,t,n=!1){const i=e.findIndex(e=>e.id===t);return[...e.slice(i+1),...n?[ui]:[],...e.slice(0,i)]}(S&&!k?b:di(b,x.rowId),l,k),t=ci(e,l);return null==t?void 0:t.id}if(S){const e=ci(k?C:_,l);return k?(null==e?void 0:e.id)||null:null==e?void 0:e.id}const V=ci(C,l);return!V&&k?null:null==V?void 0:V.id};return It(Vt(Vt({},i),a),{setBaseElement:e=>a.setState("baseElement",e),setActiveId:e=>a.setState("activeId",e),move:e=>{void 0!==e&&(a.setState("activeId",e),a.setState("moves",e=>e+1))},first:()=>{var e;return null==(e=ci(a.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=ci(li(a.getState().renderedItems)))?void 0:e.id},next:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),s("next",e)),previous:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),s("previous",e)),down:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),s("down",e)),up:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),s("up",e))})}(It(Vt({},i),{activeId:l,includesBaseElement:Tt(i.includesBaseElement,null==s?void 0:s.includesBaseElement,!0),orientation:Tt(i.orientation,null==s?void 0:s.orientation,"vertical"),focusLoop:Tt(i.focusLoop,null==s?void 0:s.focusLoop,!0),focusWrap:Tt(i.focusWrap,null==s?void 0:s.focusWrap,!0),virtualFocus:Tt(i.virtualFocus,null==s?void 0:s.virtualFocus,!0)})),u=function(e={}){var t=e,{popover:n}=t,i=Et(t,["popover"]);const r=Qn(i.store,Xn(n,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"])),a=null==r?void 0:r.getState(),s=function(e={}){return function(e={}){const t=Qn(e.store,Xn(e.disclosure,["contentElement","disclosureElement"])),n=null==t?void 0:t.getState(),i=Tt(e.open,null==n?void 0:n.open,e.defaultOpen,!1),r=Tt(e.animated,null==n?void 0:n.animated,!1),a=qn({open:i,animated:r,animating:!!r&&i,mounted:i,contentElement:Tt(null==n?void 0:n.contentElement,null),disclosureElement:Tt(null==n?void 0:n.disclosureElement,null)},t);return Kn(a,()=>Un(a,["animated","animating"],e=>{e.animated||a.setState("animating",!1)})),Kn(a,()=>Yn(a,["open"],()=>{a.getState().animated&&a.setState("animating",!0)})),Kn(a,()=>Un(a,["open","animating"],e=>{a.setState("mounted",e.open||e.animating)})),It(Vt({},a),{disclosure:e.disclosure,setOpen:e=>a.setState("open",e),show:()=>a.setState("open",!0),hide:()=>a.setState("open",!1),toggle:()=>a.setState("open",e=>!e),stopAnimation:()=>a.setState("animating",!1),setContentElement:e=>a.setState("contentElement",e),setDisclosureElement:e=>a.setState("disclosureElement",e)})}(e)}(It(Vt({},i),{store:r})),l=Tt(i.placement,null==a?void 0:a.placement,"bottom"),o=qn(It(Vt({},s.getState()),{placement:l,currentPlacement:l,anchorElement:Tt(null==a?void 0:a.anchorElement,null),popoverElement:Tt(null==a?void 0:a.popoverElement,null),arrowElement:Tt(null==a?void 0:a.arrowElement,null),rendered:Symbol("rendered")}),s,r);return It(Vt(Vt({},s),o),{setAnchorElement:e=>o.setState("anchorElement",e),setPopoverElement:e=>o.setState("popoverElement",e),setArrowElement:e=>o.setState("arrowElement",e),render:()=>o.setState("rendered",Symbol("rendered"))})}(It(Vt({},i),{placement:Tt(i.placement,null==s?void 0:s.placement,"bottom-start")})),c=Tt(i.value,null==s?void 0:s.value,i.defaultValue,""),d=Tt(i.selectedValue,null==s?void 0:s.selectedValue,null==a?void 0:a.values,i.defaultSelectedValue,""),f=Array.isArray(d),m=It(Vt(Vt({},o.getState()),u.getState()),{value:c,selectedValue:d,resetValueOnSelect:Tt(i.resetValueOnSelect,null==s?void 0:s.resetValueOnSelect,f),resetValueOnHide:Tt(i.resetValueOnHide,null==s?void 0:s.resetValueOnHide,f&&!n),activeValue:null==s?void 0:s.activeValue}),v=qn(m,o,u,r);return pi&&Kn(v,()=>Un(v,["virtualFocus"],()=>{v.setState("virtualFocus",!1)})),Kn(v,()=>{if(n)return Mt(Un(v,["selectedValue"],e=>{Array.isArray(e.selectedValue)&&n.setValues(e.selectedValue)}),Un(n,["values"],e=>{v.setState("selectedValue",e.values)}))}),Kn(v,()=>Un(v,["resetValueOnHide","mounted"],e=>{e.resetValueOnHide&&(e.mounted||v.setState("value",c))})),Kn(v,()=>Un(v,["open"],e=>{e.open||(v.setState("activeId",l),v.setState("moves",0))})),Kn(v,()=>Un(v,["moves","activeId"],(e,t)=>{e.moves===t.moves&&v.setState("activeValue",void 0)})),Kn(v,()=>Zn(v,["moves","renderedItems"],(e,t)=>{if(e.moves===t.moves)return;const{activeId:n}=v.getState(),i=o.item(n);v.setState("activeValue",null==i?void 0:i.value)})),It(Vt(Vt(Vt({},u),o),v),{tag:n,setValue:e=>v.setState("value",e),resetValue:()=>v.setState("value",m.value),setSelectedValue:e=>v.setState("selectedValue",e)})}function gi(e={}){e=function(e){const t=$n();return function(e){const t=gn(e.id);return gt({id:t},e)}(e=bt(gt({},e),{tag:void 0!==e.tag?e.tag:t}))}(e);const[t,n]=function(e,t){const[n,i]=Bt.useState(()=>e(t));vn(()=>Gn(n),[n]);const r=Bt.useCallback(e=>ti(n,e),[n]);return[Bt.useMemo(()=>bt(gt({},n),{useState:r}),[n,r]),pn(()=>{i(n=>e(gt(gt({},t),n.getState())))})]}(hi,e);return function(e,t,n){return bn(t,[n.tag]),ii(e,n,"value","setValue"),ii(e,n,"selectedValue","setSelectedValue"),ii(e,n,"resetValueOnHide"),ii(e,n,"resetValueOnSelect"),Object.assign(ai(function(e,t,n){return bn(t,[n.popover]),ii(e,n,"placement"),ri(e,t,n)}(e,t,n),t,n),{tag:n.tag})}(t,n,e)}var bi=Mn(),xi=(bi.useContext,bi.useScopedContext,bi.useProviderContext),wi=Mn([bi.ContextProvider],[bi.ScopedContextProvider]),yi=(wi.useContext,wi.useScopedContext,wi.useProviderContext,wi.ContextProvider),_i=wi.ScopedContextProvider,Ci=((0,Bt.createContext)(void 0),(0,Bt.createContext)(void 0),Mn([yi],[_i])),ji=(Ci.useContext,Ci.useScopedContext,Ci.useProviderContext),Si=Ci.ContextProvider,ki=Ci.ScopedContextProvider,Vi=(0,Bt.createContext)(void 0),Ii=Mn([Si,Tn],[ki,Bn]),Ei=Ii.useContext,Ni=Ii.useScopedContext,Fi=Ii.useProviderContext,Mi=Ii.ContextProvider,Ai=Ii.ScopedContextProvider,Oi=(0,Bt.createContext)(void 0),Pi=(0,Bt.createContext)(!1);function Li(e={}){const t=gi(e);return(0,o.jsx)(Mi,{value:t,children:e.children})}var Di=Fn(function(e){var t=e,{store:n}=t,i=xt(t,["store"]);const r=Fi();Pt(n=n||r,!1);const a=n.useState(e=>{var t;return null==(t=e.baseElement)?void 0:t.id});return Dt(i=gt({htmlFor:a},i))}),Ti=En(In(function(e){return Nn("label",Di(e))}));function Bi(e,t){return t&&e.item(t)||null}var zi=Symbol("FOCUS_SILENTLY");function Hi(e,t,n){if(!t)return!1;if(t===n)return!1;const i=e.item(t.id);return!(!i||n&&i.element===n)}var Ri=(0,Bt.createContext)(!0),$i="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function Wi(e){return!!e.matches($i)&&!!function(e){if("function"==typeof e.checkVisibility)return e.checkVisibility();const t=e;return t.offsetWidth>0||t.offsetHeight>0||e.getClientRects().length>0}(e)&&!e.closest("[inert]")}function qi(e){const t=qt(e);if(!t)return!1;if(t===e)return!0;const n=t.getAttribute("aria-activedescendant");return!!n&&n===e.id}function Ki(e){const t=qt(e);if(!t)return!1;if(Kt(e,t))return!0;const n=t.getAttribute("aria-activedescendant");return!!n&&"id"in e&&(n===e.id||!!e.querySelector(`#${CSS.escape(n)}`))}var Gi=nn(),Yi=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],Ui=Symbol("safariFocusAncestor");function Zi(e,t){e&&(e[Ui]=t)}function Xi(e){return!("input"!==e.tagName.toLowerCase()||!e.type||"radio"!==e.type&&"checkbox"!==e.type)}function Qi(e,t,n,i,r){return e?t?n&&!i?-1:void 0:n?r:r||0:r}function Ji(e,t){return pn(n=>{null==e||e(n),n.defaultPrevented||t&&(n.stopPropagation(),n.preventDefault())})}var er=!1,tr=!0;function nr(e){const t=e.target;t&&"hasAttribute"in t&&(t.hasAttribute("data-focus-visible")||(tr=!1))}function ir(e){e.metaKey||e.ctrlKey||e.altKey||(tr=!0)}var rr=Fn(function(e){var t=e,{focusable:n=!0,accessibleWhenDisabled:i,autoFocus:r,onFocusVisible:a}=t,s=xt(t,["focusable","accessibleWhenDisabled","autoFocus","onFocusVisible"]);const l=(0,Bt.useRef)(null);(0,Bt.useEffect)(()=>{n&&(er||(cn("mousedown",nr,!0),cn("keydown",ir,!0),er=!0))},[n]),Gi&&(0,Bt.useEffect)(()=>{if(!n)return;const e=l.current;if(!e)return;if(!Xi(e))return;const t=function(e){return"labels"in e?e.labels:null}(e);if(!t)return;const i=()=>queueMicrotask(()=>e.focus());for(const e of t)e.addEventListener("mouseup",i);return()=>{for(const e of t)e.removeEventListener("mouseup",i)}},[n]);const o=n&&Lt(s),u=!!o&&!i,[c,d]=(0,Bt.useState)(!1);(0,Bt.useEffect)(()=>{n&&u&&c&&d(!1)},[n,u,c]),(0,Bt.useEffect)(()=>{if(!n)return;if(!c)return;const e=l.current;if(!e)return;if("undefined"==typeof IntersectionObserver)return;const t=new IntersectionObserver(()=>{Wi(e)||d(!1)});return t.observe(e),()=>t.disconnect()},[n,c]);const f=Ji(s.onKeyPressCapture,o),m=Ji(s.onMouseDownCapture,o),v=Ji(s.onClickCapture,o),p=s.onMouseDown,h=pn(e=>{if(null==p||p(e),e.defaultPrevented)return;if(!n)return;const t=e.currentTarget;if(!Gi)return;if(rn(e))return;if(!Gt(t)&&!Xi(t))return;let i=!1;const r=()=>{i=!0};t.addEventListener("focusin",r,{capture:!0,once:!0});const a=function(e){for(;e&&!Wi(e);)e=e.closest($i);return e||null}(t.parentElement);Zi(a,!0),un(t,"mouseup",()=>{t.removeEventListener("focusin",r,!0),Zi(a,!1),i||function(e){!Ki(e)&&Wi(e)&&e.focus()}(t)})}),g=(e,t)=>{if(t&&(e.currentTarget=t),!n)return;const i=e.currentTarget;i&&qi(i)&&(null==a||a(e),e.defaultPrevented||(i.dataset.focusVisible="true",d(!0)))},b=s.onKeyDownCapture,x=pn(e=>{if(null==b||b(e),e.defaultPrevented)return;if(!n)return;if(c)return;if(e.metaKey)return;if(e.altKey)return;if(e.ctrlKey)return;if(!an(e))return;const t=e.currentTarget;un(t,"focusout",()=>g(e,t))}),w=s.onFocusCapture,y=pn(e=>{if(null==w||w(e),e.defaultPrevented)return;if(!n)return;if(!an(e))return void d(!1);const t=e.currentTarget;tr||function(e){const{tagName:t,readOnly:n,type:i}=e;return"TEXTAREA"===t&&!n||"SELECT"===t&&!n||("INPUT"!==t||n?!!e.isContentEditable||!("combobox"!==e.getAttribute("role")||!e.dataset.name):Yi.includes(i))}(e.target)?un(e.target,"focusout",()=>g(e,t)):d(!1)}),_=s.onBlur,C=pn(e=>{null==_||_(e),n&&on(e)&&(e.currentTarget.removeAttribute("data-focus-visible"),d(!1))}),j=(0,Bt.useContext)(Ri),S=pn(e=>{n&&r&&e&&j&&queueMicrotask(()=>{qi(e)||Wi(e)&&e.focus()})}),k=function(e,t){const n=e=>{if("string"==typeof e)return e},[i,r]=(0,Bt.useState)(()=>n(t));return vn(()=>{const i=e&&"current"in e?e.current:e;r((null==i?void 0:i.tagName.toLowerCase())||n(t))},[e,t]),i}(l),V=n&&function(e){return!e||"button"===e||"summary"===e||"input"===e||"select"===e||"textarea"===e||"a"===e}(k),I=n&&function(e){return!e||"button"===e||"input"===e||"select"===e||"textarea"===e}(k),E=s.style,N=(0,Bt.useMemo)(()=>u?gt({pointerEvents:"none"},E):E,[u,E]);return Dt(s=bt(gt({"data-focus-visible":n&&c||void 0,"data-autofocus":r||void 0,"aria-disabled":o||void 0},s),{ref:hn(l,S,s.ref),style:N,tabIndex:Qi(n,u,V,I,s.tabIndex),disabled:!(!I||!u)||void 0,contentEditable:o?void 0:s.contentEditable,onKeyPressCapture:f,onClickCapture:v,onMouseDownCapture:m,onMouseDown:h,onKeyDownCapture:x,onFocusCapture:y,onBlur:C}))});function ar(e,t,n){return pn(i=>{var r;if(null==t||t(i),i.defaultPrevented)return;if(i.isPropagationStopped())return;if(!an(i))return;if(function(e){return"Shift"===e.key||"Control"===e.key||"Alt"===e.key||"Meta"===e.key}(i))return;if(function(e){const t=e.target;return!(t&&!Ut(t)||1!==e.key.length||e.ctrlKey||e.metaKey)}(i))return;const a=e.getState(),s=null==(r=Bi(e,a.activeId))?void 0:r.element;if(!s)return;const l=i,{view:o}=l,u=xt(l,["view"]);s!==(null==n?void 0:n.current)&&s.focus(),function(e,t,n){const i=new KeyboardEvent(t,n);return e.dispatchEvent(i)}(s,i.type,u)||i.preventDefault(),i.currentTarget.contains(s)&&i.stopPropagation()})}In(function(e){return Nn("div",rr(e))});var sr=Fn(function(e){var t=e,{store:n,composite:i=!0,focusOnMove:r=i,moveOnKeyPress:a=!0}=t,s=xt(t,["store","composite","focusOnMove","moveOnKeyPress"]);const l=Dn();Pt(n=n||l,!1);const u=(0,Bt.useRef)(null),c=(0,Bt.useRef)(null),d=function(e){const[t,n]=(0,Bt.useState)(!1),i=(0,Bt.useCallback)(()=>n(!0),[]),r=e.useState(t=>Bi(e,t.activeId));return(0,Bt.useEffect)(()=>{const e=null==r?void 0:r.element;t&&e&&(n(!1),e.focus({preventScroll:!0}))},[r,t]),i}(n),f=n.useState("moves"),[,m]=function(e){const[t,n]=(0,Bt.useState)(null);return vn(()=>{if(null==t)return;if(!e)return;let n=null;return e(e=>(n=e,t)),()=>{e(n)}},[t,e]),[t,n]}(i?n.setBaseElement:null);(0,Bt.useEffect)(()=>{var e;if(!n)return;if(!f)return;if(!i)return;if(!r)return;const{activeId:t}=n.getState(),a=null==(e=Bi(n,t))?void 0:e.element;var s;a&&("scrollIntoView"in(s=a)?(s.focus({preventScroll:!0}),s.scrollIntoView(Vt({block:"nearest",inline:"nearest"},undefined))):s.focus())},[n,f,i,r]),vn(()=>{if(!n)return;if(!f)return;if(!i)return;const{baseElement:e,activeId:t}=n.getState();if(null!==t)return;if(!e)return;const r=c.current;c.current=null,r&&sn(r,{relatedTarget:e}),qi(e)||e.focus()},[n,f,i]);const v=n.useState("activeId"),p=n.useState("virtualFocus");vn(()=>{var e;if(!n)return;if(!i)return;if(!p)return;const t=c.current;if(c.current=null,!t)return;const r=(null==(e=Bi(n,v))?void 0:e.element)||qt(t);r!==t&&sn(t,{relatedTarget:r})},[n,v,p,i]);const h=ar(n,s.onKeyDownCapture,c),g=ar(n,s.onKeyUpCapture,c),b=s.onFocusCapture,x=pn(e=>{if(null==b||b(e),e.defaultPrevented)return;if(!n)return;const{virtualFocus:t}=n.getState();if(!t)return;const i=e.relatedTarget,r=function(e){const t=e[zi];return delete e[zi],t}(e.currentTarget);an(e)&&r&&(e.stopPropagation(),c.current=i)}),w=s.onFocus,y=pn(e=>{if(null==w||w(e),e.defaultPrevented)return;if(!i)return;if(!n)return;const{relatedTarget:t}=e,{virtualFocus:r}=n.getState();r?an(e)&&!Hi(n,t)&&queueMicrotask(d):an(e)&&n.setActiveId(null)}),_=s.onBlurCapture,C=pn(e=>{var t;if(null==_||_(e),e.defaultPrevented)return;if(!n)return;const{virtualFocus:i,activeId:r}=n.getState();if(!i)return;const a=null==(t=Bi(n,r))?void 0:t.element,s=e.relatedTarget,l=Hi(n,s),o=c.current;c.current=null,an(e)&&l?(s===a?o&&o!==s&&sn(o,e):a?sn(a,e):o&&sn(o,e),e.stopPropagation()):!Hi(n,e.target)&&a&&sn(a,e)}),j=s.onKeyDown,S=xn(a),k=pn(e=>{var t;if(null==j||j(e),e.nativeEvent.isComposing)return;if(e.defaultPrevented)return;if(!n)return;if(!an(e))return;const{orientation:i,renderedItems:r,activeId:a}=n.getState(),s=Bi(n,a);if(null==(t=null==s?void 0:s.element)?void 0:t.isConnected)return;const l="horizontal"!==i,o="vertical"!==i,u=r.some(e=>!!e.rowId);if(("ArrowLeft"===e.key||"ArrowRight"===e.key||"Home"===e.key||"End"===e.key)&&Ut(e.currentTarget))return;const c={ArrowUp:(u||l)&&(()=>{if(u){const e=function(e){return e.find(e=>!e.disabled)}(si(li(function(e){const t=[];for(const n of e){const e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===n.rowId});e?e.push(n):t.push([n])}return t}(r))));return null==e?void 0:e.id}return null==n?void 0:n.last()}),ArrowRight:(u||o)&&n.first,ArrowDown:(u||l)&&n.first,ArrowLeft:(u||o)&&n.last,Home:n.first,End:n.last,PageUp:n.first,PageDown:n.last},d=c[e.key];if(d){const t=d();if(void 0!==t){if(!S(e))return;e.preventDefault(),n.move(t)}}});s=wn(s,e=>(0,o.jsx)(Tn,{value:n,children:e}),[n]);const V=n.useState(e=>{var t;if(n&&i&&e.virtualFocus)return null==(t=Bi(n,e.activeId))?void 0:t.id});s=bt(gt({"aria-activedescendant":V},s),{ref:hn(u,m,s.ref),onKeyDownCapture:h,onKeyUpCapture:g,onFocusCapture:x,onFocus:y,onBlurCapture:C,onKeyDown:k});const I=n.useState(e=>i&&(e.virtualFocus||null===e.activeId));return rr(gt({focusable:I},s))}),lr=(In(function(e){return Nn("div",sr(e))}),Fn(function(e){var t=e,{store:n}=t,i=xt(t,["store"]);const r=ji();return n=n||r,bt(gt({},i),{ref:hn(null==n?void 0:n.setAnchorElement,i.ref)})}));function or(e,t,n){if(!n)return!1;const i=e.find(e=>!e.disabled&&e.value);return(null==i?void 0:i.value)===t}function ur(e,t){return!!t&&null!=e&&(e=At(e),t.length>e.length&&0===t.toLowerCase().indexOf(e.toLowerCase()))}In(function(e){return Nn("div",lr(e))});var cr=Fn(function(e){var t=e,{store:n,focusable:i=!0,autoSelect:r=!1,getAutoSelectId:a,setValueOnChange:s,showMinLength:l=0,showOnChange:o,showOnMouseDown:u,showOnClick:c=u,showOnKeyDown:d,showOnKeyPress:f=d,blurActiveItemOnClick:m,setValueOnClick:v=!0,moveOnKeyPress:p=!0,autoComplete:h="list"}=t,g=xt(t,["store","focusable","autoSelect","getAutoSelectId","setValueOnChange","showMinLength","showOnChange","showOnMouseDown","showOnClick","showOnKeyDown","showOnKeyPress","blurActiveItemOnClick","setValueOnClick","moveOnKeyPress","autoComplete"]);const b=Fi();Pt(n=n||b,!1);const x=(0,Bt.useRef)(null),[w,y]=(0,Bt.useReducer)(()=>[],[]),_=(0,Bt.useRef)(!1),C=(0,Bt.useRef)(!1),j=n.useState(e=>e.virtualFocus&&r),S="inline"===h||"both"===h,[k,V]=(0,Bt.useState)(S);!function(e,t){const n=(0,Bt.useRef)(!1);vn(()=>{n.current?S&&V(!0):n.current=!0},t),vn(()=>()=>{n.current=!1},[])}(0,[S]);const I=n.useState("value"),E=(0,Bt.useRef)();(0,Bt.useEffect)(()=>Un(n,["selectedValue","activeId"],(e,t)=>{E.current=t.selectedValue}),[]);const N=n.useState(e=>{var t;if(S&&k){if(e.activeValue&&Array.isArray(e.selectedValue)){if(e.selectedValue.includes(e.activeValue))return;if(null==(t=E.current)?void 0:t.includes(e.activeValue))return}return e.activeValue}}),F=n.useState("renderedItems"),M=n.useState("open"),A=n.useState("contentElement"),O=(0,Bt.useMemo)(()=>{if(!S)return I;if(!k)return I;if(or(F,N,j)){if(ur(I,N)){const e=(null==N?void 0:N.slice(I.length))||"";return I+e}return I}return N||I},[S,k,F,N,j,I]);(0,Bt.useEffect)(()=>{const e=x.current;if(!e)return;const t=()=>V(!0);return e.addEventListener("combobox-item-move",t),()=>{e.removeEventListener("combobox-item-move",t)}},[]),(0,Bt.useEffect)(()=>{if(!S)return;if(!k)return;if(!N)return;if(!or(F,N,j))return;if(!ur(I,N))return;let e=Nt;return queueMicrotask(()=>{const t=x.current;if(!t)return;const{start:n,end:i}=Xt(t),r=I.length,a=N.length;en(t,r,a),e=()=>{if(!qi(t))return;const{start:e,end:s}=Xt(t);e===r&&s===a&&en(t,n,i)}}),()=>e()},[w,S,k,N,F,j,I]);const P=(0,Bt.useRef)(null),L=pn(a),D=(0,Bt.useRef)(null);(0,Bt.useEffect)(()=>{if(!M)return;if(!A)return;const e=Jt(A);if(!e)return;P.current=e;const t=()=>{_.current=!1},i=()=>{if(!n)return;if(!_.current)return;const{activeId:e}=n.getState();null!==e&&e!==D.current&&(_.current=!1)},r={passive:!0,capture:!0};return e.addEventListener("wheel",t,r),e.addEventListener("touchmove",t,r),e.addEventListener("scroll",i,r),()=>{e.removeEventListener("wheel",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("scroll",i,!0)}},[M,A,n]),vn(()=>{I&&(C.current||(_.current=!0))},[I]),vn(()=>{"always"!==j&&M||(_.current=M)},[j,M]);const T=n.useState("resetValueOnSelect");bn(()=>{var e,t;const i=_.current;if(!n)return;if(!M)return;if(!i&&!T)return;const{baseElement:r,contentElement:a,activeId:s}=n.getState();if(!r||qi(r)){if(null==a?void 0:a.hasAttribute("data-placing")){const e=new MutationObserver(y);return e.observe(a,{attributeFilter:["data-placing"]}),()=>e.disconnect()}if(j&&i){const t=L(F),i=void 0!==t?t:null!=(e=function(e){const t=e.find(e=>{var t;return!e.disabled&&"tab"!==(null==(t=e.element)?void 0:t.getAttribute("role"))});return null==t?void 0:t.id}(F))?e:n.first();D.current=i,n.move(null!=i?i:null)}else{const e=null==(t=n.item(s||n.first()))?void 0:t.element;e&&"scrollIntoView"in e&&e.scrollIntoView({block:"nearest",inline:"nearest"})}}},[n,M,w,I,j,T,L,F]),(0,Bt.useEffect)(()=>{if(!S)return;const e=x.current;if(!e)return;const t=[e,A].filter(e=>!!e),i=e=>{t.every(t=>on(e,t))&&(null==n||n.setValue(O))};for(const e of t)e.addEventListener("focusout",i);return()=>{for(const e of t)e.removeEventListener("focusout",i)}},[S,A,n,O]);const B=e=>e.currentTarget.value.length>=l,z=g.onChange,H=xn(null!=o?o:B),R=xn(null!=s?s:!n.tag),$=pn(e=>{if(null==z||z(e),e.defaultPrevented)return;if(!n)return;const t=e.currentTarget,{value:i,selectionStart:r,selectionEnd:a}=t,s=e.nativeEvent;if(_.current=!0,function(e){return"input"===e.type}(s)&&(s.isComposing&&(_.current=!1,C.current=!0),S)){const e="insertText"===s.inputType||"insertCompositionText"===s.inputType,t=r===i.length;V(e&&t)}if(R(e)){const e=i===n.getState().value;n.setValue(i),queueMicrotask(()=>{en(t,r,a)}),S&&j&&e&&y()}H(e)&&n.show(),j&&_.current||n.setActiveId(null)}),W=g.onCompositionEnd,q=pn(e=>{_.current=!0,C.current=!1,null==W||W(e),e.defaultPrevented||j&&y()}),K=g.onMouseDown,G=xn(null!=m?m:()=>!!(null==n?void 0:n.getState().includesBaseElement)),Y=xn(v),U=xn(null!=c?c:B),Z=pn(e=>{null==K||K(e),e.defaultPrevented||e.button||e.ctrlKey||n&&(G(e)&&n.setActiveId(null),Y(e)&&n.setValue(O),U(e)&&un(e.currentTarget,"mouseup",n.show))}),X=g.onKeyDown,Q=xn(null!=f?f:B),J=pn(e=>{if(null==X||X(e),e.repeat||(_.current=!1),e.defaultPrevented)return;if(e.ctrlKey)return;if(e.altKey)return;if(e.shiftKey)return;if(e.metaKey)return;if(!n)return;const{open:t}=n.getState();t||"ArrowUp"!==e.key&&"ArrowDown"!==e.key||Q(e)&&(e.preventDefault(),n.show())}),ee=g.onBlur,te=pn(e=>{_.current=!1,null==ee||ee(e),e.defaultPrevented}),ne=gn(g.id),ie=function(e){return"inline"===e||"list"===e||"both"===e||"none"===e}(h)?h:void 0,re=n.useState(e=>null===e.activeId);return g=bt(gt({id:ne,role:"combobox","aria-autocomplete":ie,"aria-haspopup":Qt(A,"listbox"),"aria-expanded":M,"aria-controls":null==A?void 0:A.id,"data-active-item":re||void 0,value:O},g),{ref:hn(x,g.ref),onChange:$,onCompositionEnd:q,onMouseDown:Z,onKeyDown:J,onBlur:te}),g=sr(bt(gt({store:n,focusable:i},g),{moveOnKeyPress:e=>!function(e,...t){const n="function"==typeof e?e(...t):e;return null!=n&&!n}(p,e)&&(S&&V(!0),!0)})),g=lr(gt({store:n},g)),gt({autoComplete:"off"},g)}),dr=In(function(e){return Nn("input",cr(e))}),fr=n(795);function mr(e,t){const n=setTimeout(t,e);return()=>clearTimeout(n)}function vr(...e){return e.join(", ").split(", ").reduce((e,t)=>{const n=t.endsWith("ms")?1:1e3,i=Number.parseFloat(t||"0s")*n;return i>e?i:e},0)}function pr(e,t,n){return!(n||!1===t||e&&!t)}var hr=Fn(function(e){var t=e,{store:n,alwaysVisible:i}=t,r=xt(t,["store","alwaysVisible"]);const a=xi();Pt(n=n||a,!1);const s=(0,Bt.useRef)(null),l=gn(r.id),[u,c]=(0,Bt.useState)(null),d=n.useState("open"),f=n.useState("mounted"),m=n.useState("animated"),v=n.useState("contentElement"),p=ti(n.disclosure,"contentElement");vn(()=>{s.current&&(null==n||n.setContentElement(s.current))},[n]),vn(()=>{let e;return null==n||n.setState("animated",t=>(e=t,!0)),()=>{void 0!==e&&(null==n||n.setState("animated",e))}},[n]),vn(()=>{if(m){if(null==v?void 0:v.isConnected)return function(e){let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)}(()=>{c(d?"enter":f?"leave":null)});c(null)}},[m,v,d,f]),vn(()=>{if(!n)return;if(!m)return;if(!u)return;if(!v)return;const e=()=>null==n?void 0:n.setState("animating",!1),t=()=>(0,fr.flushSync)(e);if("leave"===u&&d)return;if("enter"===u&&!d)return;if("number"==typeof m)return mr(m,t);const{transitionDuration:i,animationDuration:r,transitionDelay:a,animationDelay:s}=getComputedStyle(v),{transitionDuration:l="0",animationDuration:o="0",transitionDelay:c="0",animationDelay:f="0"}=p?getComputedStyle(p):{},h=vr(a,s,c,f)+vr(i,r,l,o);return h?mr(Math.max(h-1e3/60,0),t):("enter"===u&&n.setState("animated",!1),void e())},[n,m,v,p,d,u]),r=wn(r,e=>(0,o.jsx)(_i,{value:n,children:e}),[n]);const h=pr(f,r.hidden,i),g=r.style,b=(0,Bt.useMemo)(()=>h?bt(gt({},g),{display:"none"}):g,[h,g]);return Dt(r=bt(gt({id:l,"data-open":d||void 0,"data-enter":"enter"===u||void 0,"data-leave":"leave"===u||void 0,hidden:h},r),{ref:hn(l?n.setContentElement:null,s,r.ref),style:b}))}),gr=In(function(e){return Nn("div",hr(e))}),br=(In(function(e){var t=e,{unmountOnHide:n}=t,i=xt(t,["unmountOnHide"]);const r=xi();return!1===ti(i.store||r,e=>!n||(null==e?void 0:e.mounted))?null:(0,o.jsx)(gr,gt({},i))}),Fn(function(e){var t=e,{store:n,alwaysVisible:i}=t,r=xt(t,["store","alwaysVisible"]);const a=Ni(!0),s=Ei(),l=!!(n=n||s)&&n===a;Pt(n,!1);const u=(0,Bt.useRef)(null),c=gn(r.id),d=n.useState("mounted"),f=pr(d,r.hidden,i),m=f?bt(gt({},r.style),{display:"none"}):r.style,v=n.useState(e=>Array.isArray(e.selectedValue)),p=function(e,t,n){const i=function(e){const[t]=(0,Bt.useState)(e);return t}(n),[r,a]=(0,Bt.useState)(i);return(0,Bt.useEffect)(()=>{const n=e&&"current"in e?e.current:e;if(!n)return;const r=()=>{const e=n.getAttribute(t);a(null==e?i:e)},s=new MutationObserver(r);return s.observe(n,{attributeFilter:[t]}),r(),()=>s.disconnect()},[e,t,i]),r}(u,"role",r.role),h=("listbox"===p||"tree"===p||"grid"===p)&&v||void 0,[g,b]=(0,Bt.useState)(!1),x=n.useState("contentElement");vn(()=>{if(!d)return;const e=u.current;if(!e)return;if(x!==e)return;const t=()=>{b(!!e.querySelector("[role='listbox']"))},n=new MutationObserver(t);return n.observe(e,{subtree:!0,childList:!0,attributeFilter:["role"]}),t(),()=>n.disconnect()},[d,x]),g||(r=gt({role:"listbox","aria-multiselectable":h},r)),r=wn(r,e=>(0,o.jsx)(Ai,{value:n,children:(0,o.jsx)(Vi.Provider,{value:p,children:e})}),[n,p]);const w=!c||a&&l?null:n.setContentElement;return Dt(r=bt(gt({id:c,hidden:f},r),{ref:hn(w,u,r.ref),style:m}))})),xr=In(function(e){return Nn("div",br(e))});function wr(e){const t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}var yr=Symbol("composite-hover"),_r=Fn(function(e){var t=e,{store:n,focusOnHover:i=!0,blurOnHoverEnd:r=!!i}=t,a=xt(t,["store","focusOnHover","blurOnHoverEnd"]);const s=Ln();Pt(n=n||s,!1);const l=((0,Bt.useEffect)(()=>{yn||(cn("mousemove",kn,!0),cn("mousedown",Vn,!0),cn("mouseup",Vn,!0),cn("keydown",Vn,!0),cn("scroll",Vn,!0),yn=!0)},[]),pn(()=>Cn)),o=a.onMouseMove,u=xn(i),c=pn(e=>{if(null==o||o(e),!e.defaultPrevented&&l()&&u(e)){if(!Ki(e.currentTarget)){const e=null==n?void 0:n.getState().baseElement;e&&!qi(e)&&e.focus()}null==n||n.setActiveId(e.currentTarget.id)}}),d=a.onMouseLeave,f=xn(r),m=pn(e=>{var t;null==d||d(e),e.defaultPrevented||l()&&(function(e){const t=wr(e);return!!t&&Kt(e.currentTarget,t)}(e)||function(e){let t=wr(e);if(!t)return!1;do{if(Ft(t,yr)&&t[yr])return!0;t=t.parentElement}while(t);return!1}(e)||u(e)&&f(e)&&(null==n||n.setActiveId(null),null==(t=null==n?void 0:n.getState().baseElement)||t.focus()))}),v=(0,Bt.useCallback)(e=>{e&&(e[yr]=!0)},[]);return Dt(a=bt(gt({},a),{ref:hn(v,a.ref),onMouseMove:c,onMouseLeave:m}))}),Cr=(En(In(function(e){return Nn("div",_r(e))})),Fn(function(e){var t=e,{store:n,shouldRegisterItem:i=!0,getItem:r=Ot,element:a}=t,s=xt(t,["store","shouldRegisterItem","getItem","element"]);const l=On();n=n||l;const o=gn(s.id),u=(0,Bt.useRef)(a);return(0,Bt.useEffect)(()=>{const e=u.current;if(!o)return;if(!e)return;if(!i)return;const t=r({id:o,element:e});return null==n?void 0:n.renderItem(t)},[o,i,r,n]),Dt(s=bt(gt({},s),{ref:hn(u,s.ref)}))}));function jr(e){if(!e.isTrusted)return!1;const t=e.currentTarget;return"Enter"===e.key?Gt(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&(Gt(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}In(function(e){return Nn("div",Cr(e))});var Sr=Symbol("command"),kr=Fn(function(e){var t=e,{clickOnEnter:n=!0,clickOnSpace:i=!0}=t,r=xt(t,["clickOnEnter","clickOnSpace"]);const a=(0,Bt.useRef)(null),[s,l]=(0,Bt.useState)(!1);(0,Bt.useEffect)(()=>{a.current&&l(Gt(a.current))},[]);const[o,u]=(0,Bt.useState)(!1),c=(0,Bt.useRef)(!1),d=Lt(r),[f,m]=function(e,t,n){const i=e.onLoadedMetadataCapture,r=(0,Bt.useMemo)(()=>Object.assign(()=>{},bt(gt({},i),{[t]:n})),[i,t,n]);return[null==i?void 0:i[t],{onLoadedMetadataCapture:r}]}(r,Sr,!0),v=r.onKeyDown,p=pn(e=>{null==v||v(e);const t=e.currentTarget;if(e.defaultPrevented)return;if(f)return;if(d)return;if(!an(e))return;if(Ut(t))return;if(t.isContentEditable)return;const r=n&&"Enter"===e.key,a=i&&" "===e.key,s="Enter"===e.key&&!n,l=" "===e.key&&!i;if(s||l)e.preventDefault();else if(r||a){const n=jr(e);if(r){if(!n){e.preventDefault();const n=e,{view:i}=n,r=xt(n,["view"]),a=()=>ln(t,r);$t&&/firefox\//i.test(navigator.userAgent)?un(t,"keyup",a):queueMicrotask(a)}}else a&&(c.current=!0,n||(e.preventDefault(),u(!0)))}}),h=r.onKeyUp,g=pn(e=>{if(null==h||h(e),e.defaultPrevented)return;if(f)return;if(d)return;if(e.metaKey)return;const t=i&&" "===e.key;if(c.current&&t&&(c.current=!1,!jr(e))){e.preventDefault(),u(!1);const t=e.currentTarget,n=e,{view:i}=n,r=xt(n,["view"]);queueMicrotask(()=>ln(t,r))}});return r=bt(gt(gt({"data-active":o||void 0,type:s?"button":void 0},m),r),{ref:hn(a,r.ref),onKeyDown:p,onKeyUp:g}),rr(r)});function Vr(e,t=!1){const{top:n}=e.getBoundingClientRect();return t?n+e.clientHeight:n}function Ir(e,t,n,i=!1){var r;if(!t)return;if(!n)return;const{renderedItems:a}=t.getState(),s=Jt(e);if(!s)return;const l=function(e,t=!1){const n=e.clientHeight,{top:i}=e.getBoundingClientRect(),r=1.5*Math.max(.875*n,n-40),a=t?n-r+i:r+i;return"HTML"===e.tagName?a+e.scrollTop:a}(s,i);let o,u;for(let e=0;e=0){void 0!==u&&ui||(e&&(null==p?void 0:p.baseElement)&&p.baseElement===e.baseElement?p.id:void 0),baseElement:e=>(null==e?void 0:e.baseElement)||void 0,isActiveItem:e=>!!e&&e.activeId===m,ariaSetSize:e=>null!=u?u:e&&(null==p?void 0:p.ariaSetSize)&&p.baseElement===e.baseElement?p.ariaSetSize:void 0,ariaPosInSet(e){if(null!=c)return c;if(!e)return;if(!(null==p?void 0:p.ariaPosInSet))return;if(p.baseElement!==e.baseElement)return;const t=e.renderedItems.filter(e=>e.rowId===g);return p.ariaPosInSet+t.findIndex(e=>e.id===m)},isTabbable(e){if(!(null==e?void 0:e.renderedItems.length))return!0;if(e.virtualFocus)return!1;if(s)return!0;if(null===e.activeId)return!1;const t=null==n?void 0:n.item(e.activeId);return!!(null==t?void 0:t.disabled)||!(null==t?void 0:t.element)||e.activeId===m}}),C=(0,Bt.useCallback)(e=>{var t;const n=bt(gt({},e),{id:m||e.id,rowId:g,disabled:!!h,children:null==(t=e.element)?void 0:t.textContent});return l?l(n):n},[m,g,h,l]),j=d.onFocus,S=(0,Bt.useRef)(!1),k=pn(e=>{if(null==j||j(e),e.defaultPrevented)return;if(rn(e))return;if(!m)return;if(!n)return;if(function(e,t){return!an(e)&&Hi(t,e.target)}(e,n))return;const{virtualFocus:t,baseElement:i}=n.getState();var r;(n.setActiveId(m),Zt(e.currentTarget)&&function(e,t=!1){if(Ut(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){const n=Wt(e).getSelection();null==n||n.selectAllChildren(e),t&&(null==n||n.collapseToEnd())}}(e.currentTarget),t)&&(an(e)&&(Zt(r=e.currentTarget)||"INPUT"===r.tagName&&!Gt(r)||(null==i?void 0:i.isConnected)&&(nn()&&e.currentTarget.hasAttribute("data-autofocus")&&e.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),S.current=!0,e.relatedTarget===i||Hi(n,e.relatedTarget)?function(e){e[zi]=!0,e.focus({preventScroll:!0})}(i):i.focus())))}),V=d.onBlurCapture,I=pn(e=>{if(null==V||V(e),e.defaultPrevented)return;const t=null==n?void 0:n.getState();(null==t?void 0:t.virtualFocus)&&S.current&&(S.current=!1,e.preventDefault(),e.stopPropagation())}),E=d.onKeyDown,N=xn(r),F=xn(a),M=pn(e=>{if(null==E||E(e),e.defaultPrevented)return;if(!an(e))return;if(!n)return;const{currentTarget:t}=e,i=n.getState(),r=n.item(m),a=!!(null==r?void 0:r.rowId),s="horizontal"!==i.orientation,l="vertical"!==i.orientation,o=()=>!(!a&&!l&&i.baseElement&&Ut(i.baseElement)),u={ArrowUp:(a||s)&&n.up,ArrowRight:(a||l)&&n.next,ArrowDown:(a||s)&&n.down,ArrowLeft:(a||l)&&n.previous,Home:()=>{if(o())return!a||e.ctrlKey?null==n?void 0:n.first():null==n?void 0:n.previous(-1)},End:()=>{if(o())return!a||e.ctrlKey?null==n?void 0:n.last():null==n?void 0:n.next(-1)},PageUp:()=>Ir(t,n,null==n?void 0:n.up,!0),PageDown:()=>Ir(t,n,null==n?void 0:n.down)}[e.key];if(u){if(Zt(t)){const n=Xt(t),i=l&&"ArrowLeft"===e.key,r=l&&"ArrowRight"===e.key,a=s&&"ArrowUp"===e.key,o=s&&"ArrowDown"===e.key;if(r||o){const{length:e}=function(e){if(Ut(e))return e.value;if(e.isContentEditable){const t=Wt(e).createRange();return t.selectNodeContents(e),t.toString()}return""}(t);if(n.end!==e)return}else if((i||a)&&0!==n.start)return}const i=u();if(N(e)||void 0!==i){if(!F(e))return;e.preventDefault(),n.move(i)}}}),A=(0,Bt.useMemo)(()=>({id:m,baseElement:b}),[m,b]);return d=wn(d,e=>(0,o.jsx)(zn.Provider,{value:A,children:e}),[A]),d=bt(gt({id:m,"data-active-item":x||void 0},d),{ref:hn(v,d.ref),tabIndex:_?d.tabIndex:-1,onFocus:k,onBlurCapture:I,onKeyDown:M}),d=kr(d),d=Cr(bt(gt({store:n},d),{getItem:C,shouldRegisterItem:!!m&&d.shouldRegisterItem})),Dt(bt(gt({},d),{"aria-setsize":w,"aria-posinset":y}))});function Nr(e){var t;return null!=(t={menu:"menuitem",listbox:"option",tree:"treeitem"}[e])?t:"option"}En(In(function(e){return Nn("button",Er(e))}));var Fr=Fn(function(e){var t,n=e,{store:i,value:r,hideOnClick:a,setValueOnClick:s,selectValueOnClick:l=!0,resetValueOnSelect:u,focusOnHover:c=!1,moveOnKeyPress:d=!0,getItem:f}=n,m=xt(n,["store","value","hideOnClick","setValueOnClick","selectValueOnClick","resetValueOnSelect","focusOnHover","moveOnKeyPress","getItem"]);const v=Ni();Pt(i=i||v,!1);const{resetValueOnSelectState:p,multiSelectable:h,selected:g}=ni(i,{resetValueOnSelectState:"resetValueOnSelect",multiSelectable:e=>Array.isArray(e.selectedValue),selected:e=>function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)}(e.selectedValue,r)}),b=(0,Bt.useCallback)(e=>{const t=bt(gt({},e),{value:r});return f?f(t):t},[r,f]);s=null!=s?s:!h,a=null!=a?a:null!=r&&!h;const x=m.onClick,w=xn(s),y=xn(l),_=xn(null!=(t=null!=u?u:p)?t:h),C=xn(a),j=pn(e=>{null==x||x(e),e.defaultPrevented||function(e){const t=e.currentTarget;if(!t)return!1;const n=t.tagName.toLowerCase();return!!e.altKey&&("a"===n||"button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type)}(e)||function(e){const t=e.currentTarget;if(!t)return!1;const n=tn();if(n&&!e.metaKey)return!1;if(!n&&!e.ctrlKey)return!1;const i=t.tagName.toLowerCase();return"a"===i||"button"===i&&"submit"===t.type||"input"===i&&"submit"===t.type}(e)||(null!=r&&(y(e)&&(_(e)&&(null==i||i.resetValue()),null==i||i.setSelectedValue(e=>Array.isArray(e)?e.includes(r)?e.filter(e=>e!==r):[...e,r]:r)),w(e)&&(null==i||i.setValue(r))),C(e)&&(null==i||i.hide()))}),S=m.onKeyDown,k=pn(e=>{if(null==S||S(e),e.defaultPrevented)return;const t=null==i?void 0:i.getState().baseElement;t&&(qi(t)||(1===e.key.length||"Backspace"===e.key||"Delete"===e.key)&&(queueMicrotask(()=>t.focus()),Ut(t)&&(null==i||i.setValue(t.value))))});h&&null!=g&&(m=gt({"aria-selected":g},m)),m=wn(m,e=>(0,o.jsx)(Oi.Provider,{value:r,children:(0,o.jsx)(Pi.Provider,{value:null!=g&&g,children:e})}),[r,g]);const V=(0,Bt.useContext)(Vi);m=bt(gt({role:Nr(V),children:r},m),{onClick:j,onKeyDown:k});const I=xn(d);return m=Er(bt(gt({store:i},m),{getItem:b,moveOnKeyPress:e=>{if(!I(e))return!1;const t=new Event("combobox-item-move"),n=null==i?void 0:i.getState().baseElement;return null==n||n.dispatchEvent(t),!0}})),_r(gt({store:i,focusOnHover:c},m))}),Mr=En(In(function(e){return Nn("div",Fr(e))}));function Ar(e){return At(e).toLowerCase()}var Or=Fn(function(e){var t=e,{store:n,value:i,userValue:r}=t,a=xt(t,["store","value","userValue"]);const s=Ni();n=n||s;const l=(0,Bt.useContext)(Oi),u=null!=i?i:l,c=ti(n,e=>null!=r?r:null==e?void 0:e.value),d=(0,Bt.useMemo)(()=>{if(u)return c?function(e,t){if(!e)return e;if(!t)return e;const n=(i=t,Array.isArray(i)?i:void 0!==i?[i]:[]).filter(Boolean).map(Ar);var i;const r=[],a=(e,t=!1)=>(0,o.jsx)("span",{"data-autocomplete-value":t?"":void 0,"data-user-value":t?void 0:"",children:e},r.length),s=function(e){return e.sort(([e],[t])=>e-t)}(function(e){return e.filter(([e,t],n,i)=>!i.some(([i,r],a)=>a!==n&&i<=e&&i+r>=e+t))}(function(e,t){const n=[];for(const i of t){let t=0;const r=i.length;for(;-1!==e.indexOf(i,t);){const a=e.indexOf(i,t);-1!==a&&n.push([a,r]),t=a+1}}return n}(Ar(e),new Set(n))));if(!s.length)return r.push(a(e,!0)),r;const[l]=s[0],u=[e.slice(0,l),...s.flatMap(([t,n],i)=>{var r;const a=e.slice(t,t+n),l=null==(r=s[i+1])?void 0:r[0];return[a,e.slice(t+n,l)]})];return u.forEach((e,t)=>{e&&r.push(a(e,t%2==0))}),r}(u,c):u},[u,c]);return Dt(a=gt({children:d},a))}),Pr=In(function(e){return Nn("span",Or(e))}),Lr=n(731),Dr=n.n(Lr),Tr=n(307),Br=[],zr=(e,t)=>e.singleSelection?t?.value:Array.isArray(t?.value)?t.value:!Array.isArray(t?.value)&&t?.value?[t.value]:Br,Hr=[];function Rr({elements:e,getElements:t}){const n=Array.isArray(e)&&e.length>0?e:Hr,[i,a]=(0,r.useState)(n),[s,l]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{if(!t)return void a(n);let e=!1;return l(!0),t().then(t=>{if(!e){const e=Array.isArray(t)&&t.length>0?t:n;a(e)}}).catch(()=>{e||a(n)}).finally(()=>{e||l(!1)}),()=>{e=!0}},[t,n]),{elements:i,isLoading:s}}function $r(e=""){return Dr()(e.trim().toLowerCase())}var Wr=(e,t,n)=>e.singleSelection?n:Array.isArray(t?.value)?t.value.includes(n)?t.value.filter(e=>e!==n):[...t.value,n]:[n];function qr(e,t){return`${e}-${t}`}var Kr=({selected:e})=>(0,o.jsx)("span",{className:(0,U.A)("dataviews-filters__search-widget-listitem-multi-selection",{"is-selected":e}),children:e&&(0,o.jsx)(i.Icon,{icon:Oe})}),Gr=({selected:e})=>(0,o.jsx)("span",{className:(0,U.A)("dataviews-filters__search-widget-listitem-single-selection",{"is-selected":e})});function Yr({view:e,filter:t,onChangeView:n}){const l=(0,a.useInstanceId)(Yr,"dataviews-filter-list-box"),[u,c]=(0,r.useState)(1===t.operators?.length?void 0:null),d=e.filters?.find(e=>e.field===t.field),f=zr(t,d);return(0,o.jsx)(i.Composite,{virtualFocus:!0,focusLoop:!0,activeId:u,setActiveId:c,role:"listbox",className:"dataviews-filters__search-widget-listbox","aria-label":(0,s.sprintf)(
-/* translators: List of items for a filter. 1: Filter name. e.g.: "List of: Author". */
-/* translators: List of items for a filter. 1: Filter name. e.g.: "List of: Author". */
-(0,s.__)("List of: %1$s"),t.name),onFocusVisible:()=>{!u&&t.elements.length&&c(qr(l,t.elements[0].value))},render:(0,o.jsx)(i.Composite.Typeahead,{}),children:t.elements.map(r=>(0,o.jsxs)(i.Composite.Hover,{render:(0,o.jsx)(i.Composite.Item,{id:qr(l,r.value),render:(0,o.jsx)("div",{"aria-label":r.label,role:"option",className:"dataviews-filters__search-widget-listitem"}),onClick:()=>{const i=d?[...(e.filters??[]).map(e=>e.field===t.field?{...e,operator:d.operator||t.operators[0],value:Wr(t,d,r.value)}:e)]:[...e.filters??[],{field:t.field,operator:t.operators[0],value:Wr(t,d,r.value)}];n({...e,page:1,filters:i})}}),children:[t.singleSelection&&(0,o.jsx)(Gr,{selected:f===r.value}),!t.singleSelection&&(0,o.jsx)(Kr,{selected:f.includes(r.value)}),(0,o.jsx)("span",{children:r.label})]},r.value))})}function Ur({view:e,filter:t,onChangeView:n}){const[a,l]=(0,r.useState)(""),u=(0,r.useDeferredValue)(a),c=e.filters?.find(e=>e.field===t.field),d=zr(t,c),f=(0,r.useMemo)(()=>{const e=$r(u);return t.elements.filter(t=>$r(t.label).includes(e))},[t.elements,u]);return(0,o.jsxs)(Li,{selectedValue:d,setSelectedValue:i=>{const r=c?[...(e.filters??[]).map(e=>e.field===t.field?{...e,operator:c.operator||t.operators[0],value:i}:e)]:[...e.filters??[],{field:t.field,operator:t.operators[0],value:i}];n({...e,page:1,filters:r})},setValue:l,children:[(0,o.jsxs)("div",{className:"dataviews-filters__search-widget-filter-combobox__wrapper",children:[(0,o.jsx)(Ti,{render:(0,o.jsx)(i.VisuallyHidden,{children:(0,s.__)("Search items")}),children:(0,s.__)("Search items")}),(0,o.jsx)(dr,{autoSelect:"always",placeholder:(0,s.__)("Search"),className:"dataviews-filters__search-widget-filter-combobox__input"}),(0,o.jsx)("div",{className:"dataviews-filters__search-widget-filter-combobox__icon",children:(0,o.jsx)(i.Icon,{icon:Tr.A})})]}),(0,o.jsxs)(xr,{className:"dataviews-filters__search-widget-filter-combobox-list",alwaysVisible:!0,children:[f.map(e=>(0,o.jsxs)(Mr,{resetValueOnSelect:!1,value:e.value,className:"dataviews-filters__search-widget-listitem",hideOnClick:!1,setValueOnClick:!1,focusOnHover:!0,children:[t.singleSelection&&(0,o.jsx)(Gr,{selected:d===e.value}),!t.singleSelection&&(0,o.jsx)(Kr,{selected:d.includes(e.value)}),(0,o.jsxs)("span",{children:[(0,o.jsx)(Pr,{className:"dataviews-filters__search-widget-filter-combobox-item-value",value:e.label}),!!e.description&&(0,o.jsx)("span",{className:"dataviews-filters__search-widget-listitem-description",children:e.description})]})]},e.value)),!f.length&&(0,o.jsx)("p",{children:(0,s.__)("No results found")})]})]})}function Zr(e){const{elements:t,isLoading:n}=Rr({elements:e.filter.elements,getElements:e.filter.getElements});if(n)return(0,o.jsx)("div",{className:"dataviews-filters__search-widget-no-elements",children:(0,o.jsx)(i.Spinner,{})});if(0===t.length)return(0,o.jsx)("div",{className:"dataviews-filters__search-widget-no-elements",children:(0,s.__)("No elements found")});const r=t.length>10?Ur:Yr;return(0,o.jsx)(r,{...e,filter:{...e.filter,elements:t}})}var Xr=n(252),Qr=n.n(Xr);function Jr({filter:e,view:t,onChangeView:n,fields:s}){const l=t.filters?.find(t=>t.field===e.field),u=zr(e,l),c=(0,r.useMemo)(()=>{const t=s.find(t=>t.id===e.field);return t?{...t,isValid:{required:!1,custom:()=>null},getValue:({item:e})=>e[t.id],setValue:({value:e})=>({[t.id]:e})}:t},[s,e.field]),d=(0,r.useMemo)(()=>(t.filters??[]).reduce((e,t)=>(e[t.field]=t.value,e),{}),[t.filters]),f=(0,a.useEvent)(i=>{if(!c||!l)return;const r=c.getValue({item:i});Qr()(r,u)||n({...t,filters:(t.filters??[]).map(t=>t.field===e.field?{...t,operator:l.operator||e.operators[0],value:""===r?void 0:r}:t)})});return c&&c.Edit&&l?(0,o.jsx)(i.Flex,{className:"dataviews-filters__user-input-widget",gap:2.5,direction:"column",children:(0,o.jsx)(c.Edit,{hideLabelFromVision:!0,data:d,field:c,operator:l.operator,onChange:f})}):null}Math.pow(10,8);const ea=6048e5,ta=Symbol.for("constructDateFrom");function na(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&ta in e?e[ta](t):e instanceof Date?new e.constructor(t):new Date(t)}function ia(e,t){return na(t||e,e)}function ra(e){return!(!((t=e)instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t))&&"number"!=typeof e||isNaN(+ia(e)));var t}var aa=n(443);function sa(e){if(!e)return null;const t=(0,aa.getDate)(e);return t&&ra(t)?t:null}var la="Enter",oa=" ",ua=({activeElements:e,filterInView:t,filter:n})=>{if(void 0===e||0===e.length)return n.name;const i={Name:(0,o.jsx)("span",{className:"dataviews-filters__summary-filter-text-name"}),Value:(0,o.jsx)("span",{className:"dataviews-filters__summary-filter-text-value"})};if(t?.operator===m)return(0,r.createInterpolateElement)((0,s.sprintf)(
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is any: Admin, Editor". */
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is any: Admin, Editor". */
-(0,s.__)("%1$s is any: %2$s"),n.name,e.map(e=>e.label).join(", ")),i);if(t?.operator===v)return(0,r.createInterpolateElement)((0,s.sprintf)(
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is none: Admin, Editor". */
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is none: Admin, Editor". */
-(0,s.__)("%1$s is none: %2$s"),n.name,e.map(e=>e.label).join(", ")),i);if(t?.operator===p)return(0,r.createInterpolateElement)((0,s.sprintf)(
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is all: Admin, Editor". */
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is all: Admin, Editor". */
-(0,s.__)("%1$s is all: %2$s"),n.name,e.map(e=>e.label).join(", ")),i);if(t?.operator===h)return(0,r.createInterpolateElement)((0,s.sprintf)(
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is not all: Admin, Editor". */
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is not all: Admin, Editor". */
-(0,s.__)("%1$s is not all: %2$s"),n.name,e.map(e=>e.label).join(", ")),i);if(t?.operator===d)return(0,r.createInterpolateElement)((0,s.sprintf)(
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is: Admin". */
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is: Admin". */
-(0,s.__)("%1$s is: %2$s"),n.name,e[0].label),i);if(t?.operator===f)return(0,r.createInterpolateElement)((0,s.sprintf)(
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is not: Admin". */
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is not: Admin". */
-(0,s.__)("%1$s is not: %2$s"),n.name,e[0].label),i);if(t?.operator===g)return(0,r.createInterpolateElement)((0,s.sprintf)(
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is less than: 10". */
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is less than: 10". */
-(0,s.__)("%1$s is less than: %2$s"),n.name,e[0].label),i);if(t?.operator===b)return(0,r.createInterpolateElement)((0,s.sprintf)(
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is greater than: 10". */
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is greater than: 10". */
-(0,s.__)("%1$s is greater than: %2$s"),n.name,e[0].label),i);if(t?.operator===x)return(0,r.createInterpolateElement)((0,s.sprintf)(
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is less than or equal to: 10". */
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is less than or equal to: 10". */
-(0,s.__)("%1$s is less than or equal to: %2$s"),n.name,e[0].label),i);if(t?.operator===w)return(0,r.createInterpolateElement)((0,s.sprintf)(
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is greater than or equal to: 10". */
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is greater than or equal to: 10". */
-(0,s.__)("%1$s is greater than or equal to: %2$s"),n.name,e[0].label),i);if(t?.operator===S)return(0,r.createInterpolateElement)((0,s.sprintf)(
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Title contains: Mars". */
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Title contains: Mars". */
-(0,s.__)("%1$s contains: %2$s"),n.name,e[0].label),i);if(t?.operator===k)return(0,r.createInterpolateElement)((0,s.sprintf)(
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Description doesn't contain: photo". */
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Description doesn't contain: photo". */
-(0,s.__)("%1$s doesn't contain: %2$s"),n.name,e[0].label),i);if(t?.operator===V)return(0,r.createInterpolateElement)((0,s.sprintf)(
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Title starts with: Mar". */
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Title starts with: Mar". */
-(0,s.__)("%1$s starts with: %2$s"),n.name,e[0].label),i);if(t?.operator===y)return(0,r.createInterpolateElement)((0,s.sprintf)(
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is before: 2024-01-01". */
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is before: 2024-01-01". */
-(0,s.__)("%1$s is before: %2$s"),n.name,e[0].label),i);if(t?.operator===_)return(0,r.createInterpolateElement)((0,s.sprintf)(
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is after: 2024-01-01". */
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is after: 2024-01-01". */
-(0,s.__)("%1$s is after: %2$s"),n.name,e[0].label),i);if(t?.operator===C)return(0,r.createInterpolateElement)((0,s.sprintf)(
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is on or before: 2024-01-01". */
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is on or before: 2024-01-01". */
-(0,s.__)("%1$s is on or before: %2$s"),n.name,e[0].label),i);if(t?.operator===j)return(0,r.createInterpolateElement)((0,s.sprintf)(
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is on or after: 2024-01-01". */
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is on or after: 2024-01-01". */
-(0,s.__)("%1$s is on or after: %2$s"),n.name,e[0].label),i);if(t?.operator===I){const{label:t}=e[0];return(0,r.createInterpolateElement)((0,s.sprintf)(
-/* translators: 1: Filter name. 2: Min value. 3: Max value. e.g.: "Item count between (inc): 10 and 180". */
-/* translators: 1: Filter name. 2: Min value. 3: Max value. e.g.: "Item count between (inc): 10 and 180". */
-(0,s.__)("%1$s between (inc): %2$s and %3$s"),n.name,t[0],t[1]),i)}return t?.operator===E?(0,r.createInterpolateElement)((0,s.sprintf)(
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is: 2024-01-01". */
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is: 2024-01-01". */
-(0,s.__)("%1$s is: %2$s"),n.name,e[0].label),i):t?.operator===N?(0,r.createInterpolateElement)((0,s.sprintf)(
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is not: 2024-01-01". */
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is not: 2024-01-01". */
-(0,s.__)("%1$s is not: %2$s"),n.name,e[0].label),i):t?.operator===F?(0,r.createInterpolateElement)((0,s.sprintf)(
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is in the past: 1 days". */
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is in the past: 1 days". */
-(0,s.__)("%1$s is in the past: %2$s"),n.name,`${e[0].value.value} ${e[0].value.unit}`),i):t?.operator===M?(0,r.createInterpolateElement)((0,s.sprintf)(
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is over: 1 days ago". */
-/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is over: 1 days ago". */
-(0,s.__)("%1$s is over: %2$s ago"),n.name,`${e[0].value.value} ${e[0].value.unit}`),i):(0,s.sprintf)(
-/* translators: 1: Filter name e.g.: "Unknown status for Author". */
-/* translators: 1: Filter name e.g.: "Unknown status for Author". */
-(0,s.__)("Unknown status for %1$s"),n.name)};function ca({filter:e,view:t,onChangeView:n}){const r=e.operators?.map(e=>({value:e,label:P[e]?.label})),a=t.filters?.find(t=>t.field===e.field),l=a?.operator||e.operators[0];return r.length>1&&(0,o.jsxs)(i.__experimentalHStack,{spacing:2,justify:"flex-start",className:"dataviews-filters__summary-operators-container",children:[(0,o.jsx)(i.FlexItem,{className:"dataviews-filters__summary-operators-filter-name",children:e.name}),(0,o.jsx)(i.SelectControl,{className:"dataviews-filters__summary-operators-filter-select",label:(0,s.__)("Conditions"),value:l,options:r,onChange:i=>{const r=i,s=a?.operator,l=a?[...(t.filters??[]).map(t=>{if(t.field===e.field){const e=[I,F,M],n=s&&(e.includes(s)||e.includes(r));return{...t,value:n?void 0:t.value,operator:r}}return t})]:[...t.filters??[],{field:e.field,operator:r,value:void 0}];n({...t,page:1,filters:l})},size:"small",variant:"minimal",__nextHasNoMarginBottom:!0,hideLabelFromVision:!0})]})}function da({addFilterRef:e,openedFilter:t,fields:n,...a}){const l=(0,r.useRef)(null),{filter:u,view:c,onChangeView:d}=a,f=c.filters?.find(e=>e.field===u.field);let m=[];const{elements:v}=Rr({elements:u.elements,getElements:u.getElements});if(v.length>0)m=v.filter(e=>u.singleSelection?e.value===f?.value:f?.value?.includes(e.value));else if(void 0!==f?.value){const e=n.find(e=>e.id===u.field);let t=f.value;if("datetime"===e?.type&&"string"==typeof t)try{const e=sa(t);null!==e&&(t=e.toLocaleString())}catch(e){t=f.value}m=[{value:f.value,label:t}]}const p=u.isPrimary,h=f?.isLocked,g=!h&&void 0!==f?.value,b=!h&&(!p||g);return(0,o.jsx)(i.Dropdown,{defaultOpen:t===u.field,contentClassName:"dataviews-filters__summary-popover",popoverProps:{placement:"bottom-start",role:"dialog"},onClose:()=>{l.current?.focus()},renderToggle:({isOpen:t,onToggle:n})=>(0,o.jsxs)("div",{className:"dataviews-filters__summary-chip-container",children:[(0,o.jsx)(i.Tooltip,{text:(0,s.sprintf)(
-/* translators: 1: Filter name. */
-/* translators: 1: Filter name. */
-(0,s.__)("Filter by: %1$s"),u.name.toLowerCase()),placement:"top",children:(0,o.jsx)("div",{className:(0,U.A)("dataviews-filters__summary-chip",{"has-reset":b,"has-values":g,"is-not-clickable":h}),role:"button",tabIndex:h?-1:0,onClick:()=>{h||n()},onKeyDown:e=>{!h&&[la,oa].includes(e.key)&&(n(),e.preventDefault())},"aria-disabled":h,"aria-pressed":t,"aria-expanded":t,ref:l,children:(0,o.jsx)(ua,{activeElements:m,filterInView:f,filter:u})})}),b&&(0,o.jsx)(i.Tooltip,{text:p?(0,s.__)("Reset"):(0,s.__)("Remove"),placement:"top",children:(0,o.jsx)("button",{className:(0,U.A)("dataviews-filters__summary-chip-remove",{"has-values":g}),onClick:()=>{d({...c,page:1,filters:c.filters?.filter(e=>e.field!==u.field)}),p?l.current?.focus():e.current?.focus()},children:(0,o.jsx)(i.Icon,{icon:fe})})})]}),renderContent:()=>(0,o.jsxs)(i.__experimentalVStack,{spacing:0,justify:"flex-start",children:[(0,o.jsx)(ca,{...a}),a.filter.hasElements?(0,o.jsx)(Zr,{...a,filter:{...a.filter,elements:v}}):(0,o.jsx)(Jr,{...a,fields:n})]})})}function fa({filters:e,view:t,onChangeView:n}){const r=!t.search&&!t.filters?.some(t=>{return!(t.isLocked||void 0===t.value&&(n=t.field,e.some(e=>e.field===n&&e.isPrimary)));var n});return(0,o.jsx)(i.Button,{disabled:r,accessibleWhenDisabled:!0,size:"compact",variant:"tertiary",className:"dataviews-filters__reset-button",onClick:()=>{n({...t,page:1,search:"",filters:t.filters?.filter(e=>!!e.isLocked)||[]})},children:(0,s.__)("Reset")})}var ma=function(e,t){return(0,r.useMemo)(()=>{const n=[];return e.forEach(e=>{if(!1===e.filterBy||!e.hasElements&&!e.Edit)return;const i=e.filterBy.operators,r=!!e.filterBy?.isPrimary,a=t.filters?.some(t=>t.field===e.id&&!!t.isLocked)??!1;n.push({field:e.id,name:e.label,elements:e.elements,getElements:e.getElements,hasElements:e.hasElements,singleSelection:i.some(e=>O.includes(e)),operators:i,isVisible:a||r||!!t.filters?.some(t=>t.field===e.id&&A.includes(t.operator)),isPrimary:r,isLocked:a})}),n.sort((e,t)=>e.isLocked&&!t.isLocked?-1:!e.isLocked&&t.isLocked?1:e.isPrimary&&!t.isPrimary?-1:!e.isPrimary&&t.isPrimary?1:e.name.localeCompare(t.name)),n},[e,t])},va=(0,r.memo)(function({className:e}){const{fields:t,view:n,onChangeView:a,openedFilter:s,setOpenedFilter:l}=(0,r.useContext)(W),u=(0,r.useRef)(null),c=ma(t,n),d=(0,o.jsx)(lt,{filters:c,view:n,onChangeView:a,ref:u,setOpenedFilter:l},"add-filter"),f=c.filter(e=>e.isVisible);if(0===f.length)return null;const m=[...f.map(e=>(0,o.jsx)(da,{filter:e,view:n,fields:t,onChangeView:a,addFilterRef:u,openedFilter:s},e.field)),d];return m.push((0,o.jsx)(fa,{filters:c,view:n,onChangeView:a},"reset-filters")),(0,o.jsx)(i.__experimentalHStack,{justify:"flex-start",style:{width:"fit-content"},wrap:!0,className:e,children:m})}),pa=function(e){const{isShowingFilter:t}=(0,r.useContext)(W);return t?(0,o.jsx)(va,{...e}):null};function ha({className:e}){const{actions:t=[],data:n,fields:i,getItemId:a,getItemLevel:l,isLoading:u,view:c,onChangeView:d,selection:f,onChangeSelection:m,setOpenedFilter:v,onClickItem:p,isItemClickable:h,renderItemLink:g,defaultLayouts:b,empty:x=(0,o.jsx)("p",{children:(0,s.__)("No results")})}=(0,r.useContext)(W),w=rt.find(e=>e.type===c.type&&b[e.type])?.component;return(0,o.jsx)(w,{className:e,actions:t,data:n,fields:i,getItemId:a,getItemLevel:l,isLoading:u,onChangeView:d,onChangeSelection:m,selection:f,setOpenedFilter:v,onClickItem:p,renderItemLink:g,isItemClickable:h,view:c,empty:x})}var ga=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"})}),ba=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.Path,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"})});function xa(){const{view:e,onChangeView:t,paginationInfo:{totalItems:n=0,totalPages:a}}=(0,r.useContext)(W);if(!n||!a||e.infiniteScrollEnabled)return null;const l=e.page??1,u=Array.from(Array(a)).map((e,t)=>{const n=t+1;return{value:n.toString(),label:n.toString(),"aria-label":l===n?(0,s.sprintf)(
-// translators: 1: current page number. 2: total number of pages.
-// translators: 1: current page number. 2: total number of pages.
-(0,s.__)("Page %1$d of %2$d"),l,a):n.toString()}});return!!n&&1!==a&&(0,o.jsxs)(i.__experimentalHStack,{expanded:!1,className:"dataviews-pagination",justify:"end",spacing:6,children:[(0,o.jsx)(i.__experimentalHStack,{justify:"flex-start",expanded:!1,spacing:1,className:"dataviews-pagination__page-select",children:(0,r.createInterpolateElement)((0,s.sprintf)(
-// translators: 1: Current page number, 2: Total number of pages.
-// translators: 1: Current page number, 2: Total number of pages.
-(0,s._x)("Page
%1$sof %2$d
","paging"),"",a),{div:(0,o.jsx)("div",{"aria-hidden":!0}),CurrentPage:(0,o.jsx)(i.SelectControl,{"aria-label":(0,s.__)("Current page"),value:l.toString(),options:u,onChange:n=>{t({...e,page:+n})},size:"small",__nextHasNoMarginBottom:!0,variant:"minimal"})})}),(0,o.jsxs)(i.__experimentalHStack,{expanded:!1,spacing:1,children:[(0,o.jsx)(i.Button,{onClick:()=>t({...e,page:l-1}),disabled:1===l,accessibleWhenDisabled:!0,label:(0,s.__)("Previous page"),icon:(0,s.isRTL)()?ga:ba,showTooltip:!0,size:"compact",tooltipPosition:"top"}),(0,o.jsx)(i.Button,{onClick:()=>t({...e,page:l+1}),disabled:l>=a,accessibleWhenDisabled:!0,label:(0,s.__)("Next page"),icon:(0,s.isRTL)()?ba:ga,showTooltip:!0,size:"compact",tooltipPosition:"top"})]})]})}var wa=(0,r.memo)(xa),ya=[];function _a(){const{view:e,paginationInfo:{totalItems:t=0,totalPages:n},data:a,actions:s=ya}=(0,r.useContext)(W),l=pe(s,a)&&[H,R].includes(e.type);return!t||!n||n<=1&&!l?null:!!t&&(0,o.jsxs)(i.__experimentalHStack,{expanded:!1,justify:"end",className:"dataviews-footer",children:[l&&(0,o.jsx)(_e,{}),(0,o.jsx)(wa,{})]})}var Ca=(0,r.memo)(function({label:e}){const{view:t,onChangeView:n}=(0,r.useContext)(W),[l,u,c]=(0,a.useDebouncedInput)(t.search);(0,r.useEffect)(()=>{u(t.search??"")},[t.search,u]);const d=(0,r.useRef)(n),f=(0,r.useRef)(t);(0,r.useEffect)(()=>{d.current=n,f.current=t},[n,t]),(0,r.useEffect)(()=>{c!==f.current?.search&&d.current({...f.current,page:1,search:c})},[c]);const m=e||(0,s.__)("Search");return(0,o.jsx)(i.SearchControl,{className:"dataviews-search",__nextHasNoMarginBottom:!0,onChange:u,value:l,label:m,placeholder:m,size:"compact"})}),ja=Ca,Sa=n(684),ka=n(979),Va=n.n(ka);function Ia(){const e=(0,r.useContext)(W),{view:t,onChangeView:n}=e,a=t.infiniteScrollEnabled??!1;return e.hasInfiniteScrollHandler?(0,o.jsx)(i.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,s.__)("Enable infinite scroll"),help:(0,s.__)("Automatically load more content as you scroll, instead of showing pagination links."),checked:a,onChange:e=>{n({...t,infiniteScrollEnabled:e})}}):null}var{Menu:Ea}=ne(i.privateApis),Na={className:"dataviews-config__popover",placement:"bottom-end",offset:9};function Fa(){const{view:e,onChangeView:t,defaultLayouts:n}=(0,r.useContext)(W),a=Object.keys(n);if(a.length<=1)return null;const l=rt.find(t=>e.type===t.type);return(0,o.jsxs)(Ea,{children:[(0,o.jsx)(Ea.TriggerButton,{render:(0,o.jsx)(i.Button,{size:"compact",icon:l?.icon,label:(0,s.__)("Layout")})}),(0,o.jsx)(Ea.Popover,{children:a.map(i=>{const r=rt.find(e=>e.type===i);return r?(0,o.jsx)(Ea.RadioItem,{value:i,name:"view-actions-available-view",checked:i===e.type,hideOnClick:!0,onChange:i=>{switch(i.target.value){case"list":case"grid":case"table":case"pickerGrid":case"pickerTable":const r={...e};return"layout"in r&&delete r.layout,t({...r,type:i.target.value,...n[i.target.value]})}Va()("Invalid dataview")},children:(0,o.jsx)(Ea.ItemLabel,{children:r.label})},i):null})})]})}function Ma(){const{view:e,fields:t,onChangeView:n}=(0,r.useContext)(W),a=(0,r.useMemo)(()=>t.filter(e=>!1!==e.enableSorting).map(e=>({label:e.label,value:e.id})),[t]);return(0,o.jsx)(i.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,s.__)("Sort by"),value:e.sort?.field,options:a,onChange:t=>{n({...e,sort:{direction:e?.sort?.direction||"desc",field:t},showLevels:!1})}})}function Aa(){const{view:e,fields:t,onChangeView:n}=(0,r.useContext)(W);if(0===t.filter(e=>!1!==e.enableSorting).length)return null;let a=e.sort?.direction;return!a&&e.sort?.field&&(a="desc"),(0,o.jsx)(i.__experimentalToggleGroupControl,{className:"dataviews-view-config__sort-direction",__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,isBlock:!0,label:(0,s.__)("Order"),value:a,onChange:i=>{"asc"!==i&&"desc"!==i?Va()("Invalid direction"):n({...e,sort:{direction:i,field:e.sort?.field||t.find(e=>!1!==e.enableSorting)?.id||""},showLevels:!1})},children:L.map(e=>(0,o.jsx)(i.__experimentalToggleGroupControlOptionIcon,{value:e,icon:z[e],label:B[e]},e))})}function Oa(){const{view:e,config:t,onChangeView:n}=(0,r.useContext)(W),{infiniteScrollEnabled:a}=e;return!t||!t.perPageSizes||t.perPageSizes.length<2||t.perPageSizes.length>6||a?null:(0,o.jsx)(i.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,isBlock:!0,label:(0,s.__)("Items per page"),value:e.perPage||10,disabled:!e?.sort?.field,onChange:t=>{const i="number"==typeof t||void 0===t?t:parseInt(t,10);n({...e,perPage:i,page:1})},children:t.perPageSizes.map(e=>(0,o.jsx)(i.__experimentalToggleGroupControlOption,{value:e,label:e.toString()},e))})}function Pa({title:e,description:t,children:n}){return(0,o.jsxs)(i.__experimentalGrid,{columns:12,className:"dataviews-settings-section",gap:4,children:[(0,o.jsxs)("div",{className:"dataviews-settings-section__sidebar",children:[(0,o.jsx)(i.__experimentalHeading,{level:2,className:"dataviews-settings-section__title",children:e}),t&&(0,o.jsx)(i.__experimentalText,{variant:"muted",className:"dataviews-settings-section__description",children:t})]}),(0,o.jsx)(i.__experimentalGrid,{columns:8,gap:4,className:"dataviews-settings-section__content",children:n})]})}function La(){const{view:e}=(0,r.useContext)(W),t=(0,a.useInstanceId)(Da,"dataviews-view-config-dropdown"),n=rt.find(t=>t.type===e.type);return(0,o.jsx)(i.Dropdown,{expandOnMobile:!0,popoverProps:{...Na,id:t},renderToggle:({onToggle:e,isOpen:n})=>(0,o.jsx)(i.Button,{size:"compact",icon:Sa.A,label:(0,s._x)("View options","View is used as a noun"),onClick:e,"aria-expanded":n?"true":"false","aria-controls":t}),renderContent:()=>(0,o.jsx)(i.__experimentalDropdownContentWrapper,{paddingSize:"medium",className:"dataviews-config__popover-content-wrapper",children:(0,o.jsx)(i.__experimentalVStack,{className:"dataviews-view-config",spacing:6,children:(0,o.jsxs)(Pa,{title:(0,s.__)("Appearance"),children:[(0,o.jsxs)(i.__experimentalHStack,{expanded:!0,className:"is-divided-in-two",children:[(0,o.jsx)(Ma,{}),(0,o.jsx)(Aa,{})]}),!!n?.viewConfigOptions&&(0,o.jsx)(n.viewConfigOptions,{}),(0,o.jsx)(Ia,{}),(0,o.jsx)(Oa,{}),(0,o.jsx)(De,{})]})})})})}function Da(){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Fa,{}),(0,o.jsx)(La,{})]})}var Ta=(0,r.memo)(Da);function Ba({item:e,field:t}){const{elements:n,isLoading:i}=Rr({elements:t.elements,getElements:t.getElements}),r=t.getValue({item:e});return i||0===n.length?r:n?.find(e=>e.value===r)?.label||t.getValue({item:e})}var za=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ha={sort:function(e,t,n){return"asc"===n?e.localeCompare(t):t.localeCompare(e)},isValid:{elements:!0,custom:(e,t)=>{const n=t.getValue({item:e});return[void 0,"",null].includes(n)||za.test(n)?null:(0,s.__)("Value must be a valid email address.")}},Edit:"email",render:({item:e,field:t})=>t.hasElements?(0,o.jsx)(Ba,{item:e,field:t}):t.getValue({item:e}),enableSorting:!0,filterBy:{defaultOperators:[m,v],validOperators:[d,f,S,k,V,m,v,p,h]}},Ra={sort:function(e,t,n){return"asc"===n?e-t:t-e},isValid:{elements:!0,custom:(e,t)=>{const n=t.getValue({item:e});return[void 0,"",null].includes(n)||Number.isInteger(n)?null:(0,s.__)("Value must be an integer.")}},Edit:"integer",render:({item:e,field:t})=>t.hasElements?(0,o.jsx)(Ba,{item:e,field:t}):t.getValue({item:e}),enableSorting:!0,filterBy:{defaultOperators:[d,f,g,b,x,w,I],validOperators:[d,f,g,b,x,w,I,m,v,p,h]}},$a={sort:function(e,t,n){return"asc"===n?e-t:t-e},isValid:{elements:!0,custom:(e,t)=>{const n=t.getValue({item:e});return function(e){return""===e||null==e}(n)||Number.isFinite(n)?null:(0,s.__)("Value must be a number.")}},Edit:"number",render:({item:e,field:t})=>{t.hasElements;const n=t.getValue({item:e});return[null,void 0].includes(n)?null:Number(n).toFixed(2)},enableSorting:!0,filterBy:{defaultOperators:[d,f,g,b,x,w,I],validOperators:[d,f,g,b,x,w,I,m,v,p,h]}},Wa={sort:function(e,t,n){return"asc"===n?e.localeCompare(t):t.localeCompare(e)},isValid:{elements:!0,custom:()=>null},Edit:"text",render:({item:e,field:t})=>t.hasElements?(0,o.jsx)(Ba,{item:e,field:t}):t.getValue({item:e}),enableSorting:!0,filterBy:{defaultOperators:[m,v],validOperators:[d,f,S,k,V,m,v,p,h]}},qa={sort:function(e,t,n){const i=new Date(e).getTime(),r=new Date(t).getTime();return"asc"===n?i-r:r-i},isValid:{elements:!0,custom:()=>null},Edit:"datetime",render:({item:e,field:t})=>{if(t.elements)return(0,o.jsx)(Ba,{item:e,field:t});const n=t.getValue({item:e});if(["",void 0,null].includes(n))return null;try{const e=sa(n);return e?.toLocaleString()}catch(e){return null}},enableSorting:!0,filterBy:{defaultOperators:[E,N,y,_,C,j,F,M],validOperators:[E,N,y,_,C,j,F,M]}},Ka={sort:function(e,t,n){const i=new Date(e).getTime(),r=new Date(t).getTime();return"asc"===n?i-r:r-i},Edit:"date",isValid:{elements:!0,custom:()=>null},render:({item:e,field:t})=>{if(t.hasElements)return(0,o.jsx)(Ba,{item:e,field:t});const n=t.getValue({item:e});return n?(i=n,(0,aa.dateI18n)((0,aa.getSettings)().formats.date,(0,aa.getDate)(i))):"";var i},enableSorting:!0,filterBy:{defaultOperators:[E,N,y,_,C,j,F,M,I],validOperators:[E,N,y,_,C,j,F,M,I]}},Ga={sort:function(e,t,n){const i=Boolean(e);return i===Boolean(t)?0:"asc"===n?i?1:-1:i?-1:1},isValid:{elements:!0,custom:(e,t)=>{const n=t.getValue({item:e});return[void 0,"",null].includes(n)||[!0,!1].includes(n)?null:(0,s.__)("Value must be true, false, or undefined")}},Edit:"checkbox",render:({item:e,field:t})=>t.hasElements?(0,o.jsx)(Ba,{item:e,field:t}):!0===t.getValue({item:e})?(0,s.__)("True"):!1===t.getValue({item:e})?(0,s.__)("False"):null,enableSorting:!0,filterBy:{defaultOperators:[d,f],validOperators:[d,f]}},Ya={sort:function(){return 0},isValid:{elements:!0,custom:()=>null},Edit:null,render:()=>null,enableSorting:!1,filterBy:!1},Ua={sort:function(e,t,n){const i=Array.isArray(e)?e:[],r=Array.isArray(t)?t:[];if(i.length!==r.length)return"asc"===n?i.length-r.length:r.length-i.length;const a=i.join(","),s=r.join(",");return"asc"===n?a.localeCompare(s):s.localeCompare(a)},isValid:{elements:!0,custom:(e,t)=>{const n=t.getValue({item:e});return[void 0,"",null].includes(n)||Array.isArray(n)?n.every(e=>"string"==typeof e)?null:(0,s.__)("Every value must be a string."):(0,s.__)("Value must be an array.")}},Edit:"array",render:function({item:e,field:t}){return(t.getValue({item:e})||[]).join(", ")},enableSorting:!0,filterBy:{defaultOperators:[m,v],validOperators:[m,v,p,h]}},Za=Ua,Xa={sort:function(e,t,n){return 0},isValid:{elements:!0,custom:()=>null},Edit:"password",render:({item:e,field:t})=>t.hasElements?(0,o.jsx)(Ba,{item:e,field:t}):"••••••••",enableSorting:!1,filterBy:!1},Qa={sort:function(e,t,n){return"asc"===n?e.localeCompare(t):t.localeCompare(e)},isValid:{elements:!0,custom:()=>null},Edit:"telephone",render:({item:e,field:t})=>t.hasElements?(0,o.jsx)(Ba,{item:e,field:t}):t.getValue({item:e}),enableSorting:!0,filterBy:{defaultOperators:[m,v],validOperators:[d,f,S,k,V,m,v,p,h]}},Ja={grad:.9,turn:360,rad:360/(2*Math.PI)},es=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},ts=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},ns=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},is=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},rs=function(e){return{r:ns(e.r,0,255),g:ns(e.g,0,255),b:ns(e.b,0,255),a:ns(e.a)}},as=function(e){return{r:ts(e.r),g:ts(e.g),b:ts(e.b),a:ts(e.a,3)}},ss=/^#([0-9a-f]{3,8})$/i,ls=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},os=function(e){var t=e.r,n=e.g,i=e.b,r=e.a,a=Math.max(t,n,i),s=a-Math.min(t,n,i),l=s?a===t?(n-i)/s:a===n?2+(i-t)/s:4+(t-n)/s:0;return{h:60*(l<0?l+6:l),s:a?s/a*100:0,v:a/255*100,a:r}},us=function(e){var t=e.h,n=e.s,i=e.v,r=e.a;t=t/360*6,n/=100,i/=100;var a=Math.floor(t),s=i*(1-n),l=i*(1-(t-a)*n),o=i*(1-(1-t+a)*n),u=a%6;return{r:255*[i,l,s,s,o,i][u],g:255*[o,i,i,l,s,s][u],b:255*[s,s,o,i,i,l][u],a:r}},cs=function(e){return{h:is(e.h),s:ns(e.s,0,100),l:ns(e.l,0,100),a:ns(e.a)}},ds=function(e){return{h:ts(e.h),s:ts(e.s),l:ts(e.l),a:ts(e.a,3)}},fs=function(e){return us((n=(t=e).s,{h:t.h,s:(n*=((i=t.l)<50?i:100-i)/100)>0?2*n/(i+n)*100:0,v:i+n,a:t.a}));var t,n,i},ms=function(e){return{h:(t=os(e)).h,s:(r=(200-(n=t.s))*(i=t.v)/100)>0&&r<200?n*i/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,i,r},vs=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ps=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,hs=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gs=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,bs={string:[[function(e){var t=ss.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?ts(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?ts(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=hs.exec(e)||gs.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:rs({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(e){var t=vs.exec(e)||ps.exec(e);if(!t)return null;var n,i,r=cs({h:(n=t[1],i=t[2],void 0===i&&(i="deg"),Number(n)*(Ja[i]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return fs(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,i=e.b,r=e.a,a=void 0===r?1:r;return es(t)&&es(n)&&es(i)?rs({r:Number(t),g:Number(n),b:Number(i),a:Number(a)}):null},"rgb"],[function(e){var t=e.h,n=e.s,i=e.l,r=e.a,a=void 0===r?1:r;if(!es(t)||!es(n)||!es(i))return null;var s=cs({h:Number(t),s:Number(n),l:Number(i),a:Number(a)});return fs(s)},"hsl"],[function(e){var t=e.h,n=e.s,i=e.v,r=e.a,a=void 0===r?1:r;if(!es(t)||!es(n)||!es(i))return null;var s=function(e){return{h:is(e.h),s:ns(e.s,0,100),v:ns(e.v,0,100),a:ns(e.a)}}({h:Number(t),s:Number(n),v:Number(i),a:Number(a)});return us(s)},"hsv"]]},xs=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=(e=as(this.rgba)).r,n=e.g,i=e.b,a=(r=e.a)<1?ls(ts(255*r)):"","#"+ls(t)+ls(n)+ls(i)+a;var e,t,n,i,r,a},e.prototype.toRgb=function(){return as(this.rgba)},e.prototype.toRgbString=function(){return t=(e=as(this.rgba)).r,n=e.g,i=e.b,(r=e.a)<1?"rgba("+t+", "+n+", "+i+", "+r+")":"rgb("+t+", "+n+", "+i+")";var e,t,n,i,r},e.prototype.toHsl=function(){return ds(ms(this.rgba))},e.prototype.toHslString=function(){return t=(e=ds(ms(this.rgba))).h,n=e.s,i=e.l,(r=e.a)<1?"hsla("+t+", "+n+"%, "+i+"%, "+r+")":"hsl("+t+", "+n+"%, "+i+"%)";var e,t,n,i,r},e.prototype.toHsv=function(){return e=os(this.rgba),{h:ts(e.h),s:ts(e.s),v:ts(e.v),a:ts(e.a,3)};var e},e.prototype.invert=function(){return js({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),js(ws(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),js(ws(this.rgba,-e))},e.prototype.grayscale=function(){return js(ws(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),js(_s(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),js(_s(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?js({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):ts(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=ms(this.rgba);return"number"==typeof e?js({h:e,s:t.s,l:t.l,a:t.a}):ts(t.h)},e.prototype.isEqual=function(e){return this.toHex()===js(e).toHex()},e}(),js=function(e){return e instanceof Cs?e:new Cs(e)},Ss={sort:function(e,t,n){const i=js(e),r=js(t);if(!i.isValid()&&!r.isValid())return 0;if(!i.isValid())return"asc"===n?1:-1;if(!r.isValid())return"asc"===n?-1:1;const a=i.toHsl(),s=r.toHsl();return a.h!==s.h?"asc"===n?a.h-s.h:s.h-a.h:a.s!==s.s?"asc"===n?a.s-s.s:s.s-a.s:"asc"===n?a.l-s.l:s.l-a.l},isValid:{elements:!0,custom:(e,t)=>{const n=t.getValue({item:e});return[void 0,"",null].includes(n)||js(n).isValid()?null:(0,s.__)("Value must be a valid color.")}},Edit:"color",render:({item:e,field:t})=>{if(t.hasElements)return(0,o.jsx)(Ba,{item:e,field:t});const n=t.getValue({item:e});return n&&js(n).isValid()?(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,o.jsx)("div",{style:{width:"16px",height:"16px",borderRadius:"50%",backgroundColor:n,border:"1px solid #ddd",flexShrink:0}}),(0,o.jsx)("span",{children:n})]}):n},enableSorting:!0,filterBy:{defaultOperators:[m,v],validOperators:[d,f]}},ks={sort:function(e,t,n){return"asc"===n?e.localeCompare(t):t.localeCompare(e)},isValid:{elements:!0,custom:()=>null},Edit:"url",render:({item:e,field:t})=>t.hasElements?(0,o.jsx)(Ba,{item:e,field:t}):t.getValue({item:e}),enableSorting:!0,filterBy:{defaultOperators:[m,v],validOperators:[d,f,S,k,V,m,v,p,h]}};function Vs(e,t){let n;return e?.required&&t?.required?n=t?.required?.message?t.required:void 0:e?.elements&&t?.elements?n=t.elements:t?.custom&&(n=t.custom),n}var{ValidatedCheckboxControl:Is}=ne(i.privateApis);const Es={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function Ns(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Fs={date:Ns({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Ns({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Ns({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Ms={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function As(e){return(t,n)=>{let i;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{const t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}return i[e.argumentCallback?e.argumentCallback(t):t]}}function Os(e){return(t,n={})=>{const i=n.width,r=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],a=t.match(r);if(!a)return null;const s=a[0],l=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],o=Array.isArray(l)?function(e,t){for(let n=0;ne.test(s)):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}(l,e=>e.test(s));let u;return u=e.valueCallback?e.valueCallback(o):o,u=n.valueCallback?n.valueCallback(u):u,{value:u,rest:t.slice(s.length)}}}var Ps;const Ls={code:"en-US",formatDistance:(e,t,n)=>{let i;const r=Es[e];return i="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i},formatLong:Fs,formatRelative:(e,t,n,i)=>Ms[e],localize:{ordinalNumber:(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:As({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:As({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:As({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:As({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:As({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(Ps={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(Ps.matchPattern);if(!n)return null;const i=n[0],r=e.match(Ps.parsePattern);if(!r)return null;let a=Ps.valueCallback?Ps.valueCallback(r[0]):r[0];return a=t.valueCallback?t.valueCallback(a):a,{value:a,rest:e.slice(i.length)}}),era:Os({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Os({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:Os({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Os({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Os({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};let Ds={};function Ts(){return Ds}function Bs(e){const t=ia(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function zs(e,t){const n=ia(e,t?.in);return n.setHours(0,0,0,0),n}function Hs(e,t){const n=ia(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Rs(e,t){const n=ia(e,t?.in);return function(e,t,n){const[i,r]=function(e,...t){const n=na.bind(null,e||t.find(e=>"object"==typeof e));return t.map(n)}(n?.in,e,t),a=zs(i),s=zs(r),l=+a-Bs(a),o=+s-Bs(s);return Math.round((l-o)/864e5)}(n,Hs(n))+1}function $s(e,t){const n=Ts(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=ia(e,t?.in),a=r.getDay(),s=(a=a.getTime()?i+1:n.getTime()>=l.getTime()?i:i-1}function Ks(e,t){const n=ia(e,t?.in),i=+Ws(n)-+function(e,t){const n=qs(e,t),i=na(t?.in||e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Ws(i)}(n);return Math.round(i/ea)+1}function Gs(e,t){const n=ia(e,t?.in),i=n.getFullYear(),r=Ts(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=na(t?.in||e,0);s.setFullYear(i+1,0,a),s.setHours(0,0,0,0);const l=$s(s,t),o=na(t?.in||e,0);o.setFullYear(i,0,a),o.setHours(0,0,0,0);const u=$s(o,t);return+n>=+l?i+1:+n>=+u?i:i-1}function Ys(e,t){const n=ia(e,t?.in),i=+$s(n,t)-+function(e,t){const n=Ts(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=Gs(e,t),a=na(t?.in||e,0);return a.setFullYear(r,0,i),a.setHours(0,0,0,0),$s(a,t)}(n,t);return Math.round(i/ea)+1}function Us(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const Zs={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return Us("yy"===t?i%100:i,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):Us(n+1,2)},d:(e,t)=>Us(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>Us(e.getHours()%12||12,t.length),H:(e,t)=>Us(e.getHours(),t.length),m:(e,t)=>Us(e.getMinutes(),t.length),s:(e,t)=>Us(e.getSeconds(),t.length),S(e,t){const n=t.length,i=e.getMilliseconds();return Us(Math.trunc(i*Math.pow(10,n-3)),t.length)}},Xs={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),i=t>0?t:1-t;return n.ordinalNumber(i,{unit:"year"})}return Zs.y(e,t)},Y:function(e,t,n,i){const r=Gs(e,i),a=r>0?r:1-r;return"YY"===t?Us(a%100,2):"Yo"===t?n.ordinalNumber(a,{unit:"year"}):Us(a,t.length)},R:function(e,t){return Us(qs(e),t.length)},u:function(e,t){return Us(e.getFullYear(),t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Us(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Us(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return Zs.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return Us(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const r=Ys(e,i);return"wo"===t?n.ordinalNumber(r,{unit:"week"}):Us(r,t.length)},I:function(e,t,n){const i=Ks(e);return"Io"===t?n.ordinalNumber(i,{unit:"week"}):Us(i,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):Zs.d(e,t)},D:function(e,t,n){const i=Rs(e);return"Do"===t?n.ordinalNumber(i,{unit:"dayOfYear"}):Us(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const r=e.getDay(),a=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return Us(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const r=e.getDay(),a=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return Us(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),r=0===i?7:i;switch(t){case"i":return String(r);case"ii":return Us(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let r;switch(r=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let r;switch(r=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return Zs.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):Zs.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return"Ko"===t?n.ordinalNumber(i,{unit:"hour"}):Us(i,t.length)},k:function(e,t,n){let i=e.getHours();return 0===i&&(i=24),"ko"===t?n.ordinalNumber(i,{unit:"hour"}):Us(i,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Zs.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Zs.s(e,t)},S:function(e,t){return Zs.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return Js(i);case"XXXX":case"XX":return el(i);default:return el(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return Js(i);case"xxxx":case"xx":return el(i);default:return el(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Qs(i,":");default:return"GMT"+el(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Qs(i,":");default:return"GMT"+el(i,":")}},t:function(e,t,n){return Us(Math.trunc(+e/1e3),t.length)},T:function(e,t,n){return Us(+e,t.length)}};function Qs(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.trunc(i/60),a=i%60;return 0===a?n+String(r):n+String(r)+t+Us(a,2)}function Js(e,t){return e%60==0?(e>0?"-":"+")+Us(Math.abs(e)/60,2):el(e,t)}function el(e,t=""){const n=e>0?"-":"+",i=Math.abs(e);return n+Us(Math.trunc(i/60),2)+t+Us(i%60,2)}const tl=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},nl=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},il={p:nl,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return tl(e,t);let a;switch(i){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;default:a=t.dateTime({width:"full"})}return a.replace("{{date}}",tl(i,t)).replace("{{time}}",nl(r,t))}},rl=/^D+$/,al=/^Y+$/,sl=["D","DD","YY","YYYY"],ll=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ol=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ul=/^'([^]*?)'?$/,cl=/''/g,dl=/[a-zA-Z]/;function fl(e,t,n){const i=Ts(),r=n?.locale??i.locale??Ls,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=ia(e,n?.in);if(!ra(l))throw new RangeError("Invalid time value");let o=t.match(ol).map(e=>{const t=e[0];return"p"===t||"P"===t?(0,il[t])(e,r.formatLong):e}).join("").match(ll).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:ml(e)};if(Xs[t])return{isToken:!0,value:e};if(t.match(dl))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});r.localize.preprocessor&&(o=r.localize.preprocessor(l,o));const u={firstWeekContainsDate:a,weekStartsOn:s,locale:r};return o.map(i=>{if(!i.isToken)return i.value;const a=i.value;return(!n?.useAdditionalWeekYearTokens&&function(e){return al.test(e)}(a)||!n?.useAdditionalDayOfYearTokens&&function(e){return rl.test(e)}(a))&&function(e,t,n){const i=function(e,t,n){const i="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(i),sl.includes(e))throw new RangeError(i)}(a,t,String(e)),(0,Xs[a[0]])(l,a,r.localize,u)}).join("")}function ml(e){const t=e.match(ul);return t?t[1].replace(cl,"'"):e}var vl={[F]:[{value:"days",label:(0,s.__)("Days")},{value:"weeks",label:(0,s.__)("Weeks")},{value:"months",label:(0,s.__)("Months")},{value:"years",label:(0,s.__)("Years")}],[M]:[{value:"days",label:(0,s.__)("Days ago")},{value:"weeks",label:(0,s.__)("Weeks ago")},{value:"months",label:(0,s.__)("Months ago")},{value:"years",label:(0,s.__)("Years ago")}]};function pl({className:e,data:t,field:n,onChange:a,hideLabelFromVision:l,operator:u}){const c=vl[u===F?"inThePast":"over"],{id:d,label:f,getValue:m,setValue:v}=n,p=m({item:t}),{value:h="",unit:g=c[0].value}=p&&"object"==typeof p?p:{},b=(0,r.useCallback)(e=>a(v({item:t,value:{value:Number(e),unit:g}})),[a,v,t,g]),x=(0,r.useCallback)(e=>a(v({item:t,value:{value:h,unit:e}})),[a,v,t,h]);return(0,o.jsx)(i.BaseControl,{id:d,__nextHasNoMarginBottom:!0,className:(0,U.A)(e,"dataviews-controls__relative-date"),label:f,hideLabelFromVision:l,children:(0,o.jsxs)(i.__experimentalHStack,{spacing:2.5,children:[(0,o.jsx)(i.__experimentalNumberControl,{__next40pxDefaultSize:!0,className:"dataviews-controls__relative-date-number",spinControls:"none",min:1,step:1,value:h,onChange:b}),(0,o.jsx)(i.SelectControl,{className:"dataviews-controls__relative-date-unit",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,s.__)("Unit"),value:g,options:c,onChange:x,hideLabelFromVision:!0})]})})}var{DateCalendar:hl,ValidatedInputControl:gl}=ne(i.privateApis);function bl({data:e,field:t,onChange:n,hideLabelFromVision:a,validity:l}){const{id:u,label:c,description:d,setValue:f,getValue:m,isValid:v}=t,p=m({item:e}),h="string"==typeof p?p:void 0,[g,b]=(0,r.useState)(()=>sa(h)||new Date),x=(0,r.useRef)(null),w=(0,r.useRef)(),y=(0,r.useRef)(null),_=(0,r.useCallback)(t=>n(f({item:e,value:t})),[e,n,f]);(0,r.useEffect)(()=>()=>{w.current&&clearTimeout(w.current)},[]);const C=(0,r.useCallback)(e=>{let t;if(e){let n=e;if(h){const t=sa(h);t&&(n=new Date(e),n.setHours(t.getHours()),n.setMinutes(t.getMinutes()))}t=n.toISOString(),_(t),w.current&&clearTimeout(w.current)}else _(void 0);y.current=x.current&&x.current.ownerDocument.activeElement,w.current=setTimeout(()=>{x.current&&(x.current.focus(),x.current.blur(),_(t),y.current&&y.current instanceof HTMLElement&&y.current.focus())},0)},[_,h]),j=(0,r.useCallback)(e=>{if(e){const t=new Date(e);_(t.toISOString());const n=sa(t.toISOString());n&&b(n)}else _(void 0)},[_]),{timezone:{string:S},l10n:{startOfWeek:k}}=(0,aa.getSettings)(),V=v?.required&&!a?`${c} (${(0,s.__)("Required")})`:c;return(0,o.jsx)(i.BaseControl,{__nextHasNoMarginBottom:!0,id:u,label:V,help:d,hideLabelFromVision:a,children:(0,o.jsxs)(i.__experimentalVStack,{spacing:4,children:[(0,o.jsx)(hl,{style:{width:"100%"},selected:h&&sa(h)||void 0,onSelect:C,month:g,onMonthChange:b,timeZone:S||void 0,weekStartsOn:k}),(0,o.jsx)(gl,{ref:x,__next40pxDefaultSize:!0,required:!!v?.required,customValidity:Vs(v,l),type:"datetime-local",label:(0,s.__)("Date time"),hideLabelFromVision:!0,value:h?(I=sa(h)||void 0,I?"string"==typeof I?I:fl(I,"yyyy-MM-dd'T'HH:mm"):""):"",onChange:j})]})});var I}function xl(e,t,n){return function(e,t,n){const i=ia(e,n?.in);return isNaN(t)?na(n?.in||e,NaN):t?(i.setDate(i.getDate()+t),i):i}(e,-t,n)}function wl(e,t,n){const i=ia(e,n?.in);if(isNaN(t))return na(n?.in||e,NaN);if(!t)return i;const r=i.getDate(),a=na(n?.in||e,i.getTime());return a.setMonth(i.getMonth()+t+1,0),r>=a.getDate()?a:(i.setFullYear(a.getFullYear(),a.getMonth(),r),i)}function yl(e,t){const n=ia(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function _l(e,t,n){return function(e,t,n){return wl(e,12*t,n)}(e,-t,n)}var Cl=(0,o.jsx)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(l.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z"})}),{DateCalendar:jl,DateRangeCalendar:Sl}=ne(i.privateApis),kl=[{id:"today",label:(0,s.__)("Today"),getValue:()=>(0,aa.getDate)(null)},{id:"yesterday",label:(0,s.__)("Yesterday"),getValue:()=>xl((0,aa.getDate)(null),1)},{id:"past-week",label:(0,s.__)("Past week"),getValue:()=>xl((0,aa.getDate)(null),7)},{id:"past-month",label:(0,s.__)("Past month"),getValue:()=>{return wl((0,aa.getDate)(null),-1,e);var e}}],Vl=[{id:"last-7-days",label:(0,s.__)("Last 7 days"),getValue:()=>{const e=(0,aa.getDate)(null);return[xl(e,7),e]}},{id:"last-30-days",label:(0,s.__)("Last 30 days"),getValue:()=>{const e=(0,aa.getDate)(null);return[xl(e,30),e]}},{id:"month-to-date",label:(0,s.__)("Month to date"),getValue:()=>{const e=(0,aa.getDate)(null);return[yl(e),e]}},{id:"last-year",label:(0,s.__)("Last year"),getValue:()=>{const e=(0,aa.getDate)(null);return[_l(e,1),e]}},{id:"year-to-date",label:(0,s.__)("Year to date"),getValue:()=>{const e=(0,aa.getDate)(null);return[Hs(e),e]}}],Il=e=>{if(!e)return null;const t=(0,aa.getDate)(e);return t&&ra(t)?t:null},El=e=>e?"string"==typeof e?e:fl(e,"yyyy-MM-dd"):"";function Nl({field:e,validity:t,inputRefs:n,isTouched:a,setIsTouched:s,children:l}){const{isValid:u}=e,[c,d]=(0,r.useState)(void 0),f=(0,r.useCallback)(()=>{const e=Array.isArray(n)?n:[n];for(const t of e){const e=t.current;if(e&&!e.validity.valid)return void d({type:"invalid",message:e.validationMessage})}d(void 0)},[n]);return(0,r.useEffect)(()=>{if(a){const e=setTimeout(()=>{t?d(Vs(u,t)):f()},0);return()=>clearTimeout(e)}},[a,u,t,f]),(0,o.jsxs)("div",{onBlur:e=>{a||e.relatedTarget&&e.currentTarget.contains(e.relatedTarget)||s(!0)},children:[l,(0,o.jsx)("div",{"aria-live":"polite",children:c&&(0,o.jsxs)("p",{className:(0,U.A)("components-validated-control__indicator","invalid"===c.type?"is-invalid":void 0,"valid"===c.type?"is-valid":void 0),children:[(0,o.jsx)(i.Icon,{className:"components-validated-control__indicator-icon",icon:Cl,size:16,fill:"currentColor"}),c.message]})})]})}function Fl({data:e,field:t,onChange:n,hideLabelFromVision:a,validity:l}){const{id:u,label:c,setValue:d,getValue:f,isValid:m}=t,[v,p]=(0,r.useState)(null),h=f({item:e}),g="string"==typeof h?h:void 0,[b,x]=(0,r.useState)(()=>Il(g)||new Date),[w,y]=(0,r.useState)(!1),_=(0,r.useRef)(null),C=(0,r.useCallback)(t=>n(d({item:e,value:t})),[e,n,d]),j=(0,r.useCallback)(e=>{const t=e?fl(e,"yyyy-MM-dd"):void 0;C(t),p(null),y(!0)},[C]),S=(0,r.useCallback)(e=>{const t=e.getValue(),n=El(t);x(t),C(n),p(e.id),y(!0)},[C]),k=(0,r.useCallback)(e=>{if(C(e),e){const t=Il(e);t&&x(t)}p(null),y(!0)},[C]),{timezone:{string:V},l10n:{startOfWeek:I}}=(0,aa.getSettings)(),E=m?.required?`${c} (${(0,s.__)("Required")})`:c;return(0,o.jsx)(Nl,{field:t,validity:l,inputRefs:_,isTouched:w,setIsTouched:y,children:(0,o.jsx)(i.BaseControl,{__nextHasNoMarginBottom:!0,id:u,className:"dataviews-controls__date",label:E,hideLabelFromVision:a,children:(0,o.jsxs)(i.__experimentalVStack,{spacing:4,children:[(0,o.jsxs)(i.__experimentalHStack,{spacing:2,wrap:!0,justify:"flex-start",children:[kl.map(e=>{const t=v===e.id;return(0,o.jsx)(i.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:t,size:"small",onClick:()=>S(e),children:e.label},e.id)}),(0,o.jsx)(i.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:!v,size:"small",disabled:!!v,accessibleWhenDisabled:!1,children:(0,s.__)("Custom")})]}),(0,o.jsx)(i.__experimentalInputControl,{__next40pxDefaultSize:!0,ref:_,type:"date",label:(0,s.__)("Date"),hideLabelFromVision:!0,value:g,onChange:k,required:!!t.isValid?.required}),(0,o.jsx)(jl,{style:{width:"100%"},selected:g&&Il(g)||void 0,onSelect:j,month:b,onMonthChange:x,timeZone:V||void 0,weekStartsOn:I})]})})})}function Ml({data:e,field:t,onChange:n,hideLabelFromVision:a,validity:l}){const{id:u,label:c,getValue:d,setValue:f}=t;let m;const v=d({item:e});Array.isArray(v)&&2===v.length&&v.every(e=>"string"==typeof e)&&(m=v);const p=(0,r.useCallback)(t=>{n(f({item:e,value:t}))},[e,n,f]),[h,g]=(0,r.useState)(null),b=(0,r.useMemo)(()=>{if(!m)return{from:void 0,to:void 0};const[e,t]=m;return{from:Il(e)||void 0,to:Il(t)||void 0}},[m]),[x,w]=(0,r.useState)(()=>b.from||new Date),[y,_]=(0,r.useState)(!1),C=(0,r.useRef)(null),j=(0,r.useRef)(null),S=(0,r.useCallback)((e,t)=>{e&&t?p([El(e),El(t)]):e||t||p(void 0)},[p]),k=(0,r.useCallback)(e=>{S(e?.from,e?.to),g(null),_(!0)},[S]),V=(0,r.useCallback)(e=>{const[t,n]=e.getValue();w(t),S(t,n),g(e.id),_(!0)},[S]),I=(0,r.useCallback)((e,t)=>{const[n,i]=m||[void 0,void 0];if(S("from"===e?t:n,"to"===e?t:i),t){const e=Il(t);e&&w(e)}g(null),_(!0)},[m,S]),{timezone:E,l10n:N}=(0,aa.getSettings)(),F=t.isValid?.required?`${c} (${(0,s.__)("Required")})`:c;return(0,o.jsx)(Nl,{field:t,validity:l,inputRefs:[C,j],isTouched:y,setIsTouched:_,children:(0,o.jsx)(i.BaseControl,{__nextHasNoMarginBottom:!0,id:u,className:"dataviews-controls__date",label:F,hideLabelFromVision:a,children:(0,o.jsxs)(i.__experimentalVStack,{spacing:4,children:[(0,o.jsxs)(i.__experimentalHStack,{spacing:2,wrap:!0,justify:"flex-start",children:[Vl.map(e=>{const t=h===e.id;return(0,o.jsx)(i.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:t,size:"small",onClick:()=>V(e),children:e.label},e.id)}),(0,o.jsx)(i.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:!h,size:"small",accessibleWhenDisabled:!1,disabled:!!h,children:(0,s.__)("Custom")})]}),(0,o.jsxs)(i.__experimentalHStack,{spacing:2,children:[(0,o.jsx)(i.__experimentalInputControl,{__next40pxDefaultSize:!0,ref:C,type:"date",label:(0,s.__)("From"),hideLabelFromVision:!0,value:m?.[0],onChange:e=>I("from",e),required:!!t.isValid?.required}),(0,o.jsx)(i.__experimentalInputControl,{__next40pxDefaultSize:!0,ref:j,type:"date",label:(0,s.__)("To"),hideLabelFromVision:!0,value:m?.[1],onChange:e=>I("to",e),required:!!t.isValid?.required})]}),(0,o.jsx)(Sl,{style:{width:"100%"},selected:b,onSelect:k,month:x,onMonthChange:w,timeZone:E.string||void 0,weekStartsOn:N.startOfWeek})]})})})}var Al=(0,o.jsx)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(l.Path,{d:"M12.5939 21C14.1472 21 16.1269 20.5701 17.0711 20.1975L16.6447 18.879C16.0964 19.051 14.3299 19.6242 12.6548 19.6242C7.4467 19.6242 4.67513 16.8726 4.67513 12C4.67513 7.21338 7.50762 4.34713 12.2893 4.34713C17.132 4.34713 19.4162 7.55732 19.4162 10.7675C19.4162 14.035 19.0508 15.4968 17.4975 15.4968C16.5838 15.4968 16.0964 14.7803 16.0964 13.9777V7.5H14.4822V8.30255H14.3909C14.1777 7.67198 12.9898 7.12739 11.467 7.2707C9.18274 7.5 7.4467 9.27707 7.4467 11.8567C7.4467 14.5796 8.81726 16.672 11.467 16.758C13.203 16.8153 14.1168 16.0127 14.4822 15.1815H14.5736C14.7563 16.414 16.401 16.8439 17.467 16.8439C20.6954 16.8439 21 13.5764 21 10.7962C21 6.86943 18.0761 3 12.3807 3C6.50254 3 3 6.3535 3 11.9427C3 17.7325 6.38071 21 12.5939 21ZM11.7107 15.2962C9.73096 15.2962 9.03046 13.6051 9.03046 11.7707C9.03046 10.1083 10.0355 8.67516 11.7716 8.67516C13.599 8.67516 14.5736 9.36306 14.5736 11.7707C14.5736 14.1497 13.7513 15.2962 11.7107 15.2962Z"})}),{ValidatedInputControl:Ol}=ne(i.privateApis);function Pl({data:e,field:t,onChange:n,hideLabelFromVision:i,type:a,prefix:s,suffix:l,validity:u}){const{label:c,placeholder:d,description:f,getValue:m,setValue:v,isValid:p}=t,h=m({item:e}),g=(0,r.useCallback)(t=>n(v({item:e,value:t})),[e,v,n]);return(0,o.jsx)(Ol,{required:!!p?.required,customValidity:Vs(p,u),label:c,placeholder:d,value:h??"",help:f,onChange:g,hideLabelFromVision:i,type:a,prefix:s,suffix:l,__next40pxDefaultSize:!0})}var Ll=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.Path,{d:"M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z"})}),Dl=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.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"})}),{ValidatedNumberControl:Tl}=ne(i.privateApis);function Bl(e){if(""===e||void 0===e)return"";const t=Number(e);return Number.isFinite(t)?t:""}function zl({value:e,onChange:t,hideLabelFromVision:n,step:a}){const[l="",u=""]=e,c=(0,r.useCallback)(e=>t([Bl(e),u]),[t,u]),d=(0,r.useCallback)(e=>t([l,Bl(e)]),[t,l]);return(0,o.jsx)(i.BaseControl,{__nextHasNoMarginBottom:!0,help:(0,s.__)("The max. value must be greater than the min. value."),children:(0,o.jsxs)(i.Flex,{direction:"row",gap:4,children:[(0,o.jsx)(i.__experimentalNumberControl,{label:(0,s.__)("Min."),value:l,max:u?Number(u)-a:void 0,onChange:c,__next40pxDefaultSize:!0,hideLabelFromVision:n,step:a}),(0,o.jsx)(i.__experimentalNumberControl,{label:(0,s.__)("Max."),value:u,min:l?Number(l)+a:void 0,onChange:d,__next40pxDefaultSize:!0,hideLabelFromVision:n,step:a})]})})}function Hl({data:e,field:t,onChange:n,hideLabelFromVision:i,operator:a,decimals:s,validity:l}){const u=Math.pow(10,-1*Math.abs(s)),{label:c,description:d,getValue:f,setValue:m,isValid:v}=t,p=f({item:e})??"",h=(0,r.useCallback)(t=>{n(m({item:e,value:["",void 0].includes(t)?void 0:Number(t)}))},[e,n,m]),g=(0,r.useCallback)(t=>{n(m({item:e,value:t}))},[e,n,m]);if(a===I){let e=["",""];return Array.isArray(p)&&2===p.length&&p.every(e=>"number"==typeof e||""===e)&&(e=p),(0,o.jsx)(zl,{value:e,onChange:g,hideLabelFromVision:i,step:u})}return(0,o.jsx)(Tl,{required:!!v?.required,customValidity:Vs(v,l),label:c,help:d,value:p,onChange:h,__next40pxDefaultSize:!0,hideLabelFromVision:i,step:u})}var{ValidatedRadioControl:Rl}=ne(i.privateApis),{ValidatedSelectControl:$l}=ne(i.privateApis),{ValidatedToggleControl:Wl}=ne(i.privateApis),{ValidatedTextareaControl:ql}=ne(i.privateApis),{ValidatedToggleGroupControl:Kl}=ne(i.privateApis),{ValidatedFormTokenField:Gl}=ne(i.privateApis),{ValidatedInputControl:Yl,Picker:Ul}=ne(i.privateApis),Zl=({color:e,onColorChange:t})=>{const n=e&&js(e).isValid()?e:"#ffffff";return(0,o.jsx)(i.Dropdown,{renderToggle:({onToggle:e,isOpen:t})=>(0,o.jsx)(i.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,o.jsx)("button",{type:"button",onClick:e,style:{width:"24px",height:"24px",borderRadius:"50%",backgroundColor:n,border:"1px solid #ddd",cursor:"pointer",outline:t?"2px solid #007cba":"none",outlineOffset:"2px",display:"flex",alignItems:"center",justifyContent:"center",padding:0,margin:0},"aria-label":"Open color picker"})}),renderContent:()=>(0,o.jsx)("div",{style:{padding:"16px"},children:(0,o.jsx)(Ul,{color:js(n),onChange:t,enableAlpha:!0})})})},Xl=(0,o.jsx)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(l.Path,{d:"M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z"})});function Ql(e){return Array.isArray(e.elements)&&e.elements.length>0||"function"==typeof e.getElements}var Jl={array:function({data:e,field:t,onChange:n,hideLabelFromVision:a,validity:s}){const{label:l,placeholder:u,getValue:c,setValue:d,isValid:f}=t,m=c({item:e}),{elements:v,isLoading:p}=Rr({elements:t.elements,getElements:t.getElements}),h=(0,r.useMemo)(()=>Array.isArray(m)?m.map(e=>{const t=v?.find(t=>t.value===e);return t||{value:e,label:e}}):[],[m,v]),g=(0,r.useCallback)(t=>{const i=t.map(e=>"object"==typeof e&&"value"in e?e.value:e);n(d({item:e,value:i}))},[n,d,e]);return p?(0,o.jsx)(i.Spinner,{}):(0,o.jsx)(Gl,{required:!!f?.required,customValidity:Vs(f,s),label:a?void 0:l,value:h,onChange:g,placeholder:u,suggestions:v?.map(e=>e.value),__experimentalValidateInput:e=>!t.isValid?.elements||!v||v.some(t=>t.value===e||t.label===e),__experimentalExpandOnFocus:v&&v.length>0,__experimentalShowHowTo:!t.isValid?.elements,displayTransform:e=>{if("object"==typeof e&&"label"in e)return e.label;if("string"==typeof e&&v){const t=v.find(t=>t.value===e);return t?.label||e}return e},__experimentalRenderItem:({item:e})=>{if("string"==typeof e&&v){const t=v.find(t=>t.value===e);return(0,o.jsx)("span",{children:t?.label||e})}return(0,o.jsx)("span",{children:e})}})},checkbox:function({field:e,onChange:t,data:n,hideLabelFromVision:i,validity:a}){const{getValue:s,setValue:l,label:u,description:c,isValid:d}=e,f=(0,r.useCallback)(()=>{t(l({item:n,value:!s({item:n})}))},[n,s,t,l]);return(0,o.jsx)(Is,{required:!!e.isValid?.required,customValidity:Vs(d,a),hidden:i,label:u,help:c,checked:s({item:n}),onChange:f})},color:function({data:e,field:t,onChange:n,hideLabelFromVision:i,validity:a}){const{label:s,placeholder:l,description:u,setValue:c,isValid:d}=t,f=t.getValue({item:e})||"",m=(0,r.useCallback)(t=>{n(c({item:e,value:t.toHex()}))},[e,n,c]),v=(0,r.useCallback)(t=>{n(c({item:e,value:t||""}))},[e,n,c]);return(0,o.jsx)(Yl,{required:!!t.isValid?.required,customValidity:Vs(d,a),label:s,placeholder:l,value:f,help:u,onChange:v,hideLabelFromVision:i,type:"text",prefix:(0,o.jsx)(Zl,{color:f,onColorChange:m})})},datetime:function({data:e,field:t,onChange:n,hideLabelFromVision:i,operator:r,validity:a}){return r===F||r===M?(0,o.jsx)(pl,{className:"dataviews-controls__datetime",data:e,field:t,onChange:n,hideLabelFromVision:i,operator:r}):(0,o.jsx)(bl,{data:e,field:t,onChange:n,hideLabelFromVision:i,validity:a})},date:function({data:e,field:t,onChange:n,hideLabelFromVision:i,operator:r,validity:a}){return r===F||r===M?(0,o.jsx)(pl,{className:"dataviews-controls__date",data:e,field:t,onChange:n,hideLabelFromVision:i,operator:r}):r===I?(0,o.jsx)(Ml,{data:e,field:t,onChange:n,hideLabelFromVision:i,validity:a}):(0,o.jsx)(Fl,{data:e,field:t,onChange:n,hideLabelFromVision:i,validity:a})},email:function({data:e,field:t,onChange:n,hideLabelFromVision:r,validity:a}){return(0,o.jsx)(Pl,{data:e,field:t,onChange:n,hideLabelFromVision:r,validity:a,type:"email",prefix:(0,o.jsx)(i.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,o.jsx)(i.Icon,{icon:Al})})})},telephone:function({data:e,field:t,onChange:n,hideLabelFromVision:r,validity:a}){return(0,o.jsx)(Pl,{data:e,field:t,onChange:n,hideLabelFromVision:r,validity:a,type:"tel",prefix:(0,o.jsx)(i.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,o.jsx)(i.Icon,{icon:Ll})})})},url:function({data:e,field:t,onChange:n,hideLabelFromVision:r,validity:a}){return(0,o.jsx)(Pl,{data:e,field:t,onChange:n,hideLabelFromVision:r,validity:a,type:"url",prefix:(0,o.jsx)(i.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,o.jsx)(i.Icon,{icon:Dl})})})},integer:function(e){return(0,o.jsx)(Hl,{...e,decimals:0})},number:function(e){return(0,o.jsx)(Hl,{...e,decimals:2})},password:function({data:e,field:t,onChange:n,hideLabelFromVision:a,validity:l}){const[u,c]=(0,r.useState)(!1),d=(0,r.useCallback)(()=>{c(e=>!e)},[]);return(0,o.jsx)(Pl,{data:e,field:t,onChange:n,hideLabelFromVision:a,validity:l,type:u?"text":"password",suffix:(0,o.jsx)(i.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,o.jsx)(i.Button,{icon:u?ke:Xl,onClick:d,size:"small",label:u?(0,s.__)("Hide password"):(0,s.__)("Show password")})})})},radio:function({data:e,field:t,onChange:n,hideLabelFromVision:a,validity:s}){const{label:l,description:u,getValue:c,setValue:d,isValid:f}=t,{elements:m,isLoading:v}=Rr({elements:t.elements,getElements:t.getElements}),p=c({item:e}),h=(0,r.useCallback)(t=>n(d({item:e,value:t})),[e,n,d]);return v?(0,o.jsx)(i.Spinner,{}):(0,o.jsx)(Rl,{required:!!t.isValid?.required,customValidity:Vs(f,s),label:l,help:u,onChange:h,options:m,selected:p,hideLabelFromVision:a})},select:function({data:e,field:t,onChange:n,hideLabelFromVision:a,validity:s}){const{type:l,label:u,description:c,getValue:d,setValue:f,isValid:m}=t,v="array"===l,p=d({item:e})??(v?[]:""),h=(0,r.useCallback)(t=>n(f({item:e,value:t})),[e,n,f]),{elements:g,isLoading:b}=Rr({elements:t.elements,getElements:t.getElements});return b?(0,o.jsx)(i.Spinner,{}):(0,o.jsx)($l,{required:!!t.isValid?.required,customValidity:Vs(m,s),label:u,value:p,help:c,options:g,onChange:h,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:a,multiple:v})},text:function({data:e,field:t,onChange:n,hideLabelFromVision:i,config:a,validity:s}){const{prefix:l,suffix:u}=a||{};return(0,o.jsx)(Pl,{data:e,field:t,onChange:n,hideLabelFromVision:i,validity:s,prefix:l?(0,r.createElement)(l):void 0,suffix:u?(0,r.createElement)(u):void 0})},toggle:function({field:e,onChange:t,data:n,hideLabelFromVision:i,validity:a}){const{label:s,description:l,getValue:u,setValue:c,isValid:d}=e,f=(0,r.useCallback)(()=>{t(c({item:n,value:!u({item:n})}))},[t,c,n,u]);return(0,o.jsx)(Wl,{required:!!d.required,customValidity:Vs(d,a),hidden:i,__nextHasNoMarginBottom:!0,label:s,help:l,checked:u({item:n}),onChange:f})},textarea:function({data:e,field:t,onChange:n,hideLabelFromVision:i,config:a,validity:s}){const{rows:l=4}=a||{},{label:u,placeholder:c,description:d,setValue:f,isValid:m}=t,v=t.getValue({item:e}),p=(0,r.useCallback)(t=>n(f({item:e,value:t})),[e,n,f]);return(0,o.jsx)(ql,{required:!!m?.required,customValidity:Vs(m,s),label:u,placeholder:c,value:v??"",help:d,onChange:p,rows:l,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:i})},toggleGroup:function({data:e,field:t,onChange:n,hideLabelFromVision:a,validity:s}){const{getValue:l,setValue:u,isValid:c}=t,d=l({item:e}),f=(0,r.useCallback)(t=>n(u({item:e,value:t})),[e,n,u]),{elements:m,isLoading:v}=Rr({elements:t.elements,getElements:t.getElements});if(v)return(0,o.jsx)(i.Spinner,{});if(0===m.length)return null;const p=m.find(e=>e.value===d);return(0,o.jsx)(Kl,{required:!!t.isValid?.required,customValidity:Vs(c,s),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,isBlock:!0,label:t.label,help:p?.description||t.description,onChange:f,value:d,hideLabelFromVision:a,children:m.map(e=>(0,o.jsx)(i.__experimentalToggleGroupControlOption,{label:e.label,value:e.value},e.value))})}};function eo(e){return e&&"object"==typeof e&&"string"==typeof e.control}function to(e){const{control:t,...n}=e,i=no(t);return function(e){return(0,o.jsx)(i,{...e,config:n})}}function no(e){if(Object.keys(Jl).includes(e))return Jl[e];throw"Control "+e+" not found"}var io=e=>e.id,ro=()=>!0,ao=[],so=rt.filter(e=>!e.isPicker);function lo({header:e,search:t=!0,searchLabel:n}){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(i.__experimentalHStack,{alignment:"top",justify:"space-between",className:"dataviews__view-actions",spacing:1,children:[(0,o.jsxs)(i.__experimentalHStack,{justify:"start",expanded:!1,className:"dataviews__search",children:[t&&(0,o.jsx)(ja,{label:n}),(0,o.jsx)(ut,{})]}),(0,o.jsxs)(i.__experimentalHStack,{spacing:1,expanded:!1,style:{flexShrink:0},children:[(0,o.jsx)(Ta,{}),e]})]}),(0,o.jsx)(pa,{className:"dataviews-filters__container"}),(0,o.jsx)(ha,{}),(0,o.jsx)(_a,{})]})}var oo=function({view:e,onChangeView:t,fields:n,search:i=!0,searchLabel:s,actions:l=ao,data:u,getItemId:c=io,getItemLevel:m,isLoading:v=!1,paginationInfo:p,defaultLayouts:h,selection:g,onChangeSelection:b,onClickItem:x,renderItemLink:w,isItemClickable:y=ro,header:_,children:C,config:j={perPageSizes:[10,20,50,100]},empty:S}){const{infiniteScrollHandler:k}=p,V=(0,r.useRef)(null),[E,N]=(0,r.useState)(0),F=(0,a.useResizeObserver)(e=>{N(e[0].borderBoxSize[0].inlineSize)},{box:"border-box"}),[M,P]=(0,r.useState)([]),L=void 0===g||void 0===b,D=L?M:g,[T,B]=(0,r.useState)(null),z=(0,r.useMemo)(()=>function(e){return e.map(e=>{const t="email"===(n=e.type)?Ha:"integer"===n?Ra:"number"===n?$a:"text"===n?Wa:"datetime"===n?qa:"date"===n?Ka:"boolean"===n?Ga:"media"===n?Ya:"array"===n?Za:"password"===n?Xa:"telephone"===n?Qa:"color"===n?Ss:"url"===n?ks:{sort:(e,t,n)=>"number"==typeof e&&"number"==typeof t?"asc"===n?e-t:t-e:"asc"===n?e.localeCompare(t):t.localeCompare(e),isValid:{elements:!0,custom:()=>null},Edit:null,render:({item:e,field:t})=>t.hasElements?(0,o.jsx)(Ba,{item:e,field:t}):t.getValue({item:e}),enableSorting:!0,filterBy:{defaultOperators:[d,f],validOperators:A}};var n;const i=e.getValue||(r=e.id,({item:e})=>{const t=r.split(".");let n=e;for(const e of t)n=n.hasOwnProperty(e)?n[e]:void 0;return n});var r;const a=e.setValue||(e=>({value:t})=>{const n=e.split("."),i={};let r=i;for(const e of n.slice(0,-1))r[e]={},r=r[e];return r[n.at(-1)]=t,i})(e.id),s=e.sort??function(e,n,r){return t.sort(i({item:e}),i({item:n}),r)},l={...t.isValid,...e.isValid},u=function(e,t){return"function"==typeof e.Edit?e.Edit:"string"==typeof e.Edit?no(e.Edit):eo(e.Edit)?to(e.Edit):Ql(e)&&"array"!==e.type?no("select"):"string"==typeof t.Edit?no(t.Edit):eo(t.Edit)?to(t.Edit):t.Edit}(e,t),c=e.render??function({item:e,field:n}){return t.render({item:e,field:n})},m=function(e,t){if(!1===e.filterBy)return!1;if("object"==typeof e.filterBy){let n=e.filterBy.operators;n&&Array.isArray(n)||(n=t.filterBy?t.filterBy.defaultOperators:[]);let i=A;return"object"==typeof t.filterBy&&(i=t.filterBy.validOperators),n=n.filter(e=>i.includes(e)),Ql(e)&&n.includes(I)&&(n=n.filter(e=>e!==I)),n.some(e=>O.includes(e))&&(n=n.filter(e=>[...O,I].includes(e))),0!==n.length&&{isPrimary:!!e.filterBy.isPrimary,operators:n}}if(!1===t.filterBy)return!1;let n=t.filterBy.defaultOperators;return Ql(e)&&n.includes(I)&&(n=n.filter(e=>e!==I)),{operators:n}}(e,t);return{...e,label:e.label||e.id,header:e.header||e.label||e.id,getValue:i,setValue:a,render:c,sort:s,isValid:l,Edit:u,hasElements:Ql(e),enableHiding:e.enableHiding??!0,enableSorting:e.enableSorting??t.enableSorting??!0,filterBy:m,readOnly:e.readOnly??t.readOnly??!1}})}(n),[n]),H=(0,r.useMemo)(()=>D.filter(e=>u.some(t=>c(t)===e)),[D,u,c]),R=ma(z,e),$=(0,r.useMemo)(()=>(R||[]).some(e=>e.isPrimary||e.isLocked),[R]),[q,K]=(0,r.useState)($);(0,r.useEffect)(()=>{$&&!q&&K(!0)},[$,q]),(0,r.useEffect)(()=>{if(!e.infiniteScrollEnabled||!V.current)return;const t=(0,a.throttle)(e=>{const t=e.target,n=t.scrollTop,i=t.scrollHeight;n+t.clientHeight>=i-100&&k?.()},100),n=V.current;return n.addEventListener("scroll",t),()=>{n.removeEventListener("scroll",t),t.cancel()}},[k,e.infiniteScrollEnabled]);const G=(0,r.useMemo)(()=>Object.fromEntries(Object.entries(h).filter(([e])=>so.some(t=>t.type===e))),[h]);return G[e.type]?(0,o.jsx)(W.Provider,{value:{view:e,onChangeView:t,fields:z,actions:l,data:u,isLoading:v,paginationInfo:p,selection:H,onChangeSelection:function(e){const t="function"==typeof e?e(D):e;L&&P(t),b&&b(t)},openedFilter:T,setOpenedFilter:B,getItemId:c,getItemLevel:m,isItemClickable:y,onClickItem:x,renderItemLink:w,containerWidth:E,containerRef:V,resizeObserverRef:F,defaultLayouts:G,filters:R,isShowingFilter:q,setIsShowingFilter:K,config:j,empty:S,hasInfiniteScrollHandler:!!k},children:(0,o.jsx)("div",{className:"dataviews-wrapper",ref:V,children:C??(0,o.jsx)(lo,{header:_,search:i,searchLabel:s})})}):null};oo.BulkActionToolbar=_e,oo.Filters=va,oo.FiltersToggled=pa,oo.FiltersToggle=ut,oo.Layout=ha,oo.LayoutSwitcher=Fa,oo.Pagination=xa,oo.Search=ja,oo.ViewConfig=La,oo.Footer=_a;var uo=oo},493:(e,t,n)=>{"use strict";var i=n(609),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=i.useState,s=i.useEffect,l=i.useLayoutEffect,o=i.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),i=a({inst:{value:n,getSnapshot:t}}),r=i[0].inst,c=i[1];return l(function(){r.value=n,r.getSnapshot=t,u(r)&&c({inst:r})},[e,n,t]),s(function(){return u(r)&&c({inst:r}),e(function(){u(r)&&c({inst:r})})},[e]),o(n),n};t.useSyncExternalStore=void 0!==i.useSyncExternalStore?i.useSyncExternalStore:c},510:(e,t,n)=>{"use strict";n.d(t,{l:()=>u});var i=Object.prototype.hasOwnProperty;function r(e,t,n){for(n of e.keys())if(a(n,t))return n}function a(e,t){var n,s,l;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((s=e.length)===t.length)for(;s--&&a(e[s],t[s]););return-1===s}if(n===Set){if(e.size!==t.size)return!1;for(s of e){if((l=s)&&"object"==typeof l&&!(l=r(t,l)))return!1;if(!t.has(l))return!1}return!0}if(n===Map){if(e.size!==t.size)return!1;for(s of e){if((l=s[0])&&"object"==typeof l&&!(l=r(t,l)))return!1;if(!a(s[1],t.get(l)))return!1}return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((s=e.byteLength)===t.byteLength)for(;s--&&e.getInt8(s)===t.getInt8(s););return-1===s}if(ArrayBuffer.isView(e)){if((s=e.byteLength)===t.byteLength)for(;s--&&e[s]===t[s];);return-1===s}if(!n||"object"==typeof e){for(n in s=0,e){if(i.call(e,n)&&++s&&!i.call(t,n))return!1;if(!(n in t)||!a(e[n],t[n]))return!1}return Object.keys(t).length===s}}return e!=e&&t!=t}var s=n(87),l=n(143),o=n(233);function u(e){const{kind:t,name:n,slug:i,defaultView:r,queryParams:u,onChangeQueryParams:c}=e,d=function(e,t,n){return`dataviews-${e}-${t}-${n}`}(t,n,i),f=(0,l.useSelect)(e=>e(o.store).get("core/views",d),[d]),{set:m}=(0,l.useDispatch)(o.store),v=f??r,p=Number(u?.page??v.page??1),h=u?.search??v.search??"";return{view:(0,s.useMemo)(()=>({...v,page:p,search:h}),[v,p,h]),isModified:!!f,updateView:(0,s.useCallback)(e=>{const t={page:e?.page,search:e?.search},n=function(e){const t={...e};for(const e of["page","search"])delete t[e];return t}(e);c&&!a(t,{page:p,search:h})&&c(t),a(v,n)||(a(n,r)?m("core/views",d,void 0):m("core/views",d,n))},[c,p,h,v,r,m,d]),resetToDefault:(0,s.useCallback)(()=>{m("core/views",d,void 0)},[d,m])}}},644:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(573),r=n(790),a=(0,r.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,r.jsx)(i.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"})})},655:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(573),r=n(790),a=(0,r.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(i.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})})},684:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(573),r=n(790),a=(0,r.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(i.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"})})},707:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(573),r=n(790),a=(0,r.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(i.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})})},731:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},n=Object.keys(t).join("|"),i=new RegExp(n,"g"),r=new RegExp(n,"");function a(e){return t[e]}var s=function(e){return e.replace(i,a)};e.exports=s,e.exports.has=function(e){return!!e.match(r)},e.exports.remove=s},888:(e,t,n)=>{"use strict";e.exports=n(493)},988:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(573),r=n(790),a=(0,r.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(i.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})})}}]);
\ No newline at end of file
+(globalThis["webpackChunkwordpress_activitypub"] = globalThis["webpackChunkwordpress_activitypub"] || []).push([["social-web/vendors"],{
+
+/***/ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js":
+/*!*************************************************************!*\
+ !*** ./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js ***!
+ \*************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ canUseDOM: () => (/* binding */ canUseDOM),
+/* harmony export */ contains: () => (/* binding */ contains),
+/* harmony export */ getActiveElement: () => (/* binding */ getActiveElement),
+/* harmony export */ getDocument: () => (/* binding */ getDocument),
+/* harmony export */ getPopupItemRole: () => (/* binding */ getPopupItemRole),
+/* harmony export */ getPopupRole: () => (/* binding */ getPopupRole),
+/* harmony export */ getScrollingElement: () => (/* binding */ getScrollingElement),
+/* harmony export */ getTextboxSelection: () => (/* binding */ getTextboxSelection),
+/* harmony export */ getTextboxValue: () => (/* binding */ getTextboxValue),
+/* harmony export */ getWindow: () => (/* binding */ getWindow),
+/* harmony export */ isButton: () => (/* binding */ isButton),
+/* harmony export */ isFrame: () => (/* binding */ isFrame),
+/* harmony export */ isPartiallyHidden: () => (/* binding */ isPartiallyHidden),
+/* harmony export */ isTextField: () => (/* binding */ isTextField),
+/* harmony export */ isTextbox: () => (/* binding */ isTextbox),
+/* harmony export */ isVisible: () => (/* binding */ isVisible),
+/* harmony export */ scrollIntoViewIfNeeded: () => (/* binding */ scrollIntoViewIfNeeded),
+/* harmony export */ setSelectionRange: () => (/* binding */ setSelectionRange),
+/* harmony export */ sortBasedOnDOMPosition: () => (/* binding */ sortBasedOnDOMPosition)
+/* harmony export */ });
+"use client";
+
+// src/utils/dom.ts
+var canUseDOM = checkIsBrowser();
+function checkIsBrowser() {
+ var _a;
+ return typeof window !== "undefined" && !!((_a = window.document) == null ? void 0 : _a.createElement);
+}
+function getDocument(node) {
+ if (!node) return document;
+ if ("self" in node) return node.document;
+ return node.ownerDocument || document;
+}
+function getWindow(node) {
+ if (!node) return self;
+ if ("self" in node) return node.self;
+ return getDocument(node).defaultView || window;
+}
+function getActiveElement(node, activeDescendant = false) {
+ const { activeElement } = getDocument(node);
+ if (!(activeElement == null ? void 0 : activeElement.nodeName)) {
+ return null;
+ }
+ if (isFrame(activeElement) && activeElement.contentDocument) {
+ return getActiveElement(
+ activeElement.contentDocument.body,
+ activeDescendant
+ );
+ }
+ if (activeDescendant) {
+ const id = activeElement.getAttribute("aria-activedescendant");
+ if (id) {
+ const element = getDocument(activeElement).getElementById(id);
+ if (element) {
+ return element;
+ }
+ }
+ }
+ return activeElement;
+}
+function contains(parent, child) {
+ return parent === child || parent.contains(child);
+}
+function isFrame(element) {
+ return element.tagName === "IFRAME";
+}
+function isButton(element) {
+ const tagName = element.tagName.toLowerCase();
+ if (tagName === "button") return true;
+ if (tagName === "input" && element.type) {
+ return buttonInputTypes.indexOf(element.type) !== -1;
+ }
+ return false;
+}
+var buttonInputTypes = [
+ "button",
+ "color",
+ "file",
+ "image",
+ "reset",
+ "submit"
+];
+function isVisible(element) {
+ if (typeof element.checkVisibility === "function") {
+ return element.checkVisibility();
+ }
+ const htmlElement = element;
+ return htmlElement.offsetWidth > 0 || htmlElement.offsetHeight > 0 || element.getClientRects().length > 0;
+}
+function isTextField(element) {
+ try {
+ const isTextInput = element instanceof HTMLInputElement && element.selectionStart !== null;
+ const isTextArea = element.tagName === "TEXTAREA";
+ return isTextInput || isTextArea || false;
+ } catch (_error) {
+ return false;
+ }
+}
+function isTextbox(element) {
+ return element.isContentEditable || isTextField(element);
+}
+function getTextboxValue(element) {
+ if (isTextField(element)) {
+ return element.value;
+ }
+ if (element.isContentEditable) {
+ const range = getDocument(element).createRange();
+ range.selectNodeContents(element);
+ return range.toString();
+ }
+ return "";
+}
+function getTextboxSelection(element) {
+ let start = 0;
+ let end = 0;
+ if (isTextField(element)) {
+ start = element.selectionStart || 0;
+ end = element.selectionEnd || 0;
+ } else if (element.isContentEditable) {
+ const selection = 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);
+ nextRange.setEnd(range.startContainer, range.startOffset);
+ start = nextRange.toString().length;
+ nextRange.setEnd(range.endContainer, range.endOffset);
+ end = nextRange.toString().length;
+ }
+ }
+ return { start, end };
+}
+function getPopupRole(element, fallback) {
+ const allowedPopupRoles = ["dialog", "menu", "listbox", "tree", "grid"];
+ const role = element == null ? void 0 : element.getAttribute("role");
+ if (role && allowedPopupRoles.indexOf(role) !== -1) {
+ return role;
+ }
+ return fallback;
+}
+function getPopupItemRole(element, fallback) {
+ var _a;
+ const itemRoleByPopupRole = {
+ menu: "menuitem",
+ listbox: "option",
+ tree: "treeitem"
+ };
+ const popupRole = getPopupRole(element);
+ if (!popupRole) return fallback;
+ const key = popupRole;
+ return (_a = itemRoleByPopupRole[key]) != null ? _a : fallback;
+}
+function scrollIntoViewIfNeeded(element, arg) {
+ if (isPartiallyHidden(element) && "scrollIntoView" in element) {
+ element.scrollIntoView(arg);
+ }
+}
+function getScrollingElement(element) {
+ if (!element) return null;
+ const isScrollableOverflow = (overflow) => {
+ if (overflow === "auto") return true;
+ if (overflow === "scroll") return true;
+ return false;
+ };
+ if (element.clientHeight && element.scrollHeight > element.clientHeight) {
+ const { overflowY } = getComputedStyle(element);
+ if (isScrollableOverflow(overflowY)) return element;
+ } else if (element.clientWidth && element.scrollWidth > element.clientWidth) {
+ const { overflowX } = getComputedStyle(element);
+ if (isScrollableOverflow(overflowX)) return element;
+ }
+ return getScrollingElement(element.parentElement) || document.scrollingElement || document.body;
+}
+function isPartiallyHidden(element) {
+ const elementRect = element.getBoundingClientRect();
+ const scroller = getScrollingElement(element);
+ if (!scroller) return false;
+ const scrollerRect = scroller.getBoundingClientRect();
+ const isHTML = scroller.tagName === "HTML";
+ const scrollerTop = isHTML ? scrollerRect.top + scroller.scrollTop : scrollerRect.top;
+ const scrollerBottom = isHTML ? scroller.clientHeight : scrollerRect.bottom;
+ const scrollerLeft = isHTML ? scrollerRect.left + scroller.scrollLeft : scrollerRect.left;
+ const scrollerRight = isHTML ? scroller.clientWidth : scrollerRect.right;
+ const top = elementRect.top < scrollerTop;
+ const left = elementRect.left < scrollerLeft;
+ const bottom = elementRect.bottom > scrollerBottom;
+ 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);
+ }
+}
+function sortBasedOnDOMPosition(items, getElement) {
+ const pairs = items.map((item, index) => [index, item]);
+ let isOrderDifferent = false;
+ pairs.sort(([indexA, a], [indexB, b]) => {
+ const elementA = getElement(a);
+ const elementB = getElement(b);
+ if (elementA === elementB) return 0;
+ if (!elementA || !elementB) return 0;
+ if (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 isElementPreceding(a, b) {
+ return Boolean(
+ b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING
+ );
+}
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js":
+/*!*************************************************************!*\
+ !*** ./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js ***!
+ \*************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ __objRest: () => (/* binding */ __objRest),
+/* harmony export */ __spreadProps: () => (/* binding */ __spreadProps),
+/* harmony export */ __spreadValues: () => (/* binding */ __spreadValues)
+/* harmony export */ });
+"use client";
+var __defProp = Object.defineProperty;
+var __defProps = Object.defineProperties;
+var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
+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 __spreadValues = (a, b) => {
+ for (var prop in b || (b = {}))
+ if (__hasOwnProp.call(b, prop))
+ __defNormalProp(a, prop, b[prop]);
+ if (__getOwnPropSymbols)
+ for (var prop of __getOwnPropSymbols(b)) {
+ if (__propIsEnum.call(b, prop))
+ __defNormalProp(a, prop, b[prop]);
+ }
+ return a;
+};
+var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
+var __objRest = (source, exclude) => {
+ var target = {};
+ for (var prop in source)
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
+ target[prop] = source[prop];
+ if (source != null && __getOwnPropSymbols)
+ for (var prop of __getOwnPropSymbols(source)) {
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
+ target[prop] = source[prop];
+ }
+ return target;
+};
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/core/esm/__chunks/43IPP2F4.js":
+/*!*************************************************************!*\
+ !*** ./node_modules/@ariakit/core/esm/__chunks/43IPP2F4.js ***!
+ \*************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ createDisclosureStore: () => (/* binding */ createDisclosureStore)
+/* harmony export */ });
+/* harmony import */ var _EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./EWA2WL6G.js */ "./node_modules/@ariakit/core/esm/__chunks/EWA2WL6G.js");
+/* harmony import */ var _PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PBFD2E7P.js */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
+/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js");
+"use client";
+
+
+
+
+// src/disclosure/disclosure-store.ts
+function createDisclosureStore(props = {}) {
+ const store = (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_0__.mergeStore)(
+ props.store,
+ (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_0__.omit)(props.disclosure, ["contentElement", "disclosureElement"])
+ );
+ (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_0__.throwOnConflictingProps)(props, store);
+ const syncState = store == null ? void 0 : store.getState();
+ const open = (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_1__.defaultValue)(
+ props.open,
+ syncState == null ? void 0 : syncState.open,
+ props.defaultOpen,
+ false
+ );
+ const animated = (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_1__.defaultValue)(props.animated, syncState == null ? void 0 : syncState.animated, false);
+ const initialState = {
+ open,
+ animated,
+ animating: !!animated && open,
+ mounted: open,
+ contentElement: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_1__.defaultValue)(syncState == null ? void 0 : syncState.contentElement, null),
+ disclosureElement: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_1__.defaultValue)(syncState == null ? void 0 : syncState.disclosureElement, null)
+ };
+ const disclosure = (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_0__.createStore)(initialState, store);
+ (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_0__.setup)(
+ disclosure,
+ () => (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_0__.sync)(disclosure, ["animated", "animating"], (state) => {
+ if (state.animated) return;
+ disclosure.setState("animating", false);
+ })
+ );
+ (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_0__.setup)(
+ disclosure,
+ () => (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_0__.subscribe)(disclosure, ["open"], () => {
+ if (!disclosure.getState().animated) return;
+ disclosure.setState("animating", true);
+ })
+ );
+ (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_0__.setup)(
+ disclosure,
+ () => (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_0__.sync)(disclosure, ["open", "animating"], (state) => {
+ disclosure.setState("mounted", state.open || state.animating);
+ })
+ );
+ return (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadValues)({}, disclosure), {
+ disclosure: props.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)
+ });
+}
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/core/esm/__chunks/7PRQYBBV.js":
+/*!*************************************************************!*\
+ !*** ./node_modules/@ariakit/core/esm/__chunks/7PRQYBBV.js ***!
+ \*************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ addItemToArray: () => (/* binding */ addItemToArray),
+/* harmony export */ flatten2DArray: () => (/* binding */ flatten2DArray),
+/* harmony export */ reverseArray: () => (/* binding */ reverseArray),
+/* harmony export */ toArray: () => (/* binding */ toArray)
+/* harmony export */ });
+"use client";
+
+// src/utils/array.ts
+function 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();
+}
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/core/esm/__chunks/C34RJTDU.js":
+/*!*************************************************************!*\
+ !*** ./node_modules/@ariakit/core/esm/__chunks/C34RJTDU.js ***!
+ \*************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ createCompositeStore: () => (/* binding */ createCompositeStore)
+/* harmony export */ });
+/* harmony import */ var _7PRQYBBV_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./7PRQYBBV.js */ "./node_modules/@ariakit/core/esm/__chunks/7PRQYBBV.js");
+/* harmony import */ var _K2KIGYQU_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./K2KIGYQU.js */ "./node_modules/@ariakit/core/esm/__chunks/K2KIGYQU.js");
+/* harmony import */ var _EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./EWA2WL6G.js */ "./node_modules/@ariakit/core/esm/__chunks/EWA2WL6G.js");
+/* harmony import */ var _PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PBFD2E7P.js */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
+/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js");
+"use client";
+
+
+
+
+
+
+// src/composite/composite-store.ts
+var NULL_ITEM = { id: null };
+function 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 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 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 ? findFirstEnabledItem(row) : row[i - 1];
+ row[i] = previousItem && activeId !== previousItem.id && focusShift ? previousItem : createEmptyItem(previousItem == null ? void 0 : previousItem.rowId);
+ }
+ }
+ }
+ return rows;
+}
+function 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((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__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 = (0,_K2KIGYQU_js__WEBPACK_IMPORTED_MODULE_1__.createCollectionStore)(props);
+ const activeId = (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_3__.defaultValue)(
+ props.activeId,
+ syncState == null ? void 0 : syncState.activeId,
+ props.defaultActiveId
+ );
+ const initialState = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__spreadValues)({}, collection.getState()), {
+ id: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_3__.defaultValue)(
+ props.id,
+ syncState == null ? void 0 : syncState.id,
+ `id-${Math.random().toString(36).slice(2, 8)}`
+ ),
+ activeId,
+ baseElement: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_3__.defaultValue)(syncState == null ? void 0 : syncState.baseElement, null),
+ includesBaseElement: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_3__.defaultValue)(
+ props.includesBaseElement,
+ syncState == null ? void 0 : syncState.includesBaseElement,
+ activeId === null
+ ),
+ moves: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_3__.defaultValue)(syncState == null ? void 0 : syncState.moves, 0),
+ orientation: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_3__.defaultValue)(
+ props.orientation,
+ syncState == null ? void 0 : syncState.orientation,
+ "both"
+ ),
+ rtl: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_3__.defaultValue)(props.rtl, syncState == null ? void 0 : syncState.rtl, false),
+ virtualFocus: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_3__.defaultValue)(
+ props.virtualFocus,
+ syncState == null ? void 0 : syncState.virtualFocus,
+ false
+ ),
+ focusLoop: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_3__.defaultValue)(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, false),
+ focusWrap: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_3__.defaultValue)(props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false),
+ focusShift: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_3__.defaultValue)(props.focusShift, syncState == null ? void 0 : syncState.focusShift, false)
+ });
+ const composite = (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_2__.createStore)(initialState, collection, props.store);
+ (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_2__.setup)(
+ composite,
+ () => (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_2__.sync)(composite, ["renderedItems", "activeId"], (state) => {
+ composite.setState("activeId", (activeId2) => {
+ var _a2;
+ if (activeId2 !== void 0) return activeId2;
+ return (_a2 = findFirstEnabledItem(state.renderedItems)) == null ? void 0 : _a2.id;
+ });
+ })
+ );
+ const getNextId = (direction = "next", options = {}) => {
+ var _a2, _b;
+ const defaultState = composite.getState();
+ const {
+ skip = 0,
+ activeId: activeId2 = defaultState.activeId,
+ focusShift = defaultState.focusShift,
+ focusLoop = defaultState.focusLoop,
+ focusWrap = defaultState.focusWrap,
+ includesBaseElement = defaultState.includesBaseElement,
+ renderedItems = defaultState.renderedItems,
+ rtl = defaultState.rtl
+ } = options;
+ const isVerticalDirection = direction === "up" || direction === "down";
+ const isNextDirection = direction === "next" || direction === "down";
+ const canReverse = isNextDirection ? rtl && !isVerticalDirection : !rtl || isVerticalDirection;
+ const canShift = focusShift && !skip;
+ let items = !isVerticalDirection ? renderedItems : (0,_7PRQYBBV_js__WEBPACK_IMPORTED_MODULE_0__.flatten2DArray)(
+ normalizeRows(groupItemsByRows(renderedItems), activeId2, canShift)
+ );
+ items = canReverse ? (0,_7PRQYBBV_js__WEBPACK_IMPORTED_MODULE_0__.reverseArray)(items) : items;
+ items = isVerticalDirection ? verticalizeItems(items) : items;
+ if (activeId2 == null) {
+ return (_a2 = findFirstEnabledItem(items)) == null ? void 0 : _a2.id;
+ }
+ const activeItem = items.find((item) => item.id === activeId2);
+ if (!activeItem) {
+ return (_b = findFirstEnabledItem(items)) == null ? void 0 : _b.id;
+ }
+ const isGrid = items.some((item) => item.rowId);
+ const activeIndex = items.indexOf(activeItem);
+ const nextItems = items.slice(activeIndex + 1);
+ const nextItemsInRow = getItemsInRow(nextItems, activeItem.rowId);
+ if (skip) {
+ 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 canLoop = focusLoop && (isVerticalDirection ? focusLoop !== "horizontal" : focusLoop !== "vertical");
+ const canWrap = isGrid && focusWrap && (isVerticalDirection ? focusWrap !== "horizontal" : focusWrap !== "vertical");
+ const hasNullItem = isNextDirection ? (!isGrid || isVerticalDirection) && canLoop && includesBaseElement : isVerticalDirection ? includesBaseElement : false;
+ if (canLoop) {
+ const loopItems = canWrap && !hasNullItem ? items : getItemsInRow(items, activeItem.rowId);
+ const sortedItems = flipItems(loopItems, activeId2, hasNullItem);
+ const nextItem2 = findFirstEnabledItem(sortedItems, activeId2);
+ return nextItem2 == null ? void 0 : nextItem2.id;
+ }
+ if (canWrap) {
+ const nextItem2 = 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 = findFirstEnabledItem(nextItemsInRow, activeId2);
+ if (!nextItem && hasNullItem) {
+ return null;
+ }
+ return nextItem == null ? void 0 : nextItem.id;
+ };
+ return (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__spreadValues)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__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 = findFirstEnabledItem(composite.getState().renderedItems)) == null ? void 0 : _a2.id;
+ },
+ last: () => {
+ var _a2;
+ return (_a2 = findFirstEnabledItem((0,_7PRQYBBV_js__WEBPACK_IMPORTED_MODULE_0__.reverseArray)(composite.getState().renderedItems))) == null ? void 0 : _a2.id;
+ },
+ next: (options) => {
+ if (options !== void 0 && typeof options === "number") {
+ options = { skip: options };
+ }
+ return getNextId("next", options);
+ },
+ previous: (options) => {
+ if (options !== void 0 && typeof options === "number") {
+ options = { skip: options };
+ }
+ return getNextId("previous", options);
+ },
+ down: (options) => {
+ if (options !== void 0 && typeof options === "number") {
+ options = { skip: options };
+ }
+ return getNextId("down", options);
+ },
+ up: (options) => {
+ if (options !== void 0 && typeof options === "number") {
+ options = { skip: options };
+ }
+ return getNextId("up", options);
+ }
+ });
+}
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/core/esm/__chunks/EWA2WL6G.js":
+/*!*************************************************************!*\
+ !*** ./node_modules/@ariakit/core/esm/__chunks/EWA2WL6G.js ***!
+ \*************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ batch: () => (/* binding */ batch),
+/* harmony export */ createStore: () => (/* binding */ createStore),
+/* harmony export */ init: () => (/* binding */ init),
+/* harmony export */ mergeStore: () => (/* binding */ mergeStore),
+/* harmony export */ omit: () => (/* binding */ omit2),
+/* harmony export */ pick: () => (/* binding */ pick2),
+/* harmony export */ setup: () => (/* binding */ setup),
+/* harmony export */ subscribe: () => (/* binding */ subscribe),
+/* harmony export */ sync: () => (/* binding */ sync),
+/* harmony export */ throwOnConflictingProps: () => (/* binding */ throwOnConflictingProps)
+/* harmony export */ });
+/* harmony import */ var _PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PBFD2E7P.js */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
+/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js");
+"use client";
+
+
+
+// src/utils/store.ts
+function getInternal(store, key) {
+ const internals = store.__unstableInternals;
+ (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_0__.invariant)(internals, "Invalid store");
+ return internals[key];
+}
+function createStore(initialState, ...stores) {
+ let state = initialState;
+ let prevStateBatch = state;
+ let lastUpdate = Symbol();
+ let destroy = _PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_0__.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 = (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_0__.getKeys)(state).map(
+ (key) => (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_0__.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 (!(0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_0__.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 = [];
+ for (const setup2 of setups) {
+ teardowns.push(setup2());
+ }
+ const cleanups = stores.map(init);
+ destroy = (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_0__.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((0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_0__.pick)(state, keys), finalStore);
+ const storeOmit = (keys) => createStore((0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_0__.omit)(state, keys), finalStore);
+ const getState = () => state;
+ const setState = (key, value, fromStores = false) => {
+ var _a;
+ if (!(0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_0__.hasOwnProperty)(state, key)) return;
+ const nextValue = (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_0__.applyState)(value, state[key]);
+ if (nextValue === state[key]) return;
+ if (!fromStores) {
+ for (const store of stores) {
+ (_a = store == null ? void 0 : store.setState) == null ? void 0 : _a.call(store, key, nextValue);
+ }
+ }
+ const prevState = state;
+ state = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadValues)({}, state), { [key]: nextValue });
+ const thisUpdate = Symbol();
+ lastUpdate = thisUpdate;
+ updatedKeys.add(key);
+ const run = (listener, prev, uKeys) => {
+ var _a2;
+ const keys = listenerKeys.get(listener);
+ const updated = (k) => uKeys ? uKeys.has(k) : k === key;
+ if (!keys || keys.some(updated)) {
+ (_a2 = disposables.get(listener)) == null ? void 0 : _a2();
+ disposables.set(listener, listener(state, prev));
+ }
+ };
+ for (const listener of listeners) {
+ run(listener, prevState);
+ }
+ queueMicrotask(() => {
+ if (lastUpdate !== thisUpdate) return;
+ const snapshot = state;
+ for (const listener of batchListeners) {
+ 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 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) {
+ var _a;
+ const initialState = {};
+ for (const store2 of stores) {
+ const nextState = (_a = store2 == null ? void 0 : store2.getState) == null ? void 0 : _a.call(store2);
+ if (nextState) {
+ Object.assign(initialState, nextState);
+ }
+ }
+ const store = createStore(initialState, ...stores);
+ return Object.assign({}, ...stores, store);
+}
+function throwOnConflictingProps(props, store) {
+ if (false) // removed by dead control flow
+{}
+ 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) => (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_0__.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();
+
+ ^ ^
+
+Instead, pass the default state to the topmost store:
+
+const store = useSelectStore({ defaultValue: "Apple" });
+
+
+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
+`
+ );
+}
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/core/esm/__chunks/K2KIGYQU.js":
+/*!*************************************************************!*\
+ !*** ./node_modules/@ariakit/core/esm/__chunks/K2KIGYQU.js ***!
+ \*************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ createCollectionStore: () => (/* binding */ createCollectionStore)
+/* harmony export */ });
+/* harmony import */ var _37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./37JWRFYW.js */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js");
+/* harmony import */ var _EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./EWA2WL6G.js */ "./node_modules/@ariakit/core/esm/__chunks/EWA2WL6G.js");
+/* harmony import */ var _PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PBFD2E7P.js */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
+/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js");
+"use client";
+
+
+
+
+
+// src/collection/collection-store.ts
+function 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 (0,_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.getDocument)(parentElement).body;
+}
+function getPrivateStore(store) {
+ return store == null ? void 0 : store.__unstablePrivateStore;
+}
+function createCollectionStore(props = {}) {
+ var _a;
+ (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.throwOnConflictingProps)(props, props.store);
+ const syncState = (_a = props.store) == null ? void 0 : _a.getState();
+ const items = (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_2__.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: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_2__.defaultValue)(syncState == null ? void 0 : syncState.renderedItems, [])
+ };
+ const syncPrivateStore = getPrivateStore(props.store);
+ const privateStore = (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.createStore)(
+ { items, renderedItems: initialState.renderedItems },
+ syncPrivateStore
+ );
+ const collection = (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.createStore)(initialState, props.store);
+ const sortItems = (renderedItems) => {
+ const sortedItems = (0,_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.sortBasedOnDOMPosition)(renderedItems, (i) => i.element);
+ privateStore.setState("renderedItems", sortedItems);
+ collection.setState("renderedItems", sortedItems);
+ };
+ (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.setup)(collection, () => (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.init)(privateStore));
+ (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.setup)(privateStore, () => {
+ return (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.batch)(privateStore, ["items"], (state) => {
+ collection.setState("items", state.items);
+ });
+ });
+ (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.setup)(privateStore, () => {
+ return (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.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);
+ }
+ const ioCallback = () => {
+ if (firstRun) {
+ firstRun = false;
+ return;
+ }
+ 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);
+ }
+ 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 = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__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) => privateStore.setState("items", getItems),
+ true
+ );
+ return (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)({}, collection), {
+ registerItem,
+ renderItem: (item) => (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_2__.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 } = privateStore.getState();
+ item = items2.find((item2) => item2.id === id);
+ if (item) {
+ itemsMap.set(id, item);
+ }
+ }
+ return item || null;
+ },
+ // @ts-expect-error Internal
+ __unstablePrivateStore: privateStore
+ });
+}
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/core/esm/__chunks/MD3RIO2T.js":
+/*!*************************************************************!*\
+ !*** ./node_modules/@ariakit/core/esm/__chunks/MD3RIO2T.js ***!
+ \*************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ createPopoverStore: () => (/* binding */ createPopoverStore)
+/* harmony export */ });
+/* harmony import */ var _RZDDWCDV_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./RZDDWCDV.js */ "./node_modules/@ariakit/core/esm/__chunks/RZDDWCDV.js");
+/* harmony import */ var _EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./EWA2WL6G.js */ "./node_modules/@ariakit/core/esm/__chunks/EWA2WL6G.js");
+/* harmony import */ var _PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PBFD2E7P.js */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
+/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js");
+"use client";
+
+
+
+
+
+// src/popover/popover-store.ts
+function createPopoverStore(_a = {}) {
+ var _b = _a, {
+ popover: otherPopover
+ } = _b, props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__objRest)(_b, [
+ "popover"
+ ]);
+ const store = (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.mergeStore)(
+ props.store,
+ (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.omit)(otherPopover, [
+ "arrowElement",
+ "anchorElement",
+ "contentElement",
+ "popoverElement",
+ "disclosureElement"
+ ])
+ );
+ (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.throwOnConflictingProps)(props, store);
+ const syncState = store == null ? void 0 : store.getState();
+ const dialog = (0,_RZDDWCDV_js__WEBPACK_IMPORTED_MODULE_0__.createDialogStore)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)({}, props), { store }));
+ const placement = (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_2__.defaultValue)(
+ props.placement,
+ syncState == null ? void 0 : syncState.placement,
+ "bottom"
+ );
+ const initialState = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)({}, dialog.getState()), {
+ placement,
+ currentPlacement: placement,
+ anchorElement: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_2__.defaultValue)(syncState == null ? void 0 : syncState.anchorElement, null),
+ popoverElement: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_2__.defaultValue)(syncState == null ? void 0 : syncState.popoverElement, null),
+ arrowElement: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_2__.defaultValue)(syncState == null ? void 0 : syncState.arrowElement, null),
+ rendered: Symbol("rendered")
+ });
+ const popover = (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.createStore)(initialState, dialog, store);
+ return (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__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"))
+ });
+}
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/core/esm/__chunks/O6E4ZWCP.js":
+/*!*************************************************************!*\
+ !*** ./node_modules/@ariakit/core/esm/__chunks/O6E4ZWCP.js ***!
+ \*************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ isApple: () => (/* binding */ isApple),
+/* harmony export */ isFirefox: () => (/* binding */ isFirefox),
+/* harmony export */ isMac: () => (/* binding */ isMac),
+/* harmony export */ isSafari: () => (/* binding */ isSafari),
+/* harmony export */ isTouchDevice: () => (/* binding */ isTouchDevice)
+/* harmony export */ });
+/* harmony import */ var _37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./37JWRFYW.js */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js");
+"use client";
+
+
+// src/utils/platform.ts
+function isTouchDevice() {
+ return _37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.canUseDOM && !!navigator.maxTouchPoints;
+}
+function isApple() {
+ if (!_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.canUseDOM) return false;
+ return /mac|iphone|ipad|ipod/i.test(navigator.platform);
+}
+function isSafari() {
+ return _37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.canUseDOM && isApple() && /apple/i.test(navigator.vendor);
+}
+function isFirefox() {
+ return _37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.canUseDOM && /firefox\//i.test(navigator.userAgent);
+}
+function isMac() {
+ return _37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice();
+}
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js":
+/*!*************************************************************!*\
+ !*** ./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js ***!
+ \*************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ afterPaint: () => (/* binding */ afterPaint),
+/* harmony export */ applyState: () => (/* binding */ applyState),
+/* harmony export */ beforePaint: () => (/* binding */ beforePaint),
+/* harmony export */ chain: () => (/* binding */ chain),
+/* harmony export */ cx: () => (/* binding */ cx),
+/* harmony export */ defaultValue: () => (/* binding */ defaultValue),
+/* harmony export */ disabledFromProps: () => (/* binding */ disabledFromProps),
+/* harmony export */ getKeys: () => (/* binding */ getKeys),
+/* harmony export */ hasOwnProperty: () => (/* binding */ hasOwnProperty),
+/* harmony export */ identity: () => (/* binding */ identity),
+/* harmony export */ invariant: () => (/* binding */ invariant),
+/* harmony export */ isEmpty: () => (/* binding */ isEmpty),
+/* harmony export */ isFalsyBooleanCallback: () => (/* binding */ isFalsyBooleanCallback),
+/* harmony export */ isInteger: () => (/* binding */ isInteger),
+/* harmony export */ isObject: () => (/* binding */ isObject),
+/* harmony export */ noop: () => (/* binding */ noop),
+/* harmony export */ normalizeString: () => (/* binding */ normalizeString),
+/* harmony export */ omit: () => (/* binding */ omit),
+/* harmony export */ pick: () => (/* binding */ pick),
+/* harmony export */ removeUndefinedValues: () => (/* binding */ removeUndefinedValues),
+/* harmony export */ shallowEqual: () => (/* binding */ shallowEqual)
+/* harmony export */ });
+/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js");
+"use client";
+
+
+// src/utils/misc.ts
+function noop(..._) {
+}
+function shallowEqual(a, b) {
+ if (a === b) return true;
+ if (!a) return false;
+ if (!b) return false;
+ if (typeof a !== "object") return false;
+ if (typeof b !== "object") return false;
+ const aKeys = Object.keys(a);
+ const bKeys = Object.keys(b);
+ const { length } = aKeys;
+ if (bKeys.length !== length) return false;
+ for (const key of aKeys) {
+ if (a[key] !== b[key]) {
+ return false;
+ }
+ }
+ return true;
+}
+function applyState(argument, currentValue) {
+ if (isUpdater(argument)) {
+ const value = isLazyValue(currentValue) ? currentValue() : currentValue;
+ return argument(value);
+ }
+ return argument;
+}
+function isUpdater(argument) {
+ return typeof argument === "function";
+}
+function isLazyValue(value) {
+ return typeof value === "function";
+}
+function isObject(arg) {
+ return typeof arg === "object" && arg != null;
+}
+function isEmpty(arg) {
+ if (Array.isArray(arg)) return !arg.length;
+ if (isObject(arg)) return !Object.keys(arg).length;
+ if (arg == null) return true;
+ if (arg === "") return true;
+ return false;
+}
+function isInteger(arg) {
+ if (typeof arg === "number") {
+ return Math.floor(arg) === arg;
+ }
+ return String(Math.floor(Number(arg))) === arg;
+}
+function hasOwnProperty(object, prop) {
+ if (typeof Object.hasOwn === "function") {
+ return Object.hasOwn(object, prop);
+ }
+ return Object.prototype.hasOwnProperty.call(object, prop);
+}
+function chain(...fns) {
+ return (...args) => {
+ for (const fn of fns) {
+ if (typeof fn === "function") {
+ fn(...args);
+ }
+ }
+ };
+}
+function cx(...args) {
+ return args.filter(Boolean).join(" ") || void 0;
+}
+function normalizeString(str) {
+ return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
+}
+function omit(object, keys) {
+ const result = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_0__.__spreadValues)({}, object);
+ for (const key of keys) {
+ if (hasOwnProperty(result, key)) {
+ delete result[key];
+ }
+ }
+ return result;
+}
+function pick(object, paths) {
+ const result = {};
+ for (const key of paths) {
+ if (hasOwnProperty(object, key)) {
+ result[key] = object[key];
+ }
+ }
+ return result;
+}
+function identity(value) {
+ return value;
+}
+function beforePaint(cb = noop) {
+ const raf = requestAnimationFrame(cb);
+ return () => cancelAnimationFrame(raf);
+}
+function afterPaint(cb = noop) {
+ let raf = requestAnimationFrame(() => {
+ raf = requestAnimationFrame(cb);
+ });
+ return () => cancelAnimationFrame(raf);
+}
+function invariant(condition, message) {
+ if (condition) return;
+ if (typeof message !== "string") throw new Error("Invariant failed");
+ throw new Error(message);
+}
+function getKeys(obj) {
+ return Object.keys(obj);
+}
+function isFalsyBooleanCallback(booleanOrCallback, ...args) {
+ const result = typeof booleanOrCallback === "function" ? booleanOrCallback(...args) : booleanOrCallback;
+ if (result == null) return false;
+ return !result;
+}
+function disabledFromProps(props) {
+ return props.disabled || props["aria-disabled"] === true || props["aria-disabled"] === "true";
+}
+function removeUndefinedValues(obj) {
+ const result = {};
+ for (const key in obj) {
+ if (obj[key] !== void 0) {
+ result[key] = obj[key];
+ }
+ }
+ return result;
+}
+function defaultValue(...values) {
+ for (const value of values) {
+ if (value !== void 0) return value;
+ }
+ return void 0;
+}
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/core/esm/__chunks/RZDDWCDV.js":
+/*!*************************************************************!*\
+ !*** ./node_modules/@ariakit/core/esm/__chunks/RZDDWCDV.js ***!
+ \*************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ createDialogStore: () => (/* binding */ createDialogStore)
+/* harmony export */ });
+/* harmony import */ var _43IPP2F4_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./43IPP2F4.js */ "./node_modules/@ariakit/core/esm/__chunks/43IPP2F4.js");
+"use client";
+
+
+// src/dialog/dialog-store.ts
+function createDialogStore(props = {}) {
+ return (0,_43IPP2F4_js__WEBPACK_IMPORTED_MODULE_0__.createDisclosureStore)(props);
+}
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/core/esm/combobox/combobox-store.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/core/esm/combobox/combobox-store.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ createComboboxStore: () => (/* binding */ createComboboxStore)
+/* harmony export */ });
+/* harmony import */ var _chunks_O6E4ZWCP_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../__chunks/O6E4ZWCP.js */ "./node_modules/@ariakit/core/esm/__chunks/O6E4ZWCP.js");
+/* harmony import */ var _chunks_MD3RIO2T_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../__chunks/MD3RIO2T.js */ "./node_modules/@ariakit/core/esm/__chunks/MD3RIO2T.js");
+/* harmony import */ var _chunks_C34RJTDU_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../__chunks/C34RJTDU.js */ "./node_modules/@ariakit/core/esm/__chunks/C34RJTDU.js");
+/* harmony import */ var _chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../__chunks/EWA2WL6G.js */ "./node_modules/@ariakit/core/esm/__chunks/EWA2WL6G.js");
+/* harmony import */ var _chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../__chunks/PBFD2E7P.js */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
+/* harmony import */ var _chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../__chunks/3YLGPPWQ.js */ "./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js");
+"use client";
+
+
+
+
+
+
+
+
+
+
+
+
+// src/combobox/combobox-store.ts
+var isTouchSafari = (0,_chunks_O6E4ZWCP_js__WEBPACK_IMPORTED_MODULE_0__.isSafari)() && (0,_chunks_O6E4ZWCP_js__WEBPACK_IMPORTED_MODULE_0__.isTouchDevice)();
+function createComboboxStore(_a = {}) {
+ var _b = _a, {
+ tag
+ } = _b, props = (0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__objRest)(_b, [
+ "tag"
+ ]);
+ const store = (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.mergeStore)(props.store, (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.pick)(tag, ["value", "rtl"]));
+ (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.throwOnConflictingProps)(props, store);
+ const tagState = tag == null ? void 0 : tag.getState();
+ const syncState = store == null ? void 0 : store.getState();
+ const activeId = (0,_chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__.defaultValue)(
+ props.activeId,
+ syncState == null ? void 0 : syncState.activeId,
+ props.defaultActiveId,
+ null
+ );
+ const composite = (0,_chunks_C34RJTDU_js__WEBPACK_IMPORTED_MODULE_2__.createCompositeStore)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadProps)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({}, props), {
+ activeId,
+ includesBaseElement: (0,_chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__.defaultValue)(
+ props.includesBaseElement,
+ syncState == null ? void 0 : syncState.includesBaseElement,
+ true
+ ),
+ orientation: (0,_chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__.defaultValue)(
+ props.orientation,
+ syncState == null ? void 0 : syncState.orientation,
+ "vertical"
+ ),
+ focusLoop: (0,_chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__.defaultValue)(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true),
+ focusWrap: (0,_chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__.defaultValue)(props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, true),
+ virtualFocus: (0,_chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__.defaultValue)(
+ props.virtualFocus,
+ syncState == null ? void 0 : syncState.virtualFocus,
+ true
+ )
+ }));
+ const popover = (0,_chunks_MD3RIO2T_js__WEBPACK_IMPORTED_MODULE_1__.createPopoverStore)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadProps)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({}, props), {
+ placement: (0,_chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__.defaultValue)(
+ props.placement,
+ syncState == null ? void 0 : syncState.placement,
+ "bottom-start"
+ )
+ }));
+ const value = (0,_chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__.defaultValue)(
+ props.value,
+ syncState == null ? void 0 : syncState.value,
+ props.defaultValue,
+ ""
+ );
+ const selectedValue = (0,_chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__.defaultValue)(
+ props.selectedValue,
+ syncState == null ? void 0 : syncState.selectedValue,
+ tagState == null ? void 0 : tagState.values,
+ props.defaultSelectedValue,
+ ""
+ );
+ const multiSelectable = Array.isArray(selectedValue);
+ const initialState = (0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadProps)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({}, composite.getState()), popover.getState()), {
+ value,
+ selectedValue,
+ resetValueOnSelect: (0,_chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__.defaultValue)(
+ props.resetValueOnSelect,
+ syncState == null ? void 0 : syncState.resetValueOnSelect,
+ multiSelectable
+ ),
+ resetValueOnHide: (0,_chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__.defaultValue)(
+ props.resetValueOnHide,
+ syncState == null ? void 0 : syncState.resetValueOnHide,
+ multiSelectable && !tag
+ ),
+ activeValue: syncState == null ? void 0 : syncState.activeValue
+ });
+ const combobox = (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.createStore)(initialState, composite, popover, store);
+ if (isTouchSafari) {
+ (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.setup)(
+ combobox,
+ () => (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.sync)(combobox, ["virtualFocus"], () => {
+ combobox.setState("virtualFocus", false);
+ })
+ );
+ }
+ (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.setup)(combobox, () => {
+ if (!tag) return;
+ return (0,_chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__.chain)(
+ (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.sync)(combobox, ["selectedValue"], (state) => {
+ if (!Array.isArray(state.selectedValue)) return;
+ tag.setValues(state.selectedValue);
+ }),
+ (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.sync)(tag, ["values"], (state) => {
+ combobox.setState("selectedValue", state.values);
+ })
+ );
+ });
+ (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.setup)(
+ combobox,
+ () => (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.sync)(combobox, ["resetValueOnHide", "mounted"], (state) => {
+ if (!state.resetValueOnHide) return;
+ if (state.mounted) return;
+ combobox.setState("value", value);
+ })
+ );
+ (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.setup)(
+ combobox,
+ () => (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.sync)(combobox, ["open"], (state) => {
+ if (state.open) return;
+ combobox.setState("activeId", activeId);
+ combobox.setState("moves", 0);
+ })
+ );
+ (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.setup)(
+ combobox,
+ () => (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.sync)(combobox, ["moves", "activeId"], (state, prevState) => {
+ if (state.moves === prevState.moves) {
+ combobox.setState("activeValue", void 0);
+ }
+ })
+ );
+ (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.setup)(
+ combobox,
+ () => (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.batch)(combobox, ["moves", "renderedItems"], (state, prev) => {
+ if (state.moves === prev.moves) return;
+ const { activeId: activeId2 } = combobox.getState();
+ const activeItem = composite.item(activeId2);
+ combobox.setState("activeValue", activeItem == null ? void 0 : activeItem.value);
+ })
+ );
+ return (0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadProps)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({}, popover), composite), combobox), {
+ tag,
+ setValue: (value2) => combobox.setState("value", value2),
+ resetValue: () => combobox.setState("value", initialState.value),
+ setSelectedValue: (selectedValue2) => combobox.setState("selectedValue", selectedValue2)
+ });
+}
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/core/esm/utils/events.js":
+/*!********************************************************!*\
+ !*** ./node_modules/@ariakit/core/esm/utils/events.js ***!
+ \********************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ addGlobalEventListener: () => (/* binding */ addGlobalEventListener),
+/* harmony export */ fireBlurEvent: () => (/* binding */ fireBlurEvent),
+/* harmony export */ fireClickEvent: () => (/* binding */ fireClickEvent),
+/* harmony export */ fireEvent: () => (/* binding */ fireEvent),
+/* harmony export */ fireFocusEvent: () => (/* binding */ fireFocusEvent),
+/* harmony export */ fireKeyboardEvent: () => (/* binding */ fireKeyboardEvent),
+/* harmony export */ getInputType: () => (/* binding */ getInputType),
+/* harmony export */ isDownloading: () => (/* binding */ isDownloading),
+/* harmony export */ isFocusEventOutside: () => (/* binding */ isFocusEventOutside),
+/* harmony export */ isOpeningInNewTab: () => (/* binding */ isOpeningInNewTab),
+/* harmony export */ isPortalEvent: () => (/* binding */ isPortalEvent),
+/* harmony export */ isSelfTarget: () => (/* binding */ isSelfTarget),
+/* harmony export */ queueBeforeEvent: () => (/* binding */ queueBeforeEvent)
+/* harmony export */ });
+/* harmony import */ var _chunks_O6E4ZWCP_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../__chunks/O6E4ZWCP.js */ "./node_modules/@ariakit/core/esm/__chunks/O6E4ZWCP.js");
+/* harmony import */ var _chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../__chunks/37JWRFYW.js */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js");
+/* harmony import */ var _chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../__chunks/3YLGPPWQ.js */ "./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js");
+"use client";
+
+
+
+
+// src/utils/events.ts
+function isPortalEvent(event) {
+ return Boolean(
+ event.currentTarget && !(0,_chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_1__.contains)(event.currentTarget, event.target)
+ );
+}
+function isSelfTarget(event) {
+ return event.target === event.currentTarget;
+}
+function isOpeningInNewTab(event) {
+ const element = event.currentTarget;
+ if (!element) return false;
+ const isAppleDevice = (0,_chunks_O6E4ZWCP_js__WEBPACK_IMPORTED_MODULE_0__.isApple)();
+ if (isAppleDevice && !event.metaKey) return false;
+ if (!isAppleDevice && !event.ctrlKey) return false;
+ const tagName = element.tagName.toLowerCase();
+ if (tagName === "a") return true;
+ if (tagName === "button" && element.type === "submit") return true;
+ if (tagName === "input" && element.type === "submit") return true;
+ return false;
+}
+function isDownloading(event) {
+ const element = event.currentTarget;
+ if (!element) return false;
+ const tagName = element.tagName.toLowerCase();
+ if (!event.altKey) return false;
+ if (tagName === "a") return true;
+ if (tagName === "button" && element.type === "submit") return true;
+ if (tagName === "input" && element.type === "submit") return true;
+ return false;
+}
+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 = (0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadProps)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__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 = (0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadProps)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadValues)({}, eventInit), { bubbles: true });
+ element.dispatchEvent(new FocusEvent("focusin", bubbleInit));
+ return defaultAllowed;
+}
+function fireKeyboardEvent(element, type, eventInit) {
+ const event = new KeyboardEvent(type, eventInit);
+ return element.dispatchEvent(event);
+}
+function fireClickEvent(element, eventInit) {
+ const event = new MouseEvent("click", eventInit);
+ return element.dispatchEvent(event);
+}
+function isFocusEventOutside(event, container) {
+ const containerElement = container || event.currentTarget;
+ const relatedTarget = event.relatedTarget;
+ return !relatedTarget || !(0,_chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_1__.contains)(containerElement, relatedTarget);
+}
+function getInputType(event) {
+ const nativeEvent = "nativeEvent" in event ? event.nativeEvent : event;
+ if (!nativeEvent) return;
+ if (!("inputType" in nativeEvent)) return;
+ if (typeof nativeEvent.inputType !== "string") return;
+ return nativeEvent.inputType;
+}
+function queueBeforeEvent(element, type, callback, timeout) {
+ const createTimer = (callback2) => {
+ if (timeout) {
+ const timerId2 = setTimeout(callback2, timeout);
+ return () => clearTimeout(timerId2);
+ }
+ const timerId = requestAnimationFrame(callback2);
+ return () => cancelAnimationFrame(timerId);
+ };
+ const cancelTimer = createTimer(() => {
+ element.removeEventListener(type, callSync, true);
+ callback();
+ });
+ const callSync = () => {
+ cancelTimer();
+ callback();
+ };
+ element.addEventListener(type, callSync, { once: true, capture: true });
+ return cancelTimer;
+}
+function addGlobalEventListener(type, listener, options, scope = window) {
+ const children = [];
+ try {
+ scope.document.addEventListener(type, listener, options);
+ 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) {
+ }
+ for (const remove of children) {
+ remove();
+ }
+ };
+ return removeEventListener;
+}
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/core/esm/utils/focus.js":
+/*!*******************************************************!*\
+ !*** ./node_modules/@ariakit/core/esm/utils/focus.js ***!
+ \*******************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ disableFocus: () => (/* binding */ disableFocus),
+/* harmony export */ disableFocusIn: () => (/* binding */ disableFocusIn),
+/* harmony export */ focusIfNeeded: () => (/* binding */ focusIfNeeded),
+/* harmony export */ focusIntoView: () => (/* binding */ focusIntoView),
+/* harmony export */ getAllFocusable: () => (/* binding */ getAllFocusable),
+/* harmony export */ getAllFocusableIn: () => (/* binding */ getAllFocusableIn),
+/* harmony export */ getAllTabbable: () => (/* binding */ getAllTabbable),
+/* harmony export */ getAllTabbableIn: () => (/* binding */ getAllTabbableIn),
+/* harmony export */ getClosestFocusable: () => (/* binding */ getClosestFocusable),
+/* harmony export */ getFirstFocusable: () => (/* binding */ getFirstFocusable),
+/* harmony export */ getFirstFocusableIn: () => (/* binding */ getFirstFocusableIn),
+/* harmony export */ getFirstTabbable: () => (/* binding */ getFirstTabbable),
+/* harmony export */ getFirstTabbableIn: () => (/* binding */ getFirstTabbableIn),
+/* harmony export */ getLastTabbable: () => (/* binding */ getLastTabbable),
+/* harmony export */ getLastTabbableIn: () => (/* binding */ getLastTabbableIn),
+/* harmony export */ getNextTabbable: () => (/* binding */ getNextTabbable),
+/* harmony export */ getNextTabbableIn: () => (/* binding */ getNextTabbableIn),
+/* harmony export */ getPreviousTabbable: () => (/* binding */ getPreviousTabbable),
+/* harmony export */ getPreviousTabbableIn: () => (/* binding */ getPreviousTabbableIn),
+/* harmony export */ hasFocus: () => (/* binding */ hasFocus),
+/* harmony export */ hasFocusWithin: () => (/* binding */ hasFocusWithin),
+/* harmony export */ isFocusable: () => (/* binding */ isFocusable),
+/* harmony export */ isTabbable: () => (/* binding */ isTabbable),
+/* harmony export */ restoreFocusIn: () => (/* binding */ restoreFocusIn)
+/* harmony export */ });
+/* harmony import */ var _chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../__chunks/37JWRFYW.js */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js");
+/* harmony import */ var _chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../__chunks/3YLGPPWQ.js */ "./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js");
+"use client";
+
+
+
+// src/utils/focus.ts
+var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";
+function hasNegativeTabIndex(element) {
+ const tabIndex = Number.parseInt(element.getAttribute("tabindex") || "0", 10);
+ return tabIndex < 0;
+}
+function isFocusable(element) {
+ if (!element.matches(selector)) return false;
+ if (!(0,_chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.isVisible)(element)) return false;
+ if (element.closest("[inert]")) return false;
+ return true;
+}
+function isTabbable(element) {
+ if (!isFocusable(element)) return false;
+ if (hasNegativeTabIndex(element)) return false;
+ if (!("form" in element)) return true;
+ if (!element.form) return true;
+ if (element.checked) return true;
+ if (element.type !== "radio") return true;
+ const radioGroup = element.form.elements.namedItem(element.name);
+ if (!radioGroup) return true;
+ if (!("length" in radioGroup)) return true;
+ const activeElement = (0,_chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.getActiveElement)(element);
+ if (!activeElement) return true;
+ if (activeElement === element) return true;
+ if (!("form" in activeElement)) return true;
+ if (activeElement.form !== element.form) return true;
+ if (activeElement.name !== element.name) return true;
+ return false;
+}
+function getAllFocusableIn(container, includeContainer) {
+ const elements = Array.from(
+ container.querySelectorAll(selector)
+ );
+ if (includeContainer) {
+ elements.unshift(container);
+ }
+ const focusableElements = elements.filter(isFocusable);
+ focusableElements.forEach((element, i) => {
+ if ((0,_chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.isFrame)(element) && element.contentDocument) {
+ const frameBody = element.contentDocument.body;
+ focusableElements.splice(i, 1, ...getAllFocusableIn(frameBody));
+ }
+ });
+ return focusableElements;
+}
+function getAllFocusable(includeBody) {
+ return getAllFocusableIn(document.body, includeBody);
+}
+function getFirstFocusableIn(container, includeContainer) {
+ const [first] = getAllFocusableIn(container, includeContainer);
+ return first || null;
+}
+function getFirstFocusable(includeBody) {
+ return getFirstFocusableIn(document.body, includeBody);
+}
+function getAllTabbableIn(container, includeContainer, fallbackToFocusable) {
+ const elements = Array.from(
+ container.querySelectorAll(selector)
+ );
+ const tabbableElements = elements.filter(isTabbable);
+ if (includeContainer && isTabbable(container)) {
+ tabbableElements.unshift(container);
+ }
+ tabbableElements.forEach((element, i) => {
+ if ((0,_chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.isFrame)(element) && element.contentDocument) {
+ const frameBody = element.contentDocument.body;
+ const allFrameTabbable = getAllTabbableIn(
+ frameBody,
+ false,
+ fallbackToFocusable
+ );
+ tabbableElements.splice(i, 1, ...allFrameTabbable);
+ }
+ });
+ if (!tabbableElements.length && fallbackToFocusable) {
+ return elements;
+ }
+ return tabbableElements;
+}
+function getAllTabbable(fallbackToFocusable) {
+ return getAllTabbableIn(document.body, false, fallbackToFocusable);
+}
+function getFirstTabbableIn(container, includeContainer, fallbackToFocusable) {
+ const [first] = getAllTabbableIn(
+ container,
+ includeContainer,
+ fallbackToFocusable
+ );
+ return first || null;
+}
+function getFirstTabbable(fallbackToFocusable) {
+ return getFirstTabbableIn(document.body, false, fallbackToFocusable);
+}
+function getLastTabbableIn(container, includeContainer, fallbackToFocusable) {
+ const allTabbable = getAllTabbableIn(
+ container,
+ includeContainer,
+ fallbackToFocusable
+ );
+ return allTabbable[allTabbable.length - 1] || null;
+}
+function getLastTabbable(fallbackToFocusable) {
+ return getLastTabbableIn(document.body, false, fallbackToFocusable);
+}
+function getNextTabbableIn(container, includeContainer, fallbackToFirst, fallbackToFocusable) {
+ const activeElement = (0,_chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.getActiveElement)(container);
+ const allFocusable = getAllFocusableIn(container, includeContainer);
+ const activeIndex = allFocusable.indexOf(activeElement);
+ const nextFocusableElements = allFocusable.slice(activeIndex + 1);
+ return nextFocusableElements.find(isTabbable) || (fallbackToFirst ? allFocusable.find(isTabbable) : null) || (fallbackToFocusable ? nextFocusableElements[0] : null) || null;
+}
+function getNextTabbable(fallbackToFirst, fallbackToFocusable) {
+ return getNextTabbableIn(
+ document.body,
+ false,
+ fallbackToFirst,
+ fallbackToFocusable
+ );
+}
+function getPreviousTabbableIn(container, includeContainer, fallbackToLast, fallbackToFocusable) {
+ const activeElement = (0,_chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.getActiveElement)(container);
+ const allFocusable = getAllFocusableIn(container, includeContainer).reverse();
+ const activeIndex = allFocusable.indexOf(activeElement);
+ const previousFocusableElements = allFocusable.slice(activeIndex + 1);
+ return previousFocusableElements.find(isTabbable) || (fallbackToLast ? allFocusable.find(isTabbable) : null) || (fallbackToFocusable ? previousFocusableElements[0] : null) || null;
+}
+function getPreviousTabbable(fallbackToFirst, fallbackToFocusable) {
+ return getPreviousTabbableIn(
+ document.body,
+ false,
+ fallbackToFirst,
+ fallbackToFocusable
+ );
+}
+function getClosestFocusable(element) {
+ while (element && !isFocusable(element)) {
+ element = element.closest(selector);
+ }
+ return element || null;
+}
+function hasFocus(element) {
+ const activeElement = (0,_chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.getActiveElement)(element);
+ if (!activeElement) return false;
+ if (activeElement === element) return true;
+ const activeDescendant = activeElement.getAttribute("aria-activedescendant");
+ if (!activeDescendant) return false;
+ return activeDescendant === element.id;
+}
+function hasFocusWithin(element) {
+ const activeElement = (0,_chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.getActiveElement)(element);
+ if (!activeElement) return false;
+ if ((0,_chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.contains)(element, activeElement)) return true;
+ const activeDescendant = activeElement.getAttribute("aria-activedescendant");
+ if (!activeDescendant) return false;
+ if (!("id" in element)) return false;
+ if (activeDescendant === element.id) return true;
+ return !!element.querySelector(`#${CSS.escape(activeDescendant)}`);
+}
+function focusIfNeeded(element) {
+ if (!hasFocusWithin(element) && isFocusable(element)) {
+ element.focus();
+ }
+}
+function disableFocus(element) {
+ var _a;
+ const currentTabindex = (_a = element.getAttribute("tabindex")) != null ? _a : "";
+ element.setAttribute("data-tabindex", currentTabindex);
+ element.setAttribute("tabindex", "-1");
+}
+function disableFocusIn(container, includeContainer) {
+ const tabbableElements = getAllTabbableIn(container, includeContainer);
+ for (const element of tabbableElements) {
+ disableFocus(element);
+ }
+}
+function restoreFocusIn(container) {
+ const elements = container.querySelectorAll("[data-tabindex]");
+ const restoreTabIndex = (element) => {
+ const tabindex = element.getAttribute("data-tabindex");
+ element.removeAttribute("data-tabindex");
+ if (tabindex) {
+ element.setAttribute("tabindex", tabindex);
+ } else {
+ element.removeAttribute("tabindex");
+ }
+ };
+ if (container.hasAttribute("data-tabindex")) {
+ restoreTabIndex(container);
+ }
+ for (const element of elements) {
+ restoreTabIndex(element);
+ }
+}
+function focusIntoView(element, options) {
+ if (!("scrollIntoView" in element)) {
+ element.focus();
+ } else {
+ element.focus({ preventScroll: true });
+ element.scrollIntoView((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadValues)({ block: "nearest", inline: "nearest" }, options));
+ }
+}
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/2W3RN7C5.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/2W3RN7C5.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ Command: () => (/* binding */ Command),
+/* harmony export */ useCommand: () => (/* binding */ useCommand)
+/* harmony export */ });
+/* harmony import */ var _OE2EFRVA_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./OE2EFRVA.js */ "./node_modules/@ariakit/react-core/esm/__chunks/OE2EFRVA.js");
+/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
+/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
+/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
+/* harmony import */ var _ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ariakit/core/utils/dom */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js");
+/* harmony import */ var _ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ariakit/core/utils/events */ "./node_modules/@ariakit/core/esm/utils/events.js");
+/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
+/* harmony import */ var _ariakit_core_utils_platform__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ariakit/core/utils/platform */ "./node_modules/@ariakit/core/esm/__chunks/O6E4ZWCP.js");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react */ "react");
+"use client";
+
+
+
+
+
+// src/command/command.tsx
+
+
+
+
+
+var TagName = "button";
+function isNativeClick(event) {
+ if (!event.isTrusted) return false;
+ const element = event.currentTarget;
+ if (event.key === "Enter") {
+ return (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_4__.isButton)(element) || element.tagName === "SUMMARY" || element.tagName === "A";
+ }
+ if (event.key === " ") {
+ return (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_4__.isButton)(element) || element.tagName === "SUMMARY" || element.tagName === "INPUT" || element.tagName === "SELECT";
+ }
+ return false;
+}
+var symbol = Symbol("command");
+var useCommand = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createHook)(
+ function useCommand2(_a) {
+ var _b = _a, { clickOnEnter = true, clickOnSpace = true } = _b, props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__objRest)(_b, ["clickOnEnter", "clickOnSpace"]);
+ const ref = (0,react__WEBPACK_IMPORTED_MODULE_8__.useRef)(null);
+ const [isNativeButton, setIsNativeButton] = (0,react__WEBPACK_IMPORTED_MODULE_8__.useState)(false);
+ (0,react__WEBPACK_IMPORTED_MODULE_8__.useEffect)(() => {
+ if (!ref.current) return;
+ setIsNativeButton((0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_4__.isButton)(ref.current));
+ }, []);
+ const [active, setActive] = (0,react__WEBPACK_IMPORTED_MODULE_8__.useState)(false);
+ const activeRef = (0,react__WEBPACK_IMPORTED_MODULE_8__.useRef)(false);
+ const disabled = (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_6__.disabledFromProps)(props);
+ const [isDuplicate, metadataProps] = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useMetadataProps)(props, symbol, true);
+ const onKeyDownProp = props.onKeyDown;
+ const onKeyDown = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useEvent)((event) => {
+ onKeyDownProp == null ? void 0 : onKeyDownProp(event);
+ const element = event.currentTarget;
+ if (event.defaultPrevented) return;
+ if (isDuplicate) return;
+ if (disabled) return;
+ if (!(0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.isSelfTarget)(event)) return;
+ if ((0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_4__.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 = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__objRest)(_a2, ["view"]);
+ const click = () => (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.fireClickEvent)(element, eventInit);
+ if ((0,_ariakit_core_utils_platform__WEBPACK_IMPORTED_MODULE_7__.isFirefox)()) {
+ (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.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 = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.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 = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__objRest)(_a2, ["view"]);
+ queueMicrotask(() => (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.fireClickEvent)(element, eventInit));
+ }
+ }
+ });
+ props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)({
+ "data-active": active || void 0,
+ type: isNativeButton ? "button" : void 0
+ }, metadataProps), props), {
+ ref: (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useMergeRefs)(ref, props.ref),
+ onKeyDown,
+ onKeyUp
+ });
+ props = (0,_OE2EFRVA_js__WEBPACK_IMPORTED_MODULE_0__.useFocusable)(props);
+ return props;
+ }
+);
+var Command = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function Command2(props) {
+ const htmlProps = useCommand(props);
+ return (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createElement)(TagName, htmlProps);
+});
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ __objRest: () => (/* binding */ __objRest),
+/* harmony export */ __spreadProps: () => (/* binding */ __spreadProps),
+/* harmony export */ __spreadValues: () => (/* binding */ __spreadValues)
+/* harmony export */ });
+"use client";
+var __defProp = Object.defineProperty;
+var __defProps = Object.defineProperties;
+var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
+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 __spreadValues = (a, b) => {
+ for (var prop in b || (b = {}))
+ if (__hasOwnProp.call(b, prop))
+ __defNormalProp(a, prop, b[prop]);
+ if (__getOwnPropSymbols)
+ for (var prop of __getOwnPropSymbols(b)) {
+ if (__propIsEnum.call(b, prop))
+ __defNormalProp(a, prop, b[prop]);
+ }
+ return a;
+};
+var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
+var __objRest = (source, exclude) => {
+ var target = {};
+ for (var prop in source)
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
+ target[prop] = source[prop];
+ if (source != null && __getOwnPropSymbols)
+ for (var prop of __getOwnPropSymbols(source)) {
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
+ target[prop] = source[prop];
+ }
+ return target;
+};
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/5CPL3B7G.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/5CPL3B7G.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ CollectionContextProvider: () => (/* binding */ CollectionContextProvider),
+/* harmony export */ CollectionScopedContextProvider: () => (/* binding */ CollectionScopedContextProvider),
+/* harmony export */ useCollectionContext: () => (/* binding */ useCollectionContext),
+/* harmony export */ useCollectionProviderContext: () => (/* binding */ useCollectionProviderContext),
+/* harmony export */ useCollectionScopedContext: () => (/* binding */ useCollectionScopedContext)
+/* harmony export */ });
+/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
+"use client";
+
+
+// src/collection/collection-context.tsx
+var ctx = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_0__.createStoreContext)();
+var useCollectionContext = ctx.useContext;
+var useCollectionScopedContext = ctx.useScopedContext;
+var useCollectionProviderContext = ctx.useProviderContext;
+var CollectionContextProvider = ctx.ContextProvider;
+var CollectionScopedContextProvider = ctx.ScopedContextProvider;
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+var react__WEBPACK_IMPORTED_MODULE_4___namespace_cache;
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ useAttribute: () => (/* binding */ useAttribute),
+/* harmony export */ useBooleanEvent: () => (/* binding */ useBooleanEvent),
+/* harmony export */ useDeferredValue: () => (/* binding */ useDeferredValue),
+/* harmony export */ useEvent: () => (/* binding */ useEvent),
+/* harmony export */ useForceUpdate: () => (/* binding */ useForceUpdate),
+/* harmony export */ useId: () => (/* binding */ useId),
+/* harmony export */ useInitialValue: () => (/* binding */ useInitialValue),
+/* harmony export */ useIsMouseMoving: () => (/* binding */ useIsMouseMoving),
+/* harmony export */ useLazyValue: () => (/* binding */ useLazyValue),
+/* harmony export */ useLiveRef: () => (/* binding */ useLiveRef),
+/* harmony export */ useMergeRefs: () => (/* binding */ useMergeRefs),
+/* harmony export */ useMetadataProps: () => (/* binding */ useMetadataProps),
+/* harmony export */ usePortalRef: () => (/* binding */ usePortalRef),
+/* harmony export */ usePreviousValue: () => (/* binding */ usePreviousValue),
+/* harmony export */ useSafeLayoutEffect: () => (/* binding */ useSafeLayoutEffect),
+/* harmony export */ useTagName: () => (/* binding */ useTagName),
+/* harmony export */ useTransactionState: () => (/* binding */ useTransactionState),
+/* harmony export */ useUpdateEffect: () => (/* binding */ useUpdateEffect),
+/* harmony export */ useUpdateLayoutEffect: () => (/* binding */ useUpdateLayoutEffect),
+/* harmony export */ useWrapElement: () => (/* binding */ useWrapElement)
+/* harmony export */ });
+/* harmony import */ var _SK3NAZA3_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SK3NAZA3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/SK3NAZA3.js");
+/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
+/* harmony import */ var _ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ariakit/core/utils/dom */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js");
+/* harmony import */ var _ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ariakit/core/utils/events */ "./node_modules/@ariakit/core/esm/utils/events.js");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "react");
+"use client";
+
+
+
+// src/utils/hooks.ts
+
+
+
+
+var _React = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadValues)({}, /*#__PURE__*/ (react__WEBPACK_IMPORTED_MODULE_4___namespace_cache || (react__WEBPACK_IMPORTED_MODULE_4___namespace_cache = __webpack_require__.t(react__WEBPACK_IMPORTED_MODULE_4__, 2))));
+var useReactId = _React.useId;
+var useReactDeferredValue = _React.useDeferredValue;
+var useReactInsertionEffect = _React.useInsertionEffect;
+var useSafeLayoutEffect = _ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_2__.canUseDOM ? react__WEBPACK_IMPORTED_MODULE_4__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_4__.useEffect;
+function useInitialValue(value) {
+ const [initialValue] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(value);
+ return initialValue;
+}
+function useLazyValue(init) {
+ const ref = (0,react__WEBPACK_IMPORTED_MODULE_4__.useRef)();
+ if (ref.current === void 0) {
+ ref.current = init();
+ }
+ return ref.current;
+}
+function useLiveRef(value) {
+ const ref = (0,react__WEBPACK_IMPORTED_MODULE_4__.useRef)(value);
+ useSafeLayoutEffect(() => {
+ ref.current = value;
+ });
+ return ref;
+}
+function usePreviousValue(value) {
+ const [previousValue, setPreviousValue] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(value);
+ if (value !== previousValue) {
+ setPreviousValue(value);
+ }
+ return previousValue;
+}
+function useEvent(callback) {
+ const ref = (0,react__WEBPACK_IMPORTED_MODULE_4__.useRef)(() => {
+ throw new Error("Cannot call an event handler while rendering.");
+ });
+ if (useReactInsertionEffect) {
+ useReactInsertionEffect(() => {
+ ref.current = callback;
+ });
+ } else {
+ ref.current = callback;
+ }
+ return (0,react__WEBPACK_IMPORTED_MODULE_4__.useCallback)((...args) => {
+ var _a;
+ return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args);
+ }, []);
+}
+function useTransactionState(callback) {
+ const [state, setState] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(null);
+ useSafeLayoutEffect(() => {
+ if (state == null) return;
+ if (!callback) return;
+ let prevState = null;
+ callback((prev) => {
+ prevState = prev;
+ return state;
+ });
+ return () => {
+ callback(prevState);
+ };
+ }, [state, callback]);
+ return [state, setState];
+}
+function useMergeRefs(...refs) {
+ return (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(() => {
+ if (!refs.some(Boolean)) return;
+ return (value) => {
+ for (const ref of refs) {
+ (0,_SK3NAZA3_js__WEBPACK_IMPORTED_MODULE_0__.setRef)(ref, value);
+ }
+ };
+ }, refs);
+}
+function useId(defaultId) {
+ if (useReactId) {
+ const reactId = useReactId();
+ if (defaultId) return defaultId;
+ return reactId;
+ }
+ const [id, setId] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(defaultId);
+ useSafeLayoutEffect(() => {
+ if (defaultId || id) return;
+ const random = Math.random().toString(36).slice(2, 8);
+ setId(`id-${random}`);
+ }, [defaultId, id]);
+ return defaultId || id;
+}
+function useDeferredValue(value) {
+ if (useReactDeferredValue) {
+ return useReactDeferredValue(value);
+ }
+ const [deferredValue, setDeferredValue] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(value);
+ (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
+ const raf = requestAnimationFrame(() => setDeferredValue(value));
+ return () => cancelAnimationFrame(raf);
+ }, [value]);
+ return deferredValue;
+}
+function useTagName(refOrElement, type) {
+ const stringOrUndefined = (type2) => {
+ if (typeof type2 !== "string") return;
+ return type2;
+ };
+ const [tagName, setTagName] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(() => stringOrUndefined(type));
+ useSafeLayoutEffect(() => {
+ const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement;
+ setTagName((element == null ? void 0 : element.tagName.toLowerCase()) || stringOrUndefined(type));
+ }, [refOrElement, type]);
+ return tagName;
+}
+function useAttribute(refOrElement, attributeName, defaultValue) {
+ const initialValue = useInitialValue(defaultValue);
+ const [attribute, setAttribute] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(initialValue);
+ (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
+ const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement;
+ if (!element) return;
+ const callback = () => {
+ const value = element.getAttribute(attributeName);
+ setAttribute(value == null ? initialValue : value);
+ };
+ const observer = new MutationObserver(callback);
+ observer.observe(element, { attributeFilter: [attributeName] });
+ callback();
+ return () => observer.disconnect();
+ }, [refOrElement, attributeName, initialValue]);
+ return attribute;
+}
+function useUpdateEffect(effect, deps) {
+ const mounted = (0,react__WEBPACK_IMPORTED_MODULE_4__.useRef)(false);
+ (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
+ if (mounted.current) {
+ return effect();
+ }
+ mounted.current = true;
+ }, deps);
+ (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(
+ () => () => {
+ mounted.current = false;
+ },
+ []
+ );
+}
+function useUpdateLayoutEffect(effect, deps) {
+ const mounted = (0,react__WEBPACK_IMPORTED_MODULE_4__.useRef)(false);
+ useSafeLayoutEffect(() => {
+ if (mounted.current) {
+ return effect();
+ }
+ mounted.current = true;
+ }, deps);
+ useSafeLayoutEffect(
+ () => () => {
+ mounted.current = false;
+ },
+ []
+ );
+}
+function useForceUpdate() {
+ return (0,react__WEBPACK_IMPORTED_MODULE_4__.useReducer)(() => [], []);
+}
+function useBooleanEvent(booleanOrCallback) {
+ return useEvent(
+ typeof booleanOrCallback === "function" ? booleanOrCallback : () => booleanOrCallback
+ );
+}
+function useWrapElement(props, callback, deps = []) {
+ const wrapElement = (0,react__WEBPACK_IMPORTED_MODULE_4__.useCallback)(
+ (element) => {
+ if (props.wrapElement) {
+ element = props.wrapElement(element);
+ }
+ return callback(element);
+ },
+ [...deps, props.wrapElement]
+ );
+ return (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadValues)({}, props), { wrapElement });
+}
+function usePortalRef(portalProp = false, portalRefProp) {
+ const [portalNode, setPortalNode] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(null);
+ const portalRef = useMergeRefs(setPortalNode, portalRefProp);
+ const domReady = !portalProp || portalNode;
+ return { portalRef, portalNode, domReady };
+}
+function useMetadataProps(props, key, value) {
+ const parent = props.onLoadedMetadataCapture;
+ const onLoadedMetadataCapture = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(() => {
+ return Object.assign(() => {
+ }, (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadValues)({}, parent), { [key]: value }));
+ }, [parent, key, value]);
+ return [parent == null ? void 0 : parent[key], { onLoadedMetadataCapture }];
+}
+var hasInstalledGlobalEventListeners = false;
+function useIsMouseMoving() {
+ (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
+ if (hasInstalledGlobalEventListeners) return;
+ (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_3__.addGlobalEventListener)("mousemove", setMouseMoving, true);
+ (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_3__.addGlobalEventListener)("mousedown", resetMouseMoving, true);
+ (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_3__.addGlobalEventListener)("mouseup", resetMouseMoving, true);
+ (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_3__.addGlobalEventListener)("keydown", resetMouseMoving, true);
+ (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_3__.addGlobalEventListener)("scroll", resetMouseMoving, true);
+ hasInstalledGlobalEventListeners = true;
+ }, []);
+ const isMouseMoving = useEvent(() => mouseMoving);
+ return isMouseMoving;
+}
+var mouseMoving = false;
+var previousScreenX = 0;
+var previousScreenY = 0;
+function hasMouseMovement(event) {
+ const movementX = event.movementX || event.screenX - previousScreenX;
+ const movementY = event.movementY || event.screenY - previousScreenY;
+ previousScreenX = event.screenX;
+ previousScreenY = event.screenY;
+ return movementX || movementY || "development" === "test";
+}
+function setMouseMoving(event) {
+ if (!hasMouseMovement(event)) return;
+ mouseMoving = true;
+}
+function resetMouseMoving() {
+ mouseMoving = false;
+}
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/5VQZOHHZ.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/5VQZOHHZ.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ findFirstEnabledItem: () => (/* binding */ findFirstEnabledItem),
+/* harmony export */ flipItems: () => (/* binding */ flipItems),
+/* harmony export */ focusSilently: () => (/* binding */ focusSilently),
+/* harmony export */ getEnabledItem: () => (/* binding */ getEnabledItem),
+/* harmony export */ groupItemsByRows: () => (/* binding */ groupItemsByRows),
+/* harmony export */ isItem: () => (/* binding */ isItem),
+/* harmony export */ selectTextField: () => (/* binding */ selectTextField),
+/* harmony export */ silentlyFocused: () => (/* binding */ silentlyFocused)
+/* harmony export */ });
+/* harmony import */ var _ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ariakit/core/utils/dom */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.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 ((0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isTextField)(element)) {
+ element.setSelectionRange(
+ collapseToEnd ? element.value.length : 0,
+ element.value.length
+ );
+ } else if (element.isContentEditable) {
+ const selection = (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_0__.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;
+}
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/ABN76PSX.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/ABN76PSX.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ DisclosureContextProvider: () => (/* binding */ DisclosureContextProvider),
+/* harmony export */ DisclosureScopedContextProvider: () => (/* binding */ DisclosureScopedContextProvider),
+/* harmony export */ useDisclosureContext: () => (/* binding */ useDisclosureContext),
+/* harmony export */ useDisclosureProviderContext: () => (/* binding */ useDisclosureProviderContext),
+/* harmony export */ useDisclosureScopedContext: () => (/* binding */ useDisclosureScopedContext)
+/* harmony export */ });
+/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
+"use client";
+
+
+// src/disclosure/disclosure-context.tsx
+var ctx = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_0__.createStoreContext)();
+var useDisclosureContext = ctx.useContext;
+var useDisclosureScopedContext = ctx.useScopedContext;
+var useDisclosureProviderContext = ctx.useProviderContext;
+var DisclosureContextProvider = ctx.ContextProvider;
+var DisclosureScopedContextProvider = ctx.ScopedContextProvider;
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/AMMIPFT4.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/AMMIPFT4.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ useCollectionStore: () => (/* binding */ useCollectionStore),
+/* harmony export */ useCollectionStoreProps: () => (/* binding */ useCollectionStoreProps)
+/* harmony export */ });
+/* harmony import */ var _RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./RTNCFSKZ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/RTNCFSKZ.js");
+/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
+/* harmony import */ var _ariakit_core_collection_collection_store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ariakit/core/collection/collection-store */ "./node_modules/@ariakit/core/esm/__chunks/K2KIGYQU.js");
+"use client";
+
+
+
+// src/collection/collection-store.ts
+
+function useCollectionStoreProps(store, update, props) {
+ (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_1__.useUpdateEffect)(update, [props.store]);
+ (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_0__.useStoreProps)(store, props, "items", "setItems");
+ return store;
+}
+function useCollectionStore(props = {}) {
+ const [store, update] = (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_0__.useStore)(_ariakit_core_collection_collection_store__WEBPACK_IMPORTED_MODULE_2__.createCollectionStore, props);
+ return useCollectionStoreProps(store, update, props);
+}
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/APTFW6PT.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/APTFW6PT.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ CompositeContextProvider: () => (/* binding */ CompositeContextProvider),
+/* harmony export */ CompositeItemContext: () => (/* binding */ CompositeItemContext),
+/* harmony export */ CompositeRowContext: () => (/* binding */ CompositeRowContext),
+/* harmony export */ CompositeScopedContextProvider: () => (/* binding */ CompositeScopedContextProvider),
+/* harmony export */ useCompositeContext: () => (/* binding */ useCompositeContext),
+/* harmony export */ useCompositeProviderContext: () => (/* binding */ useCompositeProviderContext),
+/* harmony export */ useCompositeScopedContext: () => (/* binding */ useCompositeScopedContext)
+/* harmony export */ });
+/* harmony import */ var _5CPL3B7G_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./5CPL3B7G.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5CPL3B7G.js");
+/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
+"use client";
+
+
+
+// src/composite/composite-context.tsx
+
+var ctx = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createStoreContext)(
+ [_5CPL3B7G_js__WEBPACK_IMPORTED_MODULE_0__.CollectionContextProvider],
+ [_5CPL3B7G_js__WEBPACK_IMPORTED_MODULE_0__.CollectionScopedContextProvider]
+);
+var useCompositeContext = ctx.useContext;
+var useCompositeScopedContext = ctx.useScopedContext;
+var useCompositeProviderContext = ctx.useProviderContext;
+var CompositeContextProvider = ctx.ContextProvider;
+var CompositeScopedContextProvider = ctx.ScopedContextProvider;
+var CompositeItemContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.createContext)(
+ void 0
+);
+var CompositeRowContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.createContext)(
+ void 0
+);
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/B7UTNDHN.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/B7UTNDHN.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ useCompositeStore: () => (/* binding */ useCompositeStore),
+/* harmony export */ useCompositeStoreOptions: () => (/* binding */ useCompositeStoreOptions),
+/* harmony export */ useCompositeStoreProps: () => (/* binding */ useCompositeStoreProps)
+/* harmony export */ });
+/* harmony import */ var _AMMIPFT4_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AMMIPFT4.js */ "./node_modules/@ariakit/react-core/esm/__chunks/AMMIPFT4.js");
+/* harmony import */ var _RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RTNCFSKZ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/RTNCFSKZ.js");
+/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
+/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
+/* harmony import */ var _ariakit_core_composite_composite_store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ariakit/core/composite/composite-store */ "./node_modules/@ariakit/core/esm/__chunks/C34RJTDU.js");
+"use client";
+
+
+
+
+
+// src/composite/composite-store.ts
+
+function useCompositeStoreOptions(props) {
+ const id = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useId)(props.id);
+ return (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)({ id }, props);
+}
+function useCompositeStoreProps(store, update, props) {
+ store = (0,_AMMIPFT4_js__WEBPACK_IMPORTED_MODULE_0__.useCollectionStoreProps)(store, update, props);
+ (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStoreProps)(store, props, "activeId", "setActiveId");
+ (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStoreProps)(store, props, "includesBaseElement");
+ (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStoreProps)(store, props, "virtualFocus");
+ (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStoreProps)(store, props, "orientation");
+ (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStoreProps)(store, props, "rtl");
+ (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStoreProps)(store, props, "focusLoop");
+ (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStoreProps)(store, props, "focusWrap");
+ (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStoreProps)(store, props, "focusShift");
+ return store;
+}
+function useCompositeStore(props = {}) {
+ props = useCompositeStoreOptions(props);
+ const [store, update] = (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStore)(_ariakit_core_composite_composite_store__WEBPACK_IMPORTED_MODULE_4__.createCompositeStore, props);
+ return useCompositeStoreProps(store, update, props);
+}
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/D7FSM5GC.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/D7FSM5GC.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ ComboboxItem: () => (/* binding */ ComboboxItem),
+/* harmony export */ useComboboxItem: () => (/* binding */ useComboboxItem)
+/* harmony export */ });
+/* harmony import */ var _IABE5EV2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./IABE5EV2.js */ "./node_modules/@ariakit/react-core/esm/__chunks/IABE5EV2.js");
+/* harmony import */ var _SBSPVDDI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SBSPVDDI.js */ "./node_modules/@ariakit/react-core/esm/__chunks/SBSPVDDI.js");
+/* harmony import */ var _OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./OLVWQA7U.js */ "./node_modules/@ariakit/react-core/esm/__chunks/OLVWQA7U.js");
+/* harmony import */ var _RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./RTNCFSKZ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/RTNCFSKZ.js");
+/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
+/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
+/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
+/* harmony import */ var _ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ariakit/core/utils/dom */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js");
+/* harmony import */ var _ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ariakit/core/utils/events */ "./node_modules/@ariakit/core/esm/utils/events.js");
+/* harmony import */ var _ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ariakit/core/utils/focus */ "./node_modules/@ariakit/core/esm/utils/focus.js");
+/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react */ "react");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+"use client";
+
+
+
+
+
+
+
+
+// src/combobox/combobox-item.tsx
+
+
+
+
+
+
+var TagName = "div";
+function isSelected(storeValue, itemValue) {
+ if (itemValue == null) return;
+ if (storeValue == null) return false;
+ if (Array.isArray(storeValue)) {
+ return storeValue.includes(itemValue);
+ }
+ return storeValue === itemValue;
+}
+function getItemRole(popupRole) {
+ var _a;
+ const itemRoleByPopupRole = {
+ menu: "menuitem",
+ listbox: "option",
+ tree: "treeitem"
+ };
+ const key = popupRole;
+ return (_a = itemRoleByPopupRole[key]) != null ? _a : "option";
+}
+var useComboboxItem = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_4__.createHook)(
+ function useComboboxItem2(_a) {
+ var _b = _a, {
+ store,
+ value,
+ hideOnClick,
+ setValueOnClick,
+ selectValueOnClick = true,
+ resetValueOnSelect,
+ focusOnHover = false,
+ moveOnKeyPress = true,
+ getItem: getItemProp
+ } = _b, props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_6__.__objRest)(_b, [
+ "store",
+ "value",
+ "hideOnClick",
+ "setValueOnClick",
+ "selectValueOnClick",
+ "resetValueOnSelect",
+ "focusOnHover",
+ "moveOnKeyPress",
+ "getItem"
+ ]);
+ var _a2;
+ const context = (0,_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_2__.useComboboxScopedContext)();
+ store = store || context;
+ (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_10__.invariant)(
+ store,
+ true && "ComboboxItem must be wrapped in a ComboboxList or ComboboxPopover component."
+ );
+ const { resetValueOnSelectState, multiSelectable, selected } = (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_3__.useStoreStateObject)(store, {
+ resetValueOnSelectState: "resetValueOnSelect",
+ multiSelectable(state) {
+ return Array.isArray(state.selectedValue);
+ },
+ selected(state) {
+ return isSelected(state.selectedValue, value);
+ }
+ });
+ const getItem = (0,react__WEBPACK_IMPORTED_MODULE_11__.useCallback)(
+ (item) => {
+ const nextItem = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_6__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_6__.__spreadValues)({}, item), { value });
+ if (getItemProp) {
+ return getItemProp(nextItem);
+ }
+ return nextItem;
+ },
+ [value, getItemProp]
+ );
+ setValueOnClick = setValueOnClick != null ? setValueOnClick : !multiSelectable;
+ hideOnClick = hideOnClick != null ? hideOnClick : value != null && !multiSelectable;
+ const onClickProp = props.onClick;
+ const setValueOnClickProp = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_5__.useBooleanEvent)(setValueOnClick);
+ const selectValueOnClickProp = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_5__.useBooleanEvent)(selectValueOnClick);
+ const resetValueOnSelectProp = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_5__.useBooleanEvent)(
+ (_a2 = resetValueOnSelect != null ? resetValueOnSelect : resetValueOnSelectState) != null ? _a2 : multiSelectable
+ );
+ const hideOnClickProp = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_5__.useBooleanEvent)(hideOnClick);
+ const onClick = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_5__.useEvent)((event) => {
+ onClickProp == null ? void 0 : onClickProp(event);
+ if (event.defaultPrevented) return;
+ if ((0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.isDownloading)(event)) return;
+ if ((0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.isOpeningInNewTab)(event)) return;
+ if (value != null) {
+ if (selectValueOnClickProp(event)) {
+ if (resetValueOnSelectProp(event)) {
+ store == null ? void 0 : store.resetValue();
+ }
+ store == null ? void 0 : store.setSelectedValue((prevValue) => {
+ if (!Array.isArray(prevValue)) return value;
+ if (prevValue.includes(value)) {
+ return prevValue.filter((v) => v !== value);
+ }
+ return [...prevValue, value];
+ });
+ }
+ if (setValueOnClickProp(event)) {
+ store == null ? void 0 : store.setValue(value);
+ }
+ }
+ if (hideOnClickProp(event)) {
+ store == null ? void 0 : store.hide();
+ }
+ });
+ const onKeyDownProp = props.onKeyDown;
+ const onKeyDown = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_5__.useEvent)((event) => {
+ onKeyDownProp == null ? void 0 : onKeyDownProp(event);
+ if (event.defaultPrevented) return;
+ const baseElement = store == null ? void 0 : store.getState().baseElement;
+ if (!baseElement) return;
+ if ((0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_9__.hasFocus)(baseElement)) return;
+ const printable = event.key.length === 1;
+ if (printable || event.key === "Backspace" || event.key === "Delete") {
+ queueMicrotask(() => baseElement.focus());
+ if ((0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_7__.isTextField)(baseElement)) {
+ store == null ? void 0 : store.setValue(baseElement.value);
+ }
+ }
+ });
+ if (multiSelectable && selected != null) {
+ props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_6__.__spreadValues)({
+ "aria-selected": selected
+ }, props);
+ }
+ props = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_5__.useWrapElement)(
+ props,
+ (element) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_2__.ComboboxItemValueContext.Provider, { value, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_2__.ComboboxItemCheckedContext.Provider, { value: selected != null ? selected : false, children: element }) }),
+ [value, selected]
+ );
+ const popupRole = (0,react__WEBPACK_IMPORTED_MODULE_11__.useContext)(_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_2__.ComboboxListRoleContext);
+ props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_6__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_6__.__spreadValues)({
+ role: getItemRole(popupRole),
+ children: value
+ }, props), {
+ onClick,
+ onKeyDown
+ });
+ const moveOnKeyPressProp = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_5__.useBooleanEvent)(moveOnKeyPress);
+ props = (0,_SBSPVDDI_js__WEBPACK_IMPORTED_MODULE_1__.useCompositeItem)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_6__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_6__.__spreadValues)({
+ store
+ }, props), {
+ getItem,
+ // Dispatch a custom event on the combobox input when moving to an item
+ // with the keyboard so the Combobox component can enable inline
+ // autocompletion.
+ moveOnKeyPress: (event) => {
+ if (!moveOnKeyPressProp(event)) return false;
+ const moveEvent = new Event("combobox-item-move");
+ const baseElement = store == null ? void 0 : store.getState().baseElement;
+ baseElement == null ? void 0 : baseElement.dispatchEvent(moveEvent);
+ return true;
+ }
+ }));
+ props = (0,_IABE5EV2_js__WEBPACK_IMPORTED_MODULE_0__.useCompositeHover)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_6__.__spreadValues)({ store, focusOnHover }, props));
+ return props;
+ }
+);
+var ComboboxItem = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_4__.memo)(
+ (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_4__.forwardRef)(function ComboboxItem2(props) {
+ const htmlProps = useComboboxItem(props);
+ return (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_4__.createElement)(TagName, htmlProps);
+ })
+);
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/HI6DYBVE.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/HI6DYBVE.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ useComboboxStore: () => (/* binding */ useComboboxStore),
+/* harmony export */ useComboboxStoreOptions: () => (/* binding */ useComboboxStoreOptions),
+/* harmony export */ useComboboxStoreProps: () => (/* binding */ useComboboxStoreProps)
+/* harmony export */ });
+/* harmony import */ var _VJQU3YUE_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VJQU3YUE.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VJQU3YUE.js");
+/* harmony import */ var _RUY5BUJG_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RUY5BUJG.js */ "./node_modules/@ariakit/react-core/esm/__chunks/RUY5BUJG.js");
+/* harmony import */ var _B7UTNDHN_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./B7UTNDHN.js */ "./node_modules/@ariakit/react-core/esm/__chunks/B7UTNDHN.js");
+/* harmony import */ var _RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./RTNCFSKZ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/RTNCFSKZ.js");
+/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
+/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
+/* harmony import */ var _ariakit_core_combobox_combobox_store__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ariakit/core/combobox/combobox-store */ "./node_modules/@ariakit/core/esm/combobox/combobox-store.js");
+"use client";
+
+
+
+
+
+
+
+// src/combobox/combobox-store.ts
+
+function useComboboxStoreOptions(props) {
+ const tag = (0,_VJQU3YUE_js__WEBPACK_IMPORTED_MODULE_0__.useTagContext)();
+ props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({}, props), {
+ tag: props.tag !== void 0 ? props.tag : tag
+ });
+ return (0,_B7UTNDHN_js__WEBPACK_IMPORTED_MODULE_2__.useCompositeStoreOptions)(props);
+}
+function useComboboxStoreProps(store, update, props) {
+ (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useUpdateEffect)(update, [props.tag]);
+ (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_3__.useStoreProps)(store, props, "value", "setValue");
+ (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_3__.useStoreProps)(store, props, "selectedValue", "setSelectedValue");
+ (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_3__.useStoreProps)(store, props, "resetValueOnHide");
+ (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_3__.useStoreProps)(store, props, "resetValueOnSelect");
+ return Object.assign(
+ (0,_B7UTNDHN_js__WEBPACK_IMPORTED_MODULE_2__.useCompositeStoreProps)(
+ (0,_RUY5BUJG_js__WEBPACK_IMPORTED_MODULE_1__.usePopoverStoreProps)(store, update, props),
+ update,
+ props
+ ),
+ { tag: props.tag }
+ );
+}
+function useComboboxStore(props = {}) {
+ props = useComboboxStoreOptions(props);
+ const [store, update] = (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_3__.useStore)(_ariakit_core_combobox_combobox_store__WEBPACK_IMPORTED_MODULE_6__.createComboboxStore, props);
+ return useComboboxStoreProps(store, update, props);
+}
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/HMCFFQCB.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/HMCFFQCB.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ PopoverAnchor: () => (/* binding */ PopoverAnchor),
+/* harmony export */ usePopoverAnchor: () => (/* binding */ usePopoverAnchor)
+/* harmony export */ });
+/* harmony import */ var _Y67KZUMI_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Y67KZUMI.js */ "./node_modules/@ariakit/react-core/esm/__chunks/Y67KZUMI.js");
+/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
+/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
+/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
+"use client";
+
+
+
+
+
+// src/popover/popover-anchor.tsx
+var TagName = "div";
+var usePopoverAnchor = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createHook)(
+ function usePopoverAnchor2(_a) {
+ var _b = _a, { store } = _b, props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__objRest)(_b, ["store"]);
+ const context = (0,_Y67KZUMI_js__WEBPACK_IMPORTED_MODULE_0__.usePopoverProviderContext)();
+ store = store || context;
+ props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)({}, props), {
+ ref: (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useMergeRefs)(store == null ? void 0 : store.setAnchorElement, props.ref)
+ });
+ return props;
+ }
+);
+var PopoverAnchor = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function PopoverAnchor2(props) {
+ const htmlProps = usePopoverAnchor(props);
+ return (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createElement)(TagName, htmlProps);
+});
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/IABE5EV2.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/IABE5EV2.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ CompositeHover: () => (/* binding */ CompositeHover),
+/* harmony export */ useCompositeHover: () => (/* binding */ useCompositeHover)
+/* harmony export */ });
+/* harmony import */ var _APTFW6PT_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./APTFW6PT.js */ "./node_modules/@ariakit/react-core/esm/__chunks/APTFW6PT.js");
+/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
+/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
+/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
+/* harmony import */ var _ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ariakit/core/utils/dom */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js");
+/* harmony import */ var _ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ariakit/core/utils/focus */ "./node_modules/@ariakit/core/esm/utils/focus.js");
+/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react */ "react");
+"use client";
+
+
+
+
+
+// src/composite/composite-hover.tsx
+
+
+
+
+var TagName = "div";
+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 (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_4__.contains)(event.currentTarget, nextElement);
+}
+var symbol = Symbol("composite-hover");
+function movingToAnotherItem(event) {
+ let dest = getMouseDestination(event);
+ if (!dest) return false;
+ do {
+ if ((0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_6__.hasOwnProperty)(dest, symbol) && dest[symbol]) return true;
+ dest = dest.parentElement;
+ } while (dest);
+ return false;
+}
+var useCompositeHover = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createHook)(
+ function useCompositeHover2(_a) {
+ var _b = _a, {
+ store,
+ focusOnHover = true,
+ blurOnHoverEnd = !!focusOnHover
+ } = _b, props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__objRest)(_b, [
+ "store",
+ "focusOnHover",
+ "blurOnHoverEnd"
+ ]);
+ const context = (0,_APTFW6PT_js__WEBPACK_IMPORTED_MODULE_0__.useCompositeContext)();
+ store = store || context;
+ (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_6__.invariant)(
+ store,
+ true && "CompositeHover must be wrapped in a Composite component."
+ );
+ const isMouseMoving = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useIsMouseMoving)();
+ const onMouseMoveProp = props.onMouseMove;
+ const focusOnHoverProp = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useBooleanEvent)(focusOnHover);
+ const onMouseMove = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useEvent)((event) => {
+ onMouseMoveProp == null ? void 0 : onMouseMoveProp(event);
+ if (event.defaultPrevented) return;
+ if (!isMouseMoving()) return;
+ if (!focusOnHoverProp(event)) return;
+ if (!(0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_5__.hasFocusWithin)(event.currentTarget)) {
+ const baseElement = store == null ? void 0 : store.getState().baseElement;
+ if (baseElement && !(0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_5__.hasFocus)(baseElement)) {
+ baseElement.focus();
+ }
+ }
+ store == null ? void 0 : store.setActiveId(event.currentTarget.id);
+ });
+ const onMouseLeaveProp = props.onMouseLeave;
+ const blurOnHoverEndProp = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useBooleanEvent)(blurOnHoverEnd);
+ const onMouseLeave = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.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,react__WEBPACK_IMPORTED_MODULE_7__.useCallback)((element) => {
+ if (!element) return;
+ element[symbol] = true;
+ }, []);
+ props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)({}, props), {
+ ref: (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useMergeRefs)(ref, props.ref),
+ onMouseMove,
+ onMouseLeave
+ });
+ return (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_6__.removeUndefinedValues)(props);
+ }
+);
+var CompositeHover = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.memo)(
+ (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function CompositeHover2(props) {
+ const htmlProps = useCompositeHover(props);
+ return (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createElement)(TagName, htmlProps);
+ })
+);
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/K4R5DNTX.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/K4R5DNTX.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ DisclosureContent: () => (/* binding */ DisclosureContent),
+/* harmony export */ isHidden: () => (/* binding */ isHidden),
+/* harmony export */ useDisclosureContent: () => (/* binding */ useDisclosureContent)
+/* harmony export */ });
+/* harmony import */ var _T2AZQXQU_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./T2AZQXQU.js */ "./node_modules/@ariakit/react-core/esm/__chunks/T2AZQXQU.js");
+/* harmony import */ var _ABN76PSX_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ABN76PSX.js */ "./node_modules/@ariakit/react-core/esm/__chunks/ABN76PSX.js");
+/* harmony import */ var _RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./RTNCFSKZ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/RTNCFSKZ.js");
+/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
+/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
+/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
+/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react */ "react");
+/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react-dom */ "react-dom");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+"use client";
+
+
+
+
+
+
+
+// src/disclosure/disclosure-content.tsx
+
+
+
+
+var TagName = "div";
+function afterTimeout(timeoutMs, cb) {
+ const timeoutId = setTimeout(cb, timeoutMs);
+ return () => clearTimeout(timeoutId);
+}
+function afterPaint(cb) {
+ let raf = requestAnimationFrame(() => {
+ raf = requestAnimationFrame(cb);
+ });
+ return () => cancelAnimationFrame(raf);
+}
+function parseCSSTime(...times) {
+ return times.join(", ").split(", ").reduce((longestTime, currentTimeString) => {
+ const multiplier = currentTimeString.endsWith("ms") ? 1 : 1e3;
+ const currentTime = Number.parseFloat(currentTimeString || "0s") * multiplier;
+ if (currentTime > longestTime) return currentTime;
+ return longestTime;
+ }, 0);
+}
+function isHidden(mounted, hidden, alwaysVisible) {
+ return !alwaysVisible && hidden !== false && (!mounted || !!hidden);
+}
+var useDisclosureContent = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__.createHook)(function useDisclosureContent2(_a) {
+ var _b = _a, { store, alwaysVisible } = _b, props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__objRest)(_b, ["store", "alwaysVisible"]);
+ const context = (0,_ABN76PSX_js__WEBPACK_IMPORTED_MODULE_1__.useDisclosureProviderContext)();
+ store = store || context;
+ (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_6__.invariant)(
+ store,
+ true && "DisclosureContent must receive a `store` prop or be wrapped in a DisclosureProvider component."
+ );
+ const ref = (0,react__WEBPACK_IMPORTED_MODULE_7__.useRef)(null);
+ const id = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useId)(props.id);
+ const [transition, setTransition] = (0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(null);
+ const open = store.useState("open");
+ const mounted = store.useState("mounted");
+ const animated = store.useState("animated");
+ const contentElement = store.useState("contentElement");
+ const otherElement = (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_2__.useStoreState)(store.disclosure, "contentElement");
+ (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useSafeLayoutEffect)(() => {
+ if (!ref.current) return;
+ store == null ? void 0 : store.setContentElement(ref.current);
+ }, [store]);
+ (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useSafeLayoutEffect)(() => {
+ let previousAnimated;
+ store == null ? void 0 : store.setState("animated", (animated2) => {
+ previousAnimated = animated2;
+ return true;
+ });
+ return () => {
+ if (previousAnimated === void 0) return;
+ store == null ? void 0 : store.setState("animated", previousAnimated);
+ };
+ }, [store]);
+ (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useSafeLayoutEffect)(() => {
+ if (!animated) return;
+ if (!(contentElement == null ? void 0 : contentElement.isConnected)) {
+ setTransition(null);
+ return;
+ }
+ return afterPaint(() => {
+ setTransition(open ? "enter" : mounted ? "leave" : null);
+ });
+ }, [animated, contentElement, open, mounted]);
+ (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useSafeLayoutEffect)(() => {
+ if (!store) return;
+ if (!animated) return;
+ if (!transition) return;
+ if (!contentElement) return;
+ const stopAnimation = () => store == null ? void 0 : store.setState("animating", false);
+ const stopAnimationSync = () => (0,react_dom__WEBPACK_IMPORTED_MODULE_8__.flushSync)(stopAnimation);
+ if (transition === "leave" && open) return;
+ if (transition === "enter" && !open) return;
+ if (typeof animated === "number") {
+ const timeout2 = animated;
+ return afterTimeout(timeout2, stopAnimationSync);
+ }
+ const {
+ transitionDuration,
+ animationDuration,
+ transitionDelay,
+ animationDelay
+ } = getComputedStyle(contentElement);
+ const {
+ transitionDuration: transitionDuration2 = "0",
+ animationDuration: animationDuration2 = "0",
+ transitionDelay: transitionDelay2 = "0",
+ animationDelay: animationDelay2 = "0"
+ } = otherElement ? getComputedStyle(otherElement) : {};
+ const delay = parseCSSTime(
+ transitionDelay,
+ animationDelay,
+ transitionDelay2,
+ animationDelay2
+ );
+ const duration = parseCSSTime(
+ transitionDuration,
+ animationDuration,
+ transitionDuration2,
+ animationDuration2
+ );
+ const timeout = delay + duration;
+ if (!timeout) {
+ if (transition === "enter") {
+ store.setState("animated", false);
+ }
+ stopAnimation();
+ return;
+ }
+ const frameRate = 1e3 / 60;
+ const maxTimeout = Math.max(timeout - frameRate, 0);
+ return afterTimeout(maxTimeout, stopAnimationSync);
+ }, [store, animated, contentElement, otherElement, open, transition]);
+ props = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useWrapElement)(
+ props,
+ (element) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_T2AZQXQU_js__WEBPACK_IMPORTED_MODULE_0__.DialogScopedContextProvider, { value: store, children: element }),
+ [store]
+ );
+ const hidden = isHidden(mounted, props.hidden, alwaysVisible);
+ const styleProp = props.style;
+ const style = (0,react__WEBPACK_IMPORTED_MODULE_7__.useMemo)(() => {
+ if (hidden) {
+ return (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({}, styleProp), { display: "none" });
+ }
+ return styleProp;
+ }, [hidden, styleProp]);
+ props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({
+ id,
+ "data-open": open || void 0,
+ "data-enter": transition === "enter" || void 0,
+ "data-leave": transition === "leave" || void 0,
+ hidden
+ }, props), {
+ ref: (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useMergeRefs)(id ? store.setContentElement : null, ref, props.ref),
+ style
+ });
+ return (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_6__.removeUndefinedValues)(props);
+});
+var DisclosureContentImpl = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__.forwardRef)(function DisclosureContentImpl2(props) {
+ const htmlProps = useDisclosureContent(props);
+ return (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__.createElement)(TagName, htmlProps);
+});
+var DisclosureContent = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__.forwardRef)(function DisclosureContent2(_a) {
+ var _b = _a, {
+ unmountOnHide
+ } = _b, props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__objRest)(_b, [
+ "unmountOnHide"
+ ]);
+ const context = (0,_ABN76PSX_js__WEBPACK_IMPORTED_MODULE_1__.useDisclosureProviderContext)();
+ const store = props.store || context;
+ const mounted = (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_2__.useStoreState)(
+ store,
+ (state) => !unmountOnHide || (state == null ? void 0 : state.mounted)
+ );
+ if (mounted === false) return null;
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(DisclosureContentImpl, (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({}, props));
+});
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/MNJRSAAC.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/MNJRSAAC.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ ComboboxList: () => (/* binding */ ComboboxList),
+/* harmony export */ useComboboxList: () => (/* binding */ useComboboxList)
+/* harmony export */ });
+/* harmony import */ var _K4R5DNTX_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./K4R5DNTX.js */ "./node_modules/@ariakit/react-core/esm/__chunks/K4R5DNTX.js");
+/* harmony import */ var _OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./OLVWQA7U.js */ "./node_modules/@ariakit/react-core/esm/__chunks/OLVWQA7U.js");
+/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
+/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
+/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
+/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react */ "react");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+"use client";
+
+
+
+
+
+
+// src/combobox/combobox-list.tsx
+
+
+
+var TagName = "div";
+var useComboboxList = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_2__.createHook)(
+ function useComboboxList2(_a) {
+ var _b = _a, { store, alwaysVisible } = _b, props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__objRest)(_b, ["store", "alwaysVisible"]);
+ const scopedContext = (0,_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_1__.useComboboxScopedContext)(true);
+ const context = (0,_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_1__.useComboboxContext)();
+ store = store || context;
+ const scopedContextSameStore = !!store && store === scopedContext;
+ (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_5__.invariant)(
+ store,
+ true && "ComboboxList must receive a `store` prop or be wrapped in a ComboboxProvider component."
+ );
+ const ref = (0,react__WEBPACK_IMPORTED_MODULE_6__.useRef)(null);
+ const id = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_3__.useId)(props.id);
+ const mounted = store.useState("mounted");
+ const hidden = (0,_K4R5DNTX_js__WEBPACK_IMPORTED_MODULE_0__.isHidden)(mounted, props.hidden, alwaysVisible);
+ const style = hidden ? (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__spreadValues)({}, props.style), { display: "none" }) : props.style;
+ const multiSelectable = store.useState(
+ (state) => Array.isArray(state.selectedValue)
+ );
+ const role = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_3__.useAttribute)(ref, "role", props.role);
+ const isCompositeRole = role === "listbox" || role === "tree" || role === "grid";
+ const ariaMultiSelectable = isCompositeRole ? multiSelectable || void 0 : void 0;
+ const [hasListboxInside, setHasListboxInside] = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)(false);
+ const contentElement = store.useState("contentElement");
+ (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_3__.useSafeLayoutEffect)(() => {
+ if (!mounted) return;
+ const element = ref.current;
+ if (!element) return;
+ if (contentElement !== element) return;
+ const callback = () => {
+ setHasListboxInside(!!element.querySelector("[role='listbox']"));
+ };
+ const observer = new MutationObserver(callback);
+ observer.observe(element, {
+ subtree: true,
+ childList: true,
+ attributeFilter: ["role"]
+ });
+ callback();
+ return () => observer.disconnect();
+ }, [mounted, contentElement]);
+ if (!hasListboxInside) {
+ props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__spreadValues)({
+ role: "listbox",
+ "aria-multiselectable": ariaMultiSelectable
+ }, props);
+ }
+ props = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_3__.useWrapElement)(
+ props,
+ (element) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_1__.ComboboxScopedContextProvider, { value: store, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_1__.ComboboxListRoleContext.Provider, { value: role, children: element }) }),
+ [store, role]
+ );
+ const setContentElement = id && (!scopedContext || !scopedContextSameStore) ? store.setContentElement : null;
+ props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__spreadValues)({
+ id,
+ hidden
+ }, props), {
+ ref: (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_3__.useMergeRefs)(setContentElement, ref, props.ref),
+ style
+ });
+ return (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_5__.removeUndefinedValues)(props);
+ }
+);
+var ComboboxList = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(function ComboboxList2(props) {
+ const htmlProps = useComboboxList(props);
+ return (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_2__.createElement)(TagName, htmlProps);
+});
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/NSTBQJLB.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/NSTBQJLB.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ Composite: () => (/* binding */ Composite),
+/* harmony export */ useComposite: () => (/* binding */ useComposite)
+/* harmony export */ });
+/* harmony import */ var _5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./5VQZOHHZ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5VQZOHHZ.js");
+/* harmony import */ var _APTFW6PT_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./APTFW6PT.js */ "./node_modules/@ariakit/react-core/esm/__chunks/APTFW6PT.js");
+/* harmony import */ var _OE2EFRVA_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./OE2EFRVA.js */ "./node_modules/@ariakit/react-core/esm/__chunks/OE2EFRVA.js");
+/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
+/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
+/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
+/* harmony import */ var _ariakit_core_utils_array__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ariakit/core/utils/array */ "./node_modules/@ariakit/core/esm/__chunks/7PRQYBBV.js");
+/* harmony import */ var _ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ariakit/core/utils/dom */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js");
+/* harmony import */ var _ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ariakit/core/utils/events */ "./node_modules/@ariakit/core/esm/utils/events.js");
+/* harmony import */ var _ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ariakit/core/utils/focus */ "./node_modules/@ariakit/core/esm/utils/focus.js");
+/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react */ "react");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+"use client";
+
+
+
+
+
+
+
+// src/composite/composite.tsx
+
+
+
+
+
+
+
+var TagName = "div";
+function isGrid(items) {
+ return items.some((item) => !!item.rowId);
+}
+function isPrintableKey(event) {
+ const target = event.target;
+ if (target && !(0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_7__.isTextField)(target)) return false;
+ 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 useKeyboardEventProxy(store, onKeyboardEvent, previousElementRef) {
+ return (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useEvent)((event) => {
+ var _a;
+ onKeyboardEvent == null ? void 0 : onKeyboardEvent(event);
+ if (event.defaultPrevented) return;
+ if (event.isPropagationStopped()) return;
+ if (!(0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.isSelfTarget)(event)) return;
+ if (isModifierKey(event)) return;
+ if (isPrintableKey(event)) return;
+ const state = store.getState();
+ const activeElement = (_a = (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.getEnabledItem)(store, state.activeId)) == null ? void 0 : _a.element;
+ if (!activeElement) return;
+ const _b = event, { view } = _b, eventInit = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__objRest)(_b, ["view"]);
+ const previousElement = previousElementRef == null ? void 0 : previousElementRef.current;
+ if (activeElement !== previousElement) {
+ activeElement.focus();
+ }
+ if (!(0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.fireKeyboardEvent)(activeElement, event.type, eventInit)) {
+ event.preventDefault();
+ }
+ if (event.currentTarget.contains(activeElement)) {
+ event.stopPropagation();
+ }
+ });
+}
+function findFirstEnabledItemInTheLastRow(items) {
+ return (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.findFirstEnabledItem)(
+ (0,_ariakit_core_utils_array__WEBPACK_IMPORTED_MODULE_6__.flatten2DArray)((0,_ariakit_core_utils_array__WEBPACK_IMPORTED_MODULE_6__.reverseArray)((0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.groupItemsByRows)(items)))
+ );
+}
+function useScheduleFocus(store) {
+ const [scheduled, setScheduled] = (0,react__WEBPACK_IMPORTED_MODULE_11__.useState)(false);
+ const schedule = (0,react__WEBPACK_IMPORTED_MODULE_11__.useCallback)(() => setScheduled(true), []);
+ const activeItem = store.useState(
+ (state) => (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.getEnabledItem)(store, state.activeId)
+ );
+ (0,react__WEBPACK_IMPORTED_MODULE_11__.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 = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__.createHook)(
+ function useComposite2(_a) {
+ var _b = _a, {
+ store,
+ composite = true,
+ focusOnMove = composite,
+ moveOnKeyPress = true
+ } = _b, props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__objRest)(_b, [
+ "store",
+ "composite",
+ "focusOnMove",
+ "moveOnKeyPress"
+ ]);
+ const context = (0,_APTFW6PT_js__WEBPACK_IMPORTED_MODULE_1__.useCompositeProviderContext)();
+ store = store || context;
+ (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_10__.invariant)(
+ store,
+ true && "Composite must receive a `store` prop or be wrapped in a CompositeProvider component."
+ );
+ const ref = (0,react__WEBPACK_IMPORTED_MODULE_11__.useRef)(null);
+ const previousElementRef = (0,react__WEBPACK_IMPORTED_MODULE_11__.useRef)(null);
+ const scheduleFocus = useScheduleFocus(store);
+ const moves = store.useState("moves");
+ const [, setBaseElement] = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useTransactionState)(
+ composite ? store.setBaseElement : null
+ );
+ (0,react__WEBPACK_IMPORTED_MODULE_11__.useEffect)(() => {
+ var _a2;
+ if (!store) return;
+ if (!moves) return;
+ if (!composite) return;
+ if (!focusOnMove) return;
+ const { activeId: activeId2 } = store.getState();
+ const itemElement = (_a2 = (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.getEnabledItem)(store, activeId2)) == null ? void 0 : _a2.element;
+ if (!itemElement) return;
+ (0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_9__.focusIntoView)(itemElement);
+ }, [store, moves, composite, focusOnMove]);
+ (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.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) {
+ (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.fireBlurEvent)(previousElement, { relatedTarget: baseElement });
+ }
+ if (!(0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_9__.hasFocus)(baseElement)) {
+ baseElement.focus();
+ }
+ }, [store, moves, composite]);
+ const activeId = store.useState("activeId");
+ const virtualFocus = store.useState("virtualFocus");
+ (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.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 = (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.getEnabledItem)(store, activeId)) == null ? void 0 : _a2.element;
+ const relatedTarget = activeElement || (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_7__.getActiveElement)(previousElement);
+ if (relatedTarget === previousElement) return;
+ (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.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 = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.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 = (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.silentlyFocused)(event.currentTarget);
+ if ((0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.isSelfTarget)(event) && isSilentlyFocused) {
+ event.stopPropagation();
+ previousElementRef.current = previousActiveElement;
+ }
+ });
+ const onFocusProp = props.onFocus;
+ const onFocus = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.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 ((0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.isSelfTarget)(event) && !(0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.isItem)(store, relatedTarget)) {
+ queueMicrotask(scheduleFocus);
+ }
+ } else if ((0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.isSelfTarget)(event)) {
+ store.setActiveId(null);
+ }
+ });
+ const onBlurCaptureProp = props.onBlurCapture;
+ const onBlurCapture = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.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 = (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.getEnabledItem)(store, activeId2)) == null ? void 0 : _a2.element;
+ const nextActiveElement = event.relatedTarget;
+ const nextActiveElementIsItem = (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.isItem)(store, nextActiveElement);
+ const previousElement = previousElementRef.current;
+ previousElementRef.current = null;
+ if ((0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.isSelfTarget)(event) && nextActiveElementIsItem) {
+ if (nextActiveElement === activeElement) {
+ if (previousElement && previousElement !== nextActiveElement) {
+ (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.fireBlurEvent)(previousElement, event);
+ }
+ } else if (activeElement) {
+ (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.fireBlurEvent)(activeElement, event);
+ } else if (previousElement) {
+ (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.fireBlurEvent)(previousElement, event);
+ }
+ event.stopPropagation();
+ } else {
+ const targetIsItem = (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.isItem)(store, event.target);
+ if (!targetIsItem && activeElement) {
+ (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.fireBlurEvent)(activeElement, event);
+ }
+ }
+ });
+ const onKeyDownProp = props.onKeyDown;
+ const moveOnKeyPressProp = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useBooleanEvent)(moveOnKeyPress);
+ const onKeyDown = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useEvent)((event) => {
+ var _a2;
+ onKeyDownProp == null ? void 0 : onKeyDownProp(event);
+ if (event.nativeEvent.isComposing) return;
+ if (event.defaultPrevented) return;
+ if (!store) return;
+ if (!(0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.isSelfTarget)(event)) return;
+ const { orientation, renderedItems, activeId: activeId2 } = store.getState();
+ const activeItem = (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.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 && (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_7__.isTextField)(event.currentTarget)) return;
+ const up = () => {
+ if (grid) {
+ const item = findFirstEnabledItemInTheLastRow(renderedItems);
+ return item == null ? void 0 : item.id;
+ }
+ return store == null ? void 0 : 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 = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useWrapElement)(
+ props,
+ (element) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_APTFW6PT_js__WEBPACK_IMPORTED_MODULE_1__.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 = (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.getEnabledItem)(store, state.activeId)) == null ? void 0 : _a2.id;
+ });
+ props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({
+ "aria-activedescendant": activeDescendant
+ }, props), {
+ ref: (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useMergeRefs)(ref, setBaseElement, props.ref),
+ onKeyDownCapture,
+ onKeyUpCapture,
+ onFocusCapture,
+ onFocus,
+ onBlurCapture,
+ onKeyDown
+ });
+ const focusable = store.useState(
+ (state) => composite && (state.virtualFocus || state.activeId === null)
+ );
+ props = (0,_OE2EFRVA_js__WEBPACK_IMPORTED_MODULE_2__.useFocusable)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({ focusable }, props));
+ return props;
+ }
+);
+var Composite = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__.forwardRef)(function Composite2(props) {
+ const htmlProps = useComposite(props);
+ return (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__.createElement)(TagName, htmlProps);
+});
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/OE2EFRVA.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/OE2EFRVA.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ Focusable: () => (/* binding */ Focusable),
+/* harmony export */ isSafariFocusAncestor: () => (/* binding */ isSafariFocusAncestor),
+/* harmony export */ useFocusable: () => (/* binding */ useFocusable)
+/* harmony export */ });
+/* harmony import */ var _SWN3JYXT_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SWN3JYXT.js */ "./node_modules/@ariakit/react-core/esm/__chunks/SWN3JYXT.js");
+/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
+/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
+/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
+/* harmony import */ var _ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ariakit/core/utils/dom */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js");
+/* harmony import */ var _ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ariakit/core/utils/events */ "./node_modules/@ariakit/core/esm/utils/events.js");
+/* harmony import */ var _ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ariakit/core/utils/focus */ "./node_modules/@ariakit/core/esm/utils/focus.js");
+/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
+/* harmony import */ var _ariakit_core_utils_platform__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ariakit/core/utils/platform */ "./node_modules/@ariakit/core/esm/__chunks/O6E4ZWCP.js");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react */ "react");
+"use client";
+
+
+
+
+
+// src/focusable/focusable.tsx
+
+
+
+
+
+
+var TagName = "div";
+var isSafariBrowser = (0,_ariakit_core_utils_platform__WEBPACK_IMPORTED_MODULE_8__.isSafari)();
+var alwaysFocusVisibleInputTypes = [
+ "text",
+ "search",
+ "url",
+ "tel",
+ "email",
+ "password",
+ "number",
+ "date",
+ "month",
+ "week",
+ "time",
+ "datetime",
+ "datetime-local"
+];
+var safariFocusAncestorSymbol = Symbol("safariFocusAncestor");
+function isSafariFocusAncestor(element) {
+ if (!element) return false;
+ return !!element[safariFocusAncestorSymbol];
+}
+function markSafariFocusAncestor(element, value) {
+ if (!element) return;
+ element[safariFocusAncestorSymbol] = value;
+}
+function isAlwaysFocusVisible(element) {
+ const { tagName, readOnly, type } = element;
+ if (tagName === "TEXTAREA" && !readOnly) return true;
+ if (tagName === "SELECT" && !readOnly) return true;
+ if (tagName === "INPUT" && !readOnly) {
+ return alwaysFocusVisibleInputTypes.includes(type);
+ }
+ if (element.isContentEditable) return true;
+ const role = element.getAttribute("role");
+ if (role === "combobox" && element.dataset.name) {
+ return true;
+ }
+ return false;
+}
+function getLabels(element) {
+ if ("labels" in element) {
+ return element.labels;
+ }
+ return null;
+}
+function isNativeCheckboxOrRadio(element) {
+ const tagName = element.tagName.toLowerCase();
+ if (tagName === "input" && element.type) {
+ return element.type === "radio" || element.type === "checkbox";
+ }
+ return false;
+}
+function isNativeTabbable(tagName) {
+ if (!tagName) return true;
+ return tagName === "button" || tagName === "summary" || tagName === "input" || tagName === "select" || tagName === "textarea" || tagName === "a";
+}
+function supportsDisabledAttribute(tagName) {
+ if (!tagName) return true;
+ return tagName === "button" || tagName === "input" || tagName === "select" || tagName === "textarea";
+}
+function getTabIndex(focusable, trulyDisabled, nativeTabbable, supportsDisabled, tabIndexProp) {
+ if (!focusable) {
+ return tabIndexProp;
+ }
+ if (trulyDisabled) {
+ if (nativeTabbable && !supportsDisabled) {
+ return -1;
+ }
+ return;
+ }
+ if (nativeTabbable) {
+ return tabIndexProp;
+ }
+ return tabIndexProp || 0;
+}
+function useDisableEvent(onEvent, disabled) {
+ return (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useEvent)((event) => {
+ onEvent == null ? void 0 : onEvent(event);
+ if (event.defaultPrevented) return;
+ if (disabled) {
+ event.stopPropagation();
+ event.preventDefault();
+ }
+ });
+}
+var hasInstalledGlobalEventListeners = false;
+var isKeyboardModality = true;
+function onGlobalMouseDown(event) {
+ const target = event.target;
+ if (target && "hasAttribute" in target) {
+ if (!target.hasAttribute("data-focus-visible")) {
+ isKeyboardModality = false;
+ }
+ }
+}
+function onGlobalKeyDown(event) {
+ if (event.metaKey) return;
+ if (event.ctrlKey) return;
+ if (event.altKey) return;
+ isKeyboardModality = true;
+}
+var useFocusable = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createHook)(
+ function useFocusable2(_a) {
+ var _b = _a, {
+ focusable = true,
+ accessibleWhenDisabled,
+ autoFocus,
+ onFocusVisible
+ } = _b, props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__objRest)(_b, [
+ "focusable",
+ "accessibleWhenDisabled",
+ "autoFocus",
+ "onFocusVisible"
+ ]);
+ const ref = (0,react__WEBPACK_IMPORTED_MODULE_9__.useRef)(null);
+ (0,react__WEBPACK_IMPORTED_MODULE_9__.useEffect)(() => {
+ if (!focusable) return;
+ if (hasInstalledGlobalEventListeners) return;
+ (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.addGlobalEventListener)("mousedown", onGlobalMouseDown, true);
+ (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.addGlobalEventListener)("keydown", onGlobalKeyDown, true);
+ hasInstalledGlobalEventListeners = true;
+ }, [focusable]);
+ if (isSafariBrowser) {
+ (0,react__WEBPACK_IMPORTED_MODULE_9__.useEffect)(() => {
+ if (!focusable) return;
+ const element = ref.current;
+ if (!element) return;
+ if (!isNativeCheckboxOrRadio(element)) return;
+ const labels = getLabels(element);
+ if (!labels) return;
+ const onMouseUp = () => queueMicrotask(() => element.focus());
+ for (const label of labels) {
+ label.addEventListener("mouseup", onMouseUp);
+ }
+ return () => {
+ for (const label of labels) {
+ label.removeEventListener("mouseup", onMouseUp);
+ }
+ };
+ }, [focusable]);
+ }
+ const disabled = focusable && (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_7__.disabledFromProps)(props);
+ const trulyDisabled = !!disabled && !accessibleWhenDisabled;
+ const [focusVisible, setFocusVisible] = (0,react__WEBPACK_IMPORTED_MODULE_9__.useState)(false);
+ (0,react__WEBPACK_IMPORTED_MODULE_9__.useEffect)(() => {
+ if (!focusable) return;
+ if (trulyDisabled && focusVisible) {
+ setFocusVisible(false);
+ }
+ }, [focusable, trulyDisabled, focusVisible]);
+ (0,react__WEBPACK_IMPORTED_MODULE_9__.useEffect)(() => {
+ if (!focusable) return;
+ if (!focusVisible) return;
+ const element = ref.current;
+ if (!element) return;
+ if (typeof IntersectionObserver === "undefined") return;
+ const observer = new IntersectionObserver(() => {
+ if (!(0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_6__.isFocusable)(element)) {
+ setFocusVisible(false);
+ }
+ });
+ observer.observe(element);
+ return () => observer.disconnect();
+ }, [focusable, focusVisible]);
+ const onKeyPressCapture = useDisableEvent(
+ props.onKeyPressCapture,
+ disabled
+ );
+ const onMouseDownCapture = useDisableEvent(
+ props.onMouseDownCapture,
+ disabled
+ );
+ const onClickCapture = useDisableEvent(props.onClickCapture, disabled);
+ const onMouseDownProp = props.onMouseDown;
+ const onMouseDown = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useEvent)((event) => {
+ onMouseDownProp == null ? void 0 : onMouseDownProp(event);
+ if (event.defaultPrevented) return;
+ if (!focusable) return;
+ const element = event.currentTarget;
+ if (!isSafariBrowser) return;
+ if ((0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.isPortalEvent)(event)) return;
+ if (!(0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_4__.isButton)(element) && !isNativeCheckboxOrRadio(element)) return;
+ let receivedFocus = false;
+ const onFocus = () => {
+ receivedFocus = true;
+ };
+ const options = { capture: true, once: true };
+ element.addEventListener("focusin", onFocus, options);
+ const focusableContainer = (0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_6__.getClosestFocusable)(element.parentElement);
+ markSafariFocusAncestor(focusableContainer, true);
+ (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.queueBeforeEvent)(element, "mouseup", () => {
+ element.removeEventListener("focusin", onFocus, true);
+ markSafariFocusAncestor(focusableContainer, false);
+ if (receivedFocus) return;
+ (0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_6__.focusIfNeeded)(element);
+ });
+ });
+ const handleFocusVisible = (event, currentTarget) => {
+ if (currentTarget) {
+ event.currentTarget = currentTarget;
+ }
+ if (!focusable) return;
+ const element = event.currentTarget;
+ if (!element) return;
+ if (!(0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_6__.hasFocus)(element)) return;
+ onFocusVisible == null ? void 0 : onFocusVisible(event);
+ if (event.defaultPrevented) return;
+ element.dataset.focusVisible = "true";
+ setFocusVisible(true);
+ };
+ const onKeyDownCaptureProp = props.onKeyDownCapture;
+ const onKeyDownCapture = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useEvent)((event) => {
+ onKeyDownCaptureProp == null ? void 0 : onKeyDownCaptureProp(event);
+ if (event.defaultPrevented) return;
+ if (!focusable) return;
+ if (focusVisible) return;
+ if (event.metaKey) return;
+ if (event.altKey) return;
+ if (event.ctrlKey) return;
+ if (!(0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.isSelfTarget)(event)) return;
+ const element = event.currentTarget;
+ const applyFocusVisible = () => handleFocusVisible(event, element);
+ (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.queueBeforeEvent)(element, "focusout", applyFocusVisible);
+ });
+ const onFocusCaptureProp = props.onFocusCapture;
+ const onFocusCapture = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useEvent)((event) => {
+ onFocusCaptureProp == null ? void 0 : onFocusCaptureProp(event);
+ if (event.defaultPrevented) return;
+ if (!focusable) return;
+ if (!(0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.isSelfTarget)(event)) {
+ setFocusVisible(false);
+ return;
+ }
+ const element = event.currentTarget;
+ const applyFocusVisible = () => handleFocusVisible(event, element);
+ if (isKeyboardModality || isAlwaysFocusVisible(event.target)) {
+ (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.queueBeforeEvent)(event.target, "focusout", applyFocusVisible);
+ } else {
+ setFocusVisible(false);
+ }
+ });
+ const onBlurProp = props.onBlur;
+ const onBlur = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useEvent)((event) => {
+ onBlurProp == null ? void 0 : onBlurProp(event);
+ if (!focusable) return;
+ if (!(0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.isFocusEventOutside)(event)) return;
+ event.currentTarget.removeAttribute("data-focus-visible");
+ setFocusVisible(false);
+ });
+ const autoFocusOnShow = (0,react__WEBPACK_IMPORTED_MODULE_9__.useContext)(_SWN3JYXT_js__WEBPACK_IMPORTED_MODULE_0__.FocusableContext);
+ const autoFocusRef = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useEvent)((element) => {
+ if (!focusable) return;
+ if (!autoFocus) return;
+ if (!element) return;
+ if (!autoFocusOnShow) return;
+ queueMicrotask(() => {
+ if ((0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_6__.hasFocus)(element)) return;
+ if (!(0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_6__.isFocusable)(element)) return;
+ element.focus();
+ });
+ });
+ const tagName = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useTagName)(ref);
+ const nativeTabbable = focusable && isNativeTabbable(tagName);
+ const supportsDisabled = focusable && supportsDisabledAttribute(tagName);
+ const styleProp = props.style;
+ const style = (0,react__WEBPACK_IMPORTED_MODULE_9__.useMemo)(() => {
+ if (trulyDisabled) {
+ return (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)({ pointerEvents: "none" }, styleProp);
+ }
+ return styleProp;
+ }, [trulyDisabled, styleProp]);
+ props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)({
+ "data-focus-visible": focusable && focusVisible || void 0,
+ "data-autofocus": autoFocus || void 0,
+ "aria-disabled": disabled || void 0
+ }, props), {
+ ref: (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useMergeRefs)(ref, autoFocusRef, props.ref),
+ style,
+ tabIndex: getTabIndex(
+ focusable,
+ trulyDisabled,
+ nativeTabbable,
+ supportsDisabled,
+ props.tabIndex
+ ),
+ disabled: supportsDisabled && trulyDisabled ? true : void 0,
+ // TODO: Test Focusable contentEditable.
+ contentEditable: disabled ? void 0 : props.contentEditable,
+ onKeyPressCapture,
+ onClickCapture,
+ onMouseDownCapture,
+ onMouseDown,
+ onKeyDownCapture,
+ onFocusCapture,
+ onBlur
+ });
+ return (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_7__.removeUndefinedValues)(props);
+ }
+);
+var Focusable = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function Focusable2(props) {
+ const htmlProps = useFocusable(props);
+ return (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createElement)(TagName, htmlProps);
+});
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/OLVWQA7U.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/OLVWQA7U.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ ComboboxContextProvider: () => (/* binding */ ComboboxContextProvider),
+/* harmony export */ ComboboxItemCheckedContext: () => (/* binding */ ComboboxItemCheckedContext),
+/* harmony export */ ComboboxItemValueContext: () => (/* binding */ ComboboxItemValueContext),
+/* harmony export */ ComboboxListRoleContext: () => (/* binding */ ComboboxListRoleContext),
+/* harmony export */ ComboboxScopedContextProvider: () => (/* binding */ ComboboxScopedContextProvider),
+/* harmony export */ useComboboxContext: () => (/* binding */ useComboboxContext),
+/* harmony export */ useComboboxProviderContext: () => (/* binding */ useComboboxProviderContext),
+/* harmony export */ useComboboxScopedContext: () => (/* binding */ useComboboxScopedContext)
+/* harmony export */ });
+/* harmony import */ var _Y67KZUMI_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Y67KZUMI.js */ "./node_modules/@ariakit/react-core/esm/__chunks/Y67KZUMI.js");
+/* harmony import */ var _APTFW6PT_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./APTFW6PT.js */ "./node_modules/@ariakit/react-core/esm/__chunks/APTFW6PT.js");
+/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "react");
+"use client";
+
+
+
+
+// src/combobox/combobox-context.tsx
+
+var ComboboxListRoleContext = (0,react__WEBPACK_IMPORTED_MODULE_3__.createContext)(
+ void 0
+);
+var ctx = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_2__.createStoreContext)(
+ [_Y67KZUMI_js__WEBPACK_IMPORTED_MODULE_0__.PopoverContextProvider, _APTFW6PT_js__WEBPACK_IMPORTED_MODULE_1__.CompositeContextProvider],
+ [_Y67KZUMI_js__WEBPACK_IMPORTED_MODULE_0__.PopoverScopedContextProvider, _APTFW6PT_js__WEBPACK_IMPORTED_MODULE_1__.CompositeScopedContextProvider]
+);
+var useComboboxContext = ctx.useContext;
+var useComboboxScopedContext = ctx.useScopedContext;
+var useComboboxProviderContext = ctx.useProviderContext;
+var ComboboxContextProvider = ctx.ContextProvider;
+var ComboboxScopedContextProvider = ctx.ScopedContextProvider;
+var ComboboxItemValueContext = (0,react__WEBPACK_IMPORTED_MODULE_3__.createContext)(
+ void 0
+);
+var ComboboxItemCheckedContext = (0,react__WEBPACK_IMPORTED_MODULE_3__.createContext)(false);
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/RTNCFSKZ.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/RTNCFSKZ.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ useStore: () => (/* binding */ useStore),
+/* harmony export */ useStoreProps: () => (/* binding */ useStoreProps),
+/* harmony export */ useStoreState: () => (/* binding */ useStoreState),
+/* harmony export */ useStoreStateObject: () => (/* binding */ useStoreStateObject)
+/* harmony export */ });
+/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
+/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
+/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
+/* harmony import */ var _ariakit_core_utils_store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ariakit/core/utils/store */ "./node_modules/@ariakit/core/esm/__chunks/EWA2WL6G.js");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "react");
+/* harmony import */ var use_sync_external_store_shim_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! use-sync-external-store/shim/index.js */ "./node_modules/use-sync-external-store/shim/index.js");
+"use client";
+
+
+
+// src/utils/store.tsx
+
+
+
+
+var { useSyncExternalStore } = use_sync_external_store_shim_index_js__WEBPACK_IMPORTED_MODULE_5__;
+var noopSubscribe = () => () => {
+};
+function useStoreState(store, keyOrSelector = _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_2__.identity) {
+ const storeSubscribe = react__WEBPACK_IMPORTED_MODULE_4__.useCallback(
+ (callback) => {
+ if (!store) return noopSubscribe();
+ return (0,_ariakit_core_utils_store__WEBPACK_IMPORTED_MODULE_3__.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 (!(0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_2__.hasOwnProperty)(state, key)) return;
+ return state[key];
+ };
+ return useSyncExternalStore(storeSubscribe, getSnapshot, getSnapshot);
+}
+function useStoreStateObject(store, object) {
+ const objRef = react__WEBPACK_IMPORTED_MODULE_4__.useRef(
+ {}
+ );
+ const storeSubscribe = react__WEBPACK_IMPORTED_MODULE_4__.useCallback(
+ (callback) => {
+ if (!store) return noopSubscribe();
+ return (0,_ariakit_core_utils_store__WEBPACK_IMPORTED_MODULE_3__.subscribe)(store, null, callback);
+ },
+ [store]
+ );
+ const getSnapshot = () => {
+ const state = store == null ? void 0 : store.getState();
+ let updated = false;
+ const obj = objRef.current;
+ for (const prop in object) {
+ const keyOrSelector = object[prop];
+ if (typeof keyOrSelector === "function") {
+ const value = keyOrSelector(state);
+ if (value !== obj[prop]) {
+ obj[prop] = value;
+ updated = true;
+ }
+ }
+ if (typeof keyOrSelector === "string") {
+ if (!state) continue;
+ if (!(0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_2__.hasOwnProperty)(state, keyOrSelector)) continue;
+ const value = state[keyOrSelector];
+ if (value !== obj[prop]) {
+ obj[prop] = value;
+ updated = true;
+ }
+ }
+ }
+ if (updated) {
+ objRef.current = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadValues)({}, obj);
+ }
+ return objRef.current;
+ };
+ return useSyncExternalStore(storeSubscribe, getSnapshot, getSnapshot);
+}
+function useStoreProps(store, props, key, setKey) {
+ const value = (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_2__.hasOwnProperty)(props, key) ? props[key] : void 0;
+ const setValue = setKey ? props[setKey] : void 0;
+ const propsRef = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_0__.useLiveRef)({ value, setValue });
+ (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_0__.useSafeLayoutEffect)(() => {
+ return (0,_ariakit_core_utils_store__WEBPACK_IMPORTED_MODULE_3__.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]);
+ (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_0__.useSafeLayoutEffect)(() => {
+ if (value === void 0) return;
+ store.setState(key, value);
+ return (0,_ariakit_core_utils_store__WEBPACK_IMPORTED_MODULE_3__.batch)(store, [key], () => {
+ if (value === void 0) return;
+ store.setState(key, value);
+ });
+ });
+}
+function useStore(createStore, props) {
+ const [store, setStore] = react__WEBPACK_IMPORTED_MODULE_4__.useState(() => createStore(props));
+ (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_0__.useSafeLayoutEffect)(() => (0,_ariakit_core_utils_store__WEBPACK_IMPORTED_MODULE_3__.init)(store), [store]);
+ const useState2 = react__WEBPACK_IMPORTED_MODULE_4__.useCallback(
+ (keyOrSelector) => useStoreState(store, keyOrSelector),
+ [store]
+ );
+ const memoizedStore = react__WEBPACK_IMPORTED_MODULE_4__.useMemo(
+ () => (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadValues)({}, store), { useState: useState2 }),
+ [store, useState2]
+ );
+ const updateStore = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_0__.useEvent)(() => {
+ setStore((store2) => createStore((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadValues)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadValues)({}, props), store2.getState())));
+ });
+ return [memoizedStore, updateStore];
+}
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/RUY5BUJG.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/RUY5BUJG.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ usePopoverStore: () => (/* binding */ usePopoverStore),
+/* harmony export */ usePopoverStoreProps: () => (/* binding */ usePopoverStoreProps)
+/* harmony export */ });
+/* harmony import */ var _Y2U4BRIM_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Y2U4BRIM.js */ "./node_modules/@ariakit/react-core/esm/__chunks/Y2U4BRIM.js");
+/* harmony import */ var _RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RTNCFSKZ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/RTNCFSKZ.js");
+/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
+/* harmony import */ var _ariakit_core_popover_popover_store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ariakit/core/popover/popover-store */ "./node_modules/@ariakit/core/esm/__chunks/MD3RIO2T.js");
+"use client";
+
+
+
+
+// src/popover/popover-store.ts
+
+function usePopoverStoreProps(store, update, props) {
+ (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useUpdateEffect)(update, [props.popover]);
+ (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStoreProps)(store, props, "placement");
+ return (0,_Y2U4BRIM_js__WEBPACK_IMPORTED_MODULE_0__.useDialogStoreProps)(store, update, props);
+}
+function usePopoverStore(props = {}) {
+ const [store, update] = (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStore)(_ariakit_core_popover_popover_store__WEBPACK_IMPORTED_MODULE_3__.createPopoverStore, props);
+ return usePopoverStoreProps(store, update, props);
+}
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/SBSPVDDI.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/SBSPVDDI.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ CompositeItem: () => (/* binding */ CompositeItem),
+/* harmony export */ useCompositeItem: () => (/* binding */ useCompositeItem)
+/* harmony export */ });
+/* harmony import */ var _5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./5VQZOHHZ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5VQZOHHZ.js");
+/* harmony import */ var _Y62RTBST_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Y62RTBST.js */ "./node_modules/@ariakit/react-core/esm/__chunks/Y62RTBST.js");
+/* harmony import */ var _APTFW6PT_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./APTFW6PT.js */ "./node_modules/@ariakit/react-core/esm/__chunks/APTFW6PT.js");
+/* harmony import */ var _2W3RN7C5_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./2W3RN7C5.js */ "./node_modules/@ariakit/react-core/esm/__chunks/2W3RN7C5.js");
+/* harmony import */ var _RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./RTNCFSKZ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/RTNCFSKZ.js");
+/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
+/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
+/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
+/* harmony import */ var _ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ariakit/core/utils/dom */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js");
+/* harmony import */ var _ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ariakit/core/utils/events */ "./node_modules/@ariakit/core/esm/utils/events.js");
+/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
+/* harmony import */ var _ariakit_core_utils_platform__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ariakit/core/utils/platform */ "./node_modules/@ariakit/core/esm/__chunks/O6E4ZWCP.js");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react */ "react");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+"use client";
+
+
+
+
+
+
+
+
+
+// src/composite/composite-item.tsx
+
+
+
+
+
+
+var TagName = "button";
+function isEditableElement(element) {
+ if ((0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_8__.isTextbox)(element)) return true;
+ return element.tagName === "INPUT" && !(0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_8__.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 = (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_8__.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 = (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.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 ((0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_9__.isSelfTarget)(event)) return false;
+ return (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.isItem)(store, event.target);
+}
+var useCompositeItem = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_5__.createHook)(
+ function useCompositeItem2(_a) {
+ var _b = _a, {
+ store,
+ rowId: rowIdProp,
+ preventScrollOnKeyDown = false,
+ moveOnKeyPress = true,
+ tabbable = false,
+ getItem: getItemProp,
+ "aria-setsize": ariaSetSizeProp,
+ "aria-posinset": ariaPosInSetProp
+ } = _b, props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_7__.__objRest)(_b, [
+ "store",
+ "rowId",
+ "preventScrollOnKeyDown",
+ "moveOnKeyPress",
+ "tabbable",
+ "getItem",
+ "aria-setsize",
+ "aria-posinset"
+ ]);
+ const context = (0,_APTFW6PT_js__WEBPACK_IMPORTED_MODULE_2__.useCompositeContext)();
+ store = store || context;
+ const id = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_6__.useId)(props.id);
+ const ref = (0,react__WEBPACK_IMPORTED_MODULE_12__.useRef)(null);
+ const row = (0,react__WEBPACK_IMPORTED_MODULE_12__.useContext)(_APTFW6PT_js__WEBPACK_IMPORTED_MODULE_2__.CompositeRowContext);
+ const disabled = (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_10__.disabledFromProps)(props);
+ const trulyDisabled = disabled && !props.accessibleWhenDisabled;
+ const {
+ rowId,
+ baseElement,
+ isActiveItem,
+ ariaSetSize,
+ ariaPosInSet,
+ isTabbable
+ } = (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_4__.useStoreStateObject)(store, {
+ rowId(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;
+ },
+ baseElement(state) {
+ return (state == null ? void 0 : state.baseElement) || void 0;
+ },
+ isActiveItem(state) {
+ return !!state && state.activeId === id;
+ },
+ ariaSetSize(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;
+ },
+ ariaPosInSet(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);
+ },
+ isTabbable(state) {
+ if (!(state == null ? void 0 : state.renderedItems.length)) return true;
+ if (state.virtualFocus) return false;
+ if (tabbable) return true;
+ if (state.activeId === null) return false;
+ const item = store == null ? void 0 : store.item(state.activeId);
+ if (item == null ? void 0 : item.disabled) return true;
+ if (!(item == null ? void 0 : item.element)) return true;
+ return state.activeId === id;
+ }
+ });
+ const getItem = (0,react__WEBPACK_IMPORTED_MODULE_12__.useCallback)(
+ (item) => {
+ var _a2;
+ const nextItem = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_7__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_7__.__spreadValues)({}, item), {
+ id: id || item.id,
+ rowId,
+ disabled: !!trulyDisabled,
+ children: (_a2 = item.element) == null ? void 0 : _a2.textContent
+ });
+ if (getItemProp) {
+ return getItemProp(nextItem);
+ }
+ return nextItem;
+ },
+ [id, rowId, trulyDisabled, getItemProp]
+ );
+ const onFocusProp = props.onFocus;
+ const hasFocusedComposite = (0,react__WEBPACK_IMPORTED_MODULE_12__.useRef)(false);
+ const onFocus = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_6__.useEvent)((event) => {
+ onFocusProp == null ? void 0 : onFocusProp(event);
+ if (event.defaultPrevented) return;
+ if ((0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_9__.isPortalEvent)(event)) return;
+ if (!id) return;
+ if (!store) return;
+ if (targetIsAnotherItem(event, store)) return;
+ const { virtualFocus, baseElement: baseElement2 } = store.getState();
+ store.setActiveId(id);
+ if ((0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_8__.isTextbox)(event.currentTarget)) {
+ (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.selectTextField)(event.currentTarget);
+ }
+ if (!virtualFocus) return;
+ if (!(0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_9__.isSelfTarget)(event)) return;
+ if (isEditableElement(event.currentTarget)) return;
+ if (!(baseElement2 == null ? void 0 : baseElement2.isConnected)) return;
+ if ((0,_ariakit_core_utils_platform__WEBPACK_IMPORTED_MODULE_11__.isSafari)() && event.currentTarget.hasAttribute("data-autofocus")) {
+ event.currentTarget.scrollIntoView({
+ block: "nearest",
+ inline: "nearest"
+ });
+ }
+ hasFocusedComposite.current = true;
+ const fromComposite = event.relatedTarget === baseElement2 || (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.isItem)(store, event.relatedTarget);
+ if (fromComposite) {
+ (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.focusSilently)(baseElement2);
+ } else {
+ baseElement2.focus();
+ }
+ });
+ const onBlurCaptureProp = props.onBlurCapture;
+ const onBlurCapture = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_6__.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 = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_6__.useBooleanEvent)(preventScrollOnKeyDown);
+ const moveOnKeyPressProp = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_6__.useBooleanEvent)(moveOnKeyPress);
+ const onKeyDown = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_6__.useEvent)((event) => {
+ onKeyDownProp == null ? void 0 : onKeyDownProp(event);
+ if (event.defaultPrevented) return;
+ if (!(0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_9__.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 (!(0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_8__.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) {
+ if ((0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_8__.isTextbox)(currentTarget)) {
+ const selection = (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_8__.getTextboxSelection)(currentTarget);
+ const isLeft = isHorizontal && event.key === "ArrowLeft";
+ const isRight = isHorizontal && event.key === "ArrowRight";
+ const isUp = isVertical && event.key === "ArrowUp";
+ const isDown = isVertical && event.key === "ArrowDown";
+ if (isRight || isDown) {
+ const { length: valueLength } = (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_8__.getTextboxValue)(currentTarget);
+ if (selection.end !== valueLength) return;
+ } else if ((isLeft || isUp) && selection.start !== 0) return;
+ }
+ const nextId = action();
+ if (preventScrollOnKeyDownProp(event) || nextId !== void 0) {
+ if (!moveOnKeyPressProp(event)) return;
+ event.preventDefault();
+ store.move(nextId);
+ }
+ }
+ });
+ const providerValue = (0,react__WEBPACK_IMPORTED_MODULE_12__.useMemo)(
+ () => ({ id, baseElement }),
+ [id, baseElement]
+ );
+ props = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_6__.useWrapElement)(
+ props,
+ (element) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_APTFW6PT_js__WEBPACK_IMPORTED_MODULE_2__.CompositeItemContext.Provider, { value: providerValue, children: element }),
+ [providerValue]
+ );
+ props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_7__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_7__.__spreadValues)({
+ id,
+ "data-active-item": isActiveItem || void 0
+ }, props), {
+ ref: (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_6__.useMergeRefs)(ref, props.ref),
+ tabIndex: isTabbable ? props.tabIndex : -1,
+ onFocus,
+ onBlurCapture,
+ onKeyDown
+ });
+ props = (0,_2W3RN7C5_js__WEBPACK_IMPORTED_MODULE_3__.useCommand)(props);
+ props = (0,_Y62RTBST_js__WEBPACK_IMPORTED_MODULE_1__.useCollectionItem)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_7__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_7__.__spreadValues)({
+ store
+ }, props), {
+ getItem,
+ shouldRegisterItem: id ? props.shouldRegisterItem : false
+ }));
+ return (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_10__.removeUndefinedValues)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_7__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_7__.__spreadValues)({}, props), {
+ "aria-setsize": ariaSetSize,
+ "aria-posinset": ariaPosInSet
+ }));
+ }
+);
+var CompositeItem = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_5__.memo)(
+ (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_5__.forwardRef)(function CompositeItem2(props) {
+ const htmlProps = useCompositeItem(props);
+ return (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_5__.createElement)(TagName, htmlProps);
+ })
+);
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/SK3NAZA3.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/SK3NAZA3.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ getRefProperty: () => (/* binding */ getRefProperty),
+/* harmony export */ isValidElementWithRef: () => (/* binding */ isValidElementWithRef),
+/* harmony export */ mergeProps: () => (/* binding */ mergeProps),
+/* harmony export */ setRef: () => (/* binding */ setRef)
+/* harmony export */ });
+/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
+/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
+"use client";
+
+
+// src/utils/misc.ts
+
+
+function setRef(ref, value) {
+ if (typeof ref === "function") {
+ ref(value);
+ } else if (ref) {
+ ref.current = value;
+ }
+}
+function isValidElementWithRef(element) {
+ if (!element) return false;
+ if (!(0,react__WEBPACK_IMPORTED_MODULE_2__.isValidElement)(element)) return false;
+ if ("ref" in element.props) return true;
+ if ("ref" in element) return true;
+ return false;
+}
+function getRefProperty(element) {
+ if (!isValidElementWithRef(element)) return null;
+ const props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_0__.__spreadValues)({}, element.props);
+ return props.ref || element.ref;
+}
+function mergeProps(base, overrides) {
+ const props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_0__.__spreadValues)({}, base);
+ for (const key in overrides) {
+ if (!(0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_1__.hasOwnProperty)(overrides, key)) continue;
+ if (key === "className") {
+ const prop = "className";
+ props[prop] = base[prop] ? `${base[prop]} ${overrides[prop]}` : overrides[prop];
+ continue;
+ }
+ if (key === "style") {
+ const prop = "style";
+ props[prop] = base[prop] ? (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_0__.__spreadValues)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_0__.__spreadValues)({}, base[prop]), overrides[prop]) : overrides[prop];
+ continue;
+ }
+ const overrideValue = overrides[key];
+ if (typeof overrideValue === "function" && key.startsWith("on")) {
+ const baseValue = base[key];
+ if (typeof baseValue === "function") {
+ props[key] = (...args) => {
+ overrideValue(...args);
+ baseValue(...args);
+ };
+ continue;
+ }
+ }
+ props[key] = overrideValue;
+ }
+ return props;
+}
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/SWN3JYXT.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/SWN3JYXT.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ FocusableContext: () => (/* binding */ FocusableContext)
+/* harmony export */ });
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
+"use client";
+
+// src/focusable/focusable-context.tsx
+
+var FocusableContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(true);
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/T22PY7TE.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/T22PY7TE.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ useDisclosureStore: () => (/* binding */ useDisclosureStore),
+/* harmony export */ useDisclosureStoreProps: () => (/* binding */ useDisclosureStoreProps)
+/* harmony export */ });
+/* harmony import */ var _RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./RTNCFSKZ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/RTNCFSKZ.js");
+/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
+/* harmony import */ var _ariakit_core_disclosure_disclosure_store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ariakit/core/disclosure/disclosure-store */ "./node_modules/@ariakit/core/esm/__chunks/43IPP2F4.js");
+"use client";
+
+
+
+// src/disclosure/disclosure-store.ts
+
+function useDisclosureStoreProps(store, update, props) {
+ (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_1__.useUpdateEffect)(update, [props.store, props.disclosure]);
+ (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_0__.useStoreProps)(store, props, "open", "setOpen");
+ (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_0__.useStoreProps)(store, props, "mounted", "setMounted");
+ (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_0__.useStoreProps)(store, props, "animated");
+ return Object.assign(store, { disclosure: props.disclosure });
+}
+function useDisclosureStore(props = {}) {
+ const [store, update] = (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_0__.useStore)(_ariakit_core_disclosure_disclosure_store__WEBPACK_IMPORTED_MODULE_2__.createDisclosureStore, props);
+ return useDisclosureStoreProps(store, update, props);
+}
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/T2AZQXQU.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/T2AZQXQU.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ DialogContextProvider: () => (/* binding */ DialogContextProvider),
+/* harmony export */ DialogDescriptionContext: () => (/* binding */ DialogDescriptionContext),
+/* harmony export */ DialogHeadingContext: () => (/* binding */ DialogHeadingContext),
+/* harmony export */ DialogScopedContextProvider: () => (/* binding */ DialogScopedContextProvider),
+/* harmony export */ useDialogContext: () => (/* binding */ useDialogContext),
+/* harmony export */ useDialogProviderContext: () => (/* binding */ useDialogProviderContext),
+/* harmony export */ useDialogScopedContext: () => (/* binding */ useDialogScopedContext)
+/* harmony export */ });
+/* harmony import */ var _ABN76PSX_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ABN76PSX.js */ "./node_modules/@ariakit/react-core/esm/__chunks/ABN76PSX.js");
+/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
+"use client";
+
+
+
+// src/dialog/dialog-context.tsx
+
+var ctx = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createStoreContext)(
+ [_ABN76PSX_js__WEBPACK_IMPORTED_MODULE_0__.DisclosureContextProvider],
+ [_ABN76PSX_js__WEBPACK_IMPORTED_MODULE_0__.DisclosureScopedContextProvider]
+);
+var useDialogContext = ctx.useContext;
+var useDialogScopedContext = ctx.useScopedContext;
+var useDialogProviderContext = ctx.useProviderContext;
+var DialogContextProvider = ctx.ContextProvider;
+var DialogScopedContextProvider = ctx.ScopedContextProvider;
+var DialogHeadingContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.createContext)(void 0);
+var DialogDescriptionContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.createContext)(void 0);
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/VJQU3YUE.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/VJQU3YUE.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ TagContextProvider: () => (/* binding */ TagContextProvider),
+/* harmony export */ TagRemoveIdContext: () => (/* binding */ TagRemoveIdContext),
+/* harmony export */ TagScopedContextProvider: () => (/* binding */ TagScopedContextProvider),
+/* harmony export */ TagValueContext: () => (/* binding */ TagValueContext),
+/* harmony export */ useTagContext: () => (/* binding */ useTagContext),
+/* harmony export */ useTagProviderContext: () => (/* binding */ useTagProviderContext),
+/* harmony export */ useTagScopedContext: () => (/* binding */ useTagScopedContext)
+/* harmony export */ });
+/* harmony import */ var _APTFW6PT_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./APTFW6PT.js */ "./node_modules/@ariakit/react-core/esm/__chunks/APTFW6PT.js");
+/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
+"use client";
+
+
+
+// src/tag/tag-context.tsx
+
+var TagValueContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.createContext)(null);
+var TagRemoveIdContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.createContext)(
+ null
+);
+var ctx = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createStoreContext)(
+ [_APTFW6PT_js__WEBPACK_IMPORTED_MODULE_0__.CompositeContextProvider],
+ [_APTFW6PT_js__WEBPACK_IMPORTED_MODULE_0__.CompositeScopedContextProvider]
+);
+var useTagContext = ctx.useContext;
+var useTagScopedContext = ctx.useScopedContext;
+var useTagProviderContext = ctx.useProviderContext;
+var TagContextProvider = ctx.ContextProvider;
+var TagScopedContextProvider = ctx.ScopedContextProvider;
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ createElement: () => (/* binding */ createElement),
+/* harmony export */ createHook: () => (/* binding */ createHook),
+/* harmony export */ createStoreContext: () => (/* binding */ createStoreContext),
+/* harmony export */ forwardRef: () => (/* binding */ forwardRef2),
+/* harmony export */ memo: () => (/* binding */ memo2)
+/* harmony export */ });
+/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
+/* harmony import */ var _SK3NAZA3_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SK3NAZA3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/SK3NAZA3.js");
+/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "react");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+"use client";
+
+
+
+
+// src/utils/system.tsx
+
+
+function forwardRef2(render) {
+ const Role = react__WEBPACK_IMPORTED_MODULE_3__.forwardRef((props, ref) => render((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadValues)({}, props), { ref })));
+ Role.displayName = render.displayName || render.name;
+ return Role;
+}
+function memo2(Component, propsAreEqual) {
+ return react__WEBPACK_IMPORTED_MODULE_3__.memo(Component, propsAreEqual);
+}
+function createElement(Type, props) {
+ const _a = props, { wrapElement, render } = _a, rest = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__objRest)(_a, ["wrapElement", "render"]);
+ const mergedRef = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_0__.useMergeRefs)(props.ref, (0,_SK3NAZA3_js__WEBPACK_IMPORTED_MODULE_1__.getRefProperty)(render));
+ let element;
+ if (react__WEBPACK_IMPORTED_MODULE_3__.isValidElement(render)) {
+ const renderProps = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadValues)({}, render.props), { ref: mergedRef });
+ element = react__WEBPACK_IMPORTED_MODULE_3__.cloneElement(render, (0,_SK3NAZA3_js__WEBPACK_IMPORTED_MODULE_1__.mergeProps)(rest, renderProps));
+ } else if (render) {
+ element = render(rest);
+ } else {
+ element = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Type, (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadValues)({}, rest));
+ }
+ if (wrapElement) {
+ return wrapElement(element);
+ }
+ return element;
+}
+function createHook(useProps) {
+ const useRole = (props = {}) => {
+ return useProps(props);
+ };
+ useRole.displayName = useProps.name;
+ return useRole;
+}
+function createStoreContext(providers = [], scopedProviders = []) {
+ const context = react__WEBPACK_IMPORTED_MODULE_3__.createContext(void 0);
+ const scopedContext = react__WEBPACK_IMPORTED_MODULE_3__.createContext(void 0);
+ const useContext2 = () => react__WEBPACK_IMPORTED_MODULE_3__.useContext(context);
+ const useScopedContext = (onlyScoped = false) => {
+ const scoped = react__WEBPACK_IMPORTED_MODULE_3__.useContext(scopedContext);
+ const store = useContext2();
+ if (onlyScoped) return scoped;
+ return scoped || store;
+ };
+ const useProviderContext = () => {
+ const scoped = react__WEBPACK_IMPORTED_MODULE_3__.useContext(scopedContext);
+ const store = useContext2();
+ if (scoped && scoped === store) return;
+ return store;
+ };
+ const ContextProvider = (props) => {
+ return providers.reduceRight(
+ (children, Provider) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Provider, (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadValues)({}, props), { children })),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(context.Provider, (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadValues)({}, props))
+ );
+ };
+ const ScopedContextProvider = (props) => {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ContextProvider, (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadValues)({}, props), { children: scopedProviders.reduceRight(
+ (children, Provider) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Provider, (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadValues)({}, props), { children })),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(scopedContext.Provider, (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadValues)({}, props))
+ ) }));
+ };
+ return {
+ context,
+ scopedContext,
+ useContext: useContext2,
+ useScopedContext,
+ useProviderContext,
+ ContextProvider,
+ ScopedContextProvider
+ };
+}
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/Y2U4BRIM.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/Y2U4BRIM.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ useDialogStore: () => (/* binding */ useDialogStore),
+/* harmony export */ useDialogStoreProps: () => (/* binding */ useDialogStoreProps)
+/* harmony export */ });
+/* harmony import */ var _T22PY7TE_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./T22PY7TE.js */ "./node_modules/@ariakit/react-core/esm/__chunks/T22PY7TE.js");
+/* harmony import */ var _RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RTNCFSKZ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/RTNCFSKZ.js");
+/* harmony import */ var _ariakit_core_dialog_dialog_store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ariakit/core/dialog/dialog-store */ "./node_modules/@ariakit/core/esm/__chunks/RZDDWCDV.js");
+"use client";
+
+
+
+// src/dialog/dialog-store.ts
+
+function useDialogStoreProps(store, update, props) {
+ return (0,_T22PY7TE_js__WEBPACK_IMPORTED_MODULE_0__.useDisclosureStoreProps)(store, update, props);
+}
+function useDialogStore(props = {}) {
+ const [store, update] = (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStore)(_ariakit_core_dialog_dialog_store__WEBPACK_IMPORTED_MODULE_2__.createDialogStore, props);
+ return useDialogStoreProps(store, update, props);
+}
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/Y62RTBST.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/Y62RTBST.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ CollectionItem: () => (/* binding */ CollectionItem),
+/* harmony export */ useCollectionItem: () => (/* binding */ useCollectionItem)
+/* harmony export */ });
+/* harmony import */ var _5CPL3B7G_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./5CPL3B7G.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5CPL3B7G.js");
+/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
+/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
+/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
+/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "react");
+"use client";
+
+
+
+
+
+// src/collection/collection-item.tsx
+
+
+var TagName = "div";
+var useCollectionItem = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createHook)(
+ function useCollectionItem2(_a) {
+ var _b = _a, {
+ store,
+ shouldRegisterItem = true,
+ getItem = _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_4__.identity,
+ element: element
+ } = _b, props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__objRest)(_b, [
+ "store",
+ "shouldRegisterItem",
+ "getItem",
+ // @ts-expect-error This prop may come from a collection renderer.
+ "element"
+ ]);
+ const context = (0,_5CPL3B7G_js__WEBPACK_IMPORTED_MODULE_0__.useCollectionContext)();
+ store = store || context;
+ const id = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useId)(props.id);
+ const ref = (0,react__WEBPACK_IMPORTED_MODULE_5__.useRef)(element);
+ (0,react__WEBPACK_IMPORTED_MODULE_5__.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 = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)({}, props), {
+ ref: (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useMergeRefs)(ref, props.ref)
+ });
+ return (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_4__.removeUndefinedValues)(props);
+ }
+);
+var CollectionItem = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function CollectionItem2(props) {
+ const htmlProps = useCollectionItem(props);
+ return (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createElement)(TagName, htmlProps);
+});
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/__chunks/Y67KZUMI.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/__chunks/Y67KZUMI.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ PopoverContextProvider: () => (/* binding */ PopoverContextProvider),
+/* harmony export */ PopoverScopedContextProvider: () => (/* binding */ PopoverScopedContextProvider),
+/* harmony export */ usePopoverContext: () => (/* binding */ usePopoverContext),
+/* harmony export */ usePopoverProviderContext: () => (/* binding */ usePopoverProviderContext),
+/* harmony export */ usePopoverScopedContext: () => (/* binding */ usePopoverScopedContext)
+/* harmony export */ });
+/* harmony import */ var _T2AZQXQU_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./T2AZQXQU.js */ "./node_modules/@ariakit/react-core/esm/__chunks/T2AZQXQU.js");
+/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
+"use client";
+
+
+
+// src/popover/popover-context.tsx
+var ctx = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createStoreContext)(
+ [_T2AZQXQU_js__WEBPACK_IMPORTED_MODULE_0__.DialogContextProvider],
+ [_T2AZQXQU_js__WEBPACK_IMPORTED_MODULE_0__.DialogScopedContextProvider]
+);
+var usePopoverContext = ctx.useContext;
+var usePopoverScopedContext = ctx.useScopedContext;
+var usePopoverProviderContext = ctx.useProviderContext;
+var PopoverContextProvider = ctx.ContextProvider;
+var PopoverScopedContextProvider = ctx.ScopedContextProvider;
+
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/combobox/combobox-item-value.js":
+/*!******************************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/combobox/combobox-item-value.js ***!
+ \******************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ ComboboxItemValue: () => (/* binding */ ComboboxItemValue),
+/* harmony export */ useComboboxItemValue: () => (/* binding */ useComboboxItemValue)
+/* harmony export */ });
+/* harmony import */ var _chunks_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../__chunks/OLVWQA7U.js */ "./node_modules/@ariakit/react-core/esm/__chunks/OLVWQA7U.js");
+/* harmony import */ var _chunks_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../__chunks/RTNCFSKZ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/RTNCFSKZ.js");
+/* harmony import */ var _chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../__chunks/VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
+/* harmony import */ var _chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../__chunks/3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
+/* harmony import */ var _ariakit_core_utils_array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ariakit/core/utils/array */ "./node_modules/@ariakit/core/esm/__chunks/7PRQYBBV.js");
+/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react */ "react");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+"use client";
+
+
+
+
+
+
+
+
+
+
+
+
+// src/combobox/combobox-item-value.tsx
+
+
+
+
+var TagName = "span";
+function normalizeValue(value) {
+ return (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_5__.normalizeString)(value).toLowerCase();
+}
+function getOffsets(string, values) {
+ const offsets = [];
+ for (const value of values) {
+ let pos = 0;
+ const length = value.length;
+ while (string.indexOf(value, pos) !== -1) {
+ const index = string.indexOf(value, pos);
+ if (index !== -1) {
+ offsets.push([index, length]);
+ }
+ pos = index + 1;
+ }
+ }
+ return offsets;
+}
+function filterOverlappingOffsets(offsets) {
+ return offsets.filter(([offset, length], i, arr) => {
+ return !arr.some(
+ ([o, l], j) => j !== i && o <= offset && o + l >= offset + length
+ );
+ });
+}
+function sortOffsets(offsets) {
+ return offsets.sort(([a], [b]) => a - b);
+}
+function splitValue(itemValue, userValue) {
+ if (!itemValue) return itemValue;
+ if (!userValue) return itemValue;
+ const userValues = (0,_ariakit_core_utils_array__WEBPACK_IMPORTED_MODULE_4__.toArray)(userValue).filter(Boolean).map(normalizeValue);
+ const parts = [];
+ const span = (value, autocomplete = false) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
+ "span",
+ {
+ "data-autocomplete-value": autocomplete ? "" : void 0,
+ "data-user-value": autocomplete ? void 0 : "",
+ children: value
+ },
+ parts.length
+ );
+ const offsets = sortOffsets(
+ filterOverlappingOffsets(
+ // Convert userValues into a set to avoid duplicates
+ getOffsets(normalizeValue(itemValue), new Set(userValues))
+ )
+ );
+ if (!offsets.length) {
+ parts.push(span(itemValue, true));
+ return parts;
+ }
+ const [firstOffset] = offsets[0];
+ const values = [
+ itemValue.slice(0, firstOffset),
+ ...offsets.flatMap(([offset, length], i) => {
+ var _a;
+ const value = itemValue.slice(offset, offset + length);
+ const nextOffset = (_a = offsets[i + 1]) == null ? void 0 : _a[0];
+ const nextValue = itemValue.slice(offset + length, nextOffset);
+ return [value, nextValue];
+ })
+ ];
+ values.forEach((value, i) => {
+ if (!value) return;
+ parts.push(span(value, i % 2 === 0));
+ });
+ return parts;
+}
+var useComboboxItemValue = (0,_chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_2__.createHook)(function useComboboxItemValue2(_a) {
+ var _b = _a, { store, value, userValue } = _b, props = (0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__objRest)(_b, ["store", "value", "userValue"]);
+ const context = (0,_chunks_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_0__.useComboboxScopedContext)();
+ store = store || context;
+ const itemContext = (0,react__WEBPACK_IMPORTED_MODULE_6__.useContext)(_chunks_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_0__.ComboboxItemValueContext);
+ const itemValue = value != null ? value : itemContext;
+ const inputValue = (0,_chunks_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStoreState)(store, (state) => userValue != null ? userValue : state == null ? void 0 : state.value);
+ const children = (0,react__WEBPACK_IMPORTED_MODULE_6__.useMemo)(() => {
+ if (!itemValue) return;
+ if (!inputValue) return itemValue;
+ return splitValue(itemValue, inputValue);
+ }, [itemValue, inputValue]);
+ props = (0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)({
+ children
+ }, props);
+ return (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_5__.removeUndefinedValues)(props);
+});
+var ComboboxItemValue = (0,_chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(function ComboboxItemValue2(props) {
+ const htmlProps = useComboboxItemValue(props);
+ return (0,_chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_2__.createElement)(TagName, htmlProps);
+});
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/combobox/combobox-label.js":
+/*!*************************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/combobox/combobox-label.js ***!
+ \*************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ ComboboxLabel: () => (/* binding */ ComboboxLabel),
+/* harmony export */ useComboboxLabel: () => (/* binding */ useComboboxLabel)
+/* harmony export */ });
+/* harmony import */ var _chunks_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../__chunks/OLVWQA7U.js */ "./node_modules/@ariakit/react-core/esm/__chunks/OLVWQA7U.js");
+/* harmony import */ var _chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../__chunks/VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
+/* harmony import */ var _chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../__chunks/3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
+/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
+"use client";
+
+
+
+
+
+
+
+
+
+
+
+// src/combobox/combobox-label.tsx
+
+var TagName = "label";
+var useComboboxLabel = (0,_chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createHook)(
+ function useComboboxLabel2(_a) {
+ var _b = _a, { store } = _b, props = (0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__objRest)(_b, ["store"]);
+ const context = (0,_chunks_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_0__.useComboboxProviderContext)();
+ store = store || context;
+ (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_3__.invariant)(
+ store,
+ true && "ComboboxLabel must receive a `store` prop or be wrapped in a ComboboxProvider component."
+ );
+ const comboboxId = store.useState((state) => {
+ var _a2;
+ return (_a2 = state.baseElement) == null ? void 0 : _a2.id;
+ });
+ props = (0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadValues)({
+ htmlFor: comboboxId
+ }, props);
+ return (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_3__.removeUndefinedValues)(props);
+ }
+);
+var ComboboxLabel = (0,_chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.memo)(
+ (0,_chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function ComboboxLabel2(props) {
+ const htmlProps = useComboboxLabel(props);
+ return (0,_chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createElement)(TagName, htmlProps);
+ })
+);
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/combobox/combobox-provider.js":
+/*!****************************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/combobox/combobox-provider.js ***!
+ \****************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ ComboboxProvider: () => (/* binding */ ComboboxProvider)
+/* harmony export */ });
+/* harmony import */ var _chunks_HI6DYBVE_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../__chunks/HI6DYBVE.js */ "./node_modules/@ariakit/react-core/esm/__chunks/HI6DYBVE.js");
+/* harmony import */ var _chunks_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../__chunks/OLVWQA7U.js */ "./node_modules/@ariakit/react-core/esm/__chunks/OLVWQA7U.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+"use client";
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// src/combobox/combobox-provider.tsx
+
+function ComboboxProvider(props = {}) {
+ const store = (0,_chunks_HI6DYBVE_js__WEBPACK_IMPORTED_MODULE_0__.useComboboxStore)(props);
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_chunks_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_1__.ComboboxContextProvider, { value: store, children: props.children });
+}
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@ariakit/react-core/esm/combobox/combobox.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@ariakit/react-core/esm/combobox/combobox.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ Combobox: () => (/* binding */ Combobox),
+/* harmony export */ useCombobox: () => (/* binding */ useCombobox)
+/* harmony export */ });
+/* harmony import */ var _chunks_NSTBQJLB_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../__chunks/NSTBQJLB.js */ "./node_modules/@ariakit/react-core/esm/__chunks/NSTBQJLB.js");
+/* harmony import */ var _chunks_HMCFFQCB_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../__chunks/HMCFFQCB.js */ "./node_modules/@ariakit/react-core/esm/__chunks/HMCFFQCB.js");
+/* harmony import */ var _chunks_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../__chunks/OLVWQA7U.js */ "./node_modules/@ariakit/react-core/esm/__chunks/OLVWQA7U.js");
+/* harmony import */ var _chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../__chunks/VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
+/* harmony import */ var _chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../__chunks/5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
+/* harmony import */ var _chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../__chunks/3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
+/* harmony import */ var _ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ariakit/core/utils/dom */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js");
+/* harmony import */ var _ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ariakit/core/utils/events */ "./node_modules/@ariakit/core/esm/utils/events.js");
+/* harmony import */ var _ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ariakit/core/utils/focus */ "./node_modules/@ariakit/core/esm/utils/focus.js");
+/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
+/* harmony import */ var _ariakit_core_utils_store__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ariakit/core/utils/store */ "./node_modules/@ariakit/core/esm/__chunks/EWA2WL6G.js");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react */ "react");
+"use client";
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// src/combobox/combobox.tsx
+
+
+
+
+
+
+var TagName = "input";
+function isFirstItemAutoSelected(items, activeValue, autoSelect) {
+ if (!autoSelect) return false;
+ const firstItem = items.find((item) => !item.disabled && item.value);
+ return (firstItem == null ? void 0 : firstItem.value) === activeValue;
+}
+function hasCompletionString(value, activeValue) {
+ if (!activeValue) return false;
+ if (value == null) return false;
+ value = (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_9__.normalizeString)(value);
+ return activeValue.length > value.length && activeValue.toLowerCase().indexOf(value.toLowerCase()) === 0;
+}
+function isInputEvent(event) {
+ return event.type === "input";
+}
+function isAriaAutoCompleteValue(value) {
+ return value === "inline" || value === "list" || value === "both" || value === "none";
+}
+function getDefaultAutoSelectId(items) {
+ const item = items.find((item2) => {
+ var _a;
+ if (item2.disabled) return false;
+ return ((_a = item2.element) == null ? void 0 : _a.getAttribute("role")) !== "tab";
+ });
+ return item == null ? void 0 : item.id;
+}
+var useCombobox = (0,_chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__.createHook)(
+ function useCombobox2(_a) {
+ var _b = _a, {
+ store,
+ focusable = true,
+ autoSelect: autoSelectProp = false,
+ getAutoSelectId,
+ setValueOnChange,
+ showMinLength = 0,
+ showOnChange,
+ showOnMouseDown,
+ showOnClick = showOnMouseDown,
+ showOnKeyDown,
+ showOnKeyPress = showOnKeyDown,
+ blurActiveItemOnClick,
+ setValueOnClick = true,
+ moveOnKeyPress = true,
+ autoComplete = "list"
+ } = _b, props = (0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__objRest)(_b, [
+ "store",
+ "focusable",
+ "autoSelect",
+ "getAutoSelectId",
+ "setValueOnChange",
+ "showMinLength",
+ "showOnChange",
+ "showOnMouseDown",
+ "showOnClick",
+ "showOnKeyDown",
+ "showOnKeyPress",
+ "blurActiveItemOnClick",
+ "setValueOnClick",
+ "moveOnKeyPress",
+ "autoComplete"
+ ]);
+ const context = (0,_chunks_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_2__.useComboboxProviderContext)();
+ store = store || context;
+ (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_9__.invariant)(
+ store,
+ true && "Combobox must receive a `store` prop or be wrapped in a ComboboxProvider component."
+ );
+ const ref = (0,react__WEBPACK_IMPORTED_MODULE_11__.useRef)(null);
+ const [valueUpdated, forceValueUpdate] = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useForceUpdate)();
+ const canAutoSelectRef = (0,react__WEBPACK_IMPORTED_MODULE_11__.useRef)(false);
+ const composingRef = (0,react__WEBPACK_IMPORTED_MODULE_11__.useRef)(false);
+ const autoSelect = store.useState(
+ (state) => state.virtualFocus && autoSelectProp
+ );
+ const inline = autoComplete === "inline" || autoComplete === "both";
+ const [canInline, setCanInline] = (0,react__WEBPACK_IMPORTED_MODULE_11__.useState)(inline);
+ (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useUpdateLayoutEffect)(() => {
+ if (!inline) return;
+ setCanInline(true);
+ }, [inline]);
+ const storeValue = store.useState("value");
+ const prevSelectedValueRef = (0,react__WEBPACK_IMPORTED_MODULE_11__.useRef)();
+ (0,react__WEBPACK_IMPORTED_MODULE_11__.useEffect)(() => {
+ return (0,_ariakit_core_utils_store__WEBPACK_IMPORTED_MODULE_10__.sync)(store, ["selectedValue", "activeId"], (_, prev) => {
+ prevSelectedValueRef.current = prev.selectedValue;
+ });
+ }, []);
+ const inlineActiveValue = store.useState((state) => {
+ var _a2;
+ if (!inline) return;
+ if (!canInline) return;
+ if (state.activeValue && Array.isArray(state.selectedValue)) {
+ if (state.selectedValue.includes(state.activeValue)) return;
+ if ((_a2 = prevSelectedValueRef.current) == null ? void 0 : _a2.includes(state.activeValue)) return;
+ }
+ return state.activeValue;
+ });
+ const items = store.useState("renderedItems");
+ const open = store.useState("open");
+ const contentElement = store.useState("contentElement");
+ const value = (0,react__WEBPACK_IMPORTED_MODULE_11__.useMemo)(() => {
+ if (!inline) return storeValue;
+ if (!canInline) return storeValue;
+ const firstItemAutoSelected = isFirstItemAutoSelected(
+ items,
+ inlineActiveValue,
+ autoSelect
+ );
+ if (firstItemAutoSelected) {
+ if (hasCompletionString(storeValue, inlineActiveValue)) {
+ const slice = (inlineActiveValue == null ? void 0 : inlineActiveValue.slice(storeValue.length)) || "";
+ return storeValue + slice;
+ }
+ return storeValue;
+ }
+ return inlineActiveValue || storeValue;
+ }, [inline, canInline, items, inlineActiveValue, autoSelect, storeValue]);
+ (0,react__WEBPACK_IMPORTED_MODULE_11__.useEffect)(() => {
+ const element = ref.current;
+ if (!element) return;
+ const onCompositeItemMove = () => setCanInline(true);
+ element.addEventListener("combobox-item-move", onCompositeItemMove);
+ return () => {
+ element.removeEventListener("combobox-item-move", onCompositeItemMove);
+ };
+ }, []);
+ (0,react__WEBPACK_IMPORTED_MODULE_11__.useEffect)(() => {
+ if (!inline) return;
+ if (!canInline) return;
+ if (!inlineActiveValue) return;
+ const firstItemAutoSelected = isFirstItemAutoSelected(
+ items,
+ inlineActiveValue,
+ autoSelect
+ );
+ if (!firstItemAutoSelected) return;
+ if (!hasCompletionString(storeValue, inlineActiveValue)) return;
+ let cleanup = _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_9__.noop;
+ queueMicrotask(() => {
+ const element = ref.current;
+ if (!element) return;
+ const { start: prevStart, end: prevEnd } = (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_6__.getTextboxSelection)(element);
+ const nextStart = storeValue.length;
+ const nextEnd = inlineActiveValue.length;
+ (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_6__.setSelectionRange)(element, nextStart, nextEnd);
+ cleanup = () => {
+ if (!(0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_8__.hasFocus)(element)) return;
+ const { start, end } = (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_6__.getTextboxSelection)(element);
+ if (start !== nextStart) return;
+ if (end !== nextEnd) return;
+ (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_6__.setSelectionRange)(element, prevStart, prevEnd);
+ };
+ });
+ return () => cleanup();
+ }, [
+ valueUpdated,
+ inline,
+ canInline,
+ inlineActiveValue,
+ items,
+ autoSelect,
+ storeValue
+ ]);
+ const scrollingElementRef = (0,react__WEBPACK_IMPORTED_MODULE_11__.useRef)(null);
+ const getAutoSelectIdProp = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useEvent)(getAutoSelectId);
+ const autoSelectIdRef = (0,react__WEBPACK_IMPORTED_MODULE_11__.useRef)(null);
+ (0,react__WEBPACK_IMPORTED_MODULE_11__.useEffect)(() => {
+ if (!open) return;
+ if (!contentElement) return;
+ const scrollingElement = (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_6__.getScrollingElement)(contentElement);
+ if (!scrollingElement) return;
+ scrollingElementRef.current = scrollingElement;
+ const onUserScroll = () => {
+ canAutoSelectRef.current = false;
+ };
+ const onScroll = () => {
+ if (!store) return;
+ if (!canAutoSelectRef.current) return;
+ const { activeId } = store.getState();
+ if (activeId === null) return;
+ if (activeId === autoSelectIdRef.current) return;
+ canAutoSelectRef.current = false;
+ };
+ const options = { passive: true, capture: true };
+ scrollingElement.addEventListener("wheel", onUserScroll, options);
+ scrollingElement.addEventListener("touchmove", onUserScroll, options);
+ scrollingElement.addEventListener("scroll", onScroll, options);
+ return () => {
+ scrollingElement.removeEventListener("wheel", onUserScroll, true);
+ scrollingElement.removeEventListener("touchmove", onUserScroll, true);
+ scrollingElement.removeEventListener("scroll", onScroll, true);
+ };
+ }, [open, contentElement, store]);
+ (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useSafeLayoutEffect)(() => {
+ if (!storeValue) return;
+ if (composingRef.current) return;
+ canAutoSelectRef.current = true;
+ }, [storeValue]);
+ (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useSafeLayoutEffect)(() => {
+ if (autoSelect !== "always" && open) return;
+ canAutoSelectRef.current = open;
+ }, [autoSelect, open]);
+ const resetValueOnSelect = store.useState("resetValueOnSelect");
+ (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useUpdateEffect)(() => {
+ var _a2, _b2;
+ const canAutoSelect = canAutoSelectRef.current;
+ if (!store) return;
+ if (!open) return;
+ if (!canAutoSelect && !resetValueOnSelect) return;
+ const { baseElement, contentElement: contentElement2, activeId } = store.getState();
+ if (baseElement && !(0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_8__.hasFocus)(baseElement)) return;
+ if (contentElement2 == null ? void 0 : contentElement2.hasAttribute("data-placing")) {
+ const observer = new MutationObserver(forceValueUpdate);
+ observer.observe(contentElement2, { attributeFilter: ["data-placing"] });
+ return () => observer.disconnect();
+ }
+ if (autoSelect && canAutoSelect) {
+ const userAutoSelectId = getAutoSelectIdProp(items);
+ const autoSelectId = userAutoSelectId !== void 0 ? userAutoSelectId : (_a2 = getDefaultAutoSelectId(items)) != null ? _a2 : store.first();
+ autoSelectIdRef.current = autoSelectId;
+ store.move(autoSelectId != null ? autoSelectId : null);
+ } else {
+ const element = (_b2 = store.item(activeId || store.first())) == null ? void 0 : _b2.element;
+ if (element && "scrollIntoView" in element) {
+ element.scrollIntoView({ block: "nearest", inline: "nearest" });
+ }
+ }
+ return;
+ }, [
+ store,
+ open,
+ valueUpdated,
+ storeValue,
+ autoSelect,
+ resetValueOnSelect,
+ getAutoSelectIdProp,
+ items
+ ]);
+ (0,react__WEBPACK_IMPORTED_MODULE_11__.useEffect)(() => {
+ if (!inline) return;
+ const combobox = ref.current;
+ if (!combobox) return;
+ const elements = [combobox, contentElement].filter(
+ (value2) => !!value2
+ );
+ const onBlur2 = (event) => {
+ if (elements.every((el) => (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_7__.isFocusEventOutside)(event, el))) {
+ store == null ? void 0 : store.setValue(value);
+ }
+ };
+ for (const element of elements) {
+ element.addEventListener("focusout", onBlur2);
+ }
+ return () => {
+ for (const element of elements) {
+ element.removeEventListener("focusout", onBlur2);
+ }
+ };
+ }, [inline, contentElement, store, value]);
+ const canShow = (event) => {
+ const currentTarget = event.currentTarget;
+ return currentTarget.value.length >= showMinLength;
+ };
+ const onChangeProp = props.onChange;
+ const showOnChangeProp = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useBooleanEvent)(showOnChange != null ? showOnChange : canShow);
+ const setValueOnChangeProp = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useBooleanEvent)(
+ // If the combobox is combined with tags, the value will be set by the tag
+ // input component.
+ setValueOnChange != null ? setValueOnChange : !store.tag
+ );
+ const onChange = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useEvent)((event) => {
+ onChangeProp == null ? void 0 : onChangeProp(event);
+ if (event.defaultPrevented) return;
+ if (!store) return;
+ const currentTarget = event.currentTarget;
+ const { value: value2, selectionStart, selectionEnd } = currentTarget;
+ const nativeEvent = event.nativeEvent;
+ canAutoSelectRef.current = true;
+ if (isInputEvent(nativeEvent)) {
+ if (nativeEvent.isComposing) {
+ canAutoSelectRef.current = false;
+ composingRef.current = true;
+ }
+ if (inline) {
+ const textInserted = nativeEvent.inputType === "insertText" || nativeEvent.inputType === "insertCompositionText";
+ const caretAtEnd = selectionStart === value2.length;
+ setCanInline(textInserted && caretAtEnd);
+ }
+ }
+ if (setValueOnChangeProp(event)) {
+ const isSameValue = value2 === store.getState().value;
+ store.setValue(value2);
+ queueMicrotask(() => {
+ (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_6__.setSelectionRange)(currentTarget, selectionStart, selectionEnd);
+ });
+ if (inline && autoSelect && isSameValue) {
+ forceValueUpdate();
+ }
+ }
+ if (showOnChangeProp(event)) {
+ store.show();
+ }
+ if (!autoSelect || !canAutoSelectRef.current) {
+ store.setActiveId(null);
+ }
+ });
+ const onCompositionEndProp = props.onCompositionEnd;
+ const onCompositionEnd = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useEvent)((event) => {
+ canAutoSelectRef.current = true;
+ composingRef.current = false;
+ onCompositionEndProp == null ? void 0 : onCompositionEndProp(event);
+ if (event.defaultPrevented) return;
+ if (!autoSelect) return;
+ forceValueUpdate();
+ });
+ const onMouseDownProp = props.onMouseDown;
+ const blurActiveItemOnClickProp = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useBooleanEvent)(
+ blurActiveItemOnClick != null ? blurActiveItemOnClick : () => !!(store == null ? void 0 : store.getState().includesBaseElement)
+ );
+ const setValueOnClickProp = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useBooleanEvent)(setValueOnClick);
+ const showOnClickProp = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useBooleanEvent)(showOnClick != null ? showOnClick : canShow);
+ const onMouseDown = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useEvent)((event) => {
+ onMouseDownProp == null ? void 0 : onMouseDownProp(event);
+ if (event.defaultPrevented) return;
+ if (event.button) return;
+ if (event.ctrlKey) return;
+ if (!store) return;
+ if (blurActiveItemOnClickProp(event)) {
+ store.setActiveId(null);
+ }
+ if (setValueOnClickProp(event)) {
+ store.setValue(value);
+ }
+ if (showOnClickProp(event)) {
+ (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_7__.queueBeforeEvent)(event.currentTarget, "mouseup", store.show);
+ }
+ });
+ const onKeyDownProp = props.onKeyDown;
+ const showOnKeyPressProp = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useBooleanEvent)(showOnKeyPress != null ? showOnKeyPress : canShow);
+ const onKeyDown = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useEvent)((event) => {
+ onKeyDownProp == null ? void 0 : onKeyDownProp(event);
+ if (!event.repeat) {
+ canAutoSelectRef.current = false;
+ }
+ if (event.defaultPrevented) return;
+ if (event.ctrlKey) return;
+ if (event.altKey) return;
+ if (event.shiftKey) return;
+ if (event.metaKey) return;
+ if (!store) return;
+ const { open: open2 } = store.getState();
+ if (open2) return;
+ if (event.key === "ArrowUp" || event.key === "ArrowDown") {
+ if (showOnKeyPressProp(event)) {
+ event.preventDefault();
+ store.show();
+ }
+ }
+ });
+ const onBlurProp = props.onBlur;
+ const onBlur = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useEvent)((event) => {
+ canAutoSelectRef.current = false;
+ onBlurProp == null ? void 0 : onBlurProp(event);
+ if (event.defaultPrevented) return;
+ });
+ const id = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useId)(props.id);
+ const ariaAutoComplete = isAriaAutoCompleteValue(autoComplete) ? autoComplete : void 0;
+ const isActiveItem = store.useState((state) => state.activeId === null);
+ props = (0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadProps)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({
+ id,
+ role: "combobox",
+ "aria-autocomplete": ariaAutoComplete,
+ "aria-haspopup": (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_6__.getPopupRole)(contentElement, "listbox"),
+ "aria-expanded": open,
+ "aria-controls": contentElement == null ? void 0 : contentElement.id,
+ "data-active-item": isActiveItem || void 0,
+ value
+ }, props), {
+ ref: (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useMergeRefs)(ref, props.ref),
+ onChange,
+ onCompositionEnd,
+ onMouseDown,
+ onKeyDown,
+ onBlur
+ });
+ props = (0,_chunks_NSTBQJLB_js__WEBPACK_IMPORTED_MODULE_0__.useComposite)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadProps)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({
+ store,
+ focusable
+ }, props), {
+ // Enable inline autocomplete when the user moves from the combobox input
+ // to an item.
+ moveOnKeyPress: (event) => {
+ if ((0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_9__.isFalsyBooleanCallback)(moveOnKeyPress, event)) return false;
+ if (inline) setCanInline(true);
+ return true;
+ }
+ }));
+ props = (0,_chunks_HMCFFQCB_js__WEBPACK_IMPORTED_MODULE_1__.usePopoverAnchor)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({ store }, props));
+ return (0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({ autoComplete: "off" }, props);
+ }
+);
+var Combobox = (0,_chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__.forwardRef)(function Combobox2(props) {
+ const htmlProps = useCombobox(props);
+ return (0,_chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__.createElement)(TagName, htmlProps);
+});
+
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-bulk-actions/index.js":
+/*!***************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-bulk-actions/index.js ***!
+ \***************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ BulkActionsFooter: () => (/* binding */ BulkActionsFooter),
+/* harmony export */ BulkSelectionCheckbox: () => (/* binding */ BulkSelectionCheckbox),
+/* harmony export */ useHasAPossibleBulkAction: () => (/* binding */ useHasAPossibleBulkAction),
+/* harmony export */ useSomeItemHasAPossibleBulkAction: () => (/* binding */ useSomeItemHasAPossibleBulkAction)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/close-small.js");
+/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
+/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__);
+/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
+/* harmony import */ var _dataviews_item_actions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../dataviews-item-actions */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-item-actions/index.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__);
+// packages/dataviews/src/components/dataviews-bulk-actions/index.tsx
+
+
+
+
+
+
+
+
+
+function ActionWithModal({
+ action,
+ items,
+ ActionTriggerComponent
+}) {
+ const [isModalOpen, setIsModalOpen] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
+ const actionTriggerProps = {
+ action,
+ onClick: () => {
+ setIsModalOpen(true);
+ },
+ items
+ };
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.Fragment, { children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(ActionTriggerComponent, { ...actionTriggerProps }),
+ isModalOpen && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(
+ _dataviews_item_actions__WEBPACK_IMPORTED_MODULE_7__.ActionModal,
+ {
+ action,
+ items,
+ closeModal: () => setIsModalOpen(false)
+ }
+ )
+ ] });
+}
+function useHasAPossibleBulkAction(actions, item) {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
+ return actions.some((action) => {
+ return action.supportsBulk && (!action.isEligible || action.isEligible(item));
+ });
+ }, [actions, item]);
+}
+function useSomeItemHasAPossibleBulkAction(actions, data) {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
+ return data.some((item) => {
+ return actions.some((action) => {
+ return action.supportsBulk && (!action.isEligible || action.isEligible(item));
+ });
+ });
+ }, [actions, data]);
+}
+function BulkSelectionCheckbox({
+ selection,
+ onChangeSelection,
+ data,
+ actions,
+ getItemId
+}) {
+ const selectableItems = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
+ return data.filter((item) => {
+ return actions.some(
+ (action) => action.supportsBulk && (!action.isEligible || action.isEligible(item))
+ );
+ });
+ }, [data, actions]);
+ const selectedItems = data.filter(
+ (item) => selection.includes(getItemId(item)) && selectableItems.includes(item)
+ );
+ const areAllSelected = selectedItems.length === selectableItems.length;
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.CheckboxControl,
+ {
+ className: "dataviews-view-table-selection-checkbox",
+ __nextHasNoMarginBottom: true,
+ checked: areAllSelected,
+ indeterminate: !areAllSelected && !!selectedItems.length,
+ onChange: () => {
+ if (areAllSelected) {
+ onChangeSelection([]);
+ } else {
+ onChangeSelection(
+ selectableItems.map((item) => getItemId(item))
+ );
+ }
+ },
+ "aria-label": areAllSelected ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Deselect all") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Select all")
+ }
+ );
+}
+function ActionTrigger({
+ action,
+ onClick,
+ isBusy,
+ items
+}) {
+ const label = typeof action.label === "string" ? action.label : action.label(items);
+ const isMobile = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__.useViewportMatch)("medium", "<");
+ if (isMobile) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
+ {
+ disabled: isBusy,
+ accessibleWhenDisabled: true,
+ label,
+ icon: action.icon,
+ size: "compact",
+ onClick,
+ isBusy
+ }
+ );
+ }
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
+ {
+ disabled: isBusy,
+ accessibleWhenDisabled: true,
+ size: "compact",
+ onClick,
+ isBusy,
+ children: label
+ }
+ );
+}
+var EMPTY_ARRAY = [];
+function ActionButton({
+ action,
+ selectedItems,
+ actionInProgress,
+ setActionInProgress
+}) {
+ const registry = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useRegistry)();
+ const selectedEligibleItems = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
+ return selectedItems.filter((item) => {
+ return !action.isEligible || action.isEligible(item);
+ });
+ }, [action, selectedItems]);
+ if ("RenderModal" in action) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(
+ ActionWithModal,
+ {
+ action,
+ items: selectedEligibleItems,
+ ActionTriggerComponent: ActionTrigger
+ },
+ action.id
+ );
+ }
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(
+ ActionTrigger,
+ {
+ action,
+ onClick: async () => {
+ setActionInProgress(action.id);
+ await action.callback(selectedItems, {
+ registry
+ });
+ setActionInProgress(null);
+ },
+ items: selectedEligibleItems,
+ isBusy: actionInProgress === action.id
+ },
+ action.id
+ );
+}
+function renderFooterContent(data, actions, getItemId, selection, actionsToShow, selectedItems, actionInProgress, setActionInProgress, onChangeSelection) {
+ const message = selectedItems.length > 0 ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(
+ /* translators: %d: number of items. */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._n)(
+ "%d Item selected",
+ "%d Items selected",
+ selectedItems.length
+ ),
+ selectedItems.length
+ ) : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(
+ /* translators: %d: number of items. */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._n)("%d Item", "%d Items", data.length),
+ data.length
+ );
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack,
+ {
+ expanded: false,
+ className: "dataviews-bulk-actions-footer__container",
+ spacing: 3,
+ children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(
+ BulkSelectionCheckbox,
+ {
+ selection,
+ onChangeSelection,
+ data,
+ actions,
+ getItemId
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("span", { className: "dataviews-bulk-actions-footer__item-count", children: message }),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack,
+ {
+ className: "dataviews-bulk-actions-footer__action-buttons",
+ expanded: false,
+ spacing: 1,
+ children: [
+ actionsToShow.map((action) => {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(
+ ActionButton,
+ {
+ action,
+ selectedItems,
+ actionInProgress,
+ setActionInProgress
+ },
+ action.id
+ );
+ }),
+ selectedItems.length > 0 && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
+ {
+ icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__["default"],
+ showTooltip: true,
+ tooltipPosition: "top",
+ size: "compact",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Cancel"),
+ disabled: !!actionInProgress,
+ accessibleWhenDisabled: false,
+ onClick: () => {
+ onChangeSelection(EMPTY_ARRAY);
+ }
+ }
+ )
+ ]
+ }
+ )
+ ]
+ }
+ );
+}
+function FooterContent({
+ selection,
+ actions,
+ onChangeSelection,
+ data,
+ getItemId
+}) {
+ const [actionInProgress, setActionInProgress] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(
+ null
+ );
+ const footerContentRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);
+ const isMobile = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__.useViewportMatch)("medium", "<");
+ const bulkActions = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(
+ () => actions.filter((action) => action.supportsBulk),
+ [actions]
+ );
+ const selectableItems = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
+ return data.filter((item) => {
+ return bulkActions.some(
+ (action) => !action.isEligible || action.isEligible(item)
+ );
+ });
+ }, [data, bulkActions]);
+ const selectedItems = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
+ return data.filter(
+ (item) => selection.includes(getItemId(item)) && selectableItems.includes(item)
+ );
+ }, [selection, data, getItemId, selectableItems]);
+ const actionsToShow = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(
+ () => actions.filter((action) => {
+ return action.supportsBulk && (!isMobile || action.icon) && selectedItems.some(
+ (item) => !action.isEligible || action.isEligible(item)
+ );
+ }),
+ [actions, selectedItems, isMobile]
+ );
+ if (!actionInProgress) {
+ if (footerContentRef.current) {
+ footerContentRef.current = null;
+ }
+ return renderFooterContent(
+ data,
+ actions,
+ getItemId,
+ selection,
+ actionsToShow,
+ selectedItems,
+ actionInProgress,
+ setActionInProgress,
+ onChangeSelection
+ );
+ } else if (!footerContentRef.current) {
+ footerContentRef.current = renderFooterContent(
+ data,
+ actions,
+ getItemId,
+ selection,
+ actionsToShow,
+ selectedItems,
+ actionInProgress,
+ setActionInProgress,
+ onChangeSelection
+ );
+ }
+ return footerContentRef.current;
+}
+function BulkActionsFooter() {
+ const {
+ data,
+ selection,
+ actions = EMPTY_ARRAY,
+ onChangeSelection,
+ getItemId
+ } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_6__["default"]);
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(
+ FooterContent,
+ {
+ selection,
+ onChangeSelection,
+ data,
+ actions,
+ getItemId
+ }
+ );
+}
+
+//# sourceMappingURL=index.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js":
+/*!**********************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js ***!
+ \**********************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ dataviews_context_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+// packages/dataviews/src/components/dataviews-context/index.ts
+
+
+var DataViewsContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createContext)({
+ view: { type: _constants__WEBPACK_IMPORTED_MODULE_1__.LAYOUT_TABLE },
+ onChangeView: () => {
+ },
+ fields: [],
+ data: [],
+ paginationInfo: {
+ totalItems: 0,
+ totalPages: 0
+ },
+ selection: [],
+ onChangeSelection: () => {
+ },
+ setOpenedFilter: () => {
+ },
+ openedFilter: null,
+ getItemId: (item) => item.id,
+ isItemClickable: () => true,
+ renderItemLink: void 0,
+ containerWidth: 0,
+ containerRef: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createRef)(),
+ resizeObserverRef: () => {
+ },
+ defaultLayouts: { list: {}, grid: {}, table: {} },
+ filters: [],
+ isShowingFilter: false,
+ setIsShowingFilter: () => {
+ },
+ hasInfiniteScrollHandler: false,
+ config: {
+ perPageSizes: []
+ }
+});
+DataViewsContext.displayName = "DataViewsContext";
+var dataviews_context_default = DataViewsContext;
+
+//# sourceMappingURL=index.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/add-filter.js":
+/*!***************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/add-filter.js ***!
+ \***************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ AddFilterMenu: () => (/* binding */ AddFilterMenu),
+/* harmony export */ "default": () => (/* binding */ add_filter_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
+// packages/dataviews/src/components/dataviews-filters/add-filter.tsx
+
+
+
+
+
+var { Menu } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_3__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.privateApis);
+function AddFilterMenu({
+ filters,
+ view,
+ onChangeView,
+ setOpenedFilter,
+ triggerProps
+}) {
+ const inactiveFilters = filters.filter((filter) => !filter.isVisible);
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(Menu, { children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Menu.TriggerButton, { ...triggerProps }),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Menu.Popover, { children: inactiveFilters.map((filter) => {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
+ Menu.Item,
+ {
+ onClick: () => {
+ setOpenedFilter(filter.field);
+ onChangeView({
+ ...view,
+ page: 1,
+ filters: [
+ ...view.filters || [],
+ {
+ field: filter.field,
+ value: void 0,
+ operator: filter.operators[0]
+ }
+ ]
+ });
+ },
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Menu.ItemLabel, { children: filter.name })
+ },
+ filter.field
+ );
+ }) })
+ ] });
+}
+function AddFilter({ filters, view, onChangeView, setOpenedFilter }, ref) {
+ if (!filters.length || filters.every(({ isPrimary }) => isPrimary)) {
+ return null;
+ }
+ const inactiveFilters = filters.filter((filter) => !filter.isVisible);
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
+ AddFilterMenu,
+ {
+ triggerProps: {
+ render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
+ {
+ accessibleWhenDisabled: true,
+ size: "compact",
+ className: "dataviews-filters-button",
+ variant: "tertiary",
+ disabled: !inactiveFilters.length,
+ ref
+ }
+ ),
+ children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Add filter")
+ },
+ ...{ filters, view, onChangeView, setOpenedFilter }
+ }
+ );
+}
+var add_filter_default = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(AddFilter);
+
+//# sourceMappingURL=add-filter.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filter.js":
+/*!***********************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filter.js ***!
+ \***********************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ Filter)
+/* harmony export */ });
+/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/close-small.js");
+/* harmony import */ var _search_widget__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./search-widget */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/search-widget.js");
+/* harmony import */ var _input_widget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./input-widget */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/input-widget.js");
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+/* harmony import */ var _hooks_use_elements__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../hooks/use-elements */ "./node_modules/@wordpress/dataviews/build-module/hooks/use-elements.js");
+/* harmony import */ var _field_types_utils_parse_date_time__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../field-types/utils/parse-date-time */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/parse-date-time.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__);
+// packages/dataviews/src/components/dataviews-filters/filter.tsx
+
+
+
+
+
+
+
+
+
+
+
+var ENTER = "Enter";
+var SPACE = " ";
+var FilterText = ({
+ activeElements,
+ filterInView,
+ filter
+}) => {
+ if (activeElements === void 0 || activeElements.length === 0) {
+ return filter.name;
+ }
+ const filterTextWrappers = {
+ Name: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", { className: "dataviews-filters__summary-filter-text-name" }),
+ Value: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", { className: "dataviews-filters__summary-filter-text-value" })
+ };
+ if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_IS_ANY) {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ /* translators: 1: Filter name. 2: Filter value. e.g.: "Author is any: Admin, Editor". */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is any: %2$s"),
+ filter.name,
+ activeElements.map((element) => element.label).join(", ")
+ ),
+ filterTextWrappers
+ );
+ }
+ if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_IS_NONE) {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ /* translators: 1: Filter name. 2: Filter value. e.g.: "Author is none: Admin, Editor". */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is none: %2$s"),
+ filter.name,
+ activeElements.map((element) => element.label).join(", ")
+ ),
+ filterTextWrappers
+ );
+ }
+ if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_IS_ALL) {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ /* translators: 1: Filter name. 2: Filter value. e.g.: "Author is all: Admin, Editor". */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is all: %2$s"),
+ filter.name,
+ activeElements.map((element) => element.label).join(", ")
+ ),
+ filterTextWrappers
+ );
+ }
+ if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_IS_NOT_ALL) {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ /* translators: 1: Filter name. 2: Filter value. e.g.: "Author is not all: Admin, Editor". */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is not all: %2$s"),
+ filter.name,
+ activeElements.map((element) => element.label).join(", ")
+ ),
+ filterTextWrappers
+ );
+ }
+ if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_IS) {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ /* translators: 1: Filter name. 2: Filter value. e.g.: "Author is: Admin". */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is: %2$s"),
+ filter.name,
+ activeElements[0].label
+ ),
+ filterTextWrappers
+ );
+ }
+ if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_IS_NOT) {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ /* translators: 1: Filter name. 2: Filter value. e.g.: "Author is not: Admin". */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is not: %2$s"),
+ filter.name,
+ activeElements[0].label
+ ),
+ filterTextWrappers
+ );
+ }
+ if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_LESS_THAN) {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ /* translators: 1: Filter name. 2: Filter value. e.g.: "Price is less than: 10". */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is less than: %2$s"),
+ filter.name,
+ activeElements[0].label
+ ),
+ filterTextWrappers
+ );
+ }
+ if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_GREATER_THAN) {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ /* translators: 1: Filter name. 2: Filter value. e.g.: "Price is greater than: 10". */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is greater than: %2$s"),
+ filter.name,
+ activeElements[0].label
+ ),
+ filterTextWrappers
+ );
+ }
+ if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_LESS_THAN_OR_EQUAL) {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ /* translators: 1: Filter name. 2: Filter value. e.g.: "Price is less than or equal to: 10". */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)(
+ "%1$s is less than or equal to: %2$s"
+ ),
+ filter.name,
+ activeElements[0].label
+ ),
+ filterTextWrappers
+ );
+ }
+ if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_GREATER_THAN_OR_EQUAL) {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ /* translators: 1: Filter name. 2: Filter value. e.g.: "Price is greater than or equal to: 10". */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)(
+ "%1$s is greater than or equal to: %2$s"
+ ),
+ filter.name,
+ activeElements[0].label
+ ),
+ filterTextWrappers
+ );
+ }
+ if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_CONTAINS) {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ /* translators: 1: Filter name. 2: Filter value. e.g.: "Title contains: Mars". */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s contains: %2$s"),
+ filter.name,
+ activeElements[0].label
+ ),
+ filterTextWrappers
+ );
+ }
+ if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_NOT_CONTAINS) {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ /* translators: 1: Filter name. 2: Filter value. e.g.: "Description doesn't contain: photo". */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s doesn't contain: %2$s"),
+ filter.name,
+ activeElements[0].label
+ ),
+ filterTextWrappers
+ );
+ }
+ if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_STARTS_WITH) {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ /* translators: 1: Filter name. 2: Filter value. e.g.: "Title starts with: Mar". */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s starts with: %2$s"),
+ filter.name,
+ activeElements[0].label
+ ),
+ filterTextWrappers
+ );
+ }
+ if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_BEFORE) {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ /* translators: 1: Filter name. 2: Filter value. e.g.: "Date is before: 2024-01-01". */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is before: %2$s"),
+ filter.name,
+ activeElements[0].label
+ ),
+ filterTextWrappers
+ );
+ }
+ if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_AFTER) {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ /* translators: 1: Filter name. 2: Filter value. e.g.: "Date is after: 2024-01-01". */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is after: %2$s"),
+ filter.name,
+ activeElements[0].label
+ ),
+ filterTextWrappers
+ );
+ }
+ if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_BEFORE_INC) {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ /* translators: 1: Filter name. 2: Filter value. e.g.: "Date is on or before: 2024-01-01". */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is on or before: %2$s"),
+ filter.name,
+ activeElements[0].label
+ ),
+ filterTextWrappers
+ );
+ }
+ if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_AFTER_INC) {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ /* translators: 1: Filter name. 2: Filter value. e.g.: "Date is on or after: 2024-01-01". */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is on or after: %2$s"),
+ filter.name,
+ activeElements[0].label
+ ),
+ filterTextWrappers
+ );
+ }
+ if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_BETWEEN) {
+ const { label } = activeElements[0];
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ /* translators: 1: Filter name. 2: Min value. 3: Max value. e.g.: "Item count between (inc): 10 and 180". */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)(
+ "%1$s between (inc): %2$s and %3$s"
+ ),
+ filter.name,
+ label[0],
+ label[1]
+ ),
+ filterTextWrappers
+ );
+ }
+ if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_ON) {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ /* translators: 1: Filter name. 2: Filter value. e.g.: "Date is: 2024-01-01". */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is: %2$s"),
+ filter.name,
+ activeElements[0].label
+ ),
+ filterTextWrappers
+ );
+ }
+ if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_NOT_ON) {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ /* translators: 1: Filter name. 2: Filter value. e.g.: "Date is not: 2024-01-01". */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is not: %2$s"),
+ filter.name,
+ activeElements[0].label
+ ),
+ filterTextWrappers
+ );
+ }
+ if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_IN_THE_PAST) {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ /* translators: 1: Filter name. 2: Filter value. e.g.: "Date is in the past: 1 days". */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is in the past: %2$s"),
+ filter.name,
+ `${activeElements[0].value.value} ${activeElements[0].value.unit}`
+ ),
+ filterTextWrappers
+ );
+ }
+ if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_OVER) {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ /* translators: 1: Filter name. 2: Filter value. e.g.: "Date is over: 1 days ago". */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is over: %2$s ago"),
+ filter.name,
+ `${activeElements[0].value.value} ${activeElements[0].value.unit}`
+ ),
+ filterTextWrappers
+ );
+ }
+ return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ /* translators: 1: Filter name e.g.: "Unknown status for Author". */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Unknown status for %1$s"),
+ filter.name
+ );
+};
+function OperatorSelector({
+ filter,
+ view,
+ onChangeView
+}) {
+ const operatorOptions = filter.operators?.map((operator) => ({
+ value: operator,
+ label: _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATORS[operator]?.label
+ }));
+ const currentFilter = view.filters?.find(
+ (_filter) => _filter.field === filter.field
+ );
+ const value = currentFilter?.operator || filter.operators[0];
+ return operatorOptions.length > 1 && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHStack,
+ {
+ spacing: 2,
+ justify: "flex-start",
+ className: "dataviews-filters__summary-operators-container",
+ children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.FlexItem, { className: "dataviews-filters__summary-operators-filter-name", children: filter.name }),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl,
+ {
+ className: "dataviews-filters__summary-operators-filter-select",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Conditions"),
+ value,
+ options: operatorOptions,
+ onChange: (newValue) => {
+ const operator = newValue;
+ const currentOperator = currentFilter?.operator;
+ const newFilters = currentFilter ? [
+ ...(view.filters ?? []).map(
+ (_filter) => {
+ if (_filter.field === filter.field) {
+ const OPERATORS_SHOULD_RESET_VALUE = [
+ _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_BETWEEN,
+ _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_IN_THE_PAST,
+ _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_OVER
+ ];
+ const shouldResetValue = currentOperator && (OPERATORS_SHOULD_RESET_VALUE.includes(
+ currentOperator
+ ) || OPERATORS_SHOULD_RESET_VALUE.includes(
+ operator
+ ));
+ return {
+ ..._filter,
+ value: shouldResetValue ? void 0 : _filter.value,
+ operator
+ };
+ }
+ return _filter;
+ }
+ )
+ ] : [
+ ...view.filters ?? [],
+ {
+ field: filter.field,
+ operator,
+ value: void 0
+ }
+ ];
+ onChangeView({
+ ...view,
+ page: 1,
+ filters: newFilters
+ });
+ },
+ size: "small",
+ variant: "minimal",
+ __nextHasNoMarginBottom: true,
+ hideLabelFromVision: true
+ }
+ )
+ ]
+ }
+ );
+}
+function Filter({
+ addFilterRef,
+ openedFilter,
+ fields,
+ ...commonProps
+}) {
+ const toggleRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)(null);
+ const { filter, view, onChangeView } = commonProps;
+ const filterInView = view.filters?.find(
+ (f) => f.field === filter.field
+ );
+ let activeElements = [];
+ const { elements } = (0,_hooks_use_elements__WEBPACK_IMPORTED_MODULE_8__["default"])({
+ elements: filter.elements,
+ getElements: filter.getElements
+ });
+ if (elements.length > 0) {
+ activeElements = elements.filter((element) => {
+ if (filter.singleSelection) {
+ return element.value === filterInView?.value;
+ }
+ return filterInView?.value?.includes(element.value);
+ });
+ } else if (filterInView?.value !== void 0) {
+ const field = fields.find((f) => f.id === filter.field);
+ let label = filterInView.value;
+ if (field?.type === "datetime" && typeof label === "string") {
+ try {
+ const dateValue = (0,_field_types_utils_parse_date_time__WEBPACK_IMPORTED_MODULE_9__["default"])(label);
+ if (dateValue !== null) {
+ label = dateValue.toLocaleString();
+ }
+ } catch (e) {
+ label = filterInView.value;
+ }
+ }
+ activeElements = [
+ {
+ value: filterInView.value,
+ label
+ }
+ ];
+ }
+ const isPrimary = filter.isPrimary;
+ const isLocked = filterInView?.isLocked;
+ const hasValues = !isLocked && filterInView?.value !== void 0;
+ const canResetOrRemove = !isLocked && (!isPrimary || hasValues);
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Dropdown,
+ {
+ defaultOpen: openedFilter === filter.field,
+ contentClassName: "dataviews-filters__summary-popover",
+ popoverProps: { placement: "bottom-start", role: "dialog" },
+ onClose: () => {
+ toggleRef.current?.focus();
+ },
+ renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { className: "dataviews-filters__summary-chip-container", children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Tooltip,
+ {
+ text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ /* translators: 1: Filter name. */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Filter by: %1$s"),
+ filter.name.toLowerCase()
+ ),
+ placement: "top",
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
+ "div",
+ {
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])(
+ "dataviews-filters__summary-chip",
+ {
+ "has-reset": canResetOrRemove,
+ "has-values": hasValues,
+ "is-not-clickable": isLocked
+ }
+ ),
+ role: "button",
+ tabIndex: isLocked ? -1 : 0,
+ onClick: () => {
+ if (!isLocked) {
+ onToggle();
+ }
+ },
+ onKeyDown: (event) => {
+ if (!isLocked && [ENTER, SPACE].includes(event.key)) {
+ onToggle();
+ event.preventDefault();
+ }
+ },
+ "aria-disabled": isLocked,
+ "aria-pressed": isOpen,
+ "aria-expanded": isOpen,
+ ref: toggleRef,
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
+ FilterText,
+ {
+ activeElements,
+ filterInView,
+ filter
+ }
+ )
+ }
+ )
+ }
+ ),
+ canResetOrRemove && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Tooltip,
+ {
+ text: isPrimary ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Reset") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Remove"),
+ placement: "top",
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
+ "button",
+ {
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])(
+ "dataviews-filters__summary-chip-remove",
+ { "has-values": hasValues }
+ ),
+ onClick: () => {
+ onChangeView({
+ ...view,
+ page: 1,
+ filters: view.filters?.filter(
+ (_filter) => _filter.field !== filter.field
+ )
+ });
+ if (!isPrimary) {
+ addFilterRef.current?.focus();
+ } else {
+ toggleRef.current?.focus();
+ }
+ },
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Icon, { icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__["default"] })
+ }
+ )
+ }
+ )
+ ] }),
+ renderContent: () => {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalVStack, { spacing: 0, justify: "flex-start", children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(OperatorSelector, { ...commonProps }),
+ commonProps.filter.hasElements ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
+ _search_widget__WEBPACK_IMPORTED_MODULE_5__["default"],
+ {
+ ...commonProps,
+ filter: {
+ ...commonProps.filter,
+ elements
+ }
+ }
+ ) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_input_widget__WEBPACK_IMPORTED_MODULE_6__["default"], { ...commonProps, fields })
+ ] });
+ }
+ }
+ );
+}
+
+//# sourceMappingURL=filter.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filters-toggled.js":
+/*!********************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filters-toggled.js ***!
+ \********************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ filters_toggled_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
+/* harmony import */ var _filters__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./filters */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filters.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
+// packages/dataviews/src/components/dataviews-filters/filters-toggled.tsx
+
+
+
+
+function FiltersToggled(props) {
+ const { isShowingFilter } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_1__["default"]);
+ if (!isShowingFilter) {
+ return null;
+ }
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_filters__WEBPACK_IMPORTED_MODULE_2__["default"], { ...props });
+}
+var filters_toggled_default = FiltersToggled;
+
+//# sourceMappingURL=filters-toggled.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filters.js":
+/*!************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filters.js ***!
+ \************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ filters_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./filter */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filter.js");
+/* harmony import */ var _add_filter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./add-filter */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/add-filter.js");
+/* harmony import */ var _reset_filters__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./reset-filters */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/reset-filters.js");
+/* harmony import */ var _use_filters__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./use-filters */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/use-filters.js");
+/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__);
+// packages/dataviews/src/components/dataviews-filters/filters.tsx
+
+
+
+
+
+
+
+
+function Filters({ className }) {
+ const { fields, view, onChangeView, openedFilter, setOpenedFilter } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_6__["default"]);
+ const addFilterRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
+ const filters = (0,_use_filters__WEBPACK_IMPORTED_MODULE_5__["default"])(fields, view);
+ const addFilter = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
+ _add_filter__WEBPACK_IMPORTED_MODULE_3__["default"],
+ {
+ filters,
+ view,
+ onChangeView,
+ ref: addFilterRef,
+ setOpenedFilter
+ },
+ "add-filter"
+ );
+ const visibleFilters = filters.filter((filter) => filter.isVisible);
+ if (visibleFilters.length === 0) {
+ return null;
+ }
+ const filterComponents = [
+ ...visibleFilters.map((filter) => {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
+ _filter__WEBPACK_IMPORTED_MODULE_2__["default"],
+ {
+ filter,
+ view,
+ fields,
+ onChangeView,
+ addFilterRef,
+ openedFilter
+ },
+ filter.field
+ );
+ }),
+ addFilter
+ ];
+ filterComponents.push(
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
+ _reset_filters__WEBPACK_IMPORTED_MODULE_4__["default"],
+ {
+ filters,
+ view,
+ onChangeView
+ },
+ "reset-filters"
+ )
+ );
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHStack,
+ {
+ justify: "flex-start",
+ style: { width: "fit-content" },
+ wrap: true,
+ className,
+ children: filterComponents
+ }
+ );
+}
+var filters_default = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.memo)(Filters);
+
+//# sourceMappingURL=filters.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/input-widget.js":
+/*!*****************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/input-widget.js ***!
+ \*****************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ InputWidget)
+/* harmony export */ });
+/* harmony import */ var fast_deep_equal_es6__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fast-deep-equal/es6 */ "./node_modules/fast-deep-equal/es6/index.js");
+/* harmony import */ var fast_deep_equal_es6__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fast_deep_equal_es6__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
+/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/utils.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
+// packages/dataviews/src/components/dataviews-filters/input-widget.tsx
+
+
+
+
+
+
+function InputWidget({
+ filter,
+ view,
+ onChangeView,
+ fields
+}) {
+ const currentFilter = view.filters?.find(
+ (f) => f.field === filter.field
+ );
+ const currentValue = (0,_utils__WEBPACK_IMPORTED_MODULE_4__.getCurrentValue)(filter, currentFilter);
+ const field = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
+ const currentField = fields.find((f) => f.id === filter.field);
+ if (currentField) {
+ return {
+ ...currentField,
+ // Deactivate validation for filters.
+ isValid: {
+ required: false,
+ custom: () => null
+ },
+ // Configure getValue/setValue as if Item was a plain object.
+ getValue: ({ item }) => item[currentField.id],
+ setValue: ({ value }) => ({
+ [currentField.id]: value
+ })
+ };
+ }
+ return currentField;
+ }, [fields, filter.field]);
+ const data = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
+ return (view.filters ?? []).reduce(
+ (acc, activeFilter) => {
+ acc[activeFilter.field] = activeFilter.value;
+ return acc;
+ },
+ {}
+ );
+ }, [view.filters]);
+ const handleChange = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__.useEvent)((updatedData) => {
+ if (!field || !currentFilter) {
+ return;
+ }
+ const nextValue = field.getValue({ item: updatedData });
+ if (fast_deep_equal_es6__WEBPACK_IMPORTED_MODULE_0___default()(nextValue, currentValue)) {
+ return;
+ }
+ onChangeView({
+ ...view,
+ filters: (view.filters ?? []).map(
+ (_filter) => _filter.field === filter.field ? {
+ ..._filter,
+ operator: currentFilter.operator || filter.operators[0],
+ // Consider empty strings as undefined:
+ //
+ // - undefined as value means the filter is unset: the filter widget displays no value and the search returns all records
+ // - empty string as value means "search empty string": returns only the records that have an empty string as value
+ //
+ // In practice, this means the filter will not be able to find an empty string as the value.
+ value: nextValue === "" ? void 0 : nextValue
+ } : _filter
+ )
+ });
+ });
+ if (!field || !field.Edit || !currentFilter) {
+ return null;
+ }
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Flex,
+ {
+ className: "dataviews-filters__user-input-widget",
+ gap: 2.5,
+ direction: "column",
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
+ field.Edit,
+ {
+ hideLabelFromVision: true,
+ data,
+ field,
+ operator: currentFilter.operator,
+ onChange: handleChange
+ }
+ )
+ }
+ );
+}
+
+//# sourceMappingURL=input-widget.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/reset-filters.js":
+/*!******************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/reset-filters.js ***!
+ \******************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ ResetFilter)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
+// packages/dataviews/src/components/dataviews-filters/reset-filters.tsx
+
+
+
+function ResetFilter({
+ filters,
+ view,
+ onChangeView
+}) {
+ const isPrimary = (field) => filters.some(
+ (_filter) => _filter.field === field && _filter.isPrimary
+ );
+ const isDisabled = !view.search && !view.filters?.some(
+ (_filter) => !_filter.isLocked && (_filter.value !== void 0 || !isPrimary(_filter.field))
+ );
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
+ {
+ disabled: isDisabled,
+ accessibleWhenDisabled: true,
+ size: "compact",
+ variant: "tertiary",
+ className: "dataviews-filters__reset-button",
+ onClick: () => {
+ onChangeView({
+ ...view,
+ page: 1,
+ search: "",
+ filters: view.filters?.filter((f) => !!f.isLocked) || []
+ });
+ },
+ children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Reset")
+ }
+ );
+}
+
+//# sourceMappingURL=reset-filters.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/search-widget.js":
+/*!******************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/search-widget.js ***!
+ \******************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ SearchWidget)
+/* harmony export */ });
+/* harmony import */ var _ariakit_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ariakit/react */ "./node_modules/@ariakit/react-core/esm/combobox/combobox.js");
+/* harmony import */ var _ariakit_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ariakit/react */ "./node_modules/@ariakit/react-core/esm/__chunks/MNJRSAAC.js");
+/* harmony import */ var _ariakit_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ariakit/react */ "./node_modules/@ariakit/react-core/esm/__chunks/D7FSM5GC.js");
+/* harmony import */ var _ariakit_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ariakit/react */ "./node_modules/@ariakit/react-core/esm/combobox/combobox-item-value.js");
+/* harmony import */ var _ariakit_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ariakit/react */ "./node_modules/@ariakit/react-core/esm/combobox/combobox-label.js");
+/* harmony import */ var _ariakit_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ariakit/react */ "./node_modules/@ariakit/react-core/esm/combobox/combobox-provider.js");
+/* harmony import */ var remove_accents__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! remove-accents */ "./node_modules/remove-accents/index.js");
+/* harmony import */ var remove_accents__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(remove_accents__WEBPACK_IMPORTED_MODULE_6__);
+/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
+/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
+/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_8__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_10__);
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__);
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/check.js");
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/search.js");
+/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/utils.js");
+/* harmony import */ var _hooks_use_elements__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../hooks/use-elements */ "./node_modules/@wordpress/dataviews/build-module/hooks/use-elements.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__);
+// packages/dataviews/src/components/dataviews-filters/search-widget.tsx
+
+
+
+
+
+
+
+
+
+
+
+function normalizeSearchInput(input = "") {
+ return remove_accents__WEBPACK_IMPORTED_MODULE_6___default()(input.trim().toLowerCase());
+}
+var getNewValue = (filterDefinition, currentFilter, value) => {
+ if (filterDefinition.singleSelection) {
+ return value;
+ }
+ if (Array.isArray(currentFilter?.value)) {
+ return currentFilter.value.includes(value) ? currentFilter.value.filter((v) => v !== value) : [...currentFilter.value, value];
+ }
+ return [value];
+};
+function generateFilterElementCompositeItemId(prefix, filterElementValue) {
+ return `${prefix}-${filterElementValue}`;
+}
+var MultiSelectionOption = ({ selected }) => {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
+ "span",
+ {
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_7__["default"])(
+ "dataviews-filters__search-widget-listitem-multi-selection",
+ { "is-selected": selected }
+ ),
+ children: selected && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__.Icon, { icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_12__["default"] })
+ }
+ );
+};
+var SingleSelectionOption = ({ selected }) => {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
+ "span",
+ {
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_7__["default"])(
+ "dataviews-filters__search-widget-listitem-single-selection",
+ { "is-selected": selected }
+ )
+ }
+ );
+};
+function ListBox({ view, filter, onChangeView }) {
+ const baseId = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_8__.useInstanceId)(ListBox, "dataviews-filter-list-box");
+ const [activeCompositeId, setActiveCompositeId] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_10__.useState)(
+ // When there are one or less operators, the first item is set as active
+ // (by setting the initial `activeId` to `undefined`).
+ // With 2 or more operators, the focus is moved on the operators control
+ // (by setting the initial `activeId` to `null`), meaning that there won't
+ // be an active item initially. Focus is then managed via the
+ // `onFocusVisible` callback.
+ filter.operators?.length === 1 ? void 0 : null
+ );
+ const currentFilter = view.filters?.find(
+ (f) => f.field === filter.field
+ );
+ const currentValue = (0,_utils__WEBPACK_IMPORTED_MODULE_14__.getCurrentValue)(filter, currentFilter);
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_11__.Composite,
+ {
+ virtualFocus: true,
+ focusLoop: true,
+ activeId: activeCompositeId,
+ setActiveId: setActiveCompositeId,
+ role: "listbox",
+ className: "dataviews-filters__search-widget-listbox",
+ "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.sprintf)(
+ /* translators: List of items for a filter. 1: Filter name. e.g.: "List of: Author". */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)("List of: %1$s"),
+ filter.name
+ ),
+ onFocusVisible: () => {
+ if (!activeCompositeId && filter.elements.length) {
+ setActiveCompositeId(
+ generateFilterElementCompositeItemId(
+ baseId,
+ filter.elements[0].value
+ )
+ );
+ }
+ },
+ render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__.Composite.Typeahead, {}),
+ children: filter.elements.map((element) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_11__.Composite.Hover,
+ {
+ render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_11__.Composite.Item,
+ {
+ id: generateFilterElementCompositeItemId(
+ baseId,
+ element.value
+ ),
+ render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
+ "div",
+ {
+ "aria-label": element.label,
+ role: "option",
+ className: "dataviews-filters__search-widget-listitem"
+ }
+ ),
+ onClick: () => {
+ const newFilters = currentFilter ? [
+ ...(view.filters ?? []).map(
+ (_filter) => {
+ if (_filter.field === filter.field) {
+ return {
+ ..._filter,
+ operator: currentFilter.operator || filter.operators[0],
+ value: getNewValue(
+ filter,
+ currentFilter,
+ element.value
+ )
+ };
+ }
+ return _filter;
+ }
+ )
+ ] : [
+ ...view.filters ?? [],
+ {
+ field: filter.field,
+ operator: filter.operators[0],
+ value: getNewValue(
+ filter,
+ currentFilter,
+ element.value
+ )
+ }
+ ];
+ onChangeView({
+ ...view,
+ page: 1,
+ filters: newFilters
+ });
+ }
+ }
+ ),
+ children: [
+ filter.singleSelection && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
+ SingleSelectionOption,
+ {
+ selected: currentValue === element.value
+ }
+ ),
+ !filter.singleSelection && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
+ MultiSelectionOption,
+ {
+ selected: currentValue.includes(element.value)
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("span", { children: element.label })
+ ]
+ },
+ element.value
+ ))
+ }
+ );
+}
+function ComboboxList2({ view, filter, onChangeView }) {
+ const [searchValue, setSearchValue] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_10__.useState)("");
+ const deferredSearchValue = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_10__.useDeferredValue)(searchValue);
+ const currentFilter = view.filters?.find(
+ (_filter) => _filter.field === filter.field
+ );
+ const currentValue = (0,_utils__WEBPACK_IMPORTED_MODULE_14__.getCurrentValue)(filter, currentFilter);
+ const matches = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_10__.useMemo)(() => {
+ const normalizedSearch = normalizeSearchInput(deferredSearchValue);
+ return filter.elements.filter(
+ (item) => normalizeSearchInput(item.label).includes(normalizedSearch)
+ );
+ }, [filter.elements, deferredSearchValue]);
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(
+ _ariakit_react__WEBPACK_IMPORTED_MODULE_5__.ComboboxProvider,
+ {
+ selectedValue: currentValue,
+ setSelectedValue: (value) => {
+ const newFilters = currentFilter ? [
+ ...(view.filters ?? []).map((_filter) => {
+ if (_filter.field === filter.field) {
+ return {
+ ..._filter,
+ operator: currentFilter.operator || filter.operators[0],
+ value
+ };
+ }
+ return _filter;
+ })
+ ] : [
+ ...view.filters ?? [],
+ {
+ field: filter.field,
+ operator: filter.operators[0],
+ value
+ }
+ ];
+ onChangeView({
+ ...view,
+ page: 1,
+ filters: newFilters
+ });
+ },
+ setValue: setSearchValue,
+ children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div", { className: "dataviews-filters__search-widget-filter-combobox__wrapper", children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
+ _ariakit_react__WEBPACK_IMPORTED_MODULE_4__.ComboboxLabel,
+ {
+ render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__.VisuallyHidden, { children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)("Search items") }),
+ children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)("Search items")
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
+ _ariakit_react__WEBPACK_IMPORTED_MODULE_0__.Combobox,
+ {
+ autoSelect: "always",
+ placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)("Search"),
+ className: "dataviews-filters__search-widget-filter-combobox__input"
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("div", { className: "dataviews-filters__search-widget-filter-combobox__icon", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__.Icon, { icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_13__["default"] }) })
+ ] }),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(
+ _ariakit_react__WEBPACK_IMPORTED_MODULE_1__.ComboboxList,
+ {
+ className: "dataviews-filters__search-widget-filter-combobox-list",
+ alwaysVisible: true,
+ children: [
+ matches.map((element) => {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(
+ _ariakit_react__WEBPACK_IMPORTED_MODULE_2__.ComboboxItem,
+ {
+ resetValueOnSelect: false,
+ value: element.value,
+ className: "dataviews-filters__search-widget-listitem",
+ hideOnClick: false,
+ setValueOnClick: false,
+ focusOnHover: true,
+ children: [
+ filter.singleSelection && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
+ SingleSelectionOption,
+ {
+ selected: currentValue === element.value
+ }
+ ),
+ !filter.singleSelection && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
+ MultiSelectionOption,
+ {
+ selected: currentValue.includes(
+ element.value
+ )
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("span", { children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
+ _ariakit_react__WEBPACK_IMPORTED_MODULE_3__.ComboboxItemValue,
+ {
+ className: "dataviews-filters__search-widget-filter-combobox-item-value",
+ value: element.label
+ }
+ ),
+ !!element.description && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("span", { className: "dataviews-filters__search-widget-listitem-description", children: element.description })
+ ] })
+ ]
+ },
+ element.value
+ );
+ }),
+ !matches.length && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("p", { children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)("No results found") })
+ ]
+ }
+ )
+ ]
+ }
+ );
+}
+function SearchWidget(props) {
+ const { elements, isLoading } = (0,_hooks_use_elements__WEBPACK_IMPORTED_MODULE_15__["default"])({
+ elements: props.filter.elements,
+ getElements: props.filter.getElements
+ });
+ if (isLoading) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("div", { className: "dataviews-filters__search-widget-no-elements", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__.Spinner, {}) });
+ }
+ if (elements.length === 0) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("div", { className: "dataviews-filters__search-widget-no-elements", children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)("No elements found") });
+ }
+ const Widget = elements.length > 10 ? ComboboxList2 : ListBox;
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(Widget, { ...props, filter: { ...props.filter, elements } });
+}
+
+//# sourceMappingURL=search-widget.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/toggle.js":
+/*!***********************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/toggle.js ***!
+ \***********************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ toggle_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/funnel.js");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _add_filter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./add-filter */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/add-filter.js");
+/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__);
+// packages/dataviews/src/components/dataviews-filters/toggle.tsx
+
+
+
+
+
+
+
+function FiltersToggle() {
+ const {
+ filters,
+ view,
+ onChangeView,
+ setOpenedFilter,
+ isShowingFilter,
+ setIsShowingFilter
+ } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_5__["default"]);
+ const buttonRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
+ const onChangeViewWithFilterVisibility = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(
+ (_view) => {
+ onChangeView(_view);
+ setIsShowingFilter(true);
+ },
+ [onChangeView, setIsShowingFilter]
+ );
+ const visibleFilters = filters.filter((filter) => filter.isVisible);
+ const hasVisibleFilters = !!visibleFilters.length;
+ if (filters.length === 0) {
+ return null;
+ }
+ const addFilterButtonProps = {
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Add filter"),
+ "aria-expanded": false,
+ isPressed: false
+ };
+ const toggleFiltersButtonProps = {
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__._x)("Filter", "verb"),
+ "aria-expanded": isShowingFilter,
+ isPressed: isShowingFilter,
+ onClick: () => {
+ if (!isShowingFilter) {
+ setOpenedFilter(null);
+ }
+ setIsShowingFilter(!isShowingFilter);
+ }
+ };
+ const buttonComponent = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button,
+ {
+ ref: buttonRef,
+ className: "dataviews-filters__visibility-toggle",
+ size: "compact",
+ icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"],
+ ...hasVisibleFilters ? toggleFiltersButtonProps : addFilterButtonProps
+ }
+ );
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", { className: "dataviews-filters__container-visibility-toggle", children: !hasVisibleFilters ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
+ _add_filter__WEBPACK_IMPORTED_MODULE_4__.AddFilterMenu,
+ {
+ filters,
+ view,
+ onChangeView: onChangeViewWithFilterVisibility,
+ setOpenedFilter,
+ triggerProps: { render: buttonComponent }
+ }
+ ) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
+ FilterVisibilityToggle,
+ {
+ buttonRef,
+ filtersCount: view.filters?.length,
+ children: buttonComponent
+ }
+ ) });
+}
+function FilterVisibilityToggle({
+ buttonRef,
+ filtersCount,
+ children
+}) {
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(
+ () => () => {
+ buttonRef.current?.focus();
+ },
+ [buttonRef]
+ );
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, { children: [
+ children,
+ !!filtersCount && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("span", { className: "dataviews-filters-toggle__count", children: filtersCount })
+ ] });
+}
+var toggle_default = FiltersToggle;
+
+//# sourceMappingURL=toggle.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/use-filters.js":
+/*!****************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/use-filters.js ***!
+ \****************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ use_filters_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+// packages/dataviews/src/components/dataviews-filters/use-filters.ts
+
+
+function useFilters(fields, view) {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
+ const filters = [];
+ fields.forEach((field) => {
+ if (field.filterBy === false || !field.hasElements && !field.Edit) {
+ return;
+ }
+ const operators = field.filterBy.operators;
+ const isPrimary = !!field.filterBy?.isPrimary;
+ const isLocked = view.filters?.some(
+ (f) => f.field === field.id && !!f.isLocked
+ ) ?? false;
+ filters.push({
+ field: field.id,
+ name: field.label,
+ elements: field.elements,
+ getElements: field.getElements,
+ hasElements: field.hasElements,
+ singleSelection: operators.some(
+ (op) => _constants__WEBPACK_IMPORTED_MODULE_1__.SINGLE_SELECTION_OPERATORS.includes(op)
+ ),
+ operators,
+ isVisible: isLocked || isPrimary || !!view.filters?.some(
+ (f) => f.field === field.id && _constants__WEBPACK_IMPORTED_MODULE_1__.ALL_OPERATORS.includes(f.operator)
+ ),
+ isPrimary,
+ isLocked
+ });
+ });
+ filters.sort((a, b) => {
+ if (a.isLocked && !b.isLocked) {
+ return -1;
+ }
+ if (!a.isLocked && b.isLocked) {
+ return 1;
+ }
+ if (a.isPrimary && !b.isPrimary) {
+ return -1;
+ }
+ if (!a.isPrimary && b.isPrimary) {
+ return 1;
+ }
+ return a.name.localeCompare(b.name);
+ });
+ return filters;
+ }, [fields, view]);
+}
+var use_filters_default = useFilters;
+
+//# sourceMappingURL=use-filters.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/utils.js":
+/*!**********************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/utils.js ***!
+ \**********************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ getCurrentValue: () => (/* binding */ getCurrentValue)
+/* harmony export */ });
+// packages/dataviews/src/components/dataviews-filters/utils.ts
+var EMPTY_ARRAY = [];
+var getCurrentValue = (filterDefinition, currentFilter) => {
+ if (filterDefinition.singleSelection) {
+ return currentFilter?.value;
+ }
+ if (Array.isArray(currentFilter?.value)) {
+ return currentFilter.value;
+ }
+ if (!Array.isArray(currentFilter?.value) && !!currentFilter?.value) {
+ return [currentFilter.value];
+ }
+ return EMPTY_ARRAY;
+};
+
+//# sourceMappingURL=utils.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-footer/index.js":
+/*!*********************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-footer/index.js ***!
+ \*********************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ DataViewsFooter)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
+/* harmony import */ var _dataviews_pagination__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../dataviews-pagination */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-pagination/index.js");
+/* harmony import */ var _dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../dataviews-bulk-actions */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-bulk-actions/index.js");
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__);
+// packages/dataviews/src/components/dataviews-footer/index.tsx
+
+
+
+
+
+
+
+var EMPTY_ARRAY = [];
+function DataViewsFooter() {
+ const {
+ view,
+ paginationInfo: { totalItems = 0, totalPages },
+ data,
+ actions = EMPTY_ARRAY
+ } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_2__["default"]);
+ const hasBulkActions = (0,_dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_4__.useSomeItemHasAPossibleBulkAction)(actions, data) && [_constants__WEBPACK_IMPORTED_MODULE_5__.LAYOUT_TABLE, _constants__WEBPACK_IMPORTED_MODULE_5__.LAYOUT_GRID].includes(view.type);
+ if (!totalItems || !totalPages || totalPages <= 1 && !hasBulkActions) {
+ return null;
+ }
+ return !!totalItems && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack,
+ {
+ expanded: false,
+ justify: "end",
+ className: "dataviews-footer",
+ children: [
+ hasBulkActions && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_4__.BulkActionsFooter, {}),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_dataviews_pagination__WEBPACK_IMPORTED_MODULE_3__["default"], {})
+ ]
+ }
+ );
+}
+
+//# sourceMappingURL=index.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-item-actions/index.js":
+/*!***************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-item-actions/index.js ***!
+ \***************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ ActionModal: () => (/* binding */ ActionModal),
+/* harmony export */ ActionsMenuGroup: () => (/* binding */ ActionsMenuGroup),
+/* harmony export */ "default": () => (/* binding */ ItemActions)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/more-vertical.js");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__);
+/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
+/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__);
+/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__);
+// packages/dataviews/src/components/dataviews-item-actions/index.tsx
+
+
+
+
+
+
+
+
+var { Menu, kebabCase } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_6__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.privateApis);
+function ButtonTrigger({
+ action,
+ onClick,
+ items
+}) {
+ const label = typeof action.label === "string" ? action.label : action.label(items);
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
+ {
+ disabled: !!action.disabled,
+ accessibleWhenDisabled: true,
+ size: "compact",
+ onClick,
+ children: label
+ }
+ );
+}
+function MenuItemTrigger({
+ action,
+ onClick,
+ items
+}) {
+ const label = typeof action.label === "string" ? action.label : action.label(items);
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(Menu.Item, { disabled: action.disabled, onClick, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(Menu.ItemLabel, { children: label }) });
+}
+function ActionModal({
+ action,
+ items,
+ closeModal
+}) {
+ const label = typeof action.label === "string" ? action.label : action.label(items);
+ const modalHeader = typeof action.modalHeader === "function" ? action.modalHeader(items) : action.modalHeader;
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Modal,
+ {
+ title: modalHeader || label,
+ __experimentalHideHeader: !!action.hideModalHeader,
+ onRequestClose: closeModal,
+ focusOnMount: action.modalFocusOnMount ?? true,
+ size: action.modalSize || "medium",
+ overlayClassName: `dataviews-action-modal dataviews-action-modal__${kebabCase(
+ action.id
+ )}`,
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(action.RenderModal, { items, closeModal })
+ }
+ );
+}
+function ActionsMenuGroup({
+ actions,
+ item,
+ registry,
+ setActiveModalAction
+}) {
+ const { primaryActions, regularActions } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
+ return actions.reduce(
+ (acc, action) => {
+ (action.isPrimary ? acc.primaryActions : acc.regularActions).push(action);
+ return acc;
+ },
+ {
+ primaryActions: [],
+ regularActions: []
+ }
+ );
+ }, [actions]);
+ const renderActionGroup = (actionList) => actionList.map((action) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
+ MenuItemTrigger,
+ {
+ action,
+ onClick: () => {
+ if ("RenderModal" in action) {
+ setActiveModalAction(action);
+ return;
+ }
+ action.callback([item], { registry });
+ },
+ items: [item]
+ },
+ action.id
+ ));
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(Menu.Group, { children: [
+ renderActionGroup(primaryActions),
+ primaryActions.length > 0 && regularActions.length > 0 && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(Menu.Separator, {}),
+ renderActionGroup(regularActions)
+ ] });
+}
+function ItemActions({
+ item,
+ actions,
+ isCompact
+}) {
+ const registry = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.useRegistry)();
+ const { primaryActions, eligibleActions } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
+ const _eligibleActions = actions.filter(
+ (action) => !action.isEligible || action.isEligible(item)
+ );
+ const _primaryActions = _eligibleActions.filter(
+ (action) => action.isPrimary
+ );
+ return {
+ primaryActions: _primaryActions,
+ eligibleActions: _eligibleActions
+ };
+ }, [actions, item]);
+ if (isCompact) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
+ CompactItemActions,
+ {
+ item,
+ actions: eligibleActions,
+ isSmall: true,
+ registry
+ }
+ );
+ }
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack,
+ {
+ spacing: 0,
+ justify: "flex-end",
+ className: "dataviews-item-actions",
+ style: {
+ flexShrink: 0,
+ width: "auto"
+ },
+ children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
+ PrimaryActions,
+ {
+ item,
+ actions: primaryActions,
+ registry
+ }
+ ),
+ primaryActions.length < eligibleActions.length && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
+ CompactItemActions,
+ {
+ item,
+ actions: eligibleActions,
+ registry
+ }
+ )
+ ]
+ }
+ );
+}
+function CompactItemActions({
+ item,
+ actions,
+ isSmall,
+ registry
+}) {
+ const [activeModalAction, setActiveModalAction] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(
+ null
+ );
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment, { children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(Menu, { placement: "bottom-end", children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
+ Menu.TriggerButton,
+ {
+ render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
+ {
+ size: isSmall ? "small" : "compact",
+ icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"],
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Actions"),
+ accessibleWhenDisabled: true,
+ disabled: !actions.length,
+ className: "dataviews-all-actions-button"
+ }
+ )
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(Menu.Popover, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
+ ActionsMenuGroup,
+ {
+ actions,
+ item,
+ registry,
+ setActiveModalAction
+ }
+ ) })
+ ] }),
+ !!activeModalAction && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
+ ActionModal,
+ {
+ action: activeModalAction,
+ items: [item],
+ closeModal: () => setActiveModalAction(null)
+ }
+ )
+ ] });
+}
+function PrimaryActions({
+ item,
+ actions,
+ registry
+}) {
+ const [activeModalAction, setActiveModalAction] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(null);
+ const isMobileViewport = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__.useViewportMatch)("medium", "<");
+ if (isMobileViewport) {
+ return null;
+ }
+ if (!Array.isArray(actions) || actions.length === 0) {
+ return null;
+ }
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment, { children: [
+ actions.map((action) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
+ ButtonTrigger,
+ {
+ action,
+ onClick: () => {
+ if ("RenderModal" in action) {
+ setActiveModalAction(action);
+ return;
+ }
+ action.callback([item], { registry });
+ },
+ items: [item]
+ },
+ action.id
+ )),
+ !!activeModalAction && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
+ ActionModal,
+ {
+ action: activeModalAction,
+ items: [item],
+ closeModal: () => setActiveModalAction(null)
+ }
+ )
+ ] });
+}
+
+//# sourceMappingURL=index.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-layout/index.js":
+/*!*********************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-layout/index.js ***!
+ \*********************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ DataViewsLayout)
+/* harmony export */ });
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
+/* harmony import */ var _dataviews_layouts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../dataviews-layouts */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/index.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
+// packages/dataviews/src/components/dataviews-layout/index.tsx
+
+
+
+
+
+function DataViewsLayout({ className }) {
+ const {
+ actions = [],
+ data,
+ fields,
+ getItemId,
+ getItemLevel,
+ isLoading,
+ view,
+ onChangeView,
+ selection,
+ onChangeSelection,
+ setOpenedFilter,
+ onClickItem,
+ isItemClickable,
+ renderItemLink,
+ defaultLayouts,
+ empty = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", { children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("No results") })
+ } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_2__["default"]);
+ const ViewComponent = _dataviews_layouts__WEBPACK_IMPORTED_MODULE_3__.VIEW_LAYOUTS.find(
+ (v) => v.type === view.type && defaultLayouts[v.type]
+ )?.component;
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
+ ViewComponent,
+ {
+ className,
+ actions,
+ data,
+ fields,
+ getItemId,
+ getItemLevel,
+ isLoading,
+ onChangeView,
+ onChangeSelection,
+ selection,
+ setOpenedFilter,
+ onClickItem,
+ renderItemLink,
+ isItemClickable,
+ view,
+ empty
+ }
+ );
+}
+
+//# sourceMappingURL=index.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-pagination/index.js":
+/*!*************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-pagination/index.js ***!
+ \*************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ DataViewsPagination: () => (/* binding */ DataViewsPagination),
+/* harmony export */ "default": () => (/* binding */ dataviews_pagination_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/next.js");
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/previous.js");
+/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__);
+// packages/dataviews/src/components/dataviews-pagination/index.tsx
+
+
+
+
+
+
+function DataViewsPagination() {
+ const {
+ view,
+ onChangeView,
+ paginationInfo: { totalItems = 0, totalPages }
+ } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_5__["default"]);
+ if (!totalItems || !totalPages || view.infiniteScrollEnabled) {
+ return null;
+ }
+ const currentPage = view.page ?? 1;
+ const pageSelectOptions = Array.from(Array(totalPages)).map(
+ (_, i) => {
+ const page = i + 1;
+ return {
+ value: page.toString(),
+ label: page.toString(),
+ "aria-label": currentPage === page ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ // translators: 1: current page number. 2: total number of pages.
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Page %1$d of %2$d"),
+ currentPage,
+ totalPages
+ ) : page.toString()
+ };
+ }
+ );
+ return !!totalItems && totalPages !== 1 && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack,
+ {
+ expanded: false,
+ className: "dataviews-pagination",
+ justify: "end",
+ spacing: 6,
+ children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack,
+ {
+ justify: "flex-start",
+ expanded: false,
+ spacing: 1,
+ className: "dataviews-pagination__page-select",
+ children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createInterpolateElement)(
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ // translators: 1: Current page number, 2: Total number of pages.
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__._x)(
+ "Page
%1$sof %2$d
",
+ "paging"
+ ),
+ "",
+ totalPages
+ ),
+ {
+ div: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", { "aria-hidden": true }),
+ CurrentPage: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.SelectControl,
+ {
+ "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Current page"),
+ value: currentPage.toString(),
+ options: pageSelectOptions,
+ onChange: (newValue) => {
+ onChangeView({
+ ...view,
+ page: +newValue
+ });
+ },
+ size: "small",
+ __nextHasNoMarginBottom: true,
+ variant: "minimal"
+ }
+ )
+ }
+ )
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack, { expanded: false, spacing: 1, children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
+ {
+ onClick: () => onChangeView({
+ ...view,
+ page: currentPage - 1
+ }),
+ disabled: currentPage === 1,
+ accessibleWhenDisabled: true,
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Previous page"),
+ icon: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.isRTL)() ? _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"] : _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__["default"],
+ showTooltip: true,
+ size: "compact",
+ tooltipPosition: "top"
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
+ {
+ onClick: () => onChangeView({ ...view, page: currentPage + 1 }),
+ disabled: currentPage >= totalPages,
+ accessibleWhenDisabled: true,
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Next page"),
+ icon: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.isRTL)() ? _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__["default"] : _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"],
+ showTooltip: true,
+ size: "compact",
+ tooltipPosition: "top"
+ }
+ )
+ ] })
+ ]
+ }
+ );
+}
+var dataviews_pagination_default = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.memo)(DataViewsPagination);
+
+//# sourceMappingURL=index.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-picker/footer.js":
+/*!**********************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-picker/footer.js ***!
+ \**********************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ DataViewsPickerFooter: () => (/* binding */ DataViewsPickerFooter),
+/* harmony export */ useIsMultiselectPicker: () => (/* binding */ useIsMultiselectPicker)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _dataviews_pagination__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../dataviews-pagination */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-pagination/index.js");
+/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__);
+// packages/dataviews/src/components/dataviews-picker/footer.tsx
+
+
+
+
+
+
+
+var EMPTY_ARRAY = [];
+function useIsMultiselectPicker(actions) {
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
+ return actions?.every((action) => action.supportsBulk);
+ }, [actions]);
+}
+function BulkSelectionCheckbox({
+ selection,
+ selectedItems,
+ onChangeSelection,
+ data,
+ getItemId
+}) {
+ const areAllSelected = selectedItems.length === data.length;
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.CheckboxControl,
+ {
+ className: "dataviews-view-table-selection-checkbox",
+ __nextHasNoMarginBottom: true,
+ checked: areAllSelected,
+ indeterminate: !areAllSelected && !!selectedItems.length,
+ onChange: () => {
+ if (areAllSelected) {
+ onChangeSelection(
+ selection.filter(
+ (id) => !data.some(
+ (item) => id === getItemId(item)
+ )
+ )
+ );
+ } else {
+ const selectionSet = /* @__PURE__ */ new Set([
+ ...selection,
+ ...data.map((item) => getItemId(item))
+ ]);
+ onChangeSelection(Array.from(selectionSet));
+ }
+ },
+ "aria-label": areAllSelected ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Deselect all") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Select all")
+ }
+ );
+}
+function ActionButtons({
+ actions,
+ items,
+ selection
+}) {
+ const registry = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useRegistry)();
+ const [actionInProgress, setActionInProgress] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(
+ null
+ );
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack, { expanded: false, spacing: 1, children: actions.map((action) => {
+ if (!("callback" in action)) {
+ return null;
+ }
+ const { id, label, icon, isPrimary, callback } = action;
+ const _label = typeof label === "string" ? label : label(items);
+ const variant = isPrimary ? "primary" : "tertiary";
+ const isInProgress = id === actionInProgress;
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
+ {
+ accessibleWhenDisabled: true,
+ icon,
+ disabled: isInProgress || !selection?.length,
+ isBusy: isInProgress,
+ onClick: async () => {
+ setActionInProgress(id);
+ await callback(items, {
+ registry
+ });
+ setActionInProgress(null);
+ },
+ size: "compact",
+ variant,
+ children: _label
+ },
+ id
+ );
+ }) });
+}
+function DataViewsPickerFooter() {
+ const {
+ data,
+ selection,
+ onChangeSelection,
+ getItemId,
+ actions = EMPTY_ARRAY
+ } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_5__["default"]);
+ const selectionCount = selection.length;
+ const isMultiselect = useIsMultiselectPicker(actions);
+ const message = selectionCount > 0 ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.sprintf)(
+ /* translators: %d: number of items. */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__._n)(
+ "%d Item selected",
+ "%d Items selected",
+ selectionCount
+ ),
+ selectionCount
+ ) : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.sprintf)(
+ /* translators: %d: number of items. */
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__._n)("%d Item", "%d Items", data.length),
+ data.length
+ );
+ const selectedItems = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(
+ () => data.filter((item) => selection.includes(getItemId(item))),
+ [selection, getItemId, data]
+ );
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack,
+ {
+ expanded: false,
+ justify: "space-between",
+ className: "dataviews-footer",
+ children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack,
+ {
+ className: "dataviews-picker-footer__bulk-selection",
+ expanded: false,
+ spacing: 3,
+ children: [
+ isMultiselect && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
+ BulkSelectionCheckbox,
+ {
+ selection,
+ selectedItems,
+ onChangeSelection,
+ data,
+ getItemId
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("span", { className: "dataviews-bulk-actions-footer__item-count", children: message })
+ ]
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_dataviews_pagination__WEBPACK_IMPORTED_MODULE_4__["default"], {}),
+ Boolean(actions?.length) && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", { className: "dataviews-picker-footer__actions", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
+ ActionButtons,
+ {
+ actions,
+ items: selectedItems,
+ selection
+ }
+ ) })
+ ]
+ }
+ );
+}
+
+//# sourceMappingURL=footer.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-search/index.js":
+/*!*********************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-search/index.js ***!
+ \*********************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ dataviews_search_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
+/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
+// packages/dataviews/src/components/dataviews-search/index.tsx
+
+
+
+
+
+
+var DataViewsSearch = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.memo)(function Search({ label }) {
+ const { view, onChangeView } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_4__["default"]);
+ const [search, setSearch, debouncedSearch] = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__.useDebouncedInput)(
+ view.search
+ );
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
+ setSearch(view.search ?? "");
+ }, [view.search, setSearch]);
+ const onChangeViewRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(onChangeView);
+ const viewRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(view);
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
+ onChangeViewRef.current = onChangeView;
+ viewRef.current = view;
+ }, [onChangeView, view]);
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
+ if (debouncedSearch !== viewRef.current?.search) {
+ onChangeViewRef.current({
+ ...viewRef.current,
+ page: 1,
+ search: debouncedSearch
+ });
+ }
+ }, [debouncedSearch]);
+ const searchLabel = label || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Search");
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.SearchControl,
+ {
+ className: "dataviews-search",
+ __nextHasNoMarginBottom: true,
+ onChange: setSearch,
+ value: search,
+ label: searchLabel,
+ placeholder: searchLabel,
+ size: "compact"
+ }
+ );
+});
+var dataviews_search_default = DataViewsSearch;
+
+//# sourceMappingURL=index.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-selection-checkbox/index.js":
+/*!*********************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-selection-checkbox/index.js ***!
+ \*********************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ DataViewsSelectionCheckbox)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
+// packages/dataviews/src/components/dataviews-selection-checkbox/index.tsx
+
+
+
+function DataViewsSelectionCheckbox({
+ selection,
+ onChangeSelection,
+ item,
+ getItemId,
+ titleField,
+ disabled,
+ ...extraProps
+}) {
+ const id = getItemId(item);
+ const checked = !disabled && selection.includes(id);
+ const selectionLabel = titleField?.getValue?.({ item }) || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("(no title)");
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.CheckboxControl,
+ {
+ className: "dataviews-selection-checkbox",
+ __nextHasNoMarginBottom: true,
+ "aria-label": selectionLabel,
+ "aria-disabled": disabled,
+ checked,
+ onChange: () => {
+ if (disabled) {
+ return;
+ }
+ onChangeSelection(
+ selection.includes(id) ? selection.filter((itemId) => id !== itemId) : [...selection, id]
+ );
+ },
+ ...extraProps
+ }
+ );
+}
+
+//# sourceMappingURL=index.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/index.js":
+/*!**************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/index.js ***!
+ \**************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ DataviewsViewConfigDropdown: () => (/* binding */ DataviewsViewConfigDropdown),
+/* harmony export */ ViewTypeMenu: () => (/* binding */ ViewTypeMenu),
+/* harmony export */ "default": () => (/* binding */ dataviews_view_config_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/cog.js");
+/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/warning */ "@wordpress/warning");
+/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_4__);
+/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
+/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__);
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+/* harmony import */ var _dataviews_layouts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../dataviews-layouts */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/index.js");
+/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
+/* harmony import */ var _infinite_scroll_toggle__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./infinite-scroll-toggle */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/infinite-scroll-toggle.js");
+/* harmony import */ var _properties_section__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./properties-section */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/properties-section.js");
+/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__);
+// packages/dataviews/src/components/dataviews-view-config/index.tsx
+
+
+
+
+
+
+
+
+
+
+
+
+
+var { Menu } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_11__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.privateApis);
+var DATAVIEWS_CONFIG_POPOVER_PROPS = {
+ className: "dataviews-config__popover",
+ placement: "bottom-end",
+ offset: 9
+};
+function ViewTypeMenu() {
+ const { view, onChangeView, defaultLayouts } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_8__["default"]);
+ const availableLayouts = Object.keys(defaultLayouts);
+ if (availableLayouts.length <= 1) {
+ return null;
+ }
+ const activeView = _dataviews_layouts__WEBPACK_IMPORTED_MODULE_7__.VIEW_LAYOUTS.find((v) => view.type === v.type);
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(Menu, { children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ Menu.TriggerButton,
+ {
+ render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
+ {
+ size: "compact",
+ icon: activeView?.icon,
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Layout")
+ }
+ )
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(Menu.Popover, { children: availableLayouts.map((layout) => {
+ const config = _dataviews_layouts__WEBPACK_IMPORTED_MODULE_7__.VIEW_LAYOUTS.find(
+ (v) => v.type === layout
+ );
+ if (!config) {
+ return null;
+ }
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ Menu.RadioItem,
+ {
+ value: layout,
+ name: "view-actions-available-view",
+ checked: layout === view.type,
+ hideOnClick: true,
+ onChange: (e) => {
+ switch (e.target.value) {
+ case "list":
+ case "grid":
+ case "table":
+ case "pickerGrid":
+ case "pickerTable":
+ const viewWithoutLayout = { ...view };
+ if ("layout" in viewWithoutLayout) {
+ delete viewWithoutLayout.layout;
+ }
+ return onChangeView({
+ ...viewWithoutLayout,
+ type: e.target.value,
+ ...defaultLayouts[e.target.value]
+ });
+ }
+ _wordpress_warning__WEBPACK_IMPORTED_MODULE_4___default()("Invalid dataview");
+ },
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(Menu.ItemLabel, { children: config.label })
+ },
+ layout
+ );
+ }) })
+ ] });
+}
+function SortFieldControl() {
+ const { view, fields, onChangeView } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_8__["default"]);
+ const orderOptions = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
+ const sortableFields = fields.filter(
+ (field) => field.enableSorting !== false
+ );
+ return sortableFields.map((field) => {
+ return {
+ label: field.label,
+ value: field.id
+ };
+ });
+ }, [fields]);
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.SelectControl,
+ {
+ __nextHasNoMarginBottom: true,
+ __next40pxDefaultSize: true,
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Sort by"),
+ value: view.sort?.field,
+ options: orderOptions,
+ onChange: (value) => {
+ onChangeView({
+ ...view,
+ sort: {
+ direction: view?.sort?.direction || "desc",
+ field: value
+ },
+ showLevels: false
+ });
+ }
+ }
+ );
+}
+function SortDirectionControl() {
+ const { view, fields, onChangeView } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_8__["default"]);
+ const sortableFields = fields.filter(
+ (field) => field.enableSorting !== false
+ );
+ if (sortableFields.length === 0) {
+ return null;
+ }
+ let value = view.sort?.direction;
+ if (!value && view.sort?.field) {
+ value = "desc";
+ }
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalToggleGroupControl,
+ {
+ className: "dataviews-view-config__sort-direction",
+ __nextHasNoMarginBottom: true,
+ __next40pxDefaultSize: true,
+ isBlock: true,
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Order"),
+ value,
+ onChange: (newDirection) => {
+ if (newDirection === "asc" || newDirection === "desc") {
+ onChangeView({
+ ...view,
+ sort: {
+ direction: newDirection,
+ field: view.sort?.field || // If there is no field assigned as the sorting field assign the first sortable field.
+ fields.find(
+ (field) => field.enableSorting !== false
+ )?.id || ""
+ },
+ showLevels: false
+ });
+ return;
+ }
+ _wordpress_warning__WEBPACK_IMPORTED_MODULE_4___default()("Invalid direction");
+ },
+ children: _constants__WEBPACK_IMPORTED_MODULE_6__.SORTING_DIRECTIONS.map((direction) => {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalToggleGroupControlOptionIcon,
+ {
+ value: direction,
+ icon: _constants__WEBPACK_IMPORTED_MODULE_6__.sortIcons[direction],
+ label: _constants__WEBPACK_IMPORTED_MODULE_6__.sortLabels[direction]
+ },
+ direction
+ );
+ })
+ }
+ );
+}
+function ItemsPerPageControl() {
+ const { view, config, onChangeView } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_8__["default"]);
+ const { infiniteScrollEnabled } = view;
+ if (!config || !config.perPageSizes || config.perPageSizes.length < 2 || config.perPageSizes.length > 6 || infiniteScrollEnabled) {
+ return null;
+ }
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalToggleGroupControl,
+ {
+ __nextHasNoMarginBottom: true,
+ __next40pxDefaultSize: true,
+ isBlock: true,
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Items per page"),
+ value: view.perPage || 10,
+ disabled: !view?.sort?.field,
+ onChange: (newItemsPerPage) => {
+ const newItemsPerPageNumber = typeof newItemsPerPage === "number" || newItemsPerPage === void 0 ? newItemsPerPage : parseInt(newItemsPerPage, 10);
+ onChangeView({
+ ...view,
+ perPage: newItemsPerPageNumber,
+ page: 1
+ });
+ },
+ children: config.perPageSizes.map((value) => {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalToggleGroupControlOption,
+ {
+ value,
+ label: value.toString()
+ },
+ value
+ );
+ })
+ }
+ );
+}
+function SettingsSection({
+ title,
+ description,
+ children
+}) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalGrid, { columns: 12, className: "dataviews-settings-section", gap: 4, children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", { className: "dataviews-settings-section__sidebar", children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHeading,
+ {
+ level: 2,
+ className: "dataviews-settings-section__title",
+ children: title
+ }
+ ),
+ description && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalText,
+ {
+ variant: "muted",
+ className: "dataviews-settings-section__description",
+ children: description
+ }
+ )
+ ] }),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalGrid,
+ {
+ columns: 8,
+ gap: 4,
+ className: "dataviews-settings-section__content",
+ children
+ }
+ )
+ ] });
+}
+function DataviewsViewConfigDropdown() {
+ const { view } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_8__["default"]);
+ const popoverId = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__.useInstanceId)(
+ _DataViewsViewConfig,
+ "dataviews-view-config-dropdown"
+ );
+ const activeLayout = _dataviews_layouts__WEBPACK_IMPORTED_MODULE_7__.VIEW_LAYOUTS.find(
+ (layout) => layout.type === view.type
+ );
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Dropdown,
+ {
+ expandOnMobile: true,
+ popoverProps: {
+ ...DATAVIEWS_CONFIG_POPOVER_PROPS,
+ id: popoverId
+ },
+ renderToggle: ({ onToggle, isOpen }) => {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
+ {
+ size: "compact",
+ icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"],
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x)("View options", "View is used as a noun"),
+ onClick: onToggle,
+ "aria-expanded": isOpen ? "true" : "false",
+ "aria-controls": popoverId
+ }
+ );
+ },
+ renderContent: () => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalDropdownContentWrapper,
+ {
+ paddingSize: "medium",
+ className: "dataviews-config__popover-content-wrapper",
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalVStack, { className: "dataviews-view-config", spacing: 6, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(SettingsSection, { title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Appearance"), children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack, { expanded: true, className: "is-divided-in-two", children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(SortFieldControl, {}),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(SortDirectionControl, {})
+ ] }),
+ !!activeLayout?.viewConfigOptions && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(activeLayout.viewConfigOptions, {}),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_infinite_scroll_toggle__WEBPACK_IMPORTED_MODULE_9__["default"], {}),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(ItemsPerPageControl, {}),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_properties_section__WEBPACK_IMPORTED_MODULE_10__.PropertiesSection, {})
+ ] }) })
+ }
+ )
+ }
+ );
+}
+function _DataViewsViewConfig() {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.Fragment, { children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(ViewTypeMenu, {}),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(DataviewsViewConfigDropdown, {})
+ ] });
+}
+var DataViewsViewConfig = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.memo)(_DataViewsViewConfig);
+var dataviews_view_config_default = DataViewsViewConfig;
+
+//# sourceMappingURL=index.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/infinite-scroll-toggle.js":
+/*!*******************************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/infinite-scroll-toggle.js ***!
+ \*******************************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ InfiniteScrollToggle)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
+// packages/dataviews/src/components/dataviews-view-config/infinite-scroll-toggle.tsx
+
+
+
+
+
+function InfiniteScrollToggle() {
+ const context = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_3__["default"]);
+ const { view, onChangeView } = context;
+ const infiniteScrollEnabled = view.infiniteScrollEnabled ?? false;
+ if (!context.hasInfiniteScrollHandler) {
+ return null;
+ }
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.ToggleControl,
+ {
+ __nextHasNoMarginBottom: true,
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Enable infinite scroll"),
+ help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)(
+ "Automatically load more content as you scroll, instead of showing pagination links."
+ ),
+ checked: infiniteScrollEnabled,
+ onChange: (newValue) => {
+ onChangeView({
+ ...view,
+ infiniteScrollEnabled: newValue
+ });
+ }
+ }
+ );
+}
+
+//# sourceMappingURL=infinite-scroll-toggle.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/properties-section.js":
+/*!***************************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/properties-section.js ***!
+ \***************************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ PropertiesSection: () => (/* binding */ PropertiesSection)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/check.js");
+/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
+// packages/dataviews/src/components/dataviews-view-config/properties-section.tsx
+
+
+
+
+
+
+function FieldItem({
+ field,
+ isVisible,
+ onToggleVisibility
+}) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalItem, { onClick: field.enableHiding ? onToggleVisibility : void 0, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack, { expanded: true, justify: "flex-start", alignment: "center", children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", { style: { height: 24, width: 24 }, children: isVisible && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Icon, { icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"] }) }),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("span", { className: "dataviews-view-config__label", children: field.label })
+ ] }) });
+}
+function isDefined(item) {
+ return !!item;
+}
+function PropertiesSection({
+ showLabel = true
+}) {
+ const { view, fields, onChangeView } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_4__["default"]);
+ const togglableFields = [
+ view?.titleField,
+ view?.mediaField,
+ view?.descriptionField
+ ].filter(Boolean);
+ const regularFields = fields.filter(
+ (f) => !togglableFields.includes(f.id) && f.type !== "media" && f.enableHiding !== false
+ );
+ if (!regularFields?.length) {
+ return null;
+ }
+ const titleField = fields.find((f) => f.id === view.titleField);
+ const previewField = fields.find((f) => f.id === view.mediaField);
+ const descriptionField = fields.find(
+ (f) => f.id === view.descriptionField
+ );
+ const lockedFields = [
+ {
+ field: titleField,
+ isVisibleFlag: "showTitle"
+ },
+ {
+ field: previewField,
+ isVisibleFlag: "showMedia"
+ },
+ {
+ field: descriptionField,
+ isVisibleFlag: "showDescription"
+ }
+ ].filter(({ field }) => isDefined(field));
+ const visibleFieldIds = view.fields ?? [];
+ const visibleRegularFieldsCount = regularFields.filter(
+ (f) => visibleFieldIds.includes(f.id)
+ ).length;
+ let visibleLockedFields = lockedFields.filter(
+ ({ field, isVisibleFlag }) => (
+ // @ts-expect-error
+ isDefined(field) && (view[isVisibleFlag] ?? true)
+ )
+ );
+ const totalVisibleFields = visibleLockedFields.length + visibleRegularFieldsCount;
+ if (totalVisibleFields === 1) {
+ if (visibleLockedFields.length === 1) {
+ visibleLockedFields = visibleLockedFields.map((locked) => ({
+ ...locked,
+ field: { ...locked.field, enableHiding: false }
+ }));
+ }
+ }
+ const hiddenLockedFields = lockedFields.filter(
+ ({ field, isVisibleFlag }) => (
+ // @ts-expect-error
+ isDefined(field) && !(view[isVisibleFlag] ?? true)
+ )
+ );
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalVStack, { className: "dataviews-field-control", spacing: 0, children: [
+ showLabel && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.BaseControl.VisualLabel, { children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Properties") }),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalVStack, { className: "dataviews-view-config__properties", spacing: 0, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalItemGroup, { isBordered: true, isSeparated: true, size: "medium", children: [
+ visibleLockedFields.map(({ field, isVisibleFlag }) => {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
+ FieldItem,
+ {
+ field,
+ isVisible: true,
+ onToggleVisibility: () => {
+ onChangeView({
+ ...view,
+ [isVisibleFlag]: false
+ });
+ }
+ },
+ field.id
+ );
+ }),
+ hiddenLockedFields.map(({ field, isVisibleFlag }) => {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
+ FieldItem,
+ {
+ field,
+ isVisible: false,
+ onToggleVisibility: () => {
+ onChangeView({
+ ...view,
+ [isVisibleFlag]: true
+ });
+ }
+ },
+ field.id
+ );
+ }),
+ regularFields.map((field) => {
+ const isVisible = visibleFieldIds.includes(field.id);
+ const isLastVisible = totalVisibleFields === 1 && isVisible;
+ const fieldToRender = isLastVisible ? { ...field, enableHiding: false } : field;
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
+ FieldItem,
+ {
+ field: fieldToRender,
+ isVisible,
+ onToggleVisibility: () => {
+ onChangeView({
+ ...view,
+ fields: isVisible ? visibleFieldIds.filter(
+ (fieldId) => fieldId !== field.id
+ ) : [...visibleFieldIds, field.id]
+ });
+ }
+ },
+ field.id
+ );
+ })
+ ] }) })
+ ] });
+}
+
+//# sourceMappingURL=properties-section.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews/index.js":
+/*!**************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews/index.js ***!
+ \**************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ dataviews_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
+/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
+/* harmony import */ var _dataviews_layouts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../dataviews-layouts */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/index.js");
+/* harmony import */ var _dataviews_filters__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dataviews-filters */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filters.js");
+/* harmony import */ var _dataviews_filters__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../dataviews-filters */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/toggle.js");
+/* harmony import */ var _dataviews_filters__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../dataviews-filters */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/use-filters.js");
+/* harmony import */ var _dataviews_filters__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../dataviews-filters */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filters-toggled.js");
+/* harmony import */ var _dataviews_layout__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../dataviews-layout */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-layout/index.js");
+/* harmony import */ var _dataviews_footer__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../dataviews-footer */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-footer/index.js");
+/* harmony import */ var _dataviews_search__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../dataviews-search */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-search/index.js");
+/* harmony import */ var _dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../dataviews-bulk-actions */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-bulk-actions/index.js");
+/* harmony import */ var _dataviews_pagination__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../dataviews-pagination */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-pagination/index.js");
+/* harmony import */ var _dataviews_view_config__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../dataviews-view-config */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/index.js");
+/* harmony import */ var _utils_normalize_fields__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../utils/normalize-fields */ "./node_modules/@wordpress/dataviews/build-module/utils/normalize-fields.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__);
+// packages/dataviews/src/components/dataviews/index.tsx
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+var defaultGetItemId = (item) => item.id;
+var defaultIsItemClickable = () => true;
+var EMPTY_ARRAY = [];
+var dataViewsLayouts = _dataviews_layouts__WEBPACK_IMPORTED_MODULE_4__.VIEW_LAYOUTS.filter(
+ (viewLayout) => !viewLayout.isPicker
+);
+function DefaultUI({
+ header,
+ search = true,
+ searchLabel = void 0
+}) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.Fragment, { children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack,
+ {
+ alignment: "top",
+ justify: "space-between",
+ className: "dataviews__view-actions",
+ spacing: 1,
+ children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack,
+ {
+ justify: "start",
+ expanded: false,
+ className: "dataviews__search",
+ children: [
+ search && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_dataviews_search__WEBPACK_IMPORTED_MODULE_11__["default"], { label: searchLabel }),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_dataviews_filters__WEBPACK_IMPORTED_MODULE_6__["default"], {})
+ ]
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack,
+ {
+ spacing: 1,
+ expanded: false,
+ style: { flexShrink: 0 },
+ children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_dataviews_view_config__WEBPACK_IMPORTED_MODULE_14__["default"], {}),
+ header
+ ]
+ }
+ )
+ ]
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_dataviews_filters__WEBPACK_IMPORTED_MODULE_8__["default"], { className: "dataviews-filters__container" }),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_dataviews_layout__WEBPACK_IMPORTED_MODULE_9__["default"], {}),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_dataviews_footer__WEBPACK_IMPORTED_MODULE_10__["default"], {})
+ ] });
+}
+function DataViews({
+ view,
+ onChangeView,
+ fields,
+ search = true,
+ searchLabel = void 0,
+ actions = EMPTY_ARRAY,
+ data,
+ getItemId = defaultGetItemId,
+ getItemLevel,
+ isLoading = false,
+ paginationInfo,
+ defaultLayouts: defaultLayoutsProperty,
+ selection: selectionProperty,
+ onChangeSelection,
+ onClickItem,
+ renderItemLink,
+ isItemClickable = defaultIsItemClickable,
+ header,
+ children,
+ config = { perPageSizes: [10, 20, 50, 100] },
+ empty
+}) {
+ const { infiniteScrollHandler } = paginationInfo;
+ const containerRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
+ const [containerWidth, setContainerWidth] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(0);
+ const resizeObserverRef = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__.useResizeObserver)(
+ (resizeObserverEntries) => {
+ setContainerWidth(
+ resizeObserverEntries[0].borderBoxSize[0].inlineSize
+ );
+ },
+ { box: "border-box" }
+ );
+ const [selectionState, setSelectionState] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
+ const isUncontrolled = selectionProperty === void 0 || onChangeSelection === void 0;
+ const selection = isUncontrolled ? selectionState : selectionProperty;
+ const [openedFilter, setOpenedFilter] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(null);
+ function setSelectionWithChange(value) {
+ const newValue = typeof value === "function" ? value(selection) : value;
+ if (isUncontrolled) {
+ setSelectionState(newValue);
+ }
+ if (onChangeSelection) {
+ onChangeSelection(newValue);
+ }
+ }
+ const _fields = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => (0,_utils_normalize_fields__WEBPACK_IMPORTED_MODULE_15__["default"])(fields), [fields]);
+ const _selection = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
+ return selection.filter(
+ (id) => data.some((item) => getItemId(item) === id)
+ );
+ }, [selection, data, getItemId]);
+ const filters = (0,_dataviews_filters__WEBPACK_IMPORTED_MODULE_7__["default"])(_fields, view);
+ const hasPrimaryOrLockedFilters = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
+ () => (filters || []).some(
+ (filter) => filter.isPrimary || filter.isLocked
+ ),
+ [filters]
+ );
+ const [isShowingFilter, setIsShowingFilter] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(
+ hasPrimaryOrLockedFilters
+ );
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
+ if (hasPrimaryOrLockedFilters && !isShowingFilter) {
+ setIsShowingFilter(true);
+ }
+ }, [hasPrimaryOrLockedFilters, isShowingFilter]);
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
+ if (!view.infiniteScrollEnabled || !containerRef.current) {
+ return;
+ }
+ const handleScroll = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__.throttle)((event) => {
+ const target = event.target;
+ const scrollTop = target.scrollTop;
+ const scrollHeight = target.scrollHeight;
+ const clientHeight = target.clientHeight;
+ if (scrollTop + clientHeight >= scrollHeight - 100) {
+ infiniteScrollHandler?.();
+ }
+ }, 100);
+ const container = containerRef.current;
+ container.addEventListener("scroll", handleScroll);
+ return () => {
+ container.removeEventListener("scroll", handleScroll);
+ handleScroll.cancel();
+ };
+ }, [infiniteScrollHandler, view.infiniteScrollEnabled]);
+ const defaultLayouts = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
+ () => Object.fromEntries(
+ Object.entries(defaultLayoutsProperty).filter(
+ ([layoutType]) => {
+ return dataViewsLayouts.some(
+ (viewLayout) => viewLayout.type === layoutType
+ );
+ }
+ )
+ ),
+ [defaultLayoutsProperty]
+ );
+ if (!defaultLayouts[view.type]) {
+ return null;
+ }
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
+ _dataviews_context__WEBPACK_IMPORTED_MODULE_3__["default"].Provider,
+ {
+ value: {
+ view,
+ onChangeView,
+ fields: _fields,
+ actions,
+ data,
+ isLoading,
+ paginationInfo,
+ selection: _selection,
+ onChangeSelection: setSelectionWithChange,
+ openedFilter,
+ setOpenedFilter,
+ getItemId,
+ getItemLevel,
+ isItemClickable,
+ onClickItem,
+ renderItemLink,
+ containerWidth,
+ containerRef,
+ resizeObserverRef,
+ defaultLayouts,
+ filters,
+ isShowingFilter,
+ setIsShowingFilter,
+ config,
+ empty,
+ hasInfiniteScrollHandler: !!infiniteScrollHandler
+ },
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("div", { className: "dataviews-wrapper", ref: containerRef, children: children ?? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
+ DefaultUI,
+ {
+ header,
+ search,
+ searchLabel
+ }
+ ) })
+ }
+ );
+}
+var DataViewsSubComponents = DataViews;
+DataViewsSubComponents.BulkActionToolbar = _dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_12__.BulkActionsFooter;
+DataViewsSubComponents.Filters = _dataviews_filters__WEBPACK_IMPORTED_MODULE_5__["default"];
+DataViewsSubComponents.FiltersToggled = _dataviews_filters__WEBPACK_IMPORTED_MODULE_8__["default"];
+DataViewsSubComponents.FiltersToggle = _dataviews_filters__WEBPACK_IMPORTED_MODULE_6__["default"];
+DataViewsSubComponents.Layout = _dataviews_layout__WEBPACK_IMPORTED_MODULE_9__["default"];
+DataViewsSubComponents.LayoutSwitcher = _dataviews_view_config__WEBPACK_IMPORTED_MODULE_14__.ViewTypeMenu;
+DataViewsSubComponents.Pagination = _dataviews_pagination__WEBPACK_IMPORTED_MODULE_13__.DataViewsPagination;
+DataViewsSubComponents.Search = _dataviews_search__WEBPACK_IMPORTED_MODULE_11__["default"];
+DataViewsSubComponents.ViewConfig = _dataviews_view_config__WEBPACK_IMPORTED_MODULE_14__.DataviewsViewConfigDropdown;
+DataViewsSubComponents.Footer = _dataviews_footer__WEBPACK_IMPORTED_MODULE_10__["default"];
+var dataviews_default = DataViewsSubComponents;
+
+//# sourceMappingURL=index.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/constants.js":
+/*!*********************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/constants.js ***!
+ \*********************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ ALL_OPERATORS: () => (/* binding */ ALL_OPERATORS),
+/* harmony export */ LAYOUT_GRID: () => (/* binding */ LAYOUT_GRID),
+/* harmony export */ LAYOUT_LIST: () => (/* binding */ LAYOUT_LIST),
+/* harmony export */ LAYOUT_PICKER_GRID: () => (/* binding */ LAYOUT_PICKER_GRID),
+/* harmony export */ LAYOUT_PICKER_TABLE: () => (/* binding */ LAYOUT_PICKER_TABLE),
+/* harmony export */ LAYOUT_TABLE: () => (/* binding */ LAYOUT_TABLE),
+/* harmony export */ OPERATORS: () => (/* binding */ OPERATORS),
+/* harmony export */ OPERATOR_AFTER: () => (/* binding */ OPERATOR_AFTER),
+/* harmony export */ OPERATOR_AFTER_INC: () => (/* binding */ OPERATOR_AFTER_INC),
+/* harmony export */ OPERATOR_BEFORE: () => (/* binding */ OPERATOR_BEFORE),
+/* harmony export */ OPERATOR_BEFORE_INC: () => (/* binding */ OPERATOR_BEFORE_INC),
+/* harmony export */ OPERATOR_BETWEEN: () => (/* binding */ OPERATOR_BETWEEN),
+/* harmony export */ OPERATOR_CONTAINS: () => (/* binding */ OPERATOR_CONTAINS),
+/* harmony export */ OPERATOR_GREATER_THAN: () => (/* binding */ OPERATOR_GREATER_THAN),
+/* harmony export */ OPERATOR_GREATER_THAN_OR_EQUAL: () => (/* binding */ OPERATOR_GREATER_THAN_OR_EQUAL),
+/* harmony export */ OPERATOR_IN_THE_PAST: () => (/* binding */ OPERATOR_IN_THE_PAST),
+/* harmony export */ OPERATOR_IS: () => (/* binding */ OPERATOR_IS),
+/* harmony export */ OPERATOR_IS_ALL: () => (/* binding */ OPERATOR_IS_ALL),
+/* harmony export */ OPERATOR_IS_ANY: () => (/* binding */ OPERATOR_IS_ANY),
+/* harmony export */ OPERATOR_IS_NONE: () => (/* binding */ OPERATOR_IS_NONE),
+/* harmony export */ OPERATOR_IS_NOT: () => (/* binding */ OPERATOR_IS_NOT),
+/* harmony export */ OPERATOR_IS_NOT_ALL: () => (/* binding */ OPERATOR_IS_NOT_ALL),
+/* harmony export */ OPERATOR_LESS_THAN: () => (/* binding */ OPERATOR_LESS_THAN),
+/* harmony export */ OPERATOR_LESS_THAN_OR_EQUAL: () => (/* binding */ OPERATOR_LESS_THAN_OR_EQUAL),
+/* harmony export */ OPERATOR_NOT_CONTAINS: () => (/* binding */ OPERATOR_NOT_CONTAINS),
+/* harmony export */ OPERATOR_NOT_ON: () => (/* binding */ OPERATOR_NOT_ON),
+/* harmony export */ OPERATOR_ON: () => (/* binding */ OPERATOR_ON),
+/* harmony export */ OPERATOR_OVER: () => (/* binding */ OPERATOR_OVER),
+/* harmony export */ OPERATOR_STARTS_WITH: () => (/* binding */ OPERATOR_STARTS_WITH),
+/* harmony export */ SINGLE_SELECTION_OPERATORS: () => (/* binding */ SINGLE_SELECTION_OPERATORS),
+/* harmony export */ SORTING_DIRECTIONS: () => (/* binding */ SORTING_DIRECTIONS),
+/* harmony export */ sortArrows: () => (/* binding */ sortArrows),
+/* harmony export */ sortIcons: () => (/* binding */ sortIcons),
+/* harmony export */ sortLabels: () => (/* binding */ sortLabels),
+/* harmony export */ sortValues: () => (/* binding */ sortValues)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/arrow-down.js");
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/arrow-up.js");
+// packages/dataviews/src/constants.ts
+
+
+var OPERATOR_IS = "is";
+var OPERATOR_IS_NOT = "isNot";
+var OPERATOR_IS_ANY = "isAny";
+var OPERATOR_IS_NONE = "isNone";
+var OPERATOR_IS_ALL = "isAll";
+var OPERATOR_IS_NOT_ALL = "isNotAll";
+var OPERATOR_LESS_THAN = "lessThan";
+var OPERATOR_GREATER_THAN = "greaterThan";
+var OPERATOR_LESS_THAN_OR_EQUAL = "lessThanOrEqual";
+var OPERATOR_GREATER_THAN_OR_EQUAL = "greaterThanOrEqual";
+var OPERATOR_BEFORE = "before";
+var OPERATOR_AFTER = "after";
+var OPERATOR_BEFORE_INC = "beforeInc";
+var OPERATOR_AFTER_INC = "afterInc";
+var OPERATOR_CONTAINS = "contains";
+var OPERATOR_NOT_CONTAINS = "notContains";
+var OPERATOR_STARTS_WITH = "startsWith";
+var OPERATOR_BETWEEN = "between";
+var OPERATOR_ON = "on";
+var OPERATOR_NOT_ON = "notOn";
+var OPERATOR_IN_THE_PAST = "inThePast";
+var OPERATOR_OVER = "over";
+var ALL_OPERATORS = [
+ OPERATOR_IS,
+ OPERATOR_IS_NOT,
+ OPERATOR_IS_ANY,
+ OPERATOR_IS_NONE,
+ OPERATOR_IS_ALL,
+ OPERATOR_IS_NOT_ALL,
+ OPERATOR_LESS_THAN,
+ OPERATOR_GREATER_THAN,
+ OPERATOR_LESS_THAN_OR_EQUAL,
+ OPERATOR_GREATER_THAN_OR_EQUAL,
+ OPERATOR_BEFORE,
+ OPERATOR_AFTER,
+ OPERATOR_BEFORE_INC,
+ OPERATOR_AFTER_INC,
+ OPERATOR_CONTAINS,
+ OPERATOR_NOT_CONTAINS,
+ OPERATOR_STARTS_WITH,
+ OPERATOR_BETWEEN,
+ OPERATOR_ON,
+ OPERATOR_NOT_ON,
+ OPERATOR_IN_THE_PAST,
+ OPERATOR_OVER
+];
+var SINGLE_SELECTION_OPERATORS = [
+ OPERATOR_IS,
+ OPERATOR_IS_NOT,
+ OPERATOR_LESS_THAN,
+ OPERATOR_GREATER_THAN,
+ OPERATOR_LESS_THAN_OR_EQUAL,
+ OPERATOR_GREATER_THAN_OR_EQUAL,
+ OPERATOR_BEFORE,
+ OPERATOR_AFTER,
+ OPERATOR_BEFORE_INC,
+ OPERATOR_AFTER_INC,
+ OPERATOR_CONTAINS,
+ OPERATOR_NOT_CONTAINS,
+ OPERATOR_STARTS_WITH,
+ OPERATOR_ON,
+ OPERATOR_NOT_ON
+];
+var OPERATORS = {
+ [OPERATOR_IS]: {
+ key: "is-filter",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Is")
+ },
+ [OPERATOR_IS_NOT]: {
+ key: "is-not-filter",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Is not")
+ },
+ [OPERATOR_IS_ANY]: {
+ key: "is-any-filter",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Is any")
+ },
+ [OPERATOR_IS_NONE]: {
+ key: "is-none-filter",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Is none")
+ },
+ [OPERATOR_IS_ALL]: {
+ key: "is-all-filter",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Is all")
+ },
+ [OPERATOR_IS_NOT_ALL]: {
+ key: "is-not-all-filter",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Is not all")
+ },
+ [OPERATOR_LESS_THAN]: {
+ key: "less-than-filter",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Less than")
+ },
+ [OPERATOR_GREATER_THAN]: {
+ key: "greater-than-filter",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Greater than")
+ },
+ [OPERATOR_LESS_THAN_OR_EQUAL]: {
+ key: "less-than-or-equal-filter",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Less than or equal")
+ },
+ [OPERATOR_GREATER_THAN_OR_EQUAL]: {
+ key: "greater-than-or-equal-filter",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Greater than or equal")
+ },
+ [OPERATOR_BEFORE]: {
+ key: "before-filter",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Before")
+ },
+ [OPERATOR_AFTER]: {
+ key: "after-filter",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("After")
+ },
+ [OPERATOR_BEFORE_INC]: {
+ key: "before-inc-filter",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Before (inc)")
+ },
+ [OPERATOR_AFTER_INC]: {
+ key: "after-inc-filter",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("After (inc)")
+ },
+ [OPERATOR_CONTAINS]: {
+ key: "contains-filter",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Contains")
+ },
+ [OPERATOR_NOT_CONTAINS]: {
+ key: "not-contains-filter",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Doesn't contain")
+ },
+ [OPERATOR_STARTS_WITH]: {
+ key: "starts-with-filter",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Starts with")
+ },
+ [OPERATOR_BETWEEN]: {
+ key: "between-filter",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Between (inc)")
+ },
+ [OPERATOR_ON]: {
+ key: "on-filter",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("On")
+ },
+ [OPERATOR_NOT_ON]: {
+ key: "not-on-filter",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Not on")
+ },
+ [OPERATOR_IN_THE_PAST]: {
+ key: "in-the-past-filter",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("In the past")
+ },
+ [OPERATOR_OVER]: {
+ key: "over-filter",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Over")
+ }
+};
+var SORTING_DIRECTIONS = ["asc", "desc"];
+var sortArrows = { asc: "\u2191", desc: "\u2193" };
+var sortValues = { asc: "ascending", desc: "descending" };
+var sortLabels = {
+ asc: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Sort ascending"),
+ desc: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Sort descending")
+};
+var sortIcons = {
+ asc: _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"],
+ desc: _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__["default"]
+};
+var LAYOUT_TABLE = "table";
+var LAYOUT_GRID = "grid";
+var LAYOUT_LIST = "list";
+var LAYOUT_PICKER_GRID = "pickerGrid";
+var LAYOUT_PICKER_TABLE = "pickerTable";
+
+//# sourceMappingURL=constants.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/array.js":
+/*!***********************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/array.js ***!
+ \***********************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ ArrayControl)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
+/* harmony import */ var _utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/get-custom-validity */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js");
+/* harmony import */ var _hooks_use_elements__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../hooks/use-elements */ "./node_modules/@wordpress/dataviews/build-module/hooks/use-elements.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
+// packages/dataviews/src/dataform-controls/array.tsx
+
+
+
+
+
+
+var { ValidatedFormTokenField } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_2__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.privateApis);
+function ArrayControl({
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ validity
+}) {
+ const { label, placeholder, getValue, setValue, isValid } = field;
+ const value = getValue({ item: data });
+ const { elements, isLoading } = (0,_hooks_use_elements__WEBPACK_IMPORTED_MODULE_4__["default"])({
+ elements: field.elements,
+ getElements: field.getElements
+ });
+ const arrayValueAsElements = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
+ () => Array.isArray(value) ? value.map((token) => {
+ const element = elements?.find(
+ (suggestion) => suggestion.value === token
+ );
+ return element || { value: token, label: token };
+ }) : [],
+ [value, elements]
+ );
+ const onChangeControl = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
+ (tokens) => {
+ const valueTokens = tokens.map((token) => {
+ if (typeof token === "object" && "value" in token) {
+ return token.value;
+ }
+ return token;
+ });
+ onChange(setValue({ item: data, value: valueTokens }));
+ },
+ [onChange, setValue, data]
+ );
+ if (isLoading) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Spinner, {});
+ }
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
+ ValidatedFormTokenField,
+ {
+ required: !!isValid?.required,
+ customValidity: (0,_utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__["default"])(isValid, validity),
+ label: hideLabelFromVision ? void 0 : label,
+ value: arrayValueAsElements,
+ onChange: onChangeControl,
+ placeholder,
+ suggestions: elements?.map((element) => element.value),
+ __experimentalValidateInput: (token) => {
+ if (field.isValid?.elements && elements) {
+ return elements.some(
+ (element) => element.value === token || element.label === token
+ );
+ }
+ return true;
+ },
+ __experimentalExpandOnFocus: elements && elements.length > 0,
+ __experimentalShowHowTo: !field.isValid?.elements,
+ displayTransform: (token) => {
+ if (typeof token === "object" && "label" in token) {
+ return token.label;
+ }
+ if (typeof token === "string" && elements) {
+ const element = elements.find(
+ (el) => el.value === token
+ );
+ return element?.label || token;
+ }
+ return token;
+ },
+ __experimentalRenderItem: ({ item }) => {
+ if (typeof item === "string" && elements) {
+ const element = elements.find(
+ (el) => el.value === item
+ );
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("span", { children: element?.label || item });
+ }
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("span", { children: item });
+ }
+ }
+ );
+}
+
+//# sourceMappingURL=array.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/checkbox.js":
+/*!**************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/checkbox.js ***!
+ \**************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ Checkbox)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
+/* harmony import */ var _utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/get-custom-validity */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
+// packages/dataviews/src/dataform-controls/checkbox.tsx
+
+
+
+
+
+var { ValidatedCheckboxControl } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_2__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.privateApis);
+function Checkbox({
+ field,
+ onChange,
+ data,
+ hideLabelFromVision,
+ validity
+}) {
+ const { getValue, setValue, label, description, isValid } = field;
+ const onChangeControl = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
+ onChange(
+ setValue({ item: data, value: !getValue({ item: data }) })
+ );
+ }, [data, getValue, onChange, setValue]);
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
+ ValidatedCheckboxControl,
+ {
+ required: !!field.isValid?.required,
+ customValidity: (0,_utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__["default"])(isValid, validity),
+ hidden: hideLabelFromVision,
+ label,
+ help: description,
+ checked: getValue({ item: data }),
+ onChange: onChangeControl
+ }
+ );
+}
+
+//# sourceMappingURL=checkbox.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/color.js":
+/*!***********************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/color.js ***!
+ \***********************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ Color)
+/* harmony export */ });
+/* harmony import */ var colord__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! colord */ "./node_modules/colord/index.mjs");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
+/* harmony import */ var _utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/get-custom-validity */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
+// packages/dataviews/src/dataform-controls/color.tsx
+
+
+
+
+
+
+var { ValidatedInputControl, Picker } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_3__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.privateApis);
+var ColorPicker = ({
+ color,
+ onColorChange
+}) => {
+ const validColor = color && (0,colord__WEBPACK_IMPORTED_MODULE_0__.colord)(color).isValid() ? color : "#ffffff";
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Dropdown,
+ {
+ renderToggle: ({ onToggle, isOpen }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
+ "button",
+ {
+ type: "button",
+ onClick: onToggle,
+ style: {
+ width: "24px",
+ height: "24px",
+ borderRadius: "50%",
+ backgroundColor: validColor,
+ border: "1px solid #ddd",
+ cursor: "pointer",
+ outline: isOpen ? "2px solid #007cba" : "none",
+ outlineOffset: "2px",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ padding: 0,
+ margin: 0
+ },
+ "aria-label": "Open color picker"
+ }
+ ) }),
+ renderContent: () => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", { style: { padding: "16px" }, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
+ Picker,
+ {
+ color: (0,colord__WEBPACK_IMPORTED_MODULE_0__.colord)(validColor),
+ onChange: onColorChange,
+ enableAlpha: true
+ }
+ ) })
+ }
+ );
+};
+function Color({
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ validity
+}) {
+ const { label, placeholder, description, setValue, isValid } = field;
+ const value = field.getValue({ item: data }) || "";
+ const handleColorChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(
+ (colorObject) => {
+ onChange(setValue({ item: data, value: colorObject.toHex() }));
+ },
+ [data, onChange, setValue]
+ );
+ const handleInputChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(
+ (newValue) => {
+ onChange(setValue({ item: data, value: newValue || "" }));
+ },
+ [data, onChange, setValue]
+ );
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
+ ValidatedInputControl,
+ {
+ required: !!field.isValid?.required,
+ customValidity: (0,_utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_4__["default"])(isValid, validity),
+ label,
+ placeholder,
+ value,
+ help: description,
+ onChange: handleInputChange,
+ hideLabelFromVision,
+ type: "text",
+ prefix: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
+ ColorPicker,
+ {
+ color: value,
+ onColorChange: handleColorChange
+ }
+ )
+ }
+ );
+}
+
+//# sourceMappingURL=color.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/date.js":
+/*!**********************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/date.js ***!
+ \**********************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ DateControl)
+/* harmony export */ });
+/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
+/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! date-fns */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/format.js");
+/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! date-fns */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/isValid.js");
+/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! date-fns */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfMonth.js");
+/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! date-fns */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfYear.js");
+/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! date-fns */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/subDays.js");
+/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! date-fns */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/subMonths.js");
+/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! date-fns */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/subYears.js");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__);
+/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/date */ "@wordpress/date");
+/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_11__);
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/error.js");
+/* harmony import */ var _utils_relative_date_control__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./utils/relative-date-control */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/relative-date-control.js");
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
+/* harmony import */ var _utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./utils/get-custom-validity */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__);
+// packages/dataviews/src/dataform-controls/date.tsx
+
+
+
+
+
+
+
+
+
+
+
+
+var { DateCalendar, DateRangeCalendar } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_15__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__.privateApis);
+var DATE_PRESETS = [
+ {
+ id: "today",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Today"),
+ getValue: () => (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_11__.getDate)(null)
+ },
+ {
+ id: "yesterday",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Yesterday"),
+ getValue: () => {
+ const today = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_11__.getDate)(null);
+ return (0,date_fns__WEBPACK_IMPORTED_MODULE_5__.subDays)(today, 1);
+ }
+ },
+ {
+ id: "past-week",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Past week"),
+ getValue: () => {
+ const today = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_11__.getDate)(null);
+ return (0,date_fns__WEBPACK_IMPORTED_MODULE_5__.subDays)(today, 7);
+ }
+ },
+ {
+ id: "past-month",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Past month"),
+ getValue: () => {
+ const today = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_11__.getDate)(null);
+ return (0,date_fns__WEBPACK_IMPORTED_MODULE_6__.subMonths)(today, 1);
+ }
+ }
+];
+var DATE_RANGE_PRESETS = [
+ {
+ id: "last-7-days",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Last 7 days"),
+ getValue: () => {
+ const today = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_11__.getDate)(null);
+ return [(0,date_fns__WEBPACK_IMPORTED_MODULE_5__.subDays)(today, 7), today];
+ }
+ },
+ {
+ id: "last-30-days",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Last 30 days"),
+ getValue: () => {
+ const today = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_11__.getDate)(null);
+ return [(0,date_fns__WEBPACK_IMPORTED_MODULE_5__.subDays)(today, 30), today];
+ }
+ },
+ {
+ id: "month-to-date",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Month to date"),
+ getValue: () => {
+ const today = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_11__.getDate)(null);
+ return [(0,date_fns__WEBPACK_IMPORTED_MODULE_3__.startOfMonth)(today), today];
+ }
+ },
+ {
+ id: "last-year",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Last year"),
+ getValue: () => {
+ const today = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_11__.getDate)(null);
+ return [(0,date_fns__WEBPACK_IMPORTED_MODULE_7__.subYears)(today, 1), today];
+ }
+ },
+ {
+ id: "year-to-date",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Year to date"),
+ getValue: () => {
+ const today = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_11__.getDate)(null);
+ return [(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.startOfYear)(today), today];
+ }
+ }
+];
+var parseDate = (dateString) => {
+ if (!dateString) {
+ return null;
+ }
+ const parsed = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_11__.getDate)(dateString);
+ return parsed && (0,date_fns__WEBPACK_IMPORTED_MODULE_2__.isValid)(parsed) ? parsed : null;
+};
+var formatDate = (date) => {
+ if (!date) {
+ return "";
+ }
+ return typeof date === "string" ? date : (0,date_fns__WEBPACK_IMPORTED_MODULE_1__.format)(date, "yyyy-MM-dd");
+};
+function ValidatedDateControl({
+ field,
+ validity,
+ inputRefs,
+ isTouched,
+ setIsTouched,
+ children
+}) {
+ const { isValid } = field;
+ const [customValidity, setCustomValidity] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useState)(void 0);
+ const validateRefs = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)(() => {
+ const refs = Array.isArray(inputRefs) ? inputRefs : [inputRefs];
+ for (const ref of refs) {
+ const input = ref.current;
+ if (input && !input.validity.valid) {
+ setCustomValidity({
+ type: "invalid",
+ message: input.validationMessage
+ });
+ return;
+ }
+ }
+ setCustomValidity(void 0);
+ }, [inputRefs]);
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useEffect)(() => {
+ if (isTouched) {
+ const timeoutId = setTimeout(() => {
+ if (validity) {
+ setCustomValidity((0,_utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_16__["default"])(isValid, validity));
+ } else {
+ validateRefs();
+ }
+ }, 0);
+ return () => clearTimeout(timeoutId);
+ }
+ return void 0;
+ }, [isTouched, isValid, validity, validateRefs]);
+ const onBlur = (event) => {
+ if (isTouched) {
+ return;
+ }
+ if (!event.relatedTarget || !event.currentTarget.contains(event.relatedTarget)) {
+ setIsTouched(true);
+ }
+ };
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)("div", { onBlur, children: [
+ children,
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)("div", { "aria-live": "polite", children: customValidity && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)(
+ "p",
+ {
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])(
+ "components-validated-control__indicator",
+ customValidity.type === "invalid" ? "is-invalid" : void 0,
+ customValidity.type === "valid" ? "is-valid" : void 0
+ ),
+ children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_8__.Icon,
+ {
+ className: "components-validated-control__indicator-icon",
+ icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_12__["default"],
+ size: 16,
+ fill: "currentColor"
+ }
+ ),
+ customValidity.message
+ ]
+ }
+ ) })
+ ] });
+}
+function CalendarDateControl({
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ validity
+}) {
+ const { id, label, setValue, getValue, isValid } = field;
+ const [selectedPresetId, setSelectedPresetId] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useState)(
+ null
+ );
+ const fieldValue = getValue({ item: data });
+ const value = typeof fieldValue === "string" ? fieldValue : void 0;
+ const [calendarMonth, setCalendarMonth] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useState)(() => {
+ const parsedDate = parseDate(value);
+ return parsedDate || /* @__PURE__ */ new Date();
+ });
+ const [isTouched, setIsTouched] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useState)(false);
+ const validityTargetRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useRef)(null);
+ const onChangeCallback = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)(
+ (newValue) => onChange(setValue({ item: data, value: newValue })),
+ [data, onChange, setValue]
+ );
+ const onSelectDate = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)(
+ (newDate) => {
+ const dateValue = newDate ? (0,date_fns__WEBPACK_IMPORTED_MODULE_1__.format)(newDate, "yyyy-MM-dd") : void 0;
+ onChangeCallback(dateValue);
+ setSelectedPresetId(null);
+ setIsTouched(true);
+ },
+ [onChangeCallback]
+ );
+ const handlePresetClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)(
+ (preset) => {
+ const presetDate = preset.getValue();
+ const dateValue = formatDate(presetDate);
+ setCalendarMonth(presetDate);
+ onChangeCallback(dateValue);
+ setSelectedPresetId(preset.id);
+ setIsTouched(true);
+ },
+ [onChangeCallback]
+ );
+ const handleManualDateChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)(
+ (newValue) => {
+ onChangeCallback(newValue);
+ if (newValue) {
+ const parsedDate = parseDate(newValue);
+ if (parsedDate) {
+ setCalendarMonth(parsedDate);
+ }
+ }
+ setSelectedPresetId(null);
+ setIsTouched(true);
+ },
+ [onChangeCallback]
+ );
+ const {
+ timezone: { string: timezoneString },
+ l10n: { startOfWeek }
+ } = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_11__.getSettings)();
+ const displayLabel = isValid?.required ? `${label} (${(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Required")})` : label;
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
+ ValidatedDateControl,
+ {
+ field,
+ validity,
+ inputRefs: validityTargetRef,
+ isTouched,
+ setIsTouched,
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_8__.BaseControl,
+ {
+ __nextHasNoMarginBottom: true,
+ id,
+ className: "dataviews-controls__date",
+ label: displayLabel,
+ hideLabelFromVision,
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__.__experimentalVStack, { spacing: 4, children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__.__experimentalHStack, { spacing: 2, wrap: true, justify: "flex-start", children: [
+ DATE_PRESETS.map((preset) => {
+ const isSelected = selectedPresetId === preset.id;
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_8__.Button,
+ {
+ className: "dataviews-controls__date-preset",
+ variant: "tertiary",
+ isPressed: isSelected,
+ size: "small",
+ onClick: () => handlePresetClick(preset),
+ children: preset.label
+ },
+ preset.id
+ );
+ }),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_8__.Button,
+ {
+ className: "dataviews-controls__date-preset",
+ variant: "tertiary",
+ isPressed: !selectedPresetId,
+ size: "small",
+ disabled: !!selectedPresetId,
+ accessibleWhenDisabled: false,
+ children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Custom")
+ }
+ )
+ ] }),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_8__.__experimentalInputControl,
+ {
+ __next40pxDefaultSize: true,
+ ref: validityTargetRef,
+ type: "date",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Date"),
+ hideLabelFromVision: true,
+ value,
+ onChange: handleManualDateChange,
+ required: !!field.isValid?.required
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
+ DateCalendar,
+ {
+ style: { width: "100%" },
+ selected: value ? parseDate(value) || void 0 : void 0,
+ onSelect: onSelectDate,
+ month: calendarMonth,
+ onMonthChange: setCalendarMonth,
+ timeZone: timezoneString || void 0,
+ weekStartsOn: startOfWeek
+ }
+ )
+ ] })
+ }
+ )
+ }
+ );
+}
+function CalendarDateRangeControl({
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ validity
+}) {
+ const { id, label, getValue, setValue } = field;
+ let value;
+ const fieldValue = getValue({ item: data });
+ if (Array.isArray(fieldValue) && fieldValue.length === 2 && fieldValue.every((date) => typeof date === "string")) {
+ value = fieldValue;
+ }
+ const onChangeCallback = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)(
+ (newValue) => {
+ onChange(
+ setValue({
+ item: data,
+ value: newValue
+ })
+ );
+ },
+ [data, onChange, setValue]
+ );
+ const [selectedPresetId, setSelectedPresetId] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useState)(
+ null
+ );
+ const selectedRange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useMemo)(() => {
+ if (!value) {
+ return { from: void 0, to: void 0 };
+ }
+ const [from, to] = value;
+ return {
+ from: parseDate(from) || void 0,
+ to: parseDate(to) || void 0
+ };
+ }, [value]);
+ const [calendarMonth, setCalendarMonth] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useState)(() => {
+ return selectedRange.from || /* @__PURE__ */ new Date();
+ });
+ const [isTouched, setIsTouched] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useState)(false);
+ const fromInputRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useRef)(null);
+ const toInputRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useRef)(null);
+ const updateDateRange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)(
+ (fromDate, toDate) => {
+ if (fromDate && toDate) {
+ onChangeCallback([
+ formatDate(fromDate),
+ formatDate(toDate)
+ ]);
+ } else if (!fromDate && !toDate) {
+ onChangeCallback(void 0);
+ }
+ },
+ [onChangeCallback]
+ );
+ const onSelectCalendarRange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)(
+ (newRange) => {
+ updateDateRange(newRange?.from, newRange?.to);
+ setSelectedPresetId(null);
+ setIsTouched(true);
+ },
+ [updateDateRange]
+ );
+ const handlePresetClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)(
+ (preset) => {
+ const [startDate, endDate] = preset.getValue();
+ setCalendarMonth(startDate);
+ updateDateRange(startDate, endDate);
+ setSelectedPresetId(preset.id);
+ setIsTouched(true);
+ },
+ [updateDateRange]
+ );
+ const handleManualDateChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)(
+ (fromOrTo, newValue) => {
+ const [currentFrom, currentTo] = value || [
+ void 0,
+ void 0
+ ];
+ const updatedFrom = fromOrTo === "from" ? newValue : currentFrom;
+ const updatedTo = fromOrTo === "to" ? newValue : currentTo;
+ updateDateRange(updatedFrom, updatedTo);
+ if (newValue) {
+ const parsedDate = parseDate(newValue);
+ if (parsedDate) {
+ setCalendarMonth(parsedDate);
+ }
+ }
+ setSelectedPresetId(null);
+ setIsTouched(true);
+ },
+ [value, updateDateRange]
+ );
+ const { timezone, l10n } = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_11__.getSettings)();
+ const displayLabel = field.isValid?.required ? `${label} (${(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Required")})` : label;
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
+ ValidatedDateControl,
+ {
+ field,
+ validity,
+ inputRefs: [fromInputRef, toInputRef],
+ isTouched,
+ setIsTouched,
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_8__.BaseControl,
+ {
+ __nextHasNoMarginBottom: true,
+ id,
+ className: "dataviews-controls__date",
+ label: displayLabel,
+ hideLabelFromVision,
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__.__experimentalVStack, { spacing: 4, children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__.__experimentalHStack, { spacing: 2, wrap: true, justify: "flex-start", children: [
+ DATE_RANGE_PRESETS.map((preset) => {
+ const isSelected = selectedPresetId === preset.id;
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_8__.Button,
+ {
+ className: "dataviews-controls__date-preset",
+ variant: "tertiary",
+ isPressed: isSelected,
+ size: "small",
+ onClick: () => handlePresetClick(preset),
+ children: preset.label
+ },
+ preset.id
+ );
+ }),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_8__.Button,
+ {
+ className: "dataviews-controls__date-preset",
+ variant: "tertiary",
+ isPressed: !selectedPresetId,
+ size: "small",
+ accessibleWhenDisabled: false,
+ disabled: !!selectedPresetId,
+ children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Custom")
+ }
+ )
+ ] }),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__.__experimentalHStack, { spacing: 2, children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_8__.__experimentalInputControl,
+ {
+ __next40pxDefaultSize: true,
+ ref: fromInputRef,
+ type: "date",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("From"),
+ hideLabelFromVision: true,
+ value: value?.[0],
+ onChange: (newValue) => handleManualDateChange("from", newValue),
+ required: !!field.isValid?.required
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_8__.__experimentalInputControl,
+ {
+ __next40pxDefaultSize: true,
+ ref: toInputRef,
+ type: "date",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("To"),
+ hideLabelFromVision: true,
+ value: value?.[1],
+ onChange: (newValue) => handleManualDateChange("to", newValue),
+ required: !!field.isValid?.required
+ }
+ )
+ ] }),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
+ DateRangeCalendar,
+ {
+ style: { width: "100%" },
+ selected: selectedRange,
+ onSelect: onSelectCalendarRange,
+ month: calendarMonth,
+ onMonthChange: setCalendarMonth,
+ timeZone: timezone.string || void 0,
+ weekStartsOn: l10n.startOfWeek
+ }
+ )
+ ] })
+ }
+ )
+ }
+ );
+}
+function DateControl({
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ operator,
+ validity
+}) {
+ if (operator === _constants__WEBPACK_IMPORTED_MODULE_14__.OPERATOR_IN_THE_PAST || operator === _constants__WEBPACK_IMPORTED_MODULE_14__.OPERATOR_OVER) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
+ _utils_relative_date_control__WEBPACK_IMPORTED_MODULE_13__["default"],
+ {
+ className: "dataviews-controls__date",
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ operator
+ }
+ );
+ }
+ if (operator === _constants__WEBPACK_IMPORTED_MODULE_14__.OPERATOR_BETWEEN) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
+ CalendarDateRangeControl,
+ {
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ validity
+ }
+ );
+ }
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
+ CalendarDateControl,
+ {
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ validity
+ }
+ );
+}
+
+//# sourceMappingURL=date.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/datetime.js":
+/*!**************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/datetime.js ***!
+ \**************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ DateTime)
+/* harmony export */ });
+/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! date-fns */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/format.js");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/date */ "@wordpress/date");
+/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_4__);
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+/* harmony import */ var _utils_relative_date_control__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/relative-date-control */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/relative-date-control.js");
+/* harmony import */ var _utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/get-custom-validity */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js");
+/* harmony import */ var _field_types_utils_parse_date_time__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../field-types/utils/parse-date-time */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/parse-date-time.js");
+/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__);
+// packages/dataviews/src/dataform-controls/datetime.tsx
+
+
+
+
+
+
+
+
+
+
+
+var { DateCalendar, ValidatedInputControl } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_9__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.privateApis);
+var formatDateTime = (date) => {
+ if (!date) {
+ return "";
+ }
+ if (typeof date === "string") {
+ return date;
+ }
+ return (0,date_fns__WEBPACK_IMPORTED_MODULE_0__.format)(date, "yyyy-MM-dd'T'HH:mm");
+};
+function CalendarDateTimeControl({
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ validity
+}) {
+ const { id, label, description, setValue, getValue, isValid } = field;
+ const fieldValue = getValue({ item: data });
+ const value = typeof fieldValue === "string" ? fieldValue : void 0;
+ const [calendarMonth, setCalendarMonth] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(() => {
+ const parsedDate = (0,_field_types_utils_parse_date_time__WEBPACK_IMPORTED_MODULE_8__["default"])(value);
+ return parsedDate || /* @__PURE__ */ new Date();
+ });
+ const inputControlRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);
+ const validationTimeoutRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)();
+ const previousFocusRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);
+ const onChangeCallback = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(
+ (newValue) => onChange(setValue({ item: data, value: newValue })),
+ [data, onChange, setValue]
+ );
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
+ return () => {
+ if (validationTimeoutRef.current) {
+ clearTimeout(validationTimeoutRef.current);
+ }
+ };
+ }, []);
+ const onSelectDate = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(
+ (newDate) => {
+ let dateTimeValue;
+ if (newDate) {
+ let finalDateTime = newDate;
+ if (value) {
+ const currentDateTime = (0,_field_types_utils_parse_date_time__WEBPACK_IMPORTED_MODULE_8__["default"])(value);
+ if (currentDateTime) {
+ finalDateTime = new Date(newDate);
+ finalDateTime.setHours(currentDateTime.getHours());
+ finalDateTime.setMinutes(
+ currentDateTime.getMinutes()
+ );
+ }
+ }
+ dateTimeValue = finalDateTime.toISOString();
+ onChangeCallback(dateTimeValue);
+ if (validationTimeoutRef.current) {
+ clearTimeout(validationTimeoutRef.current);
+ }
+ } else {
+ onChangeCallback(void 0);
+ }
+ previousFocusRef.current = inputControlRef.current && inputControlRef.current.ownerDocument.activeElement;
+ validationTimeoutRef.current = setTimeout(() => {
+ if (inputControlRef.current) {
+ inputControlRef.current.focus();
+ inputControlRef.current.blur();
+ onChangeCallback(dateTimeValue);
+ if (previousFocusRef.current && previousFocusRef.current instanceof HTMLElement) {
+ previousFocusRef.current.focus();
+ }
+ }
+ }, 0);
+ },
+ [onChangeCallback, value]
+ );
+ const handleManualDateTimeChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(
+ (newValue) => {
+ if (newValue) {
+ const dateTime = new Date(newValue);
+ onChangeCallback(dateTime.toISOString());
+ const parsedDate = (0,_field_types_utils_parse_date_time__WEBPACK_IMPORTED_MODULE_8__["default"])(dateTime.toISOString());
+ if (parsedDate) {
+ setCalendarMonth(parsedDate);
+ }
+ } else {
+ onChangeCallback(void 0);
+ }
+ },
+ [onChangeCallback]
+ );
+ const {
+ timezone: { string: timezoneString },
+ l10n: { startOfWeek }
+ } = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_4__.getSettings)();
+ const displayLabel = isValid?.required && !hideLabelFromVision ? `${label} (${(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Required")})` : label;
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.BaseControl,
+ {
+ __nextHasNoMarginBottom: true,
+ id,
+ label: displayLabel,
+ help: description,
+ hideLabelFromVision,
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalVStack, { spacing: 4, children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
+ DateCalendar,
+ {
+ style: { width: "100%" },
+ selected: value ? (0,_field_types_utils_parse_date_time__WEBPACK_IMPORTED_MODULE_8__["default"])(value) || void 0 : void 0,
+ onSelect: onSelectDate,
+ month: calendarMonth,
+ onMonthChange: setCalendarMonth,
+ timeZone: timezoneString || void 0,
+ weekStartsOn: startOfWeek
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
+ ValidatedInputControl,
+ {
+ ref: inputControlRef,
+ __next40pxDefaultSize: true,
+ required: !!isValid?.required,
+ customValidity: (0,_utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_7__["default"])(isValid, validity),
+ type: "datetime-local",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Date time"),
+ hideLabelFromVision: true,
+ value: value ? formatDateTime(
+ (0,_field_types_utils_parse_date_time__WEBPACK_IMPORTED_MODULE_8__["default"])(value) || void 0
+ ) : "",
+ onChange: handleManualDateTimeChange
+ }
+ )
+ ] })
+ }
+ );
+}
+function DateTime({
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ operator,
+ validity
+}) {
+ if (operator === _constants__WEBPACK_IMPORTED_MODULE_5__.OPERATOR_IN_THE_PAST || operator === _constants__WEBPACK_IMPORTED_MODULE_5__.OPERATOR_OVER) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
+ _utils_relative_date_control__WEBPACK_IMPORTED_MODULE_6__["default"],
+ {
+ className: "dataviews-controls__datetime",
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ operator
+ }
+ );
+ }
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
+ CalendarDateTimeControl,
+ {
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ validity
+ }
+ );
+}
+
+//# sourceMappingURL=datetime.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/email.js":
+/*!***********************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/email.js ***!
+ \***********************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ Email)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/at-symbol.js");
+/* harmony import */ var _utils_validated_input__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/validated-input */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/validated-input.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
+// packages/dataviews/src/dataform-controls/email.tsx
+
+
+
+
+function Email({
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ validity
+}) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(
+ _utils_validated_input__WEBPACK_IMPORTED_MODULE_2__["default"],
+ {
+ ...{
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ validity,
+ type: "email",
+ prefix: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Icon, { icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__["default"] }) })
+ }
+ }
+ );
+}
+
+//# sourceMappingURL=email.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/index.js":
+/*!***********************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/index.js ***!
+ \***********************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ getControl: () => (/* binding */ getControl),
+/* harmony export */ getControlByType: () => (/* binding */ getControlByType)
+/* harmony export */ });
+/* harmony import */ var _checkbox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./checkbox */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/checkbox.js");
+/* harmony import */ var _datetime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./datetime */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/datetime.js");
+/* harmony import */ var _date__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./date */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/date.js");
+/* harmony import */ var _email__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./email */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/email.js");
+/* harmony import */ var _telephone__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./telephone */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/telephone.js");
+/* harmony import */ var _url__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./url */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/url.js");
+/* harmony import */ var _integer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./integer */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/integer.js");
+/* harmony import */ var _number__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./number */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/number.js");
+/* harmony import */ var _radio__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./radio */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/radio.js");
+/* harmony import */ var _select__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./select */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/select.js");
+/* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./text */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/text.js");
+/* harmony import */ var _toggle__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./toggle */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/toggle.js");
+/* harmony import */ var _textarea__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./textarea */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/textarea.js");
+/* harmony import */ var _toggle_group__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./toggle-group */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/toggle-group.js");
+/* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./array */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/array.js");
+/* harmony import */ var _color__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./color */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/color.js");
+/* harmony import */ var _password__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./password */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/password.js");
+/* harmony import */ var _utils_has_elements__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../utils/has-elements */ "./node_modules/@wordpress/dataviews/build-module/utils/has-elements.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__);
+// packages/dataviews/src/dataform-controls/index.tsx
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+var FORM_CONTROLS = {
+ array: _array__WEBPACK_IMPORTED_MODULE_14__["default"],
+ checkbox: _checkbox__WEBPACK_IMPORTED_MODULE_0__["default"],
+ color: _color__WEBPACK_IMPORTED_MODULE_15__["default"],
+ datetime: _datetime__WEBPACK_IMPORTED_MODULE_1__["default"],
+ date: _date__WEBPACK_IMPORTED_MODULE_2__["default"],
+ email: _email__WEBPACK_IMPORTED_MODULE_3__["default"],
+ telephone: _telephone__WEBPACK_IMPORTED_MODULE_4__["default"],
+ url: _url__WEBPACK_IMPORTED_MODULE_5__["default"],
+ integer: _integer__WEBPACK_IMPORTED_MODULE_6__["default"],
+ number: _number__WEBPACK_IMPORTED_MODULE_7__["default"],
+ password: _password__WEBPACK_IMPORTED_MODULE_16__["default"],
+ radio: _radio__WEBPACK_IMPORTED_MODULE_8__["default"],
+ select: _select__WEBPACK_IMPORTED_MODULE_9__["default"],
+ text: _text__WEBPACK_IMPORTED_MODULE_10__["default"],
+ toggle: _toggle__WEBPACK_IMPORTED_MODULE_11__["default"],
+ textarea: _textarea__WEBPACK_IMPORTED_MODULE_12__["default"],
+ toggleGroup: _toggle_group__WEBPACK_IMPORTED_MODULE_13__["default"]
+};
+function isEditConfig(value) {
+ return value && typeof value === "object" && typeof value.control === "string";
+}
+function createConfiguredControl(config) {
+ const { control, ...controlConfig } = config;
+ const BaseControlType = getControlByType(control);
+ return function ConfiguredControl(props) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(BaseControlType, { ...props, config: controlConfig });
+ };
+}
+function getControl(field, fieldTypeDefinition) {
+ if (typeof field.Edit === "function") {
+ return field.Edit;
+ }
+ if (typeof field.Edit === "string") {
+ return getControlByType(field.Edit);
+ }
+ if (isEditConfig(field.Edit)) {
+ return createConfiguredControl(field.Edit);
+ }
+ if ((0,_utils_has_elements__WEBPACK_IMPORTED_MODULE_17__["default"])(field) && field.type !== "array") {
+ return getControlByType("select");
+ }
+ if (typeof fieldTypeDefinition.Edit === "string") {
+ return getControlByType(fieldTypeDefinition.Edit);
+ }
+ if (isEditConfig(fieldTypeDefinition.Edit)) {
+ return createConfiguredControl(fieldTypeDefinition.Edit);
+ }
+ return fieldTypeDefinition.Edit;
+}
+function getControlByType(type) {
+ if (Object.keys(FORM_CONTROLS).includes(type)) {
+ return FORM_CONTROLS[type];
+ }
+ throw "Control " + type + " not found";
+}
+
+//# sourceMappingURL=index.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/integer.js":
+/*!*************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/integer.js ***!
+ \*************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ Number)
+/* harmony export */ });
+/* harmony import */ var _utils_validated_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/validated-number */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/validated-number.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/dataviews/src/dataform-controls/integer.tsx
+
+
+function Number(props) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_utils_validated_number__WEBPACK_IMPORTED_MODULE_0__["default"], { ...props, decimals: 0 });
+}
+
+//# sourceMappingURL=integer.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/number.js":
+/*!************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/number.js ***!
+ \************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ Number)
+/* harmony export */ });
+/* harmony import */ var _utils_validated_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/validated-number */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/validated-number.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/dataviews/src/dataform-controls/number.tsx
+
+
+function Number(props) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_utils_validated_number__WEBPACK_IMPORTED_MODULE_0__["default"], { ...props, decimals: 2 });
+}
+
+//# sourceMappingURL=number.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/password.js":
+/*!**************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/password.js ***!
+ \**************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ Password)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/seen.js");
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/unseen.js");
+/* harmony import */ var _utils_validated_input__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/validated-input */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/validated-input.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__);
+// packages/dataviews/src/dataform-controls/password.tsx
+
+
+
+
+
+
+function Password({
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ validity
+}) {
+ const [isVisible, setIsVisible] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
+ const toggleVisibility = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
+ setIsVisible((prev) => !prev);
+ }, []);
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
+ _utils_validated_input__WEBPACK_IMPORTED_MODULE_5__["default"],
+ {
+ ...{
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ validity,
+ type: isVisible ? "text" : "password",
+ suffix: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalInputControlSuffixWrapper, { variant: "control", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
+ {
+ icon: isVisible ? _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__["default"] : _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"],
+ onClick: toggleVisibility,
+ size: "small",
+ label: isVisible ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Hide password") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Show password")
+ }
+ ) })
+ }
+ }
+ );
+}
+
+//# sourceMappingURL=password.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/radio.js":
+/*!***********************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/radio.js ***!
+ \***********************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ Radio)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
+/* harmony import */ var _utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/get-custom-validity */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js");
+/* harmony import */ var _hooks_use_elements__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../hooks/use-elements */ "./node_modules/@wordpress/dataviews/build-module/hooks/use-elements.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
+// packages/dataviews/src/dataform-controls/radio.tsx
+
+
+
+
+
+
+var { ValidatedRadioControl } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_2__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.privateApis);
+function Radio({
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ validity
+}) {
+ const { label, description, getValue, setValue, isValid } = field;
+ const { elements, isLoading } = (0,_hooks_use_elements__WEBPACK_IMPORTED_MODULE_4__["default"])({
+ elements: field.elements,
+ getElements: field.getElements
+ });
+ const value = getValue({ item: data });
+ const onChangeControl = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
+ (newValue) => onChange(setValue({ item: data, value: newValue })),
+ [data, onChange, setValue]
+ );
+ if (isLoading) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Spinner, {});
+ }
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
+ ValidatedRadioControl,
+ {
+ required: !!field.isValid?.required,
+ customValidity: (0,_utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__["default"])(isValid, validity),
+ label,
+ help: description,
+ onChange: onChangeControl,
+ options: elements,
+ selected: value,
+ hideLabelFromVision
+ }
+ );
+}
+
+//# sourceMappingURL=radio.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/select.js":
+/*!************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/select.js ***!
+ \************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ Select)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _hooks_use_elements__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../hooks/use-elements */ "./node_modules/@wordpress/dataviews/build-module/hooks/use-elements.js");
+/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
+/* harmony import */ var _utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/get-custom-validity */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
+// packages/dataviews/src/dataform-controls/select.tsx
+
+
+
+
+
+
+var { ValidatedSelectControl } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_3__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.privateApis);
+function Select({
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ validity
+}) {
+ const { type, label, description, getValue, setValue, isValid } = field;
+ const isMultiple = type === "array";
+ const value = getValue({ item: data }) ?? (isMultiple ? [] : "");
+ const onChangeControl = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
+ (newValue) => onChange(setValue({ item: data, value: newValue })),
+ [data, onChange, setValue]
+ );
+ const { elements, isLoading } = (0,_hooks_use_elements__WEBPACK_IMPORTED_MODULE_2__["default"])({
+ elements: field.elements,
+ getElements: field.getElements
+ });
+ if (isLoading) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Spinner, {});
+ }
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
+ ValidatedSelectControl,
+ {
+ required: !!field.isValid?.required,
+ customValidity: (0,_utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_4__["default"])(isValid, validity),
+ label,
+ value,
+ help: description,
+ options: elements,
+ onChange: onChangeControl,
+ __next40pxDefaultSize: true,
+ __nextHasNoMarginBottom: true,
+ hideLabelFromVision,
+ multiple: isMultiple
+ }
+ );
+}
+
+//# sourceMappingURL=select.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/telephone.js":
+/*!***************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/telephone.js ***!
+ \***************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ Telephone)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/mobile.js");
+/* harmony import */ var _utils_validated_input__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/validated-input */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/validated-input.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
+// packages/dataviews/src/dataform-controls/telephone.tsx
+
+
+
+
+function Telephone({
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ validity
+}) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(
+ _utils_validated_input__WEBPACK_IMPORTED_MODULE_2__["default"],
+ {
+ ...{
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ validity,
+ type: "tel",
+ prefix: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Icon, { icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__["default"] }) })
+ }
+ }
+ );
+}
+
+//# sourceMappingURL=telephone.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/text.js":
+/*!**********************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/text.js ***!
+ \**********************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ Text)
+/* harmony export */ });
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _utils_validated_input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/validated-input */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/validated-input.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
+// packages/dataviews/src/dataform-controls/text.tsx
+
+
+
+function Text({
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ config,
+ validity
+}) {
+ const { prefix, suffix } = config || {};
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(
+ _utils_validated_input__WEBPACK_IMPORTED_MODULE_1__["default"],
+ {
+ ...{
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ validity,
+ prefix: prefix ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(prefix) : void 0,
+ suffix: suffix ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(suffix) : void 0
+ }
+ }
+ );
+}
+
+//# sourceMappingURL=text.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/textarea.js":
+/*!**************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/textarea.js ***!
+ \**************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ Textarea)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
+/* harmony import */ var _utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/get-custom-validity */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
+// packages/dataviews/src/dataform-controls/textarea.tsx
+
+
+
+
+
+var { ValidatedTextareaControl } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_2__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.privateApis);
+function Textarea({
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ config,
+ validity
+}) {
+ const { rows = 4 } = config || {};
+ const { label, placeholder, description, setValue, isValid } = field;
+ const value = field.getValue({ item: data });
+ const onChangeControl = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
+ (newValue) => onChange(setValue({ item: data, value: newValue })),
+ [data, onChange, setValue]
+ );
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
+ ValidatedTextareaControl,
+ {
+ required: !!isValid?.required,
+ customValidity: (0,_utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__["default"])(isValid, validity),
+ label,
+ placeholder,
+ value: value ?? "",
+ help: description,
+ onChange: onChangeControl,
+ rows,
+ __next40pxDefaultSize: true,
+ __nextHasNoMarginBottom: true,
+ hideLabelFromVision
+ }
+ );
+}
+
+//# sourceMappingURL=textarea.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/toggle-group.js":
+/*!******************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/toggle-group.js ***!
+ \******************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ ToggleGroup)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
+/* harmony import */ var _utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/get-custom-validity */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js");
+/* harmony import */ var _hooks_use_elements__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../hooks/use-elements */ "./node_modules/@wordpress/dataviews/build-module/hooks/use-elements.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
+// packages/dataviews/src/dataform-controls/toggle-group.tsx
+
+
+
+
+
+
+var { ValidatedToggleGroupControl } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_2__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.privateApis);
+function ToggleGroup({
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ validity
+}) {
+ const { getValue, setValue, isValid } = field;
+ const value = getValue({ item: data });
+ const onChangeControl = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
+ (newValue) => onChange(setValue({ item: data, value: newValue })),
+ [data, onChange, setValue]
+ );
+ const { elements, isLoading } = (0,_hooks_use_elements__WEBPACK_IMPORTED_MODULE_4__["default"])({
+ elements: field.elements,
+ getElements: field.getElements
+ });
+ if (isLoading) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Spinner, {});
+ }
+ if (elements.length === 0) {
+ return null;
+ }
+ const selectedOption = elements.find((el) => el.value === value);
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
+ ValidatedToggleGroupControl,
+ {
+ required: !!field.isValid?.required,
+ customValidity: (0,_utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__["default"])(isValid, validity),
+ __next40pxDefaultSize: true,
+ __nextHasNoMarginBottom: true,
+ isBlock: true,
+ label: field.label,
+ help: selectedOption?.description || field.description,
+ onChange: onChangeControl,
+ value,
+ hideLabelFromVision,
+ children: elements.map((el) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalToggleGroupControlOption,
+ {
+ label: el.label,
+ value: el.value
+ },
+ el.value
+ ))
+ }
+ );
+}
+
+//# sourceMappingURL=toggle-group.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/toggle.js":
+/*!************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/toggle.js ***!
+ \************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ Toggle)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
+/* harmony import */ var _utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/get-custom-validity */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
+// packages/dataviews/src/dataform-controls/toggle.tsx
+
+
+
+
+
+var { ValidatedToggleControl } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_2__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.privateApis);
+function Toggle({
+ field,
+ onChange,
+ data,
+ hideLabelFromVision,
+ validity
+}) {
+ const { label, description, getValue, setValue, isValid } = field;
+ const onChangeControl = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
+ onChange(
+ setValue({ item: data, value: !getValue({ item: data }) })
+ );
+ }, [onChange, setValue, data, getValue]);
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
+ ValidatedToggleControl,
+ {
+ required: !!isValid.required,
+ customValidity: (0,_utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__["default"])(isValid, validity),
+ hidden: hideLabelFromVision,
+ __nextHasNoMarginBottom: true,
+ label,
+ help: description,
+ checked: getValue({ item: data }),
+ onChange: onChangeControl
+ }
+ );
+}
+
+//# sourceMappingURL=toggle.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/url.js":
+/*!*********************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/url.js ***!
+ \*********************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ Url)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/link.js");
+/* harmony import */ var _utils_validated_input__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/validated-input */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/validated-input.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
+// packages/dataviews/src/dataform-controls/url.tsx
+
+
+
+
+function Url({
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ validity
+}) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(
+ _utils_validated_input__WEBPACK_IMPORTED_MODULE_2__["default"],
+ {
+ ...{
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ validity,
+ type: "url",
+ prefix: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Icon, { icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__["default"] }) })
+ }
+ }
+ );
+}
+
+//# sourceMappingURL=url.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js":
+/*!*******************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js ***!
+ \*******************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ getCustomValidity)
+/* harmony export */ });
+// packages/dataviews/src/dataform-controls/utils/get-custom-validity.ts
+function getCustomValidity(isValid, validity) {
+ let customValidity;
+ if (isValid?.required && validity?.required) {
+ customValidity = validity?.required?.message ? validity.required : void 0;
+ } else if (isValid?.elements && validity?.elements) {
+ customValidity = validity.elements;
+ } else if (validity?.custom) {
+ customValidity = validity.custom;
+ }
+ return customValidity;
+}
+
+//# sourceMappingURL=get-custom-validity.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/relative-date-control.js":
+/*!*********************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/relative-date-control.js ***!
+ \*********************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ RelativeDateControl)
+/* harmony export */ });
+/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
+// packages/dataviews/src/dataform-controls/utils/relative-date-control.tsx
+
+
+
+
+
+
+var TIME_UNITS_OPTIONS = {
+ [_constants__WEBPACK_IMPORTED_MODULE_4__.OPERATOR_IN_THE_PAST]: [
+ { value: "days", label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Days") },
+ { value: "weeks", label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Weeks") },
+ { value: "months", label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Months") },
+ { value: "years", label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Years") }
+ ],
+ [_constants__WEBPACK_IMPORTED_MODULE_4__.OPERATOR_OVER]: [
+ { value: "days", label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Days ago") },
+ { value: "weeks", label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Weeks ago") },
+ { value: "months", label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Months ago") },
+ { value: "years", label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Years ago") }
+ ]
+};
+function RelativeDateControl({
+ className,
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ operator
+}) {
+ const options = TIME_UNITS_OPTIONS[operator === _constants__WEBPACK_IMPORTED_MODULE_4__.OPERATOR_IN_THE_PAST ? "inThePast" : "over"];
+ const { id, label, getValue, setValue } = field;
+ const fieldValue = getValue({ item: data });
+ const { value: relValue = "", unit = options[0].value } = fieldValue && typeof fieldValue === "object" ? fieldValue : {};
+ const onChangeValue = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(
+ (newValue) => onChange(
+ setValue({
+ item: data,
+ value: { value: Number(newValue), unit }
+ })
+ ),
+ [onChange, setValue, data, unit]
+ );
+ const onChangeUnit = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(
+ (newUnit) => onChange(
+ setValue({
+ item: data,
+ value: { value: relValue, unit: newUnit }
+ })
+ ),
+ [onChange, setValue, data, relValue]
+ );
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.BaseControl,
+ {
+ id,
+ __nextHasNoMarginBottom: true,
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])(className, "dataviews-controls__relative-date"),
+ label,
+ hideLabelFromVision,
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHStack, { spacing: 2.5, children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalNumberControl,
+ {
+ __next40pxDefaultSize: true,
+ className: "dataviews-controls__relative-date-number",
+ spinControls: "none",
+ min: 1,
+ step: 1,
+ value: relValue,
+ onChange: onChangeValue
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl,
+ {
+ className: "dataviews-controls__relative-date-unit",
+ __next40pxDefaultSize: true,
+ __nextHasNoMarginBottom: true,
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Unit"),
+ value: unit,
+ options,
+ onChange: onChangeUnit,
+ hideLabelFromVision: true
+ }
+ )
+ ] })
+ }
+ );
+}
+
+//# sourceMappingURL=relative-date-control.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/validated-input.js":
+/*!***************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/validated-input.js ***!
+ \***************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ ValidatedText)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
+/* harmony import */ var _get_custom_validity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./get-custom-validity */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
+// packages/dataviews/src/dataform-controls/utils/validated-input.tsx
+
+
+
+
+
+var { ValidatedInputControl } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_2__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.privateApis);
+function ValidatedText({
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ type,
+ prefix,
+ suffix,
+ validity
+}) {
+ const { label, placeholder, description, getValue, setValue, isValid } = field;
+ const value = getValue({ item: data });
+ const onChangeControl = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
+ (newValue) => onChange(
+ setValue({
+ item: data,
+ value: newValue
+ })
+ ),
+ [data, setValue, onChange]
+ );
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
+ ValidatedInputControl,
+ {
+ required: !!isValid?.required,
+ customValidity: (0,_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__["default"])(isValid, validity),
+ label,
+ placeholder,
+ value: value ?? "",
+ help: description,
+ onChange: onChangeControl,
+ hideLabelFromVision,
+ type,
+ prefix,
+ suffix,
+ __next40pxDefaultSize: true
+ }
+ );
+}
+
+//# sourceMappingURL=validated-input.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/validated-number.js":
+/*!****************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/validated-number.js ***!
+ \****************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ ValidatedNumber)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
+/* harmony import */ var _get_custom_validity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./get-custom-validity */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__);
+// packages/dataviews/src/dataform-controls/utils/validated-number.tsx
+
+
+
+
+
+
+
+var { ValidatedNumberControl } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_4__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.privateApis);
+function toNumberOrEmpty(value) {
+ if (value === "" || value === void 0) {
+ return "";
+ }
+ const number = Number(value);
+ return Number.isFinite(number) ? number : "";
+}
+function BetweenControls({
+ value,
+ onChange,
+ hideLabelFromVision,
+ step
+}) {
+ const [min = "", max = ""] = value;
+ const onChangeMin = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
+ (newValue) => onChange([toNumberOrEmpty(newValue), max]),
+ [onChange, max]
+ );
+ const onChangeMax = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
+ (newValue) => onChange([min, toNumberOrEmpty(newValue)]),
+ [onChange, min]
+ );
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.BaseControl,
+ {
+ __nextHasNoMarginBottom: true,
+ help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("The max. value must be greater than the min. value."),
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Flex, { direction: "row", gap: 4, children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalNumberControl,
+ {
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Min."),
+ value: min,
+ max: max ? Number(max) - step : void 0,
+ onChange: onChangeMin,
+ __next40pxDefaultSize: true,
+ hideLabelFromVision,
+ step
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalNumberControl,
+ {
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Max."),
+ value: max,
+ min: min ? Number(min) + step : void 0,
+ onChange: onChangeMax,
+ __next40pxDefaultSize: true,
+ hideLabelFromVision,
+ step
+ }
+ )
+ ] })
+ }
+ );
+}
+function ValidatedNumber({
+ data,
+ field,
+ onChange,
+ hideLabelFromVision,
+ operator,
+ decimals,
+ validity
+}) {
+ const step = Math.pow(10, Math.abs(decimals) * -1);
+ const { label, description, getValue, setValue, isValid } = field;
+ const value = getValue({ item: data }) ?? "";
+ const onChangeControl = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
+ (newValue) => {
+ onChange(
+ setValue({
+ item: data,
+ // Do not convert an empty string or undefined to a number,
+ // otherwise there's a mismatch between the UI control (empty)
+ // and the data relied by onChange (0).
+ value: ["", void 0].includes(newValue) ? void 0 : Number(newValue)
+ })
+ );
+ },
+ [data, onChange, setValue]
+ );
+ const onChangeBetweenControls = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
+ (newValue) => {
+ onChange(
+ setValue({
+ item: data,
+ value: newValue
+ })
+ );
+ },
+ [data, onChange, setValue]
+ );
+ if (operator === _constants__WEBPACK_IMPORTED_MODULE_3__.OPERATOR_BETWEEN) {
+ let valueBetween = ["", ""];
+ if (Array.isArray(value) && value.length === 2 && value.every(
+ (element) => typeof element === "number" || element === ""
+ )) {
+ valueBetween = value;
+ }
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
+ BetweenControls,
+ {
+ value: valueBetween,
+ onChange: onChangeBetweenControls,
+ hideLabelFromVision,
+ step
+ }
+ );
+ }
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
+ ValidatedNumberControl,
+ {
+ required: !!isValid?.required,
+ customValidity: (0,_get_custom_validity__WEBPACK_IMPORTED_MODULE_5__["default"])(isValid, validity),
+ label,
+ help: description,
+ value,
+ onChange: onChangeControl,
+ __next40pxDefaultSize: true,
+ hideLabelFromVision,
+ step
+ }
+ );
+}
+
+//# sourceMappingURL=validated-number.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/grid/index.js":
+/*!****************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/grid/index.js ***!
+ \****************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ grid_default)
+/* harmony export */ });
+/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
+/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes");
+/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__);
+/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
+/* harmony import */ var _components_dataviews_item_actions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../components/dataviews-item-actions */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-item-actions/index.js");
+/* harmony import */ var _components_dataviews_selection_checkbox__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../components/dataviews-selection-checkbox */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-selection-checkbox/index.js");
+/* harmony import */ var _components_dataviews_context__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../components/dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
+/* harmony import */ var _components_dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../components/dataviews-bulk-actions */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-bulk-actions/index.js");
+/* harmony import */ var _utils_item_click_wrapper__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../utils/item-click-wrapper */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/item-click-wrapper.js");
+/* harmony import */ var _utils_grid_items__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../utils/grid-items */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/grid-items.js");
+/* harmony import */ var _utils_get_data_by_group__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../utils/get-data-by-group */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/get-data-by-group.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__);
+// packages/dataviews/src/dataviews-layouts/grid/index.tsx
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+var { Badge } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_6__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.privateApis);
+function GridItem({
+ view,
+ selection,
+ onChangeSelection,
+ onClickItem,
+ isItemClickable,
+ renderItemLink,
+ getItemId,
+ item,
+ actions,
+ mediaField,
+ titleField,
+ descriptionField,
+ regularFields,
+ badgeFields,
+ hasBulkActions,
+ config,
+ posinset
+}) {
+ const {
+ showTitle = true,
+ showMedia = true,
+ showDescription = true,
+ infiniteScrollEnabled
+ } = view;
+ const hasBulkAction = (0,_components_dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_10__.useHasAPossibleBulkAction)(actions, item);
+ const id = getItemId(item);
+ const instanceId = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__.useInstanceId)(GridItem);
+ const isSelected = selection.includes(id);
+ const renderedMediaField = mediaField?.render ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
+ mediaField.render,
+ {
+ item,
+ field: mediaField,
+ config
+ }
+ ) : null;
+ const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(titleField.render, { item, field: titleField }) : null;
+ const shouldRenderMedia = showMedia && renderedMediaField;
+ let mediaA11yProps;
+ let titleA11yProps;
+ if (isItemClickable(item) && onClickItem) {
+ if (renderedTitleField) {
+ mediaA11yProps = {
+ "aria-labelledby": `dataviews-view-grid__title-field-${instanceId}`
+ };
+ titleA11yProps = {
+ id: `dataviews-view-grid__title-field-${instanceId}`
+ };
+ } else {
+ mediaA11yProps = {
+ "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Navigate to item")
+ };
+ }
+ }
+ const { paginationInfo } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useContext)(_components_dataviews_context__WEBPACK_IMPORTED_MODULE_9__["default"]);
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalVStack,
+ {
+ spacing: 0,
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])("dataviews-view-grid__card", {
+ "is-selected": hasBulkAction && isSelected
+ }),
+ onClickCapture: (event) => {
+ if ((0,_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4__.isAppleOS)() ? event.metaKey : event.ctrlKey) {
+ event.stopPropagation();
+ event.preventDefault();
+ if (!hasBulkAction) {
+ return;
+ }
+ onChangeSelection(
+ selection.includes(id) ? selection.filter((itemId) => id !== itemId) : [...selection, id]
+ );
+ }
+ },
+ role: infiniteScrollEnabled ? "article" : void 0,
+ "aria-setsize": infiniteScrollEnabled ? paginationInfo.totalItems : void 0,
+ "aria-posinset": posinset,
+ children: [
+ shouldRenderMedia && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
+ _utils_item_click_wrapper__WEBPACK_IMPORTED_MODULE_11__.ItemClickWrapper,
+ {
+ item,
+ isItemClickable,
+ onClickItem,
+ renderItemLink,
+ className: "dataviews-view-grid__media",
+ ...mediaA11yProps,
+ children: renderedMediaField
+ }
+ ),
+ hasBulkActions && shouldRenderMedia && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
+ _components_dataviews_selection_checkbox__WEBPACK_IMPORTED_MODULE_8__["default"],
+ {
+ item,
+ selection,
+ onChangeSelection,
+ getItemId,
+ titleField,
+ disabled: !hasBulkAction
+ }
+ ),
+ !showTitle && shouldRenderMedia && !!actions?.length && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)("div", { className: "dataviews-view-grid__media-actions", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_components_dataviews_item_actions__WEBPACK_IMPORTED_MODULE_7__["default"], { item, actions, isCompact: true }) }),
+ showTitle && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHStack,
+ {
+ justify: "space-between",
+ className: "dataviews-view-grid__title-actions",
+ children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
+ _utils_item_click_wrapper__WEBPACK_IMPORTED_MODULE_11__.ItemClickWrapper,
+ {
+ item,
+ isItemClickable,
+ onClickItem,
+ renderItemLink,
+ className: "dataviews-view-grid__title-field dataviews-title-field",
+ ...titleA11yProps,
+ children: renderedTitleField
+ }
+ ),
+ !!actions?.length && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
+ _components_dataviews_item_actions__WEBPACK_IMPORTED_MODULE_7__["default"],
+ {
+ item,
+ actions,
+ isCompact: true
+ }
+ )
+ ]
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalVStack, { spacing: 1, children: [
+ showDescription && descriptionField?.render && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
+ descriptionField.render,
+ {
+ item,
+ field: descriptionField
+ }
+ ),
+ !!badgeFields?.length && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHStack,
+ {
+ className: "dataviews-view-grid__badge-fields",
+ spacing: 2,
+ wrap: true,
+ alignment: "top",
+ justify: "flex-start",
+ children: badgeFields.map((field) => {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
+ Badge,
+ {
+ className: "dataviews-view-grid__field-value",
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
+ field.render,
+ {
+ item,
+ field
+ }
+ )
+ },
+ field.id
+ );
+ })
+ }
+ ),
+ !!regularFields?.length && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalVStack,
+ {
+ className: "dataviews-view-grid__fields",
+ spacing: 1,
+ children: regularFields.map((field) => {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Flex,
+ {
+ className: "dataviews-view-grid__field",
+ gap: 1,
+ justify: "flex-start",
+ expanded: true,
+ style: { height: "auto" },
+ direction: "row",
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.Fragment, { children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Tooltip, { text: field.label, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.FlexItem, { className: "dataviews-view-grid__field-name", children: field.header }) }),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.FlexItem,
+ {
+ className: "dataviews-view-grid__field-value",
+ style: { maxHeight: "none" },
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
+ field.render,
+ {
+ item,
+ field
+ }
+ )
+ }
+ )
+ ] })
+ },
+ field.id
+ );
+ })
+ }
+ )
+ ] })
+ ]
+ },
+ id
+ );
+}
+function ViewGrid({
+ actions,
+ data,
+ fields,
+ getItemId,
+ isLoading,
+ onChangeSelection,
+ onClickItem,
+ isItemClickable,
+ renderItemLink,
+ selection,
+ view,
+ className,
+ empty
+}) {
+ const { resizeObserverRef } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useContext)(_components_dataviews_context__WEBPACK_IMPORTED_MODULE_9__["default"]);
+ const titleField = fields.find(
+ (field) => field.id === view?.titleField
+ );
+ const mediaField = fields.find(
+ (field) => field.id === view?.mediaField
+ );
+ const descriptionField = fields.find(
+ (field) => field.id === view?.descriptionField
+ );
+ const otherFields = view.fields ?? [];
+ const { regularFields, badgeFields } = otherFields.reduce(
+ (accumulator, fieldId) => {
+ const field = fields.find((f) => f.id === fieldId);
+ if (!field) {
+ return accumulator;
+ }
+ const key = view.layout?.badgeFields?.includes(fieldId) ? "badgeFields" : "regularFields";
+ accumulator[key].push(field);
+ return accumulator;
+ },
+ { regularFields: [], badgeFields: [] }
+ );
+ const hasData = !!data?.length;
+ const hasBulkActions = (0,_components_dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_10__.useSomeItemHasAPossibleBulkAction)(actions, data);
+ const usedPreviewSize = view.layout?.previewSize;
+ const size = "900px";
+ const groupField = view.groupByField ? fields.find((f) => f.id === view.groupByField) : null;
+ const dataByGroup = groupField ? (0,_utils_get_data_by_group__WEBPACK_IMPORTED_MODULE_13__["default"])(data, groupField) : null;
+ const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup;
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.Fragment, {
+ // Render multiple groups.
+ children: [
+ hasData && groupField && dataByGroup && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalVStack, { spacing: 4, children: Array.from(dataByGroup.entries()).map(
+ ([groupName, groupItems]) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalVStack, { spacing: 2, children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)("h3", { className: "dataviews-view-grid__group-header", children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s: %2$s"),
+ groupField.label,
+ groupName
+ ) }),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
+ _utils_grid_items__WEBPACK_IMPORTED_MODULE_12__.GridItems,
+ {
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])(
+ "dataviews-view-grid",
+ className
+ ),
+ previewSize: usedPreviewSize,
+ "aria-busy": isLoading,
+ ref: resizeObserverRef,
+ children: groupItems.map((item) => {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
+ GridItem,
+ {
+ view,
+ selection,
+ onChangeSelection,
+ onClickItem,
+ isItemClickable,
+ renderItemLink,
+ getItemId,
+ item,
+ actions,
+ mediaField,
+ titleField,
+ descriptionField,
+ regularFields,
+ badgeFields,
+ hasBulkActions,
+ config: {
+ sizes: size
+ }
+ },
+ getItemId(item)
+ );
+ })
+ }
+ )
+ ] }, groupName)
+ ) }),
+ // Render a single grid with all data.
+ hasData && !dataByGroup && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
+ _utils_grid_items__WEBPACK_IMPORTED_MODULE_12__.GridItems,
+ {
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])("dataviews-view-grid", className),
+ previewSize: usedPreviewSize,
+ "aria-busy": isLoading,
+ ref: resizeObserverRef,
+ role: isInfiniteScroll ? "feed" : void 0,
+ children: data.map((item, index) => {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
+ GridItem,
+ {
+ view,
+ selection,
+ onChangeSelection,
+ onClickItem,
+ isItemClickable,
+ renderItemLink,
+ getItemId,
+ item,
+ actions,
+ mediaField,
+ titleField,
+ descriptionField,
+ regularFields,
+ badgeFields,
+ hasBulkActions,
+ config: {
+ sizes: size
+ },
+ posinset: isInfiniteScroll ? index + 1 : void 0
+ },
+ getItemId(item)
+ );
+ })
+ }
+ ),
+ // Render empty state.
+ !hasData && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
+ "div",
+ {
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])({
+ "dataviews-loading": isLoading,
+ "dataviews-no-results": !isLoading
+ }),
+ children: isLoading ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)("p", { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Spinner, {}) }) : empty
+ }
+ ),
+ hasData && isLoading && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Spinner, {}) })
+ ]
+ });
+}
+var grid_default = ViewGrid;
+
+//# sourceMappingURL=index.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/index.js":
+/*!***********************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/index.js ***!
+ \***********************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ VIEW_LAYOUTS: () => (/* binding */ VIEW_LAYOUTS)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/block-table.js");
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/category.js");
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/format-list-bullets-rtl.js");
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/format-list-bullets.js");
+/* harmony import */ var _table__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./table */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/index.js");
+/* harmony import */ var _grid__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./grid */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/grid/index.js");
+/* harmony import */ var _list__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./list */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/list/index.js");
+/* harmony import */ var _picker_grid__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./picker-grid */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/picker-grid/index.js");
+/* harmony import */ var _picker_table__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./picker-table */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/picker-table/index.js");
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+/* harmony import */ var _utils_preview_size_picker__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils/preview-size-picker */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/preview-size-picker.js");
+/* harmony import */ var _table_density_picker__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./table/density-picker */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/density-picker.js");
+// packages/dataviews/src/dataviews-layouts/index.ts
+
+
+
+
+
+
+
+
+
+
+var VIEW_LAYOUTS = [
+ {
+ type: _constants__WEBPACK_IMPORTED_MODULE_10__.LAYOUT_TABLE,
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Table"),
+ component: _table__WEBPACK_IMPORTED_MODULE_5__["default"],
+ icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__["default"],
+ viewConfigOptions: _table_density_picker__WEBPACK_IMPORTED_MODULE_12__["default"]
+ },
+ {
+ type: _constants__WEBPACK_IMPORTED_MODULE_10__.LAYOUT_GRID,
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Grid"),
+ component: _grid__WEBPACK_IMPORTED_MODULE_6__["default"],
+ icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"],
+ viewConfigOptions: _utils_preview_size_picker__WEBPACK_IMPORTED_MODULE_11__["default"]
+ },
+ {
+ type: _constants__WEBPACK_IMPORTED_MODULE_10__.LAYOUT_LIST,
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("List"),
+ component: _list__WEBPACK_IMPORTED_MODULE_7__["default"],
+ icon: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.isRTL)() ? _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"] : _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__["default"]
+ },
+ {
+ type: _constants__WEBPACK_IMPORTED_MODULE_10__.LAYOUT_PICKER_GRID,
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Grid"),
+ component: _picker_grid__WEBPACK_IMPORTED_MODULE_8__["default"],
+ icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"],
+ viewConfigOptions: _utils_preview_size_picker__WEBPACK_IMPORTED_MODULE_11__["default"],
+ isPicker: true
+ },
+ {
+ type: _constants__WEBPACK_IMPORTED_MODULE_10__.LAYOUT_PICKER_TABLE,
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Table"),
+ component: _picker_table__WEBPACK_IMPORTED_MODULE_9__["default"],
+ icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__["default"],
+ viewConfigOptions: _table_density_picker__WEBPACK_IMPORTED_MODULE_12__["default"],
+ isPicker: true
+ }
+];
+
+//# sourceMappingURL=index.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/list/index.js":
+/*!****************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/list/index.js ***!
+ \****************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ ViewList)
+/* harmony export */ });
+/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
+/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
+/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/more-vertical.js");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__);
+/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
+/* harmony import */ var _components_dataviews_item_actions__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../components/dataviews-item-actions */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-item-actions/index.js");
+/* harmony import */ var _components_dataviews_context__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../components/dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
+/* harmony import */ var _utils_get_data_by_group__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils/get-data-by-group */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/get-data-by-group.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__);
+// packages/dataviews/src/dataviews-layouts/list/index.tsx
+
+
+
+
+
+
+
+
+
+
+
+
+var { Menu } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_7__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.privateApis);
+function generateItemWrapperCompositeId(idPrefix) {
+ return `${idPrefix}-item-wrapper`;
+}
+function generatePrimaryActionCompositeId(idPrefix, primaryActionId) {
+ return `${idPrefix}-primary-action-${primaryActionId}`;
+}
+function generateDropdownTriggerCompositeId(idPrefix) {
+ return `${idPrefix}-dropdown`;
+}
+function PrimaryActionGridCell({
+ idPrefix,
+ primaryAction,
+ item
+}) {
+ const registry = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_6__.useRegistry)();
+ const [isModalOpen, setIsModalOpen] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(false);
+ const compositeItemId = generatePrimaryActionCompositeId(
+ idPrefix,
+ primaryAction.id
+ );
+ const label = typeof primaryAction.label === "string" ? primaryAction.label : primaryAction.label([item]);
+ return "RenderModal" in primaryAction ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", { role: "gridcell", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Composite.Item,
+ {
+ id: compositeItemId,
+ render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button,
+ {
+ disabled: !!primaryAction.disabled,
+ accessibleWhenDisabled: true,
+ text: label,
+ size: "small",
+ onClick: () => setIsModalOpen(true)
+ }
+ ),
+ children: isModalOpen && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _components_dataviews_item_actions__WEBPACK_IMPORTED_MODULE_8__.ActionModal,
+ {
+ action: primaryAction,
+ items: [item],
+ closeModal: () => setIsModalOpen(false)
+ }
+ )
+ }
+ ) }, primaryAction.id) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", { role: "gridcell", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Composite.Item,
+ {
+ id: compositeItemId,
+ render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button,
+ {
+ disabled: !!primaryAction.disabled,
+ accessibleWhenDisabled: true,
+ size: "small",
+ onClick: () => {
+ primaryAction.callback([item], { registry });
+ },
+ children: label
+ }
+ )
+ }
+ ) }, primaryAction.id);
+}
+function ListItem({
+ view,
+ actions,
+ idPrefix,
+ isSelected,
+ item,
+ titleField,
+ mediaField,
+ descriptionField,
+ onSelect,
+ otherFields,
+ onDropdownTriggerKeyDown,
+ posinset
+}) {
+ const {
+ showTitle = true,
+ showMedia = true,
+ showDescription = true,
+ infiniteScrollEnabled
+ } = view;
+ const itemRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)(null);
+ const labelId = `${idPrefix}-label`;
+ const descriptionId = `${idPrefix}-description`;
+ const registry = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_6__.useRegistry)();
+ const [isHovered, setIsHovered] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(false);
+ const [activeModalAction, setActiveModalAction] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(
+ null
+ );
+ const handleHover = ({ type }) => {
+ const isHover = type === "mouseenter";
+ setIsHovered(isHover);
+ };
+ const { paginationInfo } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useContext)(_components_dataviews_context__WEBPACK_IMPORTED_MODULE_9__["default"]);
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
+ if (isSelected) {
+ itemRef.current?.scrollIntoView({
+ behavior: "auto",
+ block: "nearest",
+ inline: "nearest"
+ });
+ }
+ }, [isSelected]);
+ const { primaryAction, eligibleActions } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useMemo)(() => {
+ const _eligibleActions = actions.filter(
+ (action) => !action.isEligible || action.isEligible(item)
+ );
+ const _primaryActions = _eligibleActions.filter(
+ (action) => action.isPrimary
+ );
+ return {
+ primaryAction: _primaryActions[0],
+ eligibleActions: _eligibleActions
+ };
+ }, [actions, item]);
+ const hasOnlyOnePrimaryAction = primaryAction && actions.length === 1;
+ const renderedMediaField = showMedia && mediaField?.render ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", { className: "dataviews-view-list__media-wrapper", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ mediaField.render,
+ {
+ item,
+ field: mediaField,
+ config: { sizes: "52px" }
+ }
+ ) }) : null;
+ const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(titleField.render, { item, field: titleField }) : null;
+ const usedActions = eligibleActions?.length > 0 && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalHStack, { spacing: 3, className: "dataviews-view-list__item-actions", children: [
+ primaryAction && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ PrimaryActionGridCell,
+ {
+ idPrefix,
+ primaryAction,
+ item
+ }
+ ),
+ !hasOnlyOnePrimaryAction && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", { role: "gridcell", children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(Menu, { placement: "bottom-end", children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ Menu.TriggerButton,
+ {
+ render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Composite.Item,
+ {
+ id: generateDropdownTriggerCompositeId(
+ idPrefix
+ ),
+ render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button,
+ {
+ size: "small",
+ icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__["default"],
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)("Actions"),
+ accessibleWhenDisabled: true,
+ disabled: !actions.length,
+ onKeyDown: onDropdownTriggerKeyDown
+ }
+ )
+ }
+ )
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(Menu.Popover, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _components_dataviews_item_actions__WEBPACK_IMPORTED_MODULE_8__.ActionsMenuGroup,
+ {
+ actions: eligibleActions,
+ item,
+ registry,
+ setActiveModalAction
+ }
+ ) })
+ ] }),
+ !!activeModalAction && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _components_dataviews_item_actions__WEBPACK_IMPORTED_MODULE_8__.ActionModal,
+ {
+ action: activeModalAction,
+ items: [item],
+ closeModal: () => setActiveModalAction(null)
+ }
+ )
+ ] })
+ ] });
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Composite.Row,
+ {
+ ref: itemRef,
+ render: (
+ /* aria-posinset breaks Composite.Row if passed to it directly. */
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ "div",
+ {
+ "aria-posinset": posinset,
+ "aria-setsize": infiniteScrollEnabled ? paginationInfo.totalItems : void 0
+ }
+ )
+ ),
+ role: infiniteScrollEnabled ? "article" : "row",
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])({
+ "is-selected": isSelected,
+ "is-hovered": isHovered
+ }),
+ onMouseEnter: handleHover,
+ onMouseLeave: handleHover,
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalHStack, { className: "dataviews-view-list__item-wrapper", spacing: 0, children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", { role: "gridcell", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Composite.Item,
+ {
+ id: generateItemWrapperCompositeId(idPrefix),
+ "aria-pressed": isSelected,
+ "aria-labelledby": labelId,
+ "aria-describedby": descriptionId,
+ className: "dataviews-view-list__item",
+ onClick: () => onSelect(item)
+ }
+ ) }),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalHStack, { spacing: 3, justify: "start", alignment: "flex-start", children: [
+ renderedMediaField,
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalVStack,
+ {
+ spacing: 1,
+ className: "dataviews-view-list__field-wrapper",
+ children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalHStack, { spacing: 0, children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ "div",
+ {
+ className: "dataviews-title-field",
+ id: labelId,
+ children: renderedTitleField
+ }
+ ),
+ usedActions
+ ] }),
+ showDescription && descriptionField?.render && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", { className: "dataviews-view-list__field", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ descriptionField.render,
+ {
+ item,
+ field: descriptionField
+ }
+ ) }),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ "div",
+ {
+ className: "dataviews-view-list__fields",
+ id: descriptionId,
+ children: otherFields.map((field) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(
+ "div",
+ {
+ className: "dataviews-view-list__field",
+ children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.VisuallyHidden,
+ {
+ as: "span",
+ className: "dataviews-view-list__field-label",
+ children: field.label
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", { className: "dataviews-view-list__field-value", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ field.render,
+ {
+ item,
+ field
+ }
+ ) })
+ ]
+ },
+ field.id
+ ))
+ }
+ )
+ ]
+ }
+ )
+ ] })
+ ] })
+ }
+ );
+}
+function isDefined(item) {
+ return !!item;
+}
+function ViewList(props) {
+ const {
+ actions,
+ data,
+ fields,
+ getItemId,
+ isLoading,
+ onChangeSelection,
+ selection,
+ view,
+ className,
+ empty
+ } = props;
+ const baseId = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__.useInstanceId)(ViewList, "view-list");
+ const selectedItem = data?.findLast(
+ (item) => selection.includes(getItemId(item))
+ );
+ const titleField = fields.find((field) => field.id === view.titleField);
+ const mediaField = fields.find((field) => field.id === view.mediaField);
+ const descriptionField = fields.find(
+ (field) => field.id === view.descriptionField
+ );
+ const otherFields = (view?.fields ?? []).map((fieldId) => fields.find((f) => fieldId === f.id)).filter(isDefined);
+ const onSelect = (item) => onChangeSelection([getItemId(item)]);
+ const generateCompositeItemIdPrefix = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(
+ (item) => `${baseId}-${getItemId(item)}`,
+ [baseId, getItemId]
+ );
+ const isActiveCompositeItem = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(
+ (item, idToCheck) => {
+ return idToCheck.startsWith(
+ generateCompositeItemIdPrefix(item)
+ );
+ },
+ [generateCompositeItemIdPrefix]
+ );
+ const [activeCompositeId, setActiveCompositeId] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(void 0);
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
+ if (selectedItem) {
+ setActiveCompositeId(
+ generateItemWrapperCompositeId(
+ generateCompositeItemIdPrefix(selectedItem)
+ )
+ );
+ }
+ }, [selectedItem, generateCompositeItemIdPrefix]);
+ const activeItemIndex = data.findIndex(
+ (item) => isActiveCompositeItem(item, activeCompositeId ?? "")
+ );
+ const previousActiveItemIndex = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__.usePrevious)(activeItemIndex);
+ const isActiveIdInList = activeItemIndex !== -1;
+ const selectCompositeItem = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(
+ (targetIndex, generateCompositeId) => {
+ const clampedIndex = Math.min(
+ data.length - 1,
+ Math.max(0, targetIndex)
+ );
+ if (!data[clampedIndex]) {
+ return;
+ }
+ const itemIdPrefix = generateCompositeItemIdPrefix(
+ data[clampedIndex]
+ );
+ const targetCompositeItemId = generateCompositeId(itemIdPrefix);
+ setActiveCompositeId(targetCompositeItemId);
+ document.getElementById(targetCompositeItemId)?.focus();
+ },
+ [data, generateCompositeItemIdPrefix]
+ );
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
+ const wasActiveIdInList = previousActiveItemIndex !== void 0 && previousActiveItemIndex !== -1;
+ if (!isActiveIdInList && wasActiveIdInList) {
+ selectCompositeItem(
+ previousActiveItemIndex,
+ generateItemWrapperCompositeId
+ );
+ }
+ }, [isActiveIdInList, selectCompositeItem, previousActiveItemIndex]);
+ const onDropdownTriggerKeyDown = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(
+ (event) => {
+ if (event.key === "ArrowDown") {
+ event.preventDefault();
+ selectCompositeItem(
+ activeItemIndex + 1,
+ generateDropdownTriggerCompositeId
+ );
+ }
+ if (event.key === "ArrowUp") {
+ event.preventDefault();
+ selectCompositeItem(
+ activeItemIndex - 1,
+ generateDropdownTriggerCompositeId
+ );
+ }
+ },
+ [selectCompositeItem, activeItemIndex]
+ );
+ const hasData = data?.length;
+ if (!hasData) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ "div",
+ {
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])({
+ "dataviews-loading": isLoading,
+ "dataviews-no-results": !hasData && !isLoading
+ }),
+ children: !hasData && (isLoading ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("p", { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Spinner, {}) }) : empty)
+ }
+ );
+ }
+ const groupField = view.groupByField ? fields.find((field) => field.id === view.groupByField) : null;
+ const dataByGroup = groupField ? (0,_utils_get_data_by_group__WEBPACK_IMPORTED_MODULE_10__["default"])(data, groupField) : null;
+ if (hasData && groupField && dataByGroup) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Composite,
+ {
+ id: `${baseId}`,
+ render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {}),
+ className: "dataviews-view-list__group",
+ role: "grid",
+ activeId: activeCompositeId,
+ setActiveId: setActiveCompositeId,
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalVStack,
+ {
+ spacing: 4,
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])("dataviews-view-list", className),
+ children: Array.from(dataByGroup.entries()).map(
+ ([groupName, groupItems]) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalVStack, { spacing: 2, children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("h3", { className: "dataviews-view-list__group-header", children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.sprintf)(
+ // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)("%1$s: %2$s"),
+ groupField.label,
+ groupName
+ ) }),
+ groupItems.map((item) => {
+ const id = generateCompositeItemIdPrefix(item);
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ ListItem,
+ {
+ view,
+ idPrefix: id,
+ actions,
+ item,
+ isSelected: item === selectedItem,
+ onSelect,
+ mediaField,
+ titleField,
+ descriptionField,
+ otherFields,
+ onDropdownTriggerKeyDown
+ },
+ id
+ );
+ })
+ ] }, groupName)
+ )
+ }
+ )
+ }
+ );
+ }
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.Fragment, { children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Composite,
+ {
+ id: baseId,
+ render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {}),
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])("dataviews-view-list", className),
+ role: view.infiniteScrollEnabled ? "feed" : "grid",
+ activeId: activeCompositeId,
+ setActiveId: setActiveCompositeId,
+ children: data.map((item, index) => {
+ const id = generateCompositeItemIdPrefix(item);
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ ListItem,
+ {
+ view,
+ idPrefix: id,
+ actions,
+ item,
+ isSelected: item === selectedItem,
+ onSelect,
+ mediaField,
+ titleField,
+ descriptionField,
+ otherFields,
+ onDropdownTriggerKeyDown,
+ posinset: view.infiniteScrollEnabled ? index + 1 : void 0
+ },
+ id
+ );
+ })
+ }
+ ),
+ hasData && isLoading && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Spinner, {}) })
+ ] });
+}
+
+//# sourceMappingURL=index.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/picker-grid/index.js":
+/*!***********************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/picker-grid/index.js ***!
+ \***********************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ picker_grid_default)
+/* harmony export */ });
+/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
+/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__);
+/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
+/* harmony import */ var _components_dataviews_selection_checkbox__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../components/dataviews-selection-checkbox */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-selection-checkbox/index.js");
+/* harmony import */ var _components_dataviews_context__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../components/dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
+/* harmony import */ var _components_dataviews_picker_footer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../components/dataviews-picker/footer */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-picker/footer.js");
+/* harmony import */ var _utils_grid_items__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../utils/grid-items */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/grid-items.js");
+/* harmony import */ var _utils_get_data_by_group__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils/get-data-by-group */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/get-data-by-group.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__);
+// packages/dataviews/src/dataviews-layouts/picker-grid/index.tsx
+
+
+
+
+
+
+
+
+
+
+
+
+var { Badge } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_5__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.privateApis);
+function GridItem({
+ view,
+ multiselect,
+ selection,
+ onChangeSelection,
+ getItemId,
+ item,
+ mediaField,
+ titleField,
+ descriptionField,
+ regularFields,
+ badgeFields,
+ config,
+ posinset,
+ setsize
+}) {
+ const { showTitle = true, showMedia = true, showDescription = true } = view;
+ const id = getItemId(item);
+ const isSelected = selection.includes(id);
+ const renderedMediaField = mediaField?.render ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ mediaField.render,
+ {
+ item,
+ field: mediaField,
+ config
+ }
+ ) : null;
+ const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(titleField.render, { item, field: titleField }) : null;
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Composite.Item,
+ {
+ "aria-label": titleField ? titleField.getValue({ item }) || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("(no title)") : void 0,
+ render: ({ children, ...props }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalVStack, { spacing: 0, children, ...props }),
+ role: "option",
+ "aria-posinset": posinset,
+ "aria-setsize": setsize,
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])("dataviews-view-picker-grid__card", {
+ "is-selected": isSelected
+ }),
+ "aria-selected": isSelected,
+ onClick: () => {
+ if (isSelected) {
+ onChangeSelection(
+ selection.filter((itemId) => id !== itemId)
+ );
+ } else {
+ const newSelection = multiselect ? [...selection, id] : [id];
+ onChangeSelection(newSelection);
+ }
+ },
+ children: [
+ showMedia && renderedMediaField && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", { className: "dataviews-view-picker-grid__media", children: renderedMediaField }),
+ showMedia && renderedMediaField && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _components_dataviews_selection_checkbox__WEBPACK_IMPORTED_MODULE_6__["default"],
+ {
+ item,
+ selection,
+ onChangeSelection,
+ getItemId,
+ titleField,
+ disabled: false,
+ "aria-hidden": true,
+ tabIndex: -1
+ }
+ ),
+ showTitle && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHStack,
+ {
+ justify: "space-between",
+ className: "dataviews-view-picker-grid__title-actions",
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", { className: "dataviews-view-picker-grid__title-field dataviews-title-field", children: renderedTitleField })
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalVStack, { spacing: 1, children: [
+ showDescription && descriptionField?.render && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ descriptionField.render,
+ {
+ item,
+ field: descriptionField
+ }
+ ),
+ !!badgeFields?.length && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHStack,
+ {
+ className: "dataviews-view-picker-grid__badge-fields",
+ spacing: 2,
+ wrap: true,
+ alignment: "top",
+ justify: "flex-start",
+ children: badgeFields.map((field) => {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ Badge,
+ {
+ className: "dataviews-view-picker-grid__field-value",
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ field.render,
+ {
+ item,
+ field
+ }
+ )
+ },
+ field.id
+ );
+ })
+ }
+ ),
+ !!regularFields?.length && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalVStack,
+ {
+ className: "dataviews-view-picker-grid__fields",
+ spacing: 1,
+ children: regularFields.map((field) => {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Flex,
+ {
+ className: "dataviews-view-picker-grid__field",
+ gap: 1,
+ justify: "flex-start",
+ expanded: true,
+ style: { height: "auto" },
+ direction: "row",
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.Fragment, { children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.FlexItem, { className: "dataviews-view-picker-grid__field-name", children: field.header }),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.FlexItem,
+ {
+ className: "dataviews-view-picker-grid__field-value",
+ style: { maxHeight: "none" },
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ field.render,
+ {
+ item,
+ field
+ }
+ )
+ }
+ )
+ ] })
+ },
+ field.id
+ );
+ })
+ }
+ )
+ ] })
+ ]
+ },
+ id
+ );
+}
+function GridGroup({
+ groupName,
+ groupField,
+ children
+}) {
+ const headerId = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__.useInstanceId)(
+ GridGroup,
+ "dataviews-view-picker-grid-group__header"
+ );
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalVStack,
+ {
+ spacing: 2,
+ role: "group",
+ "aria-labelledby": headerId,
+ children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ "h3",
+ {
+ className: "dataviews-view-picker-grid-group__header",
+ id: headerId,
+ children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
+ // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s: %2$s"),
+ groupField.label,
+ groupName
+ )
+ }
+ ),
+ children
+ ]
+ },
+ groupName
+ );
+}
+function ViewPickerGrid({
+ actions,
+ data,
+ fields,
+ getItemId,
+ isLoading,
+ onChangeSelection,
+ selection,
+ view,
+ className,
+ empty
+}) {
+ const { resizeObserverRef, paginationInfo, itemListLabel } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useContext)(_components_dataviews_context__WEBPACK_IMPORTED_MODULE_7__["default"]);
+ const titleField = fields.find(
+ (field) => field.id === view?.titleField
+ );
+ const mediaField = fields.find(
+ (field) => field.id === view?.mediaField
+ );
+ const descriptionField = fields.find(
+ (field) => field.id === view?.descriptionField
+ );
+ const otherFields = view.fields ?? [];
+ const { regularFields, badgeFields } = otherFields.reduce(
+ (accumulator, fieldId) => {
+ const field = fields.find((f) => f.id === fieldId);
+ if (!field) {
+ return accumulator;
+ }
+ const key = view.layout?.badgeFields?.includes(fieldId) ? "badgeFields" : "regularFields";
+ accumulator[key].push(field);
+ return accumulator;
+ },
+ { regularFields: [], badgeFields: [] }
+ );
+ const hasData = !!data?.length;
+ const usedPreviewSize = view.layout?.previewSize;
+ const isMultiselect = (0,_components_dataviews_picker_footer__WEBPACK_IMPORTED_MODULE_8__.useIsMultiselectPicker)(actions);
+ const size = "900px";
+ const groupField = view.groupByField ? fields.find((f) => f.id === view.groupByField) : null;
+ const dataByGroup = groupField ? (0,_utils_get_data_by_group__WEBPACK_IMPORTED_MODULE_10__["default"])(data, groupField) : null;
+ const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup;
+ const currentPage = view?.page ?? 1;
+ const perPage = view?.perPage ?? 0;
+ const setSize = isInfiniteScroll ? paginationInfo?.totalItems : void 0;
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.Fragment, {
+ // Render multiple groups.
+ children: [
+ hasData && groupField && dataByGroup && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Composite,
+ {
+ virtualFocus: true,
+ orientation: "horizontal",
+ role: "listbox",
+ "aria-multiselectable": isMultiselect,
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])(
+ "dataviews-view-picker-grid",
+ className
+ ),
+ "aria-label": itemListLabel,
+ render: ({ children, ...props }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalVStack,
+ {
+ spacing: 4,
+ children,
+ ...props
+ }
+ ),
+ children: Array.from(dataByGroup.entries()).map(
+ ([groupName, groupItems]) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ GridGroup,
+ {
+ groupName,
+ groupField,
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _utils_grid_items__WEBPACK_IMPORTED_MODULE_9__.GridItems,
+ {
+ previewSize: usedPreviewSize,
+ style: {
+ gridTemplateColumns: usedPreviewSize && `repeat(auto-fill, minmax(${usedPreviewSize}px, 1fr))`
+ },
+ "aria-busy": isLoading,
+ ref: resizeObserverRef,
+ children: groupItems.map((item) => {
+ const posInSet = (currentPage - 1) * perPage + data.indexOf(item) + 1;
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ GridItem,
+ {
+ view,
+ multiselect: isMultiselect,
+ selection,
+ onChangeSelection,
+ getItemId,
+ item,
+ mediaField,
+ titleField,
+ descriptionField,
+ regularFields,
+ badgeFields,
+ config: {
+ sizes: size
+ },
+ posinset: posInSet,
+ setsize: setSize
+ },
+ getItemId(item)
+ );
+ })
+ }
+ )
+ },
+ groupName
+ )
+ )
+ }
+ ),
+ // Render a single grid with all data.
+ hasData && !dataByGroup && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Composite,
+ {
+ render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ _utils_grid_items__WEBPACK_IMPORTED_MODULE_9__.GridItems,
+ {
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])(
+ "dataviews-view-picker-grid",
+ className
+ ),
+ previewSize: usedPreviewSize,
+ "aria-busy": isLoading,
+ ref: resizeObserverRef
+ }
+ ),
+ virtualFocus: true,
+ orientation: "horizontal",
+ role: "listbox",
+ "aria-multiselectable": isMultiselect,
+ "aria-label": itemListLabel,
+ children: data.map((item, index) => {
+ let posinset = isInfiniteScroll ? index + 1 : void 0;
+ if (!isInfiniteScroll) {
+ posinset = (currentPage - 1) * perPage + index + 1;
+ }
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ GridItem,
+ {
+ view,
+ multiselect: isMultiselect,
+ selection,
+ onChangeSelection,
+ getItemId,
+ item,
+ mediaField,
+ titleField,
+ descriptionField,
+ regularFields,
+ badgeFields,
+ config: {
+ sizes: size
+ },
+ posinset,
+ setsize: setSize
+ },
+ getItemId(item)
+ );
+ })
+ }
+ ),
+ // Render empty state.
+ !hasData && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
+ "div",
+ {
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])({
+ "dataviews-loading": isLoading,
+ "dataviews-no-results": !isLoading
+ }),
+ children: isLoading ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("p", { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Spinner, {}) }) : empty
+ }
+ ),
+ hasData && isLoading && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Spinner, {}) })
+ ]
+ });
+}
+var picker_grid_default = ViewPickerGrid;
+
+//# sourceMappingURL=index.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/picker-table/index.js":
+/*!************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/picker-table/index.js ***!
+ \************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ picker_table_default)
+/* harmony export */ });
+/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _components_dataviews_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../components/dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
+/* harmony import */ var _components_dataviews_selection_checkbox__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../components/dataviews-selection-checkbox */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-selection-checkbox/index.js");
+/* harmony import */ var _components_dataviews_picker_footer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../components/dataviews-picker/footer */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-picker/footer.js");
+/* harmony import */ var _components_dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../components/dataviews-bulk-actions */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-bulk-actions/index.js");
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+/* harmony import */ var _table_column_header_menu__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../table/column-header-menu */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/column-header-menu.js");
+/* harmony import */ var _table_column_primary__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../table/column-primary */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/column-primary.js");
+/* harmony import */ var _utils_get_data_by_group__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../utils/get-data-by-group */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/get-data-by-group.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__);
+// packages/dataviews/src/dataviews-layouts/picker-table/index.tsx
+
+
+
+
+
+
+
+
+
+
+
+
+
+function TableColumnField({
+ item,
+ fields,
+ column,
+ align
+}) {
+ const field = fields.find((f) => f.id === column);
+ if (!field) {
+ return null;
+ }
+ const className = (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])("dataviews-view-table__cell-content-wrapper", {
+ "dataviews-view-table__cell-align-end": align === "end",
+ "dataviews-view-table__cell-align-center": align === "center"
+ });
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div", { className, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(field.render, { item, field }) });
+}
+function TableRow({
+ item,
+ fields,
+ id,
+ view,
+ titleField,
+ mediaField,
+ descriptionField,
+ selection,
+ getItemId,
+ onChangeSelection,
+ multiselect,
+ posinset
+}) {
+ const { paginationInfo } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useContext)(_components_dataviews_context__WEBPACK_IMPORTED_MODULE_4__["default"]);
+ const isSelected = selection.includes(id);
+ const [isHovered, setIsHovered] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(false);
+ const {
+ showTitle = true,
+ showMedia = true,
+ showDescription = true,
+ infiniteScrollEnabled
+ } = view;
+ const handleMouseEnter = () => {
+ setIsHovered(true);
+ };
+ const handleMouseLeave = () => {
+ setIsHovered(false);
+ };
+ const columns = view.fields ?? [];
+ const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField && showDescription;
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Composite.Item,
+ {
+ render: ({ children, ...props }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ "tr",
+ {
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])("dataviews-view-table__row", {
+ "is-selected": isSelected,
+ "is-hovered": isHovered
+ }),
+ onMouseEnter: handleMouseEnter,
+ onMouseLeave: handleMouseLeave,
+ children,
+ ...props
+ }
+ ),
+ "aria-selected": isSelected,
+ "aria-setsize": paginationInfo.totalItems || void 0,
+ "aria-posinset": posinset,
+ role: infiniteScrollEnabled ? "article" : "option",
+ onClick: () => {
+ if (isSelected) {
+ onChangeSelection(
+ selection.filter((itemId) => id !== itemId)
+ );
+ } else {
+ const newSelection = multiselect ? [...selection, id] : [id];
+ onChangeSelection(newSelection);
+ }
+ },
+ children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ "td",
+ {
+ className: "dataviews-view-table__checkbox-column",
+ role: "presentation",
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div", { className: "dataviews-view-table__cell-content-wrapper", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ _components_dataviews_selection_checkbox__WEBPACK_IMPORTED_MODULE_5__["default"],
+ {
+ item,
+ selection,
+ onChangeSelection,
+ getItemId,
+ titleField,
+ disabled: false,
+ "aria-hidden": true,
+ tabIndex: -1
+ }
+ ) })
+ }
+ ),
+ hasPrimaryColumn && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td", { role: "presentation", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ _table_column_primary__WEBPACK_IMPORTED_MODULE_10__["default"],
+ {
+ item,
+ titleField: showTitle ? titleField : void 0,
+ mediaField: showMedia ? mediaField : void 0,
+ descriptionField: showDescription ? descriptionField : void 0,
+ isItemClickable: () => false
+ }
+ ) }),
+ columns.map((column) => {
+ const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {};
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ "td",
+ {
+ style: {
+ width,
+ maxWidth,
+ minWidth
+ },
+ role: "presentation",
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ TableColumnField,
+ {
+ fields,
+ item,
+ column,
+ align
+ }
+ )
+ },
+ column
+ );
+ })
+ ]
+ },
+ id
+ );
+}
+function ViewPickerTable({
+ actions,
+ data,
+ fields,
+ getItemId,
+ isLoading = false,
+ onChangeView,
+ onChangeSelection,
+ selection,
+ setOpenedFilter,
+ view,
+ className,
+ empty
+}) {
+ const headerMenuRefs = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)(/* @__PURE__ */ new Map());
+ const headerMenuToFocusRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)();
+ const [nextHeaderMenuToFocus, setNextHeaderMenuToFocus] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)();
+ const isMultiselect = (0,_components_dataviews_picker_footer__WEBPACK_IMPORTED_MODULE_6__.useIsMultiselectPicker)(actions) ?? false;
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
+ if (headerMenuToFocusRef.current) {
+ headerMenuToFocusRef.current.focus();
+ headerMenuToFocusRef.current = void 0;
+ }
+ });
+ const tableNoticeId = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useId)();
+ if (nextHeaderMenuToFocus) {
+ headerMenuToFocusRef.current = nextHeaderMenuToFocus;
+ setNextHeaderMenuToFocus(void 0);
+ return;
+ }
+ const onHide = (field) => {
+ const hidden = headerMenuRefs.current.get(field.id);
+ const fallback = hidden ? headerMenuRefs.current.get(hidden.fallback) : void 0;
+ setNextHeaderMenuToFocus(fallback?.node);
+ };
+ const hasData = !!data?.length;
+ const titleField = fields.find((field) => field.id === view.titleField);
+ const mediaField = fields.find((field) => field.id === view.mediaField);
+ const descriptionField = fields.find(
+ (field) => field.id === view.descriptionField
+ );
+ const groupField = view.groupByField ? fields.find((f) => f.id === view.groupByField) : null;
+ const dataByGroup = groupField ? (0,_utils_get_data_by_group__WEBPACK_IMPORTED_MODULE_11__["default"])(data, groupField) : null;
+ const { showTitle = true, showMedia = true, showDescription = true } = view;
+ const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField && showDescription;
+ const columns = view.fields ?? [];
+ const headerMenuRef = (column, index) => (node) => {
+ if (node) {
+ headerMenuRefs.current.set(column, {
+ node,
+ fallback: columns[index > 0 ? index - 1 : 1]
+ });
+ } else {
+ headerMenuRefs.current.delete(column);
+ }
+ };
+ const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup;
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.Fragment, { children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(
+ "table",
+ {
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])(
+ "dataviews-view-table",
+ "dataviews-view-picker-table",
+ className,
+ {
+ [`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes(
+ view.layout.density
+ )
+ }
+ ),
+ "aria-busy": isLoading,
+ "aria-describedby": tableNoticeId,
+ role: isInfiniteScroll ? "feed" : "listbox",
+ children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("thead", { role: "presentation", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(
+ "tr",
+ {
+ className: "dataviews-view-table__row",
+ role: "presentation",
+ children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("th", { className: "dataviews-view-table__checkbox-column", children: isMultiselect && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ _components_dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_7__.BulkSelectionCheckbox,
+ {
+ selection,
+ onChangeSelection,
+ data,
+ actions,
+ getItemId
+ }
+ ) }),
+ hasPrimaryColumn && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("th", { children: titleField && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ _table_column_header_menu__WEBPACK_IMPORTED_MODULE_9__["default"],
+ {
+ ref: headerMenuRef(
+ titleField.id,
+ 0
+ ),
+ fieldId: titleField.id,
+ view,
+ fields,
+ onChangeView,
+ onHide,
+ setOpenedFilter,
+ canMove: false
+ }
+ ) }),
+ columns.map((column, index) => {
+ const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {};
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ "th",
+ {
+ style: {
+ width,
+ maxWidth,
+ minWidth,
+ textAlign: align
+ },
+ "aria-sort": view.sort?.direction && view.sort?.field === column ? _constants__WEBPACK_IMPORTED_MODULE_8__.sortValues[view.sort.direction] : void 0,
+ scope: "col",
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ _table_column_header_menu__WEBPACK_IMPORTED_MODULE_9__["default"],
+ {
+ ref: headerMenuRef(column, index),
+ fieldId: column,
+ view,
+ fields,
+ onChangeView,
+ onHide,
+ setOpenedFilter,
+ canMove: view.layout?.enableMoving ?? true
+ }
+ )
+ },
+ column
+ );
+ })
+ ]
+ }
+ ) }),
+ hasData && groupField && dataByGroup ? Array.from(dataByGroup.entries()).map(
+ ([groupName, groupItems]) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Composite,
+ {
+ virtualFocus: true,
+ orientation: "vertical",
+ render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("tbody", { role: "group" }),
+ children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ "tr",
+ {
+ className: "dataviews-view-table__group-header-row",
+ role: "presentation",
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ "td",
+ {
+ colSpan: columns.length + (hasPrimaryColumn ? 1 : 0) + 1,
+ className: "dataviews-view-table__group-header-cell",
+ role: "presentation",
+ children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(
+ // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("%1$s: %2$s"),
+ groupField.label,
+ groupName
+ )
+ }
+ )
+ }
+ ),
+ groupItems.map((item, index) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ TableRow,
+ {
+ item,
+ fields,
+ id: getItemId(item) || index.toString(),
+ view,
+ titleField,
+ mediaField,
+ descriptionField,
+ selection,
+ getItemId,
+ onChangeSelection,
+ multiselect: isMultiselect
+ },
+ getItemId(item)
+ ))
+ ]
+ },
+ `group-${groupName}`
+ )
+ ) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Composite,
+ {
+ render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("tbody", { role: "presentation" }),
+ virtualFocus: true,
+ orientation: "vertical",
+ children: hasData && data.map((item, index) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
+ TableRow,
+ {
+ item,
+ fields,
+ id: getItemId(item) || index.toString(),
+ view,
+ titleField,
+ mediaField,
+ descriptionField,
+ selection,
+ getItemId,
+ onChangeSelection,
+ multiselect: isMultiselect,
+ posinset: index + 1
+ },
+ getItemId(item)
+ ))
+ }
+ )
+ ]
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(
+ "div",
+ {
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])({
+ "dataviews-loading": isLoading,
+ "dataviews-no-results": !hasData && !isLoading
+ }),
+ id: tableNoticeId,
+ children: [
+ !hasData && (isLoading ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("p", { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Spinner, {}) }) : empty),
+ hasData && isLoading && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Spinner, {}) })
+ ]
+ }
+ )
+ ] });
+}
+var picker_table_default = ViewPickerTable;
+
+//# sourceMappingURL=index.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/column-header-menu.js":
+/*!******************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/column-header-menu.js ***!
+ \******************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ column_header_menu_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/arrow-left.js");
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/arrow-right.js");
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/funnel.js");
+/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/unseen.js");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
+/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__);
+// packages/dataviews/src/dataviews-layouts/table/column-header-menu.tsx
+
+
+
+
+
+
+
+var { Menu } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_7__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.privateApis);
+function WithMenuSeparators({ children }) {
+ return _wordpress_element__WEBPACK_IMPORTED_MODULE_6__.Children.toArray(children).filter(Boolean).map((child, i) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.Fragment, { children: [
+ i > 0 && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Menu.Separator, {}),
+ child
+ ] }, i));
+}
+var _HeaderMenu = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.forwardRef)(function HeaderMenu({
+ fieldId,
+ view,
+ fields,
+ onChangeView,
+ onHide,
+ setOpenedFilter,
+ canMove = true
+}, ref) {
+ const visibleFieldIds = view.fields ?? [];
+ const index = visibleFieldIds?.indexOf(fieldId);
+ const isSorted = view.sort?.field === fieldId;
+ let isHidable = false;
+ let isSortable = false;
+ let canAddFilter = false;
+ let operators = [];
+ const field = fields.find((f) => f.id === fieldId);
+ if (!field) {
+ return null;
+ }
+ isHidable = field.enableHiding !== false;
+ isSortable = field.enableSorting !== false;
+ const header = field.header;
+ operators = !!field.filterBy && field.filterBy?.operators || [];
+ canAddFilter = !view.filters?.some((_filter) => fieldId === _filter.field) && !!(field.hasElements || field.Edit) && field.filterBy !== false && !field.filterBy?.isPrimary;
+ if (!isSortable && !canMove && !isHidable && !canAddFilter) {
+ return header;
+ }
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(Menu, { children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(
+ Menu.TriggerButton,
+ {
+ render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_5__.Button,
+ {
+ size: "compact",
+ className: "dataviews-view-table-header-button",
+ ref,
+ variant: "tertiary"
+ }
+ ),
+ children: [
+ header,
+ view.sort && isSorted && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("span", { "aria-hidden": "true", children: _constants__WEBPACK_IMPORTED_MODULE_8__.sortArrows[view.sort.direction] })
+ ]
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Menu.Popover, { style: { minWidth: "240px" }, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(WithMenuSeparators, { children: [
+ isSortable && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Menu.Group, { children: _constants__WEBPACK_IMPORTED_MODULE_8__.SORTING_DIRECTIONS.map(
+ (direction) => {
+ const isChecked = view.sort && isSorted && view.sort.direction === direction;
+ const value = `${fieldId}-${direction}`;
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(
+ Menu.RadioItem,
+ {
+ name: "view-table-sorting",
+ value,
+ checked: isChecked,
+ onChange: () => {
+ onChangeView({
+ ...view,
+ sort: {
+ field: fieldId,
+ direction
+ },
+ showLevels: false
+ });
+ },
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Menu.ItemLabel, { children: _constants__WEBPACK_IMPORTED_MODULE_8__.sortLabels[direction] })
+ },
+ value
+ );
+ }
+ ) }),
+ canAddFilter && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Menu.Group, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(
+ Menu.Item,
+ {
+ prefix: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.Icon, { icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"] }),
+ onClick: () => {
+ setOpenedFilter(fieldId);
+ onChangeView({
+ ...view,
+ page: 1,
+ filters: [
+ ...view.filters || [],
+ {
+ field: fieldId,
+ value: void 0,
+ operator: operators[0]
+ }
+ ]
+ });
+ },
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Menu.ItemLabel, { children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Add filter") })
+ }
+ ) }),
+ (canMove || isHidable) && field && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(Menu.Group, { children: [
+ canMove && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(
+ Menu.Item,
+ {
+ prefix: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.Icon, { icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__["default"] }),
+ disabled: index < 1,
+ onClick: () => {
+ onChangeView({
+ ...view,
+ fields: [
+ ...visibleFieldIds.slice(
+ 0,
+ index - 1
+ ) ?? [],
+ fieldId,
+ visibleFieldIds[index - 1],
+ ...visibleFieldIds.slice(
+ index + 1
+ )
+ ]
+ });
+ },
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Menu.ItemLabel, { children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Move left") })
+ }
+ ),
+ canMove && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(
+ Menu.Item,
+ {
+ prefix: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.Icon, { icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"] }),
+ disabled: index >= visibleFieldIds.length - 1,
+ onClick: () => {
+ onChangeView({
+ ...view,
+ fields: [
+ ...visibleFieldIds.slice(
+ 0,
+ index
+ ) ?? [],
+ visibleFieldIds[index + 1],
+ fieldId,
+ ...visibleFieldIds.slice(
+ index + 2
+ )
+ ]
+ });
+ },
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Menu.ItemLabel, { children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Move right") })
+ }
+ ),
+ isHidable && field && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(
+ Menu.Item,
+ {
+ prefix: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.Icon, { icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__["default"] }),
+ onClick: () => {
+ onHide(field);
+ onChangeView({
+ ...view,
+ fields: visibleFieldIds.filter(
+ (id) => id !== fieldId
+ )
+ });
+ },
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Menu.ItemLabel, { children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Hide column") })
+ }
+ )
+ ] })
+ ] }) })
+ ] });
+});
+var ColumnHeaderMenu = _HeaderMenu;
+var column_header_menu_default = ColumnHeaderMenu;
+
+//# sourceMappingURL=column-header-menu.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/column-primary.js":
+/*!**************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/column-primary.js ***!
+ \**************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ column_primary_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _utils_item_click_wrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/item-click-wrapper */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/item-click-wrapper.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
+// packages/dataviews/src/dataviews-layouts/table/column-primary.tsx
+
+
+
+function ColumnPrimary({
+ item,
+ level,
+ titleField,
+ mediaField,
+ descriptionField,
+ onClickItem,
+ renderItemLink,
+ isItemClickable
+}) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack, { spacing: 3, justify: "flex-start", children: [
+ mediaField && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(
+ _utils_item_click_wrapper__WEBPACK_IMPORTED_MODULE_1__.ItemClickWrapper,
+ {
+ item,
+ isItemClickable,
+ onClickItem,
+ renderItemLink,
+ className: "dataviews-view-table__cell-content-wrapper dataviews-column-primary__media",
+ "aria-label": isItemClickable(item) && (!!onClickItem || !!renderItemLink) && !!titleField ? titleField.getValue?.({ item }) : void 0,
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(
+ mediaField.render,
+ {
+ item,
+ field: mediaField,
+ config: { sizes: "32px" }
+ }
+ )
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalVStack,
+ {
+ spacing: 0,
+ alignment: "flex-start",
+ className: "dataviews-view-table__primary-column-content",
+ children: [
+ titleField && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(
+ _utils_item_click_wrapper__WEBPACK_IMPORTED_MODULE_1__.ItemClickWrapper,
+ {
+ item,
+ isItemClickable,
+ onClickItem,
+ renderItemLink,
+ className: "dataviews-view-table__cell-content-wrapper dataviews-title-field",
+ children: [
+ level !== void 0 && level > 0 && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("span", { className: "dataviews-view-table__level", children: [
+ "\u2014".repeat(level),
+ "\xA0"
+ ] }),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(titleField.render, { item, field: titleField })
+ ]
+ }
+ ),
+ descriptionField && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(
+ descriptionField.render,
+ {
+ item,
+ field: descriptionField
+ }
+ )
+ ]
+ }
+ )
+ ] });
+}
+var column_primary_default = ColumnPrimary;
+
+//# sourceMappingURL=column-primary.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/density-picker.js":
+/*!**************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/density-picker.js ***!
+ \**************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ DensityPicker)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _components_dataviews_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../components/dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
+// packages/dataviews/src/dataviews-layouts/table/density-picker.tsx
+
+
+
+
+
+function DensityPicker() {
+ const context = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useContext)(_components_dataviews_context__WEBPACK_IMPORTED_MODULE_3__["default"]);
+ const view = context.view;
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalToggleGroupControl,
+ {
+ __nextHasNoMarginBottom: true,
+ size: "__unstable-large",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Density"),
+ value: view.layout?.density || "balanced",
+ onChange: (value) => {
+ context.onChangeView({
+ ...view,
+ layout: {
+ ...view.layout,
+ density: value
+ }
+ });
+ },
+ isBlock: true,
+ children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalToggleGroupControlOption,
+ {
+ value: "comfortable",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x)(
+ "Comfortable",
+ "Density option for DataView layout"
+ )
+ },
+ "comfortable"
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalToggleGroupControlOption,
+ {
+ value: "balanced",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x)("Balanced", "Density option for DataView layout")
+ },
+ "balanced"
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalToggleGroupControlOption,
+ {
+ value: "compact",
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x)("Compact", "Density option for DataView layout")
+ },
+ "compact"
+ )
+ ]
+ }
+ );
+}
+
+//# sourceMappingURL=density-picker.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/index.js":
+/*!*****************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/index.js ***!
+ \*****************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ table_default)
+/* harmony export */ });
+/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes");
+/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4__);
+/* harmony import */ var _components_dataviews_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../components/dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
+/* harmony import */ var _components_dataviews_selection_checkbox__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../components/dataviews-selection-checkbox */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-selection-checkbox/index.js");
+/* harmony import */ var _components_dataviews_item_actions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../components/dataviews-item-actions */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-item-actions/index.js");
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+/* harmony import */ var _components_dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../components/dataviews-bulk-actions */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-bulk-actions/index.js");
+/* harmony import */ var _column_header_menu__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./column-header-menu */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/column-header-menu.js");
+/* harmony import */ var _column_primary__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./column-primary */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/column-primary.js");
+/* harmony import */ var _use_is_horizontal_scroll_end__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./use-is-horizontal-scroll-end */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/use-is-horizontal-scroll-end.js");
+/* harmony import */ var _utils_get_data_by_group__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../utils/get-data-by-group */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/get-data-by-group.js");
+/* harmony import */ var _components_dataviews_view_config_properties_section__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../components/dataviews-view-config/properties-section */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/properties-section.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__);
+// packages/dataviews/src/dataviews-layouts/table/index.tsx
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+function TableColumnField({
+ item,
+ fields,
+ column,
+ align
+}) {
+ const field = fields.find((f) => f.id === column);
+ if (!field) {
+ return null;
+ }
+ const className = (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])("dataviews-view-table__cell-content-wrapper", {
+ "dataviews-view-table__cell-align-end": align === "end",
+ "dataviews-view-table__cell-align-center": align === "center"
+ });
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("div", { className, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(field.render, { item, field }) });
+}
+function TableRow({
+ hasBulkActions,
+ item,
+ level,
+ actions,
+ fields,
+ id,
+ view,
+ titleField,
+ mediaField,
+ descriptionField,
+ selection,
+ getItemId,
+ isItemClickable,
+ onClickItem,
+ renderItemLink,
+ onChangeSelection,
+ isActionsColumnSticky,
+ posinset
+}) {
+ const { paginationInfo } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useContext)(_components_dataviews_context__WEBPACK_IMPORTED_MODULE_5__["default"]);
+ const hasPossibleBulkAction = (0,_components_dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_9__.useHasAPossibleBulkAction)(actions, item);
+ const isSelected = hasPossibleBulkAction && selection.includes(id);
+ const [isHovered, setIsHovered] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(false);
+ const {
+ showTitle = true,
+ showMedia = true,
+ showDescription = true,
+ infiniteScrollEnabled
+ } = view;
+ const handleMouseEnter = () => {
+ setIsHovered(true);
+ };
+ const handleMouseLeave = () => {
+ setIsHovered(false);
+ };
+ const isTouchDeviceRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)(false);
+ const columns = view.fields ?? [];
+ const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField && showDescription;
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsxs)(
+ "tr",
+ {
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])("dataviews-view-table__row", {
+ "is-selected": hasPossibleBulkAction && isSelected,
+ "is-hovered": isHovered,
+ "has-bulk-actions": hasPossibleBulkAction
+ }),
+ onMouseEnter: handleMouseEnter,
+ onMouseLeave: handleMouseLeave,
+ onTouchStart: () => {
+ isTouchDeviceRef.current = true;
+ },
+ "aria-setsize": infiniteScrollEnabled ? paginationInfo.totalItems : void 0,
+ "aria-posinset": posinset,
+ role: infiniteScrollEnabled ? "article" : void 0,
+ onClick: (event) => {
+ if (!hasPossibleBulkAction) {
+ return;
+ }
+ if (!isTouchDeviceRef.current && document.getSelection()?.type !== "Range") {
+ if ((0,_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4__.isAppleOS)() ? event.metaKey : event.ctrlKey) {
+ onChangeSelection(
+ selection.includes(id) ? selection.filter(
+ (itemId) => id !== itemId
+ ) : [...selection, id]
+ );
+ } else {
+ onChangeSelection(
+ selection.includes(id) ? selection.filter(
+ (itemId) => id !== itemId
+ ) : [id]
+ );
+ }
+ }
+ },
+ children: [
+ hasBulkActions && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("td", { className: "dataviews-view-table__checkbox-column", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("div", { className: "dataviews-view-table__cell-content-wrapper", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
+ _components_dataviews_selection_checkbox__WEBPACK_IMPORTED_MODULE_6__["default"],
+ {
+ item,
+ selection,
+ onChangeSelection,
+ getItemId,
+ titleField,
+ disabled: !hasPossibleBulkAction
+ }
+ ) }) }),
+ hasPrimaryColumn && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("td", { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
+ _column_primary__WEBPACK_IMPORTED_MODULE_11__["default"],
+ {
+ item,
+ level,
+ titleField: showTitle ? titleField : void 0,
+ mediaField: showMedia ? mediaField : void 0,
+ descriptionField: showDescription ? descriptionField : void 0,
+ isItemClickable,
+ onClickItem,
+ renderItemLink
+ }
+ ) }),
+ columns.map((column) => {
+ const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {};
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
+ "td",
+ {
+ style: {
+ width,
+ maxWidth,
+ minWidth
+ },
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
+ TableColumnField,
+ {
+ fields,
+ item,
+ column,
+ align
+ }
+ )
+ },
+ column
+ );
+ }),
+ !!actions?.length && // Disable reason: we are not making the element interactive,
+ // but preventing any click events from bubbling up to the
+ // table row. This allows us to add a click handler to the row
+ // itself (to toggle row selection) without erroneously
+ // intercepting click events from ItemActions.
+ /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
+ "td",
+ {
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])("dataviews-view-table__actions-column", {
+ "dataviews-view-table__actions-column--sticky": true,
+ "dataviews-view-table__actions-column--stuck": isActionsColumnSticky
+ }),
+ onClick: (e) => e.stopPropagation(),
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_components_dataviews_item_actions__WEBPACK_IMPORTED_MODULE_7__["default"], { item, actions })
+ }
+ )
+ ]
+ }
+ );
+}
+function ViewTable({
+ actions,
+ data,
+ fields,
+ getItemId,
+ getItemLevel,
+ isLoading = false,
+ onChangeView,
+ onChangeSelection,
+ selection,
+ setOpenedFilter,
+ onClickItem,
+ isItemClickable,
+ renderItemLink,
+ view,
+ className,
+ empty
+}) {
+ const { containerRef } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useContext)(_components_dataviews_context__WEBPACK_IMPORTED_MODULE_5__["default"]);
+ const headerMenuRefs = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)(/* @__PURE__ */ new Map());
+ const headerMenuToFocusRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)();
+ const [nextHeaderMenuToFocus, setNextHeaderMenuToFocus] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)();
+ const hasBulkActions = (0,_components_dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_9__.useSomeItemHasAPossibleBulkAction)(actions, data);
+ const [contextMenuAnchor, setContextMenuAnchor] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(null);
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
+ if (headerMenuToFocusRef.current) {
+ headerMenuToFocusRef.current.focus();
+ headerMenuToFocusRef.current = void 0;
+ }
+ });
+ const tableNoticeId = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useId)();
+ const isHorizontalScrollEnd = (0,_use_is_horizontal_scroll_end__WEBPACK_IMPORTED_MODULE_12__.useIsHorizontalScrollEnd)({
+ scrollContainerRef: containerRef,
+ enabled: !!actions?.length
+ });
+ if (nextHeaderMenuToFocus) {
+ headerMenuToFocusRef.current = nextHeaderMenuToFocus;
+ setNextHeaderMenuToFocus(void 0);
+ return;
+ }
+ const onHide = (field) => {
+ const hidden = headerMenuRefs.current.get(field.id);
+ const fallback = hidden ? headerMenuRefs.current.get(hidden.fallback) : void 0;
+ setNextHeaderMenuToFocus(fallback?.node);
+ };
+ const handleHeaderContextMenu = (event) => {
+ event.preventDefault();
+ event.stopPropagation();
+ const virtualAnchor = {
+ getBoundingClientRect: () => ({
+ x: event.clientX,
+ y: event.clientY,
+ top: event.clientY,
+ left: event.clientX,
+ right: event.clientX,
+ bottom: event.clientY,
+ width: 0,
+ height: 0,
+ toJSON: () => ({})
+ })
+ };
+ window.requestAnimationFrame(() => {
+ setContextMenuAnchor(virtualAnchor);
+ });
+ };
+ const hasData = !!data?.length;
+ const titleField = fields.find((field) => field.id === view.titleField);
+ const mediaField = fields.find((field) => field.id === view.mediaField);
+ const descriptionField = fields.find(
+ (field) => field.id === view.descriptionField
+ );
+ const groupField = view.groupByField ? fields.find((f) => f.id === view.groupByField) : null;
+ const dataByGroup = groupField ? (0,_utils_get_data_by_group__WEBPACK_IMPORTED_MODULE_13__["default"])(data, groupField) : null;
+ const { showTitle = true, showMedia = true, showDescription = true } = view;
+ const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField && showDescription;
+ const columns = view.fields ?? [];
+ const headerMenuRef = (column, index) => (node) => {
+ if (node) {
+ headerMenuRefs.current.set(column, {
+ node,
+ fallback: columns[index > 0 ? index - 1 : 1]
+ });
+ } else {
+ headerMenuRefs.current.delete(column);
+ }
+ };
+ const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup;
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.Fragment, { children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsxs)(
+ "table",
+ {
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])("dataviews-view-table", className, {
+ [`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes(
+ view.layout.density
+ )
+ }),
+ "aria-busy": isLoading,
+ "aria-describedby": tableNoticeId,
+ role: isInfiniteScroll ? "feed" : void 0,
+ children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsxs)("colgroup", { children: [
+ hasBulkActions && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("col", { className: "dataviews-view-table__col-checkbox" }),
+ hasPrimaryColumn && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("col", { className: "dataviews-view-table__col-primary" }),
+ columns.map((column) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
+ "col",
+ {
+ className: `dataviews-view-table__col-${column}`
+ },
+ `col-${column}`
+ )),
+ !!actions?.length && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("col", { className: "dataviews-view-table__col-actions" })
+ ] }),
+ contextMenuAnchor && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Popover,
+ {
+ anchor: contextMenuAnchor,
+ onClose: () => setContextMenuAnchor(null),
+ placement: "bottom-start",
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_components_dataviews_view_config_properties_section__WEBPACK_IMPORTED_MODULE_14__.PropertiesSection, { showLabel: false })
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("thead", { onContextMenu: handleHeaderContextMenu, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsxs)("tr", { className: "dataviews-view-table__row", children: [
+ hasBulkActions && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
+ "th",
+ {
+ className: "dataviews-view-table__checkbox-column",
+ scope: "col",
+ onContextMenu: handleHeaderContextMenu,
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
+ _components_dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_9__.BulkSelectionCheckbox,
+ {
+ selection,
+ onChangeSelection,
+ data,
+ actions,
+ getItemId
+ }
+ )
+ }
+ ),
+ hasPrimaryColumn && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("th", { scope: "col", children: titleField && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
+ _column_header_menu__WEBPACK_IMPORTED_MODULE_10__["default"],
+ {
+ ref: headerMenuRef(
+ titleField.id,
+ 0
+ ),
+ fieldId: titleField.id,
+ view,
+ fields,
+ onChangeView,
+ onHide,
+ setOpenedFilter,
+ canMove: false
+ }
+ ) }),
+ columns.map((column, index) => {
+ const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {};
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
+ "th",
+ {
+ style: {
+ width,
+ maxWidth,
+ minWidth,
+ textAlign: align
+ },
+ "aria-sort": view.sort?.direction && view.sort?.field === column ? _constants__WEBPACK_IMPORTED_MODULE_8__.sortValues[view.sort.direction] : void 0,
+ scope: "col",
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
+ _column_header_menu__WEBPACK_IMPORTED_MODULE_10__["default"],
+ {
+ ref: headerMenuRef(column, index),
+ fieldId: column,
+ view,
+ fields,
+ onChangeView,
+ onHide,
+ setOpenedFilter,
+ canMove: view.layout?.enableMoving ?? true
+ }
+ )
+ },
+ column
+ );
+ }),
+ !!actions?.length && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
+ "th",
+ {
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])(
+ "dataviews-view-table__actions-column",
+ {
+ "dataviews-view-table__actions-column--sticky": true,
+ "dataviews-view-table__actions-column--stuck": !isHorizontalScrollEnd
+ }
+ ),
+ children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("span", { className: "dataviews-view-table-header", children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Actions") })
+ }
+ )
+ ] }) }),
+ hasData && groupField && dataByGroup ? Array.from(dataByGroup.entries()).map(
+ ([groupName, groupItems]) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsxs)("tbody", { children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("tr", { className: "dataviews-view-table__group-header-row", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
+ "td",
+ {
+ colSpan: columns.length + (hasPrimaryColumn ? 1 : 0) + (hasBulkActions ? 1 : 0) + (actions?.length ? 1 : 0),
+ className: "dataviews-view-table__group-header-cell",
+ children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(
+ // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
+ (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("%1$s: %2$s"),
+ groupField.label,
+ groupName
+ )
+ }
+ ) }),
+ groupItems.map((item, index) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
+ TableRow,
+ {
+ item,
+ level: view.showLevels && typeof getItemLevel === "function" ? getItemLevel(item) : void 0,
+ hasBulkActions,
+ actions,
+ fields,
+ id: getItemId(item) || index.toString(),
+ view,
+ titleField,
+ mediaField,
+ descriptionField,
+ selection,
+ getItemId,
+ onChangeSelection,
+ onClickItem,
+ renderItemLink,
+ isItemClickable,
+ isActionsColumnSticky: !isHorizontalScrollEnd
+ },
+ getItemId(item)
+ ))
+ ] }, `group-${groupName}`)
+ ) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("tbody", { children: hasData && data.map((item, index) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
+ TableRow,
+ {
+ item,
+ level: view.showLevels && typeof getItemLevel === "function" ? getItemLevel(item) : void 0,
+ hasBulkActions,
+ actions,
+ fields,
+ id: getItemId(item) || index.toString(),
+ view,
+ titleField,
+ mediaField,
+ descriptionField,
+ selection,
+ getItemId,
+ onChangeSelection,
+ onClickItem,
+ renderItemLink,
+ isItemClickable,
+ isActionsColumnSticky: !isHorizontalScrollEnd,
+ posinset: isInfiniteScroll ? index + 1 : void 0
+ },
+ getItemId(item)
+ )) })
+ ]
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsxs)(
+ "div",
+ {
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])({
+ "dataviews-loading": isLoading,
+ "dataviews-no-results": !hasData && !isLoading
+ }),
+ id: tableNoticeId,
+ children: [
+ !hasData && (isLoading ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("p", { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Spinner, {}) }) : empty),
+ hasData && isLoading && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Spinner, {}) })
+ ]
+ }
+ )
+ ] });
+}
+var table_default = ViewTable;
+
+//# sourceMappingURL=index.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/use-is-horizontal-scroll-end.js":
+/*!****************************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/use-is-horizontal-scroll-end.js ***!
+ \****************************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ useIsHorizontalScrollEnd: () => (/* binding */ useIsHorizontalScrollEnd)
+/* harmony export */ });
+/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
+/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
+// packages/dataviews/src/dataviews-layouts/table/use-is-horizontal-scroll-end.ts
+
+
+
+var isScrolledToEnd = (element) => {
+ if ((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.isRTL)()) {
+ const scrollLeft = Math.abs(element.scrollLeft);
+ return scrollLeft <= 1;
+ }
+ return element.scrollLeft + element.clientWidth >= element.scrollWidth - 1;
+};
+function useIsHorizontalScrollEnd({
+ scrollContainerRef,
+ enabled = false
+}) {
+ const [isHorizontalScrollEnd, setIsHorizontalScrollEnd] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
+ const handleIsHorizontalScrollEnd = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_0__.useDebounce)(
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
+ const scrollContainer = scrollContainerRef.current;
+ if (scrollContainer) {
+ setIsHorizontalScrollEnd(isScrolledToEnd(scrollContainer));
+ }
+ }, [scrollContainerRef, setIsHorizontalScrollEnd]),
+ 200
+ );
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
+ if (typeof window === "undefined" || !enabled || !scrollContainerRef.current) {
+ return () => {
+ };
+ }
+ handleIsHorizontalScrollEnd();
+ scrollContainerRef.current.addEventListener(
+ "scroll",
+ handleIsHorizontalScrollEnd
+ );
+ window.addEventListener("resize", handleIsHorizontalScrollEnd);
+ return () => {
+ scrollContainerRef.current?.removeEventListener(
+ "scroll",
+ handleIsHorizontalScrollEnd
+ );
+ window.removeEventListener("resize", handleIsHorizontalScrollEnd);
+ };
+ }, [scrollContainerRef, enabled]);
+ return isHorizontalScrollEnd;
+}
+
+//# sourceMappingURL=use-is-horizontal-scroll-end.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/get-data-by-group.js":
+/*!*****************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/get-data-by-group.js ***!
+ \*****************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ getDataByGroup)
+/* harmony export */ });
+// packages/dataviews/src/dataviews-layouts/utils/get-data-by-group.ts
+function getDataByGroup(data, groupByField) {
+ return data.reduce((groups, item) => {
+ const groupName = groupByField.getValue({ item });
+ if (!groups.has(groupName)) {
+ groups.set(groupName, []);
+ }
+ groups.get(groupName)?.push(item);
+ return groups;
+ }, /* @__PURE__ */ new Map());
+}
+
+//# sourceMappingURL=get-data-by-group.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/grid-items.js":
+/*!**********************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/grid-items.js ***!
+ \**********************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ GridItems: () => (/* binding */ GridItems)
+/* harmony export */ });
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
+// packages/dataviews/src/dataviews-layouts/utils/grid-items.tsx
+
+
+
+var GridItems = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(({ className, previewSize, ...props }, ref) => {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(
+ "div",
+ {
+ ref,
+ className: (0,clsx__WEBPACK_IMPORTED_MODULE_1__["default"])("dataviews-view-grid-items", className),
+ style: {
+ gridTemplateColumns: previewSize && `repeat(auto-fill, minmax(${previewSize}px, 1fr))`
+ },
+ ...props
+ }
+ );
+});
+
+//# sourceMappingURL=grid-items.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/item-click-wrapper.js":
+/*!******************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/item-click-wrapper.js ***!
+ \******************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ ItemClickWrapper: () => (/* binding */ ItemClickWrapper)
+/* harmony export */ });
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/dataviews/src/dataviews-layouts/utils/item-click-wrapper.tsx
+
+
+function getClickableItemProps({
+ item,
+ isItemClickable,
+ onClickItem,
+ className
+}) {
+ if (!isItemClickable(item) || !onClickItem) {
+ return { className };
+ }
+ return {
+ className: className ? `${className} ${className}--clickable` : void 0,
+ role: "button",
+ tabIndex: 0,
+ onClick: (event) => {
+ event.stopPropagation();
+ onClickItem(item);
+ },
+ onKeyDown: (event) => {
+ if (event.key === "Enter" || event.key === "" || event.key === " ") {
+ event.stopPropagation();
+ onClickItem(item);
+ }
+ }
+ };
+}
+function ItemClickWrapper({
+ item,
+ isItemClickable,
+ onClickItem,
+ renderItemLink,
+ className,
+ children,
+ ...extraProps
+}) {
+ if (!isItemClickable(item)) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", { className, ...extraProps, children });
+ }
+ if (renderItemLink) {
+ const renderedElement = renderItemLink({
+ item,
+ className: `${className} ${className}--clickable`,
+ ...extraProps,
+ children
+ });
+ return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(renderedElement, {
+ onClick: (event) => {
+ event.stopPropagation();
+ if (renderedElement.props.onClick) {
+ renderedElement.props.onClick(event);
+ }
+ },
+ onKeyDown: (event) => {
+ if (event.key === "Enter" || event.key === "" || event.key === " ") {
+ event.stopPropagation();
+ if (renderedElement.props.onKeyDown) {
+ renderedElement.props.onKeyDown(event);
+ }
+ }
+ }
+ });
+ }
+ const clickProps = getClickableItemProps({
+ item,
+ isItemClickable,
+ onClickItem,
+ className
+ });
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", { ...clickProps, ...extraProps, children });
+}
+
+//# sourceMappingURL=item-click-wrapper.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/preview-size-picker.js":
+/*!*******************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/preview-size-picker.js ***!
+ \*******************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ PreviewSizePicker)
+/* harmony export */ });
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
+/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _components_dataviews_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../components/dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
+// packages/dataviews/src/dataviews-layouts/utils/preview-size-picker.tsx
+
+
+
+
+
+var imageSizes = [
+ {
+ value: 120,
+ breakpoint: 1
+ },
+ {
+ value: 170,
+ breakpoint: 1
+ },
+ {
+ value: 230,
+ breakpoint: 1
+ },
+ {
+ value: 290,
+ breakpoint: 1112
+ // at minimum image width, 4 images display at this container size
+ },
+ {
+ value: 350,
+ breakpoint: 1636
+ // at minimum image width, 6 images display at this container size
+ },
+ {
+ value: 430,
+ breakpoint: 588
+ // at minimum image width, 2 images display at this container size
+ }
+];
+function PreviewSizePicker() {
+ const context = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useContext)(_components_dataviews_context__WEBPACK_IMPORTED_MODULE_3__["default"]);
+ const view = context.view;
+ const breakValues = imageSizes.filter((size) => {
+ return context.containerWidth >= size.breakpoint;
+ });
+ const layoutPreviewSize = view.layout?.previewSize ?? 230;
+ const previewSizeToUse = breakValues.map((size, index) => ({ ...size, index })).filter((size) => size.value <= layoutPreviewSize).sort((a, b) => b.value - a.value)[0]?.index ?? 0;
+ const marks = breakValues.map((size, index) => {
+ return {
+ value: index
+ };
+ });
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
+ _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.RangeControl,
+ {
+ __nextHasNoMarginBottom: true,
+ __next40pxDefaultSize: true,
+ showTooltip: false,
+ label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Preview size"),
+ value: previewSizeToUse,
+ min: 0,
+ max: breakValues.length - 1,
+ withInputField: false,
+ onChange: (value = 0) => {
+ context.onChangeView({
+ ...view,
+ layout: {
+ ...view.layout,
+ previewSize: breakValues[value].value
+ }
+ });
+ },
+ step: 1,
+ marks
+ }
+ );
+}
+
+//# sourceMappingURL=preview-size-picker.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/array.js":
+/*!*****************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/field-types/array.js ***!
+ \*****************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ array_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+// packages/dataviews/src/field-types/array.tsx
+
+
+function sort(valueA, valueB, direction) {
+ const arrA = Array.isArray(valueA) ? valueA : [];
+ const arrB = Array.isArray(valueB) ? valueB : [];
+ if (arrA.length !== arrB.length) {
+ return direction === "asc" ? arrA.length - arrB.length : arrB.length - arrA.length;
+ }
+ const joinedA = arrA.join(",");
+ const joinedB = arrB.join(",");
+ return direction === "asc" ? joinedA.localeCompare(joinedB) : joinedB.localeCompare(joinedA);
+}
+function render({ item, field }) {
+ const value = field.getValue({ item }) || [];
+ return value.join(", ");
+}
+var arrayFieldType = {
+ sort,
+ isValid: {
+ elements: true,
+ custom: (item, field) => {
+ const value = field.getValue({ item });
+ if (![void 0, "", null].includes(value) && !Array.isArray(value)) {
+ return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Value must be an array.");
+ }
+ if (!value.every((v) => typeof v === "string")) {
+ return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Every value must be a string.");
+ }
+ return null;
+ }
+ },
+ Edit: "array",
+ // Use array control
+ render,
+ enableSorting: true,
+ filterBy: {
+ defaultOperators: [_constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ANY, _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NONE],
+ validOperators: [
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ANY,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NONE,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ALL,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NOT_ALL
+ ]
+ }
+};
+var array_default = arrayFieldType;
+
+//# sourceMappingURL=array.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/boolean.js":
+/*!*******************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/field-types/boolean.js ***!
+ \*******************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ boolean_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _utils_render_from_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/render-from-elements */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js");
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
+// packages/dataviews/src/field-types/boolean.tsx
+
+
+
+
+function sort(a, b, direction) {
+ const boolA = Boolean(a);
+ const boolB = Boolean(b);
+ if (boolA === boolB) {
+ return 0;
+ }
+ if (direction === "asc") {
+ return boolA ? 1 : -1;
+ }
+ return boolA ? -1 : 1;
+}
+var boolean_default = {
+ sort,
+ isValid: {
+ elements: true,
+ custom: (item, field) => {
+ const value = field.getValue({ item });
+ if (![void 0, "", null].includes(value) && ![true, false].includes(value)) {
+ return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Value must be true, false, or undefined");
+ }
+ return null;
+ }
+ },
+ Edit: "checkbox",
+ render: ({ item, field }) => {
+ if (field.hasElements) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_utils_render_from_elements__WEBPACK_IMPORTED_MODULE_1__["default"], { item, field });
+ }
+ if (field.getValue({ item }) === true) {
+ return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("True");
+ }
+ if (field.getValue({ item }) === false) {
+ return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("False");
+ }
+ return null;
+ },
+ enableSorting: true,
+ filterBy: {
+ defaultOperators: [_constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS, _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_NOT],
+ validOperators: [_constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS, _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_NOT]
+ }
+};
+
+//# sourceMappingURL=boolean.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/color.js":
+/*!*****************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/field-types/color.js ***!
+ \*****************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ color_default)
+/* harmony export */ });
+/* harmony import */ var colord__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! colord */ "./node_modules/colord/index.mjs");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _utils_render_from_elements__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/render-from-elements */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js");
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
+// packages/dataviews/src/field-types/color.tsx
+
+
+
+
+
+function sort(valueA, valueB, direction) {
+ const colorA = (0,colord__WEBPACK_IMPORTED_MODULE_0__.colord)(valueA);
+ const colorB = (0,colord__WEBPACK_IMPORTED_MODULE_0__.colord)(valueB);
+ if (!colorA.isValid() && !colorB.isValid()) {
+ return 0;
+ }
+ if (!colorA.isValid()) {
+ return direction === "asc" ? 1 : -1;
+ }
+ if (!colorB.isValid()) {
+ return direction === "asc" ? -1 : 1;
+ }
+ const hslA = colorA.toHsl();
+ const hslB = colorB.toHsl();
+ if (hslA.h !== hslB.h) {
+ return direction === "asc" ? hslA.h - hslB.h : hslB.h - hslA.h;
+ }
+ if (hslA.s !== hslB.s) {
+ return direction === "asc" ? hslA.s - hslB.s : hslB.s - hslA.s;
+ }
+ return direction === "asc" ? hslA.l - hslB.l : hslB.l - hslA.l;
+}
+var color_default = {
+ sort,
+ isValid: {
+ elements: true,
+ custom: (item, field) => {
+ const value = field.getValue({ item });
+ if (![void 0, "", null].includes(value) && !(0,colord__WEBPACK_IMPORTED_MODULE_0__.colord)(value).isValid()) {
+ return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Value must be a valid color.");
+ }
+ return null;
+ }
+ },
+ Edit: "color",
+ render: ({ item, field }) => {
+ if (field.hasElements) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_utils_render_from_elements__WEBPACK_IMPORTED_MODULE_2__["default"], { item, field });
+ }
+ const value = field.getValue({ item });
+ if (!value || !(0,colord__WEBPACK_IMPORTED_MODULE_0__.colord)(value).isValid()) {
+ return value;
+ }
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(
+ "div",
+ {
+ style: { display: "flex", alignItems: "center", gap: "8px" },
+ children: [
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
+ "div",
+ {
+ style: {
+ width: "16px",
+ height: "16px",
+ borderRadius: "50%",
+ backgroundColor: value,
+ border: "1px solid #ddd",
+ flexShrink: 0
+ }
+ }
+ ),
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", { children: value })
+ ]
+ }
+ );
+ },
+ enableSorting: true,
+ filterBy: {
+ defaultOperators: [_constants__WEBPACK_IMPORTED_MODULE_3__.OPERATOR_IS_ANY, _constants__WEBPACK_IMPORTED_MODULE_3__.OPERATOR_IS_NONE],
+ validOperators: [_constants__WEBPACK_IMPORTED_MODULE_3__.OPERATOR_IS, _constants__WEBPACK_IMPORTED_MODULE_3__.OPERATOR_IS_NOT]
+ }
+};
+
+//# sourceMappingURL=color.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/date.js":
+/*!****************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/field-types/date.js ***!
+ \****************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ date_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/date */ "@wordpress/date");
+/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _utils_render_from_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/render-from-elements */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js");
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
+// packages/dataviews/src/field-types/date.tsx
+
+
+
+
+var getFormattedDate = (dateToDisplay) => (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_0__.dateI18n)((0,_wordpress_date__WEBPACK_IMPORTED_MODULE_0__.getSettings)().formats.date, (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_0__.getDate)(dateToDisplay));
+function sort(a, b, direction) {
+ const timeA = new Date(a).getTime();
+ const timeB = new Date(b).getTime();
+ return direction === "asc" ? timeA - timeB : timeB - timeA;
+}
+var date_default = {
+ sort,
+ Edit: "date",
+ isValid: {
+ elements: true,
+ custom: () => null
+ },
+ render: ({ item, field }) => {
+ if (field.hasElements) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_utils_render_from_elements__WEBPACK_IMPORTED_MODULE_1__["default"], { item, field });
+ }
+ const value = field.getValue({ item });
+ if (!value) {
+ return "";
+ }
+ return getFormattedDate(value);
+ },
+ enableSorting: true,
+ filterBy: {
+ defaultOperators: [
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_ON,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_NOT_ON,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BEFORE,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_AFTER,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BEFORE_INC,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_AFTER_INC,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IN_THE_PAST,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_OVER,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BETWEEN
+ ],
+ validOperators: [
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_ON,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_NOT_ON,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BEFORE,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_AFTER,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BEFORE_INC,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_AFTER_INC,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IN_THE_PAST,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_OVER,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BETWEEN
+ ]
+ }
+};
+
+//# sourceMappingURL=date.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/datetime.js":
+/*!********************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/field-types/datetime.js ***!
+ \********************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ datetime_default)
+/* harmony export */ });
+/* harmony import */ var _utils_render_from_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/render-from-elements */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js");
+/* harmony import */ var _utils_parse_date_time__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/parse-date-time */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/parse-date-time.js");
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
+// packages/dataviews/src/field-types/datetime.tsx
+
+
+
+
+function sort(a, b, direction) {
+ const timeA = new Date(a).getTime();
+ const timeB = new Date(b).getTime();
+ return direction === "asc" ? timeA - timeB : timeB - timeA;
+}
+var datetime_default = {
+ sort,
+ isValid: {
+ elements: true,
+ custom: () => null
+ },
+ Edit: "datetime",
+ render: ({ item, field }) => {
+ if (field.elements) {
+ return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_utils_render_from_elements__WEBPACK_IMPORTED_MODULE_0__["default"], { item, field });
+ }
+ const value = field.getValue({ item });
+ if (["", void 0, null].includes(value)) {
+ return null;
+ }
+ try {
+ const dateValue = (0,_utils_parse_date_time__WEBPACK_IMPORTED_MODULE_1__["default"])(value);
+ return dateValue?.toLocaleString();
+ } catch (error) {
+ return null;
+ }
+ },
+ enableSorting: true,
+ filterBy: {
+ defaultOperators: [
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_ON,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_NOT_ON,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BEFORE,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_AFTER,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BEFORE_INC,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_AFTER_INC,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IN_THE_PAST,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_OVER
+ ],
+ validOperators: [
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_ON,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_NOT_ON,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BEFORE,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_AFTER,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BEFORE_INC,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_AFTER_INC,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IN_THE_PAST,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_OVER
+ ]
+ }
+};
+
+//# sourceMappingURL=datetime.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/email.js":
+/*!*****************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/field-types/email.js ***!
+ \*****************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ email_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _utils_render_from_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/render-from-elements */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js");
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
+// packages/dataviews/src/field-types/email.tsx
+
+
+
+
+function sort(valueA, valueB, direction) {
+ return direction === "asc" ? valueA.localeCompare(valueB) : valueB.localeCompare(valueA);
+}
+var emailRegex = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
+var email_default = {
+ sort,
+ isValid: {
+ elements: true,
+ custom: (item, field) => {
+ const value = field.getValue({ item });
+ if (![void 0, "", null].includes(value) && !emailRegex.test(value)) {
+ return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Value must be a valid email address.");
+ }
+ return null;
+ }
+ },
+ Edit: "email",
+ render: ({ item, field }) => {
+ return field.hasElements ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_utils_render_from_elements__WEBPACK_IMPORTED_MODULE_1__["default"], { item, field }) : field.getValue({ item });
+ },
+ enableSorting: true,
+ filterBy: {
+ defaultOperators: [_constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_ANY, _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_NONE],
+ validOperators: [
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_NOT,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_CONTAINS,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_NOT_CONTAINS,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_STARTS_WITH,
+ // Multiple selection
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_ANY,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_NONE,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_ALL,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_NOT_ALL
+ ]
+ }
+};
+
+//# sourceMappingURL=email.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/index.js":
+/*!*****************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/field-types/index.js ***!
+ \*****************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ getFieldTypeDefinition)
+/* harmony export */ });
+/* harmony import */ var _email__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./email */ "./node_modules/@wordpress/dataviews/build-module/field-types/email.js");
+/* harmony import */ var _integer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./integer */ "./node_modules/@wordpress/dataviews/build-module/field-types/integer.js");
+/* harmony import */ var _number__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./number */ "./node_modules/@wordpress/dataviews/build-module/field-types/number.js");
+/* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./text */ "./node_modules/@wordpress/dataviews/build-module/field-types/text.js");
+/* harmony import */ var _datetime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./datetime */ "./node_modules/@wordpress/dataviews/build-module/field-types/datetime.js");
+/* harmony import */ var _date__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./date */ "./node_modules/@wordpress/dataviews/build-module/field-types/date.js");
+/* harmony import */ var _boolean__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./boolean */ "./node_modules/@wordpress/dataviews/build-module/field-types/boolean.js");
+/* harmony import */ var _media__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./media */ "./node_modules/@wordpress/dataviews/build-module/field-types/media.js");
+/* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./array */ "./node_modules/@wordpress/dataviews/build-module/field-types/array.js");
+/* harmony import */ var _password__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./password */ "./node_modules/@wordpress/dataviews/build-module/field-types/password.js");
+/* harmony import */ var _telephone__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./telephone */ "./node_modules/@wordpress/dataviews/build-module/field-types/telephone.js");
+/* harmony import */ var _color__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./color */ "./node_modules/@wordpress/dataviews/build-module/field-types/color.js");
+/* harmony import */ var _url__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./url */ "./node_modules/@wordpress/dataviews/build-module/field-types/url.js");
+/* harmony import */ var _utils_render_from_elements__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./utils/render-from-elements */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js");
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__);
+// packages/dataviews/src/field-types/index.tsx
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+function getFieldTypeDefinition(type) {
+ if ("email" === type) {
+ return _email__WEBPACK_IMPORTED_MODULE_0__["default"];
+ }
+ if ("integer" === type) {
+ return _integer__WEBPACK_IMPORTED_MODULE_1__["default"];
+ }
+ if ("number" === type) {
+ return _number__WEBPACK_IMPORTED_MODULE_2__["default"];
+ }
+ if ("text" === type) {
+ return _text__WEBPACK_IMPORTED_MODULE_3__["default"];
+ }
+ if ("datetime" === type) {
+ return _datetime__WEBPACK_IMPORTED_MODULE_4__["default"];
+ }
+ if ("date" === type) {
+ return _date__WEBPACK_IMPORTED_MODULE_5__["default"];
+ }
+ if ("boolean" === type) {
+ return _boolean__WEBPACK_IMPORTED_MODULE_6__["default"];
+ }
+ if ("media" === type) {
+ return _media__WEBPACK_IMPORTED_MODULE_7__["default"];
+ }
+ if ("array" === type) {
+ return _array__WEBPACK_IMPORTED_MODULE_8__["default"];
+ }
+ if ("password" === type) {
+ return _password__WEBPACK_IMPORTED_MODULE_9__["default"];
+ }
+ if ("telephone" === type) {
+ return _telephone__WEBPACK_IMPORTED_MODULE_10__["default"];
+ }
+ if ("color" === type) {
+ return _color__WEBPACK_IMPORTED_MODULE_11__["default"];
+ }
+ if ("url" === type) {
+ return _url__WEBPACK_IMPORTED_MODULE_12__["default"];
+ }
+ return {
+ sort: (a, b, direction) => {
+ if (typeof a === "number" && typeof b === "number") {
+ return direction === "asc" ? a - b : b - a;
+ }
+ return direction === "asc" ? a.localeCompare(b) : b.localeCompare(a);
+ },
+ isValid: {
+ elements: true,
+ custom: () => null
+ },
+ Edit: null,
+ render: ({ item, field }) => {
+ return field.hasElements ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_utils_render_from_elements__WEBPACK_IMPORTED_MODULE_13__["default"], { item, field }) : field.getValue({ item });
+ },
+ enableSorting: true,
+ filterBy: {
+ defaultOperators: [_constants__WEBPACK_IMPORTED_MODULE_14__.OPERATOR_IS, _constants__WEBPACK_IMPORTED_MODULE_14__.OPERATOR_IS_NOT],
+ validOperators: _constants__WEBPACK_IMPORTED_MODULE_14__.ALL_OPERATORS
+ }
+ };
+}
+
+//# sourceMappingURL=index.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/integer.js":
+/*!*******************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/field-types/integer.js ***!
+ \*******************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ integer_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _utils_render_from_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/render-from-elements */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js");
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
+// packages/dataviews/src/field-types/integer.tsx
+
+
+
+
+function sort(a, b, direction) {
+ return direction === "asc" ? a - b : b - a;
+}
+var integer_default = {
+ sort,
+ isValid: {
+ elements: true,
+ custom: (item, field) => {
+ const value = field.getValue({ item });
+ if (![void 0, "", null].includes(value) && !Number.isInteger(value)) {
+ return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Value must be an integer.");
+ }
+ return null;
+ }
+ },
+ Edit: "integer",
+ render: ({ item, field }) => {
+ return field.hasElements ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_utils_render_from_elements__WEBPACK_IMPORTED_MODULE_1__["default"], { item, field }) : field.getValue({ item });
+ },
+ enableSorting: true,
+ filterBy: {
+ defaultOperators: [
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_NOT,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_LESS_THAN,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_GREATER_THAN,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_LESS_THAN_OR_EQUAL,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_GREATER_THAN_OR_EQUAL,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BETWEEN
+ ],
+ validOperators: [
+ // Single-selection
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_NOT,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_LESS_THAN,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_GREATER_THAN,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_LESS_THAN_OR_EQUAL,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_GREATER_THAN_OR_EQUAL,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BETWEEN,
+ // Multiple-selection
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_ANY,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_NONE,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_ALL,
+ _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_NOT_ALL
+ ]
+ }
+};
+
+//# sourceMappingURL=integer.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/media.js":
+/*!*****************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/field-types/media.js ***!
+ \*****************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ media_default)
+/* harmony export */ });
+// packages/dataviews/src/field-types/media.tsx
+function sort() {
+ return 0;
+}
+var media_default = {
+ sort,
+ isValid: {
+ elements: true,
+ custom: () => null
+ },
+ Edit: null,
+ render: () => null,
+ enableSorting: false,
+ filterBy: false
+};
+
+//# sourceMappingURL=media.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/number.js":
+/*!******************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/field-types/number.js ***!
+ \******************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ number_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
+/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+/* harmony import */ var _utils_render_from_elements__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/render-from-elements */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
+// packages/dataviews/src/field-types/number.tsx
+
+
+
+
+function sort(a, b, direction) {
+ return direction === "asc" ? a - b : b - a;
+}
+function isEmpty(value) {
+ return value === "" || value === void 0 || value === null;
+}
+var number_default = {
+ sort,
+ isValid: {
+ elements: true,
+ custom: (item, field) => {
+ const value = field.getValue({ item });
+ if (!isEmpty(value) && !Number.isFinite(value)) {
+ return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Value must be a number.");
+ }
+ return null;
+ }
+ },
+ Edit: "number",
+ render: ({ item, field }) => {
+ if (field.hasElements) {
+ /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_utils_render_from_elements__WEBPACK_IMPORTED_MODULE_2__["default"], { item, field });
+ }
+ const value = field.getValue({ item });
+ if (![null, void 0].includes(value)) {
+ return Number(value).toFixed(2);
+ }
+ return null;
+ },
+ enableSorting: true,
+ filterBy: {
+ defaultOperators: [
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NOT,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_LESS_THAN,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_GREATER_THAN,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_LESS_THAN_OR_EQUAL,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_GREATER_THAN_OR_EQUAL,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_BETWEEN
+ ],
+ validOperators: [
+ // Single-selection
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NOT,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_LESS_THAN,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_GREATER_THAN,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_LESS_THAN_OR_EQUAL,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_GREATER_THAN_OR_EQUAL,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_BETWEEN,
+ // Multiple-selection
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ANY,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NONE,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ALL,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NOT_ALL
+ ]
+ }
+};
+
+//# sourceMappingURL=number.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/password.js":
+/*!********************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/field-types/password.js ***!
+ \********************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ password_default)
+/* harmony export */ });
+/* harmony import */ var _utils_render_from_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/render-from-elements */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/dataviews/src/field-types/password.tsx
+
+
+function sort(valueA, valueB, direction) {
+ return 0;
+}
+var password_default = {
+ sort,
+ isValid: {
+ elements: true,
+ custom: () => null
+ },
+ Edit: "password",
+ render: ({ item, field }) => {
+ return field.hasElements ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_utils_render_from_elements__WEBPACK_IMPORTED_MODULE_0__["default"], { item, field }) : "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022";
+ },
+ enableSorting: false,
+ filterBy: false
+};
+
+//# sourceMappingURL=password.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/telephone.js":
+/*!*********************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/field-types/telephone.js ***!
+ \*********************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ telephone_default)
+/* harmony export */ });
+/* harmony import */ var _utils_render_from_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/render-from-elements */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js");
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
+// packages/dataviews/src/field-types/telephone.tsx
+
+
+
+function sort(valueA, valueB, direction) {
+ return direction === "asc" ? valueA.localeCompare(valueB) : valueB.localeCompare(valueA);
+}
+var telephone_default = {
+ sort,
+ isValid: {
+ elements: true,
+ custom: () => null
+ },
+ Edit: "telephone",
+ render: ({ item, field }) => {
+ return field.hasElements ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_utils_render_from_elements__WEBPACK_IMPORTED_MODULE_0__["default"], { item, field }) : field.getValue({ item });
+ },
+ enableSorting: true,
+ filterBy: {
+ defaultOperators: [_constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ANY, _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NONE],
+ validOperators: [
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NOT,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_CONTAINS,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_NOT_CONTAINS,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_STARTS_WITH,
+ // Multiple selection
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ANY,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NONE,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ALL,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NOT_ALL
+ ]
+ }
+};
+
+//# sourceMappingURL=telephone.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/text.js":
+/*!****************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/field-types/text.js ***!
+ \****************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ text_default)
+/* harmony export */ });
+/* harmony import */ var _utils_render_from_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/render-from-elements */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js");
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
+// packages/dataviews/src/field-types/text.tsx
+
+
+
+function sort(valueA, valueB, direction) {
+ return direction === "asc" ? valueA.localeCompare(valueB) : valueB.localeCompare(valueA);
+}
+var text_default = {
+ sort,
+ isValid: {
+ elements: true,
+ custom: () => null
+ },
+ Edit: "text",
+ render: ({ item, field }) => {
+ return field.hasElements ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_utils_render_from_elements__WEBPACK_IMPORTED_MODULE_0__["default"], { item, field }) : field.getValue({ item });
+ },
+ enableSorting: true,
+ filterBy: {
+ defaultOperators: [_constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ANY, _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NONE],
+ validOperators: [
+ // Single selection
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NOT,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_CONTAINS,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_NOT_CONTAINS,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_STARTS_WITH,
+ // Multiple selection
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ANY,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NONE,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ALL,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NOT_ALL
+ ]
+ }
+};
+
+//# sourceMappingURL=text.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/url.js":
+/*!***************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/field-types/url.js ***!
+ \***************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ url_default)
+/* harmony export */ });
+/* harmony import */ var _utils_render_from_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/render-from-elements */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js");
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
+// packages/dataviews/src/field-types/url.tsx
+
+
+
+function sort(valueA, valueB, direction) {
+ return direction === "asc" ? valueA.localeCompare(valueB) : valueB.localeCompare(valueA);
+}
+var url_default = {
+ sort,
+ isValid: {
+ elements: true,
+ custom: () => null
+ },
+ Edit: "url",
+ render: ({ item, field }) => {
+ return field.hasElements ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_utils_render_from_elements__WEBPACK_IMPORTED_MODULE_0__["default"], { item, field }) : field.getValue({ item });
+ },
+ enableSorting: true,
+ filterBy: {
+ defaultOperators: [_constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ANY, _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NONE],
+ validOperators: [
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NOT,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_CONTAINS,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_NOT_CONTAINS,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_STARTS_WITH,
+ // Multiple selection
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ANY,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NONE,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ALL,
+ _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NOT_ALL
+ ]
+ }
+};
+
+//# sourceMappingURL=url.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/parse-date-time.js":
+/*!*********************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/field-types/utils/parse-date-time.js ***!
+ \*********************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ parseDateTime)
+/* harmony export */ });
+/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! date-fns */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/isValid.js");
+/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/date */ "@wordpress/date");
+/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_1__);
+// packages/dataviews/src/field-types/utils/parse-date-time.ts
+
+
+function parseDateTime(dateTimeString) {
+ if (!dateTimeString) {
+ return null;
+ }
+ const parsed = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_1__.getDate)(dateTimeString);
+ return parsed && (0,date_fns__WEBPACK_IMPORTED_MODULE_0__.isValid)(parsed) ? parsed : null;
+}
+
+//# sourceMappingURL=parse-date-time.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js":
+/*!**************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js ***!
+ \**************************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ RenderFromElements)
+/* harmony export */ });
+/* harmony import */ var _hooks_use_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../hooks/use-elements */ "./node_modules/@wordpress/dataviews/build-module/hooks/use-elements.js");
+// packages/dataviews/src/field-types/utils/render-from-elements.tsx
+
+function RenderFromElements({
+ item,
+ field
+}) {
+ const { elements, isLoading } = (0,_hooks_use_elements__WEBPACK_IMPORTED_MODULE_0__["default"])({
+ elements: field.elements,
+ getElements: field.getElements
+ });
+ const value = field.getValue({ item });
+ if (isLoading) {
+ return value;
+ }
+ if (elements.length === 0) {
+ return value;
+ }
+ return elements?.find((element) => element.value === value)?.label || field.getValue({ item });
+}
+
+//# sourceMappingURL=render-from-elements.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/hooks/use-elements.js":
+/*!******************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/hooks/use-elements.js ***!
+ \******************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ useElements)
+/* harmony export */ });
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
+// packages/dataviews/src/hooks/use-elements.ts
+
+var EMPTY_ARRAY = [];
+function useElements({
+ elements,
+ getElements
+}) {
+ const staticElements = Array.isArray(elements) && elements.length > 0 ? elements : EMPTY_ARRAY;
+ const [records, setRecords] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(staticElements);
+ const [isLoading, setIsLoading] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
+ (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
+ if (!getElements) {
+ setRecords(staticElements);
+ return;
+ }
+ let cancelled = false;
+ setIsLoading(true);
+ getElements().then((fetchedElements) => {
+ if (!cancelled) {
+ const dynamicElements = Array.isArray(fetchedElements) && fetchedElements.length > 0 ? fetchedElements : staticElements;
+ setRecords(dynamicElements);
+ }
+ }).catch(() => {
+ if (!cancelled) {
+ setRecords(staticElements);
+ }
+ }).finally(() => {
+ if (!cancelled) {
+ setIsLoading(false);
+ }
+ });
+ return () => {
+ cancelled = true;
+ };
+ }, [getElements, staticElements]);
+ return {
+ elements: records,
+ isLoading
+ };
+}
+
+//# sourceMappingURL=use-elements.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js":
+/*!***********************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/lock-unlock.js ***!
+ \***********************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ lock: () => (/* binding */ lock),
+/* harmony export */ unlock: () => (/* binding */ unlock)
+/* harmony export */ });
+/* harmony import */ var _wordpress_private_apis__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/private-apis */ "@wordpress/private-apis");
+/* harmony import */ var _wordpress_private_apis__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_private_apis__WEBPACK_IMPORTED_MODULE_0__);
+// packages/dataviews/src/lock-unlock.ts
+
+var { lock, unlock } = (0,_wordpress_private_apis__WEBPACK_IMPORTED_MODULE_0__.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
+ "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
+ "@wordpress/dataviews"
+);
+
+//# sourceMappingURL=lock-unlock.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/utils/has-elements.js":
+/*!******************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/utils/has-elements.js ***!
+ \******************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ hasElements)
+/* harmony export */ });
+// packages/dataviews/src/utils/has-elements.ts
+function hasElements(field) {
+ return Array.isArray(field.elements) && field.elements.length > 0 || typeof field.getElements === "function";
+}
+
+//# sourceMappingURL=has-elements.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/build-module/utils/normalize-fields.js":
+/*!**********************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/build-module/utils/normalize-fields.js ***!
+ \**********************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ normalizeFields)
+/* harmony export */ });
+/* harmony import */ var _field_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../field-types */ "./node_modules/@wordpress/dataviews/build-module/field-types/index.js");
+/* harmony import */ var _dataform_controls__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dataform-controls */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/index.js");
+/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
+/* harmony import */ var _has_elements__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./has-elements */ "./node_modules/@wordpress/dataviews/build-module/utils/has-elements.js");
+// packages/dataviews/src/utils/normalize-fields.ts
+
+
+
+
+var getValueFromId = (id) => ({ item }) => {
+ const path = id.split(".");
+ let value = item;
+ for (const segment of path) {
+ if (value.hasOwnProperty(segment)) {
+ value = value[segment];
+ } else {
+ value = void 0;
+ }
+ }
+ return value;
+};
+var setValueFromId = (id) => ({ value }) => {
+ const path = id.split(".");
+ const result = {};
+ let current = result;
+ for (const segment of path.slice(0, -1)) {
+ current[segment] = {};
+ current = current[segment];
+ }
+ current[path.at(-1)] = value;
+ return result;
+};
+function getFilterBy(field, fieldTypeDefinition) {
+ if (field.filterBy === false) {
+ return false;
+ }
+ if (typeof field.filterBy === "object") {
+ let operators = field.filterBy.operators;
+ if (!operators || !Array.isArray(operators)) {
+ operators = !!fieldTypeDefinition.filterBy ? fieldTypeDefinition.filterBy.defaultOperators : [];
+ }
+ let validOperators = _constants__WEBPACK_IMPORTED_MODULE_2__.ALL_OPERATORS;
+ if (typeof fieldTypeDefinition.filterBy === "object") {
+ validOperators = fieldTypeDefinition.filterBy.validOperators;
+ }
+ operators = operators.filter(
+ (operator) => validOperators.includes(operator)
+ );
+ if ((0,_has_elements__WEBPACK_IMPORTED_MODULE_3__["default"])(field) && operators.includes(_constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BETWEEN)) {
+ operators = operators.filter(
+ (operator) => operator !== _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BETWEEN
+ );
+ }
+ const hasSingleSelectionOperator = operators.some(
+ (operator) => _constants__WEBPACK_IMPORTED_MODULE_2__.SINGLE_SELECTION_OPERATORS.includes(operator)
+ );
+ if (hasSingleSelectionOperator) {
+ operators = operators.filter(
+ (operator) => (
+ // The 'Between' operator is unique as it can be combined with single selection operators.
+ [..._constants__WEBPACK_IMPORTED_MODULE_2__.SINGLE_SELECTION_OPERATORS, _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BETWEEN].includes(
+ operator
+ )
+ )
+ );
+ }
+ if (operators.length === 0) {
+ return false;
+ }
+ return {
+ isPrimary: !!field.filterBy.isPrimary,
+ operators
+ };
+ }
+ if (fieldTypeDefinition.filterBy === false) {
+ return false;
+ }
+ let defaultOperators = fieldTypeDefinition.filterBy.defaultOperators;
+ if ((0,_has_elements__WEBPACK_IMPORTED_MODULE_3__["default"])(field) && defaultOperators.includes(_constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BETWEEN)) {
+ defaultOperators = defaultOperators.filter(
+ (operator) => operator !== _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BETWEEN
+ );
+ }
+ return {
+ operators: defaultOperators
+ };
+}
+function normalizeFields(fields) {
+ return fields.map((field) => {
+ const fieldTypeDefinition = (0,_field_types__WEBPACK_IMPORTED_MODULE_0__["default"])(
+ field.type
+ );
+ const getValue = field.getValue || getValueFromId(field.id);
+ const setValue = field.setValue || setValueFromId(field.id);
+ const sort = field.sort ?? function sort2(a, b, direction) {
+ return fieldTypeDefinition.sort(
+ getValue({ item: a }),
+ getValue({ item: b }),
+ direction
+ );
+ };
+ const isValid = {
+ ...fieldTypeDefinition.isValid,
+ ...field.isValid
+ };
+ const Edit = (0,_dataform_controls__WEBPACK_IMPORTED_MODULE_1__.getControl)(field, fieldTypeDefinition);
+ const render = field.render ?? function render2({
+ item,
+ field: renderedField
+ }) {
+ return fieldTypeDefinition.render({ item, field: renderedField });
+ };
+ const filterBy = getFilterBy(field, fieldTypeDefinition);
+ return {
+ ...field,
+ label: field.label || field.id,
+ header: field.header || field.label || field.id,
+ getValue,
+ setValue,
+ render,
+ sort,
+ isValid,
+ Edit,
+ hasElements: (0,_has_elements__WEBPACK_IMPORTED_MODULE_3__["default"])(field),
+ enableHiding: field.enableHiding ?? true,
+ enableSorting: field.enableSorting ?? fieldTypeDefinition.enableSorting ?? true,
+ filterBy,
+ readOnly: field.readOnly ?? fieldTypeDefinition.readOnly ?? false
+ };
+ });
+}
+
+//# sourceMappingURL=normalize-fields.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/addLeadingZeros.js":
+/*!*****************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/addLeadingZeros.js ***!
+ \*****************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ addLeadingZeros: () => (/* binding */ addLeadingZeros)
+/* harmony export */ });
+function addLeadingZeros(number, targetLength) {
+ const sign = number < 0 ? "-" : "";
+ const output = Math.abs(number).toString().padStart(targetLength, "0");
+ return sign + output;
+}
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/defaultOptions.js":
+/*!****************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/defaultOptions.js ***!
+ \****************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ getDefaultOptions: () => (/* binding */ getDefaultOptions),
+/* harmony export */ setDefaultOptions: () => (/* binding */ setDefaultOptions)
+/* harmony export */ });
+let defaultOptions = {};
+
+function getDefaultOptions() {
+ return defaultOptions;
+}
+
+function setDefaultOptions(newOptions) {
+ defaultOptions = newOptions;
+}
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/format/formatters.js":
+/*!*******************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/format/formatters.js ***!
+ \*******************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ formatters: () => (/* binding */ formatters)
+/* harmony export */ });
+/* harmony import */ var _getDayOfYear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../getDayOfYear.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/getDayOfYear.js");
+/* harmony import */ var _getISOWeek_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../getISOWeek.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/getISOWeek.js");
+/* harmony import */ var _getISOWeekYear_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../getISOWeekYear.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/getISOWeekYear.js");
+/* harmony import */ var _getWeek_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../getWeek.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/getWeek.js");
+/* harmony import */ var _getWeekYear_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../getWeekYear.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/getWeekYear.js");
+/* harmony import */ var _addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../addLeadingZeros.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/addLeadingZeros.js");
+/* harmony import */ var _lightFormatters_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./lightFormatters.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/format/lightFormatters.js");
+
+
+
+
+
+
+
+
+
+const dayPeriodEnum = {
+ am: "am",
+ pm: "pm",
+ midnight: "midnight",
+ noon: "noon",
+ morning: "morning",
+ afternoon: "afternoon",
+ evening: "evening",
+ night: "night",
+};
+
+/*
+ * | | Unit | | Unit |
+ * |-----|--------------------------------|-----|--------------------------------|
+ * | a | AM, PM | A* | Milliseconds in day |
+ * | b | AM, PM, noon, midnight | B | Flexible day period |
+ * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
+ * | d | Day of month | D | Day of year |
+ * | e | Local day of week | E | Day of week |
+ * | f | | F* | Day of week in month |
+ * | g* | Modified Julian day | G | Era |
+ * | h | Hour [1-12] | H | Hour [0-23] |
+ * | i! | ISO day of week | I! | ISO week of year |
+ * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
+ * | k | Hour [1-24] | K | Hour [0-11] |
+ * | l* | (deprecated) | L | Stand-alone month |
+ * | m | Minute | M | Month |
+ * | n | | N | |
+ * | o! | Ordinal number modifier | O | Timezone (GMT) |
+ * | p! | Long localized time | P! | Long localized date |
+ * | q | Stand-alone quarter | Q | Quarter |
+ * | r* | Related Gregorian year | R! | ISO week-numbering year |
+ * | s | Second | S | Fraction of second |
+ * | t! | Seconds timestamp | T! | Milliseconds timestamp |
+ * | u | Extended year | U* | Cyclic year |
+ * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
+ * | w | Local week of year | W* | Week of month |
+ * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
+ * | y | Year (abs) | Y | Local week-numbering year |
+ * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
+ *
+ * Letters marked by * are not implemented but reserved by Unicode standard.
+ *
+ * Letters marked by ! are non-standard, but implemented by date-fns:
+ * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
+ * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
+ * i.e. 7 for Sunday, 1 for Monday, etc.
+ * - `I` is ISO week of year, as opposed to `w` which is local week of year.
+ * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
+ * `R` is supposed to be used in conjunction with `I` and `i`
+ * for universal ISO week-numbering date, whereas
+ * `Y` is supposed to be used in conjunction with `w` and `e`
+ * for week-numbering date specific to the locale.
+ * - `P` is long localized date format
+ * - `p` is long localized time format
+ */
+
+const formatters = {
+ // Era
+ G: function (date, token, localize) {
+ const era = date.getFullYear() > 0 ? 1 : 0;
+ switch (token) {
+ // AD, BC
+ case "G":
+ case "GG":
+ case "GGG":
+ return localize.era(era, { width: "abbreviated" });
+ // A, B
+ case "GGGGG":
+ return localize.era(era, { width: "narrow" });
+ // Anno Domini, Before Christ
+ case "GGGG":
+ default:
+ return localize.era(era, { width: "wide" });
+ }
+ },
+
+ // Year
+ y: function (date, token, localize) {
+ // Ordinal number
+ if (token === "yo") {
+ const signedYear = date.getFullYear();
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
+ const year = signedYear > 0 ? signedYear : 1 - signedYear;
+ return localize.ordinalNumber(year, { unit: "year" });
+ }
+
+ return _lightFormatters_js__WEBPACK_IMPORTED_MODULE_6__.lightFormatters.y(date, token);
+ },
+
+ // Local week-numbering year
+ Y: function (date, token, localize, options) {
+ const signedWeekYear = (0,_getWeekYear_js__WEBPACK_IMPORTED_MODULE_4__.getWeekYear)(date, options);
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
+ const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
+
+ // Two digit year
+ if (token === "YY") {
+ const twoDigitYear = weekYear % 100;
+ return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(twoDigitYear, 2);
+ }
+
+ // Ordinal number
+ if (token === "Yo") {
+ return localize.ordinalNumber(weekYear, { unit: "year" });
+ }
+
+ // Padding
+ return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(weekYear, token.length);
+ },
+
+ // ISO week-numbering year
+ R: function (date, token) {
+ const isoWeekYear = (0,_getISOWeekYear_js__WEBPACK_IMPORTED_MODULE_2__.getISOWeekYear)(date);
+
+ // Padding
+ return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(isoWeekYear, token.length);
+ },
+
+ // Extended year. This is a single number designating the year of this calendar system.
+ // The main difference between `y` and `u` localizers are B.C. years:
+ // | Year | `y` | `u` |
+ // |------|-----|-----|
+ // | AC 1 | 1 | 1 |
+ // | BC 1 | 1 | 0 |
+ // | BC 2 | 2 | -1 |
+ // Also `yy` always returns the last two digits of a year,
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
+ u: function (date, token) {
+ const year = date.getFullYear();
+ return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(year, token.length);
+ },
+
+ // Quarter
+ Q: function (date, token, localize) {
+ const quarter = Math.ceil((date.getMonth() + 1) / 3);
+ switch (token) {
+ // 1, 2, 3, 4
+ case "Q":
+ return String(quarter);
+ // 01, 02, 03, 04
+ case "QQ":
+ return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(quarter, 2);
+ // 1st, 2nd, 3rd, 4th
+ case "Qo":
+ return localize.ordinalNumber(quarter, { unit: "quarter" });
+ // Q1, Q2, Q3, Q4
+ case "QQQ":
+ return localize.quarter(quarter, {
+ width: "abbreviated",
+ context: "formatting",
+ });
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
+ case "QQQQQ":
+ return localize.quarter(quarter, {
+ width: "narrow",
+ context: "formatting",
+ });
+ // 1st quarter, 2nd quarter, ...
+ case "QQQQ":
+ default:
+ return localize.quarter(quarter, {
+ width: "wide",
+ context: "formatting",
+ });
+ }
+ },
+
+ // Stand-alone quarter
+ q: function (date, token, localize) {
+ const quarter = Math.ceil((date.getMonth() + 1) / 3);
+ switch (token) {
+ // 1, 2, 3, 4
+ case "q":
+ return String(quarter);
+ // 01, 02, 03, 04
+ case "qq":
+ return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(quarter, 2);
+ // 1st, 2nd, 3rd, 4th
+ case "qo":
+ return localize.ordinalNumber(quarter, { unit: "quarter" });
+ // Q1, Q2, Q3, Q4
+ case "qqq":
+ return localize.quarter(quarter, {
+ width: "abbreviated",
+ context: "standalone",
+ });
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
+ case "qqqqq":
+ return localize.quarter(quarter, {
+ width: "narrow",
+ context: "standalone",
+ });
+ // 1st quarter, 2nd quarter, ...
+ case "qqqq":
+ default:
+ return localize.quarter(quarter, {
+ width: "wide",
+ context: "standalone",
+ });
+ }
+ },
+
+ // Month
+ M: function (date, token, localize) {
+ const month = date.getMonth();
+ switch (token) {
+ case "M":
+ case "MM":
+ return _lightFormatters_js__WEBPACK_IMPORTED_MODULE_6__.lightFormatters.M(date, token);
+ // 1st, 2nd, ..., 12th
+ case "Mo":
+ return localize.ordinalNumber(month + 1, { unit: "month" });
+ // Jan, Feb, ..., Dec
+ case "MMM":
+ return localize.month(month, {
+ width: "abbreviated",
+ context: "formatting",
+ });
+ // J, F, ..., D
+ case "MMMMM":
+ return localize.month(month, {
+ width: "narrow",
+ context: "formatting",
+ });
+ // January, February, ..., December
+ case "MMMM":
+ default:
+ return localize.month(month, { width: "wide", context: "formatting" });
+ }
+ },
+
+ // Stand-alone month
+ L: function (date, token, localize) {
+ const month = date.getMonth();
+ switch (token) {
+ // 1, 2, ..., 12
+ case "L":
+ return String(month + 1);
+ // 01, 02, ..., 12
+ case "LL":
+ return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(month + 1, 2);
+ // 1st, 2nd, ..., 12th
+ case "Lo":
+ return localize.ordinalNumber(month + 1, { unit: "month" });
+ // Jan, Feb, ..., Dec
+ case "LLL":
+ return localize.month(month, {
+ width: "abbreviated",
+ context: "standalone",
+ });
+ // J, F, ..., D
+ case "LLLLL":
+ return localize.month(month, {
+ width: "narrow",
+ context: "standalone",
+ });
+ // January, February, ..., December
+ case "LLLL":
+ default:
+ return localize.month(month, { width: "wide", context: "standalone" });
+ }
+ },
+
+ // Local week of year
+ w: function (date, token, localize, options) {
+ const week = (0,_getWeek_js__WEBPACK_IMPORTED_MODULE_3__.getWeek)(date, options);
+
+ if (token === "wo") {
+ return localize.ordinalNumber(week, { unit: "week" });
+ }
+
+ return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(week, token.length);
+ },
+
+ // ISO week of year
+ I: function (date, token, localize) {
+ const isoWeek = (0,_getISOWeek_js__WEBPACK_IMPORTED_MODULE_1__.getISOWeek)(date);
+
+ if (token === "Io") {
+ return localize.ordinalNumber(isoWeek, { unit: "week" });
+ }
+
+ return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(isoWeek, token.length);
+ },
+
+ // Day of the month
+ d: function (date, token, localize) {
+ if (token === "do") {
+ return localize.ordinalNumber(date.getDate(), { unit: "date" });
+ }
+
+ return _lightFormatters_js__WEBPACK_IMPORTED_MODULE_6__.lightFormatters.d(date, token);
+ },
+
+ // Day of year
+ D: function (date, token, localize) {
+ const dayOfYear = (0,_getDayOfYear_js__WEBPACK_IMPORTED_MODULE_0__.getDayOfYear)(date);
+
+ if (token === "Do") {
+ return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
+ }
+
+ return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(dayOfYear, token.length);
+ },
+
+ // Day of week
+ E: function (date, token, localize) {
+ const dayOfWeek = date.getDay();
+ switch (token) {
+ // Tue
+ case "E":
+ case "EE":
+ case "EEE":
+ return localize.day(dayOfWeek, {
+ width: "abbreviated",
+ context: "formatting",
+ });
+ // T
+ case "EEEEE":
+ return localize.day(dayOfWeek, {
+ width: "narrow",
+ context: "formatting",
+ });
+ // Tu
+ case "EEEEEE":
+ return localize.day(dayOfWeek, {
+ width: "short",
+ context: "formatting",
+ });
+ // Tuesday
+ case "EEEE":
+ default:
+ return localize.day(dayOfWeek, {
+ width: "wide",
+ context: "formatting",
+ });
+ }
+ },
+
+ // Local day of week
+ e: function (date, token, localize, options) {
+ const dayOfWeek = date.getDay();
+ const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
+ switch (token) {
+ // Numerical value (Nth day of week with current locale or weekStartsOn)
+ case "e":
+ return String(localDayOfWeek);
+ // Padded numerical value
+ case "ee":
+ return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(localDayOfWeek, 2);
+ // 1st, 2nd, ..., 7th
+ case "eo":
+ return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
+ case "eee":
+ return localize.day(dayOfWeek, {
+ width: "abbreviated",
+ context: "formatting",
+ });
+ // T
+ case "eeeee":
+ return localize.day(dayOfWeek, {
+ width: "narrow",
+ context: "formatting",
+ });
+ // Tu
+ case "eeeeee":
+ return localize.day(dayOfWeek, {
+ width: "short",
+ context: "formatting",
+ });
+ // Tuesday
+ case "eeee":
+ default:
+ return localize.day(dayOfWeek, {
+ width: "wide",
+ context: "formatting",
+ });
+ }
+ },
+
+ // Stand-alone local day of week
+ c: function (date, token, localize, options) {
+ const dayOfWeek = date.getDay();
+ const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
+ switch (token) {
+ // Numerical value (same as in `e`)
+ case "c":
+ return String(localDayOfWeek);
+ // Padded numerical value
+ case "cc":
+ return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(localDayOfWeek, token.length);
+ // 1st, 2nd, ..., 7th
+ case "co":
+ return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
+ case "ccc":
+ return localize.day(dayOfWeek, {
+ width: "abbreviated",
+ context: "standalone",
+ });
+ // T
+ case "ccccc":
+ return localize.day(dayOfWeek, {
+ width: "narrow",
+ context: "standalone",
+ });
+ // Tu
+ case "cccccc":
+ return localize.day(dayOfWeek, {
+ width: "short",
+ context: "standalone",
+ });
+ // Tuesday
+ case "cccc":
+ default:
+ return localize.day(dayOfWeek, {
+ width: "wide",
+ context: "standalone",
+ });
+ }
+ },
+
+ // ISO day of week
+ i: function (date, token, localize) {
+ const dayOfWeek = date.getDay();
+ const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
+ switch (token) {
+ // 2
+ case "i":
+ return String(isoDayOfWeek);
+ // 02
+ case "ii":
+ return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(isoDayOfWeek, token.length);
+ // 2nd
+ case "io":
+ return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
+ // Tue
+ case "iii":
+ return localize.day(dayOfWeek, {
+ width: "abbreviated",
+ context: "formatting",
+ });
+ // T
+ case "iiiii":
+ return localize.day(dayOfWeek, {
+ width: "narrow",
+ context: "formatting",
+ });
+ // Tu
+ case "iiiiii":
+ return localize.day(dayOfWeek, {
+ width: "short",
+ context: "formatting",
+ });
+ // Tuesday
+ case "iiii":
+ default:
+ return localize.day(dayOfWeek, {
+ width: "wide",
+ context: "formatting",
+ });
+ }
+ },
+
+ // AM or PM
+ a: function (date, token, localize) {
+ const hours = date.getHours();
+ const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
+
+ switch (token) {
+ case "a":
+ case "aa":
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "abbreviated",
+ context: "formatting",
+ });
+ case "aaa":
+ return localize
+ .dayPeriod(dayPeriodEnumValue, {
+ width: "abbreviated",
+ context: "formatting",
+ })
+ .toLowerCase();
+ case "aaaaa":
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "narrow",
+ context: "formatting",
+ });
+ case "aaaa":
+ default:
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "wide",
+ context: "formatting",
+ });
+ }
+ },
+
+ // AM, PM, midnight, noon
+ b: function (date, token, localize) {
+ const hours = date.getHours();
+ let dayPeriodEnumValue;
+ if (hours === 12) {
+ dayPeriodEnumValue = dayPeriodEnum.noon;
+ } else if (hours === 0) {
+ dayPeriodEnumValue = dayPeriodEnum.midnight;
+ } else {
+ dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
+ }
+
+ switch (token) {
+ case "b":
+ case "bb":
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "abbreviated",
+ context: "formatting",
+ });
+ case "bbb":
+ return localize
+ .dayPeriod(dayPeriodEnumValue, {
+ width: "abbreviated",
+ context: "formatting",
+ })
+ .toLowerCase();
+ case "bbbbb":
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "narrow",
+ context: "formatting",
+ });
+ case "bbbb":
+ default:
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "wide",
+ context: "formatting",
+ });
+ }
+ },
+
+ // in the morning, in the afternoon, in the evening, at night
+ B: function (date, token, localize) {
+ const hours = date.getHours();
+ let dayPeriodEnumValue;
+ if (hours >= 17) {
+ dayPeriodEnumValue = dayPeriodEnum.evening;
+ } else if (hours >= 12) {
+ dayPeriodEnumValue = dayPeriodEnum.afternoon;
+ } else if (hours >= 4) {
+ dayPeriodEnumValue = dayPeriodEnum.morning;
+ } else {
+ dayPeriodEnumValue = dayPeriodEnum.night;
+ }
+
+ switch (token) {
+ case "B":
+ case "BB":
+ case "BBB":
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "abbreviated",
+ context: "formatting",
+ });
+ case "BBBBB":
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "narrow",
+ context: "formatting",
+ });
+ case "BBBB":
+ default:
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: "wide",
+ context: "formatting",
+ });
+ }
+ },
+
+ // Hour [1-12]
+ h: function (date, token, localize) {
+ if (token === "ho") {
+ let hours = date.getHours() % 12;
+ if (hours === 0) hours = 12;
+ return localize.ordinalNumber(hours, { unit: "hour" });
+ }
+
+ return _lightFormatters_js__WEBPACK_IMPORTED_MODULE_6__.lightFormatters.h(date, token);
+ },
+
+ // Hour [0-23]
+ H: function (date, token, localize) {
+ if (token === "Ho") {
+ return localize.ordinalNumber(date.getHours(), { unit: "hour" });
+ }
+
+ return _lightFormatters_js__WEBPACK_IMPORTED_MODULE_6__.lightFormatters.H(date, token);
+ },
+
+ // Hour [0-11]
+ K: function (date, token, localize) {
+ const hours = date.getHours() % 12;
+
+ if (token === "Ko") {
+ return localize.ordinalNumber(hours, { unit: "hour" });
+ }
+
+ return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(hours, token.length);
+ },
+
+ // Hour [1-24]
+ k: function (date, token, localize) {
+ let hours = date.getHours();
+ if (hours === 0) hours = 24;
+
+ if (token === "ko") {
+ return localize.ordinalNumber(hours, { unit: "hour" });
+ }
+
+ return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(hours, token.length);
+ },
+
+ // Minute
+ m: function (date, token, localize) {
+ if (token === "mo") {
+ return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
+ }
+
+ return _lightFormatters_js__WEBPACK_IMPORTED_MODULE_6__.lightFormatters.m(date, token);
+ },
+
+ // Second
+ s: function (date, token, localize) {
+ if (token === "so") {
+ return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
+ }
+
+ return _lightFormatters_js__WEBPACK_IMPORTED_MODULE_6__.lightFormatters.s(date, token);
+ },
+
+ // Fraction of second
+ S: function (date, token) {
+ return _lightFormatters_js__WEBPACK_IMPORTED_MODULE_6__.lightFormatters.S(date, token);
+ },
+
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
+ X: function (date, token, _localize) {
+ const timezoneOffset = date.getTimezoneOffset();
+
+ if (timezoneOffset === 0) {
+ return "Z";
+ }
+
+ switch (token) {
+ // Hours and optional minutes
+ case "X":
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
+
+ // Hours, minutes and optional seconds without `:` delimiter
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
+ // so this token always has the same output as `XX`
+ case "XXXX":
+ case "XX": // Hours and minutes without `:` delimiter
+ return formatTimezone(timezoneOffset);
+
+ // Hours, minutes and optional seconds with `:` delimiter
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
+ // so this token always has the same output as `XXX`
+ case "XXXXX":
+ case "XXX": // Hours and minutes with `:` delimiter
+ default:
+ return formatTimezone(timezoneOffset, ":");
+ }
+ },
+
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
+ x: function (date, token, _localize) {
+ const timezoneOffset = date.getTimezoneOffset();
+
+ switch (token) {
+ // Hours and optional minutes
+ case "x":
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
+
+ // Hours, minutes and optional seconds without `:` delimiter
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
+ // so this token always has the same output as `xx`
+ case "xxxx":
+ case "xx": // Hours and minutes without `:` delimiter
+ return formatTimezone(timezoneOffset);
+
+ // Hours, minutes and optional seconds with `:` delimiter
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
+ // so this token always has the same output as `xxx`
+ case "xxxxx":
+ case "xxx": // Hours and minutes with `:` delimiter
+ default:
+ return formatTimezone(timezoneOffset, ":");
+ }
+ },
+
+ // Timezone (GMT)
+ O: function (date, token, _localize) {
+ const timezoneOffset = date.getTimezoneOffset();
+
+ switch (token) {
+ // Short
+ case "O":
+ case "OO":
+ case "OOO":
+ return "GMT" + formatTimezoneShort(timezoneOffset, ":");
+ // Long
+ case "OOOO":
+ default:
+ return "GMT" + formatTimezone(timezoneOffset, ":");
+ }
+ },
+
+ // Timezone (specific non-location)
+ z: function (date, token, _localize) {
+ const timezoneOffset = date.getTimezoneOffset();
+
+ switch (token) {
+ // Short
+ case "z":
+ case "zz":
+ case "zzz":
+ return "GMT" + formatTimezoneShort(timezoneOffset, ":");
+ // Long
+ case "zzzz":
+ default:
+ return "GMT" + formatTimezone(timezoneOffset, ":");
+ }
+ },
+
+ // Seconds timestamp
+ t: function (date, token, _localize) {
+ const timestamp = Math.trunc(+date / 1000);
+ return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(timestamp, token.length);
+ },
+
+ // Milliseconds timestamp
+ T: function (date, token, _localize) {
+ return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(+date, token.length);
+ },
+};
+
+function formatTimezoneShort(offset, delimiter = "") {
+ const sign = offset > 0 ? "-" : "+";
+ const absOffset = Math.abs(offset);
+ const hours = Math.trunc(absOffset / 60);
+ const minutes = absOffset % 60;
+ if (minutes === 0) {
+ return sign + String(hours);
+ }
+ return sign + String(hours) + delimiter + (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(minutes, 2);
+}
+
+function formatTimezoneWithOptionalMinutes(offset, delimiter) {
+ if (offset % 60 === 0) {
+ const sign = offset > 0 ? "-" : "+";
+ return sign + (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(Math.abs(offset) / 60, 2);
+ }
+ return formatTimezone(offset, delimiter);
+}
+
+function formatTimezone(offset, delimiter = "") {
+ const sign = offset > 0 ? "-" : "+";
+ const absOffset = Math.abs(offset);
+ const hours = (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(Math.trunc(absOffset / 60), 2);
+ const minutes = (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(absOffset % 60, 2);
+ return sign + hours + delimiter + minutes;
+}
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/format/lightFormatters.js":
+/*!************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/format/lightFormatters.js ***!
+ \************************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ lightFormatters: () => (/* binding */ lightFormatters)
+/* harmony export */ });
+/* harmony import */ var _addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../addLeadingZeros.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/addLeadingZeros.js");
+
+
+/*
+ * | | Unit | | Unit |
+ * |-----|--------------------------------|-----|--------------------------------|
+ * | a | AM, PM | A* | |
+ * | d | Day of month | D | |
+ * | h | Hour [1-12] | H | Hour [0-23] |
+ * | m | Minute | M | Month |
+ * | s | Second | S | Fraction of second |
+ * | y | Year (abs) | Y | |
+ *
+ * Letters marked by * are not implemented but reserved by Unicode standard.
+ */
+
+const lightFormatters = {
+ // Year
+ y(date, token) {
+ // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
+ // | Year | y | yy | yyy | yyyy | yyyyy |
+ // |----------|-------|----|-------|-------|-------|
+ // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
+ // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
+ // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
+ // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
+ // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
+
+ const signedYear = date.getFullYear();
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
+ const year = signedYear > 0 ? signedYear : 1 - signedYear;
+ return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_0__.addLeadingZeros)(token === "yy" ? year % 100 : year, token.length);
+ },
+
+ // Month
+ M(date, token) {
+ const month = date.getMonth();
+ return token === "M" ? String(month + 1) : (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_0__.addLeadingZeros)(month + 1, 2);
+ },
+
+ // Day of the month
+ d(date, token) {
+ return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_0__.addLeadingZeros)(date.getDate(), token.length);
+ },
+
+ // AM or PM
+ a(date, token) {
+ const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
+
+ switch (token) {
+ case "a":
+ case "aa":
+ return dayPeriodEnumValue.toUpperCase();
+ case "aaa":
+ return dayPeriodEnumValue;
+ case "aaaaa":
+ return dayPeriodEnumValue[0];
+ case "aaaa":
+ default:
+ return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
+ }
+ },
+
+ // Hour [1-12]
+ h(date, token) {
+ return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_0__.addLeadingZeros)(date.getHours() % 12 || 12, token.length);
+ },
+
+ // Hour [0-23]
+ H(date, token) {
+ return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_0__.addLeadingZeros)(date.getHours(), token.length);
+ },
+
+ // Minute
+ m(date, token) {
+ return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_0__.addLeadingZeros)(date.getMinutes(), token.length);
+ },
+
+ // Second
+ s(date, token) {
+ return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_0__.addLeadingZeros)(date.getSeconds(), token.length);
+ },
+
+ // Fraction of second
+ S(date, token) {
+ const numberOfDigits = token.length;
+ const milliseconds = date.getMilliseconds();
+ const fractionalSeconds = Math.trunc(
+ milliseconds * Math.pow(10, numberOfDigits - 3),
+ );
+ return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_0__.addLeadingZeros)(fractionalSeconds, token.length);
+ },
+};
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/format/longFormatters.js":
+/*!***********************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/format/longFormatters.js ***!
+ \***********************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ longFormatters: () => (/* binding */ longFormatters)
+/* harmony export */ });
+const dateLongFormatter = (pattern, formatLong) => {
+ switch (pattern) {
+ case "P":
+ return formatLong.date({ width: "short" });
+ case "PP":
+ return formatLong.date({ width: "medium" });
+ case "PPP":
+ return formatLong.date({ width: "long" });
+ case "PPPP":
+ default:
+ return formatLong.date({ width: "full" });
+ }
+};
+
+const timeLongFormatter = (pattern, formatLong) => {
+ switch (pattern) {
+ case "p":
+ return formatLong.time({ width: "short" });
+ case "pp":
+ return formatLong.time({ width: "medium" });
+ case "ppp":
+ return formatLong.time({ width: "long" });
+ case "pppp":
+ default:
+ return formatLong.time({ width: "full" });
+ }
+};
+
+const dateTimeLongFormatter = (pattern, formatLong) => {
+ const matchResult = pattern.match(/(P+)(p+)?/) || [];
+ const datePattern = matchResult[1];
+ const timePattern = matchResult[2];
+
+ if (!timePattern) {
+ return dateLongFormatter(pattern, formatLong);
+ }
+
+ let dateTimeFormat;
+
+ switch (datePattern) {
+ case "P":
+ dateTimeFormat = formatLong.dateTime({ width: "short" });
+ break;
+ case "PP":
+ dateTimeFormat = formatLong.dateTime({ width: "medium" });
+ break;
+ case "PPP":
+ dateTimeFormat = formatLong.dateTime({ width: "long" });
+ break;
+ case "PPPP":
+ default:
+ dateTimeFormat = formatLong.dateTime({ width: "full" });
+ break;
+ }
+
+ return dateTimeFormat
+ .replace("{{date}}", dateLongFormatter(datePattern, formatLong))
+ .replace("{{time}}", timeLongFormatter(timePattern, formatLong));
+};
+
+const longFormatters = {
+ p: timeLongFormatter,
+ P: dateTimeLongFormatter,
+};
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js":
+/*!*********************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js ***!
+ \*********************************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ getTimezoneOffsetInMilliseconds: () => (/* binding */ getTimezoneOffsetInMilliseconds)
+/* harmony export */ });
+/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
+
+
+/**
+ * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
+ * They usually appear for dates that denote time before the timezones were introduced
+ * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
+ * and GMT+01:00:00 after that date)
+ *
+ * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
+ * which would lead to incorrect calculations.
+ *
+ * This function returns the timezone offset in milliseconds that takes seconds in account.
+ */
+function getTimezoneOffsetInMilliseconds(date) {
+ const _date = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_0__.toDate)(date);
+ const utcDate = new Date(
+ Date.UTC(
+ _date.getFullYear(),
+ _date.getMonth(),
+ _date.getDate(),
+ _date.getHours(),
+ _date.getMinutes(),
+ _date.getSeconds(),
+ _date.getMilliseconds(),
+ ),
+ );
+ utcDate.setUTCFullYear(_date.getFullYear());
+ return +date - +utcDate;
+}
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/normalizeDates.js":
+/*!****************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/normalizeDates.js ***!
+ \****************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ normalizeDates: () => (/* binding */ normalizeDates)
+/* harmony export */ });
+/* harmony import */ var _constructFrom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constructFrom.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constructFrom.js");
+
+
+function normalizeDates(context, ...dates) {
+ const normalize = _constructFrom_js__WEBPACK_IMPORTED_MODULE_0__.constructFrom.bind(
+ null,
+ context || dates.find((date) => typeof date === "object"),
+ );
+ return dates.map(normalize);
+}
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/protectedTokens.js":
+/*!*****************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/protectedTokens.js ***!
+ \*****************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ isProtectedDayOfYearToken: () => (/* binding */ isProtectedDayOfYearToken),
+/* harmony export */ isProtectedWeekYearToken: () => (/* binding */ isProtectedWeekYearToken),
+/* harmony export */ warnOrThrowProtectedError: () => (/* binding */ warnOrThrowProtectedError)
+/* harmony export */ });
+const dayOfYearTokenRE = /^D+$/;
+const weekYearTokenRE = /^Y+$/;
+
+const throwTokens = ["D", "DD", "YY", "YYYY"];
+
+function isProtectedDayOfYearToken(token) {
+ return dayOfYearTokenRE.test(token);
+}
+
+function isProtectedWeekYearToken(token) {
+ return weekYearTokenRE.test(token);
+}
+
+function warnOrThrowProtectedError(token, format, input) {
+ const _message = message(token, format, input);
+ console.warn(_message);
+ if (throwTokens.includes(token)) throw new RangeError(_message);
+}
+
+function message(token, format, input) {
+ const subject = token[0] === "Y" ? "years" : "days of the month";
+ return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
+}
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/addDays.js":
+/*!****************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/addDays.js ***!
+ \****************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ addDays: () => (/* binding */ addDays),
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
+/* harmony export */ });
+/* harmony import */ var _constructFrom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constructFrom.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constructFrom.js");
+/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
+
+
+
+/**
+ * The {@link addDays} function options.
+ */
+
+/**
+ * @name addDays
+ * @category Day Helpers
+ * @summary Add the specified number of days to the given date.
+ *
+ * @description
+ * Add the specified number of days to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of days to be added.
+ * @param options - An object with options
+ *
+ * @returns The new date with the days added
+ *
+ * @example
+ * // Add 10 days to 1 September 2014:
+ * const result = addDays(new Date(2014, 8, 1), 10)
+ * //=> Thu Sep 11 2014 00:00:00
+ */
+function addDays(date, amount, options) {
+ const _date = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_1__.toDate)(date, options?.in);
+ if (isNaN(amount)) return (0,_constructFrom_js__WEBPACK_IMPORTED_MODULE_0__.constructFrom)(options?.in || date, NaN);
+
+ // If 0 days, no-op to avoid changing times in the hour before end of DST
+ if (!amount) return _date;
+
+ _date.setDate(_date.getDate() + amount);
+ return _date;
+}
+
+// Fallback for modularized imports:
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (addDays);
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/addMonths.js":
+/*!******************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/addMonths.js ***!
+ \******************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ addMonths: () => (/* binding */ addMonths),
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
+/* harmony export */ });
+/* harmony import */ var _constructFrom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constructFrom.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constructFrom.js");
+/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
+
+
+
+/**
+ * The {@link addMonths} function options.
+ */
+
+/**
+ * @name addMonths
+ * @category Month Helpers
+ * @summary Add the specified number of months to the given date.
+ *
+ * @description
+ * Add the specified number of months to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of months to be added.
+ * @param options - The options object
+ *
+ * @returns The new date with the months added
+ *
+ * @example
+ * // Add 5 months to 1 September 2014:
+ * const result = addMonths(new Date(2014, 8, 1), 5)
+ * //=> Sun Feb 01 2015 00:00:00
+ *
+ * // Add one month to 30 January 2023:
+ * const result = addMonths(new Date(2023, 0, 30), 1)
+ * //=> Tue Feb 28 2023 00:00:00
+ */
+function addMonths(date, amount, options) {
+ const _date = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_1__.toDate)(date, options?.in);
+ if (isNaN(amount)) return (0,_constructFrom_js__WEBPACK_IMPORTED_MODULE_0__.constructFrom)(options?.in || date, NaN);
+ if (!amount) {
+ // If 0 months, no-op to avoid changing times in the hour before end of DST
+ return _date;
+ }
+ const dayOfMonth = _date.getDate();
+
+ // The JS Date object supports date math by accepting out-of-bounds values for
+ // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
+ // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we
+ // want except that dates will wrap around the end of a month, meaning that
+ // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
+ // we'll default to the end of the desired month by adding 1 to the desired
+ // month and using a date of 0 to back up one day to the end of the desired
+ // month.
+ const endOfDesiredMonth = (0,_constructFrom_js__WEBPACK_IMPORTED_MODULE_0__.constructFrom)(options?.in || date, _date.getTime());
+ endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
+ const daysInMonth = endOfDesiredMonth.getDate();
+ if (dayOfMonth >= daysInMonth) {
+ // If we're already at the end of the month, then this is the correct date
+ // and we're done.
+ return endOfDesiredMonth;
+ } else {
+ // Otherwise, we now know that setting the original day-of-month value won't
+ // cause an overflow, so set the desired day-of-month. Note that we can't
+ // just set the date of `endOfDesiredMonth` because that object may have had
+ // its time changed in the unusual case where where a DST transition was on
+ // the last day of the month and its local time was in the hour skipped or
+ // repeated next to a DST transition. So we use `date` instead which is
+ // guaranteed to still have the original time.
+ _date.setFullYear(
+ endOfDesiredMonth.getFullYear(),
+ endOfDesiredMonth.getMonth(),
+ dayOfMonth,
+ );
+ return _date;
+ }
+}
+
+// Fallback for modularized imports:
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (addMonths);
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/addYears.js":
+/*!*****************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/addYears.js ***!
+ \*****************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ addYears: () => (/* binding */ addYears),
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
+/* harmony export */ });
+/* harmony import */ var _addMonths_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./addMonths.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/addMonths.js");
+
+
+/**
+ * The {@link addYears} function options.
+ */
+
+/**
+ * @name addYears
+ * @category Year Helpers
+ * @summary Add the specified number of years to the given date.
+ *
+ * @description
+ * Add the specified number of years to the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of years to be added.
+ * @param options - The options
+ *
+ * @returns The new date with the years added
+ *
+ * @example
+ * // Add 5 years to 1 September 2014:
+ * const result = addYears(new Date(2014, 8, 1), 5)
+ * //=> Sun Sep 01 2019 00:00:00
+ */
+function addYears(date, amount, options) {
+ return (0,_addMonths_js__WEBPACK_IMPORTED_MODULE_0__.addMonths)(date, amount * 12, options);
+}
+
+// Fallback for modularized imports:
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (addYears);
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constants.js":
+/*!******************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/constants.js ***!
+ \******************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ constructFromSymbol: () => (/* binding */ constructFromSymbol),
+/* harmony export */ daysInWeek: () => (/* binding */ daysInWeek),
+/* harmony export */ daysInYear: () => (/* binding */ daysInYear),
+/* harmony export */ maxTime: () => (/* binding */ maxTime),
+/* harmony export */ millisecondsInDay: () => (/* binding */ millisecondsInDay),
+/* harmony export */ millisecondsInHour: () => (/* binding */ millisecondsInHour),
+/* harmony export */ millisecondsInMinute: () => (/* binding */ millisecondsInMinute),
+/* harmony export */ millisecondsInSecond: () => (/* binding */ millisecondsInSecond),
+/* harmony export */ millisecondsInWeek: () => (/* binding */ millisecondsInWeek),
+/* harmony export */ minTime: () => (/* binding */ minTime),
+/* harmony export */ minutesInDay: () => (/* binding */ minutesInDay),
+/* harmony export */ minutesInHour: () => (/* binding */ minutesInHour),
+/* harmony export */ minutesInMonth: () => (/* binding */ minutesInMonth),
+/* harmony export */ minutesInYear: () => (/* binding */ minutesInYear),
+/* harmony export */ monthsInQuarter: () => (/* binding */ monthsInQuarter),
+/* harmony export */ monthsInYear: () => (/* binding */ monthsInYear),
+/* harmony export */ quartersInYear: () => (/* binding */ quartersInYear),
+/* harmony export */ secondsInDay: () => (/* binding */ secondsInDay),
+/* harmony export */ secondsInHour: () => (/* binding */ secondsInHour),
+/* harmony export */ secondsInMinute: () => (/* binding */ secondsInMinute),
+/* harmony export */ secondsInMonth: () => (/* binding */ secondsInMonth),
+/* harmony export */ secondsInQuarter: () => (/* binding */ secondsInQuarter),
+/* harmony export */ secondsInWeek: () => (/* binding */ secondsInWeek),
+/* harmony export */ secondsInYear: () => (/* binding */ secondsInYear)
+/* harmony export */ });
+/**
+ * @module constants
+ * @summary Useful constants
+ * @description
+ * Collection of useful date constants.
+ *
+ * The constants could be imported from `date-fns/constants`:
+ *
+ * ```ts
+ * import { maxTime, minTime } from "./constants/date-fns/constants";
+ *
+ * function isAllowedTime(time) {
+ * return time <= maxTime && time >= minTime;
+ * }
+ * ```
+ */
+
+/**
+ * @constant
+ * @name daysInWeek
+ * @summary Days in 1 week.
+ */
+const daysInWeek = 7;
+
+/**
+ * @constant
+ * @name daysInYear
+ * @summary Days in 1 year.
+ *
+ * @description
+ * How many days in a year.
+ *
+ * One years equals 365.2425 days according to the formula:
+ *
+ * > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400.
+ * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days
+ */
+const daysInYear = 365.2425;
+
+/**
+ * @constant
+ * @name maxTime
+ * @summary Maximum allowed time.
+ *
+ * @example
+ * import { maxTime } from "./constants/date-fns/constants";
+ *
+ * const isValid = 8640000000000001 <= maxTime;
+ * //=> false
+ *
+ * new Date(8640000000000001);
+ * //=> Invalid Date
+ */
+const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;
+
+/**
+ * @constant
+ * @name minTime
+ * @summary Minimum allowed time.
+ *
+ * @example
+ * import { minTime } from "./constants/date-fns/constants";
+ *
+ * const isValid = -8640000000000001 >= minTime;
+ * //=> false
+ *
+ * new Date(-8640000000000001)
+ * //=> Invalid Date
+ */
+const minTime = -maxTime;
+
+/**
+ * @constant
+ * @name millisecondsInWeek
+ * @summary Milliseconds in 1 week.
+ */
+const millisecondsInWeek = 604800000;
+
+/**
+ * @constant
+ * @name millisecondsInDay
+ * @summary Milliseconds in 1 day.
+ */
+const millisecondsInDay = 86400000;
+
+/**
+ * @constant
+ * @name millisecondsInMinute
+ * @summary Milliseconds in 1 minute
+ */
+const millisecondsInMinute = 60000;
+
+/**
+ * @constant
+ * @name millisecondsInHour
+ * @summary Milliseconds in 1 hour
+ */
+const millisecondsInHour = 3600000;
+
+/**
+ * @constant
+ * @name millisecondsInSecond
+ * @summary Milliseconds in 1 second
+ */
+const millisecondsInSecond = 1000;
+
+/**
+ * @constant
+ * @name minutesInYear
+ * @summary Minutes in 1 year.
+ */
+const minutesInYear = 525600;
+
+/**
+ * @constant
+ * @name minutesInMonth
+ * @summary Minutes in 1 month.
+ */
+const minutesInMonth = 43200;
+
+/**
+ * @constant
+ * @name minutesInDay
+ * @summary Minutes in 1 day.
+ */
+const minutesInDay = 1440;
+
+/**
+ * @constant
+ * @name minutesInHour
+ * @summary Minutes in 1 hour.
+ */
+const minutesInHour = 60;
+
+/**
+ * @constant
+ * @name monthsInQuarter
+ * @summary Months in 1 quarter.
+ */
+const monthsInQuarter = 3;
+
+/**
+ * @constant
+ * @name monthsInYear
+ * @summary Months in 1 year.
+ */
+const monthsInYear = 12;
+
+/**
+ * @constant
+ * @name quartersInYear
+ * @summary Quarters in 1 year
+ */
+const quartersInYear = 4;
+
+/**
+ * @constant
+ * @name secondsInHour
+ * @summary Seconds in 1 hour.
+ */
+const secondsInHour = 3600;
+
+/**
+ * @constant
+ * @name secondsInMinute
+ * @summary Seconds in 1 minute.
+ */
+const secondsInMinute = 60;
+
+/**
+ * @constant
+ * @name secondsInDay
+ * @summary Seconds in 1 day.
+ */
+const secondsInDay = secondsInHour * 24;
+
+/**
+ * @constant
+ * @name secondsInWeek
+ * @summary Seconds in 1 week.
+ */
+const secondsInWeek = secondsInDay * 7;
+
+/**
+ * @constant
+ * @name secondsInYear
+ * @summary Seconds in 1 year.
+ */
+const secondsInYear = secondsInDay * daysInYear;
+
+/**
+ * @constant
+ * @name secondsInMonth
+ * @summary Seconds in 1 month
+ */
+const secondsInMonth = secondsInYear / 12;
+
+/**
+ * @constant
+ * @name secondsInQuarter
+ * @summary Seconds in 1 quarter.
+ */
+const secondsInQuarter = secondsInMonth * 3;
+
+/**
+ * @constant
+ * @name constructFromSymbol
+ * @summary Symbol enabling Date extensions to inherit properties from the reference date.
+ *
+ * The symbol is used to enable the `constructFrom` function to construct a date
+ * using a reference date and a value. It allows to transfer extra properties
+ * from the reference date to the new date. It's useful for extensions like
+ * [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as
+ * a constructor argument.
+ */
+const constructFromSymbol = Symbol.for("constructDateFrom");
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constructFrom.js":
+/*!**********************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/constructFrom.js ***!
+ \**********************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ constructFrom: () => (/* binding */ constructFrom),
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
+/* harmony export */ });
+/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constants.js");
+
+
+/**
+ * @name constructFrom
+ * @category Generic Helpers
+ * @summary Constructs a date using the reference date and the value
+ *
+ * @description
+ * The function constructs a new date using the constructor from the reference
+ * date and the given value. It helps to build generic functions that accept
+ * date extensions.
+ *
+ * It defaults to `Date` if the passed reference date is a number or a string.
+ *
+ * Starting from v3.7.0, it allows to construct a date using `[Symbol.for("constructDateFrom")]`
+ * enabling to transfer extra properties from the reference date to the new date.
+ * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
+ * that accept a time zone as a constructor argument.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ *
+ * @param date - The reference date to take constructor from
+ * @param value - The value to create the date
+ *
+ * @returns Date initialized using the given date and value
+ *
+ * @example
+ * import { constructFrom } from "./constructFrom/date-fns";
+ *
+ * // A function that clones a date preserving the original type
+ * function cloneDate(date: DateType): DateType {
+ * return constructFrom(
+ * date, // Use constructor from the given date
+ * date.getTime() // Use the date value to create a new date
+ * );
+ * }
+ */
+function constructFrom(date, value) {
+ if (typeof date === "function") return date(value);
+
+ if (date && typeof date === "object" && _constants_js__WEBPACK_IMPORTED_MODULE_0__.constructFromSymbol in date)
+ return date[_constants_js__WEBPACK_IMPORTED_MODULE_0__.constructFromSymbol](value);
+
+ if (date instanceof Date) return new date.constructor(value);
+
+ return new Date(value);
+}
+
+// Fallback for modularized imports:
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (constructFrom);
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/differenceInCalendarDays.js":
+/*!*********************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/differenceInCalendarDays.js ***!
+ \*********************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
+/* harmony export */ differenceInCalendarDays: () => (/* binding */ differenceInCalendarDays)
+/* harmony export */ });
+/* harmony import */ var _lib_getTimezoneOffsetInMilliseconds_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_lib/getTimezoneOffsetInMilliseconds.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js");
+/* harmony import */ var _lib_normalizeDates_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_lib/normalizeDates.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/normalizeDates.js");
+/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constants.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constants.js");
+/* harmony import */ var _startOfDay_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./startOfDay.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfDay.js");
+
+
+
+
+
+/**
+ * The {@link differenceInCalendarDays} function options.
+ */
+
+/**
+ * @name differenceInCalendarDays
+ * @category Day Helpers
+ * @summary Get the number of calendar days between the given dates.
+ *
+ * @description
+ * Get the number of calendar days between the given dates. This means that the times are removed
+ * from the dates and then the difference in days is calculated.
+ *
+ * @param laterDate - The later date
+ * @param earlierDate - The earlier date
+ * @param options - The options object
+ *
+ * @returns The number of calendar days
+ *
+ * @example
+ * // How many calendar days are between
+ * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
+ * const result = differenceInCalendarDays(
+ * new Date(2012, 6, 2, 0, 0),
+ * new Date(2011, 6, 2, 23, 0)
+ * )
+ * //=> 366
+ * // How many calendar days are between
+ * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
+ * const result = differenceInCalendarDays(
+ * new Date(2011, 6, 3, 0, 1),
+ * new Date(2011, 6, 2, 23, 59)
+ * )
+ * //=> 1
+ */
+function differenceInCalendarDays(laterDate, earlierDate, options) {
+ const [laterDate_, earlierDate_] = (0,_lib_normalizeDates_js__WEBPACK_IMPORTED_MODULE_1__.normalizeDates)(
+ options?.in,
+ laterDate,
+ earlierDate,
+ );
+
+ const laterStartOfDay = (0,_startOfDay_js__WEBPACK_IMPORTED_MODULE_3__.startOfDay)(laterDate_);
+ const earlierStartOfDay = (0,_startOfDay_js__WEBPACK_IMPORTED_MODULE_3__.startOfDay)(earlierDate_);
+
+ const laterTimestamp =
+ +laterStartOfDay - (0,_lib_getTimezoneOffsetInMilliseconds_js__WEBPACK_IMPORTED_MODULE_0__.getTimezoneOffsetInMilliseconds)(laterStartOfDay);
+ const earlierTimestamp =
+ +earlierStartOfDay - (0,_lib_getTimezoneOffsetInMilliseconds_js__WEBPACK_IMPORTED_MODULE_0__.getTimezoneOffsetInMilliseconds)(earlierStartOfDay);
+
+ // Round the number of days to the nearest integer because the number of
+ // milliseconds in a day is not constant (e.g. it's different in the week of
+ // the daylight saving time clock shift).
+ return Math.round((laterTimestamp - earlierTimestamp) / _constants_js__WEBPACK_IMPORTED_MODULE_2__.millisecondsInDay);
+}
+
+// Fallback for modularized imports:
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (differenceInCalendarDays);
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/format.js":
+/*!***************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/format.js ***!
+ \***************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
+/* harmony export */ format: () => (/* binding */ format),
+/* harmony export */ formatDate: () => (/* binding */ format),
+/* harmony export */ formatters: () => (/* reexport safe */ _lib_format_formatters_js__WEBPACK_IMPORTED_MODULE_2__.formatters),
+/* harmony export */ longFormatters: () => (/* reexport safe */ _lib_format_longFormatters_js__WEBPACK_IMPORTED_MODULE_3__.longFormatters)
+/* harmony export */ });
+/* harmony import */ var _lib_defaultLocale_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_lib/defaultLocale.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US.js");
+/* harmony import */ var _lib_defaultOptions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_lib/defaultOptions.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/defaultOptions.js");
+/* harmony import */ var _lib_format_formatters_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_lib/format/formatters.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/format/formatters.js");
+/* harmony import */ var _lib_format_longFormatters_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_lib/format/longFormatters.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/format/longFormatters.js");
+/* harmony import */ var _lib_protectedTokens_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_lib/protectedTokens.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/protectedTokens.js");
+/* harmony import */ var _isValid_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isValid.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/isValid.js");
+/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
+
+
+
+
+
+
+
+
+// Rexports of internal for libraries to use.
+// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874
+
+
+// This RegExp consists of three parts separated by `|`:
+// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
+// (one of the certain letters followed by `o`)
+// - (\w)\1* matches any sequences of the same letter
+// - '' matches two quote characters in a row
+// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
+// except a single quote symbol, which ends the sequence.
+// Two quote characters do not end the sequence.
+// If there is no matching single quote
+// then the sequence will continue until the end of the string.
+// - . matches any single character unmatched by previous parts of the RegExps
+const formattingTokensRegExp =
+ /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
+
+// This RegExp catches symbols escaped by quotes, and also
+// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
+const longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
+
+const escapedStringRegExp = /^'([^]*?)'?$/;
+const doubleQuoteRegExp = /''/g;
+const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
+
+
+
+/**
+ * The {@link format} function options.
+ */
+
+/**
+ * @name format
+ * @alias formatDate
+ * @category Common Helpers
+ * @summary Format the date.
+ *
+ * @description
+ * Return the formatted date string in the given format. The result may vary by locale.
+ *
+ * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
+ * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
+ *
+ * The characters wrapped between two single quotes characters (') are escaped.
+ * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
+ * (see the last example)
+ *
+ * Format of the string is based on Unicode Technical Standard #35:
+ * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
+ * with a few additions (see note 7 below the table).
+ *
+ * Accepted patterns:
+ * | Unit | Pattern | Result examples | Notes |
+ * |---------------------------------|---------|-----------------------------------|-------|
+ * | Era | G..GGG | AD, BC | |
+ * | | GGGG | Anno Domini, Before Christ | 2 |
+ * | | GGGGG | A, B | |
+ * | Calendar year | y | 44, 1, 1900, 2017 | 5 |
+ * | | yo | 44th, 1st, 0th, 17th | 5,7 |
+ * | | yy | 44, 01, 00, 17 | 5 |
+ * | | yyy | 044, 001, 1900, 2017 | 5 |
+ * | | yyyy | 0044, 0001, 1900, 2017 | 5 |
+ * | | yyyyy | ... | 3,5 |
+ * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
+ * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
+ * | | YY | 44, 01, 00, 17 | 5,8 |
+ * | | YYY | 044, 001, 1900, 2017 | 5 |
+ * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
+ * | | YYYYY | ... | 3,5 |
+ * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
+ * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
+ * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
+ * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
+ * | | RRRRR | ... | 3,5,7 |
+ * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
+ * | | uu | -43, 01, 1900, 2017 | 5 |
+ * | | uuu | -043, 001, 1900, 2017 | 5 |
+ * | | uuuu | -0043, 0001, 1900, 2017 | 5 |
+ * | | uuuuu | ... | 3,5 |
+ * | Quarter (formatting) | Q | 1, 2, 3, 4 | |
+ * | | Qo | 1st, 2nd, 3rd, 4th | 7 |
+ * | | QQ | 01, 02, 03, 04 | |
+ * | | QQQ | Q1, Q2, Q3, Q4 | |
+ * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
+ * | | QQQQQ | 1, 2, 3, 4 | 4 |
+ * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
+ * | | qo | 1st, 2nd, 3rd, 4th | 7 |
+ * | | qq | 01, 02, 03, 04 | |
+ * | | qqq | Q1, Q2, Q3, Q4 | |
+ * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
+ * | | qqqqq | 1, 2, 3, 4 | 4 |
+ * | Month (formatting) | M | 1, 2, ..., 12 | |
+ * | | Mo | 1st, 2nd, ..., 12th | 7 |
+ * | | MM | 01, 02, ..., 12 | |
+ * | | MMM | Jan, Feb, ..., Dec | |
+ * | | MMMM | January, February, ..., December | 2 |
+ * | | MMMMM | J, F, ..., D | |
+ * | Month (stand-alone) | L | 1, 2, ..., 12 | |
+ * | | Lo | 1st, 2nd, ..., 12th | 7 |
+ * | | LL | 01, 02, ..., 12 | |
+ * | | LLL | Jan, Feb, ..., Dec | |
+ * | | LLLL | January, February, ..., December | 2 |
+ * | | LLLLL | J, F, ..., D | |
+ * | Local week of year | w | 1, 2, ..., 53 | |
+ * | | wo | 1st, 2nd, ..., 53th | 7 |
+ * | | ww | 01, 02, ..., 53 | |
+ * | ISO week of year | I | 1, 2, ..., 53 | 7 |
+ * | | Io | 1st, 2nd, ..., 53th | 7 |
+ * | | II | 01, 02, ..., 53 | 7 |
+ * | Day of month | d | 1, 2, ..., 31 | |
+ * | | do | 1st, 2nd, ..., 31st | 7 |
+ * | | dd | 01, 02, ..., 31 | |
+ * | Day of year | D | 1, 2, ..., 365, 366 | 9 |
+ * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
+ * | | DD | 01, 02, ..., 365, 366 | 9 |
+ * | | DDD | 001, 002, ..., 365, 366 | |
+ * | | DDDD | ... | 3 |
+ * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
+ * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
+ * | | EEEEE | M, T, W, T, F, S, S | |
+ * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
+ * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
+ * | | io | 1st, 2nd, ..., 7th | 7 |
+ * | | ii | 01, 02, ..., 07 | 7 |
+ * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
+ * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
+ * | | iiiii | M, T, W, T, F, S, S | 7 |
+ * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
+ * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
+ * | | eo | 2nd, 3rd, ..., 1st | 7 |
+ * | | ee | 02, 03, ..., 01 | |
+ * | | eee | Mon, Tue, Wed, ..., Sun | |
+ * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
+ * | | eeeee | M, T, W, T, F, S, S | |
+ * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
+ * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
+ * | | co | 2nd, 3rd, ..., 1st | 7 |
+ * | | cc | 02, 03, ..., 01 | |
+ * | | ccc | Mon, Tue, Wed, ..., Sun | |
+ * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
+ * | | ccccc | M, T, W, T, F, S, S | |
+ * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
+ * | AM, PM | a..aa | AM, PM | |
+ * | | aaa | am, pm | |
+ * | | aaaa | a.m., p.m. | 2 |
+ * | | aaaaa | a, p | |
+ * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
+ * | | bbb | am, pm, noon, midnight | |
+ * | | bbbb | a.m., p.m., noon, midnight | 2 |
+ * | | bbbbb | a, p, n, mi | |
+ * | Flexible day period | B..BBB | at night, in the morning, ... | |
+ * | | BBBB | at night, in the morning, ... | 2 |
+ * | | BBBBB | at night, in the morning, ... | |
+ * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
+ * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
+ * | | hh | 01, 02, ..., 11, 12 | |
+ * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
+ * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
+ * | | HH | 00, 01, 02, ..., 23 | |
+ * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
+ * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
+ * | | KK | 01, 02, ..., 11, 00 | |
+ * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
+ * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
+ * | | kk | 24, 01, 02, ..., 23 | |
+ * | Minute | m | 0, 1, ..., 59 | |
+ * | | mo | 0th, 1st, ..., 59th | 7 |
+ * | | mm | 00, 01, ..., 59 | |
+ * | Second | s | 0, 1, ..., 59 | |
+ * | | so | 0th, 1st, ..., 59th | 7 |
+ * | | ss | 00, 01, ..., 59 | |
+ * | Fraction of second | S | 0, 1, ..., 9 | |
+ * | | SS | 00, 01, ..., 99 | |
+ * | | SSS | 000, 001, ..., 999 | |
+ * | | SSSS | ... | 3 |
+ * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
+ * | | XX | -0800, +0530, Z | |
+ * | | XXX | -08:00, +05:30, Z | |
+ * | | XXXX | -0800, +0530, Z, +123456 | 2 |
+ * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
+ * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
+ * | | xx | -0800, +0530, +0000 | |
+ * | | xxx | -08:00, +05:30, +00:00 | 2 |
+ * | | xxxx | -0800, +0530, +0000, +123456 | |
+ * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
+ * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
+ * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
+ * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
+ * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
+ * | Seconds timestamp | t | 512969520 | 7 |
+ * | | tt | ... | 3,7 |
+ * | Milliseconds timestamp | T | 512969520900 | 7 |
+ * | | TT | ... | 3,7 |
+ * | Long localized date | P | 04/29/1453 | 7 |
+ * | | PP | Apr 29, 1453 | 7 |
+ * | | PPP | April 29th, 1453 | 7 |
+ * | | PPPP | Friday, April 29th, 1453 | 2,7 |
+ * | Long localized time | p | 12:00 AM | 7 |
+ * | | pp | 12:00:00 AM | 7 |
+ * | | ppp | 12:00:00 AM GMT+2 | 7 |
+ * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
+ * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
+ * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
+ * | | PPPppp | April 29th, 1453 at ... | 7 |
+ * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
+ * Notes:
+ * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
+ * are the same as "stand-alone" units, but are different in some languages.
+ * "Formatting" units are declined according to the rules of the language
+ * in the context of a date. "Stand-alone" units are always nominative singular:
+ *
+ * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
+ *
+ * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
+ *
+ * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
+ * the single quote characters (see below).
+ * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
+ * the output will be the same as default pattern for this unit, usually
+ * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
+ * are marked with "2" in the last column of the table.
+ *
+ * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
+ *
+ * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
+ *
+ * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
+ *
+ * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
+ *
+ * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
+ *
+ * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
+ * The output will be padded with zeros to match the length of the pattern.
+ *
+ * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
+ *
+ * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
+ * These tokens represent the shortest form of the quarter.
+ *
+ * 5. The main difference between `y` and `u` patterns are B.C. years:
+ *
+ * | Year | `y` | `u` |
+ * |------|-----|-----|
+ * | AC 1 | 1 | 1 |
+ * | BC 1 | 1 | 0 |
+ * | BC 2 | 2 | -1 |
+ *
+ * Also `yy` always returns the last two digits of a year,
+ * while `uu` pads single digit years to 2 characters and returns other years unchanged:
+ *
+ * | Year | `yy` | `uu` |
+ * |------|------|------|
+ * | 1 | 01 | 01 |
+ * | 14 | 14 | 14 |
+ * | 376 | 76 | 376 |
+ * | 1453 | 53 | 1453 |
+ *
+ * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
+ * except local week-numbering years are dependent on `options.weekStartsOn`
+ * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)
+ * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).
+ *
+ * 6. Specific non-location timezones are currently unavailable in `date-fns`,
+ * so right now these tokens fall back to GMT timezones.
+ *
+ * 7. These patterns are not in the Unicode Technical Standard #35:
+ * - `i`: ISO day of week
+ * - `I`: ISO week of year
+ * - `R`: ISO week-numbering year
+ * - `t`: seconds timestamp
+ * - `T`: milliseconds timestamp
+ * - `o`: ordinal number modifier
+ * - `P`: long localized date
+ * - `p`: long localized time
+ *
+ * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
+ *
+ * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
+ *
+ * @param date - The original date
+ * @param format - The string of tokens
+ * @param options - An object with options
+ *
+ * @returns The formatted date string
+ *
+ * @throws `date` must not be Invalid Date
+ * @throws `options.locale` must contain `localize` property
+ * @throws `options.locale` must contain `formatLong` property
+ * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
+ * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
+ * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
+ * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
+ * @throws format string contains an unescaped latin alphabet character
+ *
+ * @example
+ * // Represent 11 February 2014 in middle-endian format:
+ * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
+ * //=> '02/11/2014'
+ *
+ * @example
+ * // Represent 2 July 2014 in Esperanto:
+ * import { eoLocale } from 'date-fns/locale/eo'
+ * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
+ * locale: eoLocale
+ * })
+ * //=> '2-a de julio 2014'
+ *
+ * @example
+ * // Escape string by single quote characters:
+ * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
+ * //=> "3 o'clock"
+ */
+function format(date, formatStr, options) {
+ const defaultOptions = (0,_lib_defaultOptions_js__WEBPACK_IMPORTED_MODULE_1__.getDefaultOptions)();
+ const locale = options?.locale ?? defaultOptions.locale ?? _lib_defaultLocale_js__WEBPACK_IMPORTED_MODULE_0__.enUS;
+
+ const firstWeekContainsDate =
+ options?.firstWeekContainsDate ??
+ options?.locale?.options?.firstWeekContainsDate ??
+ defaultOptions.firstWeekContainsDate ??
+ defaultOptions.locale?.options?.firstWeekContainsDate ??
+ 1;
+
+ const weekStartsOn =
+ options?.weekStartsOn ??
+ options?.locale?.options?.weekStartsOn ??
+ defaultOptions.weekStartsOn ??
+ defaultOptions.locale?.options?.weekStartsOn ??
+ 0;
+
+ const originalDate = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_6__.toDate)(date, options?.in);
+
+ if (!(0,_isValid_js__WEBPACK_IMPORTED_MODULE_5__.isValid)(originalDate)) {
+ throw new RangeError("Invalid time value");
+ }
+
+ let parts = formatStr
+ .match(longFormattingTokensRegExp)
+ .map((substring) => {
+ const firstCharacter = substring[0];
+ if (firstCharacter === "p" || firstCharacter === "P") {
+ const longFormatter = _lib_format_longFormatters_js__WEBPACK_IMPORTED_MODULE_3__.longFormatters[firstCharacter];
+ return longFormatter(substring, locale.formatLong);
+ }
+ return substring;
+ })
+ .join("")
+ .match(formattingTokensRegExp)
+ .map((substring) => {
+ // Replace two single quote characters with one single quote character
+ if (substring === "''") {
+ return { isToken: false, value: "'" };
+ }
+
+ const firstCharacter = substring[0];
+ if (firstCharacter === "'") {
+ return { isToken: false, value: cleanEscapedString(substring) };
+ }
+
+ if (_lib_format_formatters_js__WEBPACK_IMPORTED_MODULE_2__.formatters[firstCharacter]) {
+ return { isToken: true, value: substring };
+ }
+
+ if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
+ throw new RangeError(
+ "Format string contains an unescaped latin alphabet character `" +
+ firstCharacter +
+ "`",
+ );
+ }
+
+ return { isToken: false, value: substring };
+ });
+
+ // invoke localize preprocessor (only for french locales at the moment)
+ if (locale.localize.preprocessor) {
+ parts = locale.localize.preprocessor(originalDate, parts);
+ }
+
+ const formatterOptions = {
+ firstWeekContainsDate,
+ weekStartsOn,
+ locale,
+ };
+
+ return parts
+ .map((part) => {
+ if (!part.isToken) return part.value;
+
+ const token = part.value;
+
+ if (
+ (!options?.useAdditionalWeekYearTokens &&
+ (0,_lib_protectedTokens_js__WEBPACK_IMPORTED_MODULE_4__.isProtectedWeekYearToken)(token)) ||
+ (!options?.useAdditionalDayOfYearTokens &&
+ (0,_lib_protectedTokens_js__WEBPACK_IMPORTED_MODULE_4__.isProtectedDayOfYearToken)(token))
+ ) {
+ (0,_lib_protectedTokens_js__WEBPACK_IMPORTED_MODULE_4__.warnOrThrowProtectedError)(token, formatStr, String(date));
+ }
+
+ const formatter = _lib_format_formatters_js__WEBPACK_IMPORTED_MODULE_2__.formatters[token[0]];
+ return formatter(originalDate, token, locale.localize, formatterOptions);
+ })
+ .join("");
+}
+
+function cleanEscapedString(input) {
+ const matched = input.match(escapedStringRegExp);
+
+ if (!matched) {
+ return input;
+ }
+
+ return matched[1].replace(doubleQuoteRegExp, "'");
+}
+
+// Fallback for modularized imports:
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (format);
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/getDayOfYear.js":
+/*!*********************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/getDayOfYear.js ***!
+ \*********************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
+/* harmony export */ getDayOfYear: () => (/* binding */ getDayOfYear)
+/* harmony export */ });
+/* harmony import */ var _differenceInCalendarDays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./differenceInCalendarDays.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/differenceInCalendarDays.js");
+/* harmony import */ var _startOfYear_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./startOfYear.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfYear.js");
+/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
+
+
+
+
+/**
+ * The {@link getDayOfYear} function options.
+ */
+
+/**
+ * @name getDayOfYear
+ * @category Day Helpers
+ * @summary Get the day of the year of the given date.
+ *
+ * @description
+ * Get the day of the year of the given date.
+ *
+ * @param date - The given date
+ * @param options - The options
+ *
+ * @returns The day of year
+ *
+ * @example
+ * // Which day of the year is 2 July 2014?
+ * const result = getDayOfYear(new Date(2014, 6, 2))
+ * //=> 183
+ */
+function getDayOfYear(date, options) {
+ const _date = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_2__.toDate)(date, options?.in);
+ const diff = (0,_differenceInCalendarDays_js__WEBPACK_IMPORTED_MODULE_0__.differenceInCalendarDays)(_date, (0,_startOfYear_js__WEBPACK_IMPORTED_MODULE_1__.startOfYear)(_date));
+ const dayOfYear = diff + 1;
+ return dayOfYear;
+}
+
+// Fallback for modularized imports:
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getDayOfYear);
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/getISOWeek.js":
+/*!*******************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/getISOWeek.js ***!
+ \*******************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
+/* harmony export */ getISOWeek: () => (/* binding */ getISOWeek)
+/* harmony export */ });
+/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constants.js");
+/* harmony import */ var _startOfISOWeek_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./startOfISOWeek.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfISOWeek.js");
+/* harmony import */ var _startOfISOWeekYear_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./startOfISOWeekYear.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfISOWeekYear.js");
+/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
+
+
+
+
+
+/**
+ * The {@link getISOWeek} function options.
+ */
+
+/**
+ * @name getISOWeek
+ * @category ISO Week Helpers
+ * @summary Get the ISO week of the given date.
+ *
+ * @description
+ * Get the ISO week of the given date.
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * @param date - The given date
+ * @param options - The options
+ *
+ * @returns The ISO week
+ *
+ * @example
+ * // Which week of the ISO-week numbering year is 2 January 2005?
+ * const result = getISOWeek(new Date(2005, 0, 2))
+ * //=> 53
+ */
+function getISOWeek(date, options) {
+ const _date = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_3__.toDate)(date, options?.in);
+ const diff = +(0,_startOfISOWeek_js__WEBPACK_IMPORTED_MODULE_1__.startOfISOWeek)(_date) - +(0,_startOfISOWeekYear_js__WEBPACK_IMPORTED_MODULE_2__.startOfISOWeekYear)(_date);
+
+ // Round the number of weeks to the nearest integer because the number of
+ // milliseconds in a week is not constant (e.g. it's different in the week of
+ // the daylight saving time clock shift).
+ return Math.round(diff / _constants_js__WEBPACK_IMPORTED_MODULE_0__.millisecondsInWeek) + 1;
+}
+
+// Fallback for modularized imports:
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getISOWeek);
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/getISOWeekYear.js":
+/*!***********************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/getISOWeekYear.js ***!
+ \***********************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
+/* harmony export */ getISOWeekYear: () => (/* binding */ getISOWeekYear)
+/* harmony export */ });
+/* harmony import */ var _constructFrom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constructFrom.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constructFrom.js");
+/* harmony import */ var _startOfISOWeek_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./startOfISOWeek.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfISOWeek.js");
+/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
+
+
+
+
+/**
+ * The {@link getISOWeekYear} function options.
+ */
+
+/**
+ * @name getISOWeekYear
+ * @category ISO Week-Numbering Year Helpers
+ * @summary Get the ISO week-numbering year of the given date.
+ *
+ * @description
+ * Get the ISO week-numbering year of the given date,
+ * which always starts 3 days before the year's first Thursday.
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * @param date - The given date
+ *
+ * @returns The ISO week-numbering year
+ *
+ * @example
+ * // Which ISO-week numbering year is 2 January 2005?
+ * const result = getISOWeekYear(new Date(2005, 0, 2))
+ * //=> 2004
+ */
+function getISOWeekYear(date, options) {
+ const _date = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_2__.toDate)(date, options?.in);
+ const year = _date.getFullYear();
+
+ const fourthOfJanuaryOfNextYear = (0,_constructFrom_js__WEBPACK_IMPORTED_MODULE_0__.constructFrom)(_date, 0);
+ fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
+ fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
+ const startOfNextYear = (0,_startOfISOWeek_js__WEBPACK_IMPORTED_MODULE_1__.startOfISOWeek)(fourthOfJanuaryOfNextYear);
+
+ const fourthOfJanuaryOfThisYear = (0,_constructFrom_js__WEBPACK_IMPORTED_MODULE_0__.constructFrom)(_date, 0);
+ fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
+ fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
+ const startOfThisYear = (0,_startOfISOWeek_js__WEBPACK_IMPORTED_MODULE_1__.startOfISOWeek)(fourthOfJanuaryOfThisYear);
+
+ if (_date.getTime() >= startOfNextYear.getTime()) {
+ return year + 1;
+ } else if (_date.getTime() >= startOfThisYear.getTime()) {
+ return year;
+ } else {
+ return year - 1;
+ }
+}
+
+// Fallback for modularized imports:
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getISOWeekYear);
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/getWeek.js":
+/*!****************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/getWeek.js ***!
+ \****************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
+/* harmony export */ getWeek: () => (/* binding */ getWeek)
+/* harmony export */ });
+/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constants.js");
+/* harmony import */ var _startOfWeek_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./startOfWeek.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfWeek.js");
+/* harmony import */ var _startOfWeekYear_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./startOfWeekYear.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfWeekYear.js");
+/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
+
+
+
+
+
+/**
+ * The {@link getWeek} function options.
+ */
+
+/**
+ * @name getWeek
+ * @category Week Helpers
+ * @summary Get the local week index of the given date.
+ *
+ * @description
+ * Get the local week index of the given date.
+ * The exact calculation depends on the values of
+ * `options.weekStartsOn` (which is the index of the first day of the week)
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
+ * the first week of the week-numbering year)
+ *
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
+ *
+ * @param date - The given date
+ * @param options - An object with options
+ *
+ * @returns The week
+ *
+ * @example
+ * // Which week of the local week numbering year is 2 January 2005 with default options?
+ * const result = getWeek(new Date(2005, 0, 2))
+ * //=> 2
+ *
+ * @example
+ * // Which week of the local week numbering year is 2 January 2005,
+ * // if Monday is the first day of the week,
+ * // and the first week of the year always contains 4 January?
+ * const result = getWeek(new Date(2005, 0, 2), {
+ * weekStartsOn: 1,
+ * firstWeekContainsDate: 4
+ * })
+ * //=> 53
+ */
+function getWeek(date, options) {
+ const _date = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_3__.toDate)(date, options?.in);
+ const diff = +(0,_startOfWeek_js__WEBPACK_IMPORTED_MODULE_1__.startOfWeek)(_date, options) - +(0,_startOfWeekYear_js__WEBPACK_IMPORTED_MODULE_2__.startOfWeekYear)(_date, options);
+
+ // Round the number of weeks to the nearest integer because the number of
+ // milliseconds in a week is not constant (e.g. it's different in the week of
+ // the daylight saving time clock shift).
+ return Math.round(diff / _constants_js__WEBPACK_IMPORTED_MODULE_0__.millisecondsInWeek) + 1;
+}
+
+// Fallback for modularized imports:
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getWeek);
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/getWeekYear.js":
+/*!********************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/getWeekYear.js ***!
+ \********************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
+/* harmony export */ getWeekYear: () => (/* binding */ getWeekYear)
+/* harmony export */ });
+/* harmony import */ var _lib_defaultOptions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_lib/defaultOptions.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/defaultOptions.js");
+/* harmony import */ var _constructFrom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constructFrom.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constructFrom.js");
+/* harmony import */ var _startOfWeek_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./startOfWeek.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfWeek.js");
+/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
+
+
+
+
+
+/**
+ * The {@link getWeekYear} function options.
+ */
+
+/**
+ * @name getWeekYear
+ * @category Week-Numbering Year Helpers
+ * @summary Get the local week-numbering year of the given date.
+ *
+ * @description
+ * Get the local week-numbering year of the given date.
+ * The exact calculation depends on the values of
+ * `options.weekStartsOn` (which is the index of the first day of the week)
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
+ * the first week of the week-numbering year)
+ *
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
+ *
+ * @param date - The given date
+ * @param options - An object with options.
+ *
+ * @returns The local week-numbering year
+ *
+ * @example
+ * // Which week numbering year is 26 December 2004 with the default settings?
+ * const result = getWeekYear(new Date(2004, 11, 26))
+ * //=> 2005
+ *
+ * @example
+ * // Which week numbering year is 26 December 2004 if week starts on Saturday?
+ * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })
+ * //=> 2004
+ *
+ * @example
+ * // Which week numbering year is 26 December 2004 if the first week contains 4 January?
+ * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })
+ * //=> 2004
+ */
+function getWeekYear(date, options) {
+ const _date = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_3__.toDate)(date, options?.in);
+ const year = _date.getFullYear();
+
+ const defaultOptions = (0,_lib_defaultOptions_js__WEBPACK_IMPORTED_MODULE_0__.getDefaultOptions)();
+ const firstWeekContainsDate =
+ options?.firstWeekContainsDate ??
+ options?.locale?.options?.firstWeekContainsDate ??
+ defaultOptions.firstWeekContainsDate ??
+ defaultOptions.locale?.options?.firstWeekContainsDate ??
+ 1;
+
+ const firstWeekOfNextYear = (0,_constructFrom_js__WEBPACK_IMPORTED_MODULE_1__.constructFrom)(options?.in || date, 0);
+ firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
+ firstWeekOfNextYear.setHours(0, 0, 0, 0);
+ const startOfNextYear = (0,_startOfWeek_js__WEBPACK_IMPORTED_MODULE_2__.startOfWeek)(firstWeekOfNextYear, options);
+
+ const firstWeekOfThisYear = (0,_constructFrom_js__WEBPACK_IMPORTED_MODULE_1__.constructFrom)(options?.in || date, 0);
+ firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
+ firstWeekOfThisYear.setHours(0, 0, 0, 0);
+ const startOfThisYear = (0,_startOfWeek_js__WEBPACK_IMPORTED_MODULE_2__.startOfWeek)(firstWeekOfThisYear, options);
+
+ if (+_date >= +startOfNextYear) {
+ return year + 1;
+ } else if (+_date >= +startOfThisYear) {
+ return year;
+ } else {
+ return year - 1;
+ }
+}
+
+// Fallback for modularized imports:
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getWeekYear);
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/isDate.js":
+/*!***************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/isDate.js ***!
+ \***************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
+/* harmony export */ isDate: () => (/* binding */ isDate)
+/* harmony export */ });
+/**
+ * @name isDate
+ * @category Common Helpers
+ * @summary Is the given value a date?
+ *
+ * @description
+ * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
+ *
+ * @param value - The value to check
+ *
+ * @returns True if the given value is a date
+ *
+ * @example
+ * // For a valid date:
+ * const result = isDate(new Date())
+ * //=> true
+ *
+ * @example
+ * // For an invalid date:
+ * const result = isDate(new Date(NaN))
+ * //=> true
+ *
+ * @example
+ * // For some value:
+ * const result = isDate('2014-02-31')
+ * //=> false
+ *
+ * @example
+ * // For an object:
+ * const result = isDate({})
+ * //=> false
+ */
+function isDate(value) {
+ return (
+ value instanceof Date ||
+ (typeof value === "object" &&
+ Object.prototype.toString.call(value) === "[object Date]")
+ );
+}
+
+// Fallback for modularized imports:
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isDate);
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/isValid.js":
+/*!****************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/isValid.js ***!
+ \****************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
+/* harmony export */ isValid: () => (/* binding */ isValid)
+/* harmony export */ });
+/* harmony import */ var _isDate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/isDate.js");
+/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
+
+
+
+/**
+ * @name isValid
+ * @category Common Helpers
+ * @summary Is the given date valid?
+ *
+ * @description
+ * Returns false if argument is Invalid Date and true otherwise.
+ * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)
+ * Invalid Date is a Date, whose time value is NaN.
+ *
+ * Time value of Date: http://es5.github.io/#x15.9.1.1
+ *
+ * @param date - The date to check
+ *
+ * @returns The date is valid
+ *
+ * @example
+ * // For the valid date:
+ * const result = isValid(new Date(2014, 1, 31))
+ * //=> true
+ *
+ * @example
+ * // For the value, convertible into a date:
+ * const result = isValid(1393804800000)
+ * //=> true
+ *
+ * @example
+ * // For the invalid date:
+ * const result = isValid(new Date(''))
+ * //=> false
+ */
+function isValid(date) {
+ return !((!(0,_isDate_js__WEBPACK_IMPORTED_MODULE_0__.isDate)(date) && typeof date !== "number") || isNaN(+(0,_toDate_js__WEBPACK_IMPORTED_MODULE_1__.toDate)(date)));
+}
+
+// Fallback for modularized imports:
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isValid);
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildFormatLongFn.js":
+/*!**************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildFormatLongFn.js ***!
+ \**************************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ buildFormatLongFn: () => (/* binding */ buildFormatLongFn)
+/* harmony export */ });
+function buildFormatLongFn(args) {
+ return (options = {}) => {
+ // TODO: Remove String()
+ const width = options.width ? String(options.width) : args.defaultWidth;
+ const format = args.formats[width] || args.formats[args.defaultWidth];
+ return format;
+ };
+}
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildLocalizeFn.js":
+/*!************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildLocalizeFn.js ***!
+ \************************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ buildLocalizeFn: () => (/* binding */ buildLocalizeFn)
+/* harmony export */ });
+/**
+ * The localize function argument callback which allows to convert raw value to
+ * the actual type.
+ *
+ * @param value - The value to convert
+ *
+ * @returns The converted value
+ */
+
+/**
+ * The map of localized values for each width.
+ */
+
+/**
+ * The index type of the locale unit value. It types conversion of units of
+ * values that don't start at 0 (i.e. quarters).
+ */
+
+/**
+ * Converts the unit value to the tuple of values.
+ */
+
+/**
+ * The tuple of localized era values. The first element represents BC,
+ * the second element represents AD.
+ */
+
+/**
+ * The tuple of localized quarter values. The first element represents Q1.
+ */
+
+/**
+ * The tuple of localized day values. The first element represents Sunday.
+ */
+
+/**
+ * The tuple of localized month values. The first element represents January.
+ */
+
+function buildLocalizeFn(args) {
+ return (value, options) => {
+ const context = options?.context ? String(options.context) : "standalone";
+
+ let valuesArray;
+ if (context === "formatting" && args.formattingValues) {
+ const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
+ const width = options?.width ? String(options.width) : defaultWidth;
+
+ valuesArray =
+ args.formattingValues[width] || args.formattingValues[defaultWidth];
+ } else {
+ const defaultWidth = args.defaultWidth;
+ const width = options?.width ? String(options.width) : args.defaultWidth;
+
+ valuesArray = args.values[width] || args.values[defaultWidth];
+ }
+ const index = args.argumentCallback ? args.argumentCallback(value) : value;
+
+ // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
+ return valuesArray[index];
+ };
+}
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildMatchFn.js":
+/*!*********************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildMatchFn.js ***!
+ \*********************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ buildMatchFn: () => (/* binding */ buildMatchFn)
+/* harmony export */ });
+function buildMatchFn(args) {
+ return (string, options = {}) => {
+ const width = options.width;
+
+ const matchPattern =
+ (width && args.matchPatterns[width]) ||
+ args.matchPatterns[args.defaultMatchWidth];
+ const matchResult = string.match(matchPattern);
+
+ if (!matchResult) {
+ return null;
+ }
+ const matchedString = matchResult[0];
+
+ const parsePatterns =
+ (width && args.parsePatterns[width]) ||
+ args.parsePatterns[args.defaultParseWidth];
+
+ const key = Array.isArray(parsePatterns)
+ ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))
+ : // [TODO] -- I challenge you to fix the type
+ findKey(parsePatterns, (pattern) => pattern.test(matchedString));
+
+ let value;
+
+ value = args.valueCallback ? args.valueCallback(key) : key;
+ value = options.valueCallback
+ ? // [TODO] -- I challenge you to fix the type
+ options.valueCallback(value)
+ : value;
+
+ const rest = string.slice(matchedString.length);
+
+ return { value, rest };
+ };
+}
+
+function findKey(object, predicate) {
+ for (const key in object) {
+ if (
+ Object.prototype.hasOwnProperty.call(object, key) &&
+ predicate(object[key])
+ ) {
+ return key;
+ }
+ }
+ return undefined;
+}
+
+function findIndex(array, predicate) {
+ for (let key = 0; key < array.length; key++) {
+ if (predicate(array[key])) {
+ return key;
+ }
+ }
+ return undefined;
+}
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js":
+/*!****************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js ***!
+ \****************************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ buildMatchPatternFn: () => (/* binding */ buildMatchPatternFn)
+/* harmony export */ });
+function buildMatchPatternFn(args) {
+ return (string, options = {}) => {
+ const matchResult = string.match(args.matchPattern);
+ if (!matchResult) return null;
+ const matchedString = matchResult[0];
+
+ const parseResult = string.match(args.parsePattern);
+ if (!parseResult) return null;
+ let value = args.valueCallback
+ ? args.valueCallback(parseResult[0])
+ : parseResult[0];
+
+ // [TODO] I challenge you to fix the type
+ value = options.valueCallback ? options.valueCallback(value) : value;
+
+ const rest = string.slice(matchedString.length);
+
+ return { value, rest };
+ };
+}
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US.js":
+/*!*********************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US.js ***!
+ \*********************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
+/* harmony export */ enUS: () => (/* binding */ enUS)
+/* harmony export */ });
+/* harmony import */ var _en_US_lib_formatDistance_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./en-US/_lib/formatDistance.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/formatDistance.js");
+/* harmony import */ var _en_US_lib_formatLong_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./en-US/_lib/formatLong.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/formatLong.js");
+/* harmony import */ var _en_US_lib_formatRelative_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./en-US/_lib/formatRelative.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/formatRelative.js");
+/* harmony import */ var _en_US_lib_localize_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./en-US/_lib/localize.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/localize.js");
+/* harmony import */ var _en_US_lib_match_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./en-US/_lib/match.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/match.js");
+
+
+
+
+
+
+/**
+ * @category Locales
+ * @summary English locale (United States).
+ * @language English
+ * @iso-639-2 eng
+ * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
+ * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
+ */
+const enUS = {
+ code: "en-US",
+ formatDistance: _en_US_lib_formatDistance_js__WEBPACK_IMPORTED_MODULE_0__.formatDistance,
+ formatLong: _en_US_lib_formatLong_js__WEBPACK_IMPORTED_MODULE_1__.formatLong,
+ formatRelative: _en_US_lib_formatRelative_js__WEBPACK_IMPORTED_MODULE_2__.formatRelative,
+ localize: _en_US_lib_localize_js__WEBPACK_IMPORTED_MODULE_3__.localize,
+ match: _en_US_lib_match_js__WEBPACK_IMPORTED_MODULE_4__.match,
+ options: {
+ weekStartsOn: 0 /* Sunday */,
+ firstWeekContainsDate: 1,
+ },
+};
+
+// Fallback for modularized imports:
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (enUS);
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/formatDistance.js":
+/*!*****************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/formatDistance.js ***!
+ \*****************************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ formatDistance: () => (/* binding */ formatDistance)
+/* harmony export */ });
+const formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: "less than a second",
+ other: "less than {{count}} seconds",
+ },
+
+ xSeconds: {
+ one: "1 second",
+ other: "{{count}} seconds",
+ },
+
+ halfAMinute: "half a minute",
+
+ lessThanXMinutes: {
+ one: "less than a minute",
+ other: "less than {{count}} minutes",
+ },
+
+ xMinutes: {
+ one: "1 minute",
+ other: "{{count}} minutes",
+ },
+
+ aboutXHours: {
+ one: "about 1 hour",
+ other: "about {{count}} hours",
+ },
+
+ xHours: {
+ one: "1 hour",
+ other: "{{count}} hours",
+ },
+
+ xDays: {
+ one: "1 day",
+ other: "{{count}} days",
+ },
+
+ aboutXWeeks: {
+ one: "about 1 week",
+ other: "about {{count}} weeks",
+ },
+
+ xWeeks: {
+ one: "1 week",
+ other: "{{count}} weeks",
+ },
+
+ aboutXMonths: {
+ one: "about 1 month",
+ other: "about {{count}} months",
+ },
+
+ xMonths: {
+ one: "1 month",
+ other: "{{count}} months",
+ },
+
+ aboutXYears: {
+ one: "about 1 year",
+ other: "about {{count}} years",
+ },
+
+ xYears: {
+ one: "1 year",
+ other: "{{count}} years",
+ },
+
+ overXYears: {
+ one: "over 1 year",
+ other: "over {{count}} years",
+ },
+
+ almostXYears: {
+ one: "almost 1 year",
+ other: "almost {{count}} years",
+ },
+};
+
+const formatDistance = (token, count, options) => {
+ let result;
+
+ const tokenValue = formatDistanceLocale[token];
+ if (typeof tokenValue === "string") {
+ result = tokenValue;
+ } else if (count === 1) {
+ result = tokenValue.one;
+ } else {
+ result = tokenValue.other.replace("{{count}}", count.toString());
+ }
+
+ if (options?.addSuffix) {
+ if (options.comparison && options.comparison > 0) {
+ return "in " + result;
+ } else {
+ return result + " ago";
+ }
+ }
+
+ return result;
+};
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/formatLong.js":
+/*!*************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/formatLong.js ***!
+ \*************************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ formatLong: () => (/* binding */ formatLong)
+/* harmony export */ });
+/* harmony import */ var _lib_buildFormatLongFn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_lib/buildFormatLongFn.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildFormatLongFn.js");
+
+
+const dateFormats = {
+ full: "EEEE, MMMM do, y",
+ long: "MMMM do, y",
+ medium: "MMM d, y",
+ short: "MM/dd/yyyy",
+};
+
+const timeFormats = {
+ full: "h:mm:ss a zzzz",
+ long: "h:mm:ss a z",
+ medium: "h:mm:ss a",
+ short: "h:mm a",
+};
+
+const dateTimeFormats = {
+ full: "{{date}} 'at' {{time}}",
+ long: "{{date}} 'at' {{time}}",
+ medium: "{{date}}, {{time}}",
+ short: "{{date}}, {{time}}",
+};
+
+const formatLong = {
+ date: (0,_lib_buildFormatLongFn_js__WEBPACK_IMPORTED_MODULE_0__.buildFormatLongFn)({
+ formats: dateFormats,
+ defaultWidth: "full",
+ }),
+
+ time: (0,_lib_buildFormatLongFn_js__WEBPACK_IMPORTED_MODULE_0__.buildFormatLongFn)({
+ formats: timeFormats,
+ defaultWidth: "full",
+ }),
+
+ dateTime: (0,_lib_buildFormatLongFn_js__WEBPACK_IMPORTED_MODULE_0__.buildFormatLongFn)({
+ formats: dateTimeFormats,
+ defaultWidth: "full",
+ }),
+};
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/formatRelative.js":
+/*!*****************************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/formatRelative.js ***!
+ \*****************************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ formatRelative: () => (/* binding */ formatRelative)
+/* harmony export */ });
+const formatRelativeLocale = {
+ lastWeek: "'last' eeee 'at' p",
+ yesterday: "'yesterday at' p",
+ today: "'today at' p",
+ tomorrow: "'tomorrow at' p",
+ nextWeek: "eeee 'at' p",
+ other: "P",
+};
+
+const formatRelative = (token, _date, _baseDate, _options) =>
+ formatRelativeLocale[token];
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/localize.js":
+/*!***********************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/localize.js ***!
+ \***********************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ localize: () => (/* binding */ localize)
+/* harmony export */ });
+/* harmony import */ var _lib_buildLocalizeFn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_lib/buildLocalizeFn.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildLocalizeFn.js");
+
+
+const eraValues = {
+ narrow: ["B", "A"],
+ abbreviated: ["BC", "AD"],
+ wide: ["Before Christ", "Anno Domini"],
+};
+
+const quarterValues = {
+ narrow: ["1", "2", "3", "4"],
+ abbreviated: ["Q1", "Q2", "Q3", "Q4"],
+ wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"],
+};
+
+// Note: in English, the names of days of the week and months are capitalized.
+// If you are making a new locale based on this one, check if the same is true for the language you're working on.
+// Generally, formatted dates should look like they are in the middle of a sentence,
+// e.g. in Spanish language the weekdays and months should be in the lowercase.
+const monthValues = {
+ narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
+ abbreviated: [
+ "Jan",
+ "Feb",
+ "Mar",
+ "Apr",
+ "May",
+ "Jun",
+ "Jul",
+ "Aug",
+ "Sep",
+ "Oct",
+ "Nov",
+ "Dec",
+ ],
+
+ wide: [
+ "January",
+ "February",
+ "March",
+ "April",
+ "May",
+ "June",
+ "July",
+ "August",
+ "September",
+ "October",
+ "November",
+ "December",
+ ],
+};
+
+const dayValues = {
+ narrow: ["S", "M", "T", "W", "T", "F", "S"],
+ short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
+ abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
+ wide: [
+ "Sunday",
+ "Monday",
+ "Tuesday",
+ "Wednesday",
+ "Thursday",
+ "Friday",
+ "Saturday",
+ ],
+};
+
+const dayPeriodValues = {
+ narrow: {
+ am: "a",
+ pm: "p",
+ midnight: "mi",
+ noon: "n",
+ morning: "morning",
+ afternoon: "afternoon",
+ evening: "evening",
+ night: "night",
+ },
+ abbreviated: {
+ am: "AM",
+ pm: "PM",
+ midnight: "midnight",
+ noon: "noon",
+ morning: "morning",
+ afternoon: "afternoon",
+ evening: "evening",
+ night: "night",
+ },
+ wide: {
+ am: "a.m.",
+ pm: "p.m.",
+ midnight: "midnight",
+ noon: "noon",
+ morning: "morning",
+ afternoon: "afternoon",
+ evening: "evening",
+ night: "night",
+ },
+};
+
+const formattingDayPeriodValues = {
+ narrow: {
+ am: "a",
+ pm: "p",
+ midnight: "mi",
+ noon: "n",
+ morning: "in the morning",
+ afternoon: "in the afternoon",
+ evening: "in the evening",
+ night: "at night",
+ },
+ abbreviated: {
+ am: "AM",
+ pm: "PM",
+ midnight: "midnight",
+ noon: "noon",
+ morning: "in the morning",
+ afternoon: "in the afternoon",
+ evening: "in the evening",
+ night: "at night",
+ },
+ wide: {
+ am: "a.m.",
+ pm: "p.m.",
+ midnight: "midnight",
+ noon: "noon",
+ morning: "in the morning",
+ afternoon: "in the afternoon",
+ evening: "in the evening",
+ night: "at night",
+ },
+};
+
+const ordinalNumber = (dirtyNumber, _options) => {
+ const number = Number(dirtyNumber);
+
+ // If ordinal numbers depend on context, for example,
+ // if they are different for different grammatical genders,
+ // use `options.unit`.
+ //
+ // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
+ // 'day', 'hour', 'minute', 'second'.
+
+ const rem100 = number % 100;
+ if (rem100 > 20 || rem100 < 10) {
+ switch (rem100 % 10) {
+ case 1:
+ return number + "st";
+ case 2:
+ return number + "nd";
+ case 3:
+ return number + "rd";
+ }
+ }
+ return number + "th";
+};
+
+const localize = {
+ ordinalNumber,
+
+ era: (0,_lib_buildLocalizeFn_js__WEBPACK_IMPORTED_MODULE_0__.buildLocalizeFn)({
+ values: eraValues,
+ defaultWidth: "wide",
+ }),
+
+ quarter: (0,_lib_buildLocalizeFn_js__WEBPACK_IMPORTED_MODULE_0__.buildLocalizeFn)({
+ values: quarterValues,
+ defaultWidth: "wide",
+ argumentCallback: (quarter) => quarter - 1,
+ }),
+
+ month: (0,_lib_buildLocalizeFn_js__WEBPACK_IMPORTED_MODULE_0__.buildLocalizeFn)({
+ values: monthValues,
+ defaultWidth: "wide",
+ }),
+
+ day: (0,_lib_buildLocalizeFn_js__WEBPACK_IMPORTED_MODULE_0__.buildLocalizeFn)({
+ values: dayValues,
+ defaultWidth: "wide",
+ }),
+
+ dayPeriod: (0,_lib_buildLocalizeFn_js__WEBPACK_IMPORTED_MODULE_0__.buildLocalizeFn)({
+ values: dayPeriodValues,
+ defaultWidth: "wide",
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: "wide",
+ }),
+};
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/match.js":
+/*!********************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/match.js ***!
+ \********************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ match: () => (/* binding */ match)
+/* harmony export */ });
+/* harmony import */ var _lib_buildMatchFn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_lib/buildMatchFn.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildMatchFn.js");
+/* harmony import */ var _lib_buildMatchPatternFn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../_lib/buildMatchPatternFn.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js");
+
+
+
+const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
+const parseOrdinalNumberPattern = /\d+/i;
+
+const matchEraPatterns = {
+ narrow: /^(b|a)/i,
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
+ wide: /^(before christ|before common era|anno domini|common era)/i,
+};
+const parseEraPatterns = {
+ any: [/^b/i, /^(a|c)/i],
+};
+
+const matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^q[1234]/i,
+ wide: /^[1234](th|st|nd|rd)? quarter/i,
+};
+const parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i],
+};
+
+const matchMonthPatterns = {
+ narrow: /^[jfmasond]/i,
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,
+};
+const parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i,
+ ],
+
+ any: [
+ /^ja/i,
+ /^f/i,
+ /^mar/i,
+ /^ap/i,
+ /^may/i,
+ /^jun/i,
+ /^jul/i,
+ /^au/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i,
+ ],
+};
+
+const matchDayPatterns = {
+ narrow: /^[smtwf]/i,
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,
+};
+const parseDayPatterns = {
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],
+};
+
+const matchDayPeriodPatterns = {
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,
+};
+const parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^mi/i,
+ noon: /^no/i,
+ morning: /morning/i,
+ afternoon: /afternoon/i,
+ evening: /evening/i,
+ night: /night/i,
+ },
+};
+
+const match = {
+ ordinalNumber: (0,_lib_buildMatchPatternFn_js__WEBPACK_IMPORTED_MODULE_1__.buildMatchPatternFn)({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: (value) => parseInt(value, 10),
+ }),
+
+ era: (0,_lib_buildMatchFn_js__WEBPACK_IMPORTED_MODULE_0__.buildMatchFn)({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: "wide",
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: "any",
+ }),
+
+ quarter: (0,_lib_buildMatchFn_js__WEBPACK_IMPORTED_MODULE_0__.buildMatchFn)({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: "wide",
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: "any",
+ valueCallback: (index) => index + 1,
+ }),
+
+ month: (0,_lib_buildMatchFn_js__WEBPACK_IMPORTED_MODULE_0__.buildMatchFn)({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: "wide",
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: "any",
+ }),
+
+ day: (0,_lib_buildMatchFn_js__WEBPACK_IMPORTED_MODULE_0__.buildMatchFn)({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: "wide",
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: "any",
+ }),
+
+ dayPeriod: (0,_lib_buildMatchFn_js__WEBPACK_IMPORTED_MODULE_0__.buildMatchFn)({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: "any",
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: "any",
+ }),
+};
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfDay.js":
+/*!*******************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfDay.js ***!
+ \*******************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
+/* harmony export */ startOfDay: () => (/* binding */ startOfDay)
+/* harmony export */ });
+/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
+
+
+/**
+ * The {@link startOfDay} function options.
+ */
+
+/**
+ * @name startOfDay
+ * @category Day Helpers
+ * @summary Return the start of a day for the given date.
+ *
+ * @description
+ * Return the start of a day for the given date.
+ * The result will be in the local timezone.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The original date
+ * @param options - The options
+ *
+ * @returns The start of a day
+ *
+ * @example
+ * // The start of a day for 2 September 2014 11:55:00:
+ * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
+ * //=> Tue Sep 02 2014 00:00:00
+ */
+function startOfDay(date, options) {
+ const _date = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_0__.toDate)(date, options?.in);
+ _date.setHours(0, 0, 0, 0);
+ return _date;
+}
+
+// Fallback for modularized imports:
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (startOfDay);
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfISOWeek.js":
+/*!***********************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfISOWeek.js ***!
+ \***********************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
+/* harmony export */ startOfISOWeek: () => (/* binding */ startOfISOWeek)
+/* harmony export */ });
+/* harmony import */ var _startOfWeek_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./startOfWeek.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfWeek.js");
+
+
+/**
+ * The {@link startOfISOWeek} function options.
+ */
+
+/**
+ * @name startOfISOWeek
+ * @category ISO Week Helpers
+ * @summary Return the start of an ISO week for the given date.
+ *
+ * @description
+ * Return the start of an ISO week for the given date.
+ * The result will be in the local timezone.
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The original date
+ * @param options - An object with options
+ *
+ * @returns The start of an ISO week
+ *
+ * @example
+ * // The start of an ISO week for 2 September 2014 11:55:00:
+ * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
+ * //=> Mon Sep 01 2014 00:00:00
+ */
+function startOfISOWeek(date, options) {
+ return (0,_startOfWeek_js__WEBPACK_IMPORTED_MODULE_0__.startOfWeek)(date, { ...options, weekStartsOn: 1 });
+}
+
+// Fallback for modularized imports:
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (startOfISOWeek);
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfISOWeekYear.js":
+/*!***************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfISOWeekYear.js ***!
+ \***************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
+/* harmony export */ startOfISOWeekYear: () => (/* binding */ startOfISOWeekYear)
+/* harmony export */ });
+/* harmony import */ var _constructFrom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constructFrom.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constructFrom.js");
+/* harmony import */ var _getISOWeekYear_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getISOWeekYear.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/getISOWeekYear.js");
+/* harmony import */ var _startOfISOWeek_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./startOfISOWeek.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfISOWeek.js");
+
+
+
+
+/**
+ * The {@link startOfISOWeekYear} function options.
+ */
+
+/**
+ * @name startOfISOWeekYear
+ * @category ISO Week-Numbering Year Helpers
+ * @summary Return the start of an ISO week-numbering year for the given date.
+ *
+ * @description
+ * Return the start of an ISO week-numbering year,
+ * which always starts 3 days before the year's first Thursday.
+ * The result will be in the local timezone.
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The original date
+ * @param options - An object with options
+ *
+ * @returns The start of an ISO week-numbering year
+ *
+ * @example
+ * // The start of an ISO week-numbering year for 2 July 2005:
+ * const result = startOfISOWeekYear(new Date(2005, 6, 2))
+ * //=> Mon Jan 03 2005 00:00:00
+ */
+function startOfISOWeekYear(date, options) {
+ const year = (0,_getISOWeekYear_js__WEBPACK_IMPORTED_MODULE_1__.getISOWeekYear)(date, options);
+ const fourthOfJanuary = (0,_constructFrom_js__WEBPACK_IMPORTED_MODULE_0__.constructFrom)(options?.in || date, 0);
+ fourthOfJanuary.setFullYear(year, 0, 4);
+ fourthOfJanuary.setHours(0, 0, 0, 0);
+ return (0,_startOfISOWeek_js__WEBPACK_IMPORTED_MODULE_2__.startOfISOWeek)(fourthOfJanuary);
+}
+
+// Fallback for modularized imports:
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (startOfISOWeekYear);
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfMonth.js":
+/*!*********************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfMonth.js ***!
+ \*********************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
+/* harmony export */ startOfMonth: () => (/* binding */ startOfMonth)
+/* harmony export */ });
+/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
+
+
+/**
+ * The {@link startOfMonth} function options.
+ */
+
+/**
+ * @name startOfMonth
+ * @category Month Helpers
+ * @summary Return the start of a month for the given date.
+ *
+ * @description
+ * Return the start of a month for the given date. The result will be in the local timezone.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments.
+ * Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed,
+ * or inferred from the arguments.
+ *
+ * @param date - The original date
+ * @param options - An object with options
+ *
+ * @returns The start of a month
+ *
+ * @example
+ * // The start of a month for 2 September 2014 11:55:00:
+ * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
+ * //=> Mon Sep 01 2014 00:00:00
+ */
+function startOfMonth(date, options) {
+ const _date = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_0__.toDate)(date, options?.in);
+ _date.setDate(1);
+ _date.setHours(0, 0, 0, 0);
+ return _date;
+}
+
+// Fallback for modularized imports:
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (startOfMonth);
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfWeek.js":
+/*!********************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfWeek.js ***!
+ \********************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
+/* harmony export */ startOfWeek: () => (/* binding */ startOfWeek)
+/* harmony export */ });
+/* harmony import */ var _lib_defaultOptions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_lib/defaultOptions.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/defaultOptions.js");
+/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
+
+
+
+/**
+ * The {@link startOfWeek} function options.
+ */
+
+/**
+ * @name startOfWeek
+ * @category Week Helpers
+ * @summary Return the start of a week for the given date.
+ *
+ * @description
+ * Return the start of a week for the given date.
+ * The result will be in the local timezone.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The original date
+ * @param options - An object with options
+ *
+ * @returns The start of a week
+ *
+ * @example
+ * // The start of a week for 2 September 2014 11:55:00:
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
+ * //=> Sun Aug 31 2014 00:00:00
+ *
+ * @example
+ * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
+ * //=> Mon Sep 01 2014 00:00:00
+ */
+function startOfWeek(date, options) {
+ const defaultOptions = (0,_lib_defaultOptions_js__WEBPACK_IMPORTED_MODULE_0__.getDefaultOptions)();
+ const weekStartsOn =
+ options?.weekStartsOn ??
+ options?.locale?.options?.weekStartsOn ??
+ defaultOptions.weekStartsOn ??
+ defaultOptions.locale?.options?.weekStartsOn ??
+ 0;
+
+ const _date = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_1__.toDate)(date, options?.in);
+ const day = _date.getDay();
+ const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
+
+ _date.setDate(_date.getDate() - diff);
+ _date.setHours(0, 0, 0, 0);
+ return _date;
+}
+
+// Fallback for modularized imports:
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (startOfWeek);
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfWeekYear.js":
+/*!************************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfWeekYear.js ***!
+ \************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
+/* harmony export */ startOfWeekYear: () => (/* binding */ startOfWeekYear)
+/* harmony export */ });
+/* harmony import */ var _lib_defaultOptions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_lib/defaultOptions.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/defaultOptions.js");
+/* harmony import */ var _constructFrom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constructFrom.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constructFrom.js");
+/* harmony import */ var _getWeekYear_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getWeekYear.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/getWeekYear.js");
+/* harmony import */ var _startOfWeek_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./startOfWeek.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfWeek.js");
+
+
+
+
+
+/**
+ * The {@link startOfWeekYear} function options.
+ */
+
+/**
+ * @name startOfWeekYear
+ * @category Week-Numbering Year Helpers
+ * @summary Return the start of a local week-numbering year for the given date.
+ *
+ * @description
+ * Return the start of a local week-numbering year.
+ * The exact calculation depends on the values of
+ * `options.weekStartsOn` (which is the index of the first day of the week)
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
+ * the first week of the week-numbering year)
+ *
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type.
+ *
+ * @param date - The original date
+ * @param options - An object with options
+ *
+ * @returns The start of a week-numbering year
+ *
+ * @example
+ * // The start of an a week-numbering year for 2 July 2005 with default settings:
+ * const result = startOfWeekYear(new Date(2005, 6, 2))
+ * //=> Sun Dec 26 2004 00:00:00
+ *
+ * @example
+ * // The start of a week-numbering year for 2 July 2005
+ * // if Monday is the first day of week
+ * // and 4 January is always in the first week of the year:
+ * const result = startOfWeekYear(new Date(2005, 6, 2), {
+ * weekStartsOn: 1,
+ * firstWeekContainsDate: 4
+ * })
+ * //=> Mon Jan 03 2005 00:00:00
+ */
+function startOfWeekYear(date, options) {
+ const defaultOptions = (0,_lib_defaultOptions_js__WEBPACK_IMPORTED_MODULE_0__.getDefaultOptions)();
+ const firstWeekContainsDate =
+ options?.firstWeekContainsDate ??
+ options?.locale?.options?.firstWeekContainsDate ??
+ defaultOptions.firstWeekContainsDate ??
+ defaultOptions.locale?.options?.firstWeekContainsDate ??
+ 1;
+
+ const year = (0,_getWeekYear_js__WEBPACK_IMPORTED_MODULE_2__.getWeekYear)(date, options);
+ const firstWeek = (0,_constructFrom_js__WEBPACK_IMPORTED_MODULE_1__.constructFrom)(options?.in || date, 0);
+ firstWeek.setFullYear(year, 0, firstWeekContainsDate);
+ firstWeek.setHours(0, 0, 0, 0);
+ const _date = (0,_startOfWeek_js__WEBPACK_IMPORTED_MODULE_3__.startOfWeek)(firstWeek, options);
+ return _date;
+}
+
+// Fallback for modularized imports:
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (startOfWeekYear);
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfYear.js":
+/*!********************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfYear.js ***!
+ \********************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
+/* harmony export */ startOfYear: () => (/* binding */ startOfYear)
+/* harmony export */ });
+/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
+
+
+/**
+ * The {@link startOfYear} function options.
+ */
+
+/**
+ * @name startOfYear
+ * @category Year Helpers
+ * @summary Return the start of a year for the given date.
+ *
+ * @description
+ * Return the start of a year for the given date.
+ * The result will be in the local timezone.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The original date
+ * @param options - The options
+ *
+ * @returns The start of a year
+ *
+ * @example
+ * // The start of a year for 2 September 2014 11:55:00:
+ * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
+ * //=> Wed Jan 01 2014 00:00:00
+ */
+function startOfYear(date, options) {
+ const date_ = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_0__.toDate)(date, options?.in);
+ date_.setFullYear(date_.getFullYear(), 0, 1);
+ date_.setHours(0, 0, 0, 0);
+ return date_;
+}
+
+// Fallback for modularized imports:
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (startOfYear);
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/subDays.js":
+/*!****************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/subDays.js ***!
+ \****************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
+/* harmony export */ subDays: () => (/* binding */ subDays)
+/* harmony export */ });
+/* harmony import */ var _addDays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./addDays.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/addDays.js");
+
+
+/**
+ * The {@link subDays} function options.
+ */
+
+/**
+ * @name subDays
+ * @category Day Helpers
+ * @summary Subtract the specified number of days from the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of days to be subtracted.
+ * @param options - An object with options
+ *
+ * @returns The new date with the days subtracted
+ *
+ * @example
+ * // Subtract 10 days from 1 September 2014:
+ * const result = subDays(new Date(2014, 8, 1), 10)
+ * //=> Fri Aug 22 2014 00:00:00
+ */
+function subDays(date, amount, options) {
+ return (0,_addDays_js__WEBPACK_IMPORTED_MODULE_0__.addDays)(date, -amount, options);
+}
+
+// Fallback for modularized imports:
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (subDays);
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/subMonths.js":
+/*!******************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/subMonths.js ***!
+ \******************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
+/* harmony export */ subMonths: () => (/* binding */ subMonths)
+/* harmony export */ });
+/* harmony import */ var _addMonths_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./addMonths.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/addMonths.js");
+
+
+/**
+ * The subMonths function options.
+ */
+
+/**
+ * @name subMonths
+ * @category Month Helpers
+ * @summary Subtract the specified number of months from the given date.
+ *
+ * @description
+ * Subtract the specified number of months from the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of months to be subtracted.
+ * @param options - An object with options
+ *
+ * @returns The new date with the months subtracted
+ *
+ * @example
+ * // Subtract 5 months from 1 February 2015:
+ * const result = subMonths(new Date(2015, 1, 1), 5)
+ * //=> Mon Sep 01 2014 00:00:00
+ */
+function subMonths(date, amount, options) {
+ return (0,_addMonths_js__WEBPACK_IMPORTED_MODULE_0__.addMonths)(date, -amount, options);
+}
+
+// Fallback for modularized imports:
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (subMonths);
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/subYears.js":
+/*!*****************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/subYears.js ***!
+ \*****************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
+/* harmony export */ subYears: () => (/* binding */ subYears)
+/* harmony export */ });
+/* harmony import */ var _addYears_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./addYears.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/addYears.js");
+
+
+/**
+ * The {@link subYears} function options.
+ */
+
+/**
+ * @name subYears
+ * @category Year Helpers
+ * @summary Subtract the specified number of years from the given date.
+ *
+ * @description
+ * Subtract the specified number of years from the given date.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param date - The date to be changed
+ * @param amount - The amount of years to be subtracted.
+ * @param options - An object with options
+ *
+ * @returns The new date with the years subtracted
+ *
+ * @example
+ * // Subtract 5 years from 1 September 2014:
+ * const result = subYears(new Date(2014, 8, 1), 5)
+ * //=> Tue Sep 01 2009 00:00:00
+ */
+function subYears(date, amount, options) {
+ return (0,_addYears_js__WEBPACK_IMPORTED_MODULE_0__.addYears)(date, -amount, options);
+}
+
+// Fallback for modularized imports:
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (subYears);
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js":
+/*!***************************************************************************!*\
+ !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js ***!
+ \***************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
+/* harmony export */ toDate: () => (/* binding */ toDate)
+/* harmony export */ });
+/* harmony import */ var _constructFrom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constructFrom.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constructFrom.js");
+
+
+/**
+ * @name toDate
+ * @category Common Helpers
+ * @summary Convert the given argument to an instance of Date.
+ *
+ * @description
+ * Convert the given argument to an instance of Date.
+ *
+ * If the argument is an instance of Date, the function returns its clone.
+ *
+ * If the argument is a number, it is treated as a timestamp.
+ *
+ * If the argument is none of the above, the function returns Invalid Date.
+ *
+ * Starting from v3.7.0, it clones a date using `[Symbol.for("constructDateFrom")]`
+ * enabling to transfer extra properties from the reference date to the new date.
+ * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
+ * that accept a time zone as a constructor argument.
+ *
+ * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
+ *
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
+ *
+ * @param argument - The value to convert
+ *
+ * @returns The parsed date in the local time zone
+ *
+ * @example
+ * // Clone the date:
+ * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
+ * //=> Tue Feb 11 2014 11:30:30
+ *
+ * @example
+ * // Convert the timestamp to date:
+ * const result = toDate(1392098430000)
+ * //=> Tue Feb 11 2014 11:30:30
+ */
+function toDate(argument, context) {
+ // [TODO] Get rid of `toDate` or `constructFrom`?
+ return (0,_constructFrom_js__WEBPACK_IMPORTED_MODULE_0__.constructFrom)(context || argument, argument);
+}
+
+// Fallback for modularized imports:
+/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (toDate);
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/arrow-down.js":
+/*!**************************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/arrow-down.js ***!
+ \**************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ arrow_down_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/arrow-down.tsx
+
+
+var arrow_down_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z" }) });
+
+//# sourceMappingURL=arrow-down.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/arrow-left.js":
+/*!**************************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/arrow-left.js ***!
+ \**************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ arrow_left_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/arrow-left.tsx
+
+
+var arrow_left_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z" }) });
+
+//# sourceMappingURL=arrow-left.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/arrow-right.js":
+/*!***************************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/arrow-right.js ***!
+ \***************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ arrow_right_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/arrow-right.tsx
+
+
+var arrow_right_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z" }) });
+
+//# sourceMappingURL=arrow-right.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/arrow-up.js":
+/*!************************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/arrow-up.js ***!
+ \************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ arrow_up_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/arrow-up.tsx
+
+
+var arrow_up_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M12 3.9 6.5 9.5l1 1 3.8-3.7V20h1.5V6.8l3.7 3.7 1-1z" }) });
+
+//# sourceMappingURL=arrow-up.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/at-symbol.js":
+/*!*************************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/at-symbol.js ***!
+ \*************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ at_symbol_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/at-symbol.tsx
+
+
+var at_symbol_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M12.5939 21C14.1472 21 16.1269 20.5701 17.0711 20.1975L16.6447 18.879C16.0964 19.051 14.3299 19.6242 12.6548 19.6242C7.4467 19.6242 4.67513 16.8726 4.67513 12C4.67513 7.21338 7.50762 4.34713 12.2893 4.34713C17.132 4.34713 19.4162 7.55732 19.4162 10.7675C19.4162 14.035 19.0508 15.4968 17.4975 15.4968C16.5838 15.4968 16.0964 14.7803 16.0964 13.9777V7.5H14.4822V8.30255H14.3909C14.1777 7.67198 12.9898 7.12739 11.467 7.2707C9.18274 7.5 7.4467 9.27707 7.4467 11.8567C7.4467 14.5796 8.81726 16.672 11.467 16.758C13.203 16.8153 14.1168 16.0127 14.4822 15.1815H14.5736C14.7563 16.414 16.401 16.8439 17.467 16.8439C20.6954 16.8439 21 13.5764 21 10.7962C21 6.86943 18.0761 3 12.3807 3C6.50254 3 3 6.3535 3 11.9427C3 17.7325 6.38071 21 12.5939 21ZM11.7107 15.2962C9.73096 15.2962 9.03046 13.6051 9.03046 11.7707C9.03046 10.1083 10.0355 8.67516 11.7716 8.67516C13.599 8.67516 14.5736 9.36306 14.5736 11.7707C14.5736 14.1497 13.7513 15.2962 11.7107 15.2962Z" }) });
+
+//# sourceMappingURL=at-symbol.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/block-table.js":
+/*!***************************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/block-table.js ***!
+ \***************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ block_table_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/block-table.tsx
+
+
+var block_table_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z" }) });
+
+//# sourceMappingURL=block-table.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/category.js":
+/*!************************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/category.js ***!
+ \************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ category_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/category.tsx
+
+
+var category_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(
+ _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path,
+ {
+ d: "M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",
+ fillRule: "evenodd",
+ clipRule: "evenodd"
+ }
+) });
+
+//# sourceMappingURL=category.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/check.js":
+/*!*********************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/check.js ***!
+ \*********************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ check_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/check.tsx
+
+
+var check_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" }) });
+
+//# sourceMappingURL=check.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/chevron-left.js":
+/*!****************************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/chevron-left.js ***!
+ \****************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ chevron_left_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/chevron-left.tsx
+
+
+var chevron_left_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" }) });
+
+//# sourceMappingURL=chevron-left.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/chevron-right.js":
+/*!*****************************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/chevron-right.js ***!
+ \*****************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ chevron_right_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/chevron-right.tsx
+
+
+var chevron_right_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" }) });
+
+//# sourceMappingURL=chevron-right.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/close-small.js":
+/*!***************************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/close-small.js ***!
+ \***************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ close_small_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/close-small.tsx
+
+
+var close_small_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.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" }) });
+
+//# sourceMappingURL=close-small.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/close.js":
+/*!*********************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/close.js ***!
+ \*********************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ close_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/close.tsx
+
+
+var close_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z" }) });
+
+//# sourceMappingURL=close.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/cog.js":
+/*!*******************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/cog.js ***!
+ \*******************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ cog_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/cog.tsx
+
+
+var cog_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(
+ _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path,
+ {
+ fillRule: "evenodd",
+ d: "M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",
+ clipRule: "evenodd"
+ }
+) });
+
+//# sourceMappingURL=cog.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/error.js":
+/*!*********************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/error.js ***!
+ \*********************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ error_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/error.tsx
+
+
+var error_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(
+ _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path,
+ {
+ fillRule: "evenodd",
+ clipRule: "evenodd",
+ d: "M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z"
+ }
+) });
+
+//# sourceMappingURL=error.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/format-list-bullets-rtl.js":
+/*!***************************************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/format-list-bullets-rtl.js ***!
+ \***************************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ format_list_bullets_rtl_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/format-list-bullets-rtl.tsx
+
+
+var format_list_bullets_rtl_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z" }) });
+
+//# sourceMappingURL=format-list-bullets-rtl.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/format-list-bullets.js":
+/*!***********************************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/format-list-bullets.js ***!
+ \***********************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ format_list_bullets_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/format-list-bullets.tsx
+
+
+var format_list_bullets_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" }) });
+
+//# sourceMappingURL=format-list-bullets.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/funnel.js":
+/*!**********************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/funnel.js ***!
+ \**********************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ funnel_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/funnel.tsx
+
+
+var funnel_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z" }) });
+
+//# sourceMappingURL=funnel.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/link.js":
+/*!********************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/link.js ***!
+ \********************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ link_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/link.tsx
+
+
+var link_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.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" }) });
+
+//# sourceMappingURL=link.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/mobile.js":
+/*!**********************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/mobile.js ***!
+ \**********************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ mobile_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/mobile.tsx
+
+
+var mobile_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z" }) });
+
+//# sourceMappingURL=mobile.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/more-vertical.js":
+/*!*****************************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/more-vertical.js ***!
+ \*****************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ more_vertical_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/more-vertical.tsx
+
+
+var more_vertical_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" }) });
+
+//# sourceMappingURL=more-vertical.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/next.js":
+/*!********************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/next.js ***!
+ \********************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ next_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/next.tsx
+
+
+var next_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z" }) });
+
+//# sourceMappingURL=next.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/previous.js":
+/*!************************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/previous.js ***!
+ \************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ previous_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/previous.tsx
+
+
+var previous_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z" }) });
+
+//# sourceMappingURL=previous.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/search.js":
+/*!**********************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/search.js ***!
+ \**********************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ search_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/search.tsx
+
+
+var search_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.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" }) });
+
+//# sourceMappingURL=search.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/seen.js":
+/*!********************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/seen.js ***!
+ \********************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ seen_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/seen.tsx
+
+
+var seen_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z" }) });
+
+//# sourceMappingURL=seen.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/unseen.js":
+/*!**********************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/unseen.js ***!
+ \**********************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ unseen_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/unseen.tsx
+
+
+var unseen_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M20.7 12.7s0-.1-.1-.2c0-.2-.2-.4-.4-.6-.3-.5-.9-1.2-1.6-1.8-.7-.6-1.5-1.3-2.6-1.8l-.6 1.4c.9.4 1.6 1 2.1 1.5.6.6 1.1 1.2 1.4 1.6.1.2.3.4.3.5v.1l.7-.3.7-.3Zm-5.2-9.3-1.8 4c-.5-.1-1.1-.2-1.7-.2-3 0-5.2 1.4-6.6 2.7-.7.7-1.2 1.3-1.6 1.8-.2.3-.3.5-.4.6 0 0 0 .1-.1.2s0 0 .7.3l.7.3V13c0-.1.2-.3.3-.5.3-.4.7-1 1.4-1.6 1.2-1.2 3-2.3 5.5-2.3H13v.3c-.4 0-.8-.1-1.1-.1-1.9 0-3.5 1.6-3.5 3.5s.6 2.3 1.6 2.9l-2 4.4.9.4 7.6-16.2-.9-.4Zm-3 12.6c1.7-.2 3-1.7 3-3.5s-.2-1.4-.6-1.9L12.4 16Z" }) });
+
+//# sourceMappingURL=unseen.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/icons/build-module/library/wordpress.js":
+/*!*************************************************************************!*\
+ !*** ./node_modules/@wordpress/icons/build-module/library/wordpress.js ***!
+ \*************************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "default": () => (/* binding */ wordpress_default)
+/* harmony export */ });
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
+// packages/icons/src/library/wordpress.tsx
+
+
+var wordpress_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -2 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z" }) });
+
+//# sourceMappingURL=wordpress.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/views/build-module/index.js":
+/*!*************************************************************!*\
+ !*** ./node_modules/@wordpress/views/build-module/index.js ***!
+ \*************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ loadView: () => (/* reexport safe */ _load_view__WEBPACK_IMPORTED_MODULE_1__.loadView),
+/* harmony export */ useView: () => (/* reexport safe */ _use_view__WEBPACK_IMPORTED_MODULE_0__.useView)
+/* harmony export */ });
+/* harmony import */ var _use_view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./use-view */ "./node_modules/@wordpress/views/build-module/use-view.js");
+/* harmony import */ var _load_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./load-view */ "./node_modules/@wordpress/views/build-module/load-view.js");
+// packages/views/src/index.ts
+
+
+
+//# sourceMappingURL=index.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/views/build-module/load-view.js":
+/*!*****************************************************************!*\
+ !*** ./node_modules/@wordpress/views/build-module/load-view.js ***!
+ \*****************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ loadView: () => (/* binding */ loadView)
+/* harmony export */ });
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_preferences__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/preferences */ "@wordpress/preferences");
+/* harmony import */ var _wordpress_preferences__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_preferences__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _preference_keys__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./preference-keys */ "./node_modules/@wordpress/views/build-module/preference-keys.js");
+// packages/views/src/load-view.ts
+
+
+
+async function loadView(config) {
+ const { kind, name, slug, defaultView, queryParams } = config;
+ const preferenceKey = (0,_preference_keys__WEBPACK_IMPORTED_MODULE_2__.generatePreferenceKey)(kind, name, slug);
+ const persistedView = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_wordpress_preferences__WEBPACK_IMPORTED_MODULE_1__.store).get(
+ "core/views",
+ preferenceKey
+ );
+ const baseView = persistedView ?? defaultView;
+ const page = queryParams?.page ?? 1;
+ const search = queryParams?.search ?? "";
+ return {
+ ...baseView,
+ page,
+ search
+ };
+}
+
+//# sourceMappingURL=load-view.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/views/build-module/preference-keys.js":
+/*!***********************************************************************!*\
+ !*** ./node_modules/@wordpress/views/build-module/preference-keys.js ***!
+ \***********************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ generatePreferenceKey: () => (/* binding */ generatePreferenceKey)
+/* harmony export */ });
+// packages/views/src/preference-keys.ts
+function generatePreferenceKey(kind, name, slug) {
+ return `dataviews-${kind}-${name}-${slug}`;
+}
+
+//# sourceMappingURL=preference-keys.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/@wordpress/views/build-module/use-view.js":
+/*!****************************************************************!*\
+ !*** ./node_modules/@wordpress/views/build-module/use-view.js ***!
+ \****************************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ useView: () => (/* binding */ useView)
+/* harmony export */ });
+/* harmony import */ var dequal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dequal */ "./node_modules/dequal/dist/index.mjs");
+/* harmony import */ var _preference_keys__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./preference-keys */ "./node_modules/@wordpress/views/build-module/preference-keys.js");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
+/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _wordpress_preferences__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/preferences */ "@wordpress/preferences");
+/* harmony import */ var _wordpress_preferences__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_preferences__WEBPACK_IMPORTED_MODULE_4__);
+// packages/views/src/use-view.ts
+
+
+
+
+
+function omit(obj, keys) {
+ const result = { ...obj };
+ for (const key of keys) {
+ delete result[key];
+ }
+ return result;
+}
+function useView(config) {
+ const { kind, name, slug, defaultView, queryParams, onChangeQueryParams } = config;
+ const preferenceKey = (0,_preference_keys__WEBPACK_IMPORTED_MODULE_1__.generatePreferenceKey)(kind, name, slug);
+ const persistedView = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(
+ (select) => {
+ return select(_wordpress_preferences__WEBPACK_IMPORTED_MODULE_4__.store).get(
+ "core/views",
+ preferenceKey
+ );
+ },
+ [preferenceKey]
+ );
+ const { set } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_wordpress_preferences__WEBPACK_IMPORTED_MODULE_4__.store);
+ const baseView = persistedView ?? defaultView;
+ const page = Number(queryParams?.page ?? baseView.page ?? 1);
+ const search = queryParams?.search ?? baseView.search ?? "";
+ const view = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
+ return {
+ ...baseView,
+ page,
+ search
+ };
+ }, [baseView, page, search]);
+ const isModified = !!persistedView;
+ const updateView = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(
+ (newView) => {
+ const urlParams = {
+ page: newView?.page,
+ search: newView?.search
+ };
+ const preferenceView = omit(newView, ["page", "search"]);
+ if (onChangeQueryParams && !(0,dequal__WEBPACK_IMPORTED_MODULE_0__.dequal)(urlParams, { page, search })) {
+ onChangeQueryParams(urlParams);
+ }
+ if (!(0,dequal__WEBPACK_IMPORTED_MODULE_0__.dequal)(baseView, preferenceView)) {
+ if ((0,dequal__WEBPACK_IMPORTED_MODULE_0__.dequal)(preferenceView, defaultView)) {
+ set("core/views", preferenceKey, void 0);
+ } else {
+ set("core/views", preferenceKey, preferenceView);
+ }
+ }
+ },
+ [
+ onChangeQueryParams,
+ page,
+ search,
+ baseView,
+ defaultView,
+ set,
+ preferenceKey
+ ]
+ );
+ const resetToDefault = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(() => {
+ set("core/views", preferenceKey, void 0);
+ }, [preferenceKey, set]);
+ return {
+ view,
+ isModified,
+ updateView,
+ resetToDefault
+ };
+}
+
+//# sourceMappingURL=use-view.js.map
+
+
+/***/ }),
+
+/***/ "./node_modules/clsx/dist/clsx.mjs":
+/*!*****************************************!*\
+ !*** ./node_modules/clsx/dist/clsx.mjs ***!
+ \*****************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ clsx: () => (/* binding */ clsx),
+/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
+/* harmony export */ });
+function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ Colord: () => (/* binding */ j),
+/* harmony export */ colord: () => (/* binding */ w),
+/* harmony export */ extend: () => (/* binding */ k),
+/* harmony export */ getFormat: () => (/* binding */ I),
+/* harmony export */ random: () => (/* binding */ E)
+/* harmony export */ });
+var r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},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},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},a=function(r){return{r:e(r.r,0,255),g:e(r.g,0,255),b:e(r.b,0,255),a:e(r.a)}},o=function(r){return{r:n(r.r),g:n(r.g),b:n(r.b),a: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:e(r.s,0,100),l:e(r.l,0,100),a:e(r.a)}},d=function(r){return{h:n(r.h),s:n(r.s),l:n(r.l),a: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}));// removed by dead control flow
+ 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};// removed by dead control flow
+ 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?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?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: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)?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:e(r.s,0,100),v:e(r.v,0,100),a: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=.5},r.prototype.toHex=function(){return r=o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(n(255*a)):"","#"+s(t)+s(e)+s(u)+i;// removed by dead control flow
+ var r, t, e, u, a, i; },r.prototype.toRgb=function(){return o(this.rgba)},r.prototype.toRgbString=function(){return r=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+")";// removed by dead control flow
+ 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+"%)";// removed by dead control flow
+ var r, t, n, e, u; },r.prototype.toHsv=function(){return r=h(this.rgba),{h:n(r.h),s:n(r.s),v:n(r.v),a:n(r.a,3)};// removed by dead control flow
+ 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});// removed by dead control flow
+ 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}):n(this.rgba.a,3);// removed by dead control flow
+ 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}):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()})};
+
+
+/***/ }),
+
+/***/ "./node_modules/dequal/dist/index.mjs":
+/*!********************************************!*\
+ !*** ./node_modules/dequal/dist/index.mjs ***!
+ \********************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ dequal: () => (/* binding */ dequal)
+/* harmony export */ });
+var has = Object.prototype.hasOwnProperty;
+
+function find(iter, tar, key) {
+ for (key of iter.keys()) {
+ if (dequal(key, tar)) return key;
+ }
+}
+
+function dequal(foo, bar) {
+ var ctor, len, tmp;
+ if (foo === bar) return true;
+
+ if (foo && bar && (ctor=foo.constructor) === bar.constructor) {
+ if (ctor === Date) return foo.getTime() === bar.getTime();
+ if (ctor === RegExp) return foo.toString() === bar.toString();
+
+ if (ctor === Array) {
+ if ((len=foo.length) === bar.length) {
+ while (len-- && dequal(foo[len], bar[len]));
+ }
+ return len === -1;
+ }
+
+ if (ctor === Set) {
+ if (foo.size !== bar.size) {
+ return false;
+ }
+ for (len of foo) {
+ tmp = len;
+ if (tmp && typeof tmp === 'object') {
+ tmp = find(bar, tmp);
+ if (!tmp) return false;
+ }
+ if (!bar.has(tmp)) return false;
+ }
+ return true;
+ }
+
+ if (ctor === Map) {
+ if (foo.size !== bar.size) {
+ return false;
+ }
+ for (len of foo) {
+ tmp = len[0];
+ if (tmp && typeof tmp === 'object') {
+ tmp = find(bar, tmp);
+ if (!tmp) return false;
+ }
+ if (!dequal(len[1], bar.get(tmp))) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ if (ctor === ArrayBuffer) {
+ foo = new Uint8Array(foo);
+ bar = new Uint8Array(bar);
+ } else if (ctor === DataView) {
+ if ((len=foo.byteLength) === bar.byteLength) {
+ while (len-- && foo.getInt8(len) === bar.getInt8(len));
+ }
+ return len === -1;
+ }
+
+ if (ArrayBuffer.isView(foo)) {
+ if ((len=foo.byteLength) === bar.byteLength) {
+ while (len-- && foo[len] === bar[len]);
+ }
+ return len === -1;
+ }
+
+ if (!ctor || typeof foo === 'object') {
+ len = 0;
+ for (ctor in foo) {
+ if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
+ if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
+ }
+ return Object.keys(bar).length === len;
+ }
+ }
+
+ return foo !== foo && bar !== bar;
+}
+
+
+/***/ }),
+
+/***/ "./node_modules/fast-deep-equal/es6/index.js":
+/*!***************************************************!*\
+ !*** ./node_modules/fast-deep-equal/es6/index.js ***!
+ \***************************************************/
+/***/ ((module) => {
+
+"use strict";
+
+
+// do not edit .js files directly - edit src/index.jst
+
+
+ var envHasBigInt64Array = typeof BigInt64Array !== 'undefined';
+
+
+module.exports = function equal(a, b) {
+ if (a === b) return true;
+
+ if (a && b && typeof a == 'object' && typeof b == 'object') {
+ if (a.constructor !== b.constructor) return false;
+
+ var length, i, keys;
+ if (Array.isArray(a)) {
+ length = a.length;
+ if (length != b.length) return false;
+ for (i = length; i-- !== 0;)
+ if (!equal(a[i], b[i])) return false;
+ return true;
+ }
+
+
+ if ((a instanceof Map) && (b instanceof Map)) {
+ if (a.size !== b.size) return false;
+ for (i of a.entries())
+ if (!b.has(i[0])) return false;
+ for (i of a.entries())
+ if (!equal(i[1], b.get(i[0]))) return false;
+ return true;
+ }
+
+ if ((a instanceof Set) && (b instanceof Set)) {
+ if (a.size !== b.size) return false;
+ for (i of a.entries())
+ if (!b.has(i[0])) return false;
+ return true;
+ }
+
+ if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
+ length = a.length;
+ if (length != b.length) return false;
+ for (i = length; i-- !== 0;)
+ if (a[i] !== b[i]) return false;
+ return true;
+ }
+
+
+ if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
+ if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
+ if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
+
+ 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;) {
+ var key = keys[i];
+
+ if (!equal(a[key], b[key])) return false;
+ }
+
+ return true;
+ }
+
+ // true if both NaN, false otherwise
+ return a!==a && b!==b;
+};
+
+
+/***/ }),
+
+/***/ "./node_modules/remove-accents/index.js":
+/*!**********************************************!*\
+ !*** ./node_modules/remove-accents/index.js ***!
+ \**********************************************/
+/***/ ((module) => {
+
+var characterMap = {
+ "À": "A",
+ "Á": "A",
+ "Â": "A",
+ "Ã": "A",
+ "Ä": "A",
+ "Å": "A",
+ "Ấ": "A",
+ "Ắ": "A",
+ "Ẳ": "A",
+ "Ẵ": "A",
+ "Ặ": "A",
+ "Æ": "AE",
+ "Ầ": "A",
+ "Ằ": "A",
+ "Ȃ": "A",
+ "Ả": "A",
+ "Ạ": "A",
+ "Ẩ": "A",
+ "Ẫ": "A",
+ "Ậ": "A",
+ "Ç": "C",
+ "Ḉ": "C",
+ "È": "E",
+ "É": "E",
+ "Ê": "E",
+ "Ë": "E",
+ "Ế": "E",
+ "Ḗ": "E",
+ "Ề": "E",
+ "Ḕ": "E",
+ "Ḝ": "E",
+ "Ȇ": "E",
+ "Ẻ": "E",
+ "Ẽ": "E",
+ "Ẹ": "E",
+ "Ể": "E",
+ "Ễ": "E",
+ "Ệ": "E",
+ "Ì": "I",
+ "Í": "I",
+ "Î": "I",
+ "Ï": "I",
+ "Ḯ": "I",
+ "Ȋ": "I",
+ "Ỉ": "I",
+ "Ị": "I",
+ "Ð": "D",
+ "Ñ": "N",
+ "Ò": "O",
+ "Ó": "O",
+ "Ô": "O",
+ "Õ": "O",
+ "Ö": "O",
+ "Ø": "O",
+ "Ố": "O",
+ "Ṍ": "O",
+ "Ṓ": "O",
+ "Ȏ": "O",
+ "Ỏ": "O",
+ "Ọ": "O",
+ "Ổ": "O",
+ "Ỗ": "O",
+ "Ộ": "O",
+ "Ờ": "O",
+ "Ở": "O",
+ "Ỡ": "O",
+ "Ớ": "O",
+ "Ợ": "O",
+ "Ù": "U",
+ "Ú": "U",
+ "Û": "U",
+ "Ü": "U",
+ "Ủ": "U",
+ "Ụ": "U",
+ "Ử": "U",
+ "Ữ": "U",
+ "Ự": "U",
+ "Ý": "Y",
+ "à": "a",
+ "á": "a",
+ "â": "a",
+ "ã": "a",
+ "ä": "a",
+ "å": "a",
+ "ấ": "a",
+ "ắ": "a",
+ "ẳ": "a",
+ "ẵ": "a",
+ "ặ": "a",
+ "æ": "ae",
+ "ầ": "a",
+ "ằ": "a",
+ "ȃ": "a",
+ "ả": "a",
+ "ạ": "a",
+ "ẩ": "a",
+ "ẫ": "a",
+ "ậ": "a",
+ "ç": "c",
+ "ḉ": "c",
+ "è": "e",
+ "é": "e",
+ "ê": "e",
+ "ë": "e",
+ "ế": "e",
+ "ḗ": "e",
+ "ề": "e",
+ "ḕ": "e",
+ "ḝ": "e",
+ "ȇ": "e",
+ "ẻ": "e",
+ "ẽ": "e",
+ "ẹ": "e",
+ "ể": "e",
+ "ễ": "e",
+ "ệ": "e",
+ "ì": "i",
+ "í": "i",
+ "î": "i",
+ "ï": "i",
+ "ḯ": "i",
+ "ȋ": "i",
+ "ỉ": "i",
+ "ị": "i",
+ "ð": "d",
+ "ñ": "n",
+ "ò": "o",
+ "ó": "o",
+ "ô": "o",
+ "õ": "o",
+ "ö": "o",
+ "ø": "o",
+ "ố": "o",
+ "ṍ": "o",
+ "ṓ": "o",
+ "ȏ": "o",
+ "ỏ": "o",
+ "ọ": "o",
+ "ổ": "o",
+ "ỗ": "o",
+ "ộ": "o",
+ "ờ": "o",
+ "ở": "o",
+ "ỡ": "o",
+ "ớ": "o",
+ "ợ": "o",
+ "ù": "u",
+ "ú": "u",
+ "û": "u",
+ "ü": "u",
+ "ủ": "u",
+ "ụ": "u",
+ "ử": "u",
+ "ữ": "u",
+ "ự": "u",
+ "ý": "y",
+ "ÿ": "y",
+ "Ā": "A",
+ "ā": "a",
+ "Ă": "A",
+ "ă": "a",
+ "Ą": "A",
+ "ą": "a",
+ "Ć": "C",
+ "ć": "c",
+ "Ĉ": "C",
+ "ĉ": "c",
+ "Ċ": "C",
+ "ċ": "c",
+ "Č": "C",
+ "č": "c",
+ "C̆": "C",
+ "c̆": "c",
+ "Ď": "D",
+ "ď": "d",
+ "Đ": "D",
+ "đ": "d",
+ "Ē": "E",
+ "ē": "e",
+ "Ĕ": "E",
+ "ĕ": "e",
+ "Ė": "E",
+ "ė": "e",
+ "Ę": "E",
+ "ę": "e",
+ "Ě": "E",
+ "ě": "e",
+ "Ĝ": "G",
+ "Ǵ": "G",
+ "ĝ": "g",
+ "ǵ": "g",
+ "Ğ": "G",
+ "ğ": "g",
+ "Ġ": "G",
+ "ġ": "g",
+ "Ģ": "G",
+ "ģ": "g",
+ "Ĥ": "H",
+ "ĥ": "h",
+ "Ħ": "H",
+ "ħ": "h",
+ "Ḫ": "H",
+ "ḫ": "h",
+ "Ĩ": "I",
+ "ĩ": "i",
+ "Ī": "I",
+ "ī": "i",
+ "Ĭ": "I",
+ "ĭ": "i",
+ "Į": "I",
+ "į": "i",
+ "İ": "I",
+ "ı": "i",
+ "IJ": "IJ",
+ "ij": "ij",
+ "Ĵ": "J",
+ "ĵ": "j",
+ "Ķ": "K",
+ "ķ": "k",
+ "Ḱ": "K",
+ "ḱ": "k",
+ "K̆": "K",
+ "k̆": "k",
+ "Ĺ": "L",
+ "ĺ": "l",
+ "Ļ": "L",
+ "ļ": "l",
+ "Ľ": "L",
+ "ľ": "l",
+ "Ŀ": "L",
+ "ŀ": "l",
+ "Ł": "l",
+ "ł": "l",
+ "Ḿ": "M",
+ "ḿ": "m",
+ "M̆": "M",
+ "m̆": "m",
+ "Ń": "N",
+ "ń": "n",
+ "Ņ": "N",
+ "ņ": "n",
+ "Ň": "N",
+ "ň": "n",
+ "ʼn": "n",
+ "N̆": "N",
+ "n̆": "n",
+ "Ō": "O",
+ "ō": "o",
+ "Ŏ": "O",
+ "ŏ": "o",
+ "Ő": "O",
+ "ő": "o",
+ "Œ": "OE",
+ "œ": "oe",
+ "P̆": "P",
+ "p̆": "p",
+ "Ŕ": "R",
+ "ŕ": "r",
+ "Ŗ": "R",
+ "ŗ": "r",
+ "Ř": "R",
+ "ř": "r",
+ "R̆": "R",
+ "r̆": "r",
+ "Ȓ": "R",
+ "ȓ": "r",
+ "Ś": "S",
+ "ś": "s",
+ "Ŝ": "S",
+ "ŝ": "s",
+ "Ş": "S",
+ "Ș": "S",
+ "ș": "s",
+ "ş": "s",
+ "Š": "S",
+ "š": "s",
+ "Ţ": "T",
+ "ţ": "t",
+ "ț": "t",
+ "Ț": "T",
+ "Ť": "T",
+ "ť": "t",
+ "Ŧ": "T",
+ "ŧ": "t",
+ "T̆": "T",
+ "t̆": "t",
+ "Ũ": "U",
+ "ũ": "u",
+ "Ū": "U",
+ "ū": "u",
+ "Ŭ": "U",
+ "ŭ": "u",
+ "Ů": "U",
+ "ů": "u",
+ "Ű": "U",
+ "ű": "u",
+ "Ų": "U",
+ "ų": "u",
+ "Ȗ": "U",
+ "ȗ": "u",
+ "V̆": "V",
+ "v̆": "v",
+ "Ŵ": "W",
+ "ŵ": "w",
+ "Ẃ": "W",
+ "ẃ": "w",
+ "X̆": "X",
+ "x̆": "x",
+ "Ŷ": "Y",
+ "ŷ": "y",
+ "Ÿ": "Y",
+ "Y̆": "Y",
+ "y̆": "y",
+ "Ź": "Z",
+ "ź": "z",
+ "Ż": "Z",
+ "ż": "z",
+ "Ž": "Z",
+ "ž": "z",
+ "ſ": "s",
+ "ƒ": "f",
+ "Ơ": "O",
+ "ơ": "o",
+ "Ư": "U",
+ "ư": "u",
+ "Ǎ": "A",
+ "ǎ": "a",
+ "Ǐ": "I",
+ "ǐ": "i",
+ "Ǒ": "O",
+ "ǒ": "o",
+ "Ǔ": "U",
+ "ǔ": "u",
+ "Ǖ": "U",
+ "ǖ": "u",
+ "Ǘ": "U",
+ "ǘ": "u",
+ "Ǚ": "U",
+ "ǚ": "u",
+ "Ǜ": "U",
+ "ǜ": "u",
+ "Ứ": "U",
+ "ứ": "u",
+ "Ṹ": "U",
+ "ṹ": "u",
+ "Ǻ": "A",
+ "ǻ": "a",
+ "Ǽ": "AE",
+ "ǽ": "ae",
+ "Ǿ": "O",
+ "ǿ": "o",
+ "Þ": "TH",
+ "þ": "th",
+ "Ṕ": "P",
+ "ṕ": "p",
+ "Ṥ": "S",
+ "ṥ": "s",
+ "X́": "X",
+ "x́": "x",
+ "Ѓ": "Г",
+ "ѓ": "г",
+ "Ќ": "К",
+ "ќ": "к",
+ "A̋": "A",
+ "a̋": "a",
+ "E̋": "E",
+ "e̋": "e",
+ "I̋": "I",
+ "i̋": "i",
+ "Ǹ": "N",
+ "ǹ": "n",
+ "Ồ": "O",
+ "ồ": "o",
+ "Ṑ": "O",
+ "ṑ": "o",
+ "Ừ": "U",
+ "ừ": "u",
+ "Ẁ": "W",
+ "ẁ": "w",
+ "Ỳ": "Y",
+ "ỳ": "y",
+ "Ȁ": "A",
+ "ȁ": "a",
+ "Ȅ": "E",
+ "ȅ": "e",
+ "Ȉ": "I",
+ "ȉ": "i",
+ "Ȍ": "O",
+ "ȍ": "o",
+ "Ȑ": "R",
+ "ȑ": "r",
+ "Ȕ": "U",
+ "ȕ": "u",
+ "B̌": "B",
+ "b̌": "b",
+ "Č̣": "C",
+ "č̣": "c",
+ "Ê̌": "E",
+ "ê̌": "e",
+ "F̌": "F",
+ "f̌": "f",
+ "Ǧ": "G",
+ "ǧ": "g",
+ "Ȟ": "H",
+ "ȟ": "h",
+ "J̌": "J",
+ "ǰ": "j",
+ "Ǩ": "K",
+ "ǩ": "k",
+ "M̌": "M",
+ "m̌": "m",
+ "P̌": "P",
+ "p̌": "p",
+ "Q̌": "Q",
+ "q̌": "q",
+ "Ř̩": "R",
+ "ř̩": "r",
+ "Ṧ": "S",
+ "ṧ": "s",
+ "V̌": "V",
+ "v̌": "v",
+ "W̌": "W",
+ "w̌": "w",
+ "X̌": "X",
+ "x̌": "x",
+ "Y̌": "Y",
+ "y̌": "y",
+ "A̧": "A",
+ "a̧": "a",
+ "B̧": "B",
+ "b̧": "b",
+ "Ḑ": "D",
+ "ḑ": "d",
+ "Ȩ": "E",
+ "ȩ": "e",
+ "Ɛ̧": "E",
+ "ɛ̧": "e",
+ "Ḩ": "H",
+ "ḩ": "h",
+ "I̧": "I",
+ "i̧": "i",
+ "Ɨ̧": "I",
+ "ɨ̧": "i",
+ "M̧": "M",
+ "m̧": "m",
+ "O̧": "O",
+ "o̧": "o",
+ "Q̧": "Q",
+ "q̧": "q",
+ "U̧": "U",
+ "u̧": "u",
+ "X̧": "X",
+ "x̧": "x",
+ "Z̧": "Z",
+ "z̧": "z",
+ "й":"и",
+ "Й":"И",
+ "ё":"е",
+ "Ё":"Е",
+};
+
+var chars = Object.keys(characterMap).join('|');
+var allAccents = new RegExp(chars, 'g');
+var firstAccent = new RegExp(chars, '');
+
+function matcher(match) {
+ return characterMap[match];
+}
+
+var removeAccents = function(string) {
+ return string.replace(allAccents, matcher);
+};
+
+var hasAccents = function(string) {
+ return !!string.match(firstAccent);
+};
+
+module.exports = removeAccents;
+module.exports.has = hasAccents;
+module.exports.remove = removeAccents;
+
+
+/***/ }),
+
+/***/ "./node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js":
+/*!**********************************************************************************************!*\
+ !*** ./node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js ***!
+ \**********************************************************************************************/
+/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
+
+"use strict";
+/**
+ * @license React
+ * use-sync-external-store-shim.development.js
+ *
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+
+ true &&
+ (function () {
+ function is(x, y) {
+ return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
+ }
+ function useSyncExternalStore$2(subscribe, getSnapshot) {
+ didWarnOld18Alpha ||
+ void 0 === React.startTransition ||
+ ((didWarnOld18Alpha = !0),
+ console.error(
+ "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
+ ));
+ var value = getSnapshot();
+ if (!didWarnUncachedGetSnapshot) {
+ var cachedValue = getSnapshot();
+ objectIs(value, cachedValue) ||
+ (console.error(
+ "The result of getSnapshot should be cached to avoid an infinite loop"
+ ),
+ (didWarnUncachedGetSnapshot = !0));
+ }
+ cachedValue = useState({
+ inst: { value: value, getSnapshot: getSnapshot }
+ });
+ var inst = cachedValue[0].inst,
+ forceUpdate = cachedValue[1];
+ useLayoutEffect(
+ function () {
+ inst.value = value;
+ inst.getSnapshot = getSnapshot;
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
+ },
+ [subscribe, value, getSnapshot]
+ );
+ useEffect(
+ function () {
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
+ return subscribe(function () {
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
+ });
+ },
+ [subscribe]
+ );
+ useDebugValue(value);
+ return value;
+ }
+ function checkIfSnapshotChanged(inst) {
+ var latestGetSnapshot = inst.getSnapshot;
+ inst = inst.value;
+ try {
+ var nextValue = latestGetSnapshot();
+ return !objectIs(inst, nextValue);
+ } catch (error) {
+ return !0;
+ }
+ }
+ function useSyncExternalStore$1(subscribe, getSnapshot) {
+ return getSnapshot();
+ }
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
+ "function" ===
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
+ var React = __webpack_require__(/*! react */ "react"),
+ objectIs = "function" === typeof Object.is ? Object.is : is,
+ useState = React.useState,
+ useEffect = React.useEffect,
+ useLayoutEffect = React.useLayoutEffect,
+ useDebugValue = React.useDebugValue,
+ didWarnOld18Alpha = !1,
+ didWarnUncachedGetSnapshot = !1,
+ shim =
+ "undefined" === typeof window ||
+ "undefined" === typeof window.document ||
+ "undefined" === typeof window.document.createElement
+ ? useSyncExternalStore$1
+ : useSyncExternalStore$2;
+ exports.useSyncExternalStore =
+ void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
+ "function" ===
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
+ })();
+
+
+/***/ }),
+
+/***/ "./node_modules/use-sync-external-store/shim/index.js":
+/*!************************************************************!*\
+ !*** ./node_modules/use-sync-external-store/shim/index.js ***!
+ \************************************************************/
+/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
+
+"use strict";
+
+
+if (false) // removed by dead control flow
+{} else {
+ module.exports = __webpack_require__(/*! ../cjs/use-sync-external-store-shim.development.js */ "./node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js");
+}
+
+
+/***/ })
+
+}]);
+//# sourceMappingURL=vendors.js.map
\ No newline at end of file
diff --git a/src/social-web/routes/feed/stage.tsx b/src/social-web/routes/feed/stage.tsx
index 3fb8d2608e..8823778cd8 100644
--- a/src/social-web/routes/feed/stage.tsx
+++ b/src/social-web/routes/feed/stage.tsx
@@ -5,7 +5,7 @@
*/
import './style.scss';
-import { useMemo, useCallback, useState, useEffect } from '@wordpress/element';
+import { useMemo, useCallback, useState, useEffect, useRef } from '@wordpress/element';
import { DataViews } from '@wordpress/dataviews';
import { useView } from '@wordpress/views';
import type { View, Field } from '@wordpress/dataviews';
@@ -31,6 +31,7 @@ const DEFAULT_VIEW: View = {
search: '',
filters: [],
fields: [ 'metadata', 'title.rendered', 'excerpt.rendered' ],
+ infiniteScrollEnabled: true,
};
const defaultLayouts = {
@@ -143,6 +144,11 @@ export default function FeedStage( { onSelectItem }: FeedStageProps ) {
const [ selection, setSelection ] = useState< string[] >( [] );
+ // State for infinite scroll
+ const [ allLoadedRecords, setAllLoadedRecords ] = useState< FeedPost[] >( [] );
+ const [ isLoadingMore, setIsLoadingMore ] = useState( false );
+ const lastProcessedPage = useRef< number >( 0 );
+
useEffect( () => {
if ( selection.length === 0 ) {
return;
@@ -173,6 +179,54 @@ export default function FeedStage( { onSelectItem }: FeedStageProps ) {
[ feed, onSelectItem ]
);
+ // Infinite scroll handler
+ const infiniteScrollHandler = useCallback( () => {
+ const currentPage = view.page || 1;
+
+ // Prevent concurrent requests or loading beyond available pages
+ if ( isLoadingMore || currentPage >= ( totalPages || 1 ) ) {
+ return;
+ }
+
+ setIsLoadingMore( true );
+ updateFeedView( {
+ ...view,
+ page: currentPage + 1,
+ } );
+ }, [ isLoadingMore, view, totalPages, updateFeedView ] );
+
+ // Accumulate data across pages for infinite scroll
+ useEffect( () => {
+ const currentPage = normalizedView.page || 1;
+ const infiniteScrollEnabled = normalizedView.infiniteScrollEnabled;
+
+ // Don't process until feed data is available
+ if ( feed.length === 0 ) {
+ return;
+ }
+
+ // Skip if we've already processed this page (but always process page 1 for search/initial load)
+ if ( currentPage > 1 && lastProcessedPage.current === currentPage ) {
+ return;
+ }
+
+ // Reset to new data on first page or when infinite scroll is disabled
+ if ( currentPage === 1 || ! infiniteScrollEnabled ) {
+ setAllLoadedRecords( feed );
+ lastProcessedPage.current = currentPage;
+ setIsLoadingMore( false );
+ } else {
+ // Append new records while avoiding duplicates
+ setAllLoadedRecords( ( prev ) => {
+ const existingIds = new Set( prev.map( ( item ) => item.id ) );
+ const newRecords = feed.filter( ( record ) => ! existingIds.has( record.id ) );
+ return newRecords.length > 0 ? [ ...prev, ...newRecords ] : prev;
+ } );
+ lastProcessedPage.current = currentPage;
+ setIsLoadingMore( false );
+ }
+ }, [ feed, normalizedView.page, normalizedView.search, normalizedView.infiniteScrollEnabled ] );
+
return (
onSelectItem( item.id ) }
isItemClickable={ () => true }
getItemId={ ( item ) => item.id.toString() }
@@ -200,7 +254,11 @@ export default function FeedStage( { onSelectItem }: FeedStageProps ) {
) }
}
- paginationInfo={ { totalItems, totalPages } }
+ paginationInfo={ {
+ totalItems,
+ totalPages,
+ infiniteScrollHandler,
+ } }
defaultLayouts={ defaultLayouts }
/>
diff --git a/src/social-web/routes/feed/style.scss b/src/social-web/routes/feed/style.scss
index f4d7fe0490..6c3c65d115 100644
--- a/src/social-web/routes/feed/style.scss
+++ b/src/social-web/routes/feed/style.scss
@@ -8,6 +8,12 @@
width: 50%;
}
+// Remove residual styles from footer when empty (infinite scroll enabled)
+.dataviews-footer:empty {
+ border: 0;
+ padding: 0;
+}
+
// List view item stacking
.dataviews-view-list {
.dataviews-view-list__item {
From fcb885e9bc5ad0a54bfdb504ac99a586ce94ea80 Mon Sep 17 00:00:00 2001
From: Konstantin Obenland
Date: Thu, 20 Nov 2025 10:29:30 -0600
Subject: [PATCH 2/2] Update build
---
build/command-palette/plugin.asset.php | 2 +-
build/command-palette/plugin.js | 480 +-
build/editor-plugin/plugin.asset.php | 2 +-
build/editor-plugin/plugin.js | 565 +-
build/extra-fields/index.asset.php | 2 +-
build/extra-fields/index.js | 738 +-
build/extra-fields/style-index-rtl.css | 143 +-
build/extra-fields/style-index.css | 145 +-
build/follow-me/index.asset.php | 2 +-
build/follow-me/index.js | 1252 +-
build/follow-me/style-index-rtl.css | 345 +-
build/follow-me/style-index.css | 347 +-
build/follow-me/view.asset.php | 2 +-
build/follow-me/view.js | 761 +-
build/followers/index.asset.php | 2 +-
build/followers/index.js | 1035 +-
build/followers/style-index-rtl.css | 242 +-
build/followers/style-index.css | 244 +-
build/followers/view.asset.php | 2 +-
build/followers/view.js | 235 +-
build/reactions/index.asset.php | 2 +-
build/reactions/index.js | 761 +-
build/reactions/style-index-rtl.css | 279 +-
build/reactions/style-index.css | 281 +-
build/reactions/view.asset.php | 2 +-
build/reactions/view.js | 519 +-
build/remote-reply/style-view.css | 98 +-
build/remote-reply/view.asset.php | 2 +-
build/remote-reply/view.js | 761 +-
build/reply-intent/plugin.asset.php | 2 +-
build/reply-intent/plugin.js | 182 +-
build/reply/index-rtl.css | 224 +-
build/reply/index.asset.php | 2 +-
build/reply/index.css | 226 +-
build/reply/index.js | 521 +-
build/social-web/feed-inspector.js | 237 +-
build/social-web/feed-stage.js | 1193 +-
build/social-web/index.asset.php | 2 +-
build/social-web/index.js | 1873 +-
build/social-web/style-feed-stage-rtl.css | 358 +-
build/social-web/style-feed-stage.css | 360 +-
build/social-web/style-index-rtl.css | 365 +-
build/social-web/style-index.css | 367 +-
build/social-web/vendors.asset.php | 2 +-
build/social-web/vendors.js | 22292 +-------------------
45 files changed, 181 insertions(+), 37276 deletions(-)
diff --git a/build/command-palette/plugin.asset.php b/build/command-palette/plugin.asset.php
index 3179b074a5..e7a6350c6d 100644
--- a/build/command-palette/plugin.asset.php
+++ b/build/command-palette/plugin.asset.php
@@ -1 +1 @@
- array('react', 'react-jsx-runtime', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '33a55a0b3696a64e729c');
+ array('react', 'react-jsx-runtime', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'e39de7b99dcb1cb7d308');
diff --git a/build/command-palette/plugin.js b/build/command-palette/plugin.js
index 7cc9d84b4e..79264d100d 100644
--- a/build/command-palette/plugin.js
+++ b/build/command-palette/plugin.js
@@ -1,477 +1,3 @@
-/******/ (() => { // webpackBootstrap
-/******/ "use strict";
-/******/ var __webpack_modules__ = ({
-
-/***/ "@wordpress/core-data":
-/*!**********************************!*\
- !*** external ["wp","coreData"] ***!
- \**********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["coreData"];
-
-/***/ }),
-
-/***/ "@wordpress/data":
-/*!******************************!*\
- !*** external ["wp","data"] ***!
- \******************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["data"];
-
-/***/ }),
-
-/***/ "@wordpress/element":
-/*!*********************************!*\
- !*** external ["wp","element"] ***!
- \*********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["element"];
-
-/***/ }),
-
-/***/ "@wordpress/i18n":
-/*!******************************!*\
- !*** external ["wp","i18n"] ***!
- \******************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["i18n"];
-
-/***/ }),
-
-/***/ "react":
-/*!************************!*\
- !*** external "React" ***!
- \************************/
-/***/ ((module) => {
-
-module.exports = window["React"];
-
-/***/ }),
-
-/***/ "react/jsx-runtime":
-/*!**********************************!*\
- !*** external "ReactJSXRuntime" ***!
- \**********************************/
-/***/ ((module) => {
-
-module.exports = window["ReactJSXRuntime"];
-
-/***/ })
-
-/******/ });
-/************************************************************************/
-/******/ // The module cache
-/******/ var __webpack_module_cache__ = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/ // Check if module is in cache
-/******/ var cachedModule = __webpack_module_cache__[moduleId];
-/******/ if (cachedModule !== undefined) {
-/******/ return cachedModule.exports;
-/******/ }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = __webpack_module_cache__[moduleId] = {
-/******/ // no module.id needed
-/******/ // no module.loaded needed
-/******/ exports: {}
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/************************************************************************/
-/******/ /* webpack/runtime/compat get default export */
-/******/ (() => {
-/******/ // getDefaultExport function for compatibility with non-harmony modules
-/******/ __webpack_require__.n = (module) => {
-/******/ var getter = module && module.__esModule ?
-/******/ () => (module['default']) :
-/******/ () => (module);
-/******/ __webpack_require__.d(getter, { a: getter });
-/******/ return getter;
-/******/ };
-/******/ })();
-/******/
-/******/ /* webpack/runtime/define property getters */
-/******/ (() => {
-/******/ // define getter functions for harmony exports
-/******/ __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 */
-/******/ (() => {
-/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
-/******/ })();
-/******/
-/******/ /* webpack/runtime/make namespace object */
-/******/ (() => {
-/******/ // define __esModule on exports
-/******/ __webpack_require__.r = (exports) => {
-/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
-/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
-/******/ }
-/******/ Object.defineProperty(exports, '__esModule', { value: true });
-/******/ };
-/******/ })();
-/******/
-/************************************************************************/
-var __webpack_exports__ = {};
-// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
-(() => {
-/*!****************************************!*\
- !*** ./src/command-palette/plugin.tsx ***!
- \****************************************/
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data");
-/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
-/**
- * ActivityPub Command Palette Integration
- *
- * Registers commands for the WordPress Command Palette (Cmd/Ctrl + K)
- * to provide quick navigation to ActivityPub admin pages.
- */
-
-
-
-
-
-
-
-// Icon for ActivityPub commands - using the official ActivityPub plugin icon.
-const activityPubIcon = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("svg", {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 80 80",
- width: "24",
- height: "24",
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("rect", {
- width: "80",
- height: "80",
- fill: "#f1027e"
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("path", {
- d: "M42.9 19.8L72 36.6v6.7L42.9 60.2v-6.7L66.2 40 42.9 26.6v-6.8z",
- fillRule: "evenodd",
- clipRule: "evenodd",
- fill: "white"
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("path", {
- d: "M42.9 33.3L54.5 40l-11.6 6.7V33.3z",
- fillRule: "evenodd",
- clipRule: "evenodd",
- fill: "white"
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("path", {
- d: "M37.1 19.8L8 36.6v6.7l23.3-13.4v26.9l5.8 3.4V19.8zM25.5 40L13.8 46.7l11.6 6.7V40z",
- fillRule: "evenodd",
- clipRule: "evenodd",
- fill: "white"
- })]
-});
-
-// Get configuration from PHP.
-const {
- actorMode,
- canManageOptions,
- followingEnabled
-} = window.activitypubCommandPalette || {
- followingEnabled: false,
- actorMode: 'actor',
- canManageOptions: false
-};
-
-// Helper function to register a command.
-const registerCommand = command => {
- try {
- (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.dispatch)('core/commands').registerCommand(command);
- } catch (error) {
- console.error('Failed to register ActivityPub command:', command.name, error);
- }
-};
-
-// Helper function to register a command loader for dynamic commands.
-const registerCommandLoader = loaderConfig => {
- try {
- (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.dispatch)('core/commands').registerCommandLoader(loaderConfig);
- } catch (error) {
- console.error('Failed to register ActivityPub command loader:', loaderConfig.name, error);
- }
-};
-
-/**
- * Hook to load user extra fields as dynamic commands.
- */
-const useExtraFieldsCommandLoader = ({
- search
-}) => {
- // Retrieving the extra fields for the "search" term.
- const {
- records,
- isLoading
- } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
- const store = select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_3__.store);
- const currentUser = store.getCurrentUser();
- const query = {
- search: !!search ? search : undefined,
- per_page: 10,
- orderby: search ? 'relevance' : 'date',
- status: 'any',
- author: currentUser?.id
- };
- return {
- records: store.getEntityRecords('postType', 'ap_extrafield', query),
- isLoading: !store.hasFinishedResolution('getEntityRecords', ['postType', 'ap_extrafield', query])
- };
- }, [search]);
-
- // Creating the commands.
- const commands = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useMemo)(() => {
- return (records !== null && records !== void 0 ? records : []).slice(0, 10).map(record => {
- const title = record.title?.rendered || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('(no title)', 'activitypub');
- // Remove all quotes and special characters that could break CSS selectors.
- const sanitizedTitle = title.replace(/["'`]/g, '');
- return {
- // Use ID in the name to ensure uniqueness even with duplicate titles.
- name: `activitypub/edit-extra-field/${record.id}`,
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %s: Extra field title */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('ActivityPub: Edit - %s', 'activitypub'), sanitizedTitle),
- icon: activityPubIcon,
- callback: ({
- close
- }) => {
- document.location = `post.php?post=${record.id}&action=edit`;
- close();
- }
- };
- });
- }, [records]);
- return {
- commands,
- isLoading
- };
-};
-
-/**
- * Hook to load blog extra fields as dynamic commands.
- */
-const useBlogExtraFieldsCommandLoader = ({
- search
-}) => {
- // Retrieving the blog extra fields for the "search" term.
- const {
- records,
- isLoading
- } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
- const store = select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_3__.store);
- const query = {
- search: !!search ? search : undefined,
- per_page: 10,
- orderby: search ? 'relevance' : 'date',
- status: 'any'
- };
- return {
- records: store.getEntityRecords('postType', 'ap_extrafield_blog', query),
- isLoading: !store.hasFinishedResolution('getEntityRecords', ['postType', 'ap_extrafield_blog', query])
- };
- }, [search]);
-
- // Creating the commands.
- const commands = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useMemo)(() => {
- return (records !== null && records !== void 0 ? records : []).slice(0, 10).map(record => {
- const title = record.title?.rendered || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('(no title)', 'activitypub');
- // Remove all quotes and special characters that could break CSS selectors.
- const sanitizedTitle = title.replace(/["'`]/g, '');
- return {
- // Use ID in the name to ensure uniqueness even with duplicate titles.
- name: `activitypub/edit-blog-extra-field/${record.id}`,
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %s: Blog extra field title */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('ActivityPub: Edit Blog - %s', 'activitypub'), sanitizedTitle),
- icon: activityPubIcon,
- callback: ({
- close
- }) => {
- document.location = `post.php?post=${record.id}&action=edit`;
- close();
- }
- };
- });
- }, [records]);
- return {
- commands,
- isLoading
- };
-};
-
-// User-specific commands (for actor and actor_blog modes).
-if (actorMode === 'actor' || actorMode === 'actor_blog') {
- // User Followers command.
- registerCommand({
- name: 'activitypub/navigate-user-followers',
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('ActivityPub: View Your Followers', 'activitypub'),
- icon: activityPubIcon,
- callback: ({
- close
- }) => {
- document.location.href = 'users.php?page=activitypub-followers-list';
- close();
- }
- });
-
- // User Following command (only if enabled).
- if (followingEnabled) {
- registerCommand({
- name: 'activitypub/navigate-user-following',
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('ActivityPub: View Who You Follow', 'activitypub'),
- icon: activityPubIcon,
- callback: ({
- close
- }) => {
- document.location.href = 'users.php?page=activitypub-following-list';
- close();
- }
- });
- }
-
- // User Extra Fields commands.
- registerCommand({
- name: 'activitypub/navigate-extra-fields',
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('ActivityPub: View Extra Fields', 'activitypub'),
- icon: activityPubIcon,
- callback: ({
- close
- }) => {
- document.location.href = 'edit.php?post_type=ap_extrafield';
- close();
- }
- });
- registerCommand({
- name: 'activitypub/add-extra-field',
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('ActivityPub: Add New Extra Field', 'activitypub'),
- icon: activityPubIcon,
- callback: ({
- close
- }) => {
- document.location.href = 'post-new.php?post_type=ap_extrafield';
- close();
- }
- });
-
- // Dynamic command loader: Edit existing extra fields.
- registerCommandLoader({
- name: 'activitypub/extra-fields-search',
- hook: useExtraFieldsCommandLoader
- });
-
- // Blocked Actors command (user-specific).
- registerCommand({
- name: 'activitypub/navigate-blocked-actors',
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('ActivityPub: View Blocked Actors', 'activitypub'),
- icon: activityPubIcon,
- callback: ({
- close
- }) => {
- document.location.href = 'users.php?page=activitypub-blocked-actors-list';
- close();
- }
- });
-}
-
-// Blog-related commands (for blog and actor_blog modes with manage_options capability).
-if (canManageOptions && (actorMode === 'blog' || actorMode === 'actor_blog')) {
- // Blog Followers command.
- registerCommand({
- name: 'activitypub/navigate-blog-followers',
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('ActivityPub: View Blog Followers', 'activitypub'),
- icon: activityPubIcon,
- callback: ({
- close
- }) => {
- document.location.href = 'options-general.php?page=activitypub&tab=followers';
- close();
- }
- });
-
- // Blog Following command (only if enabled).
- if (followingEnabled) {
- registerCommand({
- name: 'activitypub/navigate-blog-following',
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('ActivityPub: View Blog Following', 'activitypub'),
- icon: activityPubIcon,
- callback: ({
- close
- }) => {
- document.location.href = 'options-general.php?page=activitypub&tab=following';
- close();
- }
- });
- }
-
- // Settings command (blog-related, requires manage_options).
- registerCommand({
- name: 'activitypub/navigate-settings',
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('ActivityPub: View Settings', 'activitypub'),
- icon: activityPubIcon,
- callback: ({
- close
- }) => {
- document.location.href = 'options-general.php?page=activitypub&tab=settings';
- close();
- }
- });
-
- // Blog Extra Fields commands.
- registerCommand({
- name: 'activitypub/navigate-blog-extra-fields',
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('ActivityPub: View Blog Extra Fields', 'activitypub'),
- icon: activityPubIcon,
- callback: ({
- close
- }) => {
- document.location.href = 'edit.php?post_type=ap_extrafield_blog';
- close();
- }
- });
- registerCommand({
- name: 'activitypub/add-blog-extra-field',
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('ActivityPub: Add New Blog Extra Field', 'activitypub'),
- icon: activityPubIcon,
- callback: ({
- close
- }) => {
- document.location.href = 'post-new.php?post_type=ap_extrafield_blog';
- close();
- }
- });
-
- // Dynamic command loader: Edit existing blog extra fields.
- registerCommandLoader({
- name: 'activitypub/blog-extra-fields-search',
- hook: useBlogExtraFieldsCommandLoader
- });
-}
-})();
-
-/******/ })()
-;
-//# sourceMappingURL=plugin.js.map
\ No newline at end of file
+(()=>{"use strict";window.React;const e=window.wp.i18n,t=window.wp.data,i=window.wp.coreData,a=window.wp.element,o=window.ReactJSXRuntime,l=(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 80 80",width:"24",height:"24",children:[(0,o.jsx)("rect",{width:"80",height:"80",fill:"#f1027e"}),(0,o.jsx)("path",{d:"M42.9 19.8L72 36.6v6.7L42.9 60.2v-6.7L66.2 40 42.9 26.6v-6.8z",fillRule:"evenodd",clipRule:"evenodd",fill:"white"}),(0,o.jsx)("path",{d:"M42.9 33.3L54.5 40l-11.6 6.7V33.3z",fillRule:"evenodd",clipRule:"evenodd",fill:"white"}),(0,o.jsx)("path",{d:"M37.1 19.8L8 36.6v6.7l23.3-13.4v26.9l5.8 3.4V19.8zM25.5 40L13.8 46.7l11.6 6.7V40z",fillRule:"evenodd",clipRule:"evenodd",fill:"white"})]}),{actorMode:c,canManageOptions:n,followingEnabled:s}=window.activitypubCommandPalette||{followingEnabled:!1,actorMode:"actor",canManageOptions:!1},r=e=>{try{(0,t.dispatch)("core/commands").registerCommand(e)}catch(t){console.error("Failed to register ActivityPub command:",e.name,t)}},d=e=>{try{(0,t.dispatch)("core/commands").registerCommandLoader(e)}catch(t){console.error("Failed to register ActivityPub command loader:",e.name,t)}};"actor"!==c&&"actor_blog"!==c||(r({name:"activitypub/navigate-user-followers",label:(0,e.__)("ActivityPub: View Your Followers","activitypub"),icon:l,callback:({close:e})=>{document.location.href="users.php?page=activitypub-followers-list",e()}}),s&&r({name:"activitypub/navigate-user-following",label:(0,e.__)("ActivityPub: View Who You Follow","activitypub"),icon:l,callback:({close:e})=>{document.location.href="users.php?page=activitypub-following-list",e()}}),r({name:"activitypub/navigate-extra-fields",label:(0,e.__)("ActivityPub: View Extra Fields","activitypub"),icon:l,callback:({close:e})=>{document.location.href="edit.php?post_type=ap_extrafield",e()}}),r({name:"activitypub/add-extra-field",label:(0,e.__)("ActivityPub: Add New Extra Field","activitypub"),icon:l,callback:({close:e})=>{document.location.href="post-new.php?post_type=ap_extrafield",e()}}),d({name:"activitypub/extra-fields-search",hook:({search:o})=>{const{records:c,isLoading:n}=(0,t.useSelect)(e=>{const t=e(i.store),a=t.getCurrentUser(),l={search:o||void 0,per_page:10,orderby:o?"relevance":"date",status:"any",author:a?.id};return{records:t.getEntityRecords("postType","ap_extrafield",l),isLoading:!t.hasFinishedResolution("getEntityRecords",["postType","ap_extrafield",l])}},[o]);return{commands:(0,a.useMemo)(()=>(null!=c?c:[]).slice(0,10).map(t=>{const i=(t.title?.rendered||(0,e.__)("(no title)","activitypub")).replace(/["'`]/g,"");return{name:`activitypub/edit-extra-field/${t.id}`,label:(0,e.sprintf)(/* translators: %s: Extra field title */ /* translators: %s: Extra field title */
+(0,e.__)("ActivityPub: Edit - %s","activitypub"),i),icon:l,callback:({close:e})=>{document.location=`post.php?post=${t.id}&action=edit`,e()}}}),[c]),isLoading:n}}}),r({name:"activitypub/navigate-blocked-actors",label:(0,e.__)("ActivityPub: View Blocked Actors","activitypub"),icon:l,callback:({close:e})=>{document.location.href="users.php?page=activitypub-blocked-actors-list",e()}})),!n||"blog"!==c&&"actor_blog"!==c||(r({name:"activitypub/navigate-blog-followers",label:(0,e.__)("ActivityPub: View Blog Followers","activitypub"),icon:l,callback:({close:e})=>{document.location.href="options-general.php?page=activitypub&tab=followers",e()}}),s&&r({name:"activitypub/navigate-blog-following",label:(0,e.__)("ActivityPub: View Blog Following","activitypub"),icon:l,callback:({close:e})=>{document.location.href="options-general.php?page=activitypub&tab=following",e()}}),r({name:"activitypub/navigate-settings",label:(0,e.__)("ActivityPub: View Settings","activitypub"),icon:l,callback:({close:e})=>{document.location.href="options-general.php?page=activitypub&tab=settings",e()}}),r({name:"activitypub/navigate-blog-extra-fields",label:(0,e.__)("ActivityPub: View Blog Extra Fields","activitypub"),icon:l,callback:({close:e})=>{document.location.href="edit.php?post_type=ap_extrafield_blog",e()}}),r({name:"activitypub/add-blog-extra-field",label:(0,e.__)("ActivityPub: Add New Blog Extra Field","activitypub"),icon:l,callback:({close:e})=>{document.location.href="post-new.php?post_type=ap_extrafield_blog",e()}}),d({name:"activitypub/blog-extra-fields-search",hook:({search:o})=>{const{records:c,isLoading:n}=(0,t.useSelect)(e=>{const t=e(i.store),a={search:o||void 0,per_page:10,orderby:o?"relevance":"date",status:"any"};return{records:t.getEntityRecords("postType","ap_extrafield_blog",a),isLoading:!t.hasFinishedResolution("getEntityRecords",["postType","ap_extrafield_blog",a])}},[o]);return{commands:(0,a.useMemo)(()=>(null!=c?c:[]).slice(0,10).map(t=>{const i=(t.title?.rendered||(0,e.__)("(no title)","activitypub")).replace(/["'`]/g,"");return{name:`activitypub/edit-blog-extra-field/${t.id}`,label:(0,e.sprintf)(/* translators: %s: Blog extra field title */ /* translators: %s: Blog extra field title */
+(0,e.__)("ActivityPub: Edit Blog - %s","activitypub"),i),icon:l,callback:({close:e})=>{document.location=`post.php?post=${t.id}&action=edit`,e()}}}),[c]),isLoading:n}}}))})();
\ No newline at end of file
diff --git a/build/editor-plugin/plugin.asset.php b/build/editor-plugin/plugin.asset.php
index 94857c1386..2bc42a8252 100644
--- a/build/editor-plugin/plugin.asset.php
+++ b/build/editor-plugin/plugin.asset.php
@@ -1 +1 @@
- array('react-jsx-runtime', 'wp-components', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => 'f9953da56803b8af4fdf');
+ array('react-jsx-runtime', 'wp-components', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => '4371fba4c154ea1d6303');
diff --git a/build/editor-plugin/plugin.js b/build/editor-plugin/plugin.js
index bdfa585eae..b6ce964b64 100644
--- a/build/editor-plugin/plugin.js
+++ b/build/editor-plugin/plugin.js
@@ -1,564 +1 @@
-/******/ (() => { // webpackBootstrap
-/******/ "use strict";
-/******/ var __webpack_modules__ = ({
-
-/***/ "./node_modules/@wordpress/icons/build-module/icon/index.js":
-/*!******************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/icon/index.js ***!
- \******************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ icon_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-// packages/icons/src/icon/index.ts
-
-var icon_default = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(
- ({ icon, size = 24, ...props }, ref) => {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(icon, {
- width: size,
- height: size,
- ...props,
- ref
- });
- }
-);
-
-//# sourceMappingURL=index.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/external.js":
-/*!************************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/external.js ***!
- \************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ external_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/external.tsx
-
-
-var external_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.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" }) });
-
-//# sourceMappingURL=external.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/globe.js":
-/*!*********************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/globe.js ***!
- \*********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ globe_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/globe.tsx
-
-
-var globe_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8Zm6.5 8c0 .6 0 1.2-.2 1.8h-2.7c0-.6.2-1.1.2-1.8s0-1.2-.2-1.8h2.7c.2.6.2 1.1.2 1.8Zm-.9-3.2h-2.4c-.3-.9-.7-1.8-1.1-2.4-.1-.2-.2-.4-.3-.5 1.6.5 3 1.6 3.8 3ZM12.8 17c-.3.5-.6 1-.8 1.3-.2-.3-.5-.8-.8-1.3-.3-.5-.6-1.1-.8-1.7h3.3c-.2.6-.5 1.2-.8 1.7Zm-2.9-3.2c-.1-.6-.2-1.1-.2-1.8s0-1.2.2-1.8H14c.1.6.2 1.1.2 1.8s0 1.2-.2 1.8H9.9ZM11.2 7c.3-.5.6-1 .8-1.3.2.3.5.8.8 1.3.3.5.6 1.1.8 1.7h-3.3c.2-.6.5-1.2.8-1.7Zm-1-1.2c-.1.2-.2.3-.3.5-.4.7-.8 1.5-1.1 2.4H6.4c.8-1.4 2.2-2.5 3.8-3Zm-1.8 8H5.7c-.2-.6-.2-1.1-.2-1.8s0-1.2.2-1.8h2.7c0 .6-.2 1.1-.2 1.8s0 1.2.2 1.8Zm-2 1.4h2.4c.3.9.7 1.8 1.1 2.4.1.2.2.4.3.5-1.6-.5-3-1.6-3.8-3Zm7.4 3c.1-.2.2-.3.3-.5.4-.7.8-1.5 1.1-2.4h2.4c-.8 1.4-2.2 2.5-3.8 3Z" }) });
-
-//# sourceMappingURL=globe.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/people.js":
-/*!**********************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/people.js ***!
- \**********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ people_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/people.tsx
-
-
-var people_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(
- _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path,
- {
- d: "M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z",
- fillRule: "evenodd"
- }
-) });
-
-//# sourceMappingURL=people.js.map
-
-
-/***/ }),
-
-/***/ "./src/editor-plugin/utils.js":
-/*!************************************!*\
- !*** ./src/editor-plugin/utils.js ***!
- \************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ getDefaultVisibility: () => (/* binding */ getDefaultVisibility)
-/* harmony export */ });
-/**
- * Calculates the default visibility for a post based on its metadata and age.
- *
- * Priority order:
- * 1. Explicitly set visibility value
- * 2. Federated posts default to public
- * 3. Posts older than 1 month default to local
- * 4. New posts default to public
- *
- * @param {Object} meta The post metadata object.
- * @param {string|Date} postDate The post date.
- *
- * @return {string} The default visibility value ('public', 'quiet_public', or 'local').
- */
-const getDefaultVisibility = (meta, postDate) => {
- // If already set, use that value.
- if (meta?.activitypub_content_visibility) {
- return meta.activitypub_content_visibility;
- }
-
- // If post is federated, use public.
- if (meta?.activitypub_status === 'federated') {
- return 'public';
- }
-
- // If post is older than 1 month, default to local.
- if (postDate) {
- const postTimestamp = new Date(postDate).getTime();
- const oneMonthAgo = Date.now() - 30 * 24 * 60 * 60 * 1000;
- if (postTimestamp < oneMonthAgo) {
- return 'local';
- }
- }
-
- // Default to public for new posts.
- return 'public';
-};
-
-/***/ }),
-
-/***/ "@wordpress/components":
-/*!************************************!*\
- !*** external ["wp","components"] ***!
- \************************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["components"];
-
-/***/ }),
-
-/***/ "@wordpress/core-data":
-/*!**********************************!*\
- !*** external ["wp","coreData"] ***!
- \**********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["coreData"];
-
-/***/ }),
-
-/***/ "@wordpress/data":
-/*!******************************!*\
- !*** external ["wp","data"] ***!
- \******************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["data"];
-
-/***/ }),
-
-/***/ "@wordpress/edit-post":
-/*!**********************************!*\
- !*** external ["wp","editPost"] ***!
- \**********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["editPost"];
-
-/***/ }),
-
-/***/ "@wordpress/editor":
-/*!********************************!*\
- !*** external ["wp","editor"] ***!
- \********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["editor"];
-
-/***/ }),
-
-/***/ "@wordpress/element":
-/*!*********************************!*\
- !*** external ["wp","element"] ***!
- \*********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["element"];
-
-/***/ }),
-
-/***/ "@wordpress/i18n":
-/*!******************************!*\
- !*** external ["wp","i18n"] ***!
- \******************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["i18n"];
-
-/***/ }),
-
-/***/ "@wordpress/plugins":
-/*!*********************************!*\
- !*** external ["wp","plugins"] ***!
- \*********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["plugins"];
-
-/***/ }),
-
-/***/ "@wordpress/primitives":
-/*!************************************!*\
- !*** external ["wp","primitives"] ***!
- \************************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["primitives"];
-
-/***/ }),
-
-/***/ "@wordpress/url":
-/*!*****************************!*\
- !*** external ["wp","url"] ***!
- \*****************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["url"];
-
-/***/ }),
-
-/***/ "react/jsx-runtime":
-/*!**********************************!*\
- !*** external "ReactJSXRuntime" ***!
- \**********************************/
-/***/ ((module) => {
-
-module.exports = window["ReactJSXRuntime"];
-
-/***/ })
-
-/******/ });
-/************************************************************************/
-/******/ // The module cache
-/******/ var __webpack_module_cache__ = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/ // Check if module is in cache
-/******/ var cachedModule = __webpack_module_cache__[moduleId];
-/******/ if (cachedModule !== undefined) {
-/******/ return cachedModule.exports;
-/******/ }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = __webpack_module_cache__[moduleId] = {
-/******/ // no module.id needed
-/******/ // no module.loaded needed
-/******/ exports: {}
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/************************************************************************/
-/******/ /* webpack/runtime/compat get default export */
-/******/ (() => {
-/******/ // getDefaultExport function for compatibility with non-harmony modules
-/******/ __webpack_require__.n = (module) => {
-/******/ var getter = module && module.__esModule ?
-/******/ () => (module['default']) :
-/******/ () => (module);
-/******/ __webpack_require__.d(getter, { a: getter });
-/******/ return getter;
-/******/ };
-/******/ })();
-/******/
-/******/ /* webpack/runtime/define property getters */
-/******/ (() => {
-/******/ // define getter functions for harmony exports
-/******/ __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 */
-/******/ (() => {
-/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
-/******/ })();
-/******/
-/******/ /* webpack/runtime/make namespace object */
-/******/ (() => {
-/******/ // define __esModule on exports
-/******/ __webpack_require__.r = (exports) => {
-/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
-/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
-/******/ }
-/******/ Object.defineProperty(exports, '__esModule', { value: true });
-/******/ };
-/******/ })();
-/******/
-/************************************************************************/
-var __webpack_exports__ = {};
-// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
-(() => {
-/*!*************************************!*\
- !*** ./src/editor-plugin/plugin.js ***!
- \*************************************/
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/editor */ "@wordpress/editor");
-/* harmony import */ var _wordpress_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_editor__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/edit-post */ "@wordpress/edit-post");
-/* harmony import */ var _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_edit_post__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/plugins */ "@wordpress/plugins");
-/* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_plugins__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/icon/index.js");
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/external.js");
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/globe.js");
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/people.js");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__);
-/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data");
-/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_9__);
-/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
-/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_10__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__);
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_12__);
-/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./utils */ "./src/editor-plugin/utils.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__);
-
-
-
-
-
-
-
-
-
-
-
-
-/**
- * Editor plugin for ActivityPub settings in the block editor.
- *
- * @returns {React.JSX.Element|null} The settings panel for ActivityPub or null for sync blocks.
- */
-
-const EditorPlugin = () => {
- const postType = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_8__.useSelect)(select => select(_wordpress_editor__WEBPACK_IMPORTED_MODULE_0__.store).getCurrentPostType(), []);
- const [meta, setMeta] = (0,_wordpress_core_data__WEBPACK_IMPORTED_MODULE_9__.useEntityProp)('postType', postType, 'meta');
- const postDate = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_8__.useSelect)(select => select(_wordpress_editor__WEBPACK_IMPORTED_MODULE_0__.store).getCurrentPost().date, []);
-
- // Don't show when editing sync blocks.
- if ('wp_block' === postType) {
- return null;
- }
-
- /**
- * SVG for the not-allowed icon. Defining our own because it's too new in @wordpress/icons.
- *
- * @see https://github.com/WordPress/gutenberg/blob/trunk/packages/icons/src/library/not-allowed.js
- *
- * @var {React.JSX.Element} notAllowed The SVG for the not-allowed icon.
- */
- const notAllowed = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_12__.SVG, {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24",
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_12__.Path, {
- fillRule: "evenodd",
- clipRule: "evenodd",
- d: "M12 18.5A6.5 6.5 0 0 1 6.93 7.931l9.139 9.138A6.473 6.473 0 0 1 12 18.5Zm5.123-2.498a6.5 6.5 0 0 0-9.124-9.124l9.124 9.124ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z"
- })
- });
- const labelStyling = {
- verticalAlign: 'middle',
- gap: '4px',
- justifyContent: 'start',
- display: 'inline-flex',
- alignItems: 'center'
- };
-
- /**
- * Enhances a label with an icon and tooltip.
- *
- * @param {React.JSX.Element} icon The icon to display.
- * @param {string} text The label text.
- * @param {string} tooltip The tooltip text.
- *
- * @returns {React.JSX.Element} The enhanced label component.
- */
- const enhancedLabel = (icon, text, tooltip) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Tooltip, {
- text: tooltip,
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.__experimentalText, {
- style: labelStyling,
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_4__["default"], {
- icon: icon
- }), text]
- })
- });
-
- /*
- * Backwards compatibility with WordPress 6.5.
- * @todo Remove when 6.5 is no longer supported.
- */
- const SettingsPanel = _wordpress_editor__WEBPACK_IMPORTED_MODULE_0__.PluginDocumentSettingPanel || _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_1__.PluginDocumentSettingPanel;
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)(SettingsPanel, {
- name: "activitypub",
- className: "block-editor-block-inspector",
- title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Fediverse ⁂', 'activitypub'),
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.TextControl, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Content Warning', 'activitypub'),
- value: meta?.activitypub_content_warning,
- onChange: value => {
- setMeta({
- ...meta,
- activitypub_content_warning: value
- });
- },
- placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Optional content warning', 'activitypub'),
- help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Content warnings do not change the content on your site, only in the fediverse.', 'activitypub'),
- __next40pxDefaultSize: true,
- __nextHasNoMarginBottom: true
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.RangeControl, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Maximum Image Attachments', 'activitypub'),
- value: meta?.activitypub_max_image_attachments,
- onChange: value => {
- setMeta({
- ...meta,
- activitypub_max_image_attachments: value
- });
- },
- min: 0,
- max: 10,
- help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Maximum number of image attachments to include when sharing to the fediverse.', 'activitypub'),
- __next40pxDefaultSize: true,
- __nextHasNoMarginBottom: true
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.RadioControl, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Visibility', 'activitypub'),
- help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)("This adjusts the visibility of a post in the fediverse, but note that it won't affect how the post appears on the blog.", 'activitypub'),
- selected: (0,_utils__WEBPACK_IMPORTED_MODULE_13__.getDefaultVisibility)(meta, postDate),
- options: [{
- label: enhancedLabel(_wordpress_icons__WEBPACK_IMPORTED_MODULE_6__["default"], (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Public', 'activitypub'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Post will be visible to everyone and appear in public timelines.', 'activitypub')),
- value: 'public'
- }, {
- label: enhancedLabel(_wordpress_icons__WEBPACK_IMPORTED_MODULE_7__["default"], (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Quiet public', 'activitypub'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Post will be visible to everyone but will not appear in public timelines.', 'activitypub')),
- value: 'quiet_public'
- }, {
- label: enhancedLabel(notAllowed, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Do not federate', 'activitypub'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Post will not be shared to the Fediverse.', 'activitypub')),
- value: 'local'
- }],
- onChange: value => {
- setMeta({
- ...meta,
- activitypub_content_visibility: value
- });
- },
- className: "activitypub-visibility"
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.SelectControl, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Who can quote this post?', 'activitypub'),
- help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Quoting allows others to cite your post while adding their own commentary.', 'activitypub'),
- value: meta?.activitypub_interaction_policy_quote,
- options: [{
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Anyone', 'activitypub'),
- value: 'anyone'
- }, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Followers only', 'activitypub'),
- value: 'followers'
- }, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Just me', 'activitypub'),
- value: 'me'
- }],
- onChange: value => {
- setMeta({
- ...meta,
- activitypub_interaction_policy_quote: value
- });
- },
- __next40pxDefaultSize: true,
- __nextHasNoMarginBottom: true
- })]
- });
-};
-
-/**
- * Renders the preview menu item for Fediverse preview.
- *
- * @returns {React.JSX.Element} The preview menu item component.
- */
-const EditorPreview = () => {
- const post_status = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_8__.useSelect)(select => select(_wordpress_editor__WEBPACK_IMPORTED_MODULE_0__.store).getCurrentPost().status, []);
-
- /**
- * Opens the Fediverse preview for the current post in a new tab.
- */
- const onActivityPubPreview = () => {
- const previewLink = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_8__.select)(_wordpress_editor__WEBPACK_IMPORTED_MODULE_0__.store).getEditedPostPreviewLink();
- const fediversePreviewLink = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_10__.addQueryArgs)(previewLink, {
- activitypub: 'true'
- });
- window.open(fediversePreviewLink, '_blank');
- };
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.Fragment, {
- children: _wordpress_editor__WEBPACK_IMPORTED_MODULE_0__.PluginPreviewMenuItem ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_editor__WEBPACK_IMPORTED_MODULE_0__.PluginPreviewMenuItem, {
- onClick: onActivityPubPreview,
- icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__["default"],
- disabled: post_status === 'auto-draft',
- children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__.__)('Fediverse preview ⁂', 'activitypub')
- }) : null
- });
-};
-(0,_wordpress_plugins__WEBPACK_IMPORTED_MODULE_2__.registerPlugin)('activitypub-editor-plugin', {
- render: EditorPlugin
-});
-(0,_wordpress_plugins__WEBPACK_IMPORTED_MODULE_2__.registerPlugin)('activitypub-editor-preview', {
- render: EditorPreview
-});
-})();
-
-/******/ })()
-;
-//# sourceMappingURL=plugin.js.map
\ No newline at end of file
+(()=>{"use strict";const t=window.wp.editor,e=window.wp.editPost,i=window.wp.plugins,n=window.wp.components,a=window.wp.element;var o=(0,a.forwardRef)(({icon:t,size:e=24,...i},n)=>(0,a.cloneElement)(t,{width:e,height:e,...i,ref:n}));const l=window.wp.primitives,c=window.ReactJSXRuntime;var s=(0,c.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(l.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8Zm6.5 8c0 .6 0 1.2-.2 1.8h-2.7c0-.6.2-1.1.2-1.8s0-1.2-.2-1.8h2.7c.2.6.2 1.1.2 1.8Zm-.9-3.2h-2.4c-.3-.9-.7-1.8-1.1-2.4-.1-.2-.2-.4-.3-.5 1.6.5 3 1.6 3.8 3ZM12.8 17c-.3.5-.6 1-.8 1.3-.2-.3-.5-.8-.8-1.3-.3-.5-.6-1.1-.8-1.7h3.3c-.2.6-.5 1.2-.8 1.7Zm-2.9-3.2c-.1-.6-.2-1.1-.2-1.8s0-1.2.2-1.8H14c.1.6.2 1.1.2 1.8s0 1.2-.2 1.8H9.9ZM11.2 7c.3-.5.6-1 .8-1.3.2.3.5.8.8 1.3.3.5.6 1.1.8 1.7h-3.3c.2-.6.5-1.2.8-1.7Zm-1-1.2c-.1.2-.2.3-.3.5-.4.7-.8 1.5-1.1 2.4H6.4c.8-1.4 2.2-2.5 3.8-3Zm-1.8 8H5.7c-.2-.6-.2-1.1-.2-1.8s0-1.2.2-1.8h2.7c0 .6-.2 1.1-.2 1.8s0 1.2.2 1.8Zm-2 1.4h2.4c.3.9.7 1.8 1.1 2.4.1.2.2.4.3.5-1.6-.5-3-1.6-3.8-3Zm7.4 3c.1-.2.2-.3.3-.5.4-.7.8-1.5 1.1-2.4h2.4c-.8 1.4-2.2 2.5-3.8 3Z"})}),u=(0,c.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(l.Path,{d:"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z",fillRule:"evenodd"})}),r=(0,c.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(l.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"})});const p=window.wp.data,v=window.wp.coreData,w=window.wp.url,_=window.wp.i18n,h=(t,e)=>t?.activitypub_content_visibility?t.activitypub_content_visibility:"federated"===t?.activitypub_status?"public":e&&new Date(e).getTime(){const i=(0,p.useSelect)(e=>e(t.store).getCurrentPostType(),[]),[a,r]=(0,v.useEntityProp)("postType",i,"meta"),w=(0,p.useSelect)(e=>e(t.store).getCurrentPost().date,[]);if("wp_block"===i)return null;const b=(0,c.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(l.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5A6.5 6.5 0 0 1 6.93 7.931l9.139 9.138A6.473 6.473 0 0 1 12 18.5Zm5.123-2.498a6.5 6.5 0 0 0-9.124-9.124l9.124 9.124ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z"})}),d={verticalAlign:"middle",gap:"4px",justifyContent:"start",display:"inline-flex",alignItems:"center"},m=(t,e,i)=>(0,c.jsx)(n.Tooltip,{text:i,children:(0,c.jsxs)(n.__experimentalText,{style:d,children:[(0,c.jsx)(o,{icon:t}),e]})}),y=t.PluginDocumentSettingPanel||e.PluginDocumentSettingPanel;return(0,c.jsxs)(y,{name:"activitypub",className:"block-editor-block-inspector",title:(0,_.__)("Fediverse ⁂","activitypub"),children:[(0,c.jsx)(n.TextControl,{label:(0,_.__)("Content Warning","activitypub"),value:a?.activitypub_content_warning,onChange:t=>{r({...a,activitypub_content_warning:t})},placeholder:(0,_.__)("Optional content warning","activitypub"),help:(0,_.__)("Content warnings do not change the content on your site, only in the fediverse.","activitypub"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),(0,c.jsx)(n.RangeControl,{label:(0,_.__)("Maximum Image Attachments","activitypub"),value:a?.activitypub_max_image_attachments,onChange:t=>{r({...a,activitypub_max_image_attachments:t})},min:0,max:10,help:(0,_.__)("Maximum number of image attachments to include when sharing to the fediverse.","activitypub"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),(0,c.jsx)(n.RadioControl,{label:(0,_.__)("Visibility","activitypub"),help:(0,_.__)("This adjusts the visibility of a post in the fediverse, but note that it won't affect how the post appears on the blog.","activitypub"),selected:h(a,w),options:[{label:m(s,(0,_.__)("Public","activitypub"),(0,_.__)("Post will be visible to everyone and appear in public timelines.","activitypub")),value:"public"},{label:m(u,(0,_.__)("Quiet public","activitypub"),(0,_.__)("Post will be visible to everyone but will not appear in public timelines.","activitypub")),value:"quiet_public"},{label:m(b,(0,_.__)("Do not federate","activitypub"),(0,_.__)("Post will not be shared to the Fediverse.","activitypub")),value:"local"}],onChange:t=>{r({...a,activitypub_content_visibility:t})},className:"activitypub-visibility"}),(0,c.jsx)(n.SelectControl,{label:(0,_.__)("Who can quote this post?","activitypub"),help:(0,_.__)("Quoting allows others to cite your post while adding their own commentary.","activitypub"),value:a?.activitypub_interaction_policy_quote,options:[{label:(0,_.__)("Anyone","activitypub"),value:"anyone"},{label:(0,_.__)("Followers only","activitypub"),value:"followers"},{label:(0,_.__)("Just me","activitypub"),value:"me"}],onChange:t=>{r({...a,activitypub_interaction_policy_quote:t})},__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})]})}}),(0,i.registerPlugin)("activitypub-editor-preview",{render:()=>{const e=(0,p.useSelect)(e=>e(t.store).getCurrentPost().status,[]);return(0,c.jsx)(c.Fragment,{children:t.PluginPreviewMenuItem?(0,c.jsx)(t.PluginPreviewMenuItem,{onClick:()=>{const e=(0,p.select)(t.store).getEditedPostPreviewLink(),i=(0,w.addQueryArgs)(e,{activitypub:"true"});window.open(i,"_blank")},icon:r,disabled:"auto-draft"===e,children:(0,_.__)("Fediverse preview ⁂","activitypub")}):null})}})})();
\ No newline at end of file
diff --git a/build/extra-fields/index.asset.php b/build/extra-fields/index.asset.php
index bcf3891318..a2fa23f686 100644
--- a/build/extra-fields/index.asset.php
+++ b/build/extra-fields/index.asset.php
@@ -1 +1 @@
- array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '64ca4987a63ea444abd3');
+ array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '6f7cc2955f584ad618ba');
diff --git a/build/extra-fields/index.js b/build/extra-fields/index.js
index a5679680ab..c34ddc779f 100644
--- a/build/extra-fields/index.js
+++ b/build/extra-fields/index.js
@@ -1,736 +1,2 @@
-/******/ (() => { // webpackBootstrap
-/******/ "use strict";
-/******/ var __webpack_modules__ = ({
-
-/***/ "./src/extra-fields/block.json":
-/*!*************************************!*\
- !*** ./src/extra-fields/block.json ***!
- \*************************************/
-/***/ ((module) => {
-
-module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","name":"activitypub/extra-fields","apiVersion":3,"version":"1.0.0","title":"Fediverse Extra Fields","category":"widgets","description":"Display extra fields from ActivityPub user profiles","textdomain":"activitypub","icon":"list-view","supports":{"html":false,"align":["wide","full"],"color":{"gradients":true,"link":true,"__experimentalDefaultControls":{"background":true,"text":true,"link":true}},"__experimentalBorder":{"radius":true,"width":true,"color":true,"style":true},"shadow":true,"typography":{"fontSize":true,"__experimentalDefaultControls":{"fontSize":true}}},"styles":[{"name":"compact","label":"Compact","isDefault":true},{"name":"stacked","label":"Stacked"},{"name":"cards","label":"Cards"}],"attributes":{"selectedUser":{"type":"string","default":"blog"},"maxFields":{"type":"number","default":0}},"usesContext":["postType","postId"],"editorScript":"file:./index.js","style":"file:./style-index.css","render":"file:./render.php"}');
-
-/***/ }),
-
-/***/ "./src/extra-fields/edit.js":
-/*!**********************************!*\
- !*** ./src/extra-fields/edit.js ***!
- \**********************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Edit)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
-/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__);
-/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
-/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_5__);
-/* harmony import */ var _shared_use_options__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../shared/use-options */ "./src/shared/use-options.js");
-/* harmony import */ var _shared_use_user_options__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../shared/use-user-options */ "./src/shared/use-user-options.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__);
-/**
- * WordPress dependencies
- */
-
-
-
-
-
-
-
-/**
- * Internal dependencies
- */
-
-
-
-/**
- * Editor component for Extra Fields block.
- *
- * @param {Object} props Component props.
- * @param {Object} props.attributes Block attributes.
- * @param {Function} props.setAttributes Function to set attributes.
- * @param {Object} props.context Block context.
- * @return {Element} Component element.
- */
-
-function Edit({
- attributes,
- setAttributes,
- context
-}) {
- const {
- selectedUser,
- maxFields
- } = attributes;
- const {
- postId: contextPostId,
- postType: contextPostType
- } = context !== null && context !== void 0 ? context : {};
- const [fields, setFields] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)([]);
- const [isLoading, setIsLoading] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)(false);
- const [error, setError] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)(null);
-
- // Get author ID from context or current post depending on editor.
- const authorId = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
- const editorStore = select('core/editor');
- const coreStore = select('core');
- if (contextPostId && contextPostType && coreStore) {
- var _coreStore$getEditedE, _coreStore$getEntityR;
- const editedRecord = (_coreStore$getEditedE = coreStore.getEditedEntityRecord?.('postType', contextPostType, contextPostId)) !== null && _coreStore$getEditedE !== void 0 ? _coreStore$getEditedE : null;
- if (editedRecord?.author) {
- return editedRecord.author;
- }
- const record = (_coreStore$getEntityR = coreStore.getEntityRecord?.('postType', contextPostType, contextPostId)) !== null && _coreStore$getEntityR !== void 0 ? _coreStore$getEntityR : null;
- if (record?.author) {
- return record.author;
- }
- }
- if (editorStore && editorStore.getCurrentPostAttribute) {
- return editorStore.getCurrentPostAttribute('author');
- }
- return null;
- }, [contextPostId, contextPostType]);
-
- // Determine which user ID to fetch
- const getUserId = () => {
- if (selectedUser === 'blog') {
- return 0;
- }
- if (selectedUser === 'inherit') {
- if (authorId) {
- return authorId;
- }
- return null;
- }
- return selectedUser;
- };
- const userId = getUserId();
-
- // Get ActivityPub options
- const {
- namespace = 'activitypub/1.0',
- profileUrls = {}
- } = (0,_shared_use_options__WEBPACK_IMPORTED_MODULE_6__.useOptions)();
-
- // Select profile settings URL based on user type
- const profileUrl = selectedUser === 'blog' ? profileUrls.blog : profileUrls.user;
- const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
- className: 'activitypub-extra-fields-block-wrapper'
- });
-
- // Get user options for dropdown
- const userOptions = (0,_shared_use_user_options__WEBPACK_IMPORTED_MODULE_7__.useUserOptions)({
- withInherit: true
- });
-
- // Fetch extra fields
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
- if (userId === null) {
- setFields([]);
- return;
- }
- setIsLoading(true);
- setError(null);
- _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_5___default()({
- path: `/${namespace}/actors/${userId}`,
- headers: {
- Accept: 'application/activity+json'
- }
- }).then(actor => {
- // Extract fields from attachment array
- const attachments = actor.attachment || [];
- // Filter to only PropertyValue types (the main format)
- const propertyValues = attachments.filter(item => item.type === 'PropertyValue');
- setFields(propertyValues);
- setIsLoading(false);
- }).catch(err => {
- setError(err.message);
- setIsLoading(false);
- });
- }, [userId, namespace]);
-
- // Apply max fields limit for preview
- const displayFields = maxFields > 0 ? fields.slice(0, maxFields) : fields;
-
- // Extract background color for cards style
- const getCardStyle = () => {
- const isCardsStyle = attributes.className?.includes('is-style-cards');
- if (!isCardsStyle) {
- return {};
- }
-
- // Get background color from block attributes
- const style = attributes.style || {};
- const backgroundColor = attributes.backgroundColor;
- const customColor = style.color?.background;
- if (backgroundColor) {
- return {
- backgroundColor: `var(--wp--preset--color--${backgroundColor})`
- };
- } else if (customColor) {
- return {
- backgroundColor: customColor
- };
- }
- return {};
- };
- const cardStyle = getCardStyle();
- const settingsPanel = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, {
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, {
- title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Settings', 'activitypub'),
- initialOpen: true,
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.SelectControl, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('User', 'activitypub'),
- value: selectedUser,
- options: userOptions,
- onChange: value => setAttributes({
- selectedUser: value
- })
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.RangeControl, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Maximum Fields', 'activitypub'),
- value: maxFields,
- onChange: value => setAttributes({
- maxFields: value
- }),
- min: 0,
- max: 20,
- help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Limit the number of fields displayed. 0 = show all.', 'activitypub')
- })]
- })
- });
-
- // Render placeholder if inherit mode but no author. Keep controls mounted for recovery.
- if (selectedUser === 'inherit' && !authorId) {
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.Fragment, {
- children: [settingsPanel, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
- ...blockProps,
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Placeholder, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Fediverse Extra Fields', 'activitypub'),
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("p", {
- children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This block will display extra fields based on the post author when published.', 'activitypub')
- })
- })
- })]
- });
- }
-
- // Render loading state
- if (isLoading) {
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
- ...blockProps,
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Placeholder, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Fediverse Extra Fields', 'activitypub'),
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Spinner, {})
- })
- });
- }
-
- // Render error state
- if (error) {
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
- ...blockProps,
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Placeholder, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Fediverse Extra Fields', 'activitypub'),
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("p", {
- children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %s: Error message */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Error loading extra fields: %s', 'activitypub'), error)
- })
- })
- });
- }
-
- // Render empty state
- if (displayFields.length === 0) {
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.Fragment, {
- children: [settingsPanel, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
- ...blockProps,
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Placeholder, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Fediverse Extra Fields', 'activitypub'),
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("p", {
- children: [(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('No extra fields found.', 'activitypub'), ' ', profileUrl && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
- variant: "link",
- onClick: () => {
- window.location.href = profileUrl;
- },
- children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add fields in your profile settings', 'activitypub')
- })]
- })
- })
- })]
- });
- }
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.Fragment, {
- children: [settingsPanel, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
- ...blockProps,
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("dl", {
- className: "activitypub-extra-fields",
- children: displayFields.map(field => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
- className: "activitypub-extra-field",
- style: cardStyle,
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("dt", {
- children: field.name
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("dd", {
- dangerouslySetInnerHTML: {
- __html: field.value
- }
- })]
- }, `${field.name}-${field.value}`))
- })
- })]
- });
-}
-
-/***/ }),
-
-/***/ "./src/extra-fields/index.js":
-/*!***********************************!*\
- !*** ./src/extra-fields/index.js ***!
- \***********************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
-/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./edit */ "./src/extra-fields/edit.js");
-/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./block.json */ "./src/extra-fields/block.json");
-/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./style.scss */ "./src/extra-fields/style.scss");
-/**
- * WordPress dependencies
- */
-
-
-/**
- * Internal dependencies
- */
-
-
-
-
-/**
- * Register the Extra Fields block.
- *
- * This block uses server-side rendering, so the save function returns null.
- */
-(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_2__.name, {
- edit: _edit__WEBPACK_IMPORTED_MODULE_1__["default"],
- save: () => null
-});
-
-/***/ }),
-
-/***/ "./src/extra-fields/style.scss":
-/*!*************************************!*\
- !*** ./src/extra-fields/style.scss ***!
- \*************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-// extracted by mini-css-extract-plugin
-
-
-/***/ }),
-
-/***/ "./src/shared/use-options.js":
-/*!***********************************!*\
- !*** ./src/shared/use-options.js ***!
- \***********************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ useOptions: () => (/* binding */ useOptions)
-/* harmony export */ });
-/**
- * React hook to return the ActivityPub options object from the global window.
- *
- * @returns {Object} The options object.
- */
-function useOptions() {
- return window._activityPubOptions || {};
-}
-
-/***/ }),
-
-/***/ "./src/shared/use-user-options.js":
-/*!****************************************!*\
- !*** ./src/shared/use-user-options.js ***!
- \****************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ useUserOptions: () => (/* binding */ useUserOptions)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
-/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _use_options__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./use-options */ "./src/shared/use-options.js");
-
-
-
-
-
-
-/**
- * React hook providing user options for ActivityPub blocks.
- *
- * @param {Object} params
- * @param {boolean} params.withInherit - Whether to include the inherit option.
- * @returns {Array} List of user option objects.
- */
-function useUserOptions({
- withInherit = false
-}) {
- /**
- * ActivityPub options.
- *
- * @type {Object}
- * @property {boolean} enabled.users - Whether users are enabled.
- * @property {boolean} enabled.blog - Whether the blog user is enabled.
- */
- const {
- enabled,
- namespace
- } = (0,_use_options__WEBPACK_IMPORTED_MODULE_4__.useOptions)();
- const [currentUserCanActivityPub, setCurrentUserCanActivityPub] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
- const {
- fetchedUsers,
- isLoadingUsers
- } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
- const {
- getUsers,
- getIsResolving
- } = select('core');
- return {
- fetchedUsers: enabled?.users ? getUsers({
- capabilities: 'activitypub'
- }) : null,
- isLoadingUsers: enabled?.users ? getIsResolving('getUsers', [{
- capabilities: 'activitypub'
- }]) : false
- };
- }, []);
-
- // Only fetch current user if fetchedUsers is empty and we're not still loading.
- const currentUser = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => fetchedUsers || isLoadingUsers ? null : select('core').getCurrentUser(), [fetchedUsers, isLoadingUsers]);
-
- // Test if current user has activitypub capability by trying to access their actor endpoint.
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
- if (fetchedUsers || isLoadingUsers || !currentUser) {
- return;
- }
- _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3___default()({
- path: `/${namespace}/actors/${currentUser.id}`,
- method: 'HEAD',
- headers: {
- Accept: 'application/activity+json'
- },
- parse: false
- }).then(() => setCurrentUserCanActivityPub(true)).catch(() => setCurrentUserCanActivityPub(false));
- }, [fetchedUsers, isLoadingUsers, currentUser]);
- const users = fetchedUsers || (currentUser && currentUserCanActivityPub ? [{
- id: currentUser.id,
- name: currentUser.name
- }] : []);
-
- /**
- * Memoized computation of user options for block settings.
- */
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
- if (!users.length) {
- return [];
- }
- const userKeywords = [];
- if (enabled?.blog && fetchedUsers) {
- userKeywords.push({
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Blog', 'activitypub'),
- value: 'blog'
- });
- }
-
- // Only show the inherit option when explicitly asked for and users are enabled.
- if (withInherit && enabled?.users && fetchedUsers) {
- userKeywords.push({
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Dynamic User', 'activitypub'),
- value: 'inherit'
- });
- }
-
- /**
- * Reduce users into keyword/value pairs for options.
- */
- return users.reduce((acc, user) => {
- acc.push({
- label: user.name,
- value: `${user.id}` // Casting to string because that's how Gutenberg stores the attribute.
- });
- return acc;
- }, userKeywords);
- }, [users]);
-}
-
-/***/ }),
-
-/***/ "@wordpress/api-fetch":
-/*!**********************************!*\
- !*** external ["wp","apiFetch"] ***!
- \**********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["apiFetch"];
-
-/***/ }),
-
-/***/ "@wordpress/block-editor":
-/*!*************************************!*\
- !*** external ["wp","blockEditor"] ***!
- \*************************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["blockEditor"];
-
-/***/ }),
-
-/***/ "@wordpress/blocks":
-/*!********************************!*\
- !*** external ["wp","blocks"] ***!
- \********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["blocks"];
-
-/***/ }),
-
-/***/ "@wordpress/components":
-/*!************************************!*\
- !*** external ["wp","components"] ***!
- \************************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["components"];
-
-/***/ }),
-
-/***/ "@wordpress/data":
-/*!******************************!*\
- !*** external ["wp","data"] ***!
- \******************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["data"];
-
-/***/ }),
-
-/***/ "@wordpress/element":
-/*!*********************************!*\
- !*** external ["wp","element"] ***!
- \*********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["element"];
-
-/***/ }),
-
-/***/ "@wordpress/i18n":
-/*!******************************!*\
- !*** external ["wp","i18n"] ***!
- \******************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["i18n"];
-
-/***/ }),
-
-/***/ "react/jsx-runtime":
-/*!**********************************!*\
- !*** external "ReactJSXRuntime" ***!
- \**********************************/
-/***/ ((module) => {
-
-module.exports = window["ReactJSXRuntime"];
-
-/***/ })
-
-/******/ });
-/************************************************************************/
-/******/ // The module cache
-/******/ var __webpack_module_cache__ = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/ // Check if module is in cache
-/******/ var cachedModule = __webpack_module_cache__[moduleId];
-/******/ if (cachedModule !== undefined) {
-/******/ return cachedModule.exports;
-/******/ }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = __webpack_module_cache__[moduleId] = {
-/******/ // no module.id needed
-/******/ // no module.loaded needed
-/******/ exports: {}
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/******/ // expose the modules object (__webpack_modules__)
-/******/ __webpack_require__.m = __webpack_modules__;
-/******/
-/************************************************************************/
-/******/ /* webpack/runtime/chunk loaded */
-/******/ (() => {
-/******/ var deferred = [];
-/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
-/******/ if(chunkIds) {
-/******/ priority = priority || 0;
-/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
-/******/ deferred[i] = [chunkIds, fn, priority];
-/******/ return;
-/******/ }
-/******/ var notFulfilled = Infinity;
-/******/ for (var i = 0; i < deferred.length; i++) {
-/******/ var [chunkIds, fn, priority] = deferred[i];
-/******/ var fulfilled = true;
-/******/ for (var j = 0; j < chunkIds.length; j++) {
-/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
-/******/ chunkIds.splice(j--, 1);
-/******/ } else {
-/******/ fulfilled = false;
-/******/ if(priority < notFulfilled) notFulfilled = priority;
-/******/ }
-/******/ }
-/******/ if(fulfilled) {
-/******/ deferred.splice(i--, 1)
-/******/ var r = fn();
-/******/ if (r !== undefined) result = r;
-/******/ }
-/******/ }
-/******/ return result;
-/******/ };
-/******/ })();
-/******/
-/******/ /* webpack/runtime/compat get default export */
-/******/ (() => {
-/******/ // getDefaultExport function for compatibility with non-harmony modules
-/******/ __webpack_require__.n = (module) => {
-/******/ var getter = module && module.__esModule ?
-/******/ () => (module['default']) :
-/******/ () => (module);
-/******/ __webpack_require__.d(getter, { a: getter });
-/******/ return getter;
-/******/ };
-/******/ })();
-/******/
-/******/ /* webpack/runtime/define property getters */
-/******/ (() => {
-/******/ // define getter functions for harmony exports
-/******/ __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 */
-/******/ (() => {
-/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
-/******/ })();
-/******/
-/******/ /* webpack/runtime/make namespace object */
-/******/ (() => {
-/******/ // define __esModule on 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/jsonp chunk loading */
-/******/ (() => {
-/******/ // no baseURI
-/******/
-/******/ // object to store loaded and loading chunks
-/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
-/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
-/******/ var installedChunks = {
-/******/ "extra-fields/index": 0,
-/******/ "extra-fields/style-index": 0
-/******/ };
-/******/
-/******/ // no chunk on demand loading
-/******/
-/******/ // no prefetching
-/******/
-/******/ // no preloaded
-/******/
-/******/ // no HMR
-/******/
-/******/ // no HMR manifest
-/******/
-/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
-/******/
-/******/ // install a JSONP callback for chunk loading
-/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
-/******/ var [chunkIds, moreModules, runtime] = data;
-/******/ // add "moreModules" to the modules object,
-/******/ // then flag all "chunkIds" as loaded and fire callback
-/******/ var moduleId, chunkId, i = 0;
-/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
-/******/ for(moduleId in moreModules) {
-/******/ if(__webpack_require__.o(moreModules, moduleId)) {
-/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
-/******/ }
-/******/ }
-/******/ if(runtime) var result = runtime(__webpack_require__);
-/******/ }
-/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
-/******/ for(;i < chunkIds.length; i++) {
-/******/ chunkId = chunkIds[i];
-/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
-/******/ installedChunks[chunkId][0]();
-/******/ }
-/******/ installedChunks[chunkId] = 0;
-/******/ }
-/******/ return __webpack_require__.O(result);
-/******/ }
-/******/
-/******/ var chunkLoadingGlobal = globalThis["webpackChunkwordpress_activitypub"] = globalThis["webpackChunkwordpress_activitypub"] || [];
-/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
-/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
-/******/ })();
-/******/
-/************************************************************************/
-/******/
-/******/ // startup
-/******/ // Load entry module and return exports
-/******/ // This entry module depends on other loaded chunks and execution need to be delayed
-/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["extra-fields/style-index"], () => (__webpack_require__("./src/extra-fields/index.js")))
-/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
-/******/
-/******/ })()
-;
-//# sourceMappingURL=index.js.map
\ No newline at end of file
+(()=>{"use strict";var e,t={157:(e,t,i)=>{const r=window.wp.blocks,s=window.wp.i18n,l=window.wp.blockEditor,n=window.wp.components,a=window.wp.data,o=window.wp.element,c=window.wp.apiFetch;var d=i.n(c);function u(){return window._activityPubOptions||{}}const p=window.ReactJSXRuntime,h=JSON.parse('{"UU":"activitypub/extra-fields"}');(0,r.registerBlockType)(h.UU,{edit:function({attributes:e,setAttributes:t,context:i}){const{selectedUser:r,maxFields:c}=e,{postId:h,postType:v}=null!=i?i:{},[b,y]=(0,o.useState)([]),[f,x]=(0,o.useState)(!1),[g,w]=(0,o.useState)(null),m=(0,a.useSelect)(e=>{const t=e("core/editor"),i=e("core");if(h&&v&&i){var r,s;const e=null!==(r=i.getEditedEntityRecord?.("postType",v,h))&&void 0!==r?r:null;if(e?.author)return e.author;const t=null!==(s=i.getEntityRecord?.("postType",v,h))&&void 0!==s?s:null;if(t?.author)return t.author}return t&&t.getCurrentPostAttribute?t.getCurrentPostAttribute("author"):null},[h,v]),_="blog"===r?0:"inherit"===r?m||null:r,{namespace:j="activitypub/1.0",profileUrls:k={}}=u(),U="blog"===r?k.blog:k.user,F=(0,l.useBlockProps)({className:"activitypub-extra-fields-block-wrapper"}),C=function({withInherit:e=!1}){const{enabled:t,namespace:i}=u(),[r,l]=(0,o.useState)(!1),{fetchedUsers:n,isLoadingUsers:c}=(0,a.useSelect)(e=>{const{getUsers:i,getIsResolving:r}=e("core");return{fetchedUsers:t?.users?i({capabilities:"activitypub"}):null,isLoadingUsers:!!t?.users&&r("getUsers",[{capabilities:"activitypub"}])}},[]),p=(0,a.useSelect)(e=>n||c?null:e("core").getCurrentUser(),[n,c]);(0,o.useEffect)(()=>{n||c||!p||d()({path:`/${i}/actors/${p.id}`,method:"HEAD",headers:{Accept:"application/activity+json"},parse:!1}).then(()=>l(!0)).catch(()=>l(!1))},[n,c,p]);const h=n||(p&&r?[{id:p.id,name:p.name}]:[]);return(0,o.useMemo)(()=>{if(!h.length)return[];const i=[];return t?.blog&&n&&i.push({label:(0,s.__)("Blog","activitypub"),value:"blog"}),e&&t?.users&&n&&i.push({label:(0,s.__)("Dynamic User","activitypub"),value:"inherit"}),h.reduce((e,t)=>(e.push({label:t.name,value:`${t.id}`}),e),i)},[h])}({withInherit:!0});(0,o.useEffect)(()=>{null!==_?(x(!0),w(null),d()({path:`/${j}/actors/${_}`,headers:{Accept:"application/activity+json"}}).then(e=>{const t=(e.attachment||[]).filter(e=>"PropertyValue"===e.type);y(t),x(!1)}).catch(e=>{w(e.message),x(!1)})):y([])},[_,j]);const O=c>0?b.slice(0,c):b,E=(()=>{const t=e.className?.includes("is-style-cards");if(!t)return{};const i=e.style||{},r=e.backgroundColor,s=i.color?.background;return r?{backgroundColor:`var(--wp--preset--color--${r})`}:s?{backgroundColor:s}:{}})(),S=(0,p.jsx)(l.InspectorControls,{children:(0,p.jsxs)(n.PanelBody,{title:(0,s.__)("Settings","activitypub"),initialOpen:!0,children:[(0,p.jsx)(n.SelectControl,{label:(0,s.__)("User","activitypub"),value:r,options:C,onChange:e=>t({selectedUser:e})}),(0,p.jsx)(n.RangeControl,{label:(0,s.__)("Maximum Fields","activitypub"),value:c,onChange:e=>t({maxFields:e}),min:0,max:20,help:(0,s.__)("Limit the number of fields displayed. 0 = show all.","activitypub")})]})});return"inherit"!==r||m?f?(0,p.jsx)("div",{...F,children:(0,p.jsx)(n.Placeholder,{label:(0,s.__)("Fediverse Extra Fields","activitypub"),children:(0,p.jsx)(n.Spinner,{})})}):g?(0,p.jsx)("div",{...F,children:(0,p.jsx)(n.Placeholder,{label:(0,s.__)("Fediverse Extra Fields","activitypub"),children:(0,p.jsx)("p",{children:(0,s.sprintf)(/* translators: %s: Error message */ /* translators: %s: Error message */
+(0,s.__)("Error loading extra fields: %s","activitypub"),g)})})}):0===O.length?(0,p.jsxs)(p.Fragment,{children:[S,(0,p.jsx)("div",{...F,children:(0,p.jsx)(n.Placeholder,{label:(0,s.__)("Fediverse Extra Fields","activitypub"),children:(0,p.jsxs)("p",{children:[(0,s.__)("No extra fields found.","activitypub")," ",U&&(0,p.jsx)(n.Button,{variant:"link",onClick:()=>{window.location.href=U},children:(0,s.__)("Add fields in your profile settings","activitypub")})]})})})]}):(0,p.jsxs)(p.Fragment,{children:[S,(0,p.jsx)("div",{...F,children:(0,p.jsx)("dl",{className:"activitypub-extra-fields",children:O.map(e=>(0,p.jsxs)("div",{className:"activitypub-extra-field",style:E,children:[(0,p.jsx)("dt",{children:e.name}),(0,p.jsx)("dd",{dangerouslySetInnerHTML:{__html:e.value}})]},`${e.name}-${e.value}`))})})]}):(0,p.jsxs)(p.Fragment,{children:[S,(0,p.jsx)("div",{...F,children:(0,p.jsx)(n.Placeholder,{label:(0,s.__)("Fediverse Extra Fields","activitypub"),children:(0,p.jsx)("p",{children:(0,s.__)("This block will display extra fields based on the post author when published.","activitypub")})})})]})},save:()=>null})}},i={};function r(e){var s=i[e];if(void 0!==s)return s.exports;var l=i[e]={exports:{}};return t[e](l,l.exports,r),l.exports}r.m=t,e=[],r.O=(t,i,s,l)=>{if(!i){var n=1/0;for(d=0;d=l)&&Object.keys(r.O).every(e=>r.O[e](i[o]))?i.splice(o--,1):(a=!1,l0&&e[d-1][2]>l;d--)e[d]=e[d-1];e[d]=[i,s,l]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={914:0,678:0};r.O.j=t=>0===e[t];var t=(t,i)=>{var s,l,[n,a,o]=i,c=0;if(n.some(t=>0!==e[t])){for(s in a)r.o(a,s)&&(r.m[s]=a[s]);if(o)var d=o(r)}for(t&&t(i);cr(157));s=r.O(s)})();
\ No newline at end of file
diff --git a/build/extra-fields/style-index-rtl.css b/build/extra-fields/style-index-rtl.css
index 0232e06b2e..4f1e363b32 100644
--- a/build/extra-fields/style-index-rtl.css
+++ b/build/extra-fields/style-index-rtl.css
@@ -1,142 +1 @@
-/*!****************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/extra-fields/style.scss ***!
- \****************************************************************************************************************************************************************************************************************************************************/
-/**
- * Styles for the Extra Fields block.
- */
-.activitypub-extra-fields-block-wrapper.has-background .activitypub-extra-fields, .activitypub-extra-fields-block-wrapper.has-border .activitypub-extra-fields, .activitypub-extra-fields-block-wrapper.is-style-stacked.has-background .activitypub-extra-fields, .activitypub-extra-fields-block-wrapper.is-style-stacked.has-border .activitypub-extra-fields {
- padding: 1rem;
-}
-.activitypub-extra-fields-block-wrapper.is-style-cards.has-background .activitypub-extra-fields, .activitypub-extra-fields-block-wrapper.is-style-cards.has-border .activitypub-extra-fields {
- padding: 0;
-}
-.activitypub-extra-fields {
- margin: 0;
- padding: 0;
- list-style: none;
-}
-/**
- * Default Compact Style
- * Displays fields in a table-like format with aligned labels and values.
- * This is the default style, so it applies without a style class.
- */
-.activitypub-extra-fields {
- display: table;
- table-layout: fixed;
-}
-.activitypub-extra-field {
- display: table-row;
- margin-bottom: 0;
-}
-.activitypub-extra-field dt {
- display: table-cell;
- padding-bottom: 0.5em;
- margin-bottom: 0;
- padding-left: 10px;
- white-space: nowrap;
- vertical-align: baseline;
- text-overflow: ellipsis;
- font-weight: 600;
- color: inherit;
-}
-.activitypub-extra-field dt::after {
- content: ":";
-}
-.activitypub-extra-field dd {
- display: table-cell;
- padding-bottom: 0.5em;
- vertical-align: baseline;
- word-break: break-word;
- margin-right: 0;
- margin-bottom: 0;
- color: inherit;
-}
-.activitypub-extra-field dd p {
- margin-top: 0;
- margin-bottom: 0.5em;
-}
-.activitypub-extra-field dd p:last-child {
- margin-bottom: 0;
-}
-.activitypub-extra-field dd a {
- color: inherit;
- text-decoration: underline;
-}
-.activitypub-extra-field dd a:hover {
- text-decoration: none;
-}
-/**
- * Stacked Style
- * Displays fields in a stacked format with label on top and value below.
- */
-.is-style-stacked .activitypub-extra-fields {
- display: block;
- table-layout: auto;
-}
-.is-style-stacked .activitypub-extra-field {
- display: block;
- margin-bottom: 1em;
-}
-.is-style-stacked .activitypub-extra-field:last-child {
- margin-bottom: 0;
-}
-.is-style-stacked .activitypub-extra-field dt {
- display: block;
- padding-bottom: 0;
- padding-left: 0;
- margin-bottom: 0.25em;
- white-space: normal;
- text-overflow: clip;
-}
-.is-style-stacked .activitypub-extra-field dt::after {
- content: none;
-}
-.is-style-stacked .activitypub-extra-field dd {
- display: block;
- padding-bottom: 0;
-}
-/**
- * Cards Style
- * Displays each field in its own bordered card with padding.
- */
-.is-style-cards.has-background {
- background: transparent !important;
-}
-.is-style-cards.has-background .activitypub-extra-fields {
- padding: 1rem;
-}
-.is-style-cards .activitypub-extra-fields {
- display: block;
- table-layout: auto;
-}
-.is-style-cards .activitypub-extra-field {
- display: block;
- border: 1px solid var(--wp--preset--color--contrast-2, #ddd);
- border-radius: 8px;
- padding: 1em;
- margin-bottom: 1em;
- background: var(--wp--preset--color--base, #fff);
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
-}
-.is-style-cards .activitypub-extra-field:last-child {
- margin-bottom: 0;
-}
-.is-style-cards .activitypub-extra-field dt {
- display: block;
- font-size: 0.9em;
- text-transform: uppercase;
- letter-spacing: 0.5px;
- color: currentColor;
- margin-bottom: 0.5em;
- padding-bottom: 0;
- padding-left: 0;
- white-space: normal;
-}
-.is-style-cards .activitypub-extra-field dt::after {
- content: none;
-}
-.is-style-cards .activitypub-extra-field dd {
- display: block;
- font-size: 1em;
- padding-bottom: 0;
-}
+.activitypub-extra-fields-block-wrapper.has-background .activitypub-extra-fields,.activitypub-extra-fields-block-wrapper.has-border .activitypub-extra-fields,.activitypub-extra-fields-block-wrapper.is-style-stacked.has-background .activitypub-extra-fields,.activitypub-extra-fields-block-wrapper.is-style-stacked.has-border .activitypub-extra-fields{padding:1rem}.activitypub-extra-fields-block-wrapper.is-style-cards.has-background .activitypub-extra-fields,.activitypub-extra-fields-block-wrapper.is-style-cards.has-border .activitypub-extra-fields{padding:0}.activitypub-extra-fields{display:table;list-style:none;margin:0;padding:0;table-layout:fixed}.activitypub-extra-field{display:table-row;margin-bottom:0}.activitypub-extra-field dt{color:inherit;display:table-cell;font-weight:600;margin-bottom:0;padding-bottom:.5em;padding-left:10px;text-overflow:ellipsis;vertical-align:baseline;white-space:nowrap}.activitypub-extra-field dt:after{content:":"}.activitypub-extra-field dd{color:inherit;display:table-cell;margin-bottom:0;margin-right:0;padding-bottom:.5em;vertical-align:baseline;word-break:break-word}.activitypub-extra-field dd p{margin-bottom:.5em;margin-top:0}.activitypub-extra-field dd p:last-child{margin-bottom:0}.activitypub-extra-field dd a{color:inherit;text-decoration:underline}.activitypub-extra-field dd a:hover{text-decoration:none}.is-style-stacked .activitypub-extra-fields{display:block;table-layout:auto}.is-style-stacked .activitypub-extra-field{display:block;margin-bottom:1em}.is-style-stacked .activitypub-extra-field:last-child{margin-bottom:0}.is-style-stacked .activitypub-extra-field dt{display:block;margin-bottom:.25em;padding-bottom:0;padding-left:0;text-overflow:clip;white-space:normal}.is-style-stacked .activitypub-extra-field dt:after{content:none}.is-style-stacked .activitypub-extra-field dd{display:block;padding-bottom:0}.is-style-cards.has-background{background:transparent!important}.is-style-cards.has-background .activitypub-extra-fields{padding:1rem}.is-style-cards .activitypub-extra-fields{display:block;table-layout:auto}.is-style-cards .activitypub-extra-field{background:var(--wp--preset--color--base,#fff);border:1px solid var(--wp--preset--color--contrast-2,#ddd);border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.05);display:block;margin-bottom:1em;padding:1em}.is-style-cards .activitypub-extra-field:last-child{margin-bottom:0}.is-style-cards .activitypub-extra-field dt{color:currentColor;display:block;font-size:.9em;letter-spacing:.5px;margin-bottom:.5em;padding-bottom:0;padding-left:0;text-transform:uppercase;white-space:normal}.is-style-cards .activitypub-extra-field dt:after{content:none}.is-style-cards .activitypub-extra-field dd{display:block;font-size:1em;padding-bottom:0}
diff --git a/build/extra-fields/style-index.css b/build/extra-fields/style-index.css
index 28022321be..2c8cd64fa1 100644
--- a/build/extra-fields/style-index.css
+++ b/build/extra-fields/style-index.css
@@ -1,144 +1 @@
-/*!****************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/extra-fields/style.scss ***!
- \****************************************************************************************************************************************************************************************************************************************************/
-/**
- * Styles for the Extra Fields block.
- */
-.activitypub-extra-fields-block-wrapper.has-background .activitypub-extra-fields, .activitypub-extra-fields-block-wrapper.has-border .activitypub-extra-fields, .activitypub-extra-fields-block-wrapper.is-style-stacked.has-background .activitypub-extra-fields, .activitypub-extra-fields-block-wrapper.is-style-stacked.has-border .activitypub-extra-fields {
- padding: 1rem;
-}
-.activitypub-extra-fields-block-wrapper.is-style-cards.has-background .activitypub-extra-fields, .activitypub-extra-fields-block-wrapper.is-style-cards.has-border .activitypub-extra-fields {
- padding: 0;
-}
-.activitypub-extra-fields {
- margin: 0;
- padding: 0;
- list-style: none;
-}
-/**
- * Default Compact Style
- * Displays fields in a table-like format with aligned labels and values.
- * This is the default style, so it applies without a style class.
- */
-.activitypub-extra-fields {
- display: table;
- table-layout: fixed;
-}
-.activitypub-extra-field {
- display: table-row;
- margin-bottom: 0;
-}
-.activitypub-extra-field dt {
- display: table-cell;
- padding-bottom: 0.5em;
- margin-bottom: 0;
- padding-right: 10px;
- white-space: nowrap;
- vertical-align: baseline;
- text-overflow: ellipsis;
- font-weight: 600;
- color: inherit;
-}
-.activitypub-extra-field dt::after {
- content: ":";
-}
-.activitypub-extra-field dd {
- display: table-cell;
- padding-bottom: 0.5em;
- vertical-align: baseline;
- word-break: break-word;
- margin-left: 0;
- margin-bottom: 0;
- color: inherit;
-}
-.activitypub-extra-field dd p {
- margin-top: 0;
- margin-bottom: 0.5em;
-}
-.activitypub-extra-field dd p:last-child {
- margin-bottom: 0;
-}
-.activitypub-extra-field dd a {
- color: inherit;
- text-decoration: underline;
-}
-.activitypub-extra-field dd a:hover {
- text-decoration: none;
-}
-/**
- * Stacked Style
- * Displays fields in a stacked format with label on top and value below.
- */
-.is-style-stacked .activitypub-extra-fields {
- display: block;
- table-layout: auto;
-}
-.is-style-stacked .activitypub-extra-field {
- display: block;
- margin-bottom: 1em;
-}
-.is-style-stacked .activitypub-extra-field:last-child {
- margin-bottom: 0;
-}
-.is-style-stacked .activitypub-extra-field dt {
- display: block;
- padding-bottom: 0;
- padding-right: 0;
- margin-bottom: 0.25em;
- white-space: normal;
- text-overflow: clip;
-}
-.is-style-stacked .activitypub-extra-field dt::after {
- content: none;
-}
-.is-style-stacked .activitypub-extra-field dd {
- display: block;
- padding-bottom: 0;
-}
-/**
- * Cards Style
- * Displays each field in its own bordered card with padding.
- */
-.is-style-cards.has-background {
- background: transparent !important;
-}
-.is-style-cards.has-background .activitypub-extra-fields {
- padding: 1rem;
-}
-.is-style-cards .activitypub-extra-fields {
- display: block;
- table-layout: auto;
-}
-.is-style-cards .activitypub-extra-field {
- display: block;
- border: 1px solid var(--wp--preset--color--contrast-2, #ddd);
- border-radius: 8px;
- padding: 1em;
- margin-bottom: 1em;
- background: var(--wp--preset--color--base, #fff);
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
-}
-.is-style-cards .activitypub-extra-field:last-child {
- margin-bottom: 0;
-}
-.is-style-cards .activitypub-extra-field dt {
- display: block;
- font-size: 0.9em;
- text-transform: uppercase;
- letter-spacing: 0.5px;
- color: currentColor;
- margin-bottom: 0.5em;
- padding-bottom: 0;
- padding-right: 0;
- white-space: normal;
-}
-.is-style-cards .activitypub-extra-field dt::after {
- content: none;
-}
-.is-style-cards .activitypub-extra-field dd {
- display: block;
- font-size: 1em;
- padding-bottom: 0;
-}
-
-/*# sourceMappingURL=style-index.css.map*/
\ No newline at end of file
+.activitypub-extra-fields-block-wrapper.has-background .activitypub-extra-fields,.activitypub-extra-fields-block-wrapper.has-border .activitypub-extra-fields,.activitypub-extra-fields-block-wrapper.is-style-stacked.has-background .activitypub-extra-fields,.activitypub-extra-fields-block-wrapper.is-style-stacked.has-border .activitypub-extra-fields{padding:1rem}.activitypub-extra-fields-block-wrapper.is-style-cards.has-background .activitypub-extra-fields,.activitypub-extra-fields-block-wrapper.is-style-cards.has-border .activitypub-extra-fields{padding:0}.activitypub-extra-fields{display:table;list-style:none;margin:0;padding:0;table-layout:fixed}.activitypub-extra-field{display:table-row;margin-bottom:0}.activitypub-extra-field dt{color:inherit;display:table-cell;font-weight:600;margin-bottom:0;padding-bottom:.5em;padding-right:10px;text-overflow:ellipsis;vertical-align:baseline;white-space:nowrap}.activitypub-extra-field dt:after{content:":"}.activitypub-extra-field dd{color:inherit;display:table-cell;margin-bottom:0;margin-left:0;padding-bottom:.5em;vertical-align:baseline;word-break:break-word}.activitypub-extra-field dd p{margin-bottom:.5em;margin-top:0}.activitypub-extra-field dd p:last-child{margin-bottom:0}.activitypub-extra-field dd a{color:inherit;text-decoration:underline}.activitypub-extra-field dd a:hover{text-decoration:none}.is-style-stacked .activitypub-extra-fields{display:block;table-layout:auto}.is-style-stacked .activitypub-extra-field{display:block;margin-bottom:1em}.is-style-stacked .activitypub-extra-field:last-child{margin-bottom:0}.is-style-stacked .activitypub-extra-field dt{display:block;margin-bottom:.25em;padding-bottom:0;padding-right:0;text-overflow:clip;white-space:normal}.is-style-stacked .activitypub-extra-field dt:after{content:none}.is-style-stacked .activitypub-extra-field dd{display:block;padding-bottom:0}.is-style-cards.has-background{background:transparent!important}.is-style-cards.has-background .activitypub-extra-fields{padding:1rem}.is-style-cards .activitypub-extra-fields{display:block;table-layout:auto}.is-style-cards .activitypub-extra-field{background:var(--wp--preset--color--base,#fff);border:1px solid var(--wp--preset--color--contrast-2,#ddd);border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.05);display:block;margin-bottom:1em;padding:1em}.is-style-cards .activitypub-extra-field:last-child{margin-bottom:0}.is-style-cards .activitypub-extra-field dt{color:currentColor;display:block;font-size:.9em;letter-spacing:.5px;margin-bottom:.5em;padding-bottom:0;padding-right:0;text-transform:uppercase;white-space:normal}.is-style-cards .activitypub-extra-field dt:after{content:none}.is-style-cards .activitypub-extra-field dd{display:block;font-size:1em;padding-bottom:0}
diff --git a/build/follow-me/index.asset.php b/build/follow-me/index.asset.php
index 64f270d7e5..8c30a0aa73 100644
--- a/build/follow-me/index.asset.php
+++ b/build/follow-me/index.asset.php
@@ -1 +1 @@
- array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '7bdcda8b5fc056455172');
+ array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '3c6293a99ee2025acf0a');
diff --git a/build/follow-me/index.js b/build/follow-me/index.js
index a78dcfa43a..47ff3ffb4f 100644
--- a/build/follow-me/index.js
+++ b/build/follow-me/index.js
@@ -1,1250 +1,2 @@
-/******/ (() => { // webpackBootstrap
-/******/ var __webpack_modules__ = ({
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/people.js":
-/*!**********************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/people.js ***!
- \**********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ people_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/people.tsx
-
-
-var people_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(
- _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path,
- {
- d: "M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z",
- fillRule: "evenodd"
- }
-) });
-
-//# sourceMappingURL=people.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/classnames/index.js":
-/*!******************************************!*\
- !*** ./node_modules/classnames/index.js ***!
- \******************************************/
-/***/ ((module, exports) => {
-
-var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
- Copyright (c) 2018 Jed Watson.
- Licensed under the MIT License (MIT), see
- http://jedwatson.github.io/classnames
-*/
-/* global define */
-
-(function () {
- 'use strict';
-
- var hasOwn = {}.hasOwnProperty;
-
- function classNames () {
- var classes = '';
-
- for (var i = 0; i < arguments.length; i++) {
- var arg = arguments[i];
- if (arg) {
- classes = appendClass(classes, parseValue(arg));
- }
- }
-
- return classes;
- }
-
- function parseValue (arg) {
- if (typeof arg === 'string' || typeof arg === 'number') {
- return arg;
- }
-
- if (typeof arg !== 'object') {
- return '';
- }
-
- if (Array.isArray(arg)) {
- return classNames.apply(null, arg);
- }
-
- if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
- return arg.toString();
- }
-
- var classes = '';
-
- for (var key in arg) {
- if (hasOwn.call(arg, key) && arg[key]) {
- classes = appendClass(classes, key);
- }
- }
-
- return classes;
- }
-
- function appendClass (value, newClass) {
- if (!newClass) {
- return value;
- }
-
- if (value) {
- return value + ' ' + newClass;
- }
-
- return value + newClass;
- }
-
- if ( true && module.exports) {
- classNames.default = classNames;
- module.exports = classNames;
- } else if (true) {
- // register as 'classnames', consistent with npm package name
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
- return classNames;
- }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else // removed by dead control flow
-{}
-}());
-
-
-/***/ }),
-
-/***/ "./src/follow-me/block.json":
-/*!**********************************!*\
- !*** ./src/follow-me/block.json ***!
- \**********************************/
-/***/ ((module) => {
-
-"use strict";
-module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","name":"activitypub/follow-me","apiVersion":3,"version":"2.2.0","title":"Follow me on the Fediverse","category":"widgets","description":"Display your Fediverse profile so that visitors can follow you.","textdomain":"activitypub","icon":"groups","example":{"attributes":{"className":"is-style-default"}},"supports":{"html":false,"interactivity":true,"color":{"gradients":true,"link":true,"__experimentalDefaultControls":{"background":true,"text":true,"link":true}},"__experimentalBorder":{"radius":true,"width":true,"color":true,"style":true},"shadow":true,"typography":{"fontSize":true,"__experimentalDefaultControls":{"fontSize":true}},"innerBlocks":{"allowedBlocks":["core/button"]}},"styles":[{"name":"default","label":"Default","isDefault":true},{"name":"button-only","label":"Button"},{"name":"profile","label":"Profile"}],"attributes":{"selectedUser":{"type":"string","default":"blog"}},"usesContext":["postType","postId"],"editorScript":"file:./index.js","viewScriptModule":"file:./view.js","viewScript":"wp-api-fetch","style":"file:./style-index.css","render":"file:./render.php"}');
-
-/***/ }),
-
-/***/ "./src/follow-me/deprecation.js":
-/*!**************************************!*\
- !*** ./src/follow-me/deprecation.js ***!
- \**************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
-/* harmony export */ });
-/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
-/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
-/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
-/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
-
-
-
-
-
-/**
- * The block supports for the Follow Me block in version 1.
- *
- * @type {{html: boolean, color: {gradients: boolean, link: boolean, __experimentalDefaultControls: {background: boolean, text: boolean, link: boolean}}, __experimentalBorder: {radius: boolean, width: boolean, color: boolean, style: boolean}, typography: {fontSize: boolean, __experimentalDefaultControls: {fontSize: boolean}}}}
- */
-
-const v1BlockSupports = {
- html: false,
- color: {
- gradients: true,
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true,
- link: true
- }
- },
- __experimentalBorder: {
- radius: true,
- width: true,
- color: true,
- style: true
- },
- typography: {
- fontSize: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- }
-};
-const v2BlockSupports = v1BlockSupports;
-
-/**
- * Migrates the buttonOnly attribute to a block style for the Follow Me block.
- *
- * @param {Object} attributes The block attributes.
- * @return {Object} The migrated block attributes.
- */
-function migrateButtonOnly({
- buttonOnly = false,
- className = '',
- ...newAttributes
-}) {
- newAttributes.className = classnames__WEBPACK_IMPORTED_MODULE_0___default()(className, buttonOnly ? 'is-style-button-only' : 'is-style-default');
- return newAttributes;
-}
-
-/**
- * Deprecation for the Follow Me block to use a core button block instead of the custom button.
- * This handles the migration of the buttonText and buttonSize attributes to the innerBlock.
- */
-const v1 = {
- attributes: {
- buttonOnly: {
- type: 'boolean',
- default: false
- },
- buttonText: {
- type: 'string',
- default: 'Follow'
- },
- selectedUser: {
- type: 'string',
- default: 'blog'
- }
- },
- supports: v1BlockSupports,
- /**
- * Checks if the block is eligible for migration.
- *
- * @param {Object} attributes The block attributes.
- *
- * @return {boolean} Whether the block is eligible for migration.
- */
- isEligible({
- buttonText,
- buttonOnly
- }) {
- // Run migration if buttonText or buttonOnly is set.
- return !!buttonText || !!buttonOnly;
- },
- /**
- * Migrates the Follow Me block to use a core button block instead of the custom button.
- *
- * @param {Object} attributes The block attributes.
- *
- * @return {[Object, Array]} An array with the new block attributes and inner blocks.
- */
- migrate({
- buttonText,
- ...newAttributes
- }) {
- const buttonBlock = (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__.createBlock)('core/button', {
- text: buttonText
- });
- return [migrateButtonOnly(newAttributes), [buttonBlock]];
- }
-};
-
-/**
- * Deprecation for the Follow Me block.
- * Handles the transition from using the buttonOnly attribute to using block styles.
- */
-const v2 = {
- attributes: {
- selectedUser: {
- type: 'string',
- default: 'blog'
- },
- buttonOnly: {
- type: 'boolean',
- default: false
- }
- },
- supports: v2BlockSupports,
- /**
- * Checks if the block is eligible for migration.
- *
- * @param {Object} attributes The block attributes.
- *
- * @return {boolean} Whether the block is eligible for migration.
- */
- isEligible({
- buttonOnly
- }) {
- return !!buttonOnly;
- },
- /**
- * Migrates the Follow Me block to use a block style instead of the buttonOnly attribute.
- *
- * @param {Object} attributes The block attributes.
- *
- * @return {[Object, Array]} An array with the new block attributes and inner blocks.
- */
- migrate: migrateButtonOnly,
- /**
- * Save function for the Follow Me block.
- *
- * @return {JSX.Element} React element to save.
- */
- save() {
- const blockProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save();
- const innerBlocksProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useInnerBlocksProps.save(blockProps);
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
- ...innerBlocksProps
- });
- }
-};
-
-/**
- * Deprecation for the Follow Me block.
- * Handles the case where the button HTML is stripped due to unfiltered_html capability restrictions.
- */
-const v3 = {
- attributes: {
- selectedUser: {
- type: 'string',
- default: 'blog'
- }
- },
- supports: v2BlockSupports,
- /**
- * Checks if the block is eligible for migration.
- *
- * @param {Object} attributes The block attributes.
- * @param {array} innerBlocks The inner blocks.
- *
- * @return {boolean} Whether the block is eligible for migration.
- */
- isEligible(attributes, innerBlocks) {
- return innerBlocks.length === 1 && 'button' === innerBlocks[0].attributes.tagName;
- },
- /**
- * Migrates the Follow Me block to fix the broken button.
- *
- * @param {Object} attributes The block attributes.
- * @param {array} innerBlocks The inner blocks.
- *
- * @return {[Object, Array]} An array with the new block attributes and inner blocks.
- */
- migrate(attributes, innerBlocks) {
- var _innerBlocks$0$origin;
- const {
- tagName,
- ...buttonAttributes
- } = innerBlocks[0].attributes;
- const text = (_innerBlocks$0$origin = innerBlocks[0].originalContent.replace(/<[^>]*>/g, '')) !== null && _innerBlocks$0$origin !== void 0 ? _innerBlocks$0$origin : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Follow', 'activitypub');
-
- // Create a proper button block with the correct structure and the extracted text
- const buttonBlock = (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__.createBlock)('core/button', {
- ...buttonAttributes,
- text
- });
- return [attributes, [buttonBlock]];
- },
- /**
- * Save function for the Follow Me block.
- *
- * @return {JSX.Element} React element to save.
- */
- save() {
- const blockProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save();
- const innerBlocksProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useInnerBlocksProps.save(blockProps);
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
- ...innerBlocksProps
- });
- }
-};
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([v3, v2, v1]);
-
-/***/ }),
-
-/***/ "./src/follow-me/edit.js":
-/*!*******************************!*\
- !*** ./src/follow-me/edit.js ***!
- \*******************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Edit)
-/* harmony export */ });
-/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
-/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
-/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data");
-/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_4__);
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
-/* harmony import */ var _shared_use_user_options__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../shared/use-user-options */ "./src/shared/use-user-options.js");
-/* harmony import */ var _shared_inherit_block_fallback__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../shared/inherit-block-fallback */ "./src/shared/inherit-block-fallback.js");
-/* harmony import */ var _shared_use_options__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../shared/use-options */ "./src/shared/use-options.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__);
-
-
-
-
-
-
-
-
-
-
-
-/**
- * Default profile data.
- *
- * @type {Object}
- */
-
-const DEFAULT_PROFILE_DATA = {
- avatar: 'https://secure.gravatar.com/avatar/default?s=120',
- webfinger: '@well@hello.dolly',
- name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Hello Dolly Fan Account', 'activitypub'),
- url: '#',
- image: {
- url: ''
- },
- summary: ''
-};
-
-/**
- * Get normalized profile data.
- *
- * @param {Object} profile Profile data.
- * @return {Object} Normalized profile data.
- */
-function getNormalizedProfile(profile) {
- if (!profile) {
- return DEFAULT_PROFILE_DATA;
- }
- const data = {
- ...DEFAULT_PROFILE_DATA,
- ...profile
- };
- data.avatar = data?.icon?.url;
-
- // Ensure webfinger always has the @ prefix.
- if (data.webfinger && !data.webfinger.startsWith('@')) {
- data.webfinger = '@' + data.webfinger;
- }
- return data;
-}
-
-/**
- * Fetch profile data.
- *
- * @param {number} userId User ID.
- * @return {Promise} Promise resolving with profile data.
- */
-function fetchProfile(userId) {
- const {
- namespace
- } = (0,_shared_use_options__WEBPACK_IMPORTED_MODULE_9__.useOptions)();
- const fetchOptions = {
- headers: {
- Accept: 'application/activity+json'
- },
- path: `/${namespace}/actors/${userId}`
- };
- return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default()(fetchOptions);
-}
-
-/**
- * Profile component for the editor.
- *
- * @param {Object} props Component props.
- * @return {JSX.Element} Profile component.
- */
-function EditorProfile({
- profile,
- className,
- innerBlocksProps
-}) {
- const {
- webfinger,
- avatar,
- name,
- image,
- summary,
- followersCount,
- postsCount
- } = profile;
-
- // Ensure we're checking for the right className format
- const isButtonOnly = className && className.includes('is-style-button-only');
-
- // Stats for the editor preview - use real followers count if available
- const stats = {
- posts: postsCount || 0,
- followers: followersCount || 0
- };
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
- className: "activitypub-profile",
- children: [!isButtonOnly && image?.url && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
- className: "activitypub-profile__header",
- style: {
- backgroundImage: `url(${image.url})`
- }
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
- className: "activitypub-profile__body",
- children: [!isButtonOnly && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("img", {
- className: "activitypub-profile__avatar",
- src: avatar,
- alt: name
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
- className: "activitypub-profile__content",
- children: [!isButtonOnly && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
- className: "activitypub-profile__info",
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
- className: "activitypub-profile__name",
- children: name
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
- className: "activitypub-profile__handle",
- children: webfinger
- })]
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
- ...innerBlocksProps
- }), !isButtonOnly && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
- className: "activitypub-profile__bio",
- dangerouslySetInnerHTML: {
- __html: summary
- }
- }), !isButtonOnly && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
- className: "activitypub-profile__stats",
- children: Object.entries(stats).map(([key, count]) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("strong", {
- children: count
- }), ' ', key === 'posts' ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__._n)('post', 'posts', count, 'activitypub') : key === 'followers' ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__._n)('follower', 'followers', count, 'activitypub') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__._n)('following', 'following', count, 'activitypub')]
- }, key))
- })]
- })]
- })]
- });
-}
-
-/**
- * Edit component.
- *
- * @param {Object} props Component props.
- * @param {Object} props.attributes Block attributes.
- * @param {Function} props.setAttributes Set block attributes.
- * @param {Object} props.context Block context.
- * @param {string} props.context.postType Post type.
- * @param {number} props.context.postId Post ID.
- * @return {JSX.Element} Edit component.
- */
-function Edit({
- attributes,
- setAttributes,
- context: {
- postType,
- postId
- }
-}) {
- const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
- className: 'activitypub-follow-me-block-wrapper'
- });
- const usersOptions = (0,_shared_use_user_options__WEBPACK_IMPORTED_MODULE_7__.useUserOptions)({
- withInherit: true
- });
- const {
- selectedUser,
- className = 'is-style-default'
- } = attributes;
- const isInheritMode = selectedUser === 'inherit';
- const [profile, setProfile] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useState)(getNormalizedProfile(DEFAULT_PROFILE_DATA));
- const userId = selectedUser === 'blog' ? 0 : selectedUser;
- const TEMPLATE = [['core/button', {
- text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Follow', 'activitypub')
- }]];
- const innerBlocksProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useInnerBlocksProps)({}, {
- allowedBlocks: ['core/button'],
- template: TEMPLATE,
- templateLock: false,
- renderAppender: false
- });
- const authorId = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
- const {
- getEditedEntityRecord
- } = select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_4__.store);
- const _authorId = getEditedEntityRecord('postType', postType, postId)?.author;
- return _authorId !== null && _authorId !== void 0 ? _authorId : null;
- }, [postType, postId]);
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useEffect)(() => {
- // Fetch profile data when userId changes.
- if (isInheritMode && !authorId) {
- return;
- }
- const effectiveUserId = isInheritMode ? authorId : userId;
- fetchProfile(effectiveUserId).then(data => {
- setProfile(getNormalizedProfile(data));
-
- // Convert the full URL to a path if it's a local URL.
- if (data.followers) {
- try {
- // Extract just the path portion from the URL
- const {
- pathname: path
- } = new URL(data.followers);
- _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default()({
- path: path.replace('wp-json/', '')
- }).then(({
- totalItems = 0
- }) => {
- setProfile(prevProfile => ({
- ...prevProfile,
- followersCount: totalItems
- }));
- }).catch(() => {});
- } catch (e) {
- // If URL parsing fails, just continue without fetching followers.
- }
- }
- if (effectiveUserId) {
- _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default()({
- path: `/wp/v2/users/${effectiveUserId}/?context=activitypub`
- }).then(({
- post_count
- }) => {
- setProfile(prevProfile => ({
- ...prevProfile,
- postsCount: post_count
- }));
- }).catch(() => {});
- } else {
- _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default()({
- path: '/wp/v2/posts',
- method: 'HEAD',
- parse: false // Preserve headers.
- }).then(response => {
- const postsCount = response.headers.get('X-WP-Total');
- setProfile(prevProfile => ({
- ...prevProfile,
- postsCount
- }));
- }).catch(() => {});
- }
- }).catch(() => {});
- }, [userId, authorId, isInheritMode]);
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useEffect)(() => {
- // If there are no users yet, do nothing.
- if (!usersOptions.length) {
- return;
- }
- // Ensure that the selected user is in the list of options, if not, select the first available user.
- if (!usersOptions.find(({
- value
- }) => value === selectedUser)) {
- setAttributes({
- selectedUser: usersOptions[0].value
- });
- }
- }, [selectedUser, usersOptions]);
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
- ...blockProps,
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, {
- children: usersOptions.length > 1 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.PanelBody, {
- title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Follow Me Options', 'activitypub'),
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.SelectControl, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Select User', 'activitypub'),
- value: attributes.selectedUser,
- options: usersOptions,
- onChange: value => setAttributes({
- selectedUser: value
- }),
- __next40pxDefaultSize: true,
- __nextHasNoMarginBottom: true
- })
- })
- }, "activitypub-follow-me"), isInheritMode && !authorId ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_shared_inherit_block_fallback__WEBPACK_IMPORTED_MODULE_8__.InheritModeBlockFallback, {
- name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Follow Me', 'activitypub')
- }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(EditorProfile, {
- profile: profile,
- className: className,
- innerBlocksProps: innerBlocksProps
- })]
- });
-}
-
-/***/ }),
-
-/***/ "./src/follow-me/index.js":
-/*!********************************!*\
- !*** ./src/follow-me/index.js ***!
- \********************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
-/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/people.js");
-/* harmony import */ var _deprecation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./deprecation */ "./src/follow-me/deprecation.js");
-/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./edit */ "./src/follow-me/edit.js");
-/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/follow-me/block.json");
-/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./save */ "./src/follow-me/save.js");
-/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./style.scss */ "./src/follow-me/style.scss");
-
-
-
-
-
-
-
-
-// Register the block.
-(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__, {
- deprecated: _deprecation__WEBPACK_IMPORTED_MODULE_2__["default"],
- edit: _edit__WEBPACK_IMPORTED_MODULE_3__["default"],
- icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__["default"],
- save: _save__WEBPACK_IMPORTED_MODULE_5__["default"]
-});
-
-/***/ }),
-
-/***/ "./src/follow-me/save.js":
-/*!*******************************!*\
- !*** ./src/follow-me/save.js ***!
- \*******************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
-/* harmony export */ });
-/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
-/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-
-
-/**
- * Save component for the Follow Me block.
- *
- * This component ensures that inner blocks (the button) are properly saved.
- *
- * @return {JSX.Element|null} Save component.
- */
-
-function save() {
- const blockProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save();
- const innerBlocksProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useInnerBlocksProps.save(blockProps);
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
- ...innerBlocksProps
- });
-}
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (save);
-
-/***/ }),
-
-/***/ "./src/follow-me/style.scss":
-/*!**********************************!*\
- !*** ./src/follow-me/style.scss ***!
- \**********************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-// extracted by mini-css-extract-plugin
-
-
-/***/ }),
-
-/***/ "./src/shared/inherit-block-fallback.js":
-/*!**********************************************!*\
- !*** ./src/shared/inherit-block-fallback.js ***!
- \**********************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ InheritModeBlockFallback: () => (/* binding */ InheritModeBlockFallback)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _use_options__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./use-options */ "./src/shared/use-options.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
-
-
-
-
-
-/**
- * Block fallback component for inheriting user context in ActivityPub blocks.
- *
- * @param {Object} props
- * @param {string} props.name - Name of the block.
- * @returns {JSX.Element} Rendered fallback block.
- */
-
-function InheritModeBlockFallback({
- name
-}) {
- const {
- enabled
- } = (0,_use_options__WEBPACK_IMPORTED_MODULE_3__.useOptions)();
- const nonAuthorExtra = enabled?.blog ? '' : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('It will be empty in other non-author contexts.', 'activitypub');
- const text = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %1$s: block name, %2$s: extra information for non-author context */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s', 'activitypub'), name, nonAuthorExtra).trim();
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Card, {
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.CardBody, {
- children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createInterpolateElement)(text, {
- strong: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("strong", {})
- })
- })
- });
-}
-
-/***/ }),
-
-/***/ "./src/shared/use-options.js":
-/*!***********************************!*\
- !*** ./src/shared/use-options.js ***!
- \***********************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ useOptions: () => (/* binding */ useOptions)
-/* harmony export */ });
-/**
- * React hook to return the ActivityPub options object from the global window.
- *
- * @returns {Object} The options object.
- */
-function useOptions() {
- return window._activityPubOptions || {};
-}
-
-/***/ }),
-
-/***/ "./src/shared/use-user-options.js":
-/*!****************************************!*\
- !*** ./src/shared/use-user-options.js ***!
- \****************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ useUserOptions: () => (/* binding */ useUserOptions)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
-/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _use_options__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./use-options */ "./src/shared/use-options.js");
-
-
-
-
-
-
-/**
- * React hook providing user options for ActivityPub blocks.
- *
- * @param {Object} params
- * @param {boolean} params.withInherit - Whether to include the inherit option.
- * @returns {Array} List of user option objects.
- */
-function useUserOptions({
- withInherit = false
-}) {
- /**
- * ActivityPub options.
- *
- * @type {Object}
- * @property {boolean} enabled.users - Whether users are enabled.
- * @property {boolean} enabled.blog - Whether the blog user is enabled.
- */
- const {
- enabled,
- namespace
- } = (0,_use_options__WEBPACK_IMPORTED_MODULE_4__.useOptions)();
- const [currentUserCanActivityPub, setCurrentUserCanActivityPub] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
- const {
- fetchedUsers,
- isLoadingUsers
- } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
- const {
- getUsers,
- getIsResolving
- } = select('core');
- return {
- fetchedUsers: enabled?.users ? getUsers({
- capabilities: 'activitypub'
- }) : null,
- isLoadingUsers: enabled?.users ? getIsResolving('getUsers', [{
- capabilities: 'activitypub'
- }]) : false
- };
- }, []);
-
- // Only fetch current user if fetchedUsers is empty and we're not still loading.
- const currentUser = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => fetchedUsers || isLoadingUsers ? null : select('core').getCurrentUser(), [fetchedUsers, isLoadingUsers]);
-
- // Test if current user has activitypub capability by trying to access their actor endpoint.
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
- if (fetchedUsers || isLoadingUsers || !currentUser) {
- return;
- }
- _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3___default()({
- path: `/${namespace}/actors/${currentUser.id}`,
- method: 'HEAD',
- headers: {
- Accept: 'application/activity+json'
- },
- parse: false
- }).then(() => setCurrentUserCanActivityPub(true)).catch(() => setCurrentUserCanActivityPub(false));
- }, [fetchedUsers, isLoadingUsers, currentUser]);
- const users = fetchedUsers || (currentUser && currentUserCanActivityPub ? [{
- id: currentUser.id,
- name: currentUser.name
- }] : []);
-
- /**
- * Memoized computation of user options for block settings.
- */
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
- if (!users.length) {
- return [];
- }
- const userKeywords = [];
- if (enabled?.blog && fetchedUsers) {
- userKeywords.push({
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Blog', 'activitypub'),
- value: 'blog'
- });
- }
-
- // Only show the inherit option when explicitly asked for and users are enabled.
- if (withInherit && enabled?.users && fetchedUsers) {
- userKeywords.push({
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Dynamic User', 'activitypub'),
- value: 'inherit'
- });
- }
-
- /**
- * Reduce users into keyword/value pairs for options.
- */
- return users.reduce((acc, user) => {
- acc.push({
- label: user.name,
- value: `${user.id}` // Casting to string because that's how Gutenberg stores the attribute.
- });
- return acc;
- }, userKeywords);
- }, [users]);
-}
-
-/***/ }),
-
-/***/ "@wordpress/api-fetch":
-/*!**********************************!*\
- !*** external ["wp","apiFetch"] ***!
- \**********************************/
-/***/ ((module) => {
-
-"use strict";
-module.exports = window["wp"]["apiFetch"];
-
-/***/ }),
-
-/***/ "@wordpress/block-editor":
-/*!*************************************!*\
- !*** external ["wp","blockEditor"] ***!
- \*************************************/
-/***/ ((module) => {
-
-"use strict";
-module.exports = window["wp"]["blockEditor"];
-
-/***/ }),
-
-/***/ "@wordpress/blocks":
-/*!********************************!*\
- !*** external ["wp","blocks"] ***!
- \********************************/
-/***/ ((module) => {
-
-"use strict";
-module.exports = window["wp"]["blocks"];
-
-/***/ }),
-
-/***/ "@wordpress/components":
-/*!************************************!*\
- !*** external ["wp","components"] ***!
- \************************************/
-/***/ ((module) => {
-
-"use strict";
-module.exports = window["wp"]["components"];
-
-/***/ }),
-
-/***/ "@wordpress/core-data":
-/*!**********************************!*\
- !*** external ["wp","coreData"] ***!
- \**********************************/
-/***/ ((module) => {
-
-"use strict";
-module.exports = window["wp"]["coreData"];
-
-/***/ }),
-
-/***/ "@wordpress/data":
-/*!******************************!*\
- !*** external ["wp","data"] ***!
- \******************************/
-/***/ ((module) => {
-
-"use strict";
-module.exports = window["wp"]["data"];
-
-/***/ }),
-
-/***/ "@wordpress/element":
-/*!*********************************!*\
- !*** external ["wp","element"] ***!
- \*********************************/
-/***/ ((module) => {
-
-"use strict";
-module.exports = window["wp"]["element"];
-
-/***/ }),
-
-/***/ "@wordpress/i18n":
-/*!******************************!*\
- !*** external ["wp","i18n"] ***!
- \******************************/
-/***/ ((module) => {
-
-"use strict";
-module.exports = window["wp"]["i18n"];
-
-/***/ }),
-
-/***/ "@wordpress/primitives":
-/*!************************************!*\
- !*** external ["wp","primitives"] ***!
- \************************************/
-/***/ ((module) => {
-
-"use strict";
-module.exports = window["wp"]["primitives"];
-
-/***/ }),
-
-/***/ "react/jsx-runtime":
-/*!**********************************!*\
- !*** external "ReactJSXRuntime" ***!
- \**********************************/
-/***/ ((module) => {
-
-"use strict";
-module.exports = window["ReactJSXRuntime"];
-
-/***/ })
-
-/******/ });
-/************************************************************************/
-/******/ // The module cache
-/******/ var __webpack_module_cache__ = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/ // Check if module is in cache
-/******/ var cachedModule = __webpack_module_cache__[moduleId];
-/******/ if (cachedModule !== undefined) {
-/******/ return cachedModule.exports;
-/******/ }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = __webpack_module_cache__[moduleId] = {
-/******/ // no module.id needed
-/******/ // no module.loaded needed
-/******/ exports: {}
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/******/ // expose the modules object (__webpack_modules__)
-/******/ __webpack_require__.m = __webpack_modules__;
-/******/
-/************************************************************************/
-/******/ /* webpack/runtime/chunk loaded */
-/******/ (() => {
-/******/ var deferred = [];
-/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
-/******/ if(chunkIds) {
-/******/ priority = priority || 0;
-/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
-/******/ deferred[i] = [chunkIds, fn, priority];
-/******/ return;
-/******/ }
-/******/ var notFulfilled = Infinity;
-/******/ for (var i = 0; i < deferred.length; i++) {
-/******/ var [chunkIds, fn, priority] = deferred[i];
-/******/ var fulfilled = true;
-/******/ for (var j = 0; j < chunkIds.length; j++) {
-/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
-/******/ chunkIds.splice(j--, 1);
-/******/ } else {
-/******/ fulfilled = false;
-/******/ if(priority < notFulfilled) notFulfilled = priority;
-/******/ }
-/******/ }
-/******/ if(fulfilled) {
-/******/ deferred.splice(i--, 1)
-/******/ var r = fn();
-/******/ if (r !== undefined) result = r;
-/******/ }
-/******/ }
-/******/ return result;
-/******/ };
-/******/ })();
-/******/
-/******/ /* webpack/runtime/compat get default export */
-/******/ (() => {
-/******/ // getDefaultExport function for compatibility with non-harmony modules
-/******/ __webpack_require__.n = (module) => {
-/******/ var getter = module && module.__esModule ?
-/******/ () => (module['default']) :
-/******/ () => (module);
-/******/ __webpack_require__.d(getter, { a: getter });
-/******/ return getter;
-/******/ };
-/******/ })();
-/******/
-/******/ /* webpack/runtime/define property getters */
-/******/ (() => {
-/******/ // define getter functions for harmony exports
-/******/ __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 */
-/******/ (() => {
-/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
-/******/ })();
-/******/
-/******/ /* webpack/runtime/make namespace object */
-/******/ (() => {
-/******/ // define __esModule on 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/jsonp chunk loading */
-/******/ (() => {
-/******/ // no baseURI
-/******/
-/******/ // object to store loaded and loading chunks
-/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
-/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
-/******/ var installedChunks = {
-/******/ "follow-me/index": 0,
-/******/ "follow-me/style-index": 0
-/******/ };
-/******/
-/******/ // no chunk on demand loading
-/******/
-/******/ // no prefetching
-/******/
-/******/ // no preloaded
-/******/
-/******/ // no HMR
-/******/
-/******/ // no HMR manifest
-/******/
-/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
-/******/
-/******/ // install a JSONP callback for chunk loading
-/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
-/******/ var [chunkIds, moreModules, runtime] = data;
-/******/ // add "moreModules" to the modules object,
-/******/ // then flag all "chunkIds" as loaded and fire callback
-/******/ var moduleId, chunkId, i = 0;
-/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
-/******/ for(moduleId in moreModules) {
-/******/ if(__webpack_require__.o(moreModules, moduleId)) {
-/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
-/******/ }
-/******/ }
-/******/ if(runtime) var result = runtime(__webpack_require__);
-/******/ }
-/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
-/******/ for(;i < chunkIds.length; i++) {
-/******/ chunkId = chunkIds[i];
-/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
-/******/ installedChunks[chunkId][0]();
-/******/ }
-/******/ installedChunks[chunkId] = 0;
-/******/ }
-/******/ return __webpack_require__.O(result);
-/******/ }
-/******/
-/******/ var chunkLoadingGlobal = globalThis["webpackChunkwordpress_activitypub"] = globalThis["webpackChunkwordpress_activitypub"] || [];
-/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
-/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
-/******/ })();
-/******/
-/************************************************************************/
-/******/
-/******/ // startup
-/******/ // Load entry module and return exports
-/******/ // This entry module depends on other loaded chunks and execution need to be delayed
-/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["follow-me/style-index"], () => (__webpack_require__("./src/follow-me/index.js")))
-/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
-/******/
-/******/ })()
-;
-//# sourceMappingURL=index.js.map
\ No newline at end of file
+(()=>{var e,t={768:(e,t,r)=>{"use strict";const o=window.wp.blocks,s=window.wp.primitives,i=window.ReactJSXRuntime;var n=(0,i.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(s.Path,{d:"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z",fillRule:"evenodd"})}),a=r(942),l=r.n(a);const c=window.wp.blockEditor,u=window.wp.i18n,p={html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},__experimentalBorder:{radius:!0,width:!0,color:!0,style:!0},typography:{fontSize:!0,__experimentalDefaultControls:{fontSize:!0}}},d=p;function v({buttonOnly:e=!1,className:t="",...r}){return r.className=l()(t,e?"is-style-button-only":"is-style-default"),r}const f={attributes:{buttonOnly:{type:"boolean",default:!1},buttonText:{type:"string",default:"Follow"},selectedUser:{type:"string",default:"blog"}},supports:p,isEligible:({buttonText:e,buttonOnly:t})=>!!e||!!t,migrate({buttonText:e,...t}){const r=(0,o.createBlock)("core/button",{text:e});return[v(t),[r]]}},b={attributes:{selectedUser:{type:"string",default:"blog"},buttonOnly:{type:"boolean",default:!1}},supports:d,isEligible:({buttonOnly:e})=>!!e,migrate:v,save(){const e=c.useBlockProps.save(),t=c.useInnerBlocksProps.save(e);return(0,i.jsx)("div",{...t})}},h=[{attributes:{selectedUser:{type:"string",default:"blog"}},supports:d,isEligible:(e,t)=>1===t.length&&"button"===t[0].attributes.tagName,migrate(e,t){var r;const{tagName:s,...i}=t[0].attributes,n=null!==(r=t[0].originalContent.replace(/<[^>]*>/g,""))&&void 0!==r?r:(0,u.__)("Follow","activitypub");return[e,[(0,o.createBlock)("core/button",{...i,text:n})]]},save(){const e=c.useBlockProps.save(),t=c.useInnerBlocksProps.save(e);return(0,i.jsx)("div",{...t})}},b,f],y=window.wp.apiFetch;var w=r.n(y);const m=window.wp.data,g=window.wp.coreData,_=window.wp.components,x=window.wp.element;function j(){return window._activityPubOptions||{}}function k({name:e}){const{enabled:t}=j(),r=t?.blog?"":(0,u.__)("It will be empty in other non-author contexts.","activitypub"),o=(0,u.sprintf)(/* translators: %1$s: block name, %2$s: extra information for non-author context */ /* translators: %1$s: block name, %2$s: extra information for non-author context */
+(0,u.__)("This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s","activitypub"),e,r).trim();return(0,i.jsx)(_.Card,{children:(0,i.jsx)(_.CardBody,{children:(0,x.createInterpolateElement)(o,{strong:(0,i.jsx)("strong",{})})})})}const B={avatar:"https://secure.gravatar.com/avatar/default?s=120",webfinger:"@well@hello.dolly",name:(0,u.__)("Hello Dolly Fan Account","activitypub"),url:"#",image:{url:""},summary:""};function S(e){if(!e)return B;const t={...B,...e};return t.avatar=t?.icon?.url,t.webfinger&&!t.webfinger.startsWith("@")&&(t.webfinger="@"+t.webfinger),t}function O({profile:e,className:t,innerBlocksProps:r}){const{webfinger:o,avatar:s,name:n,image:a,summary:l,followersCount:c,postsCount:p}=e,d=t&&t.includes("is-style-button-only"),v={posts:p||0,followers:c||0};return(0,i.jsxs)("div",{className:"activitypub-profile",children:[!d&&a?.url&&(0,i.jsx)("div",{className:"activitypub-profile__header",style:{backgroundImage:`url(${a.url})`}}),(0,i.jsxs)("div",{className:"activitypub-profile__body",children:[!d&&(0,i.jsx)("img",{className:"activitypub-profile__avatar",src:s,alt:n}),(0,i.jsxs)("div",{className:"activitypub-profile__content",children:[!d&&(0,i.jsxs)("div",{className:"activitypub-profile__info",children:[(0,i.jsx)("div",{className:"activitypub-profile__name",children:n}),(0,i.jsx)("div",{className:"activitypub-profile__handle",children:o})]}),(0,i.jsx)("div",{...r}),!d&&(0,i.jsx)("div",{className:"activitypub-profile__bio",dangerouslySetInnerHTML:{__html:l}}),!d&&(0,i.jsx)("div",{className:"activitypub-profile__stats",children:Object.entries(v).map(([e,t])=>(0,i.jsxs)("div",{children:[(0,i.jsx)("strong",{children:t})," ","posts"===e?(0,u._n)("post","posts",t,"activitypub"):"followers"===e?(0,u._n)("follower","followers",t,"activitypub"):(0,u._n)("following","following",t,"activitypub")]},e))})]})]})]})}const N=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","name":"activitypub/follow-me","apiVersion":3,"version":"2.2.0","title":"Follow me on the Fediverse","category":"widgets","description":"Display your Fediverse profile so that visitors can follow you.","textdomain":"activitypub","icon":"groups","example":{"attributes":{"className":"is-style-default"}},"supports":{"html":false,"interactivity":true,"color":{"gradients":true,"link":true,"__experimentalDefaultControls":{"background":true,"text":true,"link":true}},"__experimentalBorder":{"radius":true,"width":true,"color":true,"style":true},"shadow":true,"typography":{"fontSize":true,"__experimentalDefaultControls":{"fontSize":true}},"innerBlocks":{"allowedBlocks":["core/button"]}},"styles":[{"name":"default","label":"Default","isDefault":true},{"name":"button-only","label":"Button"},{"name":"profile","label":"Profile"}],"attributes":{"selectedUser":{"type":"string","default":"blog"}},"usesContext":["postType","postId"],"editorScript":"file:./index.js","viewScriptModule":"file:./view.js","viewScript":"wp-api-fetch","style":"file:./style-index.css","render":"file:./render.php"}');(0,o.registerBlockType)(N,{deprecated:h,edit:function({attributes:e,setAttributes:t,context:{postType:r,postId:o}}){const s=(0,c.useBlockProps)({className:"activitypub-follow-me-block-wrapper"}),n=function({withInherit:e=!1}){const{enabled:t,namespace:r}=j(),[o,s]=(0,x.useState)(!1),{fetchedUsers:i,isLoadingUsers:n}=(0,m.useSelect)(e=>{const{getUsers:r,getIsResolving:o}=e("core");return{fetchedUsers:t?.users?r({capabilities:"activitypub"}):null,isLoadingUsers:!!t?.users&&o("getUsers",[{capabilities:"activitypub"}])}},[]),a=(0,m.useSelect)(e=>i||n?null:e("core").getCurrentUser(),[i,n]);(0,x.useEffect)(()=>{i||n||!a||w()({path:`/${r}/actors/${a.id}`,method:"HEAD",headers:{Accept:"application/activity+json"},parse:!1}).then(()=>s(!0)).catch(()=>s(!1))},[i,n,a]);const l=i||(a&&o?[{id:a.id,name:a.name}]:[]);return(0,x.useMemo)(()=>{if(!l.length)return[];const r=[];return t?.blog&&i&&r.push({label:(0,u.__)("Blog","activitypub"),value:"blog"}),e&&t?.users&&i&&r.push({label:(0,u.__)("Dynamic User","activitypub"),value:"inherit"}),l.reduce((e,t)=>(e.push({label:t.name,value:`${t.id}`}),e),r)},[l])}({withInherit:!0}),{selectedUser:a,className:l="is-style-default"}=e,p="inherit"===a,[d,v]=(0,x.useState)(S(B)),f="blog"===a?0:a,b=[["core/button",{text:(0,u.__)("Follow","activitypub")}]],h=(0,c.useInnerBlocksProps)({},{allowedBlocks:["core/button"],template:b,templateLock:!1,renderAppender:!1}),y=(0,m.useSelect)(e=>{const{getEditedEntityRecord:t}=e(g.store),s=t("postType",r,o)?.author;return null!=s?s:null},[r,o]);return(0,x.useEffect)(()=>{if(p&&!y)return;const e=p?y:f;(function(e){const{namespace:t}=j(),r={headers:{Accept:"application/activity+json"},path:`/${t}/actors/${e}`};return w()(r)})(e).then(t=>{if(v(S(t)),t.followers)try{const{pathname:e}=new URL(t.followers);w()({path:e.replace("wp-json/","")}).then(({totalItems:e=0})=>{v(t=>({...t,followersCount:e}))}).catch(()=>{})}catch(e){}e?w()({path:`/wp/v2/users/${e}/?context=activitypub`}).then(({post_count:e})=>{v(t=>({...t,postsCount:e}))}).catch(()=>{}):w()({path:"/wp/v2/posts",method:"HEAD",parse:!1}).then(e=>{const t=e.headers.get("X-WP-Total");v(e=>({...e,postsCount:t}))}).catch(()=>{})}).catch(()=>{})},[f,y,p]),(0,x.useEffect)(()=>{n.length&&(n.find(({value:e})=>e===a)||t({selectedUser:n[0].value}))},[a,n]),(0,i.jsxs)("div",{...s,children:[(0,i.jsx)(c.InspectorControls,{children:n.length>1&&(0,i.jsx)(_.PanelBody,{title:(0,u.__)("Follow Me Options","activitypub"),children:(0,i.jsx)(_.SelectControl,{label:(0,u.__)("Select User","activitypub"),value:e.selectedUser,options:n,onChange:e=>t({selectedUser:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})})},"activitypub-follow-me"),p&&!y?(0,i.jsx)(k,{name:(0,u.__)("Follow Me","activitypub")}):(0,i.jsx)(O,{profile:d,className:l,innerBlocksProps:h})]})},icon:n,save:function(){const e=c.useBlockProps.save(),t=c.useInnerBlocksProps.save(e);return(0,i.jsx)("div",{...t})}})},942:(e,t)=>{var r;!function(){"use strict";var o={}.hasOwnProperty;function s(){for(var e="",t=0;t{if(!r){var n=1/0;for(u=0;u=i)&&Object.keys(o.O).every(e=>o.O[e](r[l]))?r.splice(l--,1):(a=!1,i0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[r,s,i]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={338:0,870:0};o.O.j=t=>0===e[t];var t=(t,r)=>{var s,i,[n,a,l]=r,c=0;if(n.some(t=>0!==e[t])){for(s in a)o.o(a,s)&&(o.m[s]=a[s]);if(l)var u=l(o)}for(t&&t(r);co(768));s=o.O(s)})();
\ No newline at end of file
diff --git a/build/follow-me/style-index-rtl.css b/build/follow-me/style-index-rtl.css
index 0d426fb1d1..5c9ec8c63b 100644
--- a/build/follow-me/style-index-rtl.css
+++ b/build/follow-me/style-index-rtl.css
@@ -1,344 +1 @@
-/*!*************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/follow-me/style.scss ***!
- \*************************************************************************************************************************************************************************************************************************************************/
-body.modal-open {
- overflow: hidden;
-}
-
-.activitypub-modal__overlay {
- position: fixed;
- top: 0;
- right: 0;
- left: 0;
- bottom: 0;
- background-color: rgba(0, 0, 0, 0.5);
- color: initial;
- z-index: 100000;
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 1rem;
-}
-
-.activitypub-modal__overlay.compact {
- position: absolute;
- background-color: transparent;
- padding: 0;
- top: auto;
- right: auto;
- left: auto;
- bottom: auto;
- align-items: flex-start;
- justify-content: flex-start;
- z-index: 100;
-}
-
-.activitypub-modal__overlay[hidden] {
- display: none;
-}
-
-.activitypub-modal__frame {
- max-width: 660px;
- width: 100%;
- background-color: var(--wp--preset--color--white, #fff);
- border-radius: 8px;
- box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
- overflow: hidden;
- display: flex;
- flex-direction: column;
- max-height: calc(100vh - 2rem);
- animation: activitypub-modal-appear 0.2s ease-out;
-}
-
-.compact .activitypub-modal__frame {
- width: auto;
- max-width: -moz-min-content;
- max-width: min-content;
- min-width: 250px;
- max-height: 300px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
-}
-
-.activitypub-modal__header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 2rem 2rem 1.5rem 2rem;
- border-bottom: 1px solid var(--wp--preset--color--light-gray, #f0f0f0);
- flex-shrink: 0;
-}
-
-.compact .activitypub-modal__header {
- display: none;
-}
-
-.activitypub-modal__header .activitypub-modal__close {
- border: none;
- padding: 0.5rem;
- cursor: pointer;
- display: flex;
- align-items: center;
- justify-content: center;
- width: auto;
-}
-
-.activitypub-modal__header .activitypub-modal__close:active {
- border: none;
- padding: 0.5rem;
-}
-
-.activitypub-modal__title {
- margin: 0 !important;
- font-size: 130%;
- font-weight: 600;
- line-height: 1.4;
-}
-
-.activitypub-modal__content {
- overflow-y: auto;
-}
-
-@keyframes activitypub-modal-appear {
- from {
- opacity: 0;
- transform: translateY(20px);
- }
- to {
- opacity: 1;
- transform: translateY(0);
- }
-}
-
-.activitypub-follow-me-block-wrapper {
- display: block;
- margin: 1rem 0;
- position: relative;
-}
-
-.activitypub-follow-me-block-wrapper .activitypub-profile {
- padding: 1rem 0;
-}
-
-.activitypub-follow-me-block-wrapper .activitypub-profile__body {
- display: flex;
- flex-wrap: wrap;
-}
-
-.activitypub-follow-me-block-wrapper .activitypub-profile__avatar {
- width: 75px;
- height: 75px;
- border-radius: 50%;
- margin-left: 1rem;
- -o-object-fit: cover;
- object-fit: cover;
-}
-
-.activitypub-follow-me-block-wrapper .activitypub-profile__content {
- display: flex;
- flex: 1;
- flex-wrap: wrap;
- justify-content: space-between;
- align-items: center;
- min-width: 0;
-}
-
-.activitypub-follow-me-block-wrapper .activitypub-profile__info {
- display: block;
- flex: 1;
- min-width: 0;
-}
-
-.activitypub-follow-me-block-wrapper .activitypub-profile__name {
- font-size: 1.25em;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.activitypub-follow-me-block-wrapper .activitypub-profile__name, .activitypub-follow-me-block-wrapper .activitypub-profile__handle {
- color: inherit;
- line-height: 1.2;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.activitypub-follow-me-block-wrapper .activitypub-profile div.wp-block-button {
- margin: 0 1rem 0 0;
- display: flex;
- align-items: center;
-}
-
-.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button__link {
- margin: 0;
-}
-
-.activitypub-follow-me-block-wrapper .activitypub-profile .is-small {
- padding: 0.25rem 0.5rem;
- font-size: 0.8rem;
-}
-
-.activitypub-follow-me-block-wrapper .activitypub-profile .is-compact {
- padding: 0.4rem 0.8rem;
- font-size: 0.9rem;
-}
-
-.activitypub-follow-me-block-wrapper:not(.is-style-button-only):not(.is-style-profile) .activitypub-profile__bio,
-.activitypub-follow-me-block-wrapper:not(.is-style-button-only):not(.is-style-profile) .activitypub-profile__stats {
- display: none;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile {
- padding: 0;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__body {
- display: block;
- padding: 0;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__content {
- display: inline;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-button-only div.wp-block-button {
- display: inline-block;
- margin: 0;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__avatar,
-.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__name,
-.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__handle,
-.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__bio,
-.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__stats {
- display: none;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-profile {
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
- overflow: hidden;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-profile.has-background .activitypub-profile {
- padding: 0;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile {
- padding: 0;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__header {
- width: 100%;
- height: 120px;
- background-color: #ccc;
- background-size: cover;
- background-position: center;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__body {
- padding: 1rem;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__avatar {
- width: 64px;
- height: 64px;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__content {
- flex: 1;
- min-width: 0;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__name {
- margin-bottom: 0.25rem;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__bio {
- margin-top: 16px;
- font-size: 90%;
- line-height: 1.4;
- width: 100%;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__bio p {
- margin: 0 0 0.5rem;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__bio p:last-child {
- margin-bottom: 0;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__stats {
- display: flex;
- gap: 16px;
- margin-top: 1rem;
- font-size: 0.9em;
- width: 100%;
-}
-
-.activitypub-follow-me-block-wrapper.has-background .activitypub-profile, .activitypub-follow-me-block-wrapper.has-border .activitypub-profile {
- padding-right: 1rem;
- padding-left: 1rem;
-}
-
-.activitypub-dialog__section {
- padding: 1.5rem 2rem;
- border-bottom: 1px solid var(--wp--preset--color--light-gray, #f0f0f0);
-}
-
-.activitypub-dialog__section:last-child {
- border-bottom: none;
- padding-bottom: 2rem;
-}
-
-.activitypub-dialog__section h4 {
- margin-top: 0;
- margin-bottom: 0.5rem;
- font-size: 110%;
-}
-
-.activitypub-dialog__description {
- margin-bottom: 1rem;
- color: inherit;
- font-size: 95%;
-}
-
-.activitypub-dialog__button-group {
- display: flex;
- width: 100%;
- margin-bottom: 0.5rem;
-}
-
-.activitypub-dialog__button-group input[type] {
- flex: 1;
- border: 1px solid var(--wp--preset--color--gray, #e2e4e7);
- border-radius: 0 4px 4px 0;
- line-height: 1;
- margin: 0;
-}
-
-.activitypub-dialog__button-group input[type]::-moz-placeholder {
- opacity: 0.5;
-}
-
-.activitypub-dialog__button-group input[type]::placeholder {
- opacity: 0.5;
-}
-
-.activitypub-dialog__button-group input[type][aria-invalid=true] {
- border-color: var(--wp--preset--color--vivid-red);
-}
-
-.activitypub-dialog__button-group button {
- border-radius: 4px 0 0 4px !important;
- margin-right: -1px !important;
- min-width: 22.5%;
- width: auto;
-}
-
-.activitypub-dialog__error {
- color: var(--wp--preset--color--vivid-red);
- font-size: 90%;
- margin-top: 0.5rem;
-}
+body.modal-open{overflow:hidden}.activitypub-modal__overlay{align-items:center;background-color:rgba(0,0,0,.5);bottom:0;color:initial;display:flex;justify-content:center;right:0;padding:1rem;position:fixed;left:0;top:0;z-index:100000}.activitypub-modal__overlay.compact{align-items:flex-start;background-color:transparent;bottom:auto;justify-content:flex-start;right:auto;padding:0;position:absolute;left:auto;top:auto;z-index:100}.activitypub-modal__overlay[hidden]{display:none}.activitypub-modal__frame{animation:activitypub-modal-appear .2s ease-out;background-color:var(--wp--preset--color--white,#fff);border-radius:8px;box-shadow:0 5px 15px rgba(0,0,0,.3);display:flex;flex-direction:column;max-height:calc(100vh - 2rem);max-width:660px;overflow:hidden;width:100%}.compact .activitypub-modal__frame{box-shadow:0 2px 8px rgba(0,0,0,.1);max-height:300px;max-width:-moz-min-content;max-width:min-content;min-width:250px;width:auto}.activitypub-modal__header{align-items:center;border-bottom:1px solid var(--wp--preset--color--light-gray,#f0f0f0);display:flex;flex-shrink:0;justify-content:space-between;padding:2rem 2rem 1.5rem}.compact .activitypub-modal__header{display:none}.activitypub-modal__header .activitypub-modal__close{align-items:center;border:none;cursor:pointer;display:flex;justify-content:center;padding:.5rem;width:auto}.activitypub-modal__header .activitypub-modal__close:active{border:none;padding:.5rem}.activitypub-modal__title{font-size:130%;font-weight:600;line-height:1.4;margin:0!important}.activitypub-modal__content{overflow-y:auto}@keyframes activitypub-modal-appear{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.activitypub-follow-me-block-wrapper{display:block;margin:1rem 0;position:relative}.activitypub-follow-me-block-wrapper .activitypub-profile{padding:1rem 0}.activitypub-follow-me-block-wrapper .activitypub-profile__body{display:flex;flex-wrap:wrap}.activitypub-follow-me-block-wrapper .activitypub-profile__avatar{border-radius:50%;height:75px;margin-left:1rem;-o-object-fit:cover;object-fit:cover;width:75px}.activitypub-follow-me-block-wrapper .activitypub-profile__content{align-items:center;display:flex;flex:1;flex-wrap:wrap;justify-content:space-between;min-width:0}.activitypub-follow-me-block-wrapper .activitypub-profile__info{display:block;flex:1;min-width:0}.activitypub-follow-me-block-wrapper .activitypub-profile__name{font-size:1.25em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile__handle,.activitypub-follow-me-block-wrapper .activitypub-profile__name{color:inherit;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile div.wp-block-button{align-items:center;display:flex;margin:0 1rem 0 0}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button__link{margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .is-small{font-size:.8rem;padding:.25rem .5rem}.activitypub-follow-me-block-wrapper .activitypub-profile .is-compact{font-size:.9rem;padding:.4rem .8rem}.activitypub-follow-me-block-wrapper:not(.is-style-button-only):not(.is-style-profile) .activitypub-profile__bio,.activitypub-follow-me-block-wrapper:not(.is-style-button-only):not(.is-style-profile) .activitypub-profile__stats{display:none}.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile{padding:0}.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__body{display:block;padding:0}.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__content{display:inline}.activitypub-follow-me-block-wrapper.is-style-button-only div.wp-block-button{display:inline-block;margin:0}.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__avatar,.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__bio,.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__handle,.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__name,.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__stats{display:none}.activitypub-follow-me-block-wrapper.is-style-profile{border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,.1);overflow:hidden}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile,.activitypub-follow-me-block-wrapper.is-style-profile.has-background .activitypub-profile{padding:0}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__header{background-color:#ccc;background-position:50%;background-size:cover;height:120px;width:100%}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__body{padding:1rem}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__avatar{height:64px;width:64px}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__content{flex:1;min-width:0}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__name{margin-bottom:.25rem}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__bio{font-size:90%;line-height:1.4;margin-top:16px;width:100%}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__bio p{margin:0 0 .5rem}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__bio p:last-child{margin-bottom:0}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__stats{display:flex;font-size:.9em;gap:16px;margin-top:1rem;width:100%}.activitypub-follow-me-block-wrapper.has-background .activitypub-profile,.activitypub-follow-me-block-wrapper.has-border .activitypub-profile{padding-right:1rem;padding-left:1rem}.activitypub-dialog__section{border-bottom:1px solid var(--wp--preset--color--light-gray,#f0f0f0);padding:1.5rem 2rem}.activitypub-dialog__section:last-child{border-bottom:none;padding-bottom:2rem}.activitypub-dialog__section h4{font-size:110%;margin-bottom:.5rem;margin-top:0}.activitypub-dialog__description{color:inherit;font-size:95%;margin-bottom:1rem}.activitypub-dialog__button-group{display:flex;margin-bottom:.5rem;width:100%}.activitypub-dialog__button-group input[type]{border:1px solid var(--wp--preset--color--gray,#e2e4e7);border-radius:0 4px 4px 0;flex:1;line-height:1;margin:0}.activitypub-dialog__button-group input[type]::-moz-placeholder{opacity:.5}.activitypub-dialog__button-group input[type]::placeholder{opacity:.5}.activitypub-dialog__button-group input[type][aria-invalid=true]{border-color:var(--wp--preset--color--vivid-red)}.activitypub-dialog__button-group button{border-radius:4px 0 0 4px!important;margin-right:-1px!important;min-width:22.5%;width:auto}.activitypub-dialog__error{color:var(--wp--preset--color--vivid-red);font-size:90%;margin-top:.5rem}
diff --git a/build/follow-me/style-index.css b/build/follow-me/style-index.css
index dcf9a06b7a..386060cdf8 100644
--- a/build/follow-me/style-index.css
+++ b/build/follow-me/style-index.css
@@ -1,346 +1 @@
-/*!*************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/follow-me/style.scss ***!
- \*************************************************************************************************************************************************************************************************************************************************/
-body.modal-open {
- overflow: hidden;
-}
-
-.activitypub-modal__overlay {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background-color: rgba(0, 0, 0, 0.5);
- color: initial;
- z-index: 100000;
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 1rem;
-}
-
-.activitypub-modal__overlay.compact {
- position: absolute;
- background-color: transparent;
- padding: 0;
- top: auto;
- left: auto;
- right: auto;
- bottom: auto;
- align-items: flex-start;
- justify-content: flex-start;
- z-index: 100;
-}
-
-.activitypub-modal__overlay[hidden] {
- display: none;
-}
-
-.activitypub-modal__frame {
- max-width: 660px;
- width: 100%;
- background-color: var(--wp--preset--color--white, #fff);
- border-radius: 8px;
- box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
- overflow: hidden;
- display: flex;
- flex-direction: column;
- max-height: calc(100vh - 2rem);
- animation: activitypub-modal-appear 0.2s ease-out;
-}
-
-.compact .activitypub-modal__frame {
- width: auto;
- max-width: -moz-min-content;
- max-width: min-content;
- min-width: 250px;
- max-height: 300px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
-}
-
-.activitypub-modal__header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 2rem 2rem 1.5rem 2rem;
- border-bottom: 1px solid var(--wp--preset--color--light-gray, #f0f0f0);
- flex-shrink: 0;
-}
-
-.compact .activitypub-modal__header {
- display: none;
-}
-
-.activitypub-modal__header .activitypub-modal__close {
- border: none;
- padding: 0.5rem;
- cursor: pointer;
- display: flex;
- align-items: center;
- justify-content: center;
- width: auto;
-}
-
-.activitypub-modal__header .activitypub-modal__close:active {
- border: none;
- padding: 0.5rem;
-}
-
-.activitypub-modal__title {
- margin: 0 !important;
- font-size: 130%;
- font-weight: 600;
- line-height: 1.4;
-}
-
-.activitypub-modal__content {
- overflow-y: auto;
-}
-
-@keyframes activitypub-modal-appear {
- from {
- opacity: 0;
- transform: translateY(20px);
- }
- to {
- opacity: 1;
- transform: translateY(0);
- }
-}
-
-.activitypub-follow-me-block-wrapper {
- display: block;
- margin: 1rem 0;
- position: relative;
-}
-
-.activitypub-follow-me-block-wrapper .activitypub-profile {
- padding: 1rem 0;
-}
-
-.activitypub-follow-me-block-wrapper .activitypub-profile__body {
- display: flex;
- flex-wrap: wrap;
-}
-
-.activitypub-follow-me-block-wrapper .activitypub-profile__avatar {
- width: 75px;
- height: 75px;
- border-radius: 50%;
- margin-right: 1rem;
- -o-object-fit: cover;
- object-fit: cover;
-}
-
-.activitypub-follow-me-block-wrapper .activitypub-profile__content {
- display: flex;
- flex: 1;
- flex-wrap: wrap;
- justify-content: space-between;
- align-items: center;
- min-width: 0;
-}
-
-.activitypub-follow-me-block-wrapper .activitypub-profile__info {
- display: block;
- flex: 1;
- min-width: 0;
-}
-
-.activitypub-follow-me-block-wrapper .activitypub-profile__name {
- font-size: 1.25em;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.activitypub-follow-me-block-wrapper .activitypub-profile__name, .activitypub-follow-me-block-wrapper .activitypub-profile__handle {
- color: inherit;
- line-height: 1.2;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.activitypub-follow-me-block-wrapper .activitypub-profile div.wp-block-button {
- margin: 0 0 0 1rem;
- display: flex;
- align-items: center;
-}
-
-.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button__link {
- margin: 0;
-}
-
-.activitypub-follow-me-block-wrapper .activitypub-profile .is-small {
- padding: 0.25rem 0.5rem;
- font-size: 0.8rem;
-}
-
-.activitypub-follow-me-block-wrapper .activitypub-profile .is-compact {
- padding: 0.4rem 0.8rem;
- font-size: 0.9rem;
-}
-
-.activitypub-follow-me-block-wrapper:not(.is-style-button-only):not(.is-style-profile) .activitypub-profile__bio,
-.activitypub-follow-me-block-wrapper:not(.is-style-button-only):not(.is-style-profile) .activitypub-profile__stats {
- display: none;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile {
- padding: 0;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__body {
- display: block;
- padding: 0;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__content {
- display: inline;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-button-only div.wp-block-button {
- display: inline-block;
- margin: 0;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__avatar,
-.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__name,
-.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__handle,
-.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__bio,
-.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__stats {
- display: none;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-profile {
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
- overflow: hidden;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-profile.has-background .activitypub-profile {
- padding: 0;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile {
- padding: 0;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__header {
- width: 100%;
- height: 120px;
- background-color: #ccc;
- background-size: cover;
- background-position: center;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__body {
- padding: 1rem;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__avatar {
- width: 64px;
- height: 64px;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__content {
- flex: 1;
- min-width: 0;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__name {
- margin-bottom: 0.25rem;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__bio {
- margin-top: 16px;
- font-size: 90%;
- line-height: 1.4;
- width: 100%;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__bio p {
- margin: 0 0 0.5rem;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__bio p:last-child {
- margin-bottom: 0;
-}
-
-.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__stats {
- display: flex;
- gap: 16px;
- margin-top: 1rem;
- font-size: 0.9em;
- width: 100%;
-}
-
-.activitypub-follow-me-block-wrapper.has-background .activitypub-profile, .activitypub-follow-me-block-wrapper.has-border .activitypub-profile {
- padding-left: 1rem;
- padding-right: 1rem;
-}
-
-.activitypub-dialog__section {
- padding: 1.5rem 2rem;
- border-bottom: 1px solid var(--wp--preset--color--light-gray, #f0f0f0);
-}
-
-.activitypub-dialog__section:last-child {
- border-bottom: none;
- padding-bottom: 2rem;
-}
-
-.activitypub-dialog__section h4 {
- margin-top: 0;
- margin-bottom: 0.5rem;
- font-size: 110%;
-}
-
-.activitypub-dialog__description {
- margin-bottom: 1rem;
- color: inherit;
- font-size: 95%;
-}
-
-.activitypub-dialog__button-group {
- display: flex;
- width: 100%;
- margin-bottom: 0.5rem;
-}
-
-.activitypub-dialog__button-group input[type] {
- flex: 1;
- border: 1px solid var(--wp--preset--color--gray, #e2e4e7);
- border-radius: 4px 0 0 4px;
- line-height: 1;
- margin: 0;
-}
-
-.activitypub-dialog__button-group input[type]::-moz-placeholder {
- opacity: 0.5;
-}
-
-.activitypub-dialog__button-group input[type]::placeholder {
- opacity: 0.5;
-}
-
-.activitypub-dialog__button-group input[type][aria-invalid=true] {
- border-color: var(--wp--preset--color--vivid-red);
-}
-
-.activitypub-dialog__button-group button {
- border-radius: 0 4px 4px 0 !important;
- margin-left: -1px !important;
- min-width: 22.5%;
- width: auto;
-}
-
-.activitypub-dialog__error {
- color: var(--wp--preset--color--vivid-red);
- font-size: 90%;
- margin-top: 0.5rem;
-}
-
-/*# sourceMappingURL=style-index.css.map*/
\ No newline at end of file
+body.modal-open{overflow:hidden}.activitypub-modal__overlay{align-items:center;background-color:rgba(0,0,0,.5);bottom:0;color:initial;display:flex;justify-content:center;left:0;padding:1rem;position:fixed;right:0;top:0;z-index:100000}.activitypub-modal__overlay.compact{align-items:flex-start;background-color:transparent;bottom:auto;justify-content:flex-start;left:auto;padding:0;position:absolute;right:auto;top:auto;z-index:100}.activitypub-modal__overlay[hidden]{display:none}.activitypub-modal__frame{animation:activitypub-modal-appear .2s ease-out;background-color:var(--wp--preset--color--white,#fff);border-radius:8px;box-shadow:0 5px 15px rgba(0,0,0,.3);display:flex;flex-direction:column;max-height:calc(100vh - 2rem);max-width:660px;overflow:hidden;width:100%}.compact .activitypub-modal__frame{box-shadow:0 2px 8px rgba(0,0,0,.1);max-height:300px;max-width:-moz-min-content;max-width:min-content;min-width:250px;width:auto}.activitypub-modal__header{align-items:center;border-bottom:1px solid var(--wp--preset--color--light-gray,#f0f0f0);display:flex;flex-shrink:0;justify-content:space-between;padding:2rem 2rem 1.5rem}.compact .activitypub-modal__header{display:none}.activitypub-modal__header .activitypub-modal__close{align-items:center;border:none;cursor:pointer;display:flex;justify-content:center;padding:.5rem;width:auto}.activitypub-modal__header .activitypub-modal__close:active{border:none;padding:.5rem}.activitypub-modal__title{font-size:130%;font-weight:600;line-height:1.4;margin:0!important}.activitypub-modal__content{overflow-y:auto}@keyframes activitypub-modal-appear{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.activitypub-follow-me-block-wrapper{display:block;margin:1rem 0;position:relative}.activitypub-follow-me-block-wrapper .activitypub-profile{padding:1rem 0}.activitypub-follow-me-block-wrapper .activitypub-profile__body{display:flex;flex-wrap:wrap}.activitypub-follow-me-block-wrapper .activitypub-profile__avatar{border-radius:50%;height:75px;margin-right:1rem;-o-object-fit:cover;object-fit:cover;width:75px}.activitypub-follow-me-block-wrapper .activitypub-profile__content{align-items:center;display:flex;flex:1;flex-wrap:wrap;justify-content:space-between;min-width:0}.activitypub-follow-me-block-wrapper .activitypub-profile__info{display:block;flex:1;min-width:0}.activitypub-follow-me-block-wrapper .activitypub-profile__name{font-size:1.25em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile__handle,.activitypub-follow-me-block-wrapper .activitypub-profile__name{color:inherit;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activitypub-follow-me-block-wrapper .activitypub-profile div.wp-block-button{align-items:center;display:flex;margin:0 0 0 1rem}.activitypub-follow-me-block-wrapper .activitypub-profile .wp-block-button__link{margin:0}.activitypub-follow-me-block-wrapper .activitypub-profile .is-small{font-size:.8rem;padding:.25rem .5rem}.activitypub-follow-me-block-wrapper .activitypub-profile .is-compact{font-size:.9rem;padding:.4rem .8rem}.activitypub-follow-me-block-wrapper:not(.is-style-button-only):not(.is-style-profile) .activitypub-profile__bio,.activitypub-follow-me-block-wrapper:not(.is-style-button-only):not(.is-style-profile) .activitypub-profile__stats{display:none}.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile{padding:0}.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__body{display:block;padding:0}.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__content{display:inline}.activitypub-follow-me-block-wrapper.is-style-button-only div.wp-block-button{display:inline-block;margin:0}.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__avatar,.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__bio,.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__handle,.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__name,.activitypub-follow-me-block-wrapper.is-style-button-only .activitypub-profile__stats{display:none}.activitypub-follow-me-block-wrapper.is-style-profile{border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,.1);overflow:hidden}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile,.activitypub-follow-me-block-wrapper.is-style-profile.has-background .activitypub-profile{padding:0}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__header{background-color:#ccc;background-position:50%;background-size:cover;height:120px;width:100%}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__body{padding:1rem}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__avatar{height:64px;width:64px}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__content{flex:1;min-width:0}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__name{margin-bottom:.25rem}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__bio{font-size:90%;line-height:1.4;margin-top:16px;width:100%}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__bio p{margin:0 0 .5rem}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__bio p:last-child{margin-bottom:0}.activitypub-follow-me-block-wrapper.is-style-profile .activitypub-profile__stats{display:flex;font-size:.9em;gap:16px;margin-top:1rem;width:100%}.activitypub-follow-me-block-wrapper.has-background .activitypub-profile,.activitypub-follow-me-block-wrapper.has-border .activitypub-profile{padding-left:1rem;padding-right:1rem}.activitypub-dialog__section{border-bottom:1px solid var(--wp--preset--color--light-gray,#f0f0f0);padding:1.5rem 2rem}.activitypub-dialog__section:last-child{border-bottom:none;padding-bottom:2rem}.activitypub-dialog__section h4{font-size:110%;margin-bottom:.5rem;margin-top:0}.activitypub-dialog__description{color:inherit;font-size:95%;margin-bottom:1rem}.activitypub-dialog__button-group{display:flex;margin-bottom:.5rem;width:100%}.activitypub-dialog__button-group input[type]{border:1px solid var(--wp--preset--color--gray,#e2e4e7);border-radius:4px 0 0 4px;flex:1;line-height:1;margin:0}.activitypub-dialog__button-group input[type]::-moz-placeholder{opacity:.5}.activitypub-dialog__button-group input[type]::placeholder{opacity:.5}.activitypub-dialog__button-group input[type][aria-invalid=true]{border-color:var(--wp--preset--color--vivid-red)}.activitypub-dialog__button-group button{border-radius:0 4px 4px 0!important;margin-left:-1px!important;min-width:22.5%;width:auto}.activitypub-dialog__error{color:var(--wp--preset--color--vivid-red);font-size:90%;margin-top:.5rem}
diff --git a/build/follow-me/view.asset.php b/build/follow-me/view.asset.php
index f4719dbace..3af44537ee 100644
--- a/build/follow-me/view.asset.php
+++ b/build/follow-me/view.asset.php
@@ -1 +1 @@
- array('@wordpress/interactivity'), 'version' => '08d268be5b8e0ce2b032', 'type' => 'module');
+ array('@wordpress/interactivity'), 'version' => 'dcfaf459c212f2047ad9', 'type' => 'module');
diff --git a/build/follow-me/view.js b/build/follow-me/view.js
index 8ee37a7baf..d30475380f 100644
--- a/build/follow-me/view.js
+++ b/build/follow-me/view.js
@@ -1,760 +1 @@
-import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity";
-/******/ var __webpack_modules__ = ({
-
-/***/ "./src/follow-me/button-style.js":
-/*!***************************************!*\
- !*** ./src/follow-me/button-style.js ***!
- \***************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ getBlockStyles: () => (/* binding */ getBlockStyles),
-/* harmony export */ getPopupStyles: () => (/* binding */ getPopupStyles)
-/* harmony export */ });
-/**
- * Cache for computed styles and CSS variable checks.
- */
-const cssCache = {
- computedStyles: null,
- variables: {}
-};
-
-/**
- * Checks if a CSS variable is defined.
- *
- * Uses a caching mechanism to avoid frequent getComputedStyle calls,
- * which can cause layout thrashing when called repeatedly.
- *
- * @param {string} variableName The CSS variable name to check.
- * @return {boolean} Whether the variable is defined.
- */
-function isCssVariableDefined(variableName) {
- // Return false if we're in a server-side context.
- if (typeof window === 'undefined' || !window.getComputedStyle) {
- return false;
- }
-
- // Check if we've already cached this variable.
- if (cssCache.variables.hasOwnProperty(variableName)) {
- return cssCache.variables[variableName];
- }
-
- // Get the computed style of the root element (cached).
- if (!cssCache.computedStyles) {
- cssCache.computedStyles = window.getComputedStyle(document.documentElement);
- }
-
- // Get the value of the CSS variable.
- const value = cssCache.computedStyles.getPropertyValue(variableName).trim();
-
- // Cache the result.
- cssCache.variables[variableName] = value !== '';
-
- // If the value is empty, the variable is not defined or is set to an empty value.
- return cssCache.variables[variableName];
-}
-
-/**
- * Gets the background color from a style object.
- *
- * @param {Object|string} color Color object or string.
- * @return {string|null} Background color.
- */
-function getBackgroundColor(color) {
- // If color is a string, it's a var like this.
- if (typeof color === 'string') {
- const varName = `--wp--preset--color--${color}`;
- if (!isCssVariableDefined(varName)) {
- return null;
- }
- return `var(${varName})`;
- }
- return color?.color?.background || null;
-}
-
-/**
- * Gets the link color from a style object.
- *
- * @param {string} text Text color.
- * @return {string|null} Link color.
- */
-function getLinkColor(text) {
- if (typeof text !== 'string') {
- return null;
- }
- // If it starts with a hash, leave it be.
- if (text.match(/^#/)) {
- // We don't handle the alpha channel if present.
- return text.substring(0, 7);
- }
- // var:preset|color|luminous-vivid-amber
- // var(--wp--preset--color--luminous-vivid-amber)
- // We will receive the top format, we need to output the bottom format.
- const [,, color] = text.split('|');
- const varName = `--wp--preset--color--${color}`;
-
- // Check if the CSS variable is defined before using it.
- if (!isCssVariableDefined(varName)) {
- return null;
- }
- return `var(${varName})`;
-}
-
-/**
- * Generates a CSS selector.
- *
- * @param {string} selector CSS selector.
- * @param {string} prop CSS property.
- * @param {string|null} value CSS value.
- * @param {string} pseudo Pseudo-selector.
- * @return {string} CSS selector.
- */
-function generateSelector(selector, prop, value = null, pseudo = '') {
- if (!value) {
- return '';
- }
- return `${selector}${pseudo} { ${prop}: ${value}; }\n`;
-}
-
-/**
- * Gets styles for a button.
- *
- * @param {string} selector CSS selector.
- * @param {string} button Button color.
- * @param {string} text Text color.
- * @param {string} hover Hover color.
- * @return {string} CSS styles.
- */
-function getStyles(selector, button, text, hover) {
- return generateSelector(selector, 'background-color', button) + generateSelector(selector, 'color', text) + generateSelector(selector, 'background-color', hover, ':hover') + generateSelector(selector, 'background-color', hover, ':focus');
-}
-
-/**
- * Gets block styles.
- *
- * @param {string} base Base selector.
- * @param {Object} style Style object.
- * @param {Object|string} backgroundColor Background color.
- * @return {string} CSS styles.
- */
-function getBlockStyles(base, style, backgroundColor) {
- const selector = `${base} .wp-block-button__link`;
-
- // We grab the background color if set as a good color for our button text.
- const buttonTextColor = getBackgroundColor(backgroundColor) ||
- // Background might be in this form.
- style?.color?.background;
-
- // We misuse the link color for the button background.
- const buttonColor = getLinkColor(style?.elements?.link?.color?.text);
- const buttonHoverColor = getLinkColor(style?.elements?.link?.[':hover']?.color?.text);
- return getStyles(selector, buttonColor, buttonTextColor, buttonHoverColor);
-}
-
-/**
- * Gets popup styles.
- *
- * @param {Object} style Style object.
- * @return {string} CSS styles.
- */
-function getPopupStyles(style) {
- // We don't accept backgroundColor because the popup is always white (right?).
- const buttonColor = getLinkColor(style?.elements?.link?.color?.text) || '#111';
- const buttonTextColor = '#fff';
- const buttonHoverColor = getLinkColor(style?.elements?.link?.[':hover']?.color?.text) || '#333';
- const selector = '.activitypub-dialog__button-group .wp-block-button';
- return getStyles(selector, buttonColor, buttonTextColor, buttonHoverColor);
-}
-
-/***/ }),
-
-/***/ "./src/shared/modal/index.js":
-/*!***********************************!*\
- !*** ./src/shared/modal/index.js ***!
- \***********************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ createModalStore: () => (/* binding */ createModalStore)
-/* harmony export */ });
-/* harmony import */ var _wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/interactivity */ "@wordpress/interactivity");
-
-
-/**
- * @typedef {Object} context
- * @property {String} blockId - The ID of the block.
- * @property {Object} modal - The modal state.
- * @property {boolean} modal.isOpen - Whether the modal is open.
- * @property {boolean} modal.isCompact - Whether the modal is compact.
- */
-
-/**
- * Set up a modal store with actions and callbacks.
- *
- * The Interactivity API merges all stores that share the same namespace,
- * so these actions and callbacks are added directly to the importing block’s existing store.
- *
- * @param {string} namespace - The interactivity namespace for the block.
- */
-function createModalStore(namespace) {
- const {
- actions,
- callbacks
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.store)(namespace, {
- actions: {
- /**
- * Open the modal.
- *
- * @param {Event} event Click event.
- */
- openModal(event) {
- const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
-
- // Set modal properties
- context.modal.isOpen = true;
- if (context.modal.isCompact) {
- // Position the compact modal relative to the button.
- setTimeout(callbacks.positionModal, 0);
- } else {
- // Set up the focus trap after modal is open.
- setTimeout(() => {
- // Use the blockId to find the specific modal frame for this block
- const blockWrapper = document.getElementById(context.blockId);
- if (blockWrapper) {
- const modalFrame = blockWrapper.querySelector('.activitypub-modal__frame');
- if (modalFrame) {
- callbacks.trapFocus(modalFrame);
- }
- }
- }, 50);
- }
-
- // Call the onOpen callback if provided.
- if (typeof callbacks.onModalOpen === 'function') {
- callbacks.onModalOpen(event);
- }
- },
- /**
- * Close the modal.
- *
- * @param {Event} event Click event.
- */
- closeModal(event) {
- const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
-
- // Reset modal state
- context.modal.isOpen = false;
-
- // Return focus to the button that opened the modal.
- const button = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getElement)();
- if (button.ref.dataset['wpOn-Click'] === 'actions.toggleModal') {
- button.ref.focus();
- } else {
- const blockWrapper = document.getElementById(context.blockId);
- if (blockWrapper) {
- const openButton = blockWrapper.querySelector('[data-wp-on--click="actions.toggleModal"], [data-wp-on-async--click="actions.toggleModal"]');
- if (openButton) {
- openButton.focus();
- }
- }
- }
-
- // Call the onClose callback if provided.
- if (typeof callbacks.onModalClose === 'function') {
- callbacks.onModalClose(event);
- }
- },
- /**
- * Toggle the modal.
- *
- * @param {Event} event Click event.
- */
- toggleModal(event) {
- const {
- modal
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- modal.isOpen ? actions.closeModal(event) : actions.openModal(event);
- }
- },
- callbacks: {
- /**
- * Abort controller for keydown and click event listeners.
- *
- * @type {AbortController | null} Abort controller.
- */
- _abortController: null,
- /**
- * Handles modal effects like body class and event listeners.
- * This is called via data-wp-watch in the modal HTML.
- */
- handleModalEffects() {
- const {
- modal
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
-
- // Update body class.
- if (modal.isOpen && !modal.isCompact) {
- document.body.classList.add('modal-open');
- } else {
- document.body.classList.remove('modal-open');
- }
-
- // Remove all existing listeners.
- if (callbacks._abortController) {
- callbacks._abortController.abort();
- callbacks._abortController = null;
- }
-
- // Add new listeners if modal is open.
- if (modal.isOpen) {
- callbacks._abortController = new AbortController();
- const {
- signal
- } = callbacks._abortController;
- document.addEventListener('keydown', callbacks.documentKeydown, {
- signal
- });
- document.addEventListener('click', callbacks.documentClick, {
- signal
- });
- }
- return undefined;
- },
- /**
- * Handles keydown events on the document.
- *
- * @param {Event} event Keydown event.
- * @param {String} event.key The key that was pressed.
- */
- documentKeydown(event) {
- const {
- modal
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- if (modal.isOpen && event.key === 'Escape') {
- actions.closeModal();
- }
- },
- /**
- * Handles click events on the document.
- *
- * @param {Event} event Click event.
- */
- documentClick(event) {
- const {
- blockId,
- modal
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- if (!modal.isOpen) {
- return;
- }
-
- // Get the block wrapper element.
- const blockWrapper = document.getElementById(blockId);
- if (!blockWrapper) {
- return;
- }
-
- // If the click was on the button or its children, we should not close the modal.
- const toggleButton = blockWrapper.querySelector('.wp-element-button[data-wp-on--click="actions.toggleModal"]');
- if (toggleButton && (toggleButton === event.target || toggleButton.contains(event.target))) {
- return;
- }
-
- // Check if the click was inside the modal frame.
- const modalFrame = blockWrapper.querySelector('.activitypub-modal__frame');
- if (!modalFrame || modalFrame.contains(event.target)) {
- return;
- }
- actions.closeModal();
- },
- /**
- * Positions the modal relative to the button that opened it.
- */
- positionModal() {
- const {
- blockId
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- const blockWrapper = document.getElementById(blockId);
- if (!blockWrapper) {
- return;
- }
- const modalOverlay = blockWrapper.querySelector('.activitypub-modal__overlay');
- if (!modalOverlay) {
- return;
- }
-
- // Reset any previously set positioning.
- modalOverlay.style.top = '';
- modalOverlay.style.left = '';
- modalOverlay.style.right = '';
- modalOverlay.style.bottom = '';
-
- // Get button position relative to viewport.
- const buttonRect = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getElement)().ref.getBoundingClientRect();
-
- // Get viewport dimensions.
- const viewportWidth = window.innerWidth;
-
- // Get the block's position to calculate relative positioning.
- const blockRect = blockWrapper.getBoundingClientRect();
-
- // Calculate position relative to the block (our positioning context).
- const relativeTop = buttonRect.bottom - blockRect.top;
- const relativeLeft = buttonRect.left - blockRect.left;
-
- // Calculate available space.
- const spaceRight = viewportWidth - buttonRect.right;
-
- // Default position (below button, relative to the block).
- let position = {
- top: `${relativeTop + 8}px`,
- left: `${relativeLeft - 2}px` // -2 px to account for the button border.
- };
-
- // If not enough space to the right, align with the right edge.
- if (spaceRight < 250) {
- position.left = 'auto';
- position.right = `${blockRect.right - buttonRect.right}px`;
- }
-
- // Apply the position.
- Object.assign(modalOverlay.style, position);
- },
- /**
- * Traps focus within the specified element.
- *
- * @param {Element} element The element to trap focus within.
- */
- trapFocus(element) {
- const focusableElements = element.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]):not([readonly]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])');
- const firstFocusableElement = focusableElements[0];
- const lastFocusableElement = focusableElements[focusableElements.length - 1];
-
- // If the first focusable element is the close button, set initial focus to the next element instead.
- if (firstFocusableElement && firstFocusableElement.classList.contains('activitypub-modal__close') && focusableElements.length > 1) {
- // Set initial focus to the second element, but keep firstFocusableElement as is for tab trapping.
- focusableElements[1].focus();
- } else {
- // Otherwise focus the first element as usual.
- firstFocusableElement.focus();
- }
- element.addEventListener('keydown', function (event) {
- if (event.key !== 'Tab' && event.keyCode !== 9 /* KEYCODE_TAB */) {
- return;
- }
- if (event.shiftKey) {
- /* shift + tab */
- if (document.activeElement === firstFocusableElement) {
- lastFocusableElement.focus();
- event.preventDefault();
- }
- } /* tab */else {
- if (document.activeElement === lastFocusableElement) {
- firstFocusableElement.focus();
- event.preventDefault();
- }
- }
- });
- }
- }
- });
-}
-
-/***/ }),
-
-/***/ "@wordpress/interactivity":
-/*!*******************************************!*\
- !*** external "@wordpress/interactivity" ***!
- \*******************************************/
-/***/ ((module) => {
-
-module.exports = __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__;
-
-/***/ })
-
-/******/ });
-/************************************************************************/
-/******/ // The module cache
-/******/ var __webpack_module_cache__ = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/ // Check if module is in cache
-/******/ var cachedModule = __webpack_module_cache__[moduleId];
-/******/ if (cachedModule !== undefined) {
-/******/ return cachedModule.exports;
-/******/ }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = __webpack_module_cache__[moduleId] = {
-/******/ // no module.id needed
-/******/ // no module.loaded needed
-/******/ exports: {}
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/************************************************************************/
-/******/ /* webpack/runtime/define property getters */
-/******/ (() => {
-/******/ // define getter functions for harmony exports
-/******/ __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 */
-/******/ (() => {
-/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
-/******/ })();
-/******/
-/******/ /* webpack/runtime/make namespace object */
-/******/ (() => {
-/******/ // define __esModule on exports
-/******/ __webpack_require__.r = (exports) => {
-/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
-/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
-/******/ }
-/******/ Object.defineProperty(exports, '__esModule', { value: true });
-/******/ };
-/******/ })();
-/******/
-/************************************************************************/
-var __webpack_exports__ = {};
-// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
-(() => {
-/*!*******************************!*\
- !*** ./src/follow-me/view.js ***!
- \*******************************/
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/interactivity */ "@wordpress/interactivity");
-/* harmony import */ var _button_style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./button-style */ "./src/follow-me/button-style.js");
-/* harmony import */ var _shared_modal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../shared/modal */ "./src/shared/modal/index.js");
-
-
-
-
-/** @var {object} wp WordPress global. */
-const {
- apiFetch
-} = window.wp;
-(0,_shared_modal__WEBPACK_IMPORTED_MODULE_2__.createModalStore)('activitypub/follow-me');
-
-/**
- * @typedef {Object} config
- * @property {String} namespace ActivityPub REST Namespace.
- * @property {Object} i18n Internationalization strings.
- * @property {String} i18n.copy "Copy" button text.
- * @property {String} i18n.copied "Copied" button text.
- * @property {String} i18n.emptyProfileError Error message for empty remote profile.
- * @property {String} i18n.genericError Generic error message.
- * @property {String} i18n.invalidProfileError Error message for invalid remote profile.
- */
-
-/**
- * @typedef {Object} context
- * @property {String} backgroundColor The background color for the button.
- * @property {String} blockId The block ID.
- * @property {String} buttonStyle The button style.
- * @property {String} copyButtonText The copy button text.
- * @property {String} errorMessage The error message.
- * @property {boolean} isError Whether the remote profile input has an error.
- * @property {boolean} isLoading Whether the remote profile is being submitted.
- * @property {Object} modal The modal state.
- * @property {boolean} modal.isOpen Whether the modal is open.
- * @property {String} remoteProfile The remote profile.
- * @property {String} template The template for the remote reply URL.
- * @property {String} userId The user ID.
- * @property {String} webfinger The webfinger of the user.
- */
-
-const {
- actions,
- callbacks
-} = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.store)('activitypub/follow-me', {
- actions: {
- /**
- * Copy the webfinger to clipboard.
- */
- copyToClipboard() {
- const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- const {
- i18n
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getConfig)();
-
- // Use the Clipboard API to copy text.
- navigator.clipboard.writeText(context.webfinger).then(() => {
- // Update button text to show success.
- context.copyButtonText = i18n.copied;
-
- // Reset button text after 1 second.
- setTimeout(() => {
- context.copyButtonText = i18n.copy;
- }, 1000);
- }, error => {
- // Log error if copying fails.
- console.error('Could not copy text: ', error);
- });
- },
- /**
- * Update the remote profile value.
- *
- * @param {Event} event Input event.
- */
- updateRemoteProfile(event) {
- const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- context.remoteProfile = event.target.value;
- // Reset error state when input changes.
- context.isError = false;
- context.errorMessage = '';
- },
- /**
- * Handle the opening of the modal.
- *
- * @param {Event} event The event that triggered the modal opening/closing.
- * @param {String} event.key The key pressed, if any.
- */
- onKeydown(event) {
- if ((0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getElement)().ref.tagName === 'A' && (event.key === 'Enter' || event.key === ' ')) {
- event.preventDefault();
- actions.toggleModal(event);
- }
- },
- /**
- * Handle keydown event for remote profile input.
- *
- * @param {Event} event Keydown event.
- * @param {String} event.key The key pressed.
- */
- handleKeyDown(event) {
- if (event.key === 'Enter') {
- event.preventDefault();
- actions.submitRemoteProfile();
- }
- },
- /**
- * Submit the remote profile.
- */
- submitRemoteProfile: function* () {
- const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- const {
- namespace,
- i18n
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getConfig)();
- const input = context.remoteProfile.trim();
-
- // Validate input.
- if (!input) {
- context.isError = true;
- context.errorMessage = i18n.emptyProfileError;
- return;
- }
- if (!callbacks.isHandle(input)) {
- context.isError = true;
- context.errorMessage = i18n.invalidProfileError;
- return;
- }
-
- // Set loading state.
- context.isLoading = true;
- context.isError = false;
-
- // Construct the API path.
- const path = `/${namespace}/actors/${context.userId}/remote-follow?resource=${encodeURIComponent(input)}`;
- try {
- // Make the API request.
- const response = yield apiFetch({
- path
- });
-
- // Set opening state.
- context.isLoading = false;
-
- // Open the remote follow URL in a new tab.
- window.open(response.url, '_blank');
-
- // Close the modal after opening the URL.
- actions.closeModal(new Event('click'));
- } catch (error) {
- // Handle error.
- console.error('Error submitting profile:', error);
- context.isLoading = false;
- context.isError = true;
- context.errorMessage = error.message || i18n.genericError;
- }
- }
- },
- callbacks: {
- /**
- * Initialize button styles.
- */
- initButtonStyles: () => {
- const {
- buttonStyle,
- backgroundColor,
- blockId
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
-
- // Add dynamic button styles to the document.
- if (blockId && buttonStyle) {
- const styleElement = document.createElement('style');
- const selector = `#${blockId}`;
-
- // Use getBlockStyles from button-style.js to get the CSS string.
- styleElement.textContent = (0,_button_style__WEBPACK_IMPORTED_MODULE_1__.getBlockStyles)(selector, buttonStyle, backgroundColor);
- document.head.appendChild(styleElement);
-
- // Add popup styles.
- const popupStyleElement = document.createElement('style');
- popupStyleElement.textContent = (0,_button_style__WEBPACK_IMPORTED_MODULE_1__.getPopupStyles)(buttonStyle);
- document.head.appendChild(popupStyleElement);
- }
- },
- /**
- * Best guess whether a string is a valid ActivityPub handle.
- *
- * @param {string} string - String to check.
- * @returns {boolean} True if string is a valid handle, false otherwise.
- */
- isHandle(string) {
- // Check if the string starts with '@' and contains a valid URL.
- const parts = string.replace(/^@/, '').split('@');
- return parts.length === 2 && callbacks.isUrl(`https://${parts[1]}`);
- },
- /**
- * Checks if a string is a valid URL.
- *
- * @param {string} string - String to check.
- * @returns {boolean} True if string is a valid URL, false otherwise.
- */
- isUrl(string) {
- try {
- new URL(string);
- return true;
- } catch (_) {
- return false;
- }
- },
- /**
- * Callback when modal is closed.
- */
- onModalClose() {
- const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- context.isError = false;
- }
- }
-});
-})();
-
-
-//# sourceMappingURL=view.js.map
\ No newline at end of file
+import{getConfig as e,getContext as t,getElement as o,store as n}from"@wordpress/interactivity";const r={computedStyles:null,variables:{}};function l(e){if("undefined"==typeof window||!window.getComputedStyle)return!1;if(r.variables.hasOwnProperty(e))return r.variables[e];r.computedStyles||(r.computedStyles=window.getComputedStyle(document.documentElement));const t=r.computedStyles.getPropertyValue(e).trim();return r.variables[e]=""!==t,r.variables[e]}function c(e){if("string"!=typeof e)return null;if(e.match(/^#/))return e.substring(0,7);const[,,t]=e.split("|"),o=`--wp--preset--color--${t}`;return l(o)?`var(${o})`:null}function i(e,t,o=null,n=""){return o?`${e}${n} { ${t}: ${o}; }\n`:""}function s(e,t,o,n){return i(e,"background-color",t)+i(e,"color",o)+i(e,"background-color",n,":hover")+i(e,"background-color",n,":focus")}const{apiFetch:a}=window.wp;!function(){const{actions:e,callbacks:r}=n("activitypub/follow-me",{actions:{openModal(e){const o=t();o.modal.isOpen=!0,o.modal.isCompact?setTimeout(r.positionModal,0):setTimeout(()=>{const e=document.getElementById(o.blockId);if(e){const t=e.querySelector(".activitypub-modal__frame");t&&r.trapFocus(t)}},50),"function"==typeof r.onModalOpen&&r.onModalOpen(e)},closeModal(e){const n=t();n.modal.isOpen=!1;const l=o();if("actions.toggleModal"===l.ref.dataset["wpOn-Click"])l.ref.focus();else{const e=document.getElementById(n.blockId);if(e){const t=e.querySelector('[data-wp-on--click="actions.toggleModal"], [data-wp-on-async--click="actions.toggleModal"]');t&&t.focus()}}"function"==typeof r.onModalClose&&r.onModalClose(e)},toggleModal(o){const{modal:n}=t();n.isOpen?e.closeModal(o):e.openModal(o)}},callbacks:{_abortController:null,handleModalEffects(){const{modal:e}=t();if(e.isOpen&&!e.isCompact?document.body.classList.add("modal-open"):document.body.classList.remove("modal-open"),r._abortController&&(r._abortController.abort(),r._abortController=null),e.isOpen){r._abortController=new AbortController;const{signal:e}=r._abortController;document.addEventListener("keydown",r.documentKeydown,{signal:e}),document.addEventListener("click",r.documentClick,{signal:e})}},documentKeydown(o){const{modal:n}=t();n.isOpen&&"Escape"===o.key&&e.closeModal()},documentClick(o){const{blockId:n,modal:r}=t();if(!r.isOpen)return;const l=document.getElementById(n);if(!l)return;const c=l.querySelector('.wp-element-button[data-wp-on--click="actions.toggleModal"]');if(c&&(c===o.target||c.contains(o.target)))return;const i=l.querySelector(".activitypub-modal__frame");i&&!i.contains(o.target)&&e.closeModal()},positionModal(){const{blockId:e}=t(),n=document.getElementById(e);if(!n)return;const r=n.querySelector(".activitypub-modal__overlay");if(!r)return;r.style.top="",r.style.left="",r.style.right="",r.style.bottom="";const l=o().ref.getBoundingClientRect(),c=window.innerWidth,i=n.getBoundingClientRect();let s={top:l.bottom-i.top+8+"px",left:l.left-i.left-2+"px"};c-l.right<250&&(s.left="auto",s.right=i.right-l.right+"px"),Object.assign(r.style,s)},trapFocus(e){const t=e.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]):not([readonly]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),o=t[0],n=t[t.length-1];o&&o.classList.contains("activitypub-modal__close")&&t.length>1?t[1].focus():o.focus(),e.addEventListener("keydown",function(e){"Tab"!==e.key&&9!==e.keyCode||(e.shiftKey?document.activeElement===o&&(n.focus(),e.preventDefault()):document.activeElement===n&&(o.focus(),e.preventDefault()))})}}})}();const{actions:d,callbacks:u}=n("activitypub/follow-me",{actions:{copyToClipboard(){const o=t(),{i18n:n}=e();navigator.clipboard.writeText(o.webfinger).then(()=>{o.copyButtonText=n.copied,setTimeout(()=>{o.copyButtonText=n.copy},1e3)},e=>{console.error("Could not copy text: ",e)})},updateRemoteProfile(e){const o=t();o.remoteProfile=e.target.value,o.isError=!1,o.errorMessage=""},onKeydown(e){"A"!==o().ref.tagName||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),d.toggleModal(e))},handleKeyDown(e){"Enter"===e.key&&(e.preventDefault(),d.submitRemoteProfile())},submitRemoteProfile:function*(){const o=t(),{namespace:n,i18n:r}=e(),l=o.remoteProfile.trim();if(!l)return o.isError=!0,void(o.errorMessage=r.emptyProfileError);if(!u.isHandle(l))return o.isError=!0,void(o.errorMessage=r.invalidProfileError);o.isLoading=!0,o.isError=!1;const c=`/${n}/actors/${o.userId}/remote-follow?resource=${encodeURIComponent(l)}`;try{const e=yield a({path:c});o.isLoading=!1,window.open(e.url,"_blank"),d.closeModal(new Event("click"))}catch(e){console.error("Error submitting profile:",e),o.isLoading=!1,o.isError=!0,o.errorMessage=e.message||r.genericError}}},callbacks:{initButtonStyles:()=>{const{buttonStyle:e,backgroundColor:o,blockId:n}=t();if(n&&e){const t=document.createElement("style"),i=`#${n}`;t.textContent=function(e,t,o){const n=`${e} .wp-block-button__link`,r=function(e){if("string"==typeof e){const t=`--wp--preset--color--${e}`;return l(t)?`var(${t})`:null}return e?.color?.background||null}(o)||t?.color?.background;return s(n,c(t?.elements?.link?.color?.text),r,c(t?.elements?.link?.[":hover"]?.color?.text))}(i,e,o),document.head.appendChild(t);const a=document.createElement("style");a.textContent=(r=e,s(".activitypub-dialog__button-group .wp-block-button",c(r?.elements?.link?.color?.text)||"#111","#fff",c(r?.elements?.link?.[":hover"]?.color?.text)||"#333")),document.head.appendChild(a)}var r},isHandle(e){const t=e.replace(/^@/,"").split("@");return 2===t.length&&u.isUrl(`https://${t[1]}`)},isUrl(e){try{return new URL(e),!0}catch(e){return!1}},onModalClose(){t().isError=!1}}});
\ No newline at end of file
diff --git a/build/followers/index.asset.php b/build/followers/index.asset.php
index d97018969b..1b7f5f7e96 100644
--- a/build/followers/index.asset.php
+++ b/build/followers/index.asset.php
@@ -1 +1 @@
- array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '2e0d2ddf4bc6053b238d');
+ array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'd864454e562ad019ef94');
diff --git a/build/followers/index.js b/build/followers/index.js
index 5e9c4e7050..ac81f553f6 100644
--- a/build/followers/index.js
+++ b/build/followers/index.js
@@ -1,1033 +1,2 @@
-/******/ (() => { // webpackBootstrap
-/******/ "use strict";
-/******/ var __webpack_modules__ = ({
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/people.js":
-/*!**********************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/people.js ***!
- \**********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ people_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/people.tsx
-
-
-var people_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(
- _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path,
- {
- d: "M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z",
- fillRule: "evenodd"
- }
-) });
-
-//# sourceMappingURL=people.js.map
-
-
-/***/ }),
-
-/***/ "./src/followers/block.json":
-/*!**********************************!*\
- !*** ./src/followers/block.json ***!
- \**********************************/
-/***/ ((module) => {
-
-module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","name":"activitypub/followers","apiVersion":3,"version":"2.0.1","title":"Fediverse Followers","category":"widgets","description":"Display your followers from the Fediverse on your website.","textdomain":"activitypub","icon":"groups","supports":{"html":false,"interactivity":true},"attributes":{"selectedUser":{"type":"string","default":"blog"},"per_page":{"type":"number","default":10},"order":{"type":"string","default":"desc","enum":["asc","desc"]}},"usesContext":["postType","postId"],"styles":[{"name":"default","label":"Default","isDefault":true},{"name":"card","label":"Card"},{"name":"compact","label":"Compact"}],"editorScript":"file:./index.js","editorStyle":"file:./index.css","viewScriptModule":"file:./view.js","viewScript":"wp-api-fetch","style":["file:./style-index.css"],"render":"file:./render.php"}');
-
-/***/ }),
-
-/***/ "./src/followers/deprecations.js":
-/*!***************************************!*\
- !*** ./src/followers/deprecations.js ***!
- \***************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
-/* harmony export */ });
-/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
-/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
-
-
-/**
- * Deprecation for the followers block to handle the migration from custom title to InnerBlocks.
- */
-const v1 = {
- attributes: {
- title: {
- type: 'string',
- default: 'Fediverse Followers'
- },
- selectedUser: {
- type: 'string',
- default: 'blog'
- },
- per_page: {
- type: 'number',
- default: 10
- },
- order: {
- type: 'string',
- default: 'desc',
- enum: ['asc', 'desc']
- }
- },
- supports: {
- html: false
- },
- /**
- * Checks if the block is eligible for migration.
- *
- * @param {Object} attributes The block attributes.
- *
- * @return {boolean} Whether the block is eligible for migration.
- */
- isEligible({
- title
- }) {
- return !!title;
- },
- /**
- * Migrates the block to use a core heading block instead of the custom heading attribute.
- *
- * @param {Object} attributes The attributes for the block.
- *
- * @return {[Object, Array]} An array with the new block attributes and inner blocks.
- */
- migrate: ({
- title,
- ...newAttributes
- }) => {
- const headingBlock = (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.createBlock)('core/heading', {
- content: title,
- level: 3
- });
- return [newAttributes, [headingBlock]];
- }
-};
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([v1]);
-
-/***/ }),
-
-/***/ "./src/followers/edit.js":
-/*!*******************************!*\
- !*** ./src/followers/edit.js ***!
- \*******************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Edit)
-/* harmony export */ });
-/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
-/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
-/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data");
-/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__);
-/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
-/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_6__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__);
-/* harmony import */ var _shared_use_options__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../shared/use-options */ "./src/shared/use-options.js");
-/* harmony import */ var _shared_use_user_options__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../shared/use-user-options */ "./src/shared/use-user-options.js");
-/* harmony import */ var _shared_inherit_block_fallback__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../shared/inherit-block-fallback */ "./src/shared/inherit-block-fallback.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__);
-
-
-
-
-
-
-
-
-
-
-
-
-/**
- * Edit component.
- *
- * @param {Object} props Component props.
- * @param {Object} props.attributes Block attributes.
- * @param {Function} props.setAttributes Set block attributes.
- * @param {Object} props.context Block context.
- * @param {string} props.context.postType Post type.
- * @param {number} props.context.postId Post ID.
- *
- * @return {JSX.Element} Edit component.
- */
-
-function Edit({
- attributes,
- setAttributes,
- context: {
- postType,
- postId
- }
-}) {
- const {
- className = '',
- order,
- per_page,
- selectedUser
- } = attributes;
- const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps)();
- const [page, setPage] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useState)(1);
- const orderOptions = [{
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('New to old', 'activitypub'),
- value: 'desc'
- }, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Old to new', 'activitypub'),
- value: 'asc'
- }];
- const usersOptions = (0,_shared_use_user_options__WEBPACK_IMPORTED_MODULE_9__.useUserOptions)({
- withInherit: true
- });
- const setAttributeWithPageReset = key => value => {
- setPage(1);
- setAttributes({
- [key]: value
- });
- };
- const authorId = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => {
- const {
- getEditedEntityRecord
- } = select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_3__.store);
- const _authorId = getEditedEntityRecord('postType', postType, postId)?.author;
- return _authorId !== null && _authorId !== void 0 ? _authorId : null;
- }, [postType, postId]);
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useEffect)(() => {
- // if there are no users yet, do nothing
- if (!usersOptions.length) {
- return;
- }
- // ensure that the selected user is in the list of options, if not, select the first available user
- if (!usersOptions.find(({
- value
- }) => value === selectedUser)) {
- setAttributes({
- selectedUser: usersOptions[0].value
- });
- }
- }, [selectedUser, usersOptions]);
-
- // Template for InnerBlocks - allows only a heading block.
- const TEMPLATE = [['core/heading', {
- level: 3,
- placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Fediverse Followers', 'activitypub'),
- content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Fediverse Followers', 'activitypub')
- }]];
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
- ...blockProps,
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.InspectorControls, {
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelBody, {
- title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Followers Options', 'activitypub'),
- children: [usersOptions.length > 1 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Select User', 'activitypub'),
- value: selectedUser,
- options: usersOptions,
- onChange: setAttributeWithPageReset('selectedUser'),
- __next40pxDefaultSize: true,
- __nextHasNoMarginBottom: true
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Sort', 'activitypub'),
- value: order,
- options: orderOptions,
- onChange: setAttributeWithPageReset('order'),
- __next40pxDefaultSize: true,
- __nextHasNoMarginBottom: true
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.RangeControl, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Number of Followers', 'activitypub'),
- value: per_page,
- onChange: setAttributeWithPageReset('per_page'),
- min: 1,
- max: 10,
- __next40pxDefaultSize: true,
- __nextHasNoMarginBottom: true
- })]
- })
- }, "setting"), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
- className: 'wp-block-activitypub-followers ' + className,
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.InnerBlocks, {
- template: TEMPLATE,
- allowedBlocks: ['core/heading'],
- templateLock: 'all',
- renderAppender: false
- }), selectedUser === 'inherit' ? authorId ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(Followers, {
- ...attributes,
- page: page,
- setPage: setPage,
- selectedUser: authorId
- }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_shared_inherit_block_fallback__WEBPACK_IMPORTED_MODULE_10__.InheritModeBlockFallback, {
- name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Followers', 'activitypub')
- }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(Followers, {
- ...attributes,
- page: page,
- setPage: setPage
- })]
- })]
- });
-}
-
-/**
- * Builds the API path for fetching followers.
- *
- * @param {number} userId - The ID of the user whose followers are being fetched.
- * @param {number} per_page - The number of followers to fetch per page.
- * @param {string} order - The order in which to fetch followers ('asc' or 'desc').
- * @param {number} page - The page number to fetch.
- * @return {string} The API path with query arguments for fetching followers.
- */
-function getPath(userId, per_page, order, page) {
- const {
- namespace
- } = (0,_shared_use_options__WEBPACK_IMPORTED_MODULE_8__.useOptions)();
- const path = `/${namespace}/actors/${userId}/followers`;
- const args = {
- per_page,
- order,
- page,
- context: 'full'
- };
- return (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_6__.addQueryArgs)(path, args);
-}
-
-/**
- * Component to display followers of a user.
- *
- * @param {Object} props - The component props.
- * @param {String} props.selectedUser - The ID of the user whose followers are being fetched.
- * @param {number} props.per_page - The number of followers to fetch per page.
- * @param {string} props.order - The order in which to fetch followers ('asc' or 'desc').
- * @param {number} props.page - The page number to fetch.
- * @param {function} props.setPage - The function to set the page number.
- * @param {Object} props.followerData - Optional pre-fetched follower data.
- */
-function Followers({
- selectedUser,
- per_page,
- order,
- page: passedPage,
- setPage: passedSetPage,
- followerData = false
-}) {
- const userId = selectedUser === 'blog' ? 0 : selectedUser;
- const [followers, setFollowers] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useState)([]);
- const [pages, setPages] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useState)(0);
- const [total, setTotal] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useState)(0);
- const [localPage, setLocalPage] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useState)(1);
- const page = passedPage || localPage;
- const setPage = passedSetPage || setLocalPage;
- const setData = (followers, total) => {
- setFollowers(followers);
- setTotal(total);
- setPages(Math.ceil(total / per_page));
- };
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useEffect)(() => {
- if (followerData && page === 1) {
- return setData(followerData.followers, followerData.total);
- }
- const path = getPath(userId, per_page, order, page);
- _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default()({
- path
- }).then(({
- orderedItems,
- totalItems
- }) => setData(orderedItems, totalItems)).catch(() => setData([], 0));
- }, [userId, per_page, order, page, followerData]);
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
- className: "followers-container",
- children: [followers.length ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("ul", {
- className: "followers-list",
- children: followers.map(follower => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("li", {
- className: "follower-item",
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(Follower, {
- ...follower
- })
- }, follower.url))
- }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("p", {
- className: "followers-placeholder",
- children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('No followers found.', 'activitypub')
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(Pagination, {
- page: page,
- pages: pages,
- setPage: setPage
- })]
- });
-}
-
-/**
- * Component to display pagination navigation.
- *
- * @param {Object} props - The component props.
- * @param {number} props.page - The current page number.
- * @param {number} props.pages - The total number of pages.
- * @param {function} props.setPage - The function to set the page number.
- */
-function Pagination({
- page,
- pages,
- setPage
-}) {
- if (pages <= 1) {
- return null;
- }
- const disablePreviousLink = page <= 1;
- const disableNextLink = page >= pages;
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("nav", {
- className: "followers-pagination",
- role: "navigation",
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("h1", {
- className: "screen-reader-text",
- children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Follower navigation', 'activitypub')
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("a", {
- className: "pagination-previous",
- "aria-disabled": disablePreviousLink,
- "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Previous page', 'activitypub'),
- onClick: event => {
- event.preventDefault();
- setPage(page - 1);
- },
- children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Previous', 'activitypub')
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
- className: "pagination-info",
- children: `${page} / ${pages}`
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("a", {
- className: "pagination-next",
- "aria-disabled": disableNextLink,
- "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Next page', 'activitypub'),
- onClick: event => {
- event.preventDefault();
- setPage(page + 1);
- },
- children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Next', 'activitypub')
- })]
- });
-}
-
-/**
- * Component to display a single follower.
- *
- * @param {Object} props - The component props.
- * @param {string} props.name - The name of the follower.
- * @param {Object} props.icon - The icon of the follower.
- * @param {string} props.url - The URL of the follower.
- * @param {string} props.preferredUsername - The preferred username of the follower.
- */
-function Follower({
- name,
- icon,
- url,
- preferredUsername
-}) {
- const handle = `@${preferredUsername}`;
- const {
- defaultAvatarUrl
- } = (0,_shared_use_options__WEBPACK_IMPORTED_MODULE_8__.useOptions)();
- const avatar = icon?.url || defaultAvatarUrl;
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("a", {
- className: "follower-link",
- href: url,
- title: handle,
- onClick: event => event.preventDefault(),
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("img", {
- width: "48",
- height: "48",
- src: avatar,
- className: "follower-avatar",
- alt: name,
- onError: event => {
- event.target.src = defaultAvatarUrl;
- }
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
- className: "follower-info",
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
- className: "follower-name",
- children: name
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
- className: "follower-username",
- children: handle
- })]
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("svg", {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24",
- width: "24",
- height: "24",
- className: "external-link-icon",
- "aria-hidden": "true",
- focusable: "false",
- fill: "currentColor",
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("path", {
- d: "M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"
- })
- })]
- });
-}
-
-/***/ }),
-
-/***/ "./src/followers/index.js":
-/*!********************************!*\
- !*** ./src/followers/index.js ***!
- \********************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
-/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/people.js");
-/* harmony import */ var _deprecations__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./deprecations */ "./src/followers/deprecations.js");
-/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./edit */ "./src/followers/edit.js");
-/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/followers/block.json");
-/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./save */ "./src/followers/save.js");
-/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./style.scss */ "./src/followers/style.scss");
-
-
-
-
-
-
-
-(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__, {
- deprecated: _deprecations__WEBPACK_IMPORTED_MODULE_2__["default"],
- edit: _edit__WEBPACK_IMPORTED_MODULE_3__["default"],
- save: _save__WEBPACK_IMPORTED_MODULE_5__["default"],
- icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__["default"]
-});
-
-/***/ }),
-
-/***/ "./src/followers/save.js":
-/*!*******************************!*\
- !*** ./src/followers/save.js ***!
- \*******************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ save)
-/* harmony export */ });
-/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
-/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-
-
-/**
- * Save function for the Followers block.
- *
- * @return {JSX.Element} Element to render.
- */
-
-function save() {
- const blockProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save();
- const innerBlocksProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useInnerBlocksProps.save(blockProps);
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
- ...innerBlocksProps
- });
-}
-
-/***/ }),
-
-/***/ "./src/followers/style.scss":
-/*!**********************************!*\
- !*** ./src/followers/style.scss ***!
- \**********************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-// extracted by mini-css-extract-plugin
-
-
-/***/ }),
-
-/***/ "./src/shared/inherit-block-fallback.js":
-/*!**********************************************!*\
- !*** ./src/shared/inherit-block-fallback.js ***!
- \**********************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ InheritModeBlockFallback: () => (/* binding */ InheritModeBlockFallback)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _use_options__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./use-options */ "./src/shared/use-options.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
-
-
-
-
-
-/**
- * Block fallback component for inheriting user context in ActivityPub blocks.
- *
- * @param {Object} props
- * @param {string} props.name - Name of the block.
- * @returns {JSX.Element} Rendered fallback block.
- */
-
-function InheritModeBlockFallback({
- name
-}) {
- const {
- enabled
- } = (0,_use_options__WEBPACK_IMPORTED_MODULE_3__.useOptions)();
- const nonAuthorExtra = enabled?.blog ? '' : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('It will be empty in other non-author contexts.', 'activitypub');
- const text = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %1$s: block name, %2$s: extra information for non-author context */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s', 'activitypub'), name, nonAuthorExtra).trim();
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Card, {
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.CardBody, {
- children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createInterpolateElement)(text, {
- strong: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("strong", {})
- })
- })
- });
-}
-
-/***/ }),
-
-/***/ "./src/shared/use-options.js":
-/*!***********************************!*\
- !*** ./src/shared/use-options.js ***!
- \***********************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ useOptions: () => (/* binding */ useOptions)
-/* harmony export */ });
-/**
- * React hook to return the ActivityPub options object from the global window.
- *
- * @returns {Object} The options object.
- */
-function useOptions() {
- return window._activityPubOptions || {};
-}
-
-/***/ }),
-
-/***/ "./src/shared/use-user-options.js":
-/*!****************************************!*\
- !*** ./src/shared/use-user-options.js ***!
- \****************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ useUserOptions: () => (/* binding */ useUserOptions)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
-/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _use_options__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./use-options */ "./src/shared/use-options.js");
-
-
-
-
-
-
-/**
- * React hook providing user options for ActivityPub blocks.
- *
- * @param {Object} params
- * @param {boolean} params.withInherit - Whether to include the inherit option.
- * @returns {Array} List of user option objects.
- */
-function useUserOptions({
- withInherit = false
-}) {
- /**
- * ActivityPub options.
- *
- * @type {Object}
- * @property {boolean} enabled.users - Whether users are enabled.
- * @property {boolean} enabled.blog - Whether the blog user is enabled.
- */
- const {
- enabled,
- namespace
- } = (0,_use_options__WEBPACK_IMPORTED_MODULE_4__.useOptions)();
- const [currentUserCanActivityPub, setCurrentUserCanActivityPub] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
- const {
- fetchedUsers,
- isLoadingUsers
- } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
- const {
- getUsers,
- getIsResolving
- } = select('core');
- return {
- fetchedUsers: enabled?.users ? getUsers({
- capabilities: 'activitypub'
- }) : null,
- isLoadingUsers: enabled?.users ? getIsResolving('getUsers', [{
- capabilities: 'activitypub'
- }]) : false
- };
- }, []);
-
- // Only fetch current user if fetchedUsers is empty and we're not still loading.
- const currentUser = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => fetchedUsers || isLoadingUsers ? null : select('core').getCurrentUser(), [fetchedUsers, isLoadingUsers]);
-
- // Test if current user has activitypub capability by trying to access their actor endpoint.
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
- if (fetchedUsers || isLoadingUsers || !currentUser) {
- return;
- }
- _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3___default()({
- path: `/${namespace}/actors/${currentUser.id}`,
- method: 'HEAD',
- headers: {
- Accept: 'application/activity+json'
- },
- parse: false
- }).then(() => setCurrentUserCanActivityPub(true)).catch(() => setCurrentUserCanActivityPub(false));
- }, [fetchedUsers, isLoadingUsers, currentUser]);
- const users = fetchedUsers || (currentUser && currentUserCanActivityPub ? [{
- id: currentUser.id,
- name: currentUser.name
- }] : []);
-
- /**
- * Memoized computation of user options for block settings.
- */
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
- if (!users.length) {
- return [];
- }
- const userKeywords = [];
- if (enabled?.blog && fetchedUsers) {
- userKeywords.push({
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Blog', 'activitypub'),
- value: 'blog'
- });
- }
-
- // Only show the inherit option when explicitly asked for and users are enabled.
- if (withInherit && enabled?.users && fetchedUsers) {
- userKeywords.push({
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Dynamic User', 'activitypub'),
- value: 'inherit'
- });
- }
-
- /**
- * Reduce users into keyword/value pairs for options.
- */
- return users.reduce((acc, user) => {
- acc.push({
- label: user.name,
- value: `${user.id}` // Casting to string because that's how Gutenberg stores the attribute.
- });
- return acc;
- }, userKeywords);
- }, [users]);
-}
-
-/***/ }),
-
-/***/ "@wordpress/api-fetch":
-/*!**********************************!*\
- !*** external ["wp","apiFetch"] ***!
- \**********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["apiFetch"];
-
-/***/ }),
-
-/***/ "@wordpress/block-editor":
-/*!*************************************!*\
- !*** external ["wp","blockEditor"] ***!
- \*************************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["blockEditor"];
-
-/***/ }),
-
-/***/ "@wordpress/blocks":
-/*!********************************!*\
- !*** external ["wp","blocks"] ***!
- \********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["blocks"];
-
-/***/ }),
-
-/***/ "@wordpress/components":
-/*!************************************!*\
- !*** external ["wp","components"] ***!
- \************************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["components"];
-
-/***/ }),
-
-/***/ "@wordpress/core-data":
-/*!**********************************!*\
- !*** external ["wp","coreData"] ***!
- \**********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["coreData"];
-
-/***/ }),
-
-/***/ "@wordpress/data":
-/*!******************************!*\
- !*** external ["wp","data"] ***!
- \******************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["data"];
-
-/***/ }),
-
-/***/ "@wordpress/element":
-/*!*********************************!*\
- !*** external ["wp","element"] ***!
- \*********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["element"];
-
-/***/ }),
-
-/***/ "@wordpress/i18n":
-/*!******************************!*\
- !*** external ["wp","i18n"] ***!
- \******************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["i18n"];
-
-/***/ }),
-
-/***/ "@wordpress/primitives":
-/*!************************************!*\
- !*** external ["wp","primitives"] ***!
- \************************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["primitives"];
-
-/***/ }),
-
-/***/ "@wordpress/url":
-/*!*****************************!*\
- !*** external ["wp","url"] ***!
- \*****************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["url"];
-
-/***/ }),
-
-/***/ "react/jsx-runtime":
-/*!**********************************!*\
- !*** external "ReactJSXRuntime" ***!
- \**********************************/
-/***/ ((module) => {
-
-module.exports = window["ReactJSXRuntime"];
-
-/***/ })
-
-/******/ });
-/************************************************************************/
-/******/ // The module cache
-/******/ var __webpack_module_cache__ = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/ // Check if module is in cache
-/******/ var cachedModule = __webpack_module_cache__[moduleId];
-/******/ if (cachedModule !== undefined) {
-/******/ return cachedModule.exports;
-/******/ }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = __webpack_module_cache__[moduleId] = {
-/******/ // no module.id needed
-/******/ // no module.loaded needed
-/******/ exports: {}
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/******/ // expose the modules object (__webpack_modules__)
-/******/ __webpack_require__.m = __webpack_modules__;
-/******/
-/************************************************************************/
-/******/ /* webpack/runtime/chunk loaded */
-/******/ (() => {
-/******/ var deferred = [];
-/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
-/******/ if(chunkIds) {
-/******/ priority = priority || 0;
-/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
-/******/ deferred[i] = [chunkIds, fn, priority];
-/******/ return;
-/******/ }
-/******/ var notFulfilled = Infinity;
-/******/ for (var i = 0; i < deferred.length; i++) {
-/******/ var [chunkIds, fn, priority] = deferred[i];
-/******/ var fulfilled = true;
-/******/ for (var j = 0; j < chunkIds.length; j++) {
-/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
-/******/ chunkIds.splice(j--, 1);
-/******/ } else {
-/******/ fulfilled = false;
-/******/ if(priority < notFulfilled) notFulfilled = priority;
-/******/ }
-/******/ }
-/******/ if(fulfilled) {
-/******/ deferred.splice(i--, 1)
-/******/ var r = fn();
-/******/ if (r !== undefined) result = r;
-/******/ }
-/******/ }
-/******/ return result;
-/******/ };
-/******/ })();
-/******/
-/******/ /* webpack/runtime/compat get default export */
-/******/ (() => {
-/******/ // getDefaultExport function for compatibility with non-harmony modules
-/******/ __webpack_require__.n = (module) => {
-/******/ var getter = module && module.__esModule ?
-/******/ () => (module['default']) :
-/******/ () => (module);
-/******/ __webpack_require__.d(getter, { a: getter });
-/******/ return getter;
-/******/ };
-/******/ })();
-/******/
-/******/ /* webpack/runtime/define property getters */
-/******/ (() => {
-/******/ // define getter functions for harmony exports
-/******/ __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 */
-/******/ (() => {
-/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
-/******/ })();
-/******/
-/******/ /* webpack/runtime/make namespace object */
-/******/ (() => {
-/******/ // define __esModule on 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/jsonp chunk loading */
-/******/ (() => {
-/******/ // no baseURI
-/******/
-/******/ // object to store loaded and loading chunks
-/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
-/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
-/******/ var installedChunks = {
-/******/ "followers/index": 0,
-/******/ "followers/style-index": 0
-/******/ };
-/******/
-/******/ // no chunk on demand loading
-/******/
-/******/ // no prefetching
-/******/
-/******/ // no preloaded
-/******/
-/******/ // no HMR
-/******/
-/******/ // no HMR manifest
-/******/
-/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
-/******/
-/******/ // install a JSONP callback for chunk loading
-/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
-/******/ var [chunkIds, moreModules, runtime] = data;
-/******/ // add "moreModules" to the modules object,
-/******/ // then flag all "chunkIds" as loaded and fire callback
-/******/ var moduleId, chunkId, i = 0;
-/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
-/******/ for(moduleId in moreModules) {
-/******/ if(__webpack_require__.o(moreModules, moduleId)) {
-/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
-/******/ }
-/******/ }
-/******/ if(runtime) var result = runtime(__webpack_require__);
-/******/ }
-/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
-/******/ for(;i < chunkIds.length; i++) {
-/******/ chunkId = chunkIds[i];
-/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
-/******/ installedChunks[chunkId][0]();
-/******/ }
-/******/ installedChunks[chunkId] = 0;
-/******/ }
-/******/ return __webpack_require__.O(result);
-/******/ }
-/******/
-/******/ var chunkLoadingGlobal = globalThis["webpackChunkwordpress_activitypub"] = globalThis["webpackChunkwordpress_activitypub"] || [];
-/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
-/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
-/******/ })();
-/******/
-/************************************************************************/
-/******/
-/******/ // startup
-/******/ // Load entry module and return exports
-/******/ // This entry module depends on other loaded chunks and execution need to be delayed
-/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["followers/style-index"], () => (__webpack_require__("./src/followers/index.js")))
-/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
-/******/
-/******/ })()
-;
-//# sourceMappingURL=index.js.map
\ No newline at end of file
+(()=>{"use strict";var e,t={454:(e,t,s)=>{const a=window.wp.blocks,r=window.wp.primitives,l=window.ReactJSXRuntime;var i=(0,l.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.jsx)(r.Path,{d:"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z",fillRule:"evenodd"})});const o=[{attributes:{title:{type:"string",default:"Fediverse Followers"},selectedUser:{type:"string",default:"blog"},per_page:{type:"number",default:10},order:{type:"string",default:"desc",enum:["asc","desc"]}},supports:{html:!1},isEligible:({title:e})=>!!e,migrate:({title:e,...t})=>[t,[(0,a.createBlock)("core/heading",{content:e,level:3})]]}],n=window.wp.apiFetch;var c=s.n(n);const p=window.wp.components,u=window.wp.blockEditor,d=window.wp.coreData,v=window.wp.data,h=window.wp.element,g=window.wp.url,w=window.wp.i18n;function f(){return window._activityPubOptions||{}}function b({name:e}){const{enabled:t}=f(),s=t?.blog?"":(0,w.__)("It will be empty in other non-author contexts.","activitypub"),a=(0,w.sprintf)(/* translators: %1$s: block name, %2$s: extra information for non-author context */ /* translators: %1$s: block name, %2$s: extra information for non-author context */
+(0,w.__)("This %1$s block will adapt to the page it is on, displaying the user profile associated with a post author (in a loop) or a user archive. %2$s","activitypub"),e,s).trim();return(0,l.jsx)(p.Card,{children:(0,l.jsx)(p.CardBody,{children:(0,h.createInterpolateElement)(a,{strong:(0,l.jsx)("strong",{})})})})}function m({selectedUser:e,per_page:t,order:s,page:a,setPage:r,followerData:i=!1}){const o="blog"===e?0:e,[n,p]=(0,h.useState)([]),[u,d]=(0,h.useState)(0),[v,b]=(0,h.useState)(0),[m,y]=(0,h.useState)(1),j=a||m,N=r||y,k=(e,s)=>{p(e),b(s),d(Math.ceil(s/t))};return(0,h.useEffect)(()=>{if(i&&1===j)return k(i.followers,i.total);const e=function(e,t,s,a){const{namespace:r}=f(),l=`/${r}/actors/${e}/followers`,i={per_page:t,order:s,page:a,context:"full"};return(0,g.addQueryArgs)(l,i)}(o,t,s,j);c()({path:e}).then(({orderedItems:e,totalItems:t})=>k(e,t)).catch(()=>k([],0))},[o,t,s,j,i]),(0,l.jsxs)("div",{className:"followers-container",children:[n.length?(0,l.jsx)("ul",{className:"followers-list",children:n.map(e=>(0,l.jsx)("li",{className:"follower-item",children:(0,l.jsx)(_,{...e})},e.url))}):(0,l.jsx)("p",{className:"followers-placeholder",children:(0,w.__)("No followers found.","activitypub")}),(0,l.jsx)(x,{page:j,pages:u,setPage:N})]})}function x({page:e,pages:t,setPage:s}){if(t<=1)return null;const a=e<=1,r=e>=t;return(0,l.jsxs)("nav",{className:"followers-pagination",role:"navigation",children:[(0,l.jsx)("h1",{className:"screen-reader-text",children:(0,w.__)("Follower navigation","activitypub")}),(0,l.jsx)("a",{className:"pagination-previous","aria-disabled":a,"aria-label":(0,w.__)("Previous page","activitypub"),onClick:t=>{t.preventDefault(),s(e-1)},children:(0,w.__)("Previous","activitypub")}),(0,l.jsx)("div",{className:"pagination-info",children:`${e} / ${t}`}),(0,l.jsx)("a",{className:"pagination-next","aria-disabled":r,"aria-label":(0,w.__)("Next page","activitypub"),onClick:t=>{t.preventDefault(),s(e+1)},children:(0,w.__)("Next","activitypub")})]})}function _({name:e,icon:t,url:s,preferredUsername:a}){const r=`@${a}`,{defaultAvatarUrl:i}=f(),o=t?.url||i;return(0,l.jsxs)("a",{className:"follower-link",href:s,title:r,onClick:e=>e.preventDefault(),children:[(0,l.jsx)("img",{width:"48",height:"48",src:o,className:"follower-avatar",alt:e,onError:e=>{e.target.src=i}}),(0,l.jsxs)("div",{className:"follower-info",children:[(0,l.jsx)("span",{className:"follower-name",children:e}),(0,l.jsx)("span",{className:"follower-username",children:r})]}),(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",className:"external-link-icon","aria-hidden":"true",focusable:"false",fill:"currentColor",children:(0,l.jsx)("path",{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"})})]})}const y=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","name":"activitypub/followers","apiVersion":3,"version":"2.0.1","title":"Fediverse Followers","category":"widgets","description":"Display your followers from the Fediverse on your website.","textdomain":"activitypub","icon":"groups","supports":{"html":false,"interactivity":true},"attributes":{"selectedUser":{"type":"string","default":"blog"},"per_page":{"type":"number","default":10},"order":{"type":"string","default":"desc","enum":["asc","desc"]}},"usesContext":["postType","postId"],"styles":[{"name":"default","label":"Default","isDefault":true},{"name":"card","label":"Card"},{"name":"compact","label":"Compact"}],"editorScript":"file:./index.js","editorStyle":"file:./index.css","viewScriptModule":"file:./view.js","viewScript":"wp-api-fetch","style":["file:./style-index.css"],"render":"file:./render.php"}');(0,a.registerBlockType)(y,{deprecated:o,edit:function({attributes:e,setAttributes:t,context:{postType:s,postId:a}}){const{className:r="",order:i,per_page:o,selectedUser:n}=e,g=(0,u.useBlockProps)(),[x,_]=(0,h.useState)(1),y=[{label:(0,w.__)("New to old","activitypub"),value:"desc"},{label:(0,w.__)("Old to new","activitypub"),value:"asc"}],j=function({withInherit:e=!1}){const{enabled:t,namespace:s}=f(),[a,r]=(0,h.useState)(!1),{fetchedUsers:l,isLoadingUsers:i}=(0,v.useSelect)(e=>{const{getUsers:s,getIsResolving:a}=e("core");return{fetchedUsers:t?.users?s({capabilities:"activitypub"}):null,isLoadingUsers:!!t?.users&&a("getUsers",[{capabilities:"activitypub"}])}},[]),o=(0,v.useSelect)(e=>l||i?null:e("core").getCurrentUser(),[l,i]);(0,h.useEffect)(()=>{l||i||!o||c()({path:`/${s}/actors/${o.id}`,method:"HEAD",headers:{Accept:"application/activity+json"},parse:!1}).then(()=>r(!0)).catch(()=>r(!1))},[l,i,o]);const n=l||(o&&a?[{id:o.id,name:o.name}]:[]);return(0,h.useMemo)(()=>{if(!n.length)return[];const s=[];return t?.blog&&l&&s.push({label:(0,w.__)("Blog","activitypub"),value:"blog"}),e&&t?.users&&l&&s.push({label:(0,w.__)("Dynamic User","activitypub"),value:"inherit"}),n.reduce((e,t)=>(e.push({label:t.name,value:`${t.id}`}),e),s)},[n])}({withInherit:!0}),N=e=>s=>{_(1),t({[e]:s})},k=(0,v.useSelect)(e=>{const{getEditedEntityRecord:t}=e(d.store),r=t("postType",s,a)?.author;return null!=r?r:null},[s,a]);(0,h.useEffect)(()=>{j.length&&(j.find(({value:e})=>e===n)||t({selectedUser:j[0].value}))},[n,j]);const S=[["core/heading",{level:3,placeholder:(0,w.__)("Fediverse Followers","activitypub"),content:(0,w.__)("Fediverse Followers","activitypub")}]];return(0,l.jsxs)("div",{...g,children:[(0,l.jsx)(u.InspectorControls,{children:(0,l.jsxs)(p.PanelBody,{title:(0,w.__)("Followers Options","activitypub"),children:[j.length>1&&(0,l.jsx)(p.SelectControl,{label:(0,w.__)("Select User","activitypub"),value:n,options:j,onChange:N("selectedUser"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),(0,l.jsx)(p.SelectControl,{label:(0,w.__)("Sort","activitypub"),value:i,options:y,onChange:N("order"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),(0,l.jsx)(p.RangeControl,{label:(0,w.__)("Number of Followers","activitypub"),value:o,onChange:N("per_page"),min:1,max:10,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})]})},"setting"),(0,l.jsxs)("div",{className:"wp-block-activitypub-followers "+r,children:[(0,l.jsx)(u.InnerBlocks,{template:S,allowedBlocks:["core/heading"],templateLock:"all",renderAppender:!1}),"inherit"===n?k?(0,l.jsx)(m,{...e,page:x,setPage:_,selectedUser:k}):(0,l.jsx)(b,{name:(0,w.__)("Followers","activitypub")}):(0,l.jsx)(m,{...e,page:x,setPage:_})]})]})},save:function(){const e=u.useBlockProps.save(),t=u.useInnerBlocksProps.save(e);return(0,l.jsx)("div",{...t})},icon:i})}},s={};function a(e){var r=s[e];if(void 0!==r)return r.exports;var l=s[e]={exports:{}};return t[e](l,l.exports,a),l.exports}a.m=t,e=[],a.O=(t,s,r,l)=>{if(!s){var i=1/0;for(p=0;p=l)&&Object.keys(a.O).every(e=>a.O[e](s[n]))?s.splice(n--,1):(o=!1,l0&&e[p-1][2]>l;p--)e[p]=e[p-1];e[p]=[s,r,l]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var s in t)a.o(t,s)&&!a.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={149:0,17:0};a.O.j=t=>0===e[t];var t=(t,s)=>{var r,l,[i,o,n]=s,c=0;if(i.some(t=>0!==e[t])){for(r in o)a.o(o,r)&&(a.m[r]=o[r]);if(n)var p=n(a)}for(t&&t(s);ca(454));r=a.O(r)})();
\ No newline at end of file
diff --git a/build/followers/style-index-rtl.css b/build/followers/style-index-rtl.css
index 3a3c74a9bf..3173399f46 100644
--- a/build/followers/style-index-rtl.css
+++ b/build/followers/style-index-rtl.css
@@ -1,241 +1 @@
-/*!*************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/followers/style.scss ***!
- \*************************************************************************************************************************************************************************************************************************************************/
-@charset "UTF-8";
-button {
- border: none;
-}
-.wp-block-activitypub-followers {
- margin: 16px 0;
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
-}
-.wp-block-activitypub-followers .wp-block-heading {
- margin: 0 0 16px;
- padding: 0 0 8px;
- border-bottom: 1px solid;
-}
-.wp-block-activitypub-followers .wp-block-heading,
-.wp-block-activitypub-followers .followers-pagination {
- border-color: var(--wp--preset--color--foreground, var(--wp--preset--color--primary, #e0e0e0));
-}
-.wp-block-activitypub-followers .followers-container {
- position: relative;
-}
-.wp-block-activitypub-followers .followers-container .followers-list {
- margin: 0;
- padding: 0;
- list-style: none;
-}
-.wp-block-activitypub-followers .followers-container .follower-item {
- margin: 0 0 8px;
-}
-.wp-block-activitypub-followers .followers-container .follower-item:last-child {
- margin-bottom: 0;
-}
-.wp-block-activitypub-followers .followers-container .follower-link {
- display: flex;
- align-items: center;
- padding: 8px;
- border: none;
- border-radius: 8px;
- box-shadow: none;
- transition: background-color 0.2s ease;
-}
-.wp-block-activitypub-followers .followers-container .follower-link:hover, .wp-block-activitypub-followers .followers-container .follower-link:focus {
- background-color: var(--wp--preset--color--subtle-background, var(--wp--preset--color--accent-2, var(--wp--preset--color--tertiary, var(--wp--preset--color--secondary, #f0f0f0))));
- box-shadow: none;
- outline: none;
-}
-.wp-block-activitypub-followers .followers-container .follower-link:hover .external-link-icon, .wp-block-activitypub-followers .followers-container .follower-link:focus .external-link-icon {
- opacity: 1;
-}
-.wp-block-activitypub-followers .followers-container .follower-avatar {
- width: 48px;
- height: 48px;
- border-radius: 50%;
- -o-object-fit: cover;
- object-fit: cover;
- margin-left: 16px;
- border: 1px solid #e0e0e0;
-}
-.wp-block-activitypub-followers .followers-container .follower-info {
- flex: 1;
- display: flex;
- flex-direction: column;
- overflow: hidden;
- line-height: 1.3;
-}
-.wp-block-activitypub-followers .followers-container .follower-name {
- font-weight: 600;
- margin-bottom: 2px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-.wp-block-activitypub-followers .followers-container .follower-username {
- color: var(--wp--preset--color--very-dark-gray, #666);
- font-size: 90%;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-.wp-block-activitypub-followers .followers-container .external-link-icon {
- width: 16px;
- height: 16px;
- margin-right: 8px;
- transition: opacity 0.2s ease;
-}
-.wp-block-activitypub-followers .followers-container .followers-pagination {
- display: grid;
- grid-template-columns: 1fr auto 1fr;
- align-items: center;
- margin-top: 16px;
- padding-top: 8px !important;
- border-top-style: solid;
- border-top-width: 1px;
-}
-.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-info {
- color: var(--wp--preset--color--very-dark-gray, #666);
- font-size: 90%;
- justify-self: center;
-}
-.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous,
-.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next {
- border: none;
- box-shadow: none;
- cursor: pointer;
- font-size: 90%;
- display: inline-block;
- padding: 8px 0;
- min-width: 60px;
-}
-.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous[hidden],
-.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next[hidden] {
- display: none !important;
-}
-.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous[aria-disabled=true],
-.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next[aria-disabled=true] {
- opacity: 0.3;
- cursor: not-allowed;
- pointer-events: none;
- text-decoration: none;
-}
-.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous {
- justify-self: start;
- padding-left: 8px;
-}
-.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous::before {
- content: "←";
-}
-.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next {
- justify-self: end;
- padding-right: 8px;
- text-align: left;
-}
-.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next::after {
- content: "→";
-}
-@media (max-width: 480px) {
- .wp-block-activitypub-followers .followers-container .followers-pagination {
- grid-template-columns: 1fr 1fr;
- }
- .wp-block-activitypub-followers .followers-container .followers-pagination .pagination-info {
- display: none;
- }
- .wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous,
- .wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next {
- min-height: 44px;
- font-size: 100%;
- align-items: center;
- }
-}
-.wp-block-activitypub-followers .followers-container .followers-loading {
- position: absolute;
- top: 0;
- right: 0;
- left: 0;
- bottom: 0;
- background-color: rgba(255, 255, 255, 0.5);
- border-radius: 8px;
- display: flex;
- align-items: center;
- justify-content: center;
-}
-.wp-block-activitypub-followers .followers-container .followers-loading[aria-hidden=true] {
- display: none;
-}
-.wp-block-activitypub-followers .followers-container .loading-spinner {
- width: 40px;
- height: 40px;
- border: 3px solid color-mix(in srgb, var(--wp--preset--color--primary, #0073aa) 30%, transparent);
- border-radius: 50%;
- border-top-color: var(--wp--preset--color--primary, #0073aa);
- animation: spin 1s ease-in-out infinite;
-}
-@keyframes spin {
- to {
- transform: rotate(-360deg);
- }
-}
-.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) {
- background-color: var(--wp--preset--color--white, #fff);
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
- box-sizing: border-box;
- padding: 24px;
-}
-@media (max-width: 480px) {
- .wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) {
- margin-right: -12px;
- margin-left: -12px;
- }
-}
-.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .wp-block-heading {
- text-align: center;
- border-bottom: none;
- margin-bottom: 16px;
-}
-.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .follower-link {
- border: 1px solid #e0e0e0;
- margin-bottom: 8px;
-}
-.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .follower-link:hover, .wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .follower-link:focus {
- border-color: rgb(198.5, 198.5, 198.5);
-}
-.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .followers-pagination {
- border: none;
- padding-bottom: 0 !important;
-}
-.wp-block-activitypub-followers.is-style-compact .follower-link {
- padding: 4px;
-}
-.wp-block-activitypub-followers.is-style-compact .follower-avatar {
- width: 36px;
- height: 36px;
- margin-left: 8px;
-}
-.wp-block-activitypub-followers.is-style-compact .follower-name {
- font-size: 90%;
-}
-.wp-block-activitypub-followers.is-style-compact .follower-username {
- font-size: 80%;
-}
-.wp-block-activitypub-followers.is-style-compact .followers-pagination {
- margin-top: 8px;
- padding-top: 4px;
-}
-.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-previous,
-.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-next {
- padding-top: 4px;
- padding-bottom: 4px;
- font-size: 80%;
-}
-@media (max-width: 480px) {
- .wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-previous,
- .wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-next {
- font-size: 100%;
- }
-}
-.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-info {
- font-size: 80%;
-}
+button{border:none}.wp-block-activitypub-followers{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;margin:16px 0}.wp-block-activitypub-followers .wp-block-heading{border-bottom:1px solid;margin:0 0 16px;padding:0 0 8px}.wp-block-activitypub-followers .followers-pagination,.wp-block-activitypub-followers .wp-block-heading{border-color:var(--wp--preset--color--foreground,var(--wp--preset--color--primary,#e0e0e0))}.wp-block-activitypub-followers .followers-container{position:relative}.wp-block-activitypub-followers .followers-container .followers-list{list-style:none;margin:0;padding:0}.wp-block-activitypub-followers .followers-container .follower-item{margin:0 0 8px}.wp-block-activitypub-followers .followers-container .follower-item:last-child{margin-bottom:0}.wp-block-activitypub-followers .followers-container .follower-link{align-items:center;border:none;border-radius:8px;box-shadow:none;display:flex;padding:8px;transition:background-color .2s ease}.wp-block-activitypub-followers .followers-container .follower-link:focus,.wp-block-activitypub-followers .followers-container .follower-link:hover{background-color:var(--wp--preset--color--subtle-background,var(--wp--preset--color--accent-2,var(--wp--preset--color--tertiary,var(--wp--preset--color--secondary,#f0f0f0))));box-shadow:none;outline:none}.wp-block-activitypub-followers .followers-container .follower-link:focus .external-link-icon,.wp-block-activitypub-followers .followers-container .follower-link:hover .external-link-icon{opacity:1}.wp-block-activitypub-followers .followers-container .follower-avatar{border:1px solid #e0e0e0;border-radius:50%;height:48px;margin-left:16px;-o-object-fit:cover;object-fit:cover;width:48px}.wp-block-activitypub-followers .followers-container .follower-info{display:flex;flex:1;flex-direction:column;line-height:1.3;overflow:hidden}.wp-block-activitypub-followers .followers-container .follower-name{font-weight:600;margin-bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-block-activitypub-followers .followers-container .follower-username{color:var(--wp--preset--color--very-dark-gray,#666);font-size:90%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-block-activitypub-followers .followers-container .external-link-icon{height:16px;margin-right:8px;transition:opacity .2s ease;width:16px}.wp-block-activitypub-followers .followers-container .followers-pagination{align-items:center;border-top-style:solid;border-top-width:1px;display:grid;grid-template-columns:1fr auto 1fr;margin-top:16px;padding-top:8px!important}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-info{color:var(--wp--preset--color--very-dark-gray,#666);font-size:90%;justify-self:center}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next,.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous{border:none;box-shadow:none;cursor:pointer;display:inline-block;font-size:90%;min-width:60px;padding:8px 0}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next[hidden],.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous[hidden]{display:none!important}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next[aria-disabled=true],.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous[aria-disabled=true]{cursor:not-allowed;opacity:.3;pointer-events:none;text-decoration:none}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous{justify-self:start;padding-left:8px}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous:before{content:"←"}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next{justify-self:end;padding-right:8px;text-align:left}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next:after{content:"→"}@media(max-width:480px){.wp-block-activitypub-followers .followers-container .followers-pagination{grid-template-columns:1fr 1fr}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-info{display:none}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next,.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous{align-items:center;font-size:100%;min-height:44px}}.wp-block-activitypub-followers .followers-container .followers-loading{align-items:center;background-color:hsla(0,0%,100%,.5);border-radius:8px;bottom:0;display:flex;justify-content:center;right:0;position:absolute;left:0;top:0}.wp-block-activitypub-followers .followers-container .followers-loading[aria-hidden=true]{display:none}.wp-block-activitypub-followers .followers-container .loading-spinner{animation:spin 1s ease-in-out infinite;border:3px solid color-mix(in srgb,var(--wp--preset--color--primary,#0073aa) 30%,transparent);border-radius:50%;border-top-color:var(--wp--preset--color--primary,#0073aa);height:40px;width:40px}@keyframes spin{to{transform:rotate(-1turn)}}.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block){background-color:var(--wp--preset--color--white,#fff);border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,.1);box-sizing:border-box;padding:24px}@media(max-width:480px){.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block){margin-right:-12px;margin-left:-12px}}.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .wp-block-heading{border-bottom:none;margin-bottom:16px;text-align:center}.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .follower-link{border:1px solid #e0e0e0;margin-bottom:8px}.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .follower-link:focus,.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .follower-link:hover{border-color:#c7c7c7}.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .followers-pagination{border:none;padding-bottom:0!important}.wp-block-activitypub-followers.is-style-compact .follower-link{padding:4px}.wp-block-activitypub-followers.is-style-compact .follower-avatar{height:36px;margin-left:8px;width:36px}.wp-block-activitypub-followers.is-style-compact .follower-name{font-size:90%}.wp-block-activitypub-followers.is-style-compact .follower-username{font-size:80%}.wp-block-activitypub-followers.is-style-compact .followers-pagination{margin-top:8px;padding-top:4px}.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-next,.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-previous{font-size:80%;padding-bottom:4px;padding-top:4px}@media(max-width:480px){.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-next,.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-previous{font-size:100%}}.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-info{font-size:80%}
diff --git a/build/followers/style-index.css b/build/followers/style-index.css
index 830a0ce622..f1afc8a644 100644
--- a/build/followers/style-index.css
+++ b/build/followers/style-index.css
@@ -1,243 +1 @@
-/*!*************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/followers/style.scss ***!
- \*************************************************************************************************************************************************************************************************************************************************/
-@charset "UTF-8";
-button {
- border: none;
-}
-.wp-block-activitypub-followers {
- margin: 16px 0;
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
-}
-.wp-block-activitypub-followers .wp-block-heading {
- margin: 0 0 16px;
- padding: 0 0 8px;
- border-bottom: 1px solid;
-}
-.wp-block-activitypub-followers .wp-block-heading,
-.wp-block-activitypub-followers .followers-pagination {
- border-color: var(--wp--preset--color--foreground, var(--wp--preset--color--primary, #e0e0e0));
-}
-.wp-block-activitypub-followers .followers-container {
- position: relative;
-}
-.wp-block-activitypub-followers .followers-container .followers-list {
- margin: 0;
- padding: 0;
- list-style: none;
-}
-.wp-block-activitypub-followers .followers-container .follower-item {
- margin: 0 0 8px;
-}
-.wp-block-activitypub-followers .followers-container .follower-item:last-child {
- margin-bottom: 0;
-}
-.wp-block-activitypub-followers .followers-container .follower-link {
- display: flex;
- align-items: center;
- padding: 8px;
- border: none;
- border-radius: 8px;
- box-shadow: none;
- transition: background-color 0.2s ease;
-}
-.wp-block-activitypub-followers .followers-container .follower-link:hover, .wp-block-activitypub-followers .followers-container .follower-link:focus {
- background-color: var(--wp--preset--color--subtle-background, var(--wp--preset--color--accent-2, var(--wp--preset--color--tertiary, var(--wp--preset--color--secondary, #f0f0f0))));
- box-shadow: none;
- outline: none;
-}
-.wp-block-activitypub-followers .followers-container .follower-link:hover .external-link-icon, .wp-block-activitypub-followers .followers-container .follower-link:focus .external-link-icon {
- opacity: 1;
-}
-.wp-block-activitypub-followers .followers-container .follower-avatar {
- width: 48px;
- height: 48px;
- border-radius: 50%;
- -o-object-fit: cover;
- object-fit: cover;
- margin-right: 16px;
- border: 1px solid #e0e0e0;
-}
-.wp-block-activitypub-followers .followers-container .follower-info {
- flex: 1;
- display: flex;
- flex-direction: column;
- overflow: hidden;
- line-height: 1.3;
-}
-.wp-block-activitypub-followers .followers-container .follower-name {
- font-weight: 600;
- margin-bottom: 2px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-.wp-block-activitypub-followers .followers-container .follower-username {
- color: var(--wp--preset--color--very-dark-gray, #666);
- font-size: 90%;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-.wp-block-activitypub-followers .followers-container .external-link-icon {
- width: 16px;
- height: 16px;
- margin-left: 8px;
- transition: opacity 0.2s ease;
-}
-.wp-block-activitypub-followers .followers-container .followers-pagination {
- display: grid;
- grid-template-columns: 1fr auto 1fr;
- align-items: center;
- margin-top: 16px;
- padding-top: 8px !important;
- border-top-style: solid;
- border-top-width: 1px;
-}
-.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-info {
- color: var(--wp--preset--color--very-dark-gray, #666);
- font-size: 90%;
- justify-self: center;
-}
-.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous,
-.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next {
- border: none;
- box-shadow: none;
- cursor: pointer;
- font-size: 90%;
- display: inline-block;
- padding: 8px 0;
- min-width: 60px;
-}
-.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous[hidden],
-.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next[hidden] {
- display: none !important;
-}
-.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous[aria-disabled=true],
-.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next[aria-disabled=true] {
- opacity: 0.3;
- cursor: not-allowed;
- pointer-events: none;
- text-decoration: none;
-}
-.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous {
- justify-self: start;
- padding-right: 8px;
-}
-.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous::before {
- content: "←";
-}
-.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next {
- justify-self: end;
- padding-left: 8px;
- text-align: right;
-}
-.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next::after {
- content: "→";
-}
-@media (max-width: 480px) {
- .wp-block-activitypub-followers .followers-container .followers-pagination {
- grid-template-columns: 1fr 1fr;
- }
- .wp-block-activitypub-followers .followers-container .followers-pagination .pagination-info {
- display: none;
- }
- .wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous,
- .wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next {
- min-height: 44px;
- font-size: 100%;
- align-items: center;
- }
-}
-.wp-block-activitypub-followers .followers-container .followers-loading {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background-color: rgba(255, 255, 255, 0.5);
- border-radius: 8px;
- display: flex;
- align-items: center;
- justify-content: center;
-}
-.wp-block-activitypub-followers .followers-container .followers-loading[aria-hidden=true] {
- display: none;
-}
-.wp-block-activitypub-followers .followers-container .loading-spinner {
- width: 40px;
- height: 40px;
- border: 3px solid color-mix(in srgb, var(--wp--preset--color--primary, #0073aa) 30%, transparent);
- border-radius: 50%;
- border-top-color: var(--wp--preset--color--primary, #0073aa);
- animation: spin 1s ease-in-out infinite;
-}
-@keyframes spin {
- to {
- transform: rotate(360deg);
- }
-}
-.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) {
- background-color: var(--wp--preset--color--white, #fff);
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
- box-sizing: border-box;
- padding: 24px;
-}
-@media (max-width: 480px) {
- .wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) {
- margin-left: -12px;
- margin-right: -12px;
- }
-}
-.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .wp-block-heading {
- text-align: center;
- border-bottom: none;
- margin-bottom: 16px;
-}
-.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .follower-link {
- border: 1px solid #e0e0e0;
- margin-bottom: 8px;
-}
-.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .follower-link:hover, .wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .follower-link:focus {
- border-color: rgb(198.5, 198.5, 198.5);
-}
-.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .followers-pagination {
- border: none;
- padding-bottom: 0 !important;
-}
-.wp-block-activitypub-followers.is-style-compact .follower-link {
- padding: 4px;
-}
-.wp-block-activitypub-followers.is-style-compact .follower-avatar {
- width: 36px;
- height: 36px;
- margin-right: 8px;
-}
-.wp-block-activitypub-followers.is-style-compact .follower-name {
- font-size: 90%;
-}
-.wp-block-activitypub-followers.is-style-compact .follower-username {
- font-size: 80%;
-}
-.wp-block-activitypub-followers.is-style-compact .followers-pagination {
- margin-top: 8px;
- padding-top: 4px;
-}
-.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-previous,
-.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-next {
- padding-top: 4px;
- padding-bottom: 4px;
- font-size: 80%;
-}
-@media (max-width: 480px) {
- .wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-previous,
- .wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-next {
- font-size: 100%;
- }
-}
-.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-info {
- font-size: 80%;
-}
-
-/*# sourceMappingURL=style-index.css.map*/
\ No newline at end of file
+button{border:none}.wp-block-activitypub-followers{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;margin:16px 0}.wp-block-activitypub-followers .wp-block-heading{border-bottom:1px solid;margin:0 0 16px;padding:0 0 8px}.wp-block-activitypub-followers .followers-pagination,.wp-block-activitypub-followers .wp-block-heading{border-color:var(--wp--preset--color--foreground,var(--wp--preset--color--primary,#e0e0e0))}.wp-block-activitypub-followers .followers-container{position:relative}.wp-block-activitypub-followers .followers-container .followers-list{list-style:none;margin:0;padding:0}.wp-block-activitypub-followers .followers-container .follower-item{margin:0 0 8px}.wp-block-activitypub-followers .followers-container .follower-item:last-child{margin-bottom:0}.wp-block-activitypub-followers .followers-container .follower-link{align-items:center;border:none;border-radius:8px;box-shadow:none;display:flex;padding:8px;transition:background-color .2s ease}.wp-block-activitypub-followers .followers-container .follower-link:focus,.wp-block-activitypub-followers .followers-container .follower-link:hover{background-color:var(--wp--preset--color--subtle-background,var(--wp--preset--color--accent-2,var(--wp--preset--color--tertiary,var(--wp--preset--color--secondary,#f0f0f0))));box-shadow:none;outline:none}.wp-block-activitypub-followers .followers-container .follower-link:focus .external-link-icon,.wp-block-activitypub-followers .followers-container .follower-link:hover .external-link-icon{opacity:1}.wp-block-activitypub-followers .followers-container .follower-avatar{border:1px solid #e0e0e0;border-radius:50%;height:48px;margin-right:16px;-o-object-fit:cover;object-fit:cover;width:48px}.wp-block-activitypub-followers .followers-container .follower-info{display:flex;flex:1;flex-direction:column;line-height:1.3;overflow:hidden}.wp-block-activitypub-followers .followers-container .follower-name{font-weight:600;margin-bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-block-activitypub-followers .followers-container .follower-username{color:var(--wp--preset--color--very-dark-gray,#666);font-size:90%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-block-activitypub-followers .followers-container .external-link-icon{height:16px;margin-left:8px;transition:opacity .2s ease;width:16px}.wp-block-activitypub-followers .followers-container .followers-pagination{align-items:center;border-top-style:solid;border-top-width:1px;display:grid;grid-template-columns:1fr auto 1fr;margin-top:16px;padding-top:8px!important}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-info{color:var(--wp--preset--color--very-dark-gray,#666);font-size:90%;justify-self:center}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next,.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous{border:none;box-shadow:none;cursor:pointer;display:inline-block;font-size:90%;min-width:60px;padding:8px 0}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next[hidden],.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous[hidden]{display:none!important}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next[aria-disabled=true],.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous[aria-disabled=true]{cursor:not-allowed;opacity:.3;pointer-events:none;text-decoration:none}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous{justify-self:start;padding-right:8px}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous:before{content:"←"}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next{justify-self:end;padding-left:8px;text-align:right}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next:after{content:"→"}@media(max-width:480px){.wp-block-activitypub-followers .followers-container .followers-pagination{grid-template-columns:1fr 1fr}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-info{display:none}.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-next,.wp-block-activitypub-followers .followers-container .followers-pagination .pagination-previous{align-items:center;font-size:100%;min-height:44px}}.wp-block-activitypub-followers .followers-container .followers-loading{align-items:center;background-color:hsla(0,0%,100%,.5);border-radius:8px;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}.wp-block-activitypub-followers .followers-container .followers-loading[aria-hidden=true]{display:none}.wp-block-activitypub-followers .followers-container .loading-spinner{animation:spin 1s ease-in-out infinite;border:3px solid color-mix(in srgb,var(--wp--preset--color--primary,#0073aa) 30%,transparent);border-radius:50%;border-top-color:var(--wp--preset--color--primary,#0073aa);height:40px;width:40px}@keyframes spin{to{transform:rotate(1turn)}}.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block){background-color:var(--wp--preset--color--white,#fff);border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,.1);box-sizing:border-box;padding:24px}@media(max-width:480px){.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block){margin-left:-12px;margin-right:-12px}}.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .wp-block-heading{border-bottom:none;margin-bottom:16px;text-align:center}.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .follower-link{border:1px solid #e0e0e0;margin-bottom:8px}.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .follower-link:focus,.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .follower-link:hover{border-color:#c7c7c7}.wp-block-activitypub-followers.is-style-card:not(.block-editor-block-list__block) .followers-pagination{border:none;padding-bottom:0!important}.wp-block-activitypub-followers.is-style-compact .follower-link{padding:4px}.wp-block-activitypub-followers.is-style-compact .follower-avatar{height:36px;margin-right:8px;width:36px}.wp-block-activitypub-followers.is-style-compact .follower-name{font-size:90%}.wp-block-activitypub-followers.is-style-compact .follower-username{font-size:80%}.wp-block-activitypub-followers.is-style-compact .followers-pagination{margin-top:8px;padding-top:4px}.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-next,.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-previous{font-size:80%;padding-bottom:4px;padding-top:4px}@media(max-width:480px){.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-next,.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-previous{font-size:100%}}.wp-block-activitypub-followers.is-style-compact .followers-pagination .pagination-info{font-size:80%}
diff --git a/build/followers/view.asset.php b/build/followers/view.asset.php
index 753fa2c862..211a93056d 100644
--- a/build/followers/view.asset.php
+++ b/build/followers/view.asset.php
@@ -1 +1 @@
- array('@wordpress/interactivity'), 'version' => '74b71e913f6a93cbcc9c', 'type' => 'module');
+ array('@wordpress/interactivity'), 'version' => 'f0b102d4075c98757bf3', 'type' => 'module');
diff --git a/build/followers/view.js b/build/followers/view.js
index 3b4c77dd64..76905b1b8f 100644
--- a/build/followers/view.js
+++ b/build/followers/view.js
@@ -1,234 +1 @@
-import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity";
-/******/ var __webpack_modules__ = ({
-
-/***/ "@wordpress/interactivity":
-/*!*******************************************!*\
- !*** external "@wordpress/interactivity" ***!
- \*******************************************/
-/***/ ((module) => {
-
-module.exports = __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__;
-
-/***/ })
-
-/******/ });
-/************************************************************************/
-/******/ // The module cache
-/******/ var __webpack_module_cache__ = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/ // Check if module is in cache
-/******/ var cachedModule = __webpack_module_cache__[moduleId];
-/******/ if (cachedModule !== undefined) {
-/******/ return cachedModule.exports;
-/******/ }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = __webpack_module_cache__[moduleId] = {
-/******/ // no module.id needed
-/******/ // no module.loaded needed
-/******/ exports: {}
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/************************************************************************/
-/******/ /* webpack/runtime/make namespace object */
-/******/ (() => {
-/******/ // define __esModule on exports
-/******/ __webpack_require__.r = (exports) => {
-/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
-/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
-/******/ }
-/******/ Object.defineProperty(exports, '__esModule', { value: true });
-/******/ };
-/******/ })();
-/******/
-/************************************************************************/
-var __webpack_exports__ = {};
-// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
-(() => {
-/*!*******************************!*\
- !*** ./src/followers/view.js ***!
- \*******************************/
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/interactivity */ "@wordpress/interactivity");
-
-
-/**
- * @var {Object} window.wp WordPress global object
- * @var {Function} url.addQueryArgs Function to add query arguments to a URL.
- */
-const {
- apiFetch,
- url
-} = window.wp;
-
-/**
- * @typedef {Object} config
- * @property {String} defaultAvatarUrl Default avatar URL.
- * @property {String} namespace ActivityPub REST Namespace.
- */
-
-/**
- * @typedef {Object} context
- * @property {Array} followers The list of followers.
- * @property {boolean} isLoading Whether the followers are currently being fetched.
- * @property {String} order The order in which to fetch followers (e.g., 'asc', 'desc').
- * @property {Number} page The current page of followers.
- * @property {Number} pages The total number of pages of followers.
- * @property {Number} per_page The number of followers per page.
- * @property {Number} total The total number of followers.
- * @property {String} userId The user ID for which to fetch followers.
- */
-
-const {
- actions
-} = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.store)('activitypub/followers', {
- /**
- * @typedef {Object} state
- * @property {Function} paginationText Get the pagination text.
- * @property {Function} disablePreviousLink Whether the previous link should be disabled.
- * @property {Function} disableNextLink Whether the next link should be disabled.
- */
- state: {
- /**
- * Get the pagination text.
- *
- * @returns {string}
- */
- get paginationText() {
- const {
- page,
- pages
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- return `${page} / ${pages}`;
- },
- /**
- * Check if the previous link should be disabled.
- *
- * @returns {boolean}
- */
- get disablePreviousLink() {
- const {
- page
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- return page <= 1;
- },
- /**
- * Check if the next link should be disabled.
- *
- * @returns {boolean}
- */
- get disableNextLink() {
- const {
- page,
- pages
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- return page >= pages;
- }
- },
- actions: {
- /**
- * Fetch followers for the current page.
- *
- * @return {Promise} Promise that resolves when followers are fetched.
- */
- async fetchFollowers() {
- const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- const {
- userId,
- page,
- per_page,
- order
- } = context;
-
- // Set loading state.
- context.isLoading = true;
- try {
- // Build the API path and parameters
- const {
- namespace
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getConfig)();
- const path = url.addQueryArgs(`/${namespace}/actors/${userId}/followers`, {
- context: 'full',
- per_page,
- order,
- page
- });
-
- // Use apiFetch to get the Followers data.
- const {
- orderedItems,
- totalItems
- } = await apiFetch({
- path
- });
-
- // Update the context with the new followers.
- context.followers = orderedItems.map(follower => ({
- handle: '@' + follower.preferredUsername,
- icon: follower.icon,
- name: follower.name || follower.preferredUsername,
- url: follower.url || follower.id
- }));
- context.total = totalItems;
- context.pages = Math.ceil(totalItems / per_page);
- } catch (error) {
- console.error('Error fetching followers:', error);
- } finally {
- // Clear loading state.
- context.isLoading = false;
- }
- },
- /**
- * Navigate to the previous page.
- *
- * @param {Event} event - The click event.
- */
- previousPage(event) {
- event.preventDefault();
- const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- if (context.page > 1) {
- context.page--;
- actions.fetchFollowers().catch(error => {
- console.error('Error fetching followers:', error);
- });
- }
- },
- /**
- * Navigate to the next page.
- *
- * @param {Event} event - The click event.
- */
- nextPage(event) {
- event.preventDefault();
- const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- if (context.page < context.pages) {
- context.page++;
- actions.fetchFollowers().catch(error => {
- console.error('Error fetching followers:', error);
- });
- }
- }
- },
- callbacks: {
- /**
- * Sets the default avatar when the avatar image fails to load.
- *
- * @param {Object} event The error event.
- */
- setDefaultAvatar(event) {
- event.target.src = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getConfig)().defaultAvatarUrl;
- }
- }
-});
-})();
-
-
-//# sourceMappingURL=view.js.map
\ No newline at end of file
+import{getConfig as e,getContext as r,store as t}from"@wordpress/interactivity";const{apiFetch:a,url:o}=window.wp,{actions:s}=t("activitypub/followers",{state:{get paginationText(){const{page:e,pages:t}=r();return`${e} / ${t}`},get disablePreviousLink(){const{page:e}=r();return e<=1},get disableNextLink(){const{page:e,pages:t}=r();return e>=t}},actions:{async fetchFollowers(){const t=r(),{userId:s,page:n,per_page:l,order:c}=t;t.isLoading=!0;try{const{namespace:r}=e(),i=o.addQueryArgs(`/${r}/actors/${s}/followers`,{context:"full",per_page:l,order:c,page:n}),{orderedItems:g,totalItems:p}=await a({path:i});t.followers=g.map(e=>({handle:"@"+e.preferredUsername,icon:e.icon,name:e.name||e.preferredUsername,url:e.url||e.id})),t.total=p,t.pages=Math.ceil(p/l)}catch(e){console.error("Error fetching followers:",e)}finally{t.isLoading=!1}},previousPage(e){e.preventDefault();const t=r();t.page>1&&(t.page--,s.fetchFollowers().catch(e=>{console.error("Error fetching followers:",e)}))},nextPage(e){e.preventDefault();const t=r();t.page{console.error("Error fetching followers:",e)}))}},callbacks:{setDefaultAvatar(r){r.target.src=e().defaultAvatarUrl}}});
\ No newline at end of file
diff --git a/build/reactions/index.asset.php b/build/reactions/index.asset.php
index 8a83a43445..9d799d3b55 100644
--- a/build/reactions/index.asset.php
+++ b/build/reactions/index.asset.php
@@ -1 +1 @@
- array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'b70b416ac23b593d6869');
+ array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '19f79df5e0c04bf68777');
diff --git a/build/reactions/index.js b/build/reactions/index.js
index e932bb8965..7b968fa923 100644
--- a/build/reactions/index.js
+++ b/build/reactions/index.js
@@ -1,758 +1,3 @@
-/******/ (() => { // webpackBootstrap
-/******/ "use strict";
-/******/ var __webpack_modules__ = ({
-
-/***/ "./src/reactions/block.json":
-/*!**********************************!*\
- !*** ./src/reactions/block.json ***!
- \**********************************/
-/***/ ((module) => {
-
-module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","name":"activitypub/reactions","apiVersion":3,"version":"3.0.3","title":"Fediverse Reactions","category":"widgets","icon":"heart","description":"Display Fediverse likes and reposts","supports":{"align":["wide","full"],"color":{"gradients":true},"__experimentalBorder":{"radius":true,"width":true,"color":true,"style":true},"html":false,"interactivity":true,"layout":{"default":{"type":"constrained","orientation":"vertical","justifyContent":"center"},"allowEditing":false},"shadow":true,"typography":{"fontSize":true,"__experimentalDefaultControls":{"fontSize":true}}},"blockHooks":{"core/post-content":"after"},"textdomain":"activitypub","editorScript":"file:./index.js","style":"file:./style-index.css","viewScriptModule":"file:./view.js","viewScript":"wp-api-fetch","render":"file:./render.php"}');
-
-/***/ }),
-
-/***/ "./src/reactions/deprecation.js":
-/*!**************************************!*\
- !*** ./src/reactions/deprecation.js ***!
- \**************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
-/* harmony export */ });
-/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
-/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
-
-const v1 = {
- attributes: {
- title: {
- type: 'string',
- default: 'Fediverse reactions'
- }
- },
- supports: {
- html: false,
- color: {
- gradients: true,
- link: true,
- __experimentalDefaultControls: {
- background: true,
- text: true,
- link: true
- }
- },
- __experimentalBorder: {
- radius: true,
- width: true,
- color: true,
- style: true
- },
- typography: {
- fontSize: true,
- __experimentalDefaultControls: {
- fontSize: true
- }
- }
- },
- /**
- * Checks if the block is eligible for migration.
- *
- * @param {Object} attributes The block attributes.
- *
- * @return {boolean} Whether the block is eligible for migration.
- */
- isEligible({
- title
- }) {
- return !!title;
- },
- /**
- * Migrates the block to use a core heading block instead of the custom heading attribute.
- *
- * @param {Object} attributes The attributes for the block.
- *
- * @return {Array} The new attributes and inner blocks.
- */
- migrate({
- title,
- ...newAttributes
- }) {
- const headingBlock = (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.createBlock)('core/heading', {
- content: title,
- level: 6
- });
- return [newAttributes, [headingBlock]];
- }
-};
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([v1]);
-
-/***/ }),
-
-/***/ "./src/reactions/edit.js":
-/*!*******************************!*\
- !*** ./src/reactions/edit.js ***!
- \*******************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Edit)
-/* harmony export */ });
-/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
-/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _reactions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./reactions */ "./src/reactions/reactions.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
-
-
-
-
-
-// Generate reaction items with SVG avatars.
-
-const generateReactionItems = (count, prefix, startChar, colors) => Array.from({
- length: count
-}, (_, i) => ({
- name: `${prefix} ${i + 1}`,
- url: '#',
- avatar: `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='32' cy='32' r='32' fill='%23${colors[i % colors.length]}'/%3E%3Ctext x='32' y='38' font-family='sans-serif' font-size='24' fill='white' text-anchor='middle'%3E${String.fromCharCode(startChar + i)}%3C/text%3E%3C/svg%3E`
-}));
-
-// Colors for avatars.
-const COLORS = ['FF6B6B', '4ECDC4', '45B7D1', '96CEB4', 'D4A5A5', '9B59B6', '3498DB', 'E67E22'];
-
-// Simple predefined dummy Reactions data.
-const DUMMY_REACTIONS = {
- likes: {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %d: Number of likes */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x)('%d likes', 'number of likes', 'activitypub'), 9),
- items: generateReactionItems(9, 'User', 65, COLORS) // 65 is ASCII for 'A'
- },
- reposts: {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %d: Number of reposts */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x)('%d reposts', 'number of reposts', 'activitypub'), 6),
- items: generateReactionItems(6, 'Reposter', 82, COLORS) // 82 is ASCII for 'R'
- }
-};
-
-/**
- * Edit component for the Reactions block.
- *
- * @param {Object} props Block props.
- * @param props.__unstableLayoutClassNames Layout class names.
- * @return {JSX.Element} Component to render.
- */
-function Edit({
- __unstableLayoutClassNames
-}) {
- const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps)({
- className: __unstableLayoutClassNames
- });
- const {
- getCurrentPostId
- } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.select)('core/editor');
-
- // Template for InnerBlocks - allows only a heading block.
- const TEMPLATE = [['core/heading', {
- level: 6,
- placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Fediverse Reactions', 'activitypub'),
- content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Fediverse Reactions', 'activitypub')
- }]];
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
- ...blockProps,
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.InnerBlocks, {
- template: TEMPLATE,
- allowedBlocks: ['core/heading'],
- templateLock: 'all',
- renderAppender: false
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_reactions__WEBPACK_IMPORTED_MODULE_3__.Reactions, {
- postId: getCurrentPostId(),
- fallbackReactions: DUMMY_REACTIONS
- })]
- });
-}
-
-/***/ }),
-
-/***/ "./src/reactions/index.js":
-/*!********************************!*\
- !*** ./src/reactions/index.js ***!
- \********************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
-/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _deprecation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./deprecation */ "./src/reactions/deprecation.js");
-/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/reactions/edit.js");
-/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block.json */ "./src/reactions/block.json");
-/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./save */ "./src/reactions/save.js");
-/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./style.scss */ "./src/reactions/style.scss");
-
-
-
-
-
-
-(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_3__, {
- deprecated: _deprecation__WEBPACK_IMPORTED_MODULE_1__["default"],
- edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"],
- save: _save__WEBPACK_IMPORTED_MODULE_4__["default"]
-});
-
-/***/ }),
-
-/***/ "./src/reactions/reactions.js":
-/*!************************************!*\
- !*** ./src/reactions/reactions.js ***!
- \************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ FacepileRow: () => (/* binding */ FacepileRow),
-/* harmony export */ Reactions: () => (/* binding */ Reactions)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
-/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _shared_use_options__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../shared/use-options */ "./src/shared/use-options.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
-
-
-
-
-
-/**
- * @typedef {Object} JSX
- * @typedef {import('react').ReactElement} JSX.Element
- */
-
-/**
- * A component that renders a row of user avatars for a given set of reactions.
- *
- * @param {Object} props Component props.
- * @param {Array} props.reactions Array of reaction objects.
- * @return {JSX.Element} The rendered component.
- */
-
-const FacepileRow = ({
- reactions
-}) => {
- const {
- defaultAvatarUrl
- } = (0,_shared_use_options__WEBPACK_IMPORTED_MODULE_3__.useOptions)();
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("ul", {
- className: "reaction-avatars",
- children: reactions.map((reaction, index) => {
- const classes = ['reaction-avatar'].filter(Boolean).join(' ');
- const avatar = reaction.avatar || defaultAvatarUrl;
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("li", {
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", {
- href: reaction.url,
- target: "_blank",
- rel: "noopener noreferrer",
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("img", {
- src: avatar,
- alt: reaction.name,
- className: classes,
- width: "32",
- height: "32",
- onError: e => {
- e.target.src = defaultAvatarUrl;
- }
- })
- })
- }, index);
- })
- });
-};
-
-/**
- * A component that renders a dropdown list of reactions.
- *
- * @param {Object} props Component props.
- * @param {Array} props.reactions Array of reaction objects.
- * @return {JSX.Element} The rendered component.
- */
-const ReactionList = ({
- reactions
-}) => {
- const {
- defaultAvatarUrl
- } = (0,_shared_use_options__WEBPACK_IMPORTED_MODULE_3__.useOptions)();
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("ul", {
- className: "reactions-list",
- children: reactions.map((reaction, index) => {
- const avatar = reaction.avatar || defaultAvatarUrl;
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("li", {
- className: "reaction-item",
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("a", {
- href: reaction.url,
- className: "reaction-item",
- target: "_blank",
- rel: "noopener noreferrer",
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("img", {
- src: avatar,
- alt: reaction.name,
- width: "32",
- height: "32",
- onError: e => {
- e.target.src = defaultAvatarUrl;
- }
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
- className: "reaction-name",
- children: reaction.name
- })]
- })
- }, index);
- })
- });
-};
-
-/**
- * A component that renders a reaction group with facepile and dropdown.
- *
- * @param {Object} props Component props.
- * @param {Array} props.items Array of reaction objects.
- * @param {string} props.label Label for the reaction group.
- * @return {JSX.Element} The rendered component.
- */
-const ReactionGroup = ({
- items,
- label
-}) => {
- const [isOpen, setIsOpen] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
- const [buttonRef, setButtonRef] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
- const containerRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
- const visibleItems = items.slice(0, 20);
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
- className: "reaction-group",
- ref: containerRef,
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(FacepileRow, {
- reactions: visibleItems
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
- ref: setButtonRef,
- className: "reaction-label is-link",
- onClick: () => setIsOpen(!isOpen),
- "aria-expanded": isOpen,
- children: label
- }), isOpen && buttonRef && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Popover, {
- anchor: buttonRef,
- onClose: () => setIsOpen(false),
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ReactionList, {
- reactions: items
- })
- })]
- });
-};
-
-/**
- * The Reactions component.
- *
- * @param {Object} props Component props.
- * @param {?number} props.postId The Post ID.
- * @param {?Object} props.reactions Optional reactions data.
- * @param {?Object} props.fallbackReactions Optional fallback reactions data to use if no real reactions are found.
- * @return {?JSX.Element} The rendered component.
- */
-function Reactions({
- postId = null,
- reactions: providedReactions = null,
- fallbackReactions = null
-}) {
- const {
- namespace
- } = (0,_shared_use_options__WEBPACK_IMPORTED_MODULE_3__.useOptions)();
- const [reactions, setReactions] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(providedReactions);
- const [loading, setLoading] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(!providedReactions);
- const onError = () => {
- // On error, use fallback reactions if provided
- if (fallbackReactions) {
- setReactions(fallbackReactions);
- }
- setLoading(false);
- };
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
- if (providedReactions) {
- setReactions(providedReactions);
- setLoading(false);
- return;
- }
-
- // if no postId is provided or it's not a number (Site Editor), return early.
- if (!postId || typeof postId !== 'number') {
- onError();
- return;
- }
- setLoading(true);
- _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default()({
- path: `/${namespace}/posts/${postId}/reactions`
- }).then(response => {
- // Check if the response has any actual reactions
- const hasReactions = Object.values(response).some(group => group.items?.length > 0);
-
- // If there are no real reactions and fallback is provided, use the fallback.
- if (!hasReactions && fallbackReactions) {
- setReactions(fallbackReactions);
- } else {
- setReactions(response);
- }
- setLoading(false);
- }).catch(onError);
- }, [postId, providedReactions, fallbackReactions, namespace]);
- if (loading) {
- return null;
- }
-
- // Return null if there are no reactions
- if (!reactions || !Object.values(reactions).some(group => group.items?.length > 0)) {
- return null;
- }
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, {
- children: Object.entries(reactions).map(([key, group]) => {
- if (!group.items?.length) {
- return null;
- }
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ReactionGroup, {
- items: group.items,
- label: group.label
- }, key);
- })
- });
-}
-
-// Export for testing
-
-
-/***/ }),
-
-/***/ "./src/reactions/save.js":
-/*!*******************************!*\
- !*** ./src/reactions/save.js ***!
- \*******************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ save)
-/* harmony export */ });
-/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
-/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-
-
-/**
- * @typedef {Object} InnerBlocks
- * @property {function(): JSX.Element} Content - The InnerBlocks.Content component.
- */
-
-/**
- * Save function for the reactions block.
- *
- * With server-side rendering via render.php, we only need to output
- * the InnerBlocks content and a placeholder div.
- *
- * @return {JSX.Element} React element to save.
- */
-
-function save() {
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
- ..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save(),
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.InnerBlocks.Content, {})
- });
-}
-
-/***/ }),
-
-/***/ "./src/reactions/style.scss":
-/*!**********************************!*\
- !*** ./src/reactions/style.scss ***!
- \**********************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-// extracted by mini-css-extract-plugin
-
-
-/***/ }),
-
-/***/ "./src/shared/use-options.js":
-/*!***********************************!*\
- !*** ./src/shared/use-options.js ***!
- \***********************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ useOptions: () => (/* binding */ useOptions)
-/* harmony export */ });
-/**
- * React hook to return the ActivityPub options object from the global window.
- *
- * @returns {Object} The options object.
- */
-function useOptions() {
- return window._activityPubOptions || {};
-}
-
-/***/ }),
-
-/***/ "@wordpress/api-fetch":
-/*!**********************************!*\
- !*** external ["wp","apiFetch"] ***!
- \**********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["apiFetch"];
-
-/***/ }),
-
-/***/ "@wordpress/block-editor":
-/*!*************************************!*\
- !*** external ["wp","blockEditor"] ***!
- \*************************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["blockEditor"];
-
-/***/ }),
-
-/***/ "@wordpress/blocks":
-/*!********************************!*\
- !*** external ["wp","blocks"] ***!
- \********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["blocks"];
-
-/***/ }),
-
-/***/ "@wordpress/components":
-/*!************************************!*\
- !*** external ["wp","components"] ***!
- \************************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["components"];
-
-/***/ }),
-
-/***/ "@wordpress/data":
-/*!******************************!*\
- !*** external ["wp","data"] ***!
- \******************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["data"];
-
-/***/ }),
-
-/***/ "@wordpress/element":
-/*!*********************************!*\
- !*** external ["wp","element"] ***!
- \*********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["element"];
-
-/***/ }),
-
-/***/ "@wordpress/i18n":
-/*!******************************!*\
- !*** external ["wp","i18n"] ***!
- \******************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["i18n"];
-
-/***/ }),
-
-/***/ "react/jsx-runtime":
-/*!**********************************!*\
- !*** external "ReactJSXRuntime" ***!
- \**********************************/
-/***/ ((module) => {
-
-module.exports = window["ReactJSXRuntime"];
-
-/***/ })
-
-/******/ });
-/************************************************************************/
-/******/ // The module cache
-/******/ var __webpack_module_cache__ = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/ // Check if module is in cache
-/******/ var cachedModule = __webpack_module_cache__[moduleId];
-/******/ if (cachedModule !== undefined) {
-/******/ return cachedModule.exports;
-/******/ }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = __webpack_module_cache__[moduleId] = {
-/******/ // no module.id needed
-/******/ // no module.loaded needed
-/******/ exports: {}
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/******/ // expose the modules object (__webpack_modules__)
-/******/ __webpack_require__.m = __webpack_modules__;
-/******/
-/************************************************************************/
-/******/ /* webpack/runtime/chunk loaded */
-/******/ (() => {
-/******/ var deferred = [];
-/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
-/******/ if(chunkIds) {
-/******/ priority = priority || 0;
-/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
-/******/ deferred[i] = [chunkIds, fn, priority];
-/******/ return;
-/******/ }
-/******/ var notFulfilled = Infinity;
-/******/ for (var i = 0; i < deferred.length; i++) {
-/******/ var [chunkIds, fn, priority] = deferred[i];
-/******/ var fulfilled = true;
-/******/ for (var j = 0; j < chunkIds.length; j++) {
-/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
-/******/ chunkIds.splice(j--, 1);
-/******/ } else {
-/******/ fulfilled = false;
-/******/ if(priority < notFulfilled) notFulfilled = priority;
-/******/ }
-/******/ }
-/******/ if(fulfilled) {
-/******/ deferred.splice(i--, 1)
-/******/ var r = fn();
-/******/ if (r !== undefined) result = r;
-/******/ }
-/******/ }
-/******/ return result;
-/******/ };
-/******/ })();
-/******/
-/******/ /* webpack/runtime/compat get default export */
-/******/ (() => {
-/******/ // getDefaultExport function for compatibility with non-harmony modules
-/******/ __webpack_require__.n = (module) => {
-/******/ var getter = module && module.__esModule ?
-/******/ () => (module['default']) :
-/******/ () => (module);
-/******/ __webpack_require__.d(getter, { a: getter });
-/******/ return getter;
-/******/ };
-/******/ })();
-/******/
-/******/ /* webpack/runtime/define property getters */
-/******/ (() => {
-/******/ // define getter functions for harmony exports
-/******/ __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 */
-/******/ (() => {
-/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
-/******/ })();
-/******/
-/******/ /* webpack/runtime/make namespace object */
-/******/ (() => {
-/******/ // define __esModule on 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/jsonp chunk loading */
-/******/ (() => {
-/******/ // no baseURI
-/******/
-/******/ // object to store loaded and loading chunks
-/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
-/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
-/******/ var installedChunks = {
-/******/ "reactions/index": 0,
-/******/ "reactions/style-index": 0
-/******/ };
-/******/
-/******/ // no chunk on demand loading
-/******/
-/******/ // no prefetching
-/******/
-/******/ // no preloaded
-/******/
-/******/ // no HMR
-/******/
-/******/ // no HMR manifest
-/******/
-/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
-/******/
-/******/ // install a JSONP callback for chunk loading
-/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
-/******/ var [chunkIds, moreModules, runtime] = data;
-/******/ // add "moreModules" to the modules object,
-/******/ // then flag all "chunkIds" as loaded and fire callback
-/******/ var moduleId, chunkId, i = 0;
-/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
-/******/ for(moduleId in moreModules) {
-/******/ if(__webpack_require__.o(moreModules, moduleId)) {
-/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
-/******/ }
-/******/ }
-/******/ if(runtime) var result = runtime(__webpack_require__);
-/******/ }
-/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
-/******/ for(;i < chunkIds.length; i++) {
-/******/ chunkId = chunkIds[i];
-/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
-/******/ installedChunks[chunkId][0]();
-/******/ }
-/******/ installedChunks[chunkId] = 0;
-/******/ }
-/******/ return __webpack_require__.O(result);
-/******/ }
-/******/
-/******/ var chunkLoadingGlobal = globalThis["webpackChunkwordpress_activitypub"] = globalThis["webpackChunkwordpress_activitypub"] || [];
-/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
-/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
-/******/ })();
-/******/
-/************************************************************************/
-/******/
-/******/ // startup
-/******/ // Load entry module and return exports
-/******/ // This entry module depends on other loaded chunks and execution need to be delayed
-/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["reactions/style-index"], () => (__webpack_require__("./src/reactions/index.js")))
-/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
-/******/
-/******/ })()
-;
-//# sourceMappingURL=index.js.map
\ No newline at end of file
+(()=>{"use strict";var e,t={343:(e,t,r)=>{const n=window.wp.blocks,i=[{attributes:{title:{type:"string",default:"Fediverse reactions"}},supports:{html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},__experimentalBorder:{radius:!0,width:!0,color:!0,style:!0},typography:{fontSize:!0,__experimentalDefaultControls:{fontSize:!0}}},isEligible:({title:e})=>!!e,migrate:({title:e,...t})=>[t,[(0,n.createBlock)("core/heading",{content:e,level:6})]]}],s=window.wp.blockEditor,a=window.wp.i18n,o=window.wp.data,l=window.wp.element,c=window.wp.components,u=window.wp.apiFetch;var d=r.n(u);function p(){return window._activityPubOptions||{}}const f=window.ReactJSXRuntime,m=({reactions:e})=>{const{defaultAvatarUrl:t}=p();return(0,f.jsx)("ul",{className:"reaction-avatars",children:e.map((e,r)=>{const n=["reaction-avatar"].filter(Boolean).join(" "),i=e.avatar||t;return(0,f.jsx)("li",{children:(0,f.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",children:(0,f.jsx)("img",{src:i,alt:e.name,className:n,width:"32",height:"32",onError:e=>{e.target.src=t}})})},r)})})},h=({reactions:e})=>{const{defaultAvatarUrl:t}=p();return(0,f.jsx)("ul",{className:"reactions-list",children:e.map((e,r)=>{const n=e.avatar||t;return(0,f.jsx)("li",{className:"reaction-item",children:(0,f.jsxs)("a",{href:e.url,className:"reaction-item",target:"_blank",rel:"noopener noreferrer",children:[(0,f.jsx)("img",{src:n,alt:e.name,width:"32",height:"32",onError:e=>{e.target.src=t}}),(0,f.jsx)("span",{className:"reaction-name",children:e.name})]})},r)})})},v=({items:e,label:t})=>{const[r,n]=(0,l.useState)(!1),[i,s]=(0,l.useState)(null),a=(0,l.useRef)(null),o=e.slice(0,20);return(0,f.jsxs)("div",{className:"reaction-group",ref:a,children:[(0,f.jsx)(m,{reactions:o}),(0,f.jsx)(c.Button,{ref:s,className:"reaction-label is-link",onClick:()=>n(!r),"aria-expanded":r,children:t}),r&&i&&(0,f.jsx)(c.Popover,{anchor:i,onClose:()=>n(!1),children:(0,f.jsx)(h,{reactions:e})})]})};function w({postId:e=null,reactions:t=null,fallbackReactions:r=null}){const{namespace:n}=p(),[i,s]=(0,l.useState)(t),[a,o]=(0,l.useState)(!t),c=()=>{r&&s(r),o(!1)};return(0,l.useEffect)(()=>{if(t)return s(t),void o(!1);e&&"number"==typeof e?(o(!0),d()({path:`/${n}/posts/${e}/reactions`}).then(e=>{const t=Object.values(e).some(e=>e.items?.length>0);s(!t&&r?r:e),o(!1)}).catch(c)):c()},[e,t,r,n]),a?null:i&&Object.values(i).some(e=>e.items?.length>0)?(0,f.jsx)(f.Fragment,{children:Object.entries(i).map(([e,t])=>t.items?.length?(0,f.jsx)(v,{items:t.items,label:t.label},e):null)}):null}const g=(e,t,r,n)=>Array.from({length:e},(e,i)=>({name:`${t} ${i+1}`,url:"#",avatar:`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='32' cy='32' r='32' fill='%23${n[i%n.length]}'/%3E%3Ctext x='32' y='38' font-family='sans-serif' font-size='24' fill='white' text-anchor='middle'%3E${String.fromCharCode(r+i)}%3C/text%3E%3C/svg%3E`})),x=["FF6B6B","4ECDC4","45B7D1","96CEB4","D4A5A5","9B59B6","3498DB","E67E22"],b={likes:{label:(0,a.sprintf)(/* translators: %d: Number of likes */ /* translators: %d: Number of likes */
+(0,a._x)("%d likes","number of likes","activitypub"),9),items:g(9,"User",65,x)},reposts:{label:(0,a.sprintf)(/* translators: %d: Number of reposts */ /* translators: %d: Number of reposts */
+(0,a._x)("%d reposts","number of reposts","activitypub"),6),items:g(6,"Reposter",82,x)}},y=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","name":"activitypub/reactions","apiVersion":3,"version":"3.0.3","title":"Fediverse Reactions","category":"widgets","icon":"heart","description":"Display Fediverse likes and reposts","supports":{"align":["wide","full"],"color":{"gradients":true},"__experimentalBorder":{"radius":true,"width":true,"color":true,"style":true},"html":false,"interactivity":true,"layout":{"default":{"type":"constrained","orientation":"vertical","justifyContent":"center"},"allowEditing":false},"shadow":true,"typography":{"fontSize":true,"__experimentalDefaultControls":{"fontSize":true}}},"blockHooks":{"core/post-content":"after"},"textdomain":"activitypub","editorScript":"file:./index.js","style":"file:./style-index.css","viewScriptModule":"file:./view.js","viewScript":"wp-api-fetch","render":"file:./render.php"}');(0,n.registerBlockType)(y,{deprecated:i,edit:function({__unstableLayoutClassNames:e}){const t=(0,s.useBlockProps)({className:e}),{getCurrentPostId:r}=(0,o.select)("core/editor"),n=[["core/heading",{level:6,placeholder:(0,a.__)("Fediverse Reactions","activitypub"),content:(0,a.__)("Fediverse Reactions","activitypub")}]];return(0,f.jsxs)("div",{...t,children:[(0,f.jsx)(s.InnerBlocks,{template:n,allowedBlocks:["core/heading"],templateLock:"all",renderAppender:!1}),(0,f.jsx)(w,{postId:r(),fallbackReactions:b})]})},save:function(){return(0,f.jsx)("div",{...s.useBlockProps.save(),children:(0,f.jsx)(s.InnerBlocks.Content,{})})}})}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var s=r[e]={exports:{}};return t[e](s,s.exports,n),s.exports}n.m=t,e=[],n.O=(t,r,i,s)=>{if(!r){var a=1/0;for(u=0;u=s)&&Object.keys(n.O).every(e=>n.O[e](r[l]))?r.splice(l--,1):(o=!1,s0&&e[u-1][2]>s;u--)e[u]=e[u-1];e[u]=[r,i,s]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={608:0,104:0};n.O.j=t=>0===e[t];var t=(t,r)=>{var i,s,[a,o,l]=r,c=0;if(a.some(t=>0!==e[t])){for(i in o)n.o(o,i)&&(n.m[i]=o[i]);if(l)var u=l(n)}for(t&&t(r);cn(343));i=n.O(i)})();
\ No newline at end of file
diff --git a/build/reactions/style-index-rtl.css b/build/reactions/style-index-rtl.css
index 4d8bc4197a..54a50cff24 100644
--- a/build/reactions/style-index-rtl.css
+++ b/build/reactions/style-index-rtl.css
@@ -1,278 +1 @@
-/*!*************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/reactions/style.scss ***!
- \*************************************************************************************************************************************************************************************************************************************************/
-body.modal-open {
- overflow: hidden;
-}
-
-.activitypub-modal__overlay {
- position: fixed;
- top: 0;
- right: 0;
- left: 0;
- bottom: 0;
- background-color: rgba(0, 0, 0, 0.5);
- color: initial;
- z-index: 100000;
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 1rem;
-}
-
-.activitypub-modal__overlay.compact {
- position: absolute;
- background-color: transparent;
- padding: 0;
- top: auto;
- right: auto;
- left: auto;
- bottom: auto;
- align-items: flex-start;
- justify-content: flex-start;
- z-index: 100;
-}
-
-.activitypub-modal__overlay[hidden] {
- display: none;
-}
-
-.activitypub-modal__frame {
- max-width: 660px;
- width: 100%;
- background-color: var(--wp--preset--color--white, #fff);
- border-radius: 8px;
- box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
- overflow: hidden;
- display: flex;
- flex-direction: column;
- max-height: calc(100vh - 2rem);
- animation: activitypub-modal-appear 0.2s ease-out;
-}
-
-.compact .activitypub-modal__frame {
- width: auto;
- max-width: -moz-min-content;
- max-width: min-content;
- min-width: 250px;
- max-height: 300px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
-}
-
-.activitypub-modal__header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 2rem 2rem 1.5rem 2rem;
- border-bottom: 1px solid var(--wp--preset--color--light-gray, #f0f0f0);
- flex-shrink: 0;
-}
-
-.compact .activitypub-modal__header {
- display: none;
-}
-
-.activitypub-modal__header .activitypub-modal__close {
- border: none;
- padding: 0.5rem;
- cursor: pointer;
- display: flex;
- align-items: center;
- justify-content: center;
- width: auto;
-}
-
-.activitypub-modal__header .activitypub-modal__close:active {
- border: none;
- padding: 0.5rem;
-}
-
-.activitypub-modal__title {
- margin: 0 !important;
- font-size: 130%;
- font-weight: 600;
- line-height: 1.4;
-}
-
-.activitypub-modal__content {
- overflow-y: auto;
-}
-
-@keyframes activitypub-modal-appear {
- from {
- opacity: 0;
- transform: translateY(20px);
- }
- to {
- opacity: 1;
- transform: translateY(0);
- }
-}
-
-.wp-block-activitypub-reactions {
- margin-top: 2rem;
- margin-bottom: 2rem;
- position: relative;
-}
-
-.wp-block-activitypub-reactions.has-background, .wp-block-activitypub-reactions.has-border {
- box-sizing: border-box;
- padding: 2rem;
-}
-
-.wp-block-activitypub-reactions .activitypub-reactions {
- display: flex;
- flex-direction: column;
- flex-wrap: wrap;
-}
-
-.wp-block-activitypub-reactions .reaction-group {
- display: flex;
- align-items: center;
- margin: 0.5em 0;
- position: relative;
- width: 100%;
- gap: 0.75rem;
- justify-content: flex-start;
-}
-
-@media (max-width: 782px) {
- .wp-block-activitypub-reactions .reaction-group:has(.reaction-avatars:not(:empty)) {
- justify-content: space-between;
- }
-}
-
-.wp-block-activitypub-reactions .reaction-group .reaction-avatars {
- display: flex;
- flex-direction: row;
- align-items: center;
- list-style: none;
- margin: 0 !important;
- padding: 0;
-}
-
-.wp-block-activitypub-reactions .reaction-group .reaction-avatars li {
- padding: 0;
- margin: 0 0 0 -10px;
- transition: transform 0.2s ease;
-}
-
-.wp-block-activitypub-reactions .reaction-group .reaction-avatars li:not([hidden]):not(:has(~ li:not([hidden]))) {
- margin-left: 0;
-}
-
-.wp-block-activitypub-reactions .reaction-group .reaction-avatars li:hover {
- z-index: 2;
- transform: translateY(-2px);
-}
-
-.wp-block-activitypub-reactions .reaction-group .reaction-avatars li a {
- box-shadow: none;
- border-radius: 50%;
- display: block;
- line-height: 1;
- text-decoration: none;
-}
-
-.wp-block-activitypub-reactions .reaction-group .reaction-avatar {
- max-width: 32px;
- max-height: 32px;
- overflow: hidden;
- -moz-force-broken-image-icon: 1;
- border-radius: 50%;
- border: 0.5px solid var(--wp--preset--color--contrast, rgba(255, 255, 255, 0.8));
- box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.8), 0 1px 3px rgba(0, 0, 0, 0.2);
- transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
- will-change: transform;
-}
-
-.wp-block-activitypub-reactions .reaction-group .reaction-avatar:hover, .wp-block-activitypub-reactions .reaction-group .reaction-avatar:focus-visible {
- z-index: 1;
- position: relative;
- transform: translateY(-5px);
-}
-
-.wp-block-activitypub-reactions .reaction-group .reaction-label {
- background: none;
- border: none;
- border-radius: 4px;
- display: flex;
- align-items: center;
- gap: 0.25rem;
- flex: 0 0 auto;
- padding: 0.25rem 0.5rem;
- font-size: 70%;
- color: currentColor;
- transition: background-color 0.2s ease;
- white-space: nowrap;
- text-decoration: none;
-}
-
-.wp-block-activitypub-reactions .reaction-group .reaction-label:hover {
- background-color: rgba(0, 0, 0, 0.05);
- color: currentColor;
-}
-
-.wp-block-activitypub-reactions .reaction-group .reaction-label:focus:not(:disabled) {
- box-shadow: none;
- outline: 1px solid currentColor;
- outline-offset: 2px;
-}
-
-/* Reactions list styles */
-
-.reactions-list {
- list-style: none;
- margin: 0 !important;
- padding: 0.5rem;
-}
-
-.components-popover__content > .reactions-list {
- padding: 0;
-}
-
-.reactions-list .reaction-item {
- margin: 0 0 0.5rem 0;
-}
-
-.reactions-list .reaction-item:last-child {
- margin-bottom: 0;
-}
-
-.reactions-list .reaction-item a {
- box-shadow: none;
- display: flex;
- align-items: center;
- gap: 0.75rem;
- text-decoration: none;
- color: inherit;
- transition: background-color 0.2s ease;
- padding: 0.5rem;
- border-radius: 4px;
-}
-
-.reactions-list .reaction-item a:hover {
- background-color: rgba(0, 0, 0, 0.03);
-}
-
-.reactions-list .reaction-item img {
- box-shadow: none;
- width: 36px;
- height: 36px;
- border-radius: 50%;
- border: 1px solid var(--wp--preset--color--light-gray, #f0f0f0);
-}
-
-.reactions-list .reaction-item .reaction-name {
- font-size: 75%;
-}
-
-.components-popover__content {
- width: auto;
- max-width: -moz-min-content;
- max-width: min-content;
- min-width: 250px;
- max-height: 300px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
- padding: 0.5rem;
-}
+body.modal-open{overflow:hidden}.activitypub-modal__overlay{align-items:center;background-color:rgba(0,0,0,.5);bottom:0;color:initial;display:flex;justify-content:center;right:0;padding:1rem;position:fixed;left:0;top:0;z-index:100000}.activitypub-modal__overlay.compact{align-items:flex-start;background-color:transparent;bottom:auto;justify-content:flex-start;right:auto;padding:0;position:absolute;left:auto;top:auto;z-index:100}.activitypub-modal__overlay[hidden]{display:none}.activitypub-modal__frame{animation:activitypub-modal-appear .2s ease-out;background-color:var(--wp--preset--color--white,#fff);border-radius:8px;box-shadow:0 5px 15px rgba(0,0,0,.3);display:flex;flex-direction:column;max-height:calc(100vh - 2rem);max-width:660px;overflow:hidden;width:100%}.compact .activitypub-modal__frame{box-shadow:0 2px 8px rgba(0,0,0,.1);max-height:300px;max-width:-moz-min-content;max-width:min-content;min-width:250px;width:auto}.activitypub-modal__header{align-items:center;border-bottom:1px solid var(--wp--preset--color--light-gray,#f0f0f0);display:flex;flex-shrink:0;justify-content:space-between;padding:2rem 2rem 1.5rem}.compact .activitypub-modal__header{display:none}.activitypub-modal__header .activitypub-modal__close{align-items:center;border:none;cursor:pointer;display:flex;justify-content:center;padding:.5rem;width:auto}.activitypub-modal__header .activitypub-modal__close:active{border:none;padding:.5rem}.activitypub-modal__title{font-size:130%;font-weight:600;line-height:1.4;margin:0!important}.activitypub-modal__content{overflow-y:auto}@keyframes activitypub-modal-appear{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.wp-block-activitypub-reactions{margin-bottom:2rem;margin-top:2rem;position:relative}.wp-block-activitypub-reactions.has-background,.wp-block-activitypub-reactions.has-border{box-sizing:border-box;padding:2rem}.wp-block-activitypub-reactions .activitypub-reactions{display:flex;flex-direction:column;flex-wrap:wrap}.wp-block-activitypub-reactions .reaction-group{align-items:center;display:flex;gap:.75rem;justify-content:flex-start;margin:.5em 0;position:relative;width:100%}@media(max-width:782px){.wp-block-activitypub-reactions .reaction-group:has(.reaction-avatars:not(:empty)){justify-content:space-between}}.wp-block-activitypub-reactions .reaction-group .reaction-avatars{align-items:center;display:flex;flex-direction:row;list-style:none;margin:0!important;padding:0}.wp-block-activitypub-reactions .reaction-group .reaction-avatars li{margin:0 0 0 -10px;padding:0;transition:transform .2s ease}.wp-block-activitypub-reactions .reaction-group .reaction-avatars li:not([hidden]):not(:has(~li:not([hidden]))){margin-left:0}.wp-block-activitypub-reactions .reaction-group .reaction-avatars li:hover{transform:translateY(-2px);z-index:2}.wp-block-activitypub-reactions .reaction-group .reaction-avatars li a{border-radius:50%;box-shadow:none;display:block;line-height:1;text-decoration:none}.wp-block-activitypub-reactions .reaction-group .reaction-avatar{max-height:32px;max-width:32px;overflow:hidden;-moz-force-broken-image-icon:1;border:.5px solid var(--wp--preset--color--contrast,hsla(0,0%,100%,.8));border-radius:50%;box-shadow:0 0 0 .5px hsla(0,0%,100%,.8),0 1px 3px rgba(0,0,0,.2);transition:transform .6s cubic-bezier(.34,1.56,.64,1);will-change:transform}.wp-block-activitypub-reactions .reaction-group .reaction-avatar:focus-visible,.wp-block-activitypub-reactions .reaction-group .reaction-avatar:hover{position:relative;transform:translateY(-5px);z-index:1}.wp-block-activitypub-reactions .reaction-group .reaction-label{align-items:center;background:none;border:none;border-radius:4px;color:currentColor;display:flex;flex:0 0 auto;font-size:70%;gap:.25rem;padding:.25rem .5rem;text-decoration:none;transition:background-color .2s ease;white-space:nowrap}.wp-block-activitypub-reactions .reaction-group .reaction-label:hover{background-color:rgba(0,0,0,.05);color:currentColor}.wp-block-activitypub-reactions .reaction-group .reaction-label:focus:not(:disabled){box-shadow:none;outline:1px solid currentColor;outline-offset:2px}.reactions-list{list-style:none;margin:0!important;padding:.5rem}.components-popover__content>.reactions-list{padding:0}.reactions-list .reaction-item{margin:0 0 .5rem}.reactions-list .reaction-item:last-child{margin-bottom:0}.reactions-list .reaction-item a{align-items:center;border-radius:4px;box-shadow:none;color:inherit;display:flex;gap:.75rem;padding:.5rem;text-decoration:none;transition:background-color .2s ease}.reactions-list .reaction-item a:hover{background-color:rgba(0,0,0,.03)}.reactions-list .reaction-item img{border:1px solid var(--wp--preset--color--light-gray,#f0f0f0);border-radius:50%;box-shadow:none;height:36px;width:36px}.reactions-list .reaction-item .reaction-name{font-size:75%}.components-popover__content{box-shadow:0 2px 8px rgba(0,0,0,.1);max-height:300px;max-width:-moz-min-content;max-width:min-content;min-width:250px;padding:.5rem;width:auto}
diff --git a/build/reactions/style-index.css b/build/reactions/style-index.css
index 0e4080ed0a..5b2fbf3f5c 100644
--- a/build/reactions/style-index.css
+++ b/build/reactions/style-index.css
@@ -1,280 +1 @@
-/*!*************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/reactions/style.scss ***!
- \*************************************************************************************************************************************************************************************************************************************************/
-body.modal-open {
- overflow: hidden;
-}
-
-.activitypub-modal__overlay {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background-color: rgba(0, 0, 0, 0.5);
- color: initial;
- z-index: 100000;
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 1rem;
-}
-
-.activitypub-modal__overlay.compact {
- position: absolute;
- background-color: transparent;
- padding: 0;
- top: auto;
- left: auto;
- right: auto;
- bottom: auto;
- align-items: flex-start;
- justify-content: flex-start;
- z-index: 100;
-}
-
-.activitypub-modal__overlay[hidden] {
- display: none;
-}
-
-.activitypub-modal__frame {
- max-width: 660px;
- width: 100%;
- background-color: var(--wp--preset--color--white, #fff);
- border-radius: 8px;
- box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
- overflow: hidden;
- display: flex;
- flex-direction: column;
- max-height: calc(100vh - 2rem);
- animation: activitypub-modal-appear 0.2s ease-out;
-}
-
-.compact .activitypub-modal__frame {
- width: auto;
- max-width: -moz-min-content;
- max-width: min-content;
- min-width: 250px;
- max-height: 300px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
-}
-
-.activitypub-modal__header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 2rem 2rem 1.5rem 2rem;
- border-bottom: 1px solid var(--wp--preset--color--light-gray, #f0f0f0);
- flex-shrink: 0;
-}
-
-.compact .activitypub-modal__header {
- display: none;
-}
-
-.activitypub-modal__header .activitypub-modal__close {
- border: none;
- padding: 0.5rem;
- cursor: pointer;
- display: flex;
- align-items: center;
- justify-content: center;
- width: auto;
-}
-
-.activitypub-modal__header .activitypub-modal__close:active {
- border: none;
- padding: 0.5rem;
-}
-
-.activitypub-modal__title {
- margin: 0 !important;
- font-size: 130%;
- font-weight: 600;
- line-height: 1.4;
-}
-
-.activitypub-modal__content {
- overflow-y: auto;
-}
-
-@keyframes activitypub-modal-appear {
- from {
- opacity: 0;
- transform: translateY(20px);
- }
- to {
- opacity: 1;
- transform: translateY(0);
- }
-}
-
-.wp-block-activitypub-reactions {
- margin-top: 2rem;
- margin-bottom: 2rem;
- position: relative;
-}
-
-.wp-block-activitypub-reactions.has-background, .wp-block-activitypub-reactions.has-border {
- box-sizing: border-box;
- padding: 2rem;
-}
-
-.wp-block-activitypub-reactions .activitypub-reactions {
- display: flex;
- flex-direction: column;
- flex-wrap: wrap;
-}
-
-.wp-block-activitypub-reactions .reaction-group {
- display: flex;
- align-items: center;
- margin: 0.5em 0;
- position: relative;
- width: 100%;
- gap: 0.75rem;
- justify-content: flex-start;
-}
-
-@media (max-width: 782px) {
- .wp-block-activitypub-reactions .reaction-group:has(.reaction-avatars:not(:empty)) {
- justify-content: space-between;
- }
-}
-
-.wp-block-activitypub-reactions .reaction-group .reaction-avatars {
- display: flex;
- flex-direction: row;
- align-items: center;
- list-style: none;
- margin: 0 !important;
- padding: 0;
-}
-
-.wp-block-activitypub-reactions .reaction-group .reaction-avatars li {
- padding: 0;
- margin: 0 -10px 0 0;
- transition: transform 0.2s ease;
-}
-
-.wp-block-activitypub-reactions .reaction-group .reaction-avatars li:not([hidden]):not(:has(~ li:not([hidden]))) {
- margin-right: 0;
-}
-
-.wp-block-activitypub-reactions .reaction-group .reaction-avatars li:hover {
- z-index: 2;
- transform: translateY(-2px);
-}
-
-.wp-block-activitypub-reactions .reaction-group .reaction-avatars li a {
- box-shadow: none;
- border-radius: 50%;
- display: block;
- line-height: 1;
- text-decoration: none;
-}
-
-.wp-block-activitypub-reactions .reaction-group .reaction-avatar {
- max-width: 32px;
- max-height: 32px;
- overflow: hidden;
- -moz-force-broken-image-icon: 1;
- border-radius: 50%;
- border: 0.5px solid var(--wp--preset--color--contrast, rgba(255, 255, 255, 0.8));
- box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.8), 0 1px 3px rgba(0, 0, 0, 0.2);
- transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
- will-change: transform;
-}
-
-.wp-block-activitypub-reactions .reaction-group .reaction-avatar:hover, .wp-block-activitypub-reactions .reaction-group .reaction-avatar:focus-visible {
- z-index: 1;
- position: relative;
- transform: translateY(-5px);
-}
-
-.wp-block-activitypub-reactions .reaction-group .reaction-label {
- background: none;
- border: none;
- border-radius: 4px;
- display: flex;
- align-items: center;
- gap: 0.25rem;
- flex: 0 0 auto;
- padding: 0.25rem 0.5rem;
- font-size: 70%;
- color: currentColor;
- transition: background-color 0.2s ease;
- white-space: nowrap;
- text-decoration: none;
-}
-
-.wp-block-activitypub-reactions .reaction-group .reaction-label:hover {
- background-color: rgba(0, 0, 0, 0.05);
- color: currentColor;
-}
-
-.wp-block-activitypub-reactions .reaction-group .reaction-label:focus:not(:disabled) {
- box-shadow: none;
- outline: 1px solid currentColor;
- outline-offset: 2px;
-}
-
-/* Reactions list styles */
-
-.reactions-list {
- list-style: none;
- margin: 0 !important;
- padding: 0.5rem;
-}
-
-.components-popover__content > .reactions-list {
- padding: 0;
-}
-
-.reactions-list .reaction-item {
- margin: 0 0 0.5rem 0;
-}
-
-.reactions-list .reaction-item:last-child {
- margin-bottom: 0;
-}
-
-.reactions-list .reaction-item a {
- box-shadow: none;
- display: flex;
- align-items: center;
- gap: 0.75rem;
- text-decoration: none;
- color: inherit;
- transition: background-color 0.2s ease;
- padding: 0.5rem;
- border-radius: 4px;
-}
-
-.reactions-list .reaction-item a:hover {
- background-color: rgba(0, 0, 0, 0.03);
-}
-
-.reactions-list .reaction-item img {
- box-shadow: none;
- width: 36px;
- height: 36px;
- border-radius: 50%;
- border: 1px solid var(--wp--preset--color--light-gray, #f0f0f0);
-}
-
-.reactions-list .reaction-item .reaction-name {
- font-size: 75%;
-}
-
-.components-popover__content {
- width: auto;
- max-width: -moz-min-content;
- max-width: min-content;
- min-width: 250px;
- max-height: 300px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
- padding: 0.5rem;
-}
-
-/*# sourceMappingURL=style-index.css.map*/
\ No newline at end of file
+body.modal-open{overflow:hidden}.activitypub-modal__overlay{align-items:center;background-color:rgba(0,0,0,.5);bottom:0;color:initial;display:flex;justify-content:center;left:0;padding:1rem;position:fixed;right:0;top:0;z-index:100000}.activitypub-modal__overlay.compact{align-items:flex-start;background-color:transparent;bottom:auto;justify-content:flex-start;left:auto;padding:0;position:absolute;right:auto;top:auto;z-index:100}.activitypub-modal__overlay[hidden]{display:none}.activitypub-modal__frame{animation:activitypub-modal-appear .2s ease-out;background-color:var(--wp--preset--color--white,#fff);border-radius:8px;box-shadow:0 5px 15px rgba(0,0,0,.3);display:flex;flex-direction:column;max-height:calc(100vh - 2rem);max-width:660px;overflow:hidden;width:100%}.compact .activitypub-modal__frame{box-shadow:0 2px 8px rgba(0,0,0,.1);max-height:300px;max-width:-moz-min-content;max-width:min-content;min-width:250px;width:auto}.activitypub-modal__header{align-items:center;border-bottom:1px solid var(--wp--preset--color--light-gray,#f0f0f0);display:flex;flex-shrink:0;justify-content:space-between;padding:2rem 2rem 1.5rem}.compact .activitypub-modal__header{display:none}.activitypub-modal__header .activitypub-modal__close{align-items:center;border:none;cursor:pointer;display:flex;justify-content:center;padding:.5rem;width:auto}.activitypub-modal__header .activitypub-modal__close:active{border:none;padding:.5rem}.activitypub-modal__title{font-size:130%;font-weight:600;line-height:1.4;margin:0!important}.activitypub-modal__content{overflow-y:auto}@keyframes activitypub-modal-appear{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.wp-block-activitypub-reactions{margin-bottom:2rem;margin-top:2rem;position:relative}.wp-block-activitypub-reactions.has-background,.wp-block-activitypub-reactions.has-border{box-sizing:border-box;padding:2rem}.wp-block-activitypub-reactions .activitypub-reactions{display:flex;flex-direction:column;flex-wrap:wrap}.wp-block-activitypub-reactions .reaction-group{align-items:center;display:flex;gap:.75rem;justify-content:flex-start;margin:.5em 0;position:relative;width:100%}@media(max-width:782px){.wp-block-activitypub-reactions .reaction-group:has(.reaction-avatars:not(:empty)){justify-content:space-between}}.wp-block-activitypub-reactions .reaction-group .reaction-avatars{align-items:center;display:flex;flex-direction:row;list-style:none;margin:0!important;padding:0}.wp-block-activitypub-reactions .reaction-group .reaction-avatars li{margin:0 -10px 0 0;padding:0;transition:transform .2s ease}.wp-block-activitypub-reactions .reaction-group .reaction-avatars li:not([hidden]):not(:has(~li:not([hidden]))){margin-right:0}.wp-block-activitypub-reactions .reaction-group .reaction-avatars li:hover{transform:translateY(-2px);z-index:2}.wp-block-activitypub-reactions .reaction-group .reaction-avatars li a{border-radius:50%;box-shadow:none;display:block;line-height:1;text-decoration:none}.wp-block-activitypub-reactions .reaction-group .reaction-avatar{max-height:32px;max-width:32px;overflow:hidden;-moz-force-broken-image-icon:1;border:.5px solid var(--wp--preset--color--contrast,hsla(0,0%,100%,.8));border-radius:50%;box-shadow:0 0 0 .5px hsla(0,0%,100%,.8),0 1px 3px rgba(0,0,0,.2);transition:transform .6s cubic-bezier(.34,1.56,.64,1);will-change:transform}.wp-block-activitypub-reactions .reaction-group .reaction-avatar:focus-visible,.wp-block-activitypub-reactions .reaction-group .reaction-avatar:hover{position:relative;transform:translateY(-5px);z-index:1}.wp-block-activitypub-reactions .reaction-group .reaction-label{align-items:center;background:none;border:none;border-radius:4px;color:currentColor;display:flex;flex:0 0 auto;font-size:70%;gap:.25rem;padding:.25rem .5rem;text-decoration:none;transition:background-color .2s ease;white-space:nowrap}.wp-block-activitypub-reactions .reaction-group .reaction-label:hover{background-color:rgba(0,0,0,.05);color:currentColor}.wp-block-activitypub-reactions .reaction-group .reaction-label:focus:not(:disabled){box-shadow:none;outline:1px solid currentColor;outline-offset:2px}.reactions-list{list-style:none;margin:0!important;padding:.5rem}.components-popover__content>.reactions-list{padding:0}.reactions-list .reaction-item{margin:0 0 .5rem}.reactions-list .reaction-item:last-child{margin-bottom:0}.reactions-list .reaction-item a{align-items:center;border-radius:4px;box-shadow:none;color:inherit;display:flex;gap:.75rem;padding:.5rem;text-decoration:none;transition:background-color .2s ease}.reactions-list .reaction-item a:hover{background-color:rgba(0,0,0,.03)}.reactions-list .reaction-item img{border:1px solid var(--wp--preset--color--light-gray,#f0f0f0);border-radius:50%;box-shadow:none;height:36px;width:36px}.reactions-list .reaction-item .reaction-name{font-size:75%}.components-popover__content{box-shadow:0 2px 8px rgba(0,0,0,.1);max-height:300px;max-width:-moz-min-content;max-width:min-content;min-width:250px;padding:.5rem;width:auto}
diff --git a/build/reactions/view.asset.php b/build/reactions/view.asset.php
index 7d55725c6d..c2b4f3ccbb 100644
--- a/build/reactions/view.asset.php
+++ b/build/reactions/view.asset.php
@@ -1 +1 @@
- array('@wordpress/interactivity'), 'version' => 'a5d139a946fab697928c', 'type' => 'module');
+ array('@wordpress/interactivity'), 'version' => '97fae96804d06a1889ca', 'type' => 'module');
diff --git a/build/reactions/view.js b/build/reactions/view.js
index 1a26e64d53..684e25b3f9 100644
--- a/build/reactions/view.js
+++ b/build/reactions/view.js
@@ -1,518 +1 @@
-import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity";
-/******/ var __webpack_modules__ = ({
-
-/***/ "./src/shared/modal/index.js":
-/*!***********************************!*\
- !*** ./src/shared/modal/index.js ***!
- \***********************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ createModalStore: () => (/* binding */ createModalStore)
-/* harmony export */ });
-/* harmony import */ var _wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/interactivity */ "@wordpress/interactivity");
-
-
-/**
- * @typedef {Object} context
- * @property {String} blockId - The ID of the block.
- * @property {Object} modal - The modal state.
- * @property {boolean} modal.isOpen - Whether the modal is open.
- * @property {boolean} modal.isCompact - Whether the modal is compact.
- */
-
-/**
- * Set up a modal store with actions and callbacks.
- *
- * The Interactivity API merges all stores that share the same namespace,
- * so these actions and callbacks are added directly to the importing block’s existing store.
- *
- * @param {string} namespace - The interactivity namespace for the block.
- */
-function createModalStore(namespace) {
- const {
- actions,
- callbacks
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.store)(namespace, {
- actions: {
- /**
- * Open the modal.
- *
- * @param {Event} event Click event.
- */
- openModal(event) {
- const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
-
- // Set modal properties
- context.modal.isOpen = true;
- if (context.modal.isCompact) {
- // Position the compact modal relative to the button.
- setTimeout(callbacks.positionModal, 0);
- } else {
- // Set up the focus trap after modal is open.
- setTimeout(() => {
- // Use the blockId to find the specific modal frame for this block
- const blockWrapper = document.getElementById(context.blockId);
- if (blockWrapper) {
- const modalFrame = blockWrapper.querySelector('.activitypub-modal__frame');
- if (modalFrame) {
- callbacks.trapFocus(modalFrame);
- }
- }
- }, 50);
- }
-
- // Call the onOpen callback if provided.
- if (typeof callbacks.onModalOpen === 'function') {
- callbacks.onModalOpen(event);
- }
- },
- /**
- * Close the modal.
- *
- * @param {Event} event Click event.
- */
- closeModal(event) {
- const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
-
- // Reset modal state
- context.modal.isOpen = false;
-
- // Return focus to the button that opened the modal.
- const button = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getElement)();
- if (button.ref.dataset['wpOn-Click'] === 'actions.toggleModal') {
- button.ref.focus();
- } else {
- const blockWrapper = document.getElementById(context.blockId);
- if (blockWrapper) {
- const openButton = blockWrapper.querySelector('[data-wp-on--click="actions.toggleModal"], [data-wp-on-async--click="actions.toggleModal"]');
- if (openButton) {
- openButton.focus();
- }
- }
- }
-
- // Call the onClose callback if provided.
- if (typeof callbacks.onModalClose === 'function') {
- callbacks.onModalClose(event);
- }
- },
- /**
- * Toggle the modal.
- *
- * @param {Event} event Click event.
- */
- toggleModal(event) {
- const {
- modal
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- modal.isOpen ? actions.closeModal(event) : actions.openModal(event);
- }
- },
- callbacks: {
- /**
- * Abort controller for keydown and click event listeners.
- *
- * @type {AbortController | null} Abort controller.
- */
- _abortController: null,
- /**
- * Handles modal effects like body class and event listeners.
- * This is called via data-wp-watch in the modal HTML.
- */
- handleModalEffects() {
- const {
- modal
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
-
- // Update body class.
- if (modal.isOpen && !modal.isCompact) {
- document.body.classList.add('modal-open');
- } else {
- document.body.classList.remove('modal-open');
- }
-
- // Remove all existing listeners.
- if (callbacks._abortController) {
- callbacks._abortController.abort();
- callbacks._abortController = null;
- }
-
- // Add new listeners if modal is open.
- if (modal.isOpen) {
- callbacks._abortController = new AbortController();
- const {
- signal
- } = callbacks._abortController;
- document.addEventListener('keydown', callbacks.documentKeydown, {
- signal
- });
- document.addEventListener('click', callbacks.documentClick, {
- signal
- });
- }
- return undefined;
- },
- /**
- * Handles keydown events on the document.
- *
- * @param {Event} event Keydown event.
- * @param {String} event.key The key that was pressed.
- */
- documentKeydown(event) {
- const {
- modal
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- if (modal.isOpen && event.key === 'Escape') {
- actions.closeModal();
- }
- },
- /**
- * Handles click events on the document.
- *
- * @param {Event} event Click event.
- */
- documentClick(event) {
- const {
- blockId,
- modal
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- if (!modal.isOpen) {
- return;
- }
-
- // Get the block wrapper element.
- const blockWrapper = document.getElementById(blockId);
- if (!blockWrapper) {
- return;
- }
-
- // If the click was on the button or its children, we should not close the modal.
- const toggleButton = blockWrapper.querySelector('.wp-element-button[data-wp-on--click="actions.toggleModal"]');
- if (toggleButton && (toggleButton === event.target || toggleButton.contains(event.target))) {
- return;
- }
-
- // Check if the click was inside the modal frame.
- const modalFrame = blockWrapper.querySelector('.activitypub-modal__frame');
- if (!modalFrame || modalFrame.contains(event.target)) {
- return;
- }
- actions.closeModal();
- },
- /**
- * Positions the modal relative to the button that opened it.
- */
- positionModal() {
- const {
- blockId
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- const blockWrapper = document.getElementById(blockId);
- if (!blockWrapper) {
- return;
- }
- const modalOverlay = blockWrapper.querySelector('.activitypub-modal__overlay');
- if (!modalOverlay) {
- return;
- }
-
- // Reset any previously set positioning.
- modalOverlay.style.top = '';
- modalOverlay.style.left = '';
- modalOverlay.style.right = '';
- modalOverlay.style.bottom = '';
-
- // Get button position relative to viewport.
- const buttonRect = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getElement)().ref.getBoundingClientRect();
-
- // Get viewport dimensions.
- const viewportWidth = window.innerWidth;
-
- // Get the block's position to calculate relative positioning.
- const blockRect = blockWrapper.getBoundingClientRect();
-
- // Calculate position relative to the block (our positioning context).
- const relativeTop = buttonRect.bottom - blockRect.top;
- const relativeLeft = buttonRect.left - blockRect.left;
-
- // Calculate available space.
- const spaceRight = viewportWidth - buttonRect.right;
-
- // Default position (below button, relative to the block).
- let position = {
- top: `${relativeTop + 8}px`,
- left: `${relativeLeft - 2}px` // -2 px to account for the button border.
- };
-
- // If not enough space to the right, align with the right edge.
- if (spaceRight < 250) {
- position.left = 'auto';
- position.right = `${blockRect.right - buttonRect.right}px`;
- }
-
- // Apply the position.
- Object.assign(modalOverlay.style, position);
- },
- /**
- * Traps focus within the specified element.
- *
- * @param {Element} element The element to trap focus within.
- */
- trapFocus(element) {
- const focusableElements = element.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]):not([readonly]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])');
- const firstFocusableElement = focusableElements[0];
- const lastFocusableElement = focusableElements[focusableElements.length - 1];
-
- // If the first focusable element is the close button, set initial focus to the next element instead.
- if (firstFocusableElement && firstFocusableElement.classList.contains('activitypub-modal__close') && focusableElements.length > 1) {
- // Set initial focus to the second element, but keep firstFocusableElement as is for tab trapping.
- focusableElements[1].focus();
- } else {
- // Otherwise focus the first element as usual.
- firstFocusableElement.focus();
- }
- element.addEventListener('keydown', function (event) {
- if (event.key !== 'Tab' && event.keyCode !== 9 /* KEYCODE_TAB */) {
- return;
- }
- if (event.shiftKey) {
- /* shift + tab */
- if (document.activeElement === firstFocusableElement) {
- lastFocusableElement.focus();
- event.preventDefault();
- }
- } /* tab */else {
- if (document.activeElement === lastFocusableElement) {
- firstFocusableElement.focus();
- event.preventDefault();
- }
- }
- });
- }
- }
- });
-}
-
-/***/ }),
-
-/***/ "@wordpress/interactivity":
-/*!*******************************************!*\
- !*** external "@wordpress/interactivity" ***!
- \*******************************************/
-/***/ ((module) => {
-
-module.exports = __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__;
-
-/***/ })
-
-/******/ });
-/************************************************************************/
-/******/ // The module cache
-/******/ var __webpack_module_cache__ = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/ // Check if module is in cache
-/******/ var cachedModule = __webpack_module_cache__[moduleId];
-/******/ if (cachedModule !== undefined) {
-/******/ return cachedModule.exports;
-/******/ }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = __webpack_module_cache__[moduleId] = {
-/******/ // no module.id needed
-/******/ // no module.loaded needed
-/******/ exports: {}
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/************************************************************************/
-/******/ /* webpack/runtime/define property getters */
-/******/ (() => {
-/******/ // define getter functions for harmony exports
-/******/ __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 */
-/******/ (() => {
-/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
-/******/ })();
-/******/
-/******/ /* webpack/runtime/make namespace object */
-/******/ (() => {
-/******/ // define __esModule on exports
-/******/ __webpack_require__.r = (exports) => {
-/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
-/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
-/******/ }
-/******/ Object.defineProperty(exports, '__esModule', { value: true });
-/******/ };
-/******/ })();
-/******/
-/************************************************************************/
-var __webpack_exports__ = {};
-// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
-(() => {
-/*!*******************************!*\
- !*** ./src/reactions/view.js ***!
- \*******************************/
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/interactivity */ "@wordpress/interactivity");
-/* harmony import */ var _shared_modal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/modal */ "./src/shared/modal/index.js");
-
-
-
-/** @var {Object} window.wp WordPress global object */
-const {
- apiFetch
-} = window.wp;
-(0,_shared_modal__WEBPACK_IMPORTED_MODULE_1__.createModalStore)('activitypub/reactions');
-
-/**
- * @typedef {Object} state
- * @property {Object} reactions Reactions data, keyed by post ID.
- */
-
-/**
- * @typedef {Object} context
- * @property {String} blockId The block ID.
- * @property {Object} modal The modal state.
- * @property {boolean} modal.isCompact Whether the modal is compact.
- * @property {boolean} modal.isOpen Whether the modal is open.
- * @property {Object} modal.items The items to display in the modal.
- * @property {String} postId The post ID.
- * @property {Object} reactions Reactions data, keyed by reaction type.
- */
-
-const {
- callbacks,
- state
-} = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.store)('activitypub/reactions', {
- actions: {
- /**
- * Fetches reactions for a post.
- */
- async fetchReactions() {
- const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- const {
- namespace
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getConfig)();
- if (!context.postId) return;
- try {
- // Update the state with the new Reactions data.
- context.reactions = await apiFetch({
- path: `/${namespace}/posts/${context.postId}/reactions`
- });
- } catch (error) {
- console.error('Error fetching reactions:', error);
- }
- }
- },
- callbacks: {
- /**
- * Initializes the Reactions component.
- */
- initReactions() {
- // Set up resize observer to recalculate on window resize.
- const resizeObserver = new ResizeObserver((0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.withScope)(callbacks.calculateVisibleAvatars));
- (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getElement)().ref.querySelectorAll('.reaction-group').forEach(group => {
- resizeObserver.observe(group);
- });
-
- // Return a cleanup function to disconnect the observer when the block is unmounted.
- return () => {
- resizeObserver.disconnect();
- };
- },
- /**
- * Calculates and sets the number of visible avatars based on container width.
- */
- calculateVisibleAvatars() {
- const {
- postId
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
-
- // Constants for calculations
- const AVATAR_WIDTH = 32; // Width of each avatar
- const AVATAR_OVERLAP = 10; // How much each avatar overlaps
- const EFFECTIVE_AVATAR_WIDTH = AVATAR_WIDTH - AVATAR_OVERLAP; // Width each additional avatar takes
- const BUTTON_GAP = 12; // Gap between avatars and button (0.75em)
-
- // Get all reaction types from the state.
- const reactionTypes = state.reactions && state.reactions[postId] ? Object.keys(state.reactions[postId]) : [];
-
- // Process each reaction group.
- reactionTypes.forEach(reactionType => {
- if (!state.reactions?.[postId][reactionType]?.items?.length) {
- return;
- }
- (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getElement)().ref.querySelectorAll(`.reaction-group[data-reaction-type="${reactionType}"]`).forEach(container => {
- const label = container.querySelector('.reaction-label');
- const labelWidth = label.offsetWidth || 0;
- const availableWidth = container.offsetWidth - labelWidth - BUTTON_GAP;
-
- // Calculate how many avatars can fit.
- // The first avatar takes full width, the rest take effective width.
- let maxAvatars = 1; // Start with 1 for the first avatar.
-
- // If we have space for more than one avatar.
- if (availableWidth > AVATAR_WIDTH) {
- // Calculate how many additional avatars can fit in the remaining space.
- maxAvatars += Math.floor((availableWidth - AVATAR_WIDTH) / EFFECTIVE_AVATAR_WIDTH);
- }
-
- // Ensure we don't show more than we have.
- const items = state.reactions[postId][reactionType].items;
- const visibleCount = Math.min(maxAvatars, items.length);
-
- // Update the DOM to show only the calculated number of avatars.
- const avatarsList = container.querySelector('.reaction-avatars');
- if (avatarsList) {
- const avatarItems = avatarsList.querySelectorAll('li');
- avatarItems.forEach((item, index) => {
- if (index < visibleCount) {
- item.removeAttribute('hidden');
- } else {
- item.setAttribute('hidden', 'hidden');
- }
- });
- }
- });
- });
- },
- /**
- * Sets the default avatar when the avatar image fails to load.
- *
- * @param {Object} event The error event.
- */
- setDefaultAvatar(event) {
- event.target.src = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getConfig)().defaultAvatarUrl;
- },
- /**
- * Opens the modal with the specified reaction type.
- */
- onModalOpen() {
- const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- const reactionType = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getElement)().ref.dataset.reactionType;
-
- // Set modal properties.
- context.modal.items = state.reactions[context.postId][reactionType].items;
- }
- }
-});
-})();
-
-
-//# sourceMappingURL=view.js.map
\ No newline at end of file
+import{getConfig as t,getContext as e,getElement as o,store as n,withScope as a}from"@wordpress/interactivity";const{apiFetch:c}=window.wp;!function(){const{actions:t,callbacks:a}=n("activitypub/reactions",{actions:{openModal(t){const o=e();o.modal.isOpen=!0,o.modal.isCompact?setTimeout(a.positionModal,0):setTimeout(()=>{const t=document.getElementById(o.blockId);if(t){const e=t.querySelector(".activitypub-modal__frame");e&&a.trapFocus(e)}},50),"function"==typeof a.onModalOpen&&a.onModalOpen(t)},closeModal(t){const n=e();n.modal.isOpen=!1;const c=o();if("actions.toggleModal"===c.ref.dataset["wpOn-Click"])c.ref.focus();else{const t=document.getElementById(n.blockId);if(t){const e=t.querySelector('[data-wp-on--click="actions.toggleModal"], [data-wp-on-async--click="actions.toggleModal"]');e&&e.focus()}}"function"==typeof a.onModalClose&&a.onModalClose(t)},toggleModal(o){const{modal:n}=e();n.isOpen?t.closeModal(o):t.openModal(o)}},callbacks:{_abortController:null,handleModalEffects(){const{modal:t}=e();if(t.isOpen&&!t.isCompact?document.body.classList.add("modal-open"):document.body.classList.remove("modal-open"),a._abortController&&(a._abortController.abort(),a._abortController=null),t.isOpen){a._abortController=new AbortController;const{signal:t}=a._abortController;document.addEventListener("keydown",a.documentKeydown,{signal:t}),document.addEventListener("click",a.documentClick,{signal:t})}},documentKeydown(o){const{modal:n}=e();n.isOpen&&"Escape"===o.key&&t.closeModal()},documentClick(o){const{blockId:n,modal:a}=e();if(!a.isOpen)return;const c=document.getElementById(n);if(!c)return;const l=c.querySelector('.wp-element-button[data-wp-on--click="actions.toggleModal"]');if(l&&(l===o.target||l.contains(o.target)))return;const s=c.querySelector(".activitypub-modal__frame");s&&!s.contains(o.target)&&t.closeModal()},positionModal(){const{blockId:t}=e(),n=document.getElementById(t);if(!n)return;const a=n.querySelector(".activitypub-modal__overlay");if(!a)return;a.style.top="",a.style.left="",a.style.right="",a.style.bottom="";const c=o().ref.getBoundingClientRect(),l=window.innerWidth,s=n.getBoundingClientRect();let i={top:c.bottom-s.top+8+"px",left:c.left-s.left-2+"px"};l-c.right<250&&(i.left="auto",i.right=s.right-c.right+"px"),Object.assign(a.style,i)},trapFocus(t){const e=t.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]):not([readonly]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),o=e[0],n=e[e.length-1];o&&o.classList.contains("activitypub-modal__close")&&e.length>1?e[1].focus():o.focus(),t.addEventListener("keydown",function(t){"Tab"!==t.key&&9!==t.keyCode||(t.shiftKey?document.activeElement===o&&(n.focus(),t.preventDefault()):document.activeElement===n&&(o.focus(),t.preventDefault()))})}}})}();const{callbacks:l,state:s}=n("activitypub/reactions",{actions:{async fetchReactions(){const o=e(),{namespace:n}=t();if(o.postId)try{o.reactions=await c({path:`/${n}/posts/${o.postId}/reactions`})}catch(t){console.error("Error fetching reactions:",t)}}},callbacks:{initReactions(){const t=new ResizeObserver(a(l.calculateVisibleAvatars));return o().ref.querySelectorAll(".reaction-group").forEach(e=>{t.observe(e)}),()=>{t.disconnect()}},calculateVisibleAvatars(){const{postId:t}=e();(s.reactions&&s.reactions[t]?Object.keys(s.reactions[t]):[]).forEach(e=>{s.reactions?.[t][e]?.items?.length&&o().ref.querySelectorAll(`.reaction-group[data-reaction-type="${e}"]`).forEach(o=>{const n=o.querySelector(".reaction-label").offsetWidth||0,a=o.offsetWidth-n-12;let c=1;a>32&&(c+=Math.floor((a-32)/22));const l=s.reactions[t][e].items,i=Math.min(c,l.length),r=o.querySelector(".reaction-avatars");r&&r.querySelectorAll("li").forEach((t,e)=>{e array('@wordpress/interactivity'), 'version' => '219b38d5a72506d5d5bb', 'type' => 'module');
+ array('@wordpress/interactivity'), 'version' => 'bb8eb819b949d4c63e53', 'type' => 'module');
diff --git a/build/remote-reply/view.js b/build/remote-reply/view.js
index 285426addb..aed57a024a 100644
--- a/build/remote-reply/view.js
+++ b/build/remote-reply/view.js
@@ -1,760 +1 @@
-import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity";
-/******/ var __webpack_modules__ = ({
-
-/***/ "./src/remote-reply/style.scss":
-/*!*************************************!*\
- !*** ./src/remote-reply/style.scss ***!
- \*************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-// extracted by mini-css-extract-plugin
-
-
-/***/ }),
-
-/***/ "./src/remote-reply/view.js":
-/*!**********************************!*\
- !*** ./src/remote-reply/view.js ***!
- \**********************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/interactivity */ "@wordpress/interactivity");
-/* harmony import */ var _shared_modal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/modal */ "./src/shared/modal/index.js");
-/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ "./src/remote-reply/style.scss");
-
-
-
-
-/** @var {object} wp WordPress global. */
-const {
- apiFetch
-} = window.wp;
-(0,_shared_modal__WEBPACK_IMPORTED_MODULE_1__.createModalStore)('activitypub/remote-reply');
-
-/**
- * @typedef {Object} config
- * @property {String} namespace ActivityPub REST Namespace.
- * @property {Object} i18n Internationalization strings.
- * @property {String} i18n.copy "Copy" button text.
- * @property {String} i18n.copied "Copied" button text.
- * @property {String} i18n.emptyProfileError Error message for empty remote profile.
- * @property {String} i18n.invalidProfileError Error message for invalid remote profile.
- * @property {String} i18n.genericError Generic error message.
- */
-
-/**
- * @typedef {Object} context
- * @property {String} blockId The block ID.
- * @property {String} commentId The comment ID.
- * @property {String} commentURL The comment URL.
- * @property {String} copyButtonText The copy button text.
- * @property {String} errorMessage The error message.
- * @property {boolean} isError Whether there is an error.
- * @property {boolean} isLoading Whether the remote profile is being submitted.
- * @property {Object} modal The modal state.
- * @property {boolean} modal.isOpen Whether the modal is open.
- * @property {String} remoteProfile The remote profile.
- * @property {boolean} shouldSaveProfile Whether to save the profile.
- */
-
-const {
- actions,
- callbacks,
- state
-} = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.store)('activitypub/remote-reply', {
- state: {
- /**
- * Get the remote profile URL.
- *
- * @returns {String} The remote profile URL.
- */
- get remoteProfileUrl() {
- const {
- commentURL
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- return state.template.replace('{uri}', encodeURIComponent(commentURL));
- }
- },
- actions: {
- /**
- * Handle the opening of the modal.
- *
- * @param {Event} event The event that triggered the modal opening/closing.
- * @param {String} event.key The key pressed, if any.
- */
- onReplyLinkKeydown(event) {
- // Handle Enter key to open the modal.
- if (event.key === 'Enter' || event.key === ' ') {
- event.preventDefault();
- actions.toggleModal(event);
- }
- },
- /**
- * Copy the comment URL to the clipboard.
- */
- copyToClipboard() {
- const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- const {
- i18n
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getConfig)();
-
- // Use the Clipboard API to copy text.
- navigator.clipboard.writeText(context.commentURL).then(() => {
- // Update button text to show success.
- context.copyButtonText = i18n.copied;
-
- // Reset button text after 1 second.
- setTimeout(() => {
- context.copyButtonText = i18n.copy;
- }, 1000);
- }, error => {
- // Log error if copying fails.
- console.error('Could not copy text: ', error);
- });
- },
- /**
- * Update the remote profile value.
- *
- * @param {Event} event Input event.
- * @param {String} event.target.value The remote profile value.
- */
- updateRemoteProfile(event) {
- const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- context.remoteProfile = event.target.value;
-
- // Reset error state when input changes.
- context.isError = false;
- context.errorMessage = '';
- },
- /**
- * Handle keydown event for remote profile input.
- *
- * @param {Event} event Keydown event.
- * @param {String} event.key Key pressed.
- */
- onInputKeydown(event) {
- if (event.key === 'Enter') {
- event.preventDefault();
- return actions.submitRemoteProfile();
- }
- },
- /**
- * Submit the remote profile.
- */
- *submitRemoteProfile() {
- const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- const {
- namespace,
- i18n
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getConfig)();
- const profileURL = context.remoteProfile.trim();
-
- // Validate input.
- if (!profileURL) {
- context.isError = true;
- context.errorMessage = i18n.emptyProfileError;
- return;
- }
- if (!callbacks.isHandle(profileURL) && !callbacks.isUrl(profileURL)) {
- context.isError = true;
- context.errorMessage = i18n.invalidProfileError;
- return;
- }
-
- // Set loading state.
- context.isLoading = true;
- context.isError = false;
- context.errorMessage = '';
-
- // Construct the API path.
- const path = `/${namespace}/comments/${context.commentId}/remote-reply?resource=${encodeURIComponent(profileURL)}`;
- try {
- // Make the API request.
- const {
- template,
- url
- } = yield apiFetch({
- path
- });
-
- // Set opening state.
- context.isLoading = false;
-
- // Open the remote reply URL in a new tab.
- window.open(url, '_blank');
-
- // Close the modal after opening the URL.
- actions.closeModal();
-
- // Save the remote user if the remember option is checked.
- if (context.shouldSaveProfile) {
- callbacks.setStore({
- profileURL,
- template
- });
- Object.assign(state, {
- hasRemoteUser: true,
- profileURL,
- template
- });
- }
- } catch (error) {
- // Handle error.
- console.error('Error submitting profile:', error);
- context.isLoading = false;
- context.isError = true;
- context.errorMessage = error.message || i18n.genericError;
- }
- },
- /**
- * Toggle the remember profile checkbox.
- */
- toggleRememberProfile() {
- const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- context.shouldSaveProfile = !context.shouldSaveProfile;
- },
- /**
- * Delete the saved remote user profile.
- */
- deleteRemoteUser() {
- callbacks.deleteStore();
- state.hasRemoteUser = false;
- state.profileURL = '';
- state.template = '';
- }
- },
- callbacks: {
- /**
- * The storage key for the remote user data.
- */
- storageKey: 'fediverse-remote-user',
- /**
- * Initialize the component.
- */
- init() {
- const {
- profileURL,
- template
- } = callbacks.getStore();
-
- // Set the remote user data from localStorage if available.
- if (profileURL && template) {
- Object.assign(state, {
- hasRemoteUser: true,
- profileURL,
- template
- });
- }
- },
- /**
- * Retrieve the remote user data from localStorage.
- *
- * @returns {Object} Remote user data or empty object, if not set.
- */
- getStore() {
- const data = localStorage.getItem(callbacks.storageKey);
- return data ? JSON.parse(data) : {};
- },
- /**
- * Store remote user data in localStorage.
- *
- * @param {Object} data - Remote user data to store.
- */
- setStore(data) {
- localStorage.setItem(callbacks.storageKey, JSON.stringify(data));
- },
- /**
- * Remove remote user data from localStorage.
- */
- deleteStore() {
- localStorage.removeItem(callbacks.storageKey);
- },
- /**
- * Best guess whether a string is a valid ActivityPub handle.
- *
- * @param {string} string - String to check.
- * @returns {boolean} True if string is a valid handle, false otherwise.
- */
- isHandle(string) {
- // Check if the string starts with '@' and contains a valid URL.
- const parts = string.replace(/^@/, '').split('@');
- return parts.length === 2 && callbacks.isUrl(`https://${parts[1]}`);
- },
- /**
- * Checks if a string is a valid URL.
- *
- * @param {string} string - String to check.
- * @returns {boolean} True if string is a valid URL, false otherwise.
- */
- isUrl(string) {
- try {
- new URL(string);
- return true;
- } catch (_) {
- return false;
- }
- }
- }
-});
-
-/***/ }),
-
-/***/ "./src/shared/modal/index.js":
-/*!***********************************!*\
- !*** ./src/shared/modal/index.js ***!
- \***********************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ createModalStore: () => (/* binding */ createModalStore)
-/* harmony export */ });
-/* harmony import */ var _wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/interactivity */ "@wordpress/interactivity");
-
-
-/**
- * @typedef {Object} context
- * @property {String} blockId - The ID of the block.
- * @property {Object} modal - The modal state.
- * @property {boolean} modal.isOpen - Whether the modal is open.
- * @property {boolean} modal.isCompact - Whether the modal is compact.
- */
-
-/**
- * Set up a modal store with actions and callbacks.
- *
- * The Interactivity API merges all stores that share the same namespace,
- * so these actions and callbacks are added directly to the importing block’s existing store.
- *
- * @param {string} namespace - The interactivity namespace for the block.
- */
-function createModalStore(namespace) {
- const {
- actions,
- callbacks
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.store)(namespace, {
- actions: {
- /**
- * Open the modal.
- *
- * @param {Event} event Click event.
- */
- openModal(event) {
- const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
-
- // Set modal properties
- context.modal.isOpen = true;
- if (context.modal.isCompact) {
- // Position the compact modal relative to the button.
- setTimeout(callbacks.positionModal, 0);
- } else {
- // Set up the focus trap after modal is open.
- setTimeout(() => {
- // Use the blockId to find the specific modal frame for this block
- const blockWrapper = document.getElementById(context.blockId);
- if (blockWrapper) {
- const modalFrame = blockWrapper.querySelector('.activitypub-modal__frame');
- if (modalFrame) {
- callbacks.trapFocus(modalFrame);
- }
- }
- }, 50);
- }
-
- // Call the onOpen callback if provided.
- if (typeof callbacks.onModalOpen === 'function') {
- callbacks.onModalOpen(event);
- }
- },
- /**
- * Close the modal.
- *
- * @param {Event} event Click event.
- */
- closeModal(event) {
- const context = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
-
- // Reset modal state
- context.modal.isOpen = false;
-
- // Return focus to the button that opened the modal.
- const button = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getElement)();
- if (button.ref.dataset['wpOn-Click'] === 'actions.toggleModal') {
- button.ref.focus();
- } else {
- const blockWrapper = document.getElementById(context.blockId);
- if (blockWrapper) {
- const openButton = blockWrapper.querySelector('[data-wp-on--click="actions.toggleModal"], [data-wp-on-async--click="actions.toggleModal"]');
- if (openButton) {
- openButton.focus();
- }
- }
- }
-
- // Call the onClose callback if provided.
- if (typeof callbacks.onModalClose === 'function') {
- callbacks.onModalClose(event);
- }
- },
- /**
- * Toggle the modal.
- *
- * @param {Event} event Click event.
- */
- toggleModal(event) {
- const {
- modal
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- modal.isOpen ? actions.closeModal(event) : actions.openModal(event);
- }
- },
- callbacks: {
- /**
- * Abort controller for keydown and click event listeners.
- *
- * @type {AbortController | null} Abort controller.
- */
- _abortController: null,
- /**
- * Handles modal effects like body class and event listeners.
- * This is called via data-wp-watch in the modal HTML.
- */
- handleModalEffects() {
- const {
- modal
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
-
- // Update body class.
- if (modal.isOpen && !modal.isCompact) {
- document.body.classList.add('modal-open');
- } else {
- document.body.classList.remove('modal-open');
- }
-
- // Remove all existing listeners.
- if (callbacks._abortController) {
- callbacks._abortController.abort();
- callbacks._abortController = null;
- }
-
- // Add new listeners if modal is open.
- if (modal.isOpen) {
- callbacks._abortController = new AbortController();
- const {
- signal
- } = callbacks._abortController;
- document.addEventListener('keydown', callbacks.documentKeydown, {
- signal
- });
- document.addEventListener('click', callbacks.documentClick, {
- signal
- });
- }
- return undefined;
- },
- /**
- * Handles keydown events on the document.
- *
- * @param {Event} event Keydown event.
- * @param {String} event.key The key that was pressed.
- */
- documentKeydown(event) {
- const {
- modal
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- if (modal.isOpen && event.key === 'Escape') {
- actions.closeModal();
- }
- },
- /**
- * Handles click events on the document.
- *
- * @param {Event} event Click event.
- */
- documentClick(event) {
- const {
- blockId,
- modal
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- if (!modal.isOpen) {
- return;
- }
-
- // Get the block wrapper element.
- const blockWrapper = document.getElementById(blockId);
- if (!blockWrapper) {
- return;
- }
-
- // If the click was on the button or its children, we should not close the modal.
- const toggleButton = blockWrapper.querySelector('.wp-element-button[data-wp-on--click="actions.toggleModal"]');
- if (toggleButton && (toggleButton === event.target || toggleButton.contains(event.target))) {
- return;
- }
-
- // Check if the click was inside the modal frame.
- const modalFrame = blockWrapper.querySelector('.activitypub-modal__frame');
- if (!modalFrame || modalFrame.contains(event.target)) {
- return;
- }
- actions.closeModal();
- },
- /**
- * Positions the modal relative to the button that opened it.
- */
- positionModal() {
- const {
- blockId
- } = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getContext)();
- const blockWrapper = document.getElementById(blockId);
- if (!blockWrapper) {
- return;
- }
- const modalOverlay = blockWrapper.querySelector('.activitypub-modal__overlay');
- if (!modalOverlay) {
- return;
- }
-
- // Reset any previously set positioning.
- modalOverlay.style.top = '';
- modalOverlay.style.left = '';
- modalOverlay.style.right = '';
- modalOverlay.style.bottom = '';
-
- // Get button position relative to viewport.
- const buttonRect = (0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__.getElement)().ref.getBoundingClientRect();
-
- // Get viewport dimensions.
- const viewportWidth = window.innerWidth;
-
- // Get the block's position to calculate relative positioning.
- const blockRect = blockWrapper.getBoundingClientRect();
-
- // Calculate position relative to the block (our positioning context).
- const relativeTop = buttonRect.bottom - blockRect.top;
- const relativeLeft = buttonRect.left - blockRect.left;
-
- // Calculate available space.
- const spaceRight = viewportWidth - buttonRect.right;
-
- // Default position (below button, relative to the block).
- let position = {
- top: `${relativeTop + 8}px`,
- left: `${relativeLeft - 2}px` // -2 px to account for the button border.
- };
-
- // If not enough space to the right, align with the right edge.
- if (spaceRight < 250) {
- position.left = 'auto';
- position.right = `${blockRect.right - buttonRect.right}px`;
- }
-
- // Apply the position.
- Object.assign(modalOverlay.style, position);
- },
- /**
- * Traps focus within the specified element.
- *
- * @param {Element} element The element to trap focus within.
- */
- trapFocus(element) {
- const focusableElements = element.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]):not([readonly]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])');
- const firstFocusableElement = focusableElements[0];
- const lastFocusableElement = focusableElements[focusableElements.length - 1];
-
- // If the first focusable element is the close button, set initial focus to the next element instead.
- if (firstFocusableElement && firstFocusableElement.classList.contains('activitypub-modal__close') && focusableElements.length > 1) {
- // Set initial focus to the second element, but keep firstFocusableElement as is for tab trapping.
- focusableElements[1].focus();
- } else {
- // Otherwise focus the first element as usual.
- firstFocusableElement.focus();
- }
- element.addEventListener('keydown', function (event) {
- if (event.key !== 'Tab' && event.keyCode !== 9 /* KEYCODE_TAB */) {
- return;
- }
- if (event.shiftKey) {
- /* shift + tab */
- if (document.activeElement === firstFocusableElement) {
- lastFocusableElement.focus();
- event.preventDefault();
- }
- } /* tab */else {
- if (document.activeElement === lastFocusableElement) {
- firstFocusableElement.focus();
- event.preventDefault();
- }
- }
- });
- }
- }
- });
-}
-
-/***/ }),
-
-/***/ "@wordpress/interactivity":
-/*!*******************************************!*\
- !*** external "@wordpress/interactivity" ***!
- \*******************************************/
-/***/ ((module) => {
-
-module.exports = __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__;
-
-/***/ })
-
-/******/ });
-/************************************************************************/
-/******/ // The module cache
-/******/ var __webpack_module_cache__ = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/ // Check if module is in cache
-/******/ var cachedModule = __webpack_module_cache__[moduleId];
-/******/ if (cachedModule !== undefined) {
-/******/ return cachedModule.exports;
-/******/ }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = __webpack_module_cache__[moduleId] = {
-/******/ // no module.id needed
-/******/ // no module.loaded needed
-/******/ exports: {}
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/******/ // expose the modules object (__webpack_modules__)
-/******/ __webpack_require__.m = __webpack_modules__;
-/******/
-/************************************************************************/
-/******/ /* webpack/runtime/chunk loaded */
-/******/ (() => {
-/******/ var deferred = [];
-/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
-/******/ if(chunkIds) {
-/******/ priority = priority || 0;
-/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
-/******/ deferred[i] = [chunkIds, fn, priority];
-/******/ return;
-/******/ }
-/******/ var notFulfilled = Infinity;
-/******/ for (var i = 0; i < deferred.length; i++) {
-/******/ var [chunkIds, fn, priority] = deferred[i];
-/******/ var fulfilled = true;
-/******/ for (var j = 0; j < chunkIds.length; j++) {
-/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
-/******/ chunkIds.splice(j--, 1);
-/******/ } else {
-/******/ fulfilled = false;
-/******/ if(priority < notFulfilled) notFulfilled = priority;
-/******/ }
-/******/ }
-/******/ if(fulfilled) {
-/******/ deferred.splice(i--, 1)
-/******/ var r = fn();
-/******/ if (r !== undefined) result = r;
-/******/ }
-/******/ }
-/******/ return result;
-/******/ };
-/******/ })();
-/******/
-/******/ /* webpack/runtime/define property getters */
-/******/ (() => {
-/******/ // define getter functions for harmony exports
-/******/ __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 */
-/******/ (() => {
-/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
-/******/ })();
-/******/
-/******/ /* webpack/runtime/make namespace object */
-/******/ (() => {
-/******/ // define __esModule on 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/export webpack runtime */
-/******/ var __webpack_require_temp__ = __webpack_require__;
-/******/ export { __webpack_require_temp__ as __webpack_require__ };
-/******/
-/******/ /* webpack/runtime/import chunk loading */
-/******/ (() => {
-/******/ // no baseURI
-/******/
-/******/ // object to store loaded and loading chunks
-/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
-/******/ // [resolve, Promise] = chunk loading, 0 = chunk loaded
-/******/ var installedChunks = {
-/******/ "remote-reply/view": 0,
-/******/ "remote-reply/style-view": 0
-/******/ };
-/******/
-/******/ var installChunk = (data) => {
-/******/ var {__webpack_esm_ids__, __webpack_esm_modules__, __webpack_esm_runtime__} = data;
-/******/ // add "modules" to the modules object,
-/******/ // then flag all "ids" as loaded and fire callback
-/******/ var moduleId, chunkId, i = 0;
-/******/ for(moduleId in __webpack_esm_modules__) {
-/******/ if(__webpack_require__.o(__webpack_esm_modules__, moduleId)) {
-/******/ __webpack_require__.m[moduleId] = __webpack_esm_modules__[moduleId];
-/******/ }
-/******/ }
-/******/ if(__webpack_esm_runtime__) __webpack_esm_runtime__(__webpack_require__);
-/******/ for(;i < __webpack_esm_ids__.length; i++) {
-/******/ chunkId = __webpack_esm_ids__[i];
-/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
-/******/ installedChunks[chunkId][0]();
-/******/ }
-/******/ installedChunks[__webpack_esm_ids__[i]] = 0;
-/******/ }
-/******/ __webpack_require__.O();
-/******/ }
-/******/
-/******/ // no chunk on demand loading
-/******/
-/******/ // no prefetching
-/******/
-/******/ // no preloaded
-/******/
-/******/ __webpack_require__.C = installChunk;
-/******/
-/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
-/******/ // no HMR
-/******/
-/******/ // no HMR manifest
-/******/ })();
-/******/
-/************************************************************************/
-/******/
-/******/
-/******/ // startup
-/******/ // Load entry module and return exports
-/******/ // This entry module depends on other loaded chunks and execution need to be delayed
-/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["remote-reply/style-view"], () => (__webpack_require__("./src/remote-reply/view.js")))
-/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
-/******/
-
-//# sourceMappingURL=view.js.map
\ No newline at end of file
+import{getConfig as e,getContext as t,getElement as o,store as r}from"@wordpress/interactivity";var n,l={764:()=>{const{apiFetch:n}=window.wp;!function(){const{actions:e,callbacks:n}=r("activitypub/remote-reply",{actions:{openModal(e){const o=t();o.modal.isOpen=!0,o.modal.isCompact?setTimeout(n.positionModal,0):setTimeout(()=>{const e=document.getElementById(o.blockId);if(e){const t=e.querySelector(".activitypub-modal__frame");t&&n.trapFocus(t)}},50),"function"==typeof n.onModalOpen&&n.onModalOpen(e)},closeModal(e){const r=t();r.modal.isOpen=!1;const l=o();if("actions.toggleModal"===l.ref.dataset["wpOn-Click"])l.ref.focus();else{const e=document.getElementById(r.blockId);if(e){const t=e.querySelector('[data-wp-on--click="actions.toggleModal"], [data-wp-on-async--click="actions.toggleModal"]');t&&t.focus()}}"function"==typeof n.onModalClose&&n.onModalClose(e)},toggleModal(o){const{modal:r}=t();r.isOpen?e.closeModal(o):e.openModal(o)}},callbacks:{_abortController:null,handleModalEffects(){const{modal:e}=t();if(e.isOpen&&!e.isCompact?document.body.classList.add("modal-open"):document.body.classList.remove("modal-open"),n._abortController&&(n._abortController.abort(),n._abortController=null),e.isOpen){n._abortController=new AbortController;const{signal:e}=n._abortController;document.addEventListener("keydown",n.documentKeydown,{signal:e}),document.addEventListener("click",n.documentClick,{signal:e})}},documentKeydown(o){const{modal:r}=t();r.isOpen&&"Escape"===o.key&&e.closeModal()},documentClick(o){const{blockId:r,modal:n}=t();if(!n.isOpen)return;const l=document.getElementById(r);if(!l)return;const s=l.querySelector('.wp-element-button[data-wp-on--click="actions.toggleModal"]');if(s&&(s===o.target||s.contains(o.target)))return;const a=l.querySelector(".activitypub-modal__frame");a&&!a.contains(o.target)&&e.closeModal()},positionModal(){const{blockId:e}=t(),r=document.getElementById(e);if(!r)return;const n=r.querySelector(".activitypub-modal__overlay");if(!n)return;n.style.top="",n.style.left="",n.style.right="",n.style.bottom="";const l=o().ref.getBoundingClientRect(),s=window.innerWidth,a=r.getBoundingClientRect();let i={top:l.bottom-a.top+8+"px",left:l.left-a.left-2+"px"};s-l.right<250&&(i.left="auto",i.right=a.right-l.right+"px"),Object.assign(n.style,i)},trapFocus(e){const t=e.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]):not([readonly]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),o=t[0],r=t[t.length-1];o&&o.classList.contains("activitypub-modal__close")&&t.length>1?t[1].focus():o.focus(),e.addEventListener("keydown",function(e){"Tab"!==e.key&&9!==e.keyCode||(e.shiftKey?document.activeElement===o&&(r.focus(),e.preventDefault()):document.activeElement===r&&(o.focus(),e.preventDefault()))})}}})}();const{actions:l,callbacks:s,state:a}=r("activitypub/remote-reply",{state:{get remoteProfileUrl(){const{commentURL:e}=t();return a.template.replace("{uri}",encodeURIComponent(e))}},actions:{onReplyLinkKeydown(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),l.toggleModal(e))},copyToClipboard(){const o=t(),{i18n:r}=e();navigator.clipboard.writeText(o.commentURL).then(()=>{o.copyButtonText=r.copied,setTimeout(()=>{o.copyButtonText=r.copy},1e3)},e=>{console.error("Could not copy text: ",e)})},updateRemoteProfile(e){const o=t();o.remoteProfile=e.target.value,o.isError=!1,o.errorMessage=""},onInputKeydown(e){if("Enter"===e.key)return e.preventDefault(),l.submitRemoteProfile()},*submitRemoteProfile(){const o=t(),{namespace:r,i18n:i}=e(),c=o.remoteProfile.trim();if(!c)return o.isError=!0,void(o.errorMessage=i.emptyProfileError);if(!s.isHandle(c)&&!s.isUrl(c))return o.isError=!0,void(o.errorMessage=i.invalidProfileError);o.isLoading=!0,o.isError=!1,o.errorMessage="";const d=`/${r}/comments/${o.commentId}/remote-reply?resource=${encodeURIComponent(c)}`;try{const{template:e,url:t}=yield n({path:d});o.isLoading=!1,window.open(t,"_blank"),l.closeModal(),o.shouldSaveProfile&&(s.setStore({profileURL:c,template:e}),Object.assign(a,{hasRemoteUser:!0,profileURL:c,template:e}))}catch(e){console.error("Error submitting profile:",e),o.isLoading=!1,o.isError=!0,o.errorMessage=e.message||i.genericError}},toggleRememberProfile(){const e=t();e.shouldSaveProfile=!e.shouldSaveProfile},deleteRemoteUser(){s.deleteStore(),a.hasRemoteUser=!1,a.profileURL="",a.template=""}},callbacks:{storageKey:"fediverse-remote-user",init(){const{profileURL:e,template:t}=s.getStore();e&&t&&Object.assign(a,{hasRemoteUser:!0,profileURL:e,template:t})},getStore(){const e=localStorage.getItem(s.storageKey);return e?JSON.parse(e):{}},setStore(e){localStorage.setItem(s.storageKey,JSON.stringify(e))},deleteStore(){localStorage.removeItem(s.storageKey)},isHandle(e){const t=e.replace(/^@/,"").split("@");return 2===t.length&&s.isUrl(`https://${t[1]}`)},isUrl(e){try{return new URL(e),!0}catch(e){return!1}}}})}},s={};function a(e){var t=s[e];if(void 0!==t)return t.exports;var o=s[e]={exports:{}};return l[e](o,o.exports,a),o.exports}a.m=l,n=[],a.O=(e,t,o,r)=>{if(!t){var l=1/0;for(d=0;d=r)&&Object.keys(a.O).every(e=>a.O[e](t[i]))?t.splice(i--,1):(s=!1,r0&&n[d-1][2]>r;d--)n[d]=n[d-1];n[d]=[t,o,r]},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i,c=a;export{c as __webpack_require__};i={466:0,354:0},a.C=e=>{var t,o,{__webpack_esm_ids__:r,__webpack_esm_modules__:n,__webpack_esm_runtime__:l}=e,s=0;for(t in n)a.o(n,t)&&(a.m[t]=n[t]);for(l&&l(a);s0===i[e];var d=a.O(void 0,[354],()=>a(764));d=a.O(d);
\ No newline at end of file
diff --git a/build/reply-intent/plugin.asset.php b/build/reply-intent/plugin.asset.php
index 5a003ec4c0..2bb3bb5fa4 100644
--- a/build/reply-intent/plugin.asset.php
+++ b/build/reply-intent/plugin.asset.php
@@ -1 +1 @@
- array('wp-block-editor', 'wp-blocks', 'wp-data', 'wp-element', 'wp-plugins'), 'version' => 'a0ec149271af9882bd8b');
+ array('wp-block-editor', 'wp-blocks', 'wp-data', 'wp-element', 'wp-plugins'), 'version' => 'ee563d746b20aabb037a');
diff --git a/build/reply-intent/plugin.js b/build/reply-intent/plugin.js
index d8cc69f81b..b0183a39b7 100644
--- a/build/reply-intent/plugin.js
+++ b/build/reply-intent/plugin.js
@@ -1,181 +1 @@
-/******/ (() => { // webpackBootstrap
-/******/ "use strict";
-/******/ var __webpack_modules__ = ({
-
-/***/ "@wordpress/block-editor":
-/*!*************************************!*\
- !*** external ["wp","blockEditor"] ***!
- \*************************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["blockEditor"];
-
-/***/ }),
-
-/***/ "@wordpress/blocks":
-/*!********************************!*\
- !*** external ["wp","blocks"] ***!
- \********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["blocks"];
-
-/***/ }),
-
-/***/ "@wordpress/data":
-/*!******************************!*\
- !*** external ["wp","data"] ***!
- \******************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["data"];
-
-/***/ }),
-
-/***/ "@wordpress/element":
-/*!*********************************!*\
- !*** external ["wp","element"] ***!
- \*********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["element"];
-
-/***/ }),
-
-/***/ "@wordpress/plugins":
-/*!*********************************!*\
- !*** external ["wp","plugins"] ***!
- \*********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["plugins"];
-
-/***/ })
-
-/******/ });
-/************************************************************************/
-/******/ // The module cache
-/******/ var __webpack_module_cache__ = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/ // Check if module is in cache
-/******/ var cachedModule = __webpack_module_cache__[moduleId];
-/******/ if (cachedModule !== undefined) {
-/******/ return cachedModule.exports;
-/******/ }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = __webpack_module_cache__[moduleId] = {
-/******/ // no module.id needed
-/******/ // no module.loaded needed
-/******/ exports: {}
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/************************************************************************/
-/******/ /* webpack/runtime/compat get default export */
-/******/ (() => {
-/******/ // getDefaultExport function for compatibility with non-harmony modules
-/******/ __webpack_require__.n = (module) => {
-/******/ var getter = module && module.__esModule ?
-/******/ () => (module['default']) :
-/******/ () => (module);
-/******/ __webpack_require__.d(getter, { a: getter });
-/******/ return getter;
-/******/ };
-/******/ })();
-/******/
-/******/ /* webpack/runtime/define property getters */
-/******/ (() => {
-/******/ // define getter functions for harmony exports
-/******/ __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 */
-/******/ (() => {
-/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
-/******/ })();
-/******/
-/******/ /* webpack/runtime/make namespace object */
-/******/ (() => {
-/******/ // define __esModule on exports
-/******/ __webpack_require__.r = (exports) => {
-/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
-/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
-/******/ }
-/******/ Object.defineProperty(exports, '__esModule', { value: true });
-/******/ };
-/******/ })();
-/******/
-/************************************************************************/
-var __webpack_exports__ = {};
-// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
-(() => {
-/*!************************************!*\
- !*** ./src/reply-intent/plugin.js ***!
- \************************************/
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/plugins */ "@wordpress/plugins");
-/* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_plugins__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
-/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
-/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__);
-
-
-
-
-
-
-// We use a kind of global state to ensure only a single embed is rendered across component re-renders.
-let didHandleEmbed = false;
-const HandleReplyIntent = () => {
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
- if (didHandleEmbed) {
- return;
- }
- // Get the GET['in_reply_to'] value from the URL
- const urlParams = new URLSearchParams(window.location.search);
- const inReplyTo = urlParams.get('in_reply_to');
- if (inReplyTo && !didHandleEmbed) {
- // prepend an activitypub/reply block to the editor
- // it appears to need a slight delay
- setTimeout(() => {
- const block = (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.createBlock)('activitypub/reply', {
- url: inReplyTo,
- embedPost: true
- });
- const store = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.dispatch)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.store);
- store.insertBlock(block);
- // add a new block after it so the user can just type
- store.insertAfterBlock(block.clientId);
- }, 200);
- }
- didHandleEmbed = true;
- });
- return null;
-};
-(0,_wordpress_plugins__WEBPACK_IMPORTED_MODULE_0__.registerPlugin)('activitypub-reply-intent', {
- render: HandleReplyIntent
-});
-})();
-
-/******/ })()
-;
-//# sourceMappingURL=plugin.js.map
\ No newline at end of file
+(()=>{"use strict";const e=window.wp.plugins,t=window.wp.blocks,i=window.wp.data,n=window.wp.blockEditor,o=window.wp.element;let r=!1;(0,e.registerPlugin)("activitypub-reply-intent",{render:()=>((0,o.useEffect)(()=>{if(r)return;const e=new URLSearchParams(window.location.search).get("in_reply_to");e&&!r&&setTimeout(()=>{const o=(0,t.createBlock)("activitypub/reply",{url:e,embedPost:!0}),r=(0,i.dispatch)(n.store);r.insertBlock(o),r.insertAfterBlock(o.clientId)},200),r=!0}),null)})})();
\ No newline at end of file
diff --git a/build/reply/index-rtl.css b/build/reply/index-rtl.css
index c04d0763a0..6ee6d1b0ae 100644
--- a/build/reply/index-rtl.css
+++ b/build/reply/index-rtl.css
@@ -1,223 +1 @@
-/*!**********************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/reply/editor.scss ***!
- \**********************************************************************************************************************************************************************************************************************************************/
-.activitypub-embed-container {
- position: relative;
- min-height: 100px;
- pointer-events: none;
- -webkit-user-select: none;
- -moz-user-select: none;
- user-select: none;
-}
-
-.activitypub-embed-loading {
- display: flex;
- justify-content: center;
- align-items: center;
-}
-
-.activitypub-embed-container .wp-block-embed {
- pointer-events: none !important;
-}
-
-.activitypub-embed-preview {
- pointer-events: none;
-}
-
-.activitypub-embed-preview iframe {
- pointer-events: none;
-}
-
-.activitypub-reply-display {
- margin: 1em 0;
-}
-
-.activitypub-reply-display p {
- margin: 0;
-}
-
-.activitypub-reply-display a {
- color: #2271b1;
- text-decoration: none;
-}
-
-.activitypub-reply-display a:hover {
- color: #135e96;
- text-decoration: underline;
-}
-
-/**
- * ActivityPub embed styles.
- */
-
-.activitypub-embed {
- background: #fff;
- border: 1px solid #e6e6e6;
- border-radius: 12px;
- padding: 0;
- max-width: 100%;
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
-}
-
-.activitypub-reply-block .activitypub-embed {
- margin: 1em 0;
-}
-
-.activitypub-embed-header {
- padding: 15px;
- display: flex;
- align-items: center;
- gap: 10px;
-}
-
-.activitypub-embed-header img {
- width: 48px;
- height: 48px;
- border-radius: 50%;
-}
-
-.activitypub-embed-header-text {
- flex-grow: 1;
-}
-
-.activitypub-embed-header-text h2 {
- color: #000;
- font-size: 15px;
- font-weight: 600;
- margin: 0;
- padding: 0;
-}
-
-.activitypub-embed-header-text .ap-account {
- color: #687684;
- font-size: 14px;
- text-decoration: none;
-}
-
-.activitypub-embed-content {
- padding: 0 15px 15px;
-}
-
-.activitypub-embed-content .ap-title {
- font-size: 23px;
- font-weight: 600;
- margin: 0 0 10px;
- padding: 0;
- color: #000;
-}
-
-.activitypub-embed-content .ap-subtitle {
- font-size: 15px;
- color: #000;
- margin: 0 0 15px;
-}
-
-.activitypub-embed-content .ap-preview {
- border: 1px solid #e6e6e6;
- border-radius: 8px;
- overflow: hidden;
-}
-
-.activitypub-embed-content .ap-preview img {
- width: 100%;
- height: auto;
- display: block;
-}
-
-.activitypub-embed-content .ap-preview {
- border-radius: 8px;
- box-sizing: border-box;
- display: grid;
- gap: 2px;
- grid-template-columns: 1fr 1fr;
- grid-template-rows: 1fr 1fr;
- margin: 1em 0 0;
- min-height: 64px;
- overflow: hidden;
- position: relative;
- width: 100%;
-}
-
-.activitypub-embed-content .ap-preview.layout-1 {
- grid-template-columns: 1fr;
- grid-template-rows: 1fr;
-}
-
-.activitypub-embed-content .ap-preview.layout-2 {
- aspect-ratio: auto;
- grid-template-rows: 1fr;
- height: auto;
-}
-
-.activitypub-embed-content .ap-preview.layout-3 > img:first-child {
- grid-row: span 2;
-}
-
-.activitypub-embed-content .ap-preview img {
- border: 0;
- box-sizing: border-box;
- display: inline-block;
- height: 100%;
- -o-object-fit: cover;
- object-fit: cover;
- overflow: hidden;
- position: relative;
- width: 100%;
-}
-
-.activitypub-embed-content .ap-preview video,
-.activitypub-embed-content .ap-preview audio {
- max-width: 100%;
- display: block;
- grid-column: 1/span 2;
-}
-
-.activitypub-embed-content .ap-preview audio {
- width: 100%;
-}
-
-.activitypub-embed-content .ap-preview-text {
- padding: 15px;
-}
-
-.activitypub-embed-meta {
- padding: 15px;
- border-top: 1px solid #e6e6e6;
- color: #687684;
- font-size: 13px;
- display: flex;
- gap: 15px;
-}
-
-.activitypub-embed-meta .ap-stat {
- display: flex;
- align-items: center;
- gap: 5px;
-}
-
-@media only screen and (max-width: 399px) {
- .activitypub-embed-meta span.ap-stat {
- display: none !important;
- }
-}
-
-.activitypub-embed-meta a.ap-stat {
- color: inherit;
- text-decoration: none;
-}
-
-.activitypub-embed-meta strong {
- font-weight: 600;
- color: #000;
-}
-
-.activitypub-embed-meta .ap-stat-label {
- color: #687684;
-}
-
-.wp-block-activitypub-reply .components-spinner {
- margin-top: 0;
- margin-bottom: 0;
- width: 12px;
- height: 12px;
-}
+.activitypub-embed-container{min-height:100px;pointer-events:none;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.activitypub-embed-loading{align-items:center;display:flex;justify-content:center}.activitypub-embed-container .wp-block-embed{pointer-events:none!important}.activitypub-embed-preview,.activitypub-embed-preview iframe{pointer-events:none}.activitypub-reply-display{margin:1em 0}.activitypub-reply-display p{margin:0}.activitypub-reply-display a{color:#2271b1;text-decoration:none}.activitypub-reply-display a:hover{color:#135e96;text-decoration:underline}.activitypub-embed{background:#fff;border:1px solid #e6e6e6;border-radius:12px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;max-width:100%;padding:0}.activitypub-reply-block .activitypub-embed{margin:1em 0}.activitypub-embed-header{align-items:center;display:flex;gap:10px;padding:15px}.activitypub-embed-header img{border-radius:50%;height:48px;width:48px}.activitypub-embed-header-text{flex-grow:1}.activitypub-embed-header-text h2{color:#000;font-size:15px;font-weight:600;margin:0;padding:0}.activitypub-embed-header-text .ap-account{color:#687684;font-size:14px;text-decoration:none}.activitypub-embed-content{padding:0 15px 15px}.activitypub-embed-content .ap-title{color:#000;font-size:23px;font-weight:600;margin:0 0 10px;padding:0}.activitypub-embed-content .ap-subtitle{color:#000;font-size:15px;margin:0 0 15px}.activitypub-embed-content .ap-preview{border:1px solid #e6e6e6}.activitypub-embed-content .ap-preview img{display:block;height:auto}.activitypub-embed-content .ap-preview{border-radius:8px;box-sizing:border-box;display:grid;gap:2px;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;margin:1em 0 0;min-height:64px;overflow:hidden;position:relative;width:100%}.activitypub-embed-content .ap-preview.layout-1{grid-template-columns:1fr;grid-template-rows:1fr}.activitypub-embed-content .ap-preview.layout-2{aspect-ratio:auto;grid-template-rows:1fr;height:auto}.activitypub-embed-content .ap-preview.layout-3>img:first-child{grid-row:span 2}.activitypub-embed-content .ap-preview img{border:0;box-sizing:border-box;display:inline-block;height:100%;-o-object-fit:cover;object-fit:cover;overflow:hidden;position:relative;width:100%}.activitypub-embed-content .ap-preview audio,.activitypub-embed-content .ap-preview video{display:block;grid-column:1/span 2;max-width:100%}.activitypub-embed-content .ap-preview audio{width:100%}.activitypub-embed-content .ap-preview-text{padding:15px}.activitypub-embed-meta{border-top:1px solid #e6e6e6;color:#687684;display:flex;font-size:13px;gap:15px;padding:15px}.activitypub-embed-meta .ap-stat{align-items:center;display:flex;gap:5px}@media only screen and (max-width:399px){.activitypub-embed-meta span.ap-stat{display:none!important}}.activitypub-embed-meta a.ap-stat{color:inherit;text-decoration:none}.activitypub-embed-meta strong{color:#000;font-weight:600}.activitypub-embed-meta .ap-stat-label{color:#687684}.wp-block-activitypub-reply .components-spinner{height:12px;margin-bottom:0;margin-top:0;width:12px}
diff --git a/build/reply/index.asset.php b/build/reply/index.asset.php
index 0504a1ea4d..e40056b538 100644
--- a/build/reply/index.asset.php
+++ b/build/reply/index.asset.php
@@ -1 +1 @@
- array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '7563ea251176a9893ca6');
+ array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '81c54476cf58b65cc4fd');
diff --git a/build/reply/index.css b/build/reply/index.css
index 9d5a0ed037..6ee6d1b0ae 100644
--- a/build/reply/index.css
+++ b/build/reply/index.css
@@ -1,225 +1 @@
-/*!**********************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/reply/editor.scss ***!
- \**********************************************************************************************************************************************************************************************************************************************/
-.activitypub-embed-container {
- position: relative;
- min-height: 100px;
- pointer-events: none;
- -webkit-user-select: none;
- -moz-user-select: none;
- user-select: none;
-}
-
-.activitypub-embed-loading {
- display: flex;
- justify-content: center;
- align-items: center;
-}
-
-.activitypub-embed-container .wp-block-embed {
- pointer-events: none !important;
-}
-
-.activitypub-embed-preview {
- pointer-events: none;
-}
-
-.activitypub-embed-preview iframe {
- pointer-events: none;
-}
-
-.activitypub-reply-display {
- margin: 1em 0;
-}
-
-.activitypub-reply-display p {
- margin: 0;
-}
-
-.activitypub-reply-display a {
- color: #2271b1;
- text-decoration: none;
-}
-
-.activitypub-reply-display a:hover {
- color: #135e96;
- text-decoration: underline;
-}
-
-/**
- * ActivityPub embed styles.
- */
-
-.activitypub-embed {
- background: #fff;
- border: 1px solid #e6e6e6;
- border-radius: 12px;
- padding: 0;
- max-width: 100%;
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
-}
-
-.activitypub-reply-block .activitypub-embed {
- margin: 1em 0;
-}
-
-.activitypub-embed-header {
- padding: 15px;
- display: flex;
- align-items: center;
- gap: 10px;
-}
-
-.activitypub-embed-header img {
- width: 48px;
- height: 48px;
- border-radius: 50%;
-}
-
-.activitypub-embed-header-text {
- flex-grow: 1;
-}
-
-.activitypub-embed-header-text h2 {
- color: #000;
- font-size: 15px;
- font-weight: 600;
- margin: 0;
- padding: 0;
-}
-
-.activitypub-embed-header-text .ap-account {
- color: #687684;
- font-size: 14px;
- text-decoration: none;
-}
-
-.activitypub-embed-content {
- padding: 0 15px 15px;
-}
-
-.activitypub-embed-content .ap-title {
- font-size: 23px;
- font-weight: 600;
- margin: 0 0 10px;
- padding: 0;
- color: #000;
-}
-
-.activitypub-embed-content .ap-subtitle {
- font-size: 15px;
- color: #000;
- margin: 0 0 15px;
-}
-
-.activitypub-embed-content .ap-preview {
- border: 1px solid #e6e6e6;
- border-radius: 8px;
- overflow: hidden;
-}
-
-.activitypub-embed-content .ap-preview img {
- width: 100%;
- height: auto;
- display: block;
-}
-
-.activitypub-embed-content .ap-preview {
- border-radius: 8px;
- box-sizing: border-box;
- display: grid;
- gap: 2px;
- grid-template-columns: 1fr 1fr;
- grid-template-rows: 1fr 1fr;
- margin: 1em 0 0;
- min-height: 64px;
- overflow: hidden;
- position: relative;
- width: 100%;
-}
-
-.activitypub-embed-content .ap-preview.layout-1 {
- grid-template-columns: 1fr;
- grid-template-rows: 1fr;
-}
-
-.activitypub-embed-content .ap-preview.layout-2 {
- aspect-ratio: auto;
- grid-template-rows: 1fr;
- height: auto;
-}
-
-.activitypub-embed-content .ap-preview.layout-3 > img:first-child {
- grid-row: span 2;
-}
-
-.activitypub-embed-content .ap-preview img {
- border: 0;
- box-sizing: border-box;
- display: inline-block;
- height: 100%;
- -o-object-fit: cover;
- object-fit: cover;
- overflow: hidden;
- position: relative;
- width: 100%;
-}
-
-.activitypub-embed-content .ap-preview video,
-.activitypub-embed-content .ap-preview audio {
- max-width: 100%;
- display: block;
- grid-column: 1/span 2;
-}
-
-.activitypub-embed-content .ap-preview audio {
- width: 100%;
-}
-
-.activitypub-embed-content .ap-preview-text {
- padding: 15px;
-}
-
-.activitypub-embed-meta {
- padding: 15px;
- border-top: 1px solid #e6e6e6;
- color: #687684;
- font-size: 13px;
- display: flex;
- gap: 15px;
-}
-
-.activitypub-embed-meta .ap-stat {
- display: flex;
- align-items: center;
- gap: 5px;
-}
-
-@media only screen and (max-width: 399px) {
- .activitypub-embed-meta span.ap-stat {
- display: none !important;
- }
-}
-
-.activitypub-embed-meta a.ap-stat {
- color: inherit;
- text-decoration: none;
-}
-
-.activitypub-embed-meta strong {
- font-weight: 600;
- color: #000;
-}
-
-.activitypub-embed-meta .ap-stat-label {
- color: #687684;
-}
-
-.wp-block-activitypub-reply .components-spinner {
- margin-top: 0;
- margin-bottom: 0;
- width: 12px;
- height: 12px;
-}
-
-/*# sourceMappingURL=index.css.map*/
\ No newline at end of file
+.activitypub-embed-container{min-height:100px;pointer-events:none;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.activitypub-embed-loading{align-items:center;display:flex;justify-content:center}.activitypub-embed-container .wp-block-embed{pointer-events:none!important}.activitypub-embed-preview,.activitypub-embed-preview iframe{pointer-events:none}.activitypub-reply-display{margin:1em 0}.activitypub-reply-display p{margin:0}.activitypub-reply-display a{color:#2271b1;text-decoration:none}.activitypub-reply-display a:hover{color:#135e96;text-decoration:underline}.activitypub-embed{background:#fff;border:1px solid #e6e6e6;border-radius:12px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;max-width:100%;padding:0}.activitypub-reply-block .activitypub-embed{margin:1em 0}.activitypub-embed-header{align-items:center;display:flex;gap:10px;padding:15px}.activitypub-embed-header img{border-radius:50%;height:48px;width:48px}.activitypub-embed-header-text{flex-grow:1}.activitypub-embed-header-text h2{color:#000;font-size:15px;font-weight:600;margin:0;padding:0}.activitypub-embed-header-text .ap-account{color:#687684;font-size:14px;text-decoration:none}.activitypub-embed-content{padding:0 15px 15px}.activitypub-embed-content .ap-title{color:#000;font-size:23px;font-weight:600;margin:0 0 10px;padding:0}.activitypub-embed-content .ap-subtitle{color:#000;font-size:15px;margin:0 0 15px}.activitypub-embed-content .ap-preview{border:1px solid #e6e6e6}.activitypub-embed-content .ap-preview img{display:block;height:auto}.activitypub-embed-content .ap-preview{border-radius:8px;box-sizing:border-box;display:grid;gap:2px;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;margin:1em 0 0;min-height:64px;overflow:hidden;position:relative;width:100%}.activitypub-embed-content .ap-preview.layout-1{grid-template-columns:1fr;grid-template-rows:1fr}.activitypub-embed-content .ap-preview.layout-2{aspect-ratio:auto;grid-template-rows:1fr;height:auto}.activitypub-embed-content .ap-preview.layout-3>img:first-child{grid-row:span 2}.activitypub-embed-content .ap-preview img{border:0;box-sizing:border-box;display:inline-block;height:100%;-o-object-fit:cover;object-fit:cover;overflow:hidden;position:relative;width:100%}.activitypub-embed-content .ap-preview audio,.activitypub-embed-content .ap-preview video{display:block;grid-column:1/span 2;max-width:100%}.activitypub-embed-content .ap-preview audio{width:100%}.activitypub-embed-content .ap-preview-text{padding:15px}.activitypub-embed-meta{border-top:1px solid #e6e6e6;color:#687684;display:flex;font-size:13px;gap:15px;padding:15px}.activitypub-embed-meta .ap-stat{align-items:center;display:flex;gap:5px}@media only screen and (max-width:399px){.activitypub-embed-meta span.ap-stat{display:none!important}}.activitypub-embed-meta a.ap-stat{color:inherit;text-decoration:none}.activitypub-embed-meta strong{color:#000;font-weight:600}.activitypub-embed-meta .ap-stat-label{color:#687684}.wp-block-activitypub-reply .components-spinner{height:12px;margin-bottom:0;margin-top:0;width:12px}
diff --git a/build/reply/index.js b/build/reply/index.js
index c4628a633b..d7dbd5e256 100644
--- a/build/reply/index.js
+++ b/build/reply/index.js
@@ -1,520 +1 @@
-/******/ (() => { // webpackBootstrap
-/******/ "use strict";
-/******/ var __webpack_modules__ = ({
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/comment-reply-link.js":
-/*!**********************************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/comment-reply-link.js ***!
- \**********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ comment_reply_link_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/comment-reply-link.tsx
-
-
-var comment_reply_link_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M6.68822 10.625L6.24878 11.0649L5.5 11.8145L5.5 5.5L12.5 5.5V8L14 6.5V5C14 4.44772 13.5523 4 13 4H5C4.44772 4 4 4.44771 4 5V13.5247C4 13.8173 4.16123 14.086 4.41935 14.2237C4.72711 14.3878 5.10601 14.3313 5.35252 14.0845L7.31 12.125H8.375L9.875 10.625H7.31H6.68822ZM14.5605 10.4983L11.6701 13.75H16.9975C17.9963 13.75 18.7796 14.1104 19.3553 14.7048C19.9095 15.2771 20.2299 16.0224 20.4224 16.7443C20.7645 18.0276 20.7543 19.4618 20.7487 20.2544C20.7481 20.345 20.7475 20.4272 20.7475 20.4999L19.2475 20.5001C19.2475 20.4191 19.248 20.3319 19.2484 20.2394V20.2394C19.2526 19.4274 19.259 18.2035 18.973 17.1307C18.8156 16.5401 18.586 16.0666 18.2778 15.7483C17.9909 15.4521 17.5991 15.25 16.9975 15.25H11.8106L14.5303 17.9697L13.4696 19.0303L8.96956 14.5303L13.4394 9.50171L14.5605 10.4983Z" }) });
-
-//# sourceMappingURL=comment-reply-link.js.map
-
-
-/***/ }),
-
-/***/ "./src/reply/edit.js":
-/*!***************************!*\
- !*** ./src/reply/edit.js ***!
- \***************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Edit)
-/* harmony export */ });
-/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
-/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
-/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__);
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__);
-/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
-/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_6__);
-/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
-/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_7__);
-/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
-/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_8__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__);
-
-
-
-
-
-
-
-
-
-
-/**
- * Help text messages for different reply states.
- */
-
-const HELP_TEXT = {
- default: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Enter the URL of a post from the Fediverse (Mastodon, Pixelfed, etc.) that you want to reply to.', 'activitypub'),
- checking: () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.Fragment, {
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Spinner, {}), ' ' + (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Checking URL...', 'activitypub')]
- }),
- valid: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('The author will be notified of your response.', 'activitypub'),
- error: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('This site doesn\u2019t have ActivityPub enabled and won\u2019t receive your reply.', 'activitypub')
-};
-
-/**
- * Edit component for the ActivityPub Reply block.
- *
- * @param {Object} props - Component props.
- * @param {Object} props.attributes - Block attributes.
- * @param {Function} props.setAttributes - Function to update block attributes.
- * @param {string} props.clientId - Block client ID.
- * @param {boolean} props.isSelected - Whether the block is selected.
- */
-function Edit({
- attributes,
- setAttributes,
- clientId,
- isSelected
-}) {
- const {
- url = '',
- embedPost = false
- } = attributes;
- const [helpText, setHelpText] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(HELP_TEXT.default);
- const [isValidEmbed, setIsValidEmbed] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(false);
- const [isCheckingEmbed, setIsCheckingEmbed] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(false);
- const urlInputRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)();
- const {
- insertAfterBlock,
- removeBlock,
- replaceInnerBlocks
- } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_5__.useDispatch)('core/block-editor');
-
- // Show embed in both selected and non-selected states when embedPost is true.
- const showEmbed = embedPost && !isCheckingEmbed && isValidEmbed;
-
- // Setup inner blocks.
- const innerBlocksProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useInnerBlocksProps)({
- className: 'activitypub-embed-container'
- }, {
- allowedBlocks: ['core/embed'],
- template: url && showEmbed ? [['core/embed', {
- url
- }]] : [],
- templateLock: 'all'
- });
-
- // Update inner blocks when URL, embedPost, or isValidEmbed changes.
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
- if (url && showEmbed) {
- replaceInnerBlocks(clientId, [(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_8__.createBlock)('core/embed', {
- url
- })]);
- } else {
- // Remove all inner blocks if embedding is disabled or URL is not embeddable.
- replaceInnerBlocks(clientId, []);
- }
- }, [url, showEmbed, clientId, replaceInnerBlocks]);
-
- // Update help text based on state changes.
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
- if (!url) {
- setHelpText(HELP_TEXT.default);
- } else if (isCheckingEmbed) {
- setHelpText(HELP_TEXT.checking());
- } else if (isValidEmbed) {
- setHelpText(HELP_TEXT.valid);
- } else {
- setHelpText(HELP_TEXT.error);
- }
- }, [url, isCheckingEmbed, isValidEmbed]);
- const focusInput = () => {
- setTimeout(() => urlInputRef.current?.focus(), 50);
- };
-
- // Check URL when it changes.
- const checkUrl = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(async urlToCheck => {
- if (!urlToCheck) {
- setIsValidEmbed(false);
- return;
- }
- try {
- setIsCheckingEmbed(true);
-
- // Simple URL validation.
- new URL(urlToCheck); // Will throw if invalid.
-
- try {
- /**
- * Fetch the embed information using the WordPress oEmbed API.
- *
- * @typedef {Object} OEmbedResponse
- * @property {string} [provider_name] The name of the oEmbed provider.
- * @property {string} [html] The HTML content to embed.
- * @property {string} [title] The title of the embedded content.
- * @property {string} [author_name] The author of the embedded content.
- * @property {string} [author_url] The URL of the author.
- * @property {number} [width] The width of the embedded content.
- * @property {number} [height] The height of the embedded content.
- * @property {string} [type] The type of the embedded content (rich, video, photo).
- */
- const response = await _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_6___default()({
- path: (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_7__.addQueryArgs)('/oembed/1.0/proxy', {
- url: urlToCheck,
- activitypub: true
- })
- });
- if (response && response.provider_name) {
- setAttributes({
- embedPost: true,
- isValidActivityPub: true
- }); // Auto-enable embedding when we get valid embed info.
- setIsValidEmbed(true);
- } else {
- setAttributes({
- isValidActivityPub: false
- });
- setIsValidEmbed(false);
- }
- } catch (error) {
- console.log('Could not fetch embed:', error);
- setAttributes({
- isValidActivityPub: false
- });
- setIsValidEmbed(false);
- }
- } catch (error) {
- setAttributes({
- isValidActivityPub: false
- });
- setIsValidEmbed(false);
- } finally {
- setIsCheckingEmbed(false);
- }
- }, [embedPost, setAttributes]);
-
- // Debounce the URL check to avoid too many requests.
- const debouncedCheckUrl = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_4__.useDebounce)(checkUrl, 250);
-
- // Check URL when it changes.
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
- if (url) {
- debouncedCheckUrl(url);
- }
- }, [url]);
- const onKeyDown = event => {
- if (event.key === 'Enter') {
- insertAfterBlock(clientId);
- }
- if (!url && ['Backspace', 'Delete'].includes(event.key)) {
- removeBlock(clientId);
- }
- };
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.Fragment, {
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.InspectorControls, {
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelBody, {
- title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Settings', 'activitypub'),
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.ToggleControl, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Embed Post', 'activitypub'),
- checked: !!embedPost,
- onChange: value => setAttributes({
- embedPost: value
- }),
- disabled: !isValidEmbed,
- help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Show embedded content from the URL.', 'activitypub'),
- __nextHasNoMarginBottom: true
- })
- })
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
- onClick: focusInput,
- ...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps)(),
- children: [isSelected && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.TextControl, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Your post is a reply to the following URL', 'activitypub'),
- value: url,
- onChange: value => setAttributes({
- url: value
- }),
- help: helpText,
- onKeyDown: onKeyDown,
- ref: urlInputRef,
- __next40pxDefaultSize: true,
- __nextHasNoMarginBottom: true
- }), showEmbed && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
- ...innerBlocksProps
- }), url && !showEmbed && !isSelected && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
- className: "activitypub-reply-block-editor__preview",
- contentEditable: false,
- onClick: focusInput,
- style: {
- cursor: 'pointer'
- },
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("a", {
- href: url,
- className: "u-in-reply-to",
- target: "_blank",
- rel: "noreferrer",
- children: '↬' + url.replace(/^https?:\/\//, '')
- })
- })]
- })]
- });
-}
-
-/***/ }),
-
-/***/ "./src/reply/editor.scss":
-/*!*******************************!*\
- !*** ./src/reply/editor.scss ***!
- \*******************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-// extracted by mini-css-extract-plugin
-
-
-/***/ }),
-
-/***/ "@wordpress/api-fetch":
-/*!**********************************!*\
- !*** external ["wp","apiFetch"] ***!
- \**********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["apiFetch"];
-
-/***/ }),
-
-/***/ "@wordpress/block-editor":
-/*!*************************************!*\
- !*** external ["wp","blockEditor"] ***!
- \*************************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["blockEditor"];
-
-/***/ }),
-
-/***/ "@wordpress/blocks":
-/*!********************************!*\
- !*** external ["wp","blocks"] ***!
- \********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["blocks"];
-
-/***/ }),
-
-/***/ "@wordpress/components":
-/*!************************************!*\
- !*** external ["wp","components"] ***!
- \************************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["components"];
-
-/***/ }),
-
-/***/ "@wordpress/compose":
-/*!*********************************!*\
- !*** external ["wp","compose"] ***!
- \*********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["compose"];
-
-/***/ }),
-
-/***/ "@wordpress/data":
-/*!******************************!*\
- !*** external ["wp","data"] ***!
- \******************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["data"];
-
-/***/ }),
-
-/***/ "@wordpress/element":
-/*!*********************************!*\
- !*** external ["wp","element"] ***!
- \*********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["element"];
-
-/***/ }),
-
-/***/ "@wordpress/i18n":
-/*!******************************!*\
- !*** external ["wp","i18n"] ***!
- \******************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["i18n"];
-
-/***/ }),
-
-/***/ "@wordpress/primitives":
-/*!************************************!*\
- !*** external ["wp","primitives"] ***!
- \************************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["primitives"];
-
-/***/ }),
-
-/***/ "@wordpress/url":
-/*!*****************************!*\
- !*** external ["wp","url"] ***!
- \*****************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["url"];
-
-/***/ }),
-
-/***/ "react/jsx-runtime":
-/*!**********************************!*\
- !*** external "ReactJSXRuntime" ***!
- \**********************************/
-/***/ ((module) => {
-
-module.exports = window["ReactJSXRuntime"];
-
-/***/ })
-
-/******/ });
-/************************************************************************/
-/******/ // The module cache
-/******/ var __webpack_module_cache__ = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/ // Check if module is in cache
-/******/ var cachedModule = __webpack_module_cache__[moduleId];
-/******/ if (cachedModule !== undefined) {
-/******/ return cachedModule.exports;
-/******/ }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = __webpack_module_cache__[moduleId] = {
-/******/ // no module.id needed
-/******/ // no module.loaded needed
-/******/ exports: {}
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/************************************************************************/
-/******/ /* webpack/runtime/compat get default export */
-/******/ (() => {
-/******/ // getDefaultExport function for compatibility with non-harmony modules
-/******/ __webpack_require__.n = (module) => {
-/******/ var getter = module && module.__esModule ?
-/******/ () => (module['default']) :
-/******/ () => (module);
-/******/ __webpack_require__.d(getter, { a: getter });
-/******/ return getter;
-/******/ };
-/******/ })();
-/******/
-/******/ /* webpack/runtime/define property getters */
-/******/ (() => {
-/******/ // define getter functions for harmony exports
-/******/ __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 */
-/******/ (() => {
-/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
-/******/ })();
-/******/
-/******/ /* webpack/runtime/make namespace object */
-/******/ (() => {
-/******/ // define __esModule on exports
-/******/ __webpack_require__.r = (exports) => {
-/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
-/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
-/******/ }
-/******/ Object.defineProperty(exports, '__esModule', { value: true });
-/******/ };
-/******/ })();
-/******/
-/************************************************************************/
-var __webpack_exports__ = {};
-// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
-(() => {
-/*!****************************!*\
- !*** ./src/reply/index.js ***!
- \****************************/
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
-/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/comment-reply-link.js");
-/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/reply/edit.js");
-/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editor.scss */ "./src/reply/editor.scss");
-
-
-
-
-const save = () => null;
-(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)('activitypub/reply', {
- edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"],
- save,
- icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__["default"],
- transforms: {
- from: [{
- type: 'block',
- blocks: ['core/embed'],
- transform: attributes => {
- return (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.createBlock)('activitypub/reply', {
- url: attributes.url || '',
- embedPost: true
- });
- }
- }],
- to: [{
- type: 'block',
- blocks: ['core/embed'],
- transform: attributes => {
- return (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.createBlock)('core/embed', {
- url: attributes.url || ''
- });
- }
- }]
- }
-});
-})();
-
-/******/ })()
-;
-//# sourceMappingURL=index.js.map
\ No newline at end of file
+(()=>{"use strict";var e={n:t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var r in o)e.o(o,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.blocks,o=window.wp.primitives,r=window.ReactJSXRuntime;var i=(0,r.jsx)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)(o.Path,{d:"M6.68822 10.625L6.24878 11.0649L5.5 11.8145L5.5 5.5L12.5 5.5V8L14 6.5V5C14 4.44772 13.5523 4 13 4H5C4.44772 4 4 4.44771 4 5V13.5247C4 13.8173 4.16123 14.086 4.41935 14.2237C4.72711 14.3878 5.10601 14.3313 5.35252 14.0845L7.31 12.125H8.375L9.875 10.625H7.31H6.68822ZM14.5605 10.4983L11.6701 13.75H16.9975C17.9963 13.75 18.7796 14.1104 19.3553 14.7048C19.9095 15.2771 20.2299 16.0224 20.4224 16.7443C20.7645 18.0276 20.7543 19.4618 20.7487 20.2544C20.7481 20.345 20.7475 20.4272 20.7475 20.4999L19.2475 20.5001C19.2475 20.4191 19.248 20.3319 19.2484 20.2394V20.2394C19.2526 19.4274 19.259 18.2035 18.973 17.1307C18.8156 16.5401 18.586 16.0666 18.2778 15.7483C17.9909 15.4521 17.5991 15.25 16.9975 15.25H11.8106L14.5303 17.9697L13.4696 19.0303L8.96956 14.5303L13.4394 9.50171L14.5605 10.4983Z"})});const c=window.wp.blockEditor,l=window.wp.components,n=window.wp.i18n,s=window.wp.element,a=window.wp.compose,d=window.wp.data,u=window.wp.apiFetch;var p=e.n(u);const b=window.wp.url,w={default:(0,n.__)("Enter the URL of a post from the Fediverse (Mastodon, Pixelfed, etc.) that you want to reply to.","activitypub"),checking:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.Spinner,{})," "+(0,n.__)("Checking URL...","activitypub")]}),valid:(0,n.__)("The author will be notified of your response.","activitypub"),error:(0,n.__)("This site doesn’t have ActivityPub enabled and won’t receive your reply.","activitypub")};(0,t.registerBlockType)("activitypub/reply",{edit:function({attributes:e,setAttributes:o,clientId:i,isSelected:u}){const{url:y="",embedPost:m=!1}=e,[v,h]=(0,s.useState)(w.default),[f,k]=(0,s.useState)(!1),[_,x]=(0,s.useState)(!1),C=(0,s.useRef)(),{insertAfterBlock:g,removeBlock:L,replaceInnerBlocks:P}=(0,d.useDispatch)("core/block-editor"),j=m&&!_&&f,B=(0,c.useInnerBlocksProps)({className:"activitypub-embed-container"},{allowedBlocks:["core/embed"],template:y&&j?[["core/embed",{url:y}]]:[],templateLock:"all"});(0,s.useEffect)(()=>{P(i,y&&j?[(0,t.createBlock)("core/embed",{url:y})]:[])},[y,j,i,P]),(0,s.useEffect)(()=>{h(y?_?w.checking():f?w.valid:w.error:w.default)},[y,_,f]);const S=()=>{setTimeout(()=>C.current?.focus(),50)},V=(0,s.useCallback)(async e=>{if(e)try{x(!0),new URL(e);try{const t=await p()({path:(0,b.addQueryArgs)("/oembed/1.0/proxy",{url:e,activitypub:!0})});t&&t.provider_name?(o({embedPost:!0,isValidActivityPub:!0}),k(!0)):(o({isValidActivityPub:!1}),k(!1))}catch(e){console.log("Could not fetch embed:",e),o({isValidActivityPub:!1}),k(!1)}}catch(e){o({isValidActivityPub:!1}),k(!1)}finally{x(!1)}else k(!1)},[m,o]),A=(0,a.useDebounce)(V,250);return(0,s.useEffect)(()=>{y&&A(y)},[y]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.InspectorControls,{children:(0,r.jsx)(l.PanelBody,{title:(0,n.__)("Settings","activitypub"),children:(0,r.jsx)(l.ToggleControl,{label:(0,n.__)("Embed Post","activitypub"),checked:!!m,onChange:e=>o({embedPost:e}),disabled:!f,help:(0,n.__)("Show embedded content from the URL.","activitypub"),__nextHasNoMarginBottom:!0})})}),(0,r.jsxs)("div",{onClick:S,...(0,c.useBlockProps)(),children:[u&&(0,r.jsx)(l.TextControl,{label:(0,n.__)("Your post is a reply to the following URL","activitypub"),value:y,onChange:e=>o({url:e}),help:v,onKeyDown:e=>{"Enter"===e.key&&g(i),!y&&["Backspace","Delete"].includes(e.key)&&L(i)},ref:C,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),j&&(0,r.jsx)("div",{...B}),y&&!j&&!u&&(0,r.jsx)("div",{className:"activitypub-reply-block-editor__preview",contentEditable:!1,onClick:S,style:{cursor:"pointer"},children:(0,r.jsx)("a",{href:y,className:"u-in-reply-to",target:"_blank",rel:"noreferrer",children:"↬"+y.replace(/^https?:\/\//,"")})})]})]})},save:()=>null,icon:i,transforms:{from:[{type:"block",blocks:["core/embed"],transform:e=>(0,t.createBlock)("activitypub/reply",{url:e.url||"",embedPost:!0})}],to:[{type:"block",blocks:["core/embed"],transform:e=>(0,t.createBlock)("core/embed",{url:e.url||""})}]}})})();
\ No newline at end of file
diff --git a/build/social-web/feed-inspector.js b/build/social-web/feed-inspector.js
index 02f8edb699..74476eb3db 100644
--- a/build/social-web/feed-inspector.js
+++ b/build/social-web/feed-inspector.js
@@ -1,233 +1,4 @@
-"use strict";
-(globalThis["webpackChunkwordpress_activitypub"] = globalThis["webpackChunkwordpress_activitypub"] || []).push([["social-web/feed-inspector"],{
-
-/***/ "./src/social-web/routes/feed/inspector.tsx":
-/*!**************************************************!*\
- !*** ./src/social-web/routes/feed/inspector.tsx ***!
- \**************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ FeedInspector)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data");
-/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities");
-/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/close.js");
-/* harmony import */ var _contexts_settings_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../contexts/settings-context */ "./src/social-web/contexts/settings-context.tsx");
-/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils */ "./src/social-web/utils.ts");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__);
-/**
- * Feed Post Inspector
- *
- * Detail view for a single feed post in the side panel
- */
-
-
-
-
-
-
-
-
-
-// Helper to render HTML content with proper entity decoding and unescape
-const RenderHTML = ({
- html
-}) => {
- // Remove backslash escapes (e.g., \! becomes !)
- const unescaped = html.replace(/\\(.)/g, '$1');
- const decoded = (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_3__.decodeEntities)(unescaped);
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
- dangerouslySetInnerHTML: {
- __html: decoded
- }
- });
-};
-function FeedInspector({
- id,
- onClose
-}) {
- const {
- defaultAvatar
- } = (0,_contexts_settings_context__WEBPACK_IMPORTED_MODULE_5__.useSettings)();
- const {
- record: post,
- isResolving: isLoading
- } = (0,_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__.useEntityRecord)('postType', 'ap_post', id);
- const {
- records: comments,
- isResolving: isLoadingComments
- } = (0,_wordpress_core_data__WEBPACK_IMPORTED_MODULE_1__.useEntityRecords)('root', 'comment', {
- post: id,
- per_page: 100,
- order: 'asc',
- orderby: 'date'
- });
- if (isLoading) {
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
- className: "activitypub-inspector-loading",
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Spinner, {})
- });
- }
- if (!post) {
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
- className: "activitypub-inspector-loading",
- children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Post not found', 'activitypub')
- });
- }
- const actor = post.actor_info;
- const author = (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_3__.decodeEntities)(actor?.name || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Unknown author', 'activitypub'));
- const webfinger = actor?.webfinger || '';
- const profileUrl = actor?.url || '';
- const avatarUrl = actor?.icon || '';
- const postLink = post.link || '';
- const relativeTime = post.date ? (0,_utils__WEBPACK_IMPORTED_MODULE_6__.getRelativeTime)(post.date) : '';
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
- className: "activitypub-inspector",
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Card, {
- className: "activitypub-inspector-card",
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.CardHeader, {
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
- className: "activitypub-inspector-header",
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("img", {
- src: avatarUrl,
- alt: author,
- className: "activitypub-inspector-avatar",
- onError: e => {
- e.target.src = defaultAvatar;
- }
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
- className: "activitypub-inspector-author",
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("a", {
- href: profileUrl,
- target: "_blank",
- rel: "noopener noreferrer",
- className: "activitypub-inspector-author-name",
- children: author
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
- className: "activitypub-inspector-meta",
- children: [webfinger && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("span", {
- className: "activitypub-inspector-webfinger",
- children: webfinger
- }), relativeTime && postLink && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment, {
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("span", {
- className: "activitypub-inspector-separator",
- children: "\xB7"
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("a", {
- href: postLink,
- target: "_blank",
- rel: "noopener noreferrer",
- className: "activitypub-inspector-timestamp",
- children: relativeTime
- })]
- })]
- })]
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button, {
- icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__["default"],
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Close', 'activitypub'),
- onClick: onClose,
- className: "activitypub-inspector-close"
- })]
- })
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.CardBody, {
- children: [post.title?.rendered && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("h2", {
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(RenderHTML, {
- html: post.title.rendered
- })
- }), (post.content?.rendered || post.excerpt?.rendered) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(RenderHTML, {
- html: post.content?.rendered || post.excerpt?.rendered || ''
- })]
- })]
- }), (isLoadingComments || comments && comments.length > 0) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Card, {
- className: "activitypub-inspector-card activitypub-inspector-comments-card",
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.CardHeader, {
- children: [(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Comments', 'activitypub'), comments && comments.length > 0 && ` (${comments.length})`]
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.CardBody, {
- children: [isLoadingComments && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Spinner, {}), !isLoadingComments && comments && comments.length > 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
- children: comments.map(comment => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
- className: "activitypub-inspector-comment",
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
- className: "activitypub-inspector-comment-meta",
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("strong", {
- children: (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_3__.decodeEntities)(comment.author_name)
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("span", {
- className: "activitypub-inspector-comment-date",
- children: new Date(comment.date).toLocaleString()
- })]
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(RenderHTML, {
- html: comment.content.rendered
- })]
- }, comment.id))
- }), !isLoadingComments && (!comments || comments.length === 0) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("p", {
- children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('No comments yet.', 'activitypub')
- })]
- })]
- })]
- });
-}
-
-/***/ }),
-
-/***/ "./src/social-web/utils.ts":
-/*!*********************************!*\
- !*** ./src/social-web/utils.ts ***!
- \*********************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ getRelativeTime: () => (/* binding */ getRelativeTime)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/date */ "@wordpress/date");
-/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_1__);
-/**
- * Utility functions for Social Web
- */
-
-
-
-
-/**
- * Format relative time in short format (5m, 2h, 6d)
- * For dates older than a week, returns the site's date format
- *
- * @param dateString - The date string to format
- * @return The formatted relative time string
- */
-function getRelativeTime(dateString) {
- // Ensure the date string is parsed as UTC by adding 'Z' if not present
- const date = new Date(dateString.endsWith('Z') ? dateString : dateString + 'Z');
- const now = Date.now();
- const diffMs = now - date.getTime();
- const diffMinutes = Math.floor(diffMs / (1000 * 60));
- const diffHours = Math.floor(diffMs / (1000 * 60 * 60));
- const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
- if (diffMinutes < 60) {
- return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %d: number of minutes */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('%dm', 'short time format: minutes', 'activitypub'), diffMinutes);
- } else if (diffHours < 24) {
- return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %d: number of hours */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('%dh', 'short time format: hours', 'activitypub'), diffHours);
- } else if (diffDays < 7) {
- return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %d: number of days */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('%dd', 'short time format: days', 'activitypub'), diffDays);
- }
-
- // Use site's date format for dates older than a week
- return (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_1__.dateI18n)((0,_wordpress_date__WEBPACK_IMPORTED_MODULE_1__.getSettings)().formats.date, dateString);
-}
-
-/***/ })
-
-}]);
-//# sourceMappingURL=feed-inspector.js.map
\ No newline at end of file
+"use strict";(globalThis.webpackChunkwordpress_activitypub=globalThis.webpackChunkwordpress_activitypub||[]).push([[322],{42:(e,t,r)=>{r.r(t),r.d(t,{default:()=>h});var i=r(427),s=r(582),n=r(723),a=r(537),c=r(707),o=r(375),d=r(230),l=r(790);const p=({html:e})=>{const t=e.replace(/\\(.)/g,"$1"),r=(0,a.decodeEntities)(t);return(0,l.jsx)("div",{dangerouslySetInnerHTML:{__html:r}})};function h({id:e,onClose:t}){const{defaultAvatar:r}=(0,o.t)(),{record:h,isResolving:m}=(0,s.useEntityRecord)("postType","ap_post",e),{records:u,isResolving:v}=(0,s.useEntityRecords)("root","comment",{post:e,per_page:100,order:"asc",orderby:"date"});if(m)return(0,l.jsx)("div",{className:"activitypub-inspector-loading",children:(0,l.jsx)(i.Spinner,{})});if(!h)return(0,l.jsx)("div",{className:"activitypub-inspector-loading",children:(0,n.__)("Post not found","activitypub")});const b=h.actor_info,x=(0,a.decodeEntities)(b?.name||(0,n.__)("Unknown author","activitypub")),y=b?.webfinger||"",j=b?.url||"",g=b?.icon||"",f=h.link||"",_=h.date?(0,d.g)(h.date):"";return(0,l.jsxs)("div",{className:"activitypub-inspector",children:[(0,l.jsxs)(i.Card,{className:"activitypub-inspector-card",children:[(0,l.jsx)(i.CardHeader,{children:(0,l.jsxs)("div",{className:"activitypub-inspector-header",children:[(0,l.jsx)("img",{src:g,alt:x,className:"activitypub-inspector-avatar",onError:e=>{e.target.src=r}}),(0,l.jsxs)("div",{className:"activitypub-inspector-author",children:[(0,l.jsx)("a",{href:j,target:"_blank",rel:"noopener noreferrer",className:"activitypub-inspector-author-name",children:x}),(0,l.jsxs)("div",{className:"activitypub-inspector-meta",children:[y&&(0,l.jsx)("span",{className:"activitypub-inspector-webfinger",children:y}),_&&f&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"activitypub-inspector-separator",children:"·"}),(0,l.jsx)("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"activitypub-inspector-timestamp",children:_})]})]})]}),(0,l.jsx)(i.Button,{icon:c.A,label:(0,n.__)("Close","activitypub"),onClick:t,className:"activitypub-inspector-close"})]})}),(0,l.jsxs)(i.CardBody,{children:[h.title?.rendered&&(0,l.jsx)("h2",{children:(0,l.jsx)(p,{html:h.title.rendered})}),(h.content?.rendered||h.excerpt?.rendered)&&(0,l.jsx)(p,{html:h.content?.rendered||h.excerpt?.rendered||""})]})]}),(v||u&&u.length>0)&&(0,l.jsxs)(i.Card,{className:"activitypub-inspector-card activitypub-inspector-comments-card",children:[(0,l.jsxs)(i.CardHeader,{children:[(0,n.__)("Comments","activitypub"),u&&u.length>0&&` (${u.length})`]}),(0,l.jsxs)(i.CardBody,{children:[v&&(0,l.jsx)(i.Spinner,{}),!v&&u&&u.length>0&&(0,l.jsx)("div",{children:u.map(e=>(0,l.jsxs)("div",{className:"activitypub-inspector-comment",children:[(0,l.jsxs)("div",{className:"activitypub-inspector-comment-meta",children:[(0,l.jsx)("strong",{children:(0,a.decodeEntities)(e.author_name)}),(0,l.jsx)("span",{className:"activitypub-inspector-comment-date",children:new Date(e.date).toLocaleString()})]}),(0,l.jsx)(p,{html:e.content.rendered})]},e.id))}),!v&&(!u||0===u.length)&&(0,l.jsx)("p",{children:(0,n.__)("No comments yet.","activitypub")})]})]})]})}},230:(e,t,r)=>{r.d(t,{g:()=>n});var i=r(723),s=r(443);function n(e){const t=new Date(e.endsWith("Z")?e:e+"Z"),r=Date.now()-t.getTime(),n=Math.floor(r/6e4),a=Math.floor(r/36e5),c=Math.floor(r/864e5);return n<60?(0,i.sprintf)(/* translators: %d: number of minutes */ /* translators: %d: number of minutes */
+(0,i._x)("%dm","short time format: minutes","activitypub"),n):a<24?(0,i.sprintf)(/* translators: %d: number of hours */ /* translators: %d: number of hours */
+(0,i._x)("%dh","short time format: hours","activitypub"),a):c<7?(0,i.sprintf)(/* translators: %d: number of days */ /* translators: %d: number of days */
+(0,i._x)("%dd","short time format: days","activitypub"),c):(0,s.dateI18n)((0,s.getSettings)().formats.date,e)}}}]);
\ No newline at end of file
diff --git a/build/social-web/feed-stage.js b/build/social-web/feed-stage.js
index 6363797698..e407ff85b9 100644
--- a/build/social-web/feed-stage.js
+++ b/build/social-web/feed-stage.js
@@ -1,1189 +1,4 @@
-"use strict";
-(globalThis["webpackChunkwordpress_activitypub"] = globalThis["webpackChunkwordpress_activitypub"] || []).push([["social-web/feed-stage"],{
-
-/***/ "./src/social-web/components/fields/avatar/avatar.tsx":
-/*!************************************************************!*\
- !*** ./src/social-web/components/fields/avatar/avatar.tsx ***!
- \************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Avatar)
-/* harmony export */ });
-/* harmony import */ var _contexts_settings_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../contexts/settings-context */ "./src/social-web/contexts/settings-context.tsx");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-/**
- * Avatar component that displays an actor's avatar with fallback support.
- */
-
-
-
-function Avatar({
- item
-}) {
- const {
- defaultAvatar
- } = (0,_contexts_settings_context__WEBPACK_IMPORTED_MODULE_0__.useSettings)();
- const avatarUrl = item.actor_info?.icon || defaultAvatar;
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("img", {
- alt: item.actor_info?.username || '',
- src: avatarUrl,
- className: "activitypub-avatar-field__image",
- onError: e => {
- e.target.src = defaultAvatar;
- }
- });
-}
-
-/***/ }),
-
-/***/ "./src/social-web/components/fields/avatar/index.tsx":
-/*!***********************************************************!*\
- !*** ./src/social-web/components/fields/avatar/index.tsx ***!
- \***********************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ avatarField: () => (/* binding */ avatarField)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _avatar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./avatar */ "./src/social-web/components/fields/avatar/avatar.tsx");
-/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ "./src/social-web/components/fields/avatar/style.scss");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
-/**
- * Avatar field for DataViews.
- */
-
-
-
-
-
-const avatarField = {
- id: 'avatar',
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Avatar', 'activitypub'),
- type: 'media',
- enableHiding: false,
- enableSorting: false,
- getValue: ({
- item
- }) => item.actor_info?.icon || '',
- render: ({
- item
- }) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_avatar__WEBPACK_IMPORTED_MODULE_1__["default"], {
- item: item
- })
-};
-
-/***/ }),
-
-/***/ "./src/social-web/components/fields/avatar/style.scss":
-/*!************************************************************!*\
- !*** ./src/social-web/components/fields/avatar/style.scss ***!
- \************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-// extracted by mini-css-extract-plugin
-
-
-/***/ }),
-
-/***/ "./src/social-web/components/fields/content/index.tsx":
-/*!************************************************************!*\
- !*** ./src/social-web/components/fields/content/index.tsx ***!
- \************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ contentField: () => (/* binding */ contentField)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities");
-/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom");
-/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
-
-
-
-
-/**
- * Content field for reader-style view
- * Displays rich content with HTML formatting
- */
-const contentField = {
- id: 'content',
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Content', 'activitypub'),
- enableHiding: true,
- enableSorting: false,
- getValue: ({
- item
- }) => {
- // Strip HTML tags for plain text value (used for search/sort)
- const text = item.excerpt?.rendered || item.content?.rendered || '';
- return (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__.decodeEntities)((0,_wordpress_dom__WEBPACK_IMPORTED_MODULE_2__.__unstableStripHTML)(text));
- },
- render: ({
- item
- }) => {
- const content = (0,_wordpress_dom__WEBPACK_IMPORTED_MODULE_2__.safeHTML)((0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__.decodeEntities)(item.content?.rendered || ''));
-
- // Check if content is actually empty (not just whitespace)
- const hasRealContent = content.trim().replace(/<\/?p>/g, '').replace(/ /g, '').trim().length > 0;
- if (!hasRealContent) {
- return null;
- }
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
- className: "activitypub-feed-post",
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
- className: "activitypub-feed-content",
- dangerouslySetInnerHTML: {
- __html: content
- }
- })
- });
- }
-};
-
-/***/ }),
-
-/***/ "./src/social-web/components/fields/date/index.tsx":
-/*!*********************************************************!*\
- !*** ./src/social-web/components/fields/date/index.tsx ***!
- \*********************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ dateField: () => (/* binding */ dateField)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-
-const dateField = {
- id: 'date',
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Date', 'activitypub'),
- enableHiding: false,
- enableSorting: true,
- getValue: ({
- item
- }) => item.date || '',
- render: ({
- item
- }) => {
- if (!item.date) {
- return '';
- }
- return new Date(item.date).toLocaleDateString();
- }
-};
-
-/***/ }),
-
-/***/ "./src/social-web/components/fields/excerpt/index.tsx":
-/*!************************************************************!*\
- !*** ./src/social-web/components/fields/excerpt/index.tsx ***!
- \************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ excerptField: () => (/* binding */ excerptField)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities");
-/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom");
-/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
-
-
-
-
-/**
- * Get plain text excerpt from post.
- */
-const getPlainTextExcerpt = item => {
- const text = item.excerpt?.rendered || item.content?.rendered || '';
- return (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__.decodeEntities)((0,_wordpress_dom__WEBPACK_IMPORTED_MODULE_2__.__unstableStripHTML)(text));
-};
-const excerptField = {
- id: 'excerpt.rendered',
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Excerpt', 'activitypub'),
- enableHiding: true,
- enableSorting: false,
- getValue: ({
- item
- }) => getPlainTextExcerpt(item),
- render: ({
- item
- }) => {
- const plainText = getPlainTextExcerpt(item).trim();
- if (!plainText) {
- return null;
- }
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
- className: "activitypub-feed-excerpt",
- children: plainText
- });
- }
-};
-
-/***/ }),
-
-/***/ "./src/social-web/components/fields/follow-status/index.tsx":
-/*!******************************************************************!*\
- !*** ./src/social-web/components/fields/follow-status/index.tsx ***!
- \******************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ followStatusField: () => (/* binding */ followStatusField)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/social-web/components/fields/follow-status/style.scss");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
-/**
- * Follow Status field for DataViews.
- */
-
-
-
-
-const followStatusField = {
- id: 'follow_status',
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Following', 'activitypub'),
- enableHiding: true,
- getValue: ({
- item
- }) => item.follow_status?.follows_back,
- render: ({
- item
- }) => {
- if (item.follow_status?.follows_back) {
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {
- className: "activitypub-mutual",
- children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('Mutual', 'Follow status', 'activitypub')
- });
- }
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {
- children: "\u2014"
- });
- }
-};
-
-/***/ }),
-
-/***/ "./src/social-web/components/fields/follow-status/style.scss":
-/*!*******************************************************************!*\
- !*** ./src/social-web/components/fields/follow-status/style.scss ***!
- \*******************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-// extracted by mini-css-extract-plugin
-
-
-/***/ }),
-
-/***/ "./src/social-web/components/fields/index.ts":
-/*!***************************************************!*\
- !*** ./src/social-web/components/fields/index.ts ***!
- \***************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ avatarField: () => (/* reexport safe */ _avatar__WEBPACK_IMPORTED_MODULE_0__.avatarField),
-/* harmony export */ contentField: () => (/* reexport safe */ _content__WEBPACK_IMPORTED_MODULE_1__.contentField),
-/* harmony export */ dateField: () => (/* reexport safe */ _date__WEBPACK_IMPORTED_MODULE_2__.dateField),
-/* harmony export */ excerptField: () => (/* reexport safe */ _excerpt__WEBPACK_IMPORTED_MODULE_3__.excerptField),
-/* harmony export */ followStatusField: () => (/* reexport safe */ _follow_status__WEBPACK_IMPORTED_MODULE_4__.followStatusField),
-/* harmony export */ metadataField: () => (/* reexport safe */ _metadata__WEBPACK_IMPORTED_MODULE_5__.metadataField),
-/* harmony export */ modifiedField: () => (/* reexport safe */ _modified__WEBPACK_IMPORTED_MODULE_6__.modifiedField),
-/* harmony export */ nameField: () => (/* reexport safe */ _name__WEBPACK_IMPORTED_MODULE_7__.nameField),
-/* harmony export */ statusField: () => (/* reexport safe */ _status__WEBPACK_IMPORTED_MODULE_8__.statusField),
-/* harmony export */ titleField: () => (/* reexport safe */ _title__WEBPACK_IMPORTED_MODULE_9__.titleField),
-/* harmony export */ webfingerField: () => (/* reexport safe */ _webfinger__WEBPACK_IMPORTED_MODULE_10__.webfingerField)
-/* harmony export */ });
-/* harmony import */ var _avatar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./avatar */ "./src/social-web/components/fields/avatar/index.tsx");
-/* harmony import */ var _content__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./content */ "./src/social-web/components/fields/content/index.tsx");
-/* harmony import */ var _date__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./date */ "./src/social-web/components/fields/date/index.tsx");
-/* harmony import */ var _excerpt__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./excerpt */ "./src/social-web/components/fields/excerpt/index.tsx");
-/* harmony import */ var _follow_status__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./follow-status */ "./src/social-web/components/fields/follow-status/index.tsx");
-/* harmony import */ var _metadata__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./metadata */ "./src/social-web/components/fields/metadata/index.tsx");
-/* harmony import */ var _modified__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./modified */ "./src/social-web/components/fields/modified/index.tsx");
-/* harmony import */ var _name__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./name */ "./src/social-web/components/fields/name/index.tsx");
-/* harmony import */ var _status__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./status */ "./src/social-web/components/fields/status/index.tsx");
-/* harmony import */ var _title__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./title */ "./src/social-web/components/fields/title/index.tsx");
-/* harmony import */ var _webfinger__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./webfinger */ "./src/social-web/components/fields/webfinger/index.tsx");
-
-
-
-
-
-
-
-
-
-
-
-
-/***/ }),
-
-/***/ "./src/social-web/components/fields/metadata/index.tsx":
-/*!*************************************************************!*\
- !*** ./src/social-web/components/fields/metadata/index.tsx ***!
- \*************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ metadataField: () => (/* binding */ metadataField)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities");
-/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _contexts_settings_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../contexts/settings-context */ "./src/social-web/contexts/settings-context.tsx");
-/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../utils */ "./src/social-web/utils.ts");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
-
-
-
-
-
-const metadataField = {
- id: 'metadata',
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Metadata', 'activitypub'),
- enableHiding: true,
- enableSorting: false,
- getValue: ({
- item
- }) => {
- const author = item.actor_info?.name || '';
- const relativeTime = item.date ? (0,_utils__WEBPACK_IMPORTED_MODULE_3__.getRelativeTime)(item.date) : '';
- return `${author} · ${relativeTime}`;
- },
- render: ({
- item
- }) => {
- const {
- defaultAvatar
- } = (0,_contexts_settings_context__WEBPACK_IMPORTED_MODULE_2__.useSettings)();
- const name = (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__.decodeEntities)(item.actor_info?.name || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Unknown author', 'activitypub'));
- const avatarUrl = item.actor_info?.icon || '';
- const relativeTime = item.date ? (0,_utils__WEBPACK_IMPORTED_MODULE_3__.getRelativeTime)(item.date) : '';
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
- className: "activitypub-feed-post-meta",
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("img", {
- src: avatarUrl,
- alt: name,
- className: "activitypub-feed-avatar",
- onError: e => {
- e.target.src = defaultAvatar;
- }
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
- className: "author",
- children: name
- }), relativeTime && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, {
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
- className: "separator",
- children: "\xB7"
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
- className: "date",
- children: relativeTime
- })]
- })]
- });
- }
-};
-
-/***/ }),
-
-/***/ "./src/social-web/components/fields/modified/index.tsx":
-/*!*************************************************************!*\
- !*** ./src/social-web/components/fields/modified/index.tsx ***!
- \*************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ modifiedField: () => (/* binding */ modifiedField)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/date */ "@wordpress/date");
-/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
-/**
- * Modified/Last Updated field for DataViews.
- */
-
-
-
-
-const modifiedField = {
- id: 'modified',
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Last Updated', 'activitypub'),
- enableHiding: true,
- enableSorting: true,
- getValue: ({
- item
- }) => item.modified_gmt || item.modified,
- render: ({
- item
- }) => {
- const date = item.modified_gmt || item.modified;
- if (!date) {
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {
- children: "\u2014"
- });
- }
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("time", {
- dateTime: date,
- children: (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_1__.dateI18n)('M j, Y', date)
- });
- },
- filterBy: {
- operators: ['after', 'before']
- }
-};
-
-/***/ }),
-
-/***/ "./src/social-web/components/fields/name/index.tsx":
-/*!*********************************************************!*\
- !*** ./src/social-web/components/fields/name/index.tsx ***!
- \*********************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ nameField: () => (/* binding */ nameField)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-/**
- * Name field for DataViews.
- */
-
-
-
-const nameField = {
- id: 'name',
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Name', 'activitypub'),
- enableHiding: false,
- enableSorting: true,
- getValue: ({
- item
- }) => item.actor_info?.name || '',
- render: ({
- item
- }) => {
- const name = item.actor_info?.name || '';
- const url = item.actor_info?.url || '#';
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("a", {
- href: url,
- target: "_blank",
- rel: "noopener noreferrer",
- className: "activitypub-name-field__link",
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong", {
- children: name
- })
- });
- }
-};
-
-/***/ }),
-
-/***/ "./src/social-web/components/fields/status/index.tsx":
-/*!***********************************************************!*\
- !*** ./src/social-web/components/fields/status/index.tsx ***!
- \***********************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ statusField: () => (/* binding */ statusField)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-
-const statusField = {
- id: 'status',
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Status', 'activitypub'),
- enableHiding: true,
- enableSorting: true,
- getValue: ({
- item
- }) => item.status || ''
-};
-
-/***/ }),
-
-/***/ "./src/social-web/components/fields/title/index.tsx":
-/*!**********************************************************!*\
- !*** ./src/social-web/components/fields/title/index.tsx ***!
- \**********************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ titleField: () => (/* binding */ titleField)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities");
-/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
-
-
-
-const titleField = {
- id: 'title.rendered',
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Title', 'activitypub'),
- enableHiding: true,
- enableSorting: false,
- enableGlobalSearch: true,
- getValue: ({
- item
- }) => (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__.decodeEntities)(item.title?.rendered || ''),
- render: ({
- item
- }) => {
- if (!item.title?.rendered) {
- return null;
- }
-
- // Remove backslash escapes and decode entities
- const unescaped = item.title.rendered.replace(/\\(.)/g, '$1');
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
- className: "activitypub-feed-post-title",
- children: (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__.decodeEntities)(unescaped)
- });
- }
-};
-
-/***/ }),
-
-/***/ "./src/social-web/components/fields/webfinger/index.tsx":
-/*!**************************************************************!*\
- !*** ./src/social-web/components/fields/webfinger/index.tsx ***!
- \**************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ webfingerField: () => (/* binding */ webfingerField)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-/**
- * Webfinger/Profile field for DataViews.
- */
-
-
-
-const webfingerField = {
- id: 'webfinger',
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Profile', 'activitypub'),
- enableHiding: true,
- getValue: ({
- item
- }) => item.actor_info?.webfinger || '',
- render: ({
- item
- }) => {
- const webfinger = item.actor_info?.webfinger || '';
- const url = item.actor_info?.url || '#';
- if (!webfinger) {
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("span", {
- children: "\u2014"
- });
- }
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("a", {
- href: url,
- target: "_blank",
- rel: "noopener noreferrer",
- title: webfinger,
- children: ["@", webfinger]
- });
- }
-};
-
-/***/ }),
-
-/***/ "./src/social-web/components/page/index.tsx":
-/*!**************************************************!*\
- !*** ./src/social-web/components/page/index.tsx ***!
- \**************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ Page: () => (/* binding */ Page)
-/* harmony export */ });
-/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
-/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/social-web/components/page/style.scss");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
-/**
- * Page Component
- *
- * A reusable page wrapper that provides consistent header layout and content structure.
- */
-
-
-
-
-function Page({
- title,
- subTitle,
- badges,
- actions,
- breadcrumbs,
- hasPadding = true,
- hasBorder = false,
- contentWidth = 'default',
- children
-}) {
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
- className: "page",
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("header", {
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])('header', {
- 'has-border': hasBorder
- }),
- children: [breadcrumbs && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
- className: "breadcrumbs",
- children: breadcrumbs
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
- className: "title-row",
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
- className: "title-group",
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("h1", {
- className: "title",
- children: title
- }), badges && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
- className: "badges",
- children: badges
- })]
- }), actions && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
- className: "actions",
- children: actions
- })]
- }), subTitle && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("p", {
- className: "sub-title",
- children: subTitle
- })]
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])('content', {
- padded: hasPadding,
- constrained: contentWidth === 'constrained',
- full: contentWidth === 'full'
- }),
- children: children
- })]
- });
-}
-
-/***/ }),
-
-/***/ "./src/social-web/components/page/style.scss":
-/*!***************************************************!*\
- !*** ./src/social-web/components/page/style.scss ***!
- \***************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-// extracted by mini-css-extract-plugin
-
-
-/***/ }),
-
-/***/ "./src/social-web/hooks/use-feed.ts":
-/*!******************************************!*\
- !*** ./src/social-web/hooks/use-feed.ts ***!
- \******************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ useFeed: () => (/* binding */ useFeed)
-/* harmony export */ });
-/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data");
-/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
-
-
-function useFeed({
- perPage = 20,
- page = 1,
- orderBy = 'date',
- order = 'desc',
- search = '',
- userId,
- fields = ['id', 'date', 'modified', 'title', 'excerpt', 'content', 'actor_info', 'status', 'link']
-} = {}) {
- // Don't fetch if userId is not set
- const enabled = userId !== null && userId !== undefined;
- const queryArgs = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
- const args = {
- per_page: perPage,
- page,
- orderby: orderBy,
- order,
- search,
- _fields: fields
- };
-
- // Only add user_id if we have a valid userId
- if (enabled) {
- args.user_id = userId;
- }
- return args;
- }, [perPage, page, orderBy, order, search, userId, fields, enabled]);
- const {
- records,
- hasResolved,
- isResolving,
- totalItems,
- totalPages
- } = (0,_wordpress_core_data__WEBPACK_IMPORTED_MODULE_0__.useEntityRecords)('postType', 'ap_post', enabled ? queryArgs : undefined);
- return {
- feed: enabled ? records || [] : [],
- hasResolved,
- isResolving,
- totalItems: enabled ? totalItems : null,
- totalPages: enabled ? totalPages : null
- };
-}
-
-/***/ }),
-
-/***/ "./src/social-web/routes/feed/stage.tsx":
-/*!**********************************************!*\
- !*** ./src/social-web/routes/feed/stage.tsx ***!
- \**********************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ FeedStage)
-/* harmony export */ });
-/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./style.scss */ "./src/social-web/routes/feed/style.scss");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_dataviews__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/dataviews */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews/index.js");
-/* harmony import */ var _wordpress_views__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/views */ "./node_modules/@wordpress/views/build-module/index.js");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
-/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
-/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_5__);
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__);
-/* harmony import */ var _components_page__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../components/page */ "./src/social-web/components/page/index.tsx");
-/* harmony import */ var _hooks_use_feed__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../hooks/use-feed */ "./src/social-web/hooks/use-feed.ts");
-/* harmony import */ var _components_fields__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../components/fields */ "./src/social-web/components/fields/index.ts");
-/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils */ "./src/social-web/routes/feed/utils.ts");
-/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../store */ "./src/social-web/store/index.ts");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__);
-/**
- * Feed Stage
- *
- * Main feed list view with DataViews
- */
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-const DEFAULT_VIEW = {
- type: 'list',
- perPage: 20,
- page: 1,
- sort: {
- field: 'date',
- direction: 'desc'
- },
- search: '',
- filters: [],
- fields: ['metadata', 'title.rendered', 'excerpt.rendered'],
- infiniteScrollEnabled: true
-};
-const defaultLayouts = {
- list: {
- primaryField: 'metadata',
- fields: ['metadata', 'title.rendered', 'excerpt.rendered'],
- mediaField: undefined
- }
-};
-function FeedStage({
- onSelectItem
-}) {
- // Get active actor ID from store
- const activeActorId = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_6__.useSelect)(select => select(_store__WEBPACK_IMPORTED_MODULE_11__.STORE_NAME).getActiveActorId(), []);
-
- // Track URL query parameters as state for reactivity
- const [urlQueryParams, setUrlQueryParams] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(() => {
- const args = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_5__.getQueryArgs)(window.location.href);
- return {
- page: args.paged ? Number(args.paged) : undefined,
- search: args.search || undefined
- };
- });
-
- // Listen for URL changes (browser back/forward).
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
- const updateQueryParams = () => {
- const args = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_5__.getQueryArgs)(window.location.href);
- setUrlQueryParams({
- page: args.paged ? Number(args.paged) : undefined,
- search: args.search || undefined
- });
- };
- window.addEventListener('popstate', updateQueryParams);
- window.addEventListener('hashchange', updateQueryParams);
- return () => {
- window.removeEventListener('popstate', updateQueryParams);
- window.removeEventListener('hashchange', updateQueryParams);
- };
- }, []);
-
- // Use the views hook to persist user preferences
- const {
- view,
- updateView
- } = (0,_wordpress_views__WEBPACK_IMPORTED_MODULE_3__.useView)({
- kind: 'postType',
- name: 'ap_post',
- slug: 'feed',
- defaultView: DEFAULT_VIEW,
- queryParams: urlQueryParams,
- onChangeQueryParams: params => {
- const currentUrl = window.location.href;
- const currentArgs = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_5__.getQueryArgs)(currentUrl);
- const newUrl = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_5__.addQueryArgs)(currentUrl, {
- ...currentArgs,
- paged: params.page || undefined,
- search: params.search || undefined
- });
- window.history.pushState(null, '', newUrl);
- setUrlQueryParams({
- page: params.page,
- search: params.search
- });
- }
- });
-
- // Wrap updateView to enforce mutual exclusion between excerpt and content fields
- const updateFeedView = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(updatedView => {
- const oldFields = view.fields || [];
- const newFields = updatedView.fields || [];
- const fields = (0,_utils__WEBPACK_IMPORTED_MODULE_10__.enforceContentExcerptMutualExclusion)(oldFields, newFields);
- updateView({
- ...updatedView,
- fields
- });
- }, [view.fields, updateView]);
- const {
- feed,
- isResolving,
- totalItems,
- totalPages
- } = (0,_hooks_use_feed__WEBPACK_IMPORTED_MODULE_8__.useFeed)({
- perPage: view.perPage || 20,
- page: view.page || 1,
- orderBy: view.sort?.field || 'date',
- order: view.sort?.direction || 'desc',
- search: view.search || '',
- userId: activeActorId
- });
- const fields = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => [_components_fields__WEBPACK_IMPORTED_MODULE_9__.metadataField, _components_fields__WEBPACK_IMPORTED_MODULE_9__.titleField, _components_fields__WEBPACK_IMPORTED_MODULE_9__.excerptField, _components_fields__WEBPACK_IMPORTED_MODULE_9__.contentField, _components_fields__WEBPACK_IMPORTED_MODULE_9__.dateField], []);
-
- // Normalize view.fields to maintain the canonical order defined in fields array
- const normalizedView = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => (0,_utils__WEBPACK_IMPORTED_MODULE_10__.normalizeFieldOrder)(view, fields), [view, fields]);
- const [selection, setSelection] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
-
- // State for infinite scroll
- const [allLoadedRecords, setAllLoadedRecords] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
- const [isLoadingMore, setIsLoadingMore] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
- const lastProcessedPage = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(0);
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
- if (selection.length === 0) {
- return;
- }
- const selectedId = selection[0];
- const exists = feed.some(item => item.id.toString() === selectedId);
- if (!exists) {
- setSelection([]);
- }
- }, [feed, selection]);
- const changeSelection = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(nextSelection => {
- setSelection(nextSelection);
- if (nextSelection.length === 0) {
- return;
- }
- const selectedId = nextSelection[0];
- const selectedItem = feed.find(item => item.id.toString() === selectedId);
- if (selectedItem) {
- onSelectItem(selectedItem.id);
- }
- }, [feed, onSelectItem]);
-
- // Infinite scroll handler
- const infiniteScrollHandler = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
- const currentPage = view.page || 1;
-
- // Prevent concurrent requests or loading beyond available pages
- if (isLoadingMore || currentPage >= (totalPages || 1)) {
- return;
- }
- setIsLoadingMore(true);
- updateFeedView({
- ...view,
- page: currentPage + 1
- });
- }, [isLoadingMore, view, totalPages, updateFeedView]);
-
- // Accumulate data across pages for infinite scroll
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
- const currentPage = normalizedView.page || 1;
- const infiniteScrollEnabled = normalizedView.infiniteScrollEnabled;
-
- // Don't process until feed data is available
- if (feed.length === 0) {
- return;
- }
-
- // Skip if we've already processed this page (but always process page 1 for search/initial load)
- if (currentPage > 1 && lastProcessedPage.current === currentPage) {
- return;
- }
-
- // Reset to new data on first page or when infinite scroll is disabled
- if (currentPage === 1 || !infiniteScrollEnabled) {
- setAllLoadedRecords(feed);
- lastProcessedPage.current = currentPage;
- setIsLoadingMore(false);
- } else {
- // Append new records while avoiding duplicates
- setAllLoadedRecords(prev => {
- const existingIds = new Set(prev.map(item => item.id));
- const newRecords = feed.filter(record => !existingIds.has(record.id));
- return newRecords.length > 0 ? [...prev, ...newRecords] : prev;
- });
- lastProcessedPage.current = currentPage;
- setIsLoadingMore(false);
- }
- }, [feed, normalizedView.page, normalizedView.search, normalizedView.infiniteScrollEnabled]);
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_components_page__WEBPACK_IMPORTED_MODULE_7__.Page, {
- title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Feed', 'activitypub'),
- subTitle: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('ActivityPub posts from your network', 'activitypub'),
- hasPadding: false,
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_wordpress_dataviews__WEBPACK_IMPORTED_MODULE_2__["default"], {
- data: allLoadedRecords,
- fields: fields,
- view: normalizedView,
- onChangeView: updateFeedView,
- isLoading: isResolving || isLoadingMore,
- onClickItem: item => onSelectItem(item.id),
- isItemClickable: () => true,
- getItemId: item => item.id.toString(),
- selection: selection,
- onChangeSelection: changeSelection,
- empty: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("p", {
- children: normalizedView.search ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('No posts found.', 'activitypub') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('No posts found in your feed. Posts from ActivityPub actors you follow will appear here.', 'activitypub')
- }),
- paginationInfo: {
- totalItems,
- totalPages,
- infiniteScrollHandler
- },
- defaultLayouts: defaultLayouts
- })
- });
-}
-
-/***/ }),
-
-/***/ "./src/social-web/routes/feed/style.scss":
-/*!***********************************************!*\
- !*** ./src/social-web/routes/feed/style.scss ***!
- \***********************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-// extracted by mini-css-extract-plugin
-
-
-/***/ }),
-
-/***/ "./src/social-web/routes/feed/utils.ts":
-/*!*********************************************!*\
- !*** ./src/social-web/routes/feed/utils.ts ***!
- \*********************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ enforceContentExcerptMutualExclusion: () => (/* binding */ enforceContentExcerptMutualExclusion),
-/* harmony export */ normalizeFieldOrder: () => (/* binding */ normalizeFieldOrder)
-/* harmony export */ });
-/**
- * Utility functions for feed view management
- */
-
-/**
- * Enforces mutual exclusion between excerpt and content fields.
- * Ensures that only one of these fields is visible at a time, and at least one is always selected.
- *
- * @param oldFields - The previous array of visible field IDs
- * @param newFields - The new array of visible field IDs
- * @return The adjusted array of field IDs with enforcement applied
- */
-function enforceContentExcerptMutualExclusion(oldFields, newFields) {
- // Check if content was just added
- const contentAdded = newFields.includes('content') && !oldFields.includes('content');
- // Check if excerpt was just added
- const excerptAdded = newFields.includes('excerpt.rendered') && !oldFields.includes('excerpt.rendered');
- // Check if content was just removed
- const contentRemoved = !newFields.includes('content') && oldFields.includes('content');
- // Check if excerpt was just removed
- const excerptRemoved = !newFields.includes('excerpt.rendered') && oldFields.includes('excerpt.rendered');
- if (contentAdded) {
- // Remove excerpt when content is added
- return newFields.filter(field => field !== 'excerpt.rendered');
- }
- if (excerptAdded) {
- // Remove content when excerpt is added
- return newFields.filter(field => field !== 'content');
- }
- if (contentRemoved && !newFields.includes('excerpt.rendered')) {
- // Add excerpt when content is removed and excerpt is not already present
- return [...newFields, 'excerpt.rendered'];
- }
- if (excerptRemoved && !newFields.includes('content')) {
- // Add content when excerpt is removed and content is not already present
- return [...newFields, 'content'];
- }
- return newFields;
-}
-
-/**
- * Normalizes view fields to maintain canonical order.
- * Sorts the visible fields according to the order defined in the fields array.
- *
- * @param view - The current view configuration
- * @param fields - Array of field objects with their canonical order
- * @return The view with fields sorted in canonical order
- */
-function normalizeFieldOrder(view, fields) {
- if (!view.fields) {
- return view;
- }
-
- // Create a map of field IDs to their canonical order
- const fieldOrder = new Map(fields.map((field, index) => [field.id, index]));
-
- // Sort view.fields according to the canonical order
- const sortedFields = [...view.fields].sort((a, b) => {
- var _fieldOrder$get, _fieldOrder$get2;
- const orderA = (_fieldOrder$get = fieldOrder.get(a)) !== null && _fieldOrder$get !== void 0 ? _fieldOrder$get : Infinity;
- const orderB = (_fieldOrder$get2 = fieldOrder.get(b)) !== null && _fieldOrder$get2 !== void 0 ? _fieldOrder$get2 : Infinity;
- return orderA - orderB;
- });
- return {
- ...view,
- fields: sortedFields
- };
-}
-
-/***/ }),
-
-/***/ "./src/social-web/utils.ts":
-/*!*********************************!*\
- !*** ./src/social-web/utils.ts ***!
- \*********************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ getRelativeTime: () => (/* binding */ getRelativeTime)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/date */ "@wordpress/date");
-/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_1__);
-/**
- * Utility functions for Social Web
- */
-
-
-
-
-/**
- * Format relative time in short format (5m, 2h, 6d)
- * For dates older than a week, returns the site's date format
- *
- * @param dateString - The date string to format
- * @return The formatted relative time string
- */
-function getRelativeTime(dateString) {
- // Ensure the date string is parsed as UTC by adding 'Z' if not present
- const date = new Date(dateString.endsWith('Z') ? dateString : dateString + 'Z');
- const now = Date.now();
- const diffMs = now - date.getTime();
- const diffMinutes = Math.floor(diffMs / (1000 * 60));
- const diffHours = Math.floor(diffMs / (1000 * 60 * 60));
- const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
- if (diffMinutes < 60) {
- return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %d: number of minutes */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('%dm', 'short time format: minutes', 'activitypub'), diffMinutes);
- } else if (diffHours < 24) {
- return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %d: number of hours */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('%dh', 'short time format: hours', 'activitypub'), diffHours);
- } else if (diffDays < 7) {
- return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %d: number of days */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('%dd', 'short time format: days', 'activitypub'), diffDays);
- }
-
- // Use site's date format for dates older than a week
- return (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_1__.dateI18n)((0,_wordpress_date__WEBPACK_IMPORTED_MODULE_1__.getSettings)().formats.date, dateString);
-}
-
-/***/ })
-
-}]);
-//# sourceMappingURL=feed-stage.js.map
\ No newline at end of file
+"use strict";(globalThis.webpackChunkwordpress_activitypub=globalThis.webpackChunkwordpress_activitypub||[]).push([[303],{230:(e,t,i)=>{i.d(t,{g:()=>n});var a=i(723),r=i(443);function n(e){const t=new Date(e.endsWith("Z")?e:e+"Z"),i=Date.now()-t.getTime(),n=Math.floor(i/6e4),s=Math.floor(i/36e5),d=Math.floor(i/864e5);return n<60?(0,a.sprintf)(/* translators: %d: number of minutes */ /* translators: %d: number of minutes */
+(0,a._x)("%dm","short time format: minutes","activitypub"),n):s<24?(0,a.sprintf)(/* translators: %d: number of hours */ /* translators: %d: number of hours */
+(0,a._x)("%dh","short time format: hours","activitypub"),s):d<7?(0,a.sprintf)(/* translators: %d: number of days */ /* translators: %d: number of days */
+(0,a._x)("%dd","short time format: days","activitypub"),d):(0,r.dateI18n)((0,r.getSettings)().formats.date,e)}},658:(e,t,i)=>{i.r(t),i.d(t,{default:()=>E});var a=i(87),r=i(371),n=i(510),s=i(723),d=i(832),c=i(143),l=i(164),o=i(790);function u({title:e,subTitle:t,badges:i,actions:a,breadcrumbs:r,hasPadding:n=!0,hasBorder:s=!1,contentWidth:d="default",children:c}){return(0,o.jsxs)("div",{className:"page",children:[(0,o.jsxs)("header",{className:(0,l.A)("header",{"has-border":s}),children:[r&&(0,o.jsx)("div",{className:"breadcrumbs",children:r}),(0,o.jsxs)("div",{className:"title-row",children:[(0,o.jsxs)("div",{className:"title-group",children:[(0,o.jsx)("h1",{className:"title",children:e}),i&&(0,o.jsx)("div",{className:"badges",children:i})]}),a&&(0,o.jsx)("div",{className:"actions",children:a})]}),t&&(0,o.jsx)("p",{className:"sub-title",children:t})]}),(0,o.jsx)("div",{className:(0,l.A)("content",{padded:n,constrained:"constrained"===d,full:"full"===d}),children:c})]})}var p=i(582),g=i(375);(0,s.__)("Avatar","activitypub");var h=i(537),f=i(107);const m={id:"content",label:(0,s.__)("Content","activitypub"),enableHiding:!0,enableSorting:!1,getValue:({item:e})=>{const t=e.excerpt?.rendered||e.content?.rendered||"";return(0,h.decodeEntities)((0,f.__unstableStripHTML)(t))},render:({item:e})=>{const t=(0,f.safeHTML)((0,h.decodeEntities)(e.content?.rendered||""));return t.trim().replace(/<\/?p>/g,"").replace(/ /g,"").trim().length>0?(0,o.jsx)("div",{className:"activitypub-feed-post",children:(0,o.jsx)("div",{className:"activitypub-feed-content",dangerouslySetInnerHTML:{__html:t}})}):null}},v={id:"date",label:(0,s.__)("Date","activitypub"),enableHiding:!1,enableSorting:!0,getValue:({item:e})=>e.date||"",render:({item:e})=>e.date?new Date(e.date).toLocaleDateString():""},b=e=>{const t=e.excerpt?.rendered||e.content?.rendered||"";return(0,h.decodeEntities)((0,f.__unstableStripHTML)(t))},_={id:"excerpt.rendered",label:(0,s.__)("Excerpt","activitypub"),enableHiding:!0,enableSorting:!1,getValue:({item:e})=>b(e),render:({item:e})=>{const t=b(e).trim();return t?(0,o.jsx)("div",{className:"activitypub-feed-excerpt",children:t}):null}};(0,s.__)("Following","activitypub");var y=i(230);const x={id:"metadata",label:(0,s.__)("Metadata","activitypub"),enableHiding:!0,enableSorting:!1,getValue:({item:e})=>`${e.actor_info?.name||""} · ${e.date?(0,y.g)(e.date):""}`,render:({item:e})=>{const{defaultAvatar:t}=(0,g.t)(),i=(0,h.decodeEntities)(e.actor_info?.name||(0,s.__)("Unknown author","activitypub")),a=e.actor_info?.icon||"",r=e.date?(0,y.g)(e.date):"";return(0,o.jsxs)("div",{className:"activitypub-feed-post-meta",children:[(0,o.jsx)("img",{src:a,alt:i,className:"activitypub-feed-avatar",onError:e=>{e.target.src=t}}),(0,o.jsx)("span",{className:"author",children:i}),r&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"separator",children:"·"}),(0,o.jsx)("span",{className:"date",children:r})]})]})}};i(443),(0,s.__)("Last Updated","activitypub"),(0,s.__)("Name","activitypub"),(0,s.__)("Status","activitypub");const w={id:"title.rendered",label:(0,s.__)("Title","activitypub"),enableHiding:!0,enableSorting:!1,enableGlobalSearch:!0,getValue:({item:e})=>(0,h.decodeEntities)(e.title?.rendered||""),render:({item:e})=>{if(!e.title?.rendered)return null;const t=e.title.rendered.replace(/\\(.)/g,"$1");return(0,o.jsx)("div",{className:"activitypub-feed-post-title",children:(0,h.decodeEntities)(t)})}};(0,s.__)("Profile","activitypub");var S=i(17);const N={type:"list",perPage:20,page:1,sort:{field:"date",direction:"desc"},search:"",filters:[],fields:["metadata","title.rendered","excerpt.rendered"],infiniteScrollEnabled:!0},j={list:{primaryField:"metadata",fields:["metadata","title.rendered","excerpt.rendered"],mediaField:void 0}};function E({onSelectItem:e}){const t=(0,c.useSelect)(e=>e(S.E).getActiveActorId(),[]),[i,l]=(0,a.useState)(()=>{const e=(0,d.getQueryArgs)(window.location.href);return{page:e.paged?Number(e.paged):void 0,search:e.search||void 0}});(0,a.useEffect)(()=>{const e=()=>{const e=(0,d.getQueryArgs)(window.location.href);l({page:e.paged?Number(e.paged):void 0,search:e.search||void 0})};return window.addEventListener("popstate",e),window.addEventListener("hashchange",e),()=>{window.removeEventListener("popstate",e),window.removeEventListener("hashchange",e)}},[]);const{view:g,updateView:h}=(0,n.l)({kind:"postType",name:"ap_post",slug:"feed",defaultView:N,queryParams:i,onChangeQueryParams:e=>{const t=window.location.href,i=(0,d.getQueryArgs)(t),a=(0,d.addQueryArgs)(t,{...i,paged:e.page||void 0,search:e.search||void 0});window.history.pushState(null,"",a),l({page:e.page,search:e.search})}}),f=(0,a.useCallback)(e=>{const t=function(e,t){const i=t.includes("content")&&!e.includes("content"),a=t.includes("excerpt.rendered")&&!e.includes("excerpt.rendered"),r=!t.includes("content")&&e.includes("content"),n=!t.includes("excerpt.rendered")&&e.includes("excerpt.rendered");return i?t.filter(e=>"excerpt.rendered"!==e):a?t.filter(e=>"content"!==e):r&&!t.includes("excerpt.rendered")?[...t,"excerpt.rendered"]:n&&!t.includes("content")?[...t,"content"]:t}(g.fields||[],e.fields||[]);h({...e,fields:t})},[g.fields,h]),{feed:b,isResolving:y,totalItems:E,totalPages:P}=function({perPage:e=20,page:t=1,orderBy:i="date",order:r="desc",search:n="",userId:s,fields:d=["id","date","modified","title","excerpt","content","actor_info","status","link"]}={}){const c=null!=s,l=(0,a.useMemo)(()=>{const a={per_page:e,page:t,orderby:i,order:r,search:n,_fields:d};return c&&(a.user_id=s),a},[e,t,i,r,n,s,d,c]),{records:o,hasResolved:u,isResolving:g,totalItems:h,totalPages:f}=(0,p.useEntityRecords)("postType","ap_post",c?l:void 0);return{feed:c&&o||[],hasResolved:u,isResolving:g,totalItems:c?h:null,totalPages:c?f:null}}({perPage:g.perPage||20,page:g.page||1,orderBy:g.sort?.field||"date",order:g.sort?.direction||"desc",search:g.search||"",userId:t}),I=(0,a.useMemo)(()=>[x,w,_,m,v],[]),k=(0,a.useMemo)(()=>function(e,t){if(!e.fields)return e;const i=new Map(t.map((e,t)=>[e.id,t])),a=[...e.fields].sort((e,t)=>{var a,r;return(null!==(a=i.get(e))&&void 0!==a?a:1/0)-(null!==(r=i.get(t))&&void 0!==r?r:1/0)});return{...e,fields:a}}(g,I),[g,I]),[A,L]=(0,a.useState)([]),[M,T]=(0,a.useState)([]),[C,H]=(0,a.useState)(!1),V=(0,a.useRef)(0);(0,a.useEffect)(()=>{if(0===A.length)return;const e=A[0];b.some(t=>t.id.toString()===e)||L([])},[b,A]);const R=(0,a.useCallback)(t=>{if(L(t),0===t.length)return;const i=t[0],a=b.find(e=>e.id.toString()===i);a&&e(a.id)},[b,e]),D=(0,a.useCallback)(()=>{const e=g.page||1;C||e>=(P||1)||(H(!0),f({...g,page:e+1}))},[C,g,P,f]);return(0,a.useEffect)(()=>{const e=k.page||1,t=k.infiniteScrollEnabled;0!==b.length&&(e>1&&V.current===e||(1!==e&&t?(T(e=>{const t=new Set(e.map(e=>e.id)),i=b.filter(e=>!t.has(e.id));return i.length>0?[...e,...i]:e}),V.current=e,H(!1)):(T(b),V.current=e,H(!1))))},[b,k.page,k.search,k.infiniteScrollEnabled]),(0,o.jsx)(u,{title:(0,s.__)("Feed","activitypub"),subTitle:(0,s.__)("ActivityPub posts from your network","activitypub"),hasPadding:!1,children:(0,o.jsx)(r.A,{data:M,fields:I,view:k,onChangeView:f,isLoading:y||C,onClickItem:t=>e(t.id),isItemClickable:()=>!0,getItemId:e=>e.id.toString(),selection:A,onChangeSelection:R,empty:(0,o.jsx)("p",{children:k.search?(0,s.__)("No posts found.","activitypub"):(0,s.__)("No posts found in your feed. Posts from ActivityPub actors you follow will appear here.","activitypub")}),paginationInfo:{totalItems:E,totalPages:P,infiniteScrollHandler:D},defaultLayouts:j})})}}}]);
\ No newline at end of file
diff --git a/build/social-web/index.asset.php b/build/social-web/index.asset.php
index 7cf136da20..5ad8a84213 100644
--- a/build/social-web/index.asset.php
+++ b/build/social-web/index.asset.php
@@ -1 +1 @@
- array('react', 'react-dom', 'react-jsx-runtime', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-url', 'wp-warning'), 'version' => '79951448730011de2dd8');
+ array('react', 'react-dom', 'react-jsx-runtime', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-url', 'wp-warning'), 'version' => '658866a5e77c1bf57d37');
diff --git a/build/social-web/index.js b/build/social-web/index.js
index 4e1f409344..b4a7ca6e69 100644
--- a/build/social-web/index.js
+++ b/build/social-web/index.js
@@ -1,1871 +1,2 @@
-/******/ (() => { // webpackBootstrap
-/******/ "use strict";
-/******/ var __webpack_modules__ = ({
-
-/***/ "./src/social-web/components/actor-switcher/index.tsx":
-/*!************************************************************!*\
- !*** ./src/social-web/components/actor-switcher/index.tsx ***!
- \************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ ActorSwitcher)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data");
-/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _contexts_settings_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../contexts/settings-context */ "./src/social-web/contexts/settings-context.tsx");
-/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../store */ "./src/social-web/store/index.ts");
-/* harmony import */ var _site_icon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../site-icon */ "./src/social-web/components/site-icon/index.tsx");
-/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./style.scss */ "./src/social-web/components/actor-switcher/style.scss");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__);
-/**
- * Actor Switcher Component
- *
- * Displays current actor (user or site) and allows admins to toggle between them
- */
-
-
-
-
-
-
-
-
-
-
-function ActorSwitcher() {
- const {
- defaultAvatar,
- adminUrl
- } = (0,_contexts_settings_context__WEBPACK_IMPORTED_MODULE_4__.useSettings)();
- const {
- setActiveActor
- } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_store__WEBPACK_IMPORTED_MODULE_5__.STORE_NAME);
- const {
- currentUser,
- activeActorId,
- canManageSite
- } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => ({
- currentUser: select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__.store).getCurrentUser(),
- activeActorId: select(_store__WEBPACK_IMPORTED_MODULE_5__.STORE_NAME).getActiveActorId(),
- canManageSite: select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__.store).canUser('read', {
- kind: 'root',
- name: 'site'
- })
- }), []);
- const currentUserId = currentUser?.id;
-
- // Determine which actor info to display
- const isSiteActor = activeActorId === 0;
- const userAvatarUrl = currentUser?.avatar_urls?.[48] || defaultAvatar;
- const displayName = isSiteActor ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Site', 'activitypub') : currentUser?.name || '';
-
- // Toggle between user and site actor
- const toggleActor = () => {
- if (canManageSite && currentUserId) {
- const newActorId = activeActorId === 0 ? currentUserId : 0;
- setActiveActor(newActorId);
- }
- };
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button, {
- ...(canManageSite ? {
- onClick: toggleActor
- } : {
- href: `${adminUrl}profile.php`
- }),
- className: "actor-switcher",
- label: canManageSite ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Switch Actor', 'activitypub') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Profile', 'activitypub'),
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack, {
- spacing: 2,
- alignment: "center",
- children: [isSiteActor ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_site_icon__WEBPACK_IMPORTED_MODULE_6__["default"], {
- className: "actor-switcher__avatar"
- }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("img", {
- src: userAvatarUrl,
- alt: displayName,
- className: "actor-switcher__avatar",
- onError: e => {
- e.target.src = defaultAvatar;
- }
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("span", {
- className: "actor-switcher__name",
- children: displayName
- })]
- })
- });
-}
-
-/***/ }),
-
-/***/ "./src/social-web/components/actor-switcher/style.scss":
-/*!*************************************************************!*\
- !*** ./src/social-web/components/actor-switcher/style.scss ***!
- \*************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-// extracted by mini-css-extract-plugin
-
-
-/***/ }),
-
-/***/ "./src/social-web/components/layout/index.tsx":
-/*!****************************************************!*\
- !*** ./src/social-web/components/layout/index.tsx ***!
- \****************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ Layout: () => (/* binding */ Layout)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/commands */ "@wordpress/commands");
-/* harmony import */ var _wordpress_commands__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_commands__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _wordpress_notices__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/notices */ "@wordpress/notices");
-/* harmony import */ var _wordpress_notices__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_notices__WEBPACK_IMPORTED_MODULE_4__);
-/* harmony import */ var _sidebar__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../sidebar */ "./src/social-web/components/sidebar/index.tsx");
-/* harmony import */ var _panel__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../panel */ "./src/social-web/components/panel/index.tsx");
-/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../store */ "./src/social-web/store/index.ts");
-/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./style.scss */ "./src/social-web/components/layout/style.scss");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__);
-/**
- * Layout Component
- *
- * Three-panel layout system:
- * - Sidebar (300px fixed) - Navigation
- * - Stage (flexible) - Main content
- * - Inspector (380px fixed, optional) - Detail panel
- */
-
-
-
-
-
-
-
-
-
-
-
-// Lazy load route stages for better performance
-// Use magic comments to give chunks proper names
-
-const FeedStage = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.lazy)(() => Promise.all(/*! import() | social-web/feed-stage */[__webpack_require__.e("social-web/vendors"), __webpack_require__.e("social-web/style-feed-stage"), __webpack_require__.e("social-web/feed-stage")]).then(__webpack_require__.bind(__webpack_require__, /*! ../../routes/feed/stage */ "./src/social-web/routes/feed/stage.tsx")));
-
-// Lazy load inspector components
-const FeedInspector = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.lazy)(() => Promise.all(/*! import() | social-web/feed-inspector */[__webpack_require__.e("social-web/vendors"), __webpack_require__.e("social-web/feed-inspector")]).then(__webpack_require__.bind(__webpack_require__, /*! ../../routes/feed/inspector */ "./src/social-web/routes/feed/inspector.tsx")));
-
-/**
- * Parse the URL hash to extract section and item ID
- * Format: #/section or #/section/itemId
- */
-function parseHash() {
- const hash = window.location.hash.slice(1); // Remove #
- if (!hash || hash === '/') {
- return {
- section: 'feed',
- itemId: null
- };
- }
- const parts = hash.split('/').filter(Boolean);
- const section = parts[0] || 'feed';
- const itemId = parts[1] || null;
-
- // Convert itemId to number for feed
- if (section === 'feed' && itemId) {
- return {
- section,
- itemId: parseInt(itemId, 10)
- };
- }
- return {
- section,
- itemId
- };
-}
-
-/**
- * Update the URL hash without triggering a page reload
- *
- * @param {string} section Section name
- * @param {string|number|null} itemId Optional item ID
- */
-function updateHash(section, itemId) {
- const hash = itemId ? `#/${section}/${itemId}` : `#/${section}`;
- window.history.pushState(null, '', hash);
-}
-function Layout() {
- const [activeSection, setActiveSection] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)('feed');
- const [selectedItemId, setSelectedItemId] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
-
- // Get active actor ID
- const activeActorId = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_store__WEBPACK_IMPORTED_MODULE_7__.STORE_NAME).getActiveActorId(), []);
-
- // Track previous actor ID to detect changes
- const prevActiveActorId = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(activeActorId);
-
- // Get notices for the snackbar
- const notices = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
- const store = select(_wordpress_notices__WEBPACK_IMPORTED_MODULE_4__.store);
- return store.getNotices().filter(notice => notice.type === 'snackbar');
- }, []);
- const {
- removeNotice
- } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_wordpress_notices__WEBPACK_IMPORTED_MODULE_4__.store);
-
- // Initialize from URL hash on mount
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
- const {
- section,
- itemId
- } = parseHash();
- setActiveSection(section);
- setSelectedItemId(itemId);
- }, []);
-
- // Close inspector when actor changes
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
- if (prevActiveActorId.current !== activeActorId && selectedItemId) {
- setSelectedItemId(null);
- updateHash(activeSection);
- }
- prevActiveActorId.current = activeActorId;
- }, [activeActorId, selectedItemId, activeSection]);
-
- // Listen for hash changes (back/forward navigation).
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
- const syncUrlToState = () => {
- const {
- section,
- itemId
- } = parseHash();
- setActiveSection(section);
- setSelectedItemId(itemId);
- };
- window.addEventListener('hashchange', syncUrlToState);
- return () => {
- window.removeEventListener('hashchange', syncUrlToState);
- };
- }, []);
- const selectItem = id => {
- setSelectedItemId(id);
- updateHash(activeSection, id);
- };
- const closeInspector = () => {
- setSelectedItemId(null);
- updateHash(activeSection);
- };
- const navigate = section => {
- setActiveSection(section);
- setSelectedItemId(null);
- updateHash(section);
- };
-
- // Render main content (stage) with Suspense for lazy loading
- const renderStage = () => {
- const props = {
- onSelectItem: selectItem
- };
- let StageComponent;
- switch (activeSection) {
- case 'feed':
- default:
- StageComponent = FeedStage;
- }
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Suspense, {
- fallback: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
- style: {
- padding: '20px',
- textAlign: 'center'
- },
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Spinner, {})
- }),
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(StageComponent, {
- ...props
- })
- });
- };
-
- // Render detail panel (inspector) with Suspense for lazy loading
- const renderInspector = () => {
- if (!selectedItemId) {
- return null;
- }
- let InspectorComponent;
- let props;
- switch (activeSection) {
- case 'feed':
- default:
- // Feed inspector expects number type
- if (typeof selectedItemId !== 'number') {
- return null;
- }
- InspectorComponent = FeedInspector;
- props = {
- id: selectedItemId,
- onClose: closeInspector
- };
- }
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Suspense, {
- fallback: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
- style: {
- padding: '20px',
- textAlign: 'center'
- },
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Spinner, {})
- }),
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(InspectorComponent, {
- ...props
- })
- });
- };
- const showInspector = !!selectedItemId;
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
- className: "app-layout",
- "data-section": activeSection,
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_commands__WEBPACK_IMPORTED_MODULE_1__.CommandMenu, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
- className: "app-content",
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
- className: "sidebar-region",
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_sidebar__WEBPACK_IMPORTED_MODULE_5__["default"], {
- activeSection: activeSection,
- onNavigate: navigate
- })
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
- className: "stage-region",
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_panel__WEBPACK_IMPORTED_MODULE_6__["default"], {
- children: renderStage()
- })
- }), showInspector && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
- className: "inspector-region",
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_panel__WEBPACK_IMPORTED_MODULE_6__["default"], {
- children: renderInspector()
- })
- })]
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.SnackbarList, {
- notices: notices,
- onRemove: removeNotice
- })]
- });
-}
-
-/***/ }),
-
-/***/ "./src/social-web/components/layout/style.scss":
-/*!*****************************************************!*\
- !*** ./src/social-web/components/layout/style.scss ***!
- \*****************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-// extracted by mini-css-extract-plugin
-
-
-/***/ }),
-
-/***/ "./src/social-web/components/panel/index.tsx":
-/*!***************************************************!*\
- !*** ./src/social-web/components/panel/index.tsx ***!
- \***************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Panel)
-/* harmony export */ });
-/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
-/* harmony import */ var _themed_surface__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../themed-surface */ "./src/social-web/components/themed-surface/index.tsx");
-/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ "./src/social-web/components/panel/style.scss");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
-/**
- * Panel Component
- *
- * A reusable surface wrapper for themed content areas.
- * Uses ThemedSurface component with margin spacing.
- */
-
-
-
-
-
-function Panel({
- className,
- children
-}) {
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])('panel', className),
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_themed_surface__WEBPACK_IMPORTED_MODULE_1__["default"], {
- children: children
- })
- });
-}
-
-/***/ }),
-
-/***/ "./src/social-web/components/panel/style.scss":
-/*!****************************************************!*\
- !*** ./src/social-web/components/panel/style.scss ***!
- \****************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-// extracted by mini-css-extract-plugin
-
-
-/***/ }),
-
-/***/ "./src/social-web/components/sidebar/index.tsx":
-/*!*****************************************************!*\
- !*** ./src/social-web/components/sidebar/index.tsx ***!
- \*****************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Sidebar)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/chevron-left.js");
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/chevron-right.js");
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/cog.js");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
-/* harmony import */ var _contexts_settings_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../contexts/settings-context */ "./src/social-web/contexts/settings-context.tsx");
-/* harmony import */ var _site_hub__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../site-hub */ "./src/social-web/components/site-hub/index.tsx");
-/* harmony import */ var _actor_switcher__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../actor-switcher */ "./src/social-web/components/actor-switcher/index.tsx");
-/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./style.scss */ "./src/social-web/components/sidebar/style.scss");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__);
-/**
- * Sidebar Component
- *
- * Navigation sidebar with menu items for different sections
- */
-
-
-
-
-
-
-
-
-
-const menuItems = [{
- id: 'feed',
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Feed', 'activitypub')
-}];
-function Sidebar({
- activeSection,
- onNavigate
-}) {
- const {
- adminUrl
- } = (0,_contexts_settings_context__WEBPACK_IMPORTED_MODULE_5__.useSettings)();
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
- className: "sidebar",
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_site_hub__WEBPACK_IMPORTED_MODULE_6__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("nav", {
- className: "nav",
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack, {
- spacing: 3,
- alignment: "flex-start",
- className: "sidebar-navigation__icon-title",
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button, {
- className: "sidebar-navigation__button",
- size: "compact",
- icon: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.isRTL)() ? _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"] : _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__["default"],
- href: "/wp-admin/",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Go to the Dashboard', 'activitypub')
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHeading, {
- className: "sidebar-navigation__title",
- level: 1,
- size: 20,
- children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Social Web', 'activitypub')
- })]
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.NavigableMenu, {
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.MenuGroup, {
- children: menuItems.map(item => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.MenuItem, {
- isSelected: activeSection === item.id,
- onClick: () => onNavigate(item.id),
- className: "menu-item",
- children: [item.icon && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Icon, {
- icon: item.icon,
- size: 20
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("span", {
- children: item.label
- })]
- }, item.id))
- })
- })]
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
- className: "footer",
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack, {
- justify: "space-between",
- alignment: "center",
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_actor_switcher__WEBPACK_IMPORTED_MODULE_7__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button, {
- icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"],
- iconSize: 20,
- size: "compact",
- href: `${adminUrl}admin.php?page=activitypub`,
- target: "_blank",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Settings', 'activitypub'),
- className: "footer-settings-button"
- })]
- })
- })]
- });
-}
-
-/***/ }),
-
-/***/ "./src/social-web/components/sidebar/style.scss":
-/*!******************************************************!*\
- !*** ./src/social-web/components/sidebar/style.scss ***!
- \******************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-// extracted by mini-css-extract-plugin
-
-
-/***/ }),
-
-/***/ "./src/social-web/components/site-hub/index.tsx":
-/*!******************************************************!*\
- !*** ./src/social-web/components/site-hub/index.tsx ***!
- \******************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
-/* harmony export */ });
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data");
-/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities");
-/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__);
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/search.js");
-/* harmony import */ var _wordpress_commands__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/commands */ "@wordpress/commands");
-/* harmony import */ var _wordpress_commands__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_commands__WEBPACK_IMPORTED_MODULE_6__);
-/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes");
-/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_7__);
-/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
-/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_8__);
-/* harmony import */ var _site_icon__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../site-icon */ "./src/social-web/components/site-icon/index.tsx");
-/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./style.scss */ "./src/social-web/components/site-hub/style.scss");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__);
-/**
- * Site Hub Component
- *
- * Displays site icon, title, and command palette toggle
- */
-
-/**
- * WordPress dependencies
- */
-
-
-
-
-
-
-
-
-
-/**
- * Internal dependencies
- */
-
-
-
-function SiteHub() {
- const {
- homeUrl,
- siteTitle
- } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
- const {
- getEntityRecord
- } = select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_3__.store);
- const _base = getEntityRecord('root', '__unstableBase');
- return {
- homeUrl: _base?.home,
- siteTitle: !_base?.name && !!_base?.url ? (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_8__.filterURLForDisplay)(_base?.url) : _base?.name
- };
- }, []);
- const {
- open: openCommandCenter
- } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch)(_wordpress_commands__WEBPACK_IMPORTED_MODULE_6__.store);
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
- className: "site-hub",
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHStack, {
- justify: "flex-start",
- spacing: "0",
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
- className: "site-hub__icon-container",
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
- __next40pxDefaultSize: true,
- href: "/wp-admin/",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Go to the Dashboard', 'activitypub'),
- className: "site-hub__icon-button",
- style: {
- transform: 'scale(0.5333) translateX(-4px)',
- // Offset to position the icon 12px from viewport edge
- borderRadius: 4
- },
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_site_icon__WEBPACK_IMPORTED_MODULE_9__["default"], {
- className: "site-hub__icon"
- })
- })
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHStack, {
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
- className: "site-hub__title",
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
- variant: "link",
- href: homeUrl,
- target: "_blank",
- children: [(0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__.decodeEntities)(siteTitle), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.VisuallyHidden, {
- as: "span",
- children: /* translators: accessibility text */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('(opens in a new tab)', 'activitypub')
- })]
- })
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHStack, {
- spacing: 0,
- expanded: false,
- className: "site-hub__actions",
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
- size: "compact",
- className: "site-hub__command-button",
- icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__["default"],
- onClick: () => openCommandCenter(),
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Open command palette', 'activitypub'),
- shortcut: _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_7__.displayShortcut.primary('k')
- })
- })]
- })]
- })
- });
-}
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SiteHub);
-
-/***/ }),
-
-/***/ "./src/social-web/components/site-hub/style.scss":
-/*!*******************************************************!*\
- !*** ./src/social-web/components/site-hub/style.scss ***!
- \*******************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-// extracted by mini-css-extract-plugin
-
-
-/***/ }),
-
-/***/ "./src/social-web/components/site-icon/index.tsx":
-/*!*******************************************************!*\
- !*** ./src/social-web/components/site-icon/index.tsx ***!
- \*******************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
-/* harmony export */ });
-/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/wordpress.js");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
-/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data");
-/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_5__);
-/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./style.scss */ "./src/social-web/components/site-icon/style.scss");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__);
-/**
- * External dependencies
- */
-
-
-/**
- * WordPress dependencies
- */
-
-
-
-
-
-/**
- * Internal dependencies
- */
-
-
-function SiteIcon({
- className
-}) {
- const {
- isRequestingSite,
- siteIconUrl
- } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
- const {
- getEntityRecord
- } = select(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_5__.store);
- const siteData = getEntityRecord('root', '__unstableBase', undefined);
- return {
- isRequestingSite: !siteData,
- siteIconUrl: siteData?.site_icon_url
- };
- }, []);
- let icon = null;
- if (isRequestingSite) {
- icon = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
- className: "site-icon__image"
- });
- } else if (siteIconUrl) {
- icon = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("img", {
- className: "site-icon__image",
- alt: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Site Icon', 'activitypub'),
- src: siteIconUrl
- });
- } else {
- icon = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Icon, {
- className: "site-icon__icon",
- icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"],
- size: 48
- });
- }
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])(className, 'site-icon'),
- children: icon
- });
-}
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SiteIcon);
-
-/***/ }),
-
-/***/ "./src/social-web/components/site-icon/style.scss":
-/*!********************************************************!*\
- !*** ./src/social-web/components/site-icon/style.scss ***!
- \********************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-// extracted by mini-css-extract-plugin
-
-
-/***/ }),
-
-/***/ "./src/social-web/components/themed-surface/index.tsx":
-/*!************************************************************!*\
- !*** ./src/social-web/components/themed-surface/index.tsx ***!
- \************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ ThemedSurface)
-/* harmony export */ });
-/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
-/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/social-web/components/themed-surface/style.scss");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
-/**
- * ThemedSurface Component
- *
- * This component wraps content with appropriate theme context for consistent styling.
- */
-
-
-
-
-/**
- * ThemedSurface component
- *
- * Wraps content in a themed surface with light background.
- * Uses wpds design tokens that are provided by ThemeProvider context.
- */
-function ThemedSurface({
- className,
- children
-}) {
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])('themed-surface', className),
- children: children
- });
-}
-
-/***/ }),
-
-/***/ "./src/social-web/components/themed-surface/style.scss":
-/*!*************************************************************!*\
- !*** ./src/social-web/components/themed-surface/style.scss ***!
- \*************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-// extracted by mini-css-extract-plugin
-
-
-/***/ }),
-
-/***/ "./src/social-web/contexts/settings-context.tsx":
-/*!******************************************************!*\
- !*** ./src/social-web/contexts/settings-context.tsx ***!
- \******************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ SettingsProvider: () => (/* binding */ SettingsProvider),
-/* harmony export */ useSettings: () => (/* binding */ useSettings)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-/**
- * WordPress dependencies
- */
-
-
-/**
- * Internal dependencies
- */
-
-const SettingsContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createContext)(undefined);
-function SettingsProvider({
- children,
- settings
-}) {
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(SettingsContext.Provider, {
- value: settings,
- children: children
- });
-}
-function useSettings() {
- const settings = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useContext)(SettingsContext);
- if (!settings) {
- throw new Error('useSettings must be used within a SettingsProvider');
- }
- return settings;
-}
-
-/***/ }),
-
-/***/ "./src/social-web/index.tsx":
-/*!**********************************!*\
- !*** ./src/social-web/index.tsx ***!
- \**********************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ initialize: () => (/* binding */ initialize)
-/* harmony export */ });
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/keyboard-shortcuts */ "@wordpress/keyboard-shortcuts");
-/* harmony import */ var _wordpress_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _components_layout__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/layout */ "./src/social-web/components/layout/index.tsx");
-/* harmony import */ var _contexts_settings_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./contexts/settings-context */ "./src/social-web/contexts/settings-context.tsx");
-/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./store */ "./src/social-web/store/index.ts");
-/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./style.scss */ "./src/social-web/style.scss");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__);
-/**
- * WordPress dependencies
- */
-
-
-
-
-
-/**
- * Internal dependencies
- */
-
-
- // Import to register the store
- // Import all styles
-
-/**
- * Initialize the Social Web application.
- *
- * @param id The ID of the root element.
- * @param settings The editor settings.
- */
-
-function initialize(id, settings) {
- const target = document.getElementById(id);
- if (!target) {
- return;
- }
- const root = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createRoot)(target);
- root.render(/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_contexts_settings_context__WEBPACK_IMPORTED_MODULE_5__.SettingsProvider, {
- settings: settings,
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_3__.ShortcutProvider, {
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.SlotFillProvider, {
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_components_layout__WEBPACK_IMPORTED_MODULE_4__.Layout, {})
- })
- })
- }));
-}
-
-// Extend Window interface for type safety.
-
-// Export to window for inline script access.
-window.wp = window.wp || {};
-window.wp.activitypubSocialWeb = {
- initialize
-};
-
-/***/ }),
-
-/***/ "./src/social-web/store/actions.ts":
-/*!*****************************************!*\
- !*** ./src/social-web/store/actions.ts ***!
- \*****************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ actions: () => (/* binding */ actions)
-/* harmony export */ });
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_preferences__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/preferences */ "@wordpress/preferences");
-/* harmony import */ var _wordpress_preferences__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_preferences__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./types */ "./src/social-web/store/types.ts");
-/**
- * WordPress dependencies
- */
-
-
-
-/**
- * Internal dependencies
- */
-
-
-
-/**
- * Store actions
- */
-const actions = {
- *setActiveActor(actorId) {
- // Save to preferences
- yield (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)(_wordpress_preferences__WEBPACK_IMPORTED_MODULE_1__.store).set('activitypub/social-web', 'activeActorId', actorId);
-
- // Update state
- return {
- type: _types__WEBPACK_IMPORTED_MODULE_2__.SET_ACTIVE_ACTOR,
- actorId
- };
- }
-};
-
-/***/ }),
-
-/***/ "./src/social-web/store/index.ts":
-/*!***************************************!*\
- !*** ./src/social-web/store/index.ts ***!
- \***************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ STORE_NAME: () => (/* binding */ STORE_NAME),
-/* harmony export */ store: () => (/* binding */ store)
-/* harmony export */ });
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_data_controls__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data-controls */ "@wordpress/data-controls");
-/* harmony import */ var _wordpress_data_controls__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data_controls__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./actions */ "./src/social-web/store/actions.ts");
-/* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./selectors */ "./src/social-web/store/selectors.ts");
-/* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./reducer */ "./src/social-web/store/reducer.ts");
-/* harmony import */ var _resolvers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./resolvers */ "./src/social-web/store/resolvers.ts");
-/**
- * WordPress dependencies
- */
-
-
-
-/**
- * Internal dependencies
- */
-
-
-
-
-/**
- * Store name
- */
-const STORE_NAME = 'activitypub/social-web';
-
-/**
- * Store configuration
- */
-const storeConfig = {
- reducer: _reducer__WEBPACK_IMPORTED_MODULE_4__.reducer,
- actions: _actions__WEBPACK_IMPORTED_MODULE_2__.actions,
- selectors: _selectors__WEBPACK_IMPORTED_MODULE_3__.selectors,
- resolvers: _resolvers__WEBPACK_IMPORTED_MODULE_5__.resolvers,
- controls: _wordpress_data_controls__WEBPACK_IMPORTED_MODULE_1__.controls
-};
-
-/**
- * Create and register the store
- */
-const store = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.createReduxStore)(STORE_NAME, storeConfig);
-(0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.register)(store);
-
-/**
- * Re-export types for convenience
- */
-
-/**
- * Store types for TypeScript
- */
-
-/**
- * Type helpers for using the store
- */
-
-/***/ }),
-
-/***/ "./src/social-web/store/reducer.ts":
-/*!*****************************************!*\
- !*** ./src/social-web/store/reducer.ts ***!
- \*****************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ reducer: () => (/* binding */ reducer)
-/* harmony export */ });
-/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./src/social-web/store/types.ts");
-/**
- * Internal dependencies
- */
-
-
-
-/**
- * Store reducer
- */
-function reducer(state = _types__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_STATE, action) {
- switch (action.type) {
- case _types__WEBPACK_IMPORTED_MODULE_0__.SET_ACTIVE_ACTOR:
- return {
- ...state,
- activeActorId: action.actorId
- };
- default:
- return state;
- }
-}
-
-/***/ }),
-
-/***/ "./src/social-web/store/resolvers.ts":
-/*!*******************************************!*\
- !*** ./src/social-web/store/resolvers.ts ***!
- \*******************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ getActiveActorId: () => (/* binding */ getActiveActorId),
-/* harmony export */ resolvers: () => (/* binding */ resolvers)
-/* harmony export */ });
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_preferences__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/preferences */ "@wordpress/preferences");
-/* harmony import */ var _wordpress_preferences__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_preferences__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data");
-/* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./index */ "./src/social-web/store/index.ts");
-/**
- * WordPress dependencies
- */
-
-
-
-
-/**
- * Internal dependencies
- */
-
-
-/**
- * Resolver to initialize the active actor from preferences
- */
-function* getActiveActorId() {
- const preferences = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_wordpress_preferences__WEBPACK_IMPORTED_MODULE_1__.store);
- const savedActorId = preferences.get('activitypub/social-web', 'activeActorId');
- if (savedActorId !== undefined && savedActorId !== null) {
- // Restore saved actor ID
- yield (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)(_index__WEBPACK_IMPORTED_MODULE_3__.STORE_NAME).setActiveActor(savedActorId);
- } else {
- // No saved preference, initialize with current user ID
- const currentUser = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__.store).getCurrentUser();
- if (currentUser?.id) {
- yield (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)(_index__WEBPACK_IMPORTED_MODULE_3__.STORE_NAME).setActiveActor(currentUser.id);
- }
- }
-}
-const resolvers = {
- getActiveActorId
-};
-
-/***/ }),
-
-/***/ "./src/social-web/store/selectors.ts":
-/*!*******************************************!*\
- !*** ./src/social-web/store/selectors.ts ***!
- \*******************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ selectors: () => (/* binding */ selectors)
-/* harmony export */ });
-/**
- * Internal dependencies
- */
-
-/**
- * Store selectors
- */
-const selectors = {
- getActiveActorId(state) {
- return state.activeActorId;
- }
-};
-
-/***/ }),
-
-/***/ "./src/social-web/store/types.ts":
-/*!***************************************!*\
- !*** ./src/social-web/store/types.ts ***!
- \***************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ DEFAULT_STATE: () => (/* binding */ DEFAULT_STATE),
-/* harmony export */ SET_ACTIVE_ACTOR: () => (/* binding */ SET_ACTIVE_ACTOR)
-/* harmony export */ });
-/**
- * Store state interface
- */
-
-/**
- * Action Types
- */
-const SET_ACTIVE_ACTOR = 'SET_ACTIVE_ACTOR';
-/**
- * Initial state
- */
-const DEFAULT_STATE = {
- activeActorId: null
-};
-
-/***/ }),
-
-/***/ "./src/social-web/style.scss":
-/*!***********************************!*\
- !*** ./src/social-web/style.scss ***!
- \***********************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-// extracted by mini-css-extract-plugin
-
-
-/***/ }),
-
-/***/ "@wordpress/commands":
-/*!**********************************!*\
- !*** external ["wp","commands"] ***!
- \**********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["commands"];
-
-/***/ }),
-
-/***/ "@wordpress/components":
-/*!************************************!*\
- !*** external ["wp","components"] ***!
- \************************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["components"];
-
-/***/ }),
-
-/***/ "@wordpress/compose":
-/*!*********************************!*\
- !*** external ["wp","compose"] ***!
- \*********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["compose"];
-
-/***/ }),
-
-/***/ "@wordpress/core-data":
-/*!**********************************!*\
- !*** external ["wp","coreData"] ***!
- \**********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["coreData"];
-
-/***/ }),
-
-/***/ "@wordpress/data":
-/*!******************************!*\
- !*** external ["wp","data"] ***!
- \******************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["data"];
-
-/***/ }),
-
-/***/ "@wordpress/data-controls":
-/*!**************************************!*\
- !*** external ["wp","dataControls"] ***!
- \**************************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["dataControls"];
-
-/***/ }),
-
-/***/ "@wordpress/date":
-/*!******************************!*\
- !*** external ["wp","date"] ***!
- \******************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["date"];
-
-/***/ }),
-
-/***/ "@wordpress/dom":
-/*!*****************************!*\
- !*** external ["wp","dom"] ***!
- \*****************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["dom"];
-
-/***/ }),
-
-/***/ "@wordpress/element":
-/*!*********************************!*\
- !*** external ["wp","element"] ***!
- \*********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["element"];
-
-/***/ }),
-
-/***/ "@wordpress/html-entities":
-/*!**************************************!*\
- !*** external ["wp","htmlEntities"] ***!
- \**************************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["htmlEntities"];
-
-/***/ }),
-
-/***/ "@wordpress/i18n":
-/*!******************************!*\
- !*** external ["wp","i18n"] ***!
- \******************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["i18n"];
-
-/***/ }),
-
-/***/ "@wordpress/keyboard-shortcuts":
-/*!*******************************************!*\
- !*** external ["wp","keyboardShortcuts"] ***!
- \*******************************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["keyboardShortcuts"];
-
-/***/ }),
-
-/***/ "@wordpress/keycodes":
-/*!**********************************!*\
- !*** external ["wp","keycodes"] ***!
- \**********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["keycodes"];
-
-/***/ }),
-
-/***/ "@wordpress/notices":
-/*!*********************************!*\
- !*** external ["wp","notices"] ***!
- \*********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["notices"];
-
-/***/ }),
-
-/***/ "@wordpress/preferences":
-/*!*************************************!*\
- !*** external ["wp","preferences"] ***!
- \*************************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["preferences"];
-
-/***/ }),
-
-/***/ "@wordpress/primitives":
-/*!************************************!*\
- !*** external ["wp","primitives"] ***!
- \************************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["primitives"];
-
-/***/ }),
-
-/***/ "@wordpress/private-apis":
-/*!*************************************!*\
- !*** external ["wp","privateApis"] ***!
- \*************************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["privateApis"];
-
-/***/ }),
-
-/***/ "@wordpress/url":
-/*!*****************************!*\
- !*** external ["wp","url"] ***!
- \*****************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["url"];
-
-/***/ }),
-
-/***/ "@wordpress/warning":
-/*!*********************************!*\
- !*** external ["wp","warning"] ***!
- \*********************************/
-/***/ ((module) => {
-
-module.exports = window["wp"]["warning"];
-
-/***/ }),
-
-/***/ "react":
-/*!************************!*\
- !*** external "React" ***!
- \************************/
-/***/ ((module) => {
-
-module.exports = window["React"];
-
-/***/ }),
-
-/***/ "react-dom":
-/*!***************************!*\
- !*** external "ReactDOM" ***!
- \***************************/
-/***/ ((module) => {
-
-module.exports = window["ReactDOM"];
-
-/***/ }),
-
-/***/ "react/jsx-runtime":
-/*!**********************************!*\
- !*** external "ReactJSXRuntime" ***!
- \**********************************/
-/***/ ((module) => {
-
-module.exports = window["ReactJSXRuntime"];
-
-/***/ })
-
-/******/ });
-/************************************************************************/
-/******/ // The module cache
-/******/ var __webpack_module_cache__ = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/ // Check if module is in cache
-/******/ var cachedModule = __webpack_module_cache__[moduleId];
-/******/ if (cachedModule !== undefined) {
-/******/ return cachedModule.exports;
-/******/ }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = __webpack_module_cache__[moduleId] = {
-/******/ // no module.id needed
-/******/ // no module.loaded needed
-/******/ exports: {}
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/******/ // expose the modules object (__webpack_modules__)
-/******/ __webpack_require__.m = __webpack_modules__;
-/******/
-/************************************************************************/
-/******/ /* webpack/runtime/chunk loaded */
-/******/ (() => {
-/******/ var deferred = [];
-/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
-/******/ if(chunkIds) {
-/******/ priority = priority || 0;
-/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
-/******/ deferred[i] = [chunkIds, fn, priority];
-/******/ return;
-/******/ }
-/******/ var notFulfilled = Infinity;
-/******/ for (var i = 0; i < deferred.length; i++) {
-/******/ var [chunkIds, fn, priority] = deferred[i];
-/******/ var fulfilled = true;
-/******/ for (var j = 0; j < chunkIds.length; j++) {
-/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
-/******/ chunkIds.splice(j--, 1);
-/******/ } else {
-/******/ fulfilled = false;
-/******/ if(priority < notFulfilled) notFulfilled = priority;
-/******/ }
-/******/ }
-/******/ if(fulfilled) {
-/******/ deferred.splice(i--, 1)
-/******/ var r = fn();
-/******/ if (r !== undefined) result = r;
-/******/ }
-/******/ }
-/******/ return result;
-/******/ };
-/******/ })();
-/******/
-/******/ /* webpack/runtime/compat get default export */
-/******/ (() => {
-/******/ // getDefaultExport function for compatibility with non-harmony modules
-/******/ __webpack_require__.n = (module) => {
-/******/ var getter = module && module.__esModule ?
-/******/ () => (module['default']) :
-/******/ () => (module);
-/******/ __webpack_require__.d(getter, { a: getter });
-/******/ return getter;
-/******/ };
-/******/ })();
-/******/
-/******/ /* webpack/runtime/create fake namespace object */
-/******/ (() => {
-/******/ 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
-/******/ // mode & 2: merge all properties of value into the ns
-/******/ // mode & 4: return value when already ns object
-/******/ // mode & 16: return value when it's Promise-like
-/******/ // mode & 8|1: behave like require
-/******/ __webpack_require__.t = function(value, mode) {
-/******/ if(mode & 1) value = this(value);
-/******/ if(mode & 8) return value;
-/******/ if(typeof value === 'object' && value) {
-/******/ if((mode & 4) && value.__esModule) return value;
-/******/ if((mode & 16) && typeof value.then === 'function') return value;
-/******/ }
-/******/ var ns = Object.create(null);
-/******/ __webpack_require__.r(ns);
-/******/ var def = {};
-/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
-/******/ for(var current = mode & 2 && value; (typeof current == 'object' || typeof current == 'function') && !~leafPrototypes.indexOf(current); current = getProto(current)) {
-/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
-/******/ }
-/******/ def['default'] = () => (value);
-/******/ __webpack_require__.d(ns, def);
-/******/ return ns;
-/******/ };
-/******/ })();
-/******/
-/******/ /* webpack/runtime/define property getters */
-/******/ (() => {
-/******/ // define getter functions for harmony exports
-/******/ __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/ensure chunk */
-/******/ (() => {
-/******/ __webpack_require__.f = {};
-/******/ // This file contains only the entry chunk.
-/******/ // The chunk loading function for additional chunks
-/******/ __webpack_require__.e = (chunkId) => {
-/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
-/******/ __webpack_require__.f[key](chunkId, promises);
-/******/ return promises;
-/******/ }, []));
-/******/ };
-/******/ })();
-/******/
-/******/ /* webpack/runtime/get javascript chunk filename */
-/******/ (() => {
-/******/ // This function allow to reference async chunks
-/******/ __webpack_require__.u = (chunkId) => {
-/******/ // return url for filenames not based on template
-/******/ if ({"social-web/feed-stage":1,"social-web/feed-inspector":1}[chunkId]) return "" + chunkId + ".js";
-/******/ // return url for filenames based on template
-/******/ return undefined;
-/******/ };
-/******/ })();
-/******/
-/******/ /* webpack/runtime/get mini-css chunk filename */
-/******/ (() => {
-/******/ // This function allow to reference async chunks
-/******/ __webpack_require__.miniCssF = (chunkId) => {
-/******/ // return url for filenames based on template
-/******/ return "" + chunkId + ".css";
-/******/ };
-/******/ })();
-/******/
-/******/ /* webpack/runtime/global */
-/******/ (() => {
-/******/ __webpack_require__.g = (function() {
-/******/ if (typeof globalThis === 'object') return globalThis;
-/******/ try {
-/******/ return this || new Function('return this')();
-/******/ } catch (e) {
-/******/ if (typeof window === 'object') return window;
-/******/ }
-/******/ })();
-/******/ })();
-/******/
-/******/ /* webpack/runtime/hasOwnProperty shorthand */
-/******/ (() => {
-/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
-/******/ })();
-/******/
-/******/ /* webpack/runtime/load script */
-/******/ (() => {
-/******/ var inProgress = {};
-/******/ var dataWebpackPrefix = "wordpress-activitypub:";
-/******/ // loadScript function to load a script via script tag
-/******/ __webpack_require__.l = (url, done, key, chunkId) => {
-/******/ if(inProgress[url]) { inProgress[url].push(done); return; }
-/******/ var script, needAttach;
-/******/ if(key !== undefined) {
-/******/ var scripts = document.getElementsByTagName("script");
-/******/ for(var i = 0; i < scripts.length; i++) {
-/******/ var s = scripts[i];
-/******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
-/******/ }
-/******/ }
-/******/ if(!script) {
-/******/ needAttach = true;
-/******/ script = document.createElement('script');
-/******/
-/******/ script.charset = 'utf-8';
-/******/ if (__webpack_require__.nc) {
-/******/ script.setAttribute("nonce", __webpack_require__.nc);
-/******/ }
-/******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
-/******/
-/******/ script.src = url;
-/******/ }
-/******/ inProgress[url] = [done];
-/******/ var onScriptComplete = (prev, event) => {
-/******/ // avoid mem leaks in IE.
-/******/ script.onerror = script.onload = null;
-/******/ clearTimeout(timeout);
-/******/ var doneFns = inProgress[url];
-/******/ delete inProgress[url];
-/******/ script.parentNode && script.parentNode.removeChild(script);
-/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
-/******/ if(prev) return prev(event);
-/******/ }
-/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
-/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
-/******/ script.onload = onScriptComplete.bind(null, script.onload);
-/******/ needAttach && document.head.appendChild(script);
-/******/ };
-/******/ })();
-/******/
-/******/ /* webpack/runtime/make namespace object */
-/******/ (() => {
-/******/ // define __esModule on 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/publicPath */
-/******/ (() => {
-/******/ var scriptUrl;
-/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
-/******/ var document = __webpack_require__.g.document;
-/******/ if (!scriptUrl && document) {
-/******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
-/******/ scriptUrl = document.currentScript.src;
-/******/ if (!scriptUrl) {
-/******/ var scripts = document.getElementsByTagName("script");
-/******/ if(scripts.length) {
-/******/ var i = scripts.length - 1;
-/******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
-/******/ }
-/******/ }
-/******/ }
-/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
-/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
-/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
-/******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
-/******/ __webpack_require__.p = scriptUrl + "../";
-/******/ })();
-/******/
-/******/ /* webpack/runtime/css loading */
-/******/ (() => {
-/******/ if (typeof document === "undefined") return;
-/******/ var createStylesheet = (chunkId, fullhref, oldTag, resolve, reject) => {
-/******/ var linkTag = document.createElement("link");
-/******/
-/******/ linkTag.rel = "stylesheet";
-/******/ linkTag.type = "text/css";
-/******/ if (__webpack_require__.nc) {
-/******/ linkTag.nonce = __webpack_require__.nc;
-/******/ }
-/******/ var onLinkComplete = (event) => {
-/******/ // avoid mem leaks.
-/******/ linkTag.onerror = linkTag.onload = null;
-/******/ if (event.type === 'load') {
-/******/ resolve();
-/******/ } else {
-/******/ var errorType = event && event.type;
-/******/ var realHref = event && event.target && event.target.href || fullhref;
-/******/ var err = new Error("Loading CSS chunk " + chunkId + " failed.\n(" + errorType + ": " + realHref + ")");
-/******/ err.name = "ChunkLoadError";
-/******/ err.code = "CSS_CHUNK_LOAD_FAILED";
-/******/ err.type = errorType;
-/******/ err.request = realHref;
-/******/ if (linkTag.parentNode) linkTag.parentNode.removeChild(linkTag)
-/******/ reject(err);
-/******/ }
-/******/ }
-/******/ linkTag.onerror = linkTag.onload = onLinkComplete;
-/******/ linkTag.href = fullhref;
-/******/
-/******/
-/******/ if (oldTag) {
-/******/ oldTag.parentNode.insertBefore(linkTag, oldTag.nextSibling);
-/******/ } else {
-/******/ document.head.appendChild(linkTag);
-/******/ }
-/******/ return linkTag;
-/******/ };
-/******/ var findStylesheet = (href, fullhref) => {
-/******/ var existingLinkTags = document.getElementsByTagName("link");
-/******/ for(var i = 0; i < existingLinkTags.length; i++) {
-/******/ var tag = existingLinkTags[i];
-/******/ var dataHref = tag.getAttribute("data-href") || tag.getAttribute("href");
-/******/ if(tag.rel === "stylesheet" && (dataHref === href || dataHref === fullhref)) return tag;
-/******/ }
-/******/ var existingStyleTags = document.getElementsByTagName("style");
-/******/ for(var i = 0; i < existingStyleTags.length; i++) {
-/******/ var tag = existingStyleTags[i];
-/******/ var dataHref = tag.getAttribute("data-href");
-/******/ if(dataHref === href || dataHref === fullhref) return tag;
-/******/ }
-/******/ };
-/******/ var loadStylesheet = (chunkId) => {
-/******/ return new Promise((resolve, reject) => {
-/******/ var href = __webpack_require__.miniCssF(chunkId);
-/******/ var fullhref = __webpack_require__.p + href;
-/******/ if(findStylesheet(href, fullhref)) return resolve();
-/******/ createStylesheet(chunkId, fullhref, null, resolve, reject);
-/******/ });
-/******/ }
-/******/ // object to store loaded CSS chunks
-/******/ var installedCssChunks = {
-/******/ "social-web/index": 0
-/******/ };
-/******/
-/******/ __webpack_require__.f.miniCss = (chunkId, promises) => {
-/******/ var cssChunks = {"social-web/style-feed-stage":1};
-/******/ if(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);
-/******/ else if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {
-/******/ promises.push(installedCssChunks[chunkId] = loadStylesheet(chunkId).then(() => {
-/******/ installedCssChunks[chunkId] = 0;
-/******/ }, (e) => {
-/******/ delete installedCssChunks[chunkId];
-/******/ throw e;
-/******/ }));
-/******/ }
-/******/ };
-/******/
-/******/ // no hmr
-/******/
-/******/ // no prefetching
-/******/
-/******/ // no preloaded
-/******/ })();
-/******/
-/******/ /* webpack/runtime/jsonp chunk loading */
-/******/ (() => {
-/******/ // no baseURI
-/******/
-/******/ // object to store loaded and loading chunks
-/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
-/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
-/******/ var installedChunks = {
-/******/ "social-web/index": 0,
-/******/ "social-web/style-index": 0
-/******/ };
-/******/
-/******/ __webpack_require__.f.j = (chunkId, promises) => {
-/******/ // JSONP chunk loading for javascript
-/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
-/******/ if(installedChunkData !== 0) { // 0 means "already installed".
-/******/
-/******/ // a Promise means "currently loading".
-/******/ if(installedChunkData) {
-/******/ promises.push(installedChunkData[2]);
-/******/ } else {
-/******/ if(!/^social\-web\/style\-(feed\-stage|index)$/.test(chunkId)) {
-/******/ // setup Promise in chunk cache
-/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
-/******/ promises.push(installedChunkData[2] = promise);
-/******/
-/******/ // start chunk loading
-/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
-/******/ // create error before stack unwound to get useful stacktrace later
-/******/ var error = new Error();
-/******/ var loadingEnded = (event) => {
-/******/ if(__webpack_require__.o(installedChunks, chunkId)) {
-/******/ installedChunkData = installedChunks[chunkId];
-/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
-/******/ if(installedChunkData) {
-/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
-/******/ var realSrc = event && event.target && event.target.src;
-/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
-/******/ error.name = 'ChunkLoadError';
-/******/ error.type = errorType;
-/******/ error.request = realSrc;
-/******/ installedChunkData[1](error);
-/******/ }
-/******/ }
-/******/ };
-/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
-/******/ } else installedChunks[chunkId] = 0;
-/******/ }
-/******/ }
-/******/ };
-/******/
-/******/ // no prefetching
-/******/
-/******/ // no preloaded
-/******/
-/******/ // no HMR
-/******/
-/******/ // no HMR manifest
-/******/
-/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
-/******/
-/******/ // install a JSONP callback for chunk loading
-/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
-/******/ var [chunkIds, moreModules, runtime] = data;
-/******/ // add "moreModules" to the modules object,
-/******/ // then flag all "chunkIds" as loaded and fire callback
-/******/ var moduleId, chunkId, i = 0;
-/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
-/******/ for(moduleId in moreModules) {
-/******/ if(__webpack_require__.o(moreModules, moduleId)) {
-/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
-/******/ }
-/******/ }
-/******/ if(runtime) var result = runtime(__webpack_require__);
-/******/ }
-/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
-/******/ for(;i < chunkIds.length; i++) {
-/******/ chunkId = chunkIds[i];
-/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
-/******/ installedChunks[chunkId][0]();
-/******/ }
-/******/ installedChunks[chunkId] = 0;
-/******/ }
-/******/ return __webpack_require__.O(result);
-/******/ }
-/******/
-/******/ var chunkLoadingGlobal = globalThis["webpackChunkwordpress_activitypub"] = globalThis["webpackChunkwordpress_activitypub"] || [];
-/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
-/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
-/******/ })();
-/******/
-/************************************************************************/
-/******/
-/******/ // startup
-/******/ // Load entry module and return exports
-/******/ // This entry module depends on other loaded chunks and execution need to be delayed
-/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["social-web/vendors","social-web/style-index"], () => (__webpack_require__("./src/social-web/index.tsx")))
-/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
-/******/
-/******/ })()
-;
-//# sourceMappingURL=index.js.map
\ No newline at end of file
+(()=>{"use strict";var e,t,r,n,i,s={17:(e,t,r)=>{r.d(t,{E:()=>u});var n=r(143);const i=window.wp.dataControls;var s=r(233);const o="SET_ACTIVE_ACTOR",a={activeActorId:null},c={*setActiveActor(e){return yield(0,n.dispatch)(s.store).set("activitypub/social-web","activeActorId",e),{type:o,actorId:e}}};var l=r(582);const d={getActiveActorId:function*(){const e=(0,n.select)(s.store).get("activitypub/social-web","activeActorId");if(null!=e)yield(0,n.dispatch)(u).setActiveActor(e);else{const e=(0,n.select)(l.store).getCurrentUser();e?.id&&(yield(0,n.dispatch)(u).setActiveActor(e.id))}}},u="activitypub/social-web",p={reducer:function(e=a,t){return t.type===o?{...e,activeActorId:t.actorId}:e},actions:c,selectors:{getActiveActorId:e=>e.activeActorId},resolvers:d,controls:i.controls},h=(0,n.createReduxStore)(u,p);(0,n.register)(h)},53:e=>{e.exports=window.wp.privateApis},87:e=>{e.exports=window.wp.element},107:e=>{e.exports=window.wp.dom},143:e=>{e.exports=window.wp.data},217:(e,t,r)=>{r(609);var n=r(87),i=r(427);const s=window.wp.keyboardShortcuts,o=window.wp.commands;var a=r(143);const c=window.wp.notices;var l=r(655),d=r(988),u=r(684),p=r(723),h=r(375),m=r(582),v=r(537),f=r(307),w=r(558),b=r(832),g=r(164),x=r(644),_=r(790);const y=function({className:e}){const{isRequestingSite:t,siteIconUrl:r}=(0,a.useSelect)(e=>{const{getEntityRecord:t}=e(m.store),r=t("root","__unstableBase",void 0);return{isRequestingSite:!r,siteIconUrl:r?.site_icon_url}},[]);let n=null;return n=t?(0,_.jsx)("div",{className:"site-icon__image"}):r?(0,_.jsx)("img",{className:"site-icon__image",alt:(0,p.__)("Site Icon","activitypub"),src:r}):(0,_.jsx)(i.Icon,{className:"site-icon__icon",icon:x.A,size:48}),(0,_.jsx)("div",{className:(0,g.A)(e,"site-icon"),children:n})},j=function(){const{homeUrl:e,siteTitle:t}=(0,a.useSelect)(e=>{const{getEntityRecord:t}=e(m.store),r=t("root","__unstableBase");return{homeUrl:r?.home,siteTitle:!r?.name&&r?.url?(0,b.filterURLForDisplay)(r?.url):r?.name}},[]),{open:r}=(0,a.useDispatch)(o.store);return(0,_.jsx)("div",{className:"site-hub",children:(0,_.jsxs)(i.__experimentalHStack,{justify:"flex-start",spacing:"0",children:[(0,_.jsx)("div",{className:"site-hub__icon-container",children:(0,_.jsx)(i.Button,{__next40pxDefaultSize:!0,href:"/wp-admin/",label:(0,p.__)("Go to the Dashboard","activitypub"),className:"site-hub__icon-button",style:{transform:"scale(0.5333) translateX(-4px)",borderRadius:4},children:(0,_.jsx)(y,{className:"site-hub__icon"})})}),(0,_.jsxs)(i.__experimentalHStack,{children:[(0,_.jsx)("div",{className:"site-hub__title",children:(0,_.jsxs)(i.Button,{variant:"link",href:e,target:"_blank",children:[(0,v.decodeEntities)(t),(0,_.jsx)(i.VisuallyHidden,{as:"span",children:/* translators: accessibility text */ /* translators: accessibility text */
+(0,p.__)("(opens in a new tab)","activitypub")})]})}),(0,_.jsx)(i.__experimentalHStack,{spacing:0,expanded:!1,className:"site-hub__actions",children:(0,_.jsx)(i.Button,{size:"compact",className:"site-hub__command-button",icon:f.A,onClick:()=>r(),label:(0,p.__)("Open command palette","activitypub"),shortcut:w.displayShortcut.primary("k")})})]})]})})};var S=r(17);function N(){const{defaultAvatar:e,adminUrl:t}=(0,h.t)(),{setActiveActor:r}=(0,a.useDispatch)(S.E),{currentUser:n,activeActorId:s,canManageSite:o}=(0,a.useSelect)(e=>({currentUser:e(m.store).getCurrentUser(),activeActorId:e(S.E).getActiveActorId(),canManageSite:e(m.store).canUser("read",{kind:"root",name:"site"})}),[]),c=n?.id,l=0===s,d=n?.avatar_urls?.[48]||e,u=l?(0,p.__)("Site","activitypub"):n?.name||"";return(0,_.jsx)(i.Button,{...o?{onClick:()=>{o&&c&&r(0===s?c:0)}}:{href:`${t}profile.php`},className:"actor-switcher",label:o?(0,p.__)("Switch Actor","activitypub"):(0,p.__)("Profile","activitypub"),children:(0,_.jsxs)(i.__experimentalHStack,{spacing:2,alignment:"center",children:[l?(0,_.jsx)(y,{className:"actor-switcher__avatar"}):(0,_.jsx)("img",{src:d,alt:u,className:"actor-switcher__avatar",onError:t=>{t.target.src=e}}),(0,_.jsx)("span",{className:"actor-switcher__name",children:u})]})})}const A=[{id:"feed",label:(0,p.__)("Feed","activitypub")}];function k({activeSection:e,onNavigate:t}){const{adminUrl:r}=(0,h.t)();return(0,_.jsxs)("div",{className:"sidebar",children:[(0,_.jsx)(j,{}),(0,_.jsxs)("nav",{className:"nav",children:[(0,_.jsxs)(i.__experimentalHStack,{spacing:3,alignment:"flex-start",className:"sidebar-navigation__icon-title",children:[(0,_.jsx)(i.Button,{className:"sidebar-navigation__button",size:"compact",icon:(0,p.isRTL)()?l.A:d.A,href:"/wp-admin/",label:(0,p.__)("Go to the Dashboard","activitypub")}),(0,_.jsx)(i.__experimentalHeading,{className:"sidebar-navigation__title",level:1,size:20,children:(0,p.__)("Social Web","activitypub")})]}),(0,_.jsx)(i.NavigableMenu,{children:(0,_.jsx)(i.MenuGroup,{children:A.map(r=>(0,_.jsxs)(i.MenuItem,{isSelected:e===r.id,onClick:()=>t(r.id),className:"menu-item",children:[r.icon&&(0,_.jsx)(i.Icon,{icon:r.icon,size:20}),(0,_.jsx)("span",{children:r.label})]},r.id))})})]}),(0,_.jsx)("div",{className:"footer",children:(0,_.jsxs)(i.__experimentalHStack,{justify:"space-between",alignment:"center",children:[(0,_.jsx)(N,{}),(0,_.jsx)(i.Button,{icon:u.A,iconSize:20,size:"compact",href:`${r}admin.php?page=activitypub`,target:"_blank",label:(0,p.__)("Settings","activitypub"),className:"footer-settings-button"})]})})]})}function E({className:e,children:t}){return(0,_.jsx)("div",{className:(0,g.A)("themed-surface",e),children:t})}function I({className:e,children:t}){return(0,_.jsx)("div",{className:(0,g.A)("panel",e),children:(0,_.jsx)(E,{children:t})})}const C=(0,n.lazy)(()=>Promise.all([r.e(803),r.e(755),r.e(303)]).then(r.bind(r,658))),O=(0,n.lazy)(()=>Promise.all([r.e(803),r.e(322)]).then(r.bind(r,42)));function P(){const e=window.location.hash.slice(1);if(!e||"/"===e)return{section:"feed",itemId:null};const t=e.split("/").filter(Boolean),r=t[0]||"feed",n=t[1]||null;return"feed"===r&&n?{section:r,itemId:parseInt(n,10)}:{section:r,itemId:n}}function T(e,t){const r=t?`#/${e}/${t}`:`#/${e}`;window.history.pushState(null,"",r)}function R(){const[e,t]=(0,n.useState)("feed"),[r,s]=(0,n.useState)(null),l=(0,a.useSelect)(e=>e(S.E).getActiveActorId(),[]),d=(0,n.useRef)(l),u=(0,a.useSelect)(e=>e(c.store).getNotices().filter(e=>"snackbar"===e.type),[]),{removeNotice:p}=(0,a.useDispatch)(c.store);(0,n.useEffect)(()=>{const{section:e,itemId:r}=P();t(e),s(r)},[]),(0,n.useEffect)(()=>{d.current!==l&&r&&(s(null),T(e)),d.current=l},[l,r,e]),(0,n.useEffect)(()=>{const e=()=>{const{section:e,itemId:r}=P();t(e),s(r)};return window.addEventListener("hashchange",e),()=>{window.removeEventListener("hashchange",e)}},[]);const h=t=>{s(t),T(e,t)},m=()=>{s(null),T(e)},v=!!r;return(0,_.jsxs)("div",{className:"app-layout","data-section":e,children:[(0,_.jsx)(o.CommandMenu,{}),(0,_.jsxs)("div",{className:"app-content",children:[(0,_.jsx)("div",{className:"sidebar-region",children:(0,_.jsx)(k,{activeSection:e,onNavigate:e=>{t(e),s(null),T(e)}})}),(0,_.jsx)("div",{className:"stage-region",children:(0,_.jsx)(I,{children:(()=>{const e={onSelectItem:h};let t;return t=C,(0,_.jsx)(n.Suspense,{fallback:(0,_.jsx)("div",{style:{padding:"20px",textAlign:"center"},children:(0,_.jsx)(i.Spinner,{})}),children:(0,_.jsx)(t,{...e})})})()})}),v&&(0,_.jsx)("div",{className:"inspector-region",children:(0,_.jsx)(I,{children:(()=>{if(!r)return null;let e,t;return"number"!=typeof r?null:(e=O,t={id:r,onClose:m},(0,_.jsx)(n.Suspense,{fallback:(0,_.jsx)("div",{style:{padding:"20px",textAlign:"center"},children:(0,_.jsx)(i.Spinner,{})}),children:(0,_.jsx)(e,{...t})}))})()})})]}),(0,_.jsx)(i.SnackbarList,{notices:u,onRemove:p})]})}window.wp=window.wp||{},window.wp.activitypubSocialWeb={initialize:function(e,t){const r=document.getElementById(e);r&&(0,n.createRoot)(r).render((0,_.jsx)(h.Z,{settings:t,children:(0,_.jsx)(s.ShortcutProvider,{children:(0,_.jsx)(i.SlotFillProvider,{children:(0,_.jsx)(R,{})})})}))}}},233:e=>{e.exports=window.wp.preferences},375:(e,t,r)=>{r.d(t,{Z:()=>o,t:()=>a});var n=r(87),i=r(790);const s=(0,n.createContext)(void 0);function o({children:e,settings:t}){return(0,i.jsx)(s.Provider,{value:t,children:e})}function a(){const e=(0,n.useContext)(s);if(!e)throw new Error("useSettings must be used within a SettingsProvider");return e}},427:e=>{e.exports=window.wp.components},443:e=>{e.exports=window.wp.date},491:e=>{e.exports=window.wp.compose},537:e=>{e.exports=window.wp.htmlEntities},558:e=>{e.exports=window.wp.keycodes},573:e=>{e.exports=window.wp.primitives},582:e=>{e.exports=window.wp.coreData},609:e=>{e.exports=window.React},723:e=>{e.exports=window.wp.i18n},790:e=>{e.exports=window.ReactJSXRuntime},795:e=>{e.exports=window.ReactDOM},832:e=>{e.exports=window.wp.url},979:e=>{e.exports=window.wp.warning}},o={};function a(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}};return s[e](r,r.exports,a),r.exports}a.m=s,e=[],a.O=(t,r,n,i)=>{if(!r){var s=1/0;for(d=0;d=i)&&Object.keys(a.O).every(e=>a.O[e](r[c]))?r.splice(c--,1):(o=!1,i0&&e[d-1][2]>i;d--)e[d]=e[d-1];e[d]=[r,n,i]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(e,n){if(1&n&&(e=this(e)),8&n)return e;if("object"==typeof e&&e){if(4&n&&e.__esModule)return e;if(16&n&&"function"==typeof e.then)return e}var i=Object.create(null);a.r(i);var s={};t=t||[null,r({}),r([]),r(r)];for(var o=2&n&&e;("object"==typeof o||"function"==typeof o)&&!~t.indexOf(o);o=r(o))Object.getOwnPropertyNames(o).forEach(t=>s[t]=()=>e[t]);return s.default=()=>e,a.d(i,s),i},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((t,r)=>(a.f[r](e,t),t),[])),a.u=e=>303===e?"social-web/feed-stage.js":322===e?"social-web/feed-inspector.js":void 0,a.miniCssF=e=>"social-web/style-feed-stage.css",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},i="wordpress-activitypub:",a.l=(e,t,r,s)=>{if(n[e])n[e].push(t);else{var o,c;if(void 0!==r)for(var l=document.getElementsByTagName("script"),d=0;d{o.onerror=o.onload=null,clearTimeout(h);var i=n[e];if(delete n[e],o.parentNode&&o.parentNode.removeChild(o),i&&i.forEach(e=>e(r)),t)return t(r)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=p.bind(null,o.onerror),o.onload=p.bind(null,o.onload),c&&document.head.appendChild(o)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e+"../"})(),(()=>{if("undefined"!=typeof document){var e={994:0};a.f.miniCss=(t,r)=>{e[t]?r.push(e[t]):0!==e[t]&&{755:1}[t]&&r.push(e[t]=(e=>new Promise((t,r)=>{var n=a.miniCssF(e),i=a.p+n;if(((e,t)=>{for(var r=document.getElementsByTagName("link"),n=0;n{var s=document.createElement("link");s.rel="stylesheet",s.type="text/css",a.nc&&(s.nonce=a.nc),s.onerror=s.onload=r=>{if(s.onerror=s.onload=null,"load"===r.type)n();else{var o=r&&r.type,a=r&&r.target&&r.target.href||t,c=new Error("Loading CSS chunk "+e+" failed.\n("+o+": "+a+")");c.name="ChunkLoadError",c.code="CSS_CHUNK_LOAD_FAILED",c.type=o,c.request=a,s.parentNode&&s.parentNode.removeChild(s),i(c)}},s.href=t,document.head.appendChild(s)})(e,i,0,t,r)}))(t).then(()=>{e[t]=0},r=>{throw delete e[t],r}))}}})(),(()=>{var e={994:0,982:0};a.f.j=(t,r)=>{var n=a.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else if(/^(755|982)$/.test(t))e[t]=0;else{var i=new Promise((r,i)=>n=e[t]=[r,i]);r.push(n[2]=i);var s=a.p+a.u(t),o=new Error;a.l(s,r=>{if(a.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),s=r&&r.target&&r.target.src;o.message="Loading chunk "+t+" failed.\n("+i+": "+s+")",o.name="ChunkLoadError",o.type=i,o.request=s,n[1](o)}},"chunk-"+t,t)}},a.O.j=t=>0===e[t];var t=(t,r)=>{var n,i,[s,o,c]=r,l=0;if(s.some(t=>0!==e[t])){for(n in o)a.o(o,n)&&(a.m[n]=o[n]);if(c)var d=c(a)}for(t&&t(r);la(217));c=a.O(c)})();
\ No newline at end of file
diff --git a/build/social-web/style-feed-stage-rtl.css b/build/social-web/style-feed-stage-rtl.css
index 0002636269..4852d6bf0e 100644
--- a/build/social-web/style-feed-stage-rtl.css
+++ b/build/social-web/style-feed-stage-rtl.css
@@ -1,354 +1,4 @@
-/*!**************************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/routes/feed/style.scss ***!
- \**************************************************************************************************************************************************************************************************************************************************************/
-@charset "UTF-8";
-/**
- * Feed view styles
- * Minimal styling - relies on WordPress/DataViews defaults
- */
-.app-layout[data-section=feed] .inspector-region {
- width: 50%;
-}
-.dataviews-footer:empty {
- border: 0;
- padding: 0;
-}
-.dataviews-view-list .dataviews-view-list__item {
- cursor: pointer;
-}
-.dataviews-view-list .dataviews-view-list__field {
- width: 100%;
-}
-.activitypub-feed-post {
- border-bottom: var(--wpds-border-width-control, 1px) solid var(--wpds-color-stroke-neutral-weak, #dcdcde);
- min-width: 0;
- max-width: 100%;
-}
-.activitypub-feed-post:last-child {
- border-bottom: none;
-}
-.activitypub-feed-post-meta {
- display: flex;
- align-items: center;
- gap: var(--wpds-spacing-20, 8px);
- margin-bottom: var(--wpds-spacing-30, 12px);
- font-size: var(--wpds-font-size-small, 13px);
- color: var(--wpds-color-fg-secondary, #646970);
-}
-.activitypub-feed-post-meta .activitypub-feed-avatar {
- width: var(--wpds-spacing-50, 20px);
- height: var(--wpds-spacing-50, 20px);
- border-radius: 50%;
- -o-object-fit: cover;
- object-fit: cover;
- background-color: var(--wpds-color-bg-neutral-weak, #f0f0f1);
- flex-shrink: 0;
-}
-.activitypub-feed-post-meta .author {
- font-weight: var(--wpds-font-weight-medium, 500);
- color: var(--wpds-color-fg-primary, #1d2327);
-}
-.activitypub-feed-post-meta .separator {
- color: var(--wpds-color-fg-tertiary, #c3c4c7);
-}
-.activitypub-feed-post-meta .date {
- color: var(--wpds-color-fg-secondary, #646970);
-}
-.activitypub-feed-post-title {
- margin: 0 0 var(--wpds-spacing-30, 12px);
- font-size: inherit;
- font-weight: normal;
- line-height: 1.4;
- color: var(--wpds-color-fg-primary, #1d2327);
- max-width: 100%;
- overflow-wrap: break-word;
- word-wrap: break-word;
-}
-.activitypub-feed-post-title > * {
- margin: 0;
-}
-.activitypub-feed-excerpt {
- color: var(--wpds-color-fg-secondary, #50575e);
- font-size: var(--wpds-font-size-small, 13px);
- line-height: 1.6;
- margin-top: var(--wpds-spacing-15, 6px);
- max-width: 100%;
- overflow-wrap: break-word;
- word-wrap: break-word;
-}
-.dataviews-view-list .activitypub-feed-post-title {
- font-size: 1.3em;
- font-weight: var(--wpds-font-weight-semibold, 600);
-}
-.activitypub-feed-content {
- line-height: 1.6;
- color: var(--wpds-color-fg-primary, #2c3338);
- min-width: 0;
- max-width: 100%;
- overflow-wrap: break-word;
- word-wrap: break-word;
-}
-.activitypub-feed-content > *:first-child {
- margin-top: 0;
-}
-.activitypub-feed-content > *:last-child {
- margin-bottom: 0;
-}
-.activitypub-feed-content img {
- max-width: 100%;
- height: auto;
- border-radius: var(--wpds-border-radius-small, 4px);
- margin: var(--wpds-spacing-30, 12px) 0;
-}
-.activitypub-feed-content img.alignleft {
- float: right;
- margin: 0 0 var(--wpds-spacing-30, 12px) var(--wpds-spacing-40, 16px);
- max-width: 50%;
-}
-.activitypub-feed-content img.alignright {
- float: left;
- margin: 0 var(--wpds-spacing-40, 16px) var(--wpds-spacing-30, 12px) 0;
- max-width: 50%;
-}
-.activitypub-feed-content img.aligncenter {
- display: block;
- margin-right: auto;
- margin-left: auto;
-}
-.activitypub-feed-content::after {
- content: "";
- display: table;
- clear: both;
-}
-.activitypub-inspector {
- height: 100%;
- overflow: auto;
-}
-.activitypub-inspector-loading {
- padding: var(--wpds-spacing-50, 20px);
- text-align: center;
-}
-.activitypub-inspector-card {
- border: none !important;
- border-radius: 0 !important;
- box-shadow: none !important;
- background: transparent !important;
- padding: 0 !important;
- margin-bottom: var(--wpds-spacing-60, 24px) !important;
-}
-.activitypub-inspector-card .components-card__header {
- border: none !important;
- border-radius: 0 !important;
- padding: var(--wpds-spacing-60, 24px) var(--wpds-spacing-60, 24px) var(--wpds-spacing-40, 16px) !important;
- border-bottom: var(--wpds-border-width-control, 1px) solid var(--wpds-color-stroke-neutral-weak, #dcdcde) !important;
-}
-.activitypub-inspector-card .components-card__body {
- padding: var(--wpds-spacing-40, 16px) var(--wpds-spacing-60, 24px) 0 !important;
-}
-.activitypub-inspector-comments-card {
- margin-top: var(--wpds-spacing-60, 24px) !important;
- padding-top: var(--wpds-spacing-60, 24px) !important;
- border-top: var(--wpds-border-width-control, 1px) solid var(--wpds-color-stroke-neutral-weak, #dcdcde) !important;
-}
-.activitypub-inspector-comments-card .components-card__header {
- border-bottom: none !important;
- padding-bottom: var(--wpds-spacing-30, 12px) !important;
- font-size: var(--wpds-font-size-medium, 16px);
- font-weight: var(--wpds-font-weight-semibold, 600);
-}
-.activitypub-inspector-header {
- display: flex;
- align-items: center;
- gap: var(--wpds-spacing-30, 12px);
- width: 100%;
-}
-.activitypub-inspector-close {
- margin-right: auto;
- flex-shrink: 0;
-}
-.activitypub-inspector-avatar {
- width: var(--wpds-spacing-120, 48px);
- height: var(--wpds-spacing-120, 48px);
- border-radius: 50%;
- -o-object-fit: cover;
- object-fit: cover;
- background-color: var(--wpds-color-bg-neutral-weak, #f0f0f1);
- flex-shrink: 0;
-}
-.activitypub-inspector-author {
- display: flex;
- flex-direction: column;
- gap: var(--wpds-spacing-10, 4px);
-}
-.activitypub-inspector-author-name {
- font-size: var(--wpds-font-size-small, 14px);
- font-weight: var(--wpds-font-weight-semibold, 600);
- color: var(--wpds-color-fg-primary, #1d2327);
- text-decoration: none;
-}
-.activitypub-inspector-author-name:hover {
- color: var(--wpds-color-fg-brand, #135e96);
- text-decoration: underline;
-}
-.activitypub-inspector-meta {
- display: flex;
- align-items: center;
- gap: var(--wpds-spacing-15, 6px);
- font-size: var(--wpds-font-size-small, 13px);
-}
-.activitypub-inspector-webfinger {
- color: var(--wpds-color-fg-secondary, #646970);
-}
-.activitypub-inspector-separator {
- color: var(--wpds-color-fg-tertiary, #c3c4c7);
-}
-.activitypub-inspector-timestamp {
- color: var(--wpds-color-fg-secondary, #646970);
- text-decoration: none;
-}
-.activitypub-inspector-timestamp:hover {
- color: var(--wpds-color-fg-brand, #135e96);
- text-decoration: underline;
-}
-.activitypub-inspector-card .components-card__body h2 {
- margin: 0 0 var(--wpds-spacing-40, 16px);
- font-size: var(--wpds-font-size-large, 20px);
- font-weight: var(--wpds-font-weight-semibold, 600);
- line-height: 1.4;
- color: var(--wpds-color-fg-primary, #1d2327);
-}
-.activitypub-inspector-card .components-card__body > div {
- line-height: 1.6;
- color: var(--wpds-color-fg-primary, #2c3338);
- margin-bottom: var(--wpds-spacing-40, 16px);
-}
-.activitypub-inspector-card .components-card__body > div img {
- max-width: 100%;
- height: auto;
-}
-.activitypub-inspector-card .components-card__body > div a {
- color: var(--wpds-color-fg-brand, #135e96);
- text-decoration: none;
- word-wrap: break-word;
- overflow-wrap: break-word;
-}
-.activitypub-inspector-card .components-card__body > div a:hover {
- text-decoration: underline;
-}
-.activitypub-inspector-card .components-card__body > div a .invisible {
- display: none;
-}
-.activitypub-inspector-card .components-card__body > div a .ellipsis::after {
- content: "…";
-}
-.activitypub-inspector-link {
- margin-top: var(--wpds-spacing-40, 16px);
-}
-.activitypub-inspector-comment {
- margin-bottom: var(--wpds-spacing-50, 20px);
- padding-bottom: var(--wpds-spacing-50, 20px);
- border-bottom: var(--wpds-border-width-control, 1px) solid var(--wpds-color-stroke-neutral-weak, #f0f0f1);
-}
-.activitypub-inspector-comment:last-child {
- border-bottom: none;
- margin-bottom: 0;
- padding-bottom: 0;
-}
-.activitypub-inspector-comment-meta {
- margin-bottom: var(--wpds-spacing-20, 8px);
-}
-.activitypub-inspector-comment-meta strong {
- font-size: var(--wpds-font-size-small, 14px);
- color: var(--wpds-color-fg-primary, #1d2327);
-}
-.activitypub-inspector-comment-date {
- margin-right: var(--wpds-spacing-20, 8px);
- font-size: var(--wpds-font-size-small, 13px);
- color: var(--wpds-color-fg-secondary, #646970);
-}
-/*!******************************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/page/style.scss ***!
- \******************************************************************************************************************************************************************************************************************************************************************/
-.page {
- display: flex;
- flex-direction: column;
- height: 100%;
- min-width: 0;
-}
-
-.header {
- padding: var(--wpds-spacing-60, 24px);
- flex-shrink: 0;
-}
-
-.header.has-border {
- border-bottom: var(--wpds-border-width-focus, 1px) solid var(--wpds-color-stroke-surface-neutral, #ddd);
-}
-
-.title-row {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: var(--wpds-spacing-40, 16px);
-}
-
-.title-group {
- display: flex;
- align-items: center;
- gap: var(--wpds-spacing-30, 12px);
-}
-
-.title {
- margin: 0;
- font-size: var(--wpds-font-size-large, 20px);
- font-weight: 500;
- color: var(--wpds-color-fg-primary, #1e1e1e);
-}
-
-.sub-title {
- margin: var(--wpds-spacing-20, 8px) 0 0;
- color: var(--wpds-color-fg-secondary, #757575);
- font-size: var(--wpds-font-size-small, 13px);
-}
-
-.content {
- flex: 1;
- overflow: auto;
- display: flex;
- flex-direction: column;
- gap: var(--wpds-spacing-60, 24px);
-}
-
-.content.padded {
- padding: var(--wpds-spacing-60, 24px);
-}
-
-.content.constrained {
- max-width: 960px;
- margin: 0 auto;
- width: 100%;
-}
-
-.content.full {
- padding: 0;
-}
-/*!***************************************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/fields/avatar/style.scss ***!
- \***************************************************************************************************************************************************************************************************************************************************************************/
-.dataviews-view-table .activitypub-avatar-field__image {
- height: 32px;
- width: 32px;
-}
-/*!**********************************************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/fields/follow-status/style.scss ***!
- \**********************************************************************************************************************************************************************************************************************************************************************************/
-.activitypub-mutual {
- display: inline-block;
- padding: 2px 8px;
- background: #dcdcde;
- border-radius: 3px;
- font-size: 11px;
- font-weight: 600;
- text-transform: uppercase;
- color: #50575e;
-}
+.app-layout[data-section=feed] .inspector-region{width:50%}.dataviews-footer:empty{border:0;padding:0}.dataviews-view-list .dataviews-view-list__item{cursor:pointer}.dataviews-view-list .dataviews-view-list__field{width:100%}.activitypub-feed-post{border-bottom:var(--wpds-border-width-control,1px) solid var(--wpds-color-stroke-neutral-weak,#dcdcde);max-width:100%;min-width:0}.activitypub-feed-post:last-child{border-bottom:none}.activitypub-feed-post-meta{align-items:center;color:var(--wpds-color-fg-secondary,#646970);display:flex;font-size:var(--wpds-font-size-small,13px);gap:var(--wpds-spacing-20,8px);margin-bottom:var(--wpds-spacing-30,12px)}.activitypub-feed-post-meta .activitypub-feed-avatar{background-color:var(--wpds-color-bg-neutral-weak,#f0f0f1);border-radius:50%;flex-shrink:0;height:var(--wpds-spacing-50,20px);-o-object-fit:cover;object-fit:cover;width:var(--wpds-spacing-50,20px)}.activitypub-feed-post-meta .author{color:var(--wpds-color-fg-primary,#1d2327);font-weight:var(--wpds-font-weight-medium,500)}.activitypub-feed-post-meta .separator{color:var(--wpds-color-fg-tertiary,#c3c4c7)}.activitypub-feed-post-meta .date{color:var(--wpds-color-fg-secondary,#646970)}.activitypub-feed-post-title{color:var(--wpds-color-fg-primary,#1d2327);font-size:inherit;font-weight:400;line-height:1.4;margin:0 0 var(--wpds-spacing-30,12px);max-width:100%;overflow-wrap:break-word;word-wrap:break-word}.activitypub-feed-post-title>*{margin:0}.activitypub-feed-excerpt{color:var(--wpds-color-fg-secondary,#50575e);font-size:var(--wpds-font-size-small,13px);line-height:1.6;margin-top:var(--wpds-spacing-15,6px);max-width:100%;overflow-wrap:break-word;word-wrap:break-word}.dataviews-view-list .activitypub-feed-post-title{font-size:1.3em;font-weight:var(--wpds-font-weight-semibold,600)}.activitypub-feed-content{color:var(--wpds-color-fg-primary,#2c3338);line-height:1.6;max-width:100%;min-width:0;overflow-wrap:break-word;word-wrap:break-word}.activitypub-feed-content>:first-child{margin-top:0}.activitypub-feed-content>:last-child{margin-bottom:0}.activitypub-feed-content img{border-radius:var(--wpds-border-radius-small,4px);height:auto;margin:var(--wpds-spacing-30,12px) 0;max-width:100%}.activitypub-feed-content img.alignleft{float:right;margin:0 0 var(--wpds-spacing-30,12px) var(--wpds-spacing-40,16px);max-width:50%}.activitypub-feed-content img.alignright{float:left;margin:0 var(--wpds-spacing-40,16px) var(--wpds-spacing-30,12px) 0;max-width:50%}.activitypub-feed-content img.aligncenter{display:block;margin-right:auto;margin-left:auto}.activitypub-feed-content:after{clear:both;content:"";display:table}.activitypub-inspector{height:100%;overflow:auto}.activitypub-inspector-loading{padding:var(--wpds-spacing-50,20px);text-align:center}.activitypub-inspector-card{background:transparent!important;border:none!important;border-radius:0!important;box-shadow:none!important;margin-bottom:var(--wpds-spacing-60,24px)!important;padding:0!important}.activitypub-inspector-card .components-card__header{border:none!important;border-bottom:var(--wpds-border-width-control,1px) solid var(--wpds-color-stroke-neutral-weak,#dcdcde)!important;border-radius:0!important;padding:var(--wpds-spacing-60,24px) var(--wpds-spacing-60,24px) var(--wpds-spacing-40,16px)!important}.activitypub-inspector-card .components-card__body{padding:var(--wpds-spacing-40,16px) var(--wpds-spacing-60,24px) 0!important}.activitypub-inspector-comments-card{border-top:var(--wpds-border-width-control,1px) solid var(--wpds-color-stroke-neutral-weak,#dcdcde)!important;margin-top:var(--wpds-spacing-60,24px)!important;padding-top:var(--wpds-spacing-60,24px)!important}.activitypub-inspector-comments-card .components-card__header{border-bottom:none!important;font-size:var(--wpds-font-size-medium,16px);font-weight:var(--wpds-font-weight-semibold,600);padding-bottom:var(--wpds-spacing-30,12px)!important}.activitypub-inspector-header{align-items:center;display:flex;gap:var(--wpds-spacing-30,12px);width:100%}.activitypub-inspector-close{flex-shrink:0;margin-right:auto}.activitypub-inspector-avatar{background-color:var(--wpds-color-bg-neutral-weak,#f0f0f1);border-radius:50%;flex-shrink:0;height:var(--wpds-spacing-120,48px);-o-object-fit:cover;object-fit:cover;width:var(--wpds-spacing-120,48px)}.activitypub-inspector-author{display:flex;flex-direction:column;gap:var(--wpds-spacing-10,4px)}.activitypub-inspector-author-name{color:var(--wpds-color-fg-primary,#1d2327);font-size:var(--wpds-font-size-small,14px);font-weight:var(--wpds-font-weight-semibold,600);text-decoration:none}.activitypub-inspector-author-name:hover{color:var(--wpds-color-fg-brand,#135e96);text-decoration:underline}.activitypub-inspector-meta{align-items:center;display:flex;font-size:var(--wpds-font-size-small,13px);gap:var(--wpds-spacing-15,6px)}.activitypub-inspector-webfinger{color:var(--wpds-color-fg-secondary,#646970)}.activitypub-inspector-separator{color:var(--wpds-color-fg-tertiary,#c3c4c7)}.activitypub-inspector-timestamp{color:var(--wpds-color-fg-secondary,#646970);text-decoration:none}.activitypub-inspector-timestamp:hover{color:var(--wpds-color-fg-brand,#135e96);text-decoration:underline}.activitypub-inspector-card .components-card__body h2{color:var(--wpds-color-fg-primary,#1d2327);font-size:var(--wpds-font-size-large,20px);font-weight:var(--wpds-font-weight-semibold,600);line-height:1.4;margin:0 0 var(--wpds-spacing-40,16px)}.activitypub-inspector-card .components-card__body>div{color:var(--wpds-color-fg-primary,#2c3338);line-height:1.6;margin-bottom:var(--wpds-spacing-40,16px)}.activitypub-inspector-card .components-card__body>div img{height:auto;max-width:100%}.activitypub-inspector-card .components-card__body>div a{color:var(--wpds-color-fg-brand,#135e96);text-decoration:none;word-wrap:break-word;overflow-wrap:break-word}.activitypub-inspector-card .components-card__body>div a:hover{text-decoration:underline}.activitypub-inspector-card .components-card__body>div a .invisible{display:none}.activitypub-inspector-card .components-card__body>div a .ellipsis:after{content:"…"}.activitypub-inspector-link{margin-top:var(--wpds-spacing-40,16px)}.activitypub-inspector-comment{border-bottom:var(--wpds-border-width-control,1px) solid var(--wpds-color-stroke-neutral-weak,#f0f0f1);margin-bottom:var(--wpds-spacing-50,20px);padding-bottom:var(--wpds-spacing-50,20px)}.activitypub-inspector-comment:last-child{border-bottom:none;margin-bottom:0;padding-bottom:0}.activitypub-inspector-comment-meta{margin-bottom:var(--wpds-spacing-20,8px)}.activitypub-inspector-comment-meta strong{color:var(--wpds-color-fg-primary,#1d2327);font-size:var(--wpds-font-size-small,14px)}.activitypub-inspector-comment-date{color:var(--wpds-color-fg-secondary,#646970);font-size:var(--wpds-font-size-small,13px);margin-right:var(--wpds-spacing-20,8px)}
+.page{display:flex;flex-direction:column;height:100%;min-width:0}.header{flex-shrink:0;padding:var(--wpds-spacing-60,24px)}.header.has-border{border-bottom:var(--wpds-border-width-focus,1px) solid var(--wpds-color-stroke-surface-neutral,#ddd)}.title-row{gap:var(--wpds-spacing-40,16px);justify-content:space-between}.title-group,.title-row{align-items:center;display:flex}.title-group{gap:var(--wpds-spacing-30,12px)}.title{color:var(--wpds-color-fg-primary,#1e1e1e);font-size:var(--wpds-font-size-large,20px);font-weight:500;margin:0}.sub-title{color:var(--wpds-color-fg-secondary,#757575);font-size:var(--wpds-font-size-small,13px);margin:var(--wpds-spacing-20,8px) 0 0}.content{display:flex;flex:1;flex-direction:column;gap:var(--wpds-spacing-60,24px);overflow:auto}.content.padded{padding:var(--wpds-spacing-60,24px)}.content.constrained{margin:0 auto;max-width:960px;width:100%}.content.full{padding:0}
+.dataviews-view-table .activitypub-avatar-field__image{height:32px;width:32px}
+.activitypub-mutual{background:#dcdcde;border-radius:3px;color:#50575e;display:inline-block;font-size:11px;font-weight:600;padding:2px 8px;text-transform:uppercase}
diff --git a/build/social-web/style-feed-stage.css b/build/social-web/style-feed-stage.css
index b68892ad3e..b8dd87f96b 100644
--- a/build/social-web/style-feed-stage.css
+++ b/build/social-web/style-feed-stage.css
@@ -1,356 +1,4 @@
-/*!**************************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/routes/feed/style.scss ***!
- \**************************************************************************************************************************************************************************************************************************************************************/
-@charset "UTF-8";
-/**
- * Feed view styles
- * Minimal styling - relies on WordPress/DataViews defaults
- */
-.app-layout[data-section=feed] .inspector-region {
- width: 50%;
-}
-.dataviews-footer:empty {
- border: 0;
- padding: 0;
-}
-.dataviews-view-list .dataviews-view-list__item {
- cursor: pointer;
-}
-.dataviews-view-list .dataviews-view-list__field {
- width: 100%;
-}
-.activitypub-feed-post {
- border-bottom: var(--wpds-border-width-control, 1px) solid var(--wpds-color-stroke-neutral-weak, #dcdcde);
- min-width: 0;
- max-width: 100%;
-}
-.activitypub-feed-post:last-child {
- border-bottom: none;
-}
-.activitypub-feed-post-meta {
- display: flex;
- align-items: center;
- gap: var(--wpds-spacing-20, 8px);
- margin-bottom: var(--wpds-spacing-30, 12px);
- font-size: var(--wpds-font-size-small, 13px);
- color: var(--wpds-color-fg-secondary, #646970);
-}
-.activitypub-feed-post-meta .activitypub-feed-avatar {
- width: var(--wpds-spacing-50, 20px);
- height: var(--wpds-spacing-50, 20px);
- border-radius: 50%;
- -o-object-fit: cover;
- object-fit: cover;
- background-color: var(--wpds-color-bg-neutral-weak, #f0f0f1);
- flex-shrink: 0;
-}
-.activitypub-feed-post-meta .author {
- font-weight: var(--wpds-font-weight-medium, 500);
- color: var(--wpds-color-fg-primary, #1d2327);
-}
-.activitypub-feed-post-meta .separator {
- color: var(--wpds-color-fg-tertiary, #c3c4c7);
-}
-.activitypub-feed-post-meta .date {
- color: var(--wpds-color-fg-secondary, #646970);
-}
-.activitypub-feed-post-title {
- margin: 0 0 var(--wpds-spacing-30, 12px);
- font-size: inherit;
- font-weight: normal;
- line-height: 1.4;
- color: var(--wpds-color-fg-primary, #1d2327);
- max-width: 100%;
- overflow-wrap: break-word;
- word-wrap: break-word;
-}
-.activitypub-feed-post-title > * {
- margin: 0;
-}
-.activitypub-feed-excerpt {
- color: var(--wpds-color-fg-secondary, #50575e);
- font-size: var(--wpds-font-size-small, 13px);
- line-height: 1.6;
- margin-top: var(--wpds-spacing-15, 6px);
- max-width: 100%;
- overflow-wrap: break-word;
- word-wrap: break-word;
-}
-.dataviews-view-list .activitypub-feed-post-title {
- font-size: 1.3em;
- font-weight: var(--wpds-font-weight-semibold, 600);
-}
-.activitypub-feed-content {
- line-height: 1.6;
- color: var(--wpds-color-fg-primary, #2c3338);
- min-width: 0;
- max-width: 100%;
- overflow-wrap: break-word;
- word-wrap: break-word;
-}
-.activitypub-feed-content > *:first-child {
- margin-top: 0;
-}
-.activitypub-feed-content > *:last-child {
- margin-bottom: 0;
-}
-.activitypub-feed-content img {
- max-width: 100%;
- height: auto;
- border-radius: var(--wpds-border-radius-small, 4px);
- margin: var(--wpds-spacing-30, 12px) 0;
-}
-.activitypub-feed-content img.alignleft {
- float: left;
- margin: 0 var(--wpds-spacing-40, 16px) var(--wpds-spacing-30, 12px) 0;
- max-width: 50%;
-}
-.activitypub-feed-content img.alignright {
- float: right;
- margin: 0 0 var(--wpds-spacing-30, 12px) var(--wpds-spacing-40, 16px);
- max-width: 50%;
-}
-.activitypub-feed-content img.aligncenter {
- display: block;
- margin-left: auto;
- margin-right: auto;
-}
-.activitypub-feed-content::after {
- content: "";
- display: table;
- clear: both;
-}
-.activitypub-inspector {
- height: 100%;
- overflow: auto;
-}
-.activitypub-inspector-loading {
- padding: var(--wpds-spacing-50, 20px);
- text-align: center;
-}
-.activitypub-inspector-card {
- border: none !important;
- border-radius: 0 !important;
- box-shadow: none !important;
- background: transparent !important;
- padding: 0 !important;
- margin-bottom: var(--wpds-spacing-60, 24px) !important;
-}
-.activitypub-inspector-card .components-card__header {
- border: none !important;
- border-radius: 0 !important;
- padding: var(--wpds-spacing-60, 24px) var(--wpds-spacing-60, 24px) var(--wpds-spacing-40, 16px) !important;
- border-bottom: var(--wpds-border-width-control, 1px) solid var(--wpds-color-stroke-neutral-weak, #dcdcde) !important;
-}
-.activitypub-inspector-card .components-card__body {
- padding: var(--wpds-spacing-40, 16px) var(--wpds-spacing-60, 24px) 0 !important;
-}
-.activitypub-inspector-comments-card {
- margin-top: var(--wpds-spacing-60, 24px) !important;
- padding-top: var(--wpds-spacing-60, 24px) !important;
- border-top: var(--wpds-border-width-control, 1px) solid var(--wpds-color-stroke-neutral-weak, #dcdcde) !important;
-}
-.activitypub-inspector-comments-card .components-card__header {
- border-bottom: none !important;
- padding-bottom: var(--wpds-spacing-30, 12px) !important;
- font-size: var(--wpds-font-size-medium, 16px);
- font-weight: var(--wpds-font-weight-semibold, 600);
-}
-.activitypub-inspector-header {
- display: flex;
- align-items: center;
- gap: var(--wpds-spacing-30, 12px);
- width: 100%;
-}
-.activitypub-inspector-close {
- margin-left: auto;
- flex-shrink: 0;
-}
-.activitypub-inspector-avatar {
- width: var(--wpds-spacing-120, 48px);
- height: var(--wpds-spacing-120, 48px);
- border-radius: 50%;
- -o-object-fit: cover;
- object-fit: cover;
- background-color: var(--wpds-color-bg-neutral-weak, #f0f0f1);
- flex-shrink: 0;
-}
-.activitypub-inspector-author {
- display: flex;
- flex-direction: column;
- gap: var(--wpds-spacing-10, 4px);
-}
-.activitypub-inspector-author-name {
- font-size: var(--wpds-font-size-small, 14px);
- font-weight: var(--wpds-font-weight-semibold, 600);
- color: var(--wpds-color-fg-primary, #1d2327);
- text-decoration: none;
-}
-.activitypub-inspector-author-name:hover {
- color: var(--wpds-color-fg-brand, #135e96);
- text-decoration: underline;
-}
-.activitypub-inspector-meta {
- display: flex;
- align-items: center;
- gap: var(--wpds-spacing-15, 6px);
- font-size: var(--wpds-font-size-small, 13px);
-}
-.activitypub-inspector-webfinger {
- color: var(--wpds-color-fg-secondary, #646970);
-}
-.activitypub-inspector-separator {
- color: var(--wpds-color-fg-tertiary, #c3c4c7);
-}
-.activitypub-inspector-timestamp {
- color: var(--wpds-color-fg-secondary, #646970);
- text-decoration: none;
-}
-.activitypub-inspector-timestamp:hover {
- color: var(--wpds-color-fg-brand, #135e96);
- text-decoration: underline;
-}
-.activitypub-inspector-card .components-card__body h2 {
- margin: 0 0 var(--wpds-spacing-40, 16px);
- font-size: var(--wpds-font-size-large, 20px);
- font-weight: var(--wpds-font-weight-semibold, 600);
- line-height: 1.4;
- color: var(--wpds-color-fg-primary, #1d2327);
-}
-.activitypub-inspector-card .components-card__body > div {
- line-height: 1.6;
- color: var(--wpds-color-fg-primary, #2c3338);
- margin-bottom: var(--wpds-spacing-40, 16px);
-}
-.activitypub-inspector-card .components-card__body > div img {
- max-width: 100%;
- height: auto;
-}
-.activitypub-inspector-card .components-card__body > div a {
- color: var(--wpds-color-fg-brand, #135e96);
- text-decoration: none;
- word-wrap: break-word;
- overflow-wrap: break-word;
-}
-.activitypub-inspector-card .components-card__body > div a:hover {
- text-decoration: underline;
-}
-.activitypub-inspector-card .components-card__body > div a .invisible {
- display: none;
-}
-.activitypub-inspector-card .components-card__body > div a .ellipsis::after {
- content: "…";
-}
-.activitypub-inspector-link {
- margin-top: var(--wpds-spacing-40, 16px);
-}
-.activitypub-inspector-comment {
- margin-bottom: var(--wpds-spacing-50, 20px);
- padding-bottom: var(--wpds-spacing-50, 20px);
- border-bottom: var(--wpds-border-width-control, 1px) solid var(--wpds-color-stroke-neutral-weak, #f0f0f1);
-}
-.activitypub-inspector-comment:last-child {
- border-bottom: none;
- margin-bottom: 0;
- padding-bottom: 0;
-}
-.activitypub-inspector-comment-meta {
- margin-bottom: var(--wpds-spacing-20, 8px);
-}
-.activitypub-inspector-comment-meta strong {
- font-size: var(--wpds-font-size-small, 14px);
- color: var(--wpds-color-fg-primary, #1d2327);
-}
-.activitypub-inspector-comment-date {
- margin-left: var(--wpds-spacing-20, 8px);
- font-size: var(--wpds-font-size-small, 13px);
- color: var(--wpds-color-fg-secondary, #646970);
-}
-/*!******************************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/page/style.scss ***!
- \******************************************************************************************************************************************************************************************************************************************************************/
-.page {
- display: flex;
- flex-direction: column;
- height: 100%;
- min-width: 0;
-}
-
-.header {
- padding: var(--wpds-spacing-60, 24px);
- flex-shrink: 0;
-}
-
-.header.has-border {
- border-bottom: var(--wpds-border-width-focus, 1px) solid var(--wpds-color-stroke-surface-neutral, #ddd);
-}
-
-.title-row {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: var(--wpds-spacing-40, 16px);
-}
-
-.title-group {
- display: flex;
- align-items: center;
- gap: var(--wpds-spacing-30, 12px);
-}
-
-.title {
- margin: 0;
- font-size: var(--wpds-font-size-large, 20px);
- font-weight: 500;
- color: var(--wpds-color-fg-primary, #1e1e1e);
-}
-
-.sub-title {
- margin: var(--wpds-spacing-20, 8px) 0 0;
- color: var(--wpds-color-fg-secondary, #757575);
- font-size: var(--wpds-font-size-small, 13px);
-}
-
-.content {
- flex: 1;
- overflow: auto;
- display: flex;
- flex-direction: column;
- gap: var(--wpds-spacing-60, 24px);
-}
-
-.content.padded {
- padding: var(--wpds-spacing-60, 24px);
-}
-
-.content.constrained {
- max-width: 960px;
- margin: 0 auto;
- width: 100%;
-}
-
-.content.full {
- padding: 0;
-}
-/*!***************************************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/fields/avatar/style.scss ***!
- \***************************************************************************************************************************************************************************************************************************************************************************/
-.dataviews-view-table .activitypub-avatar-field__image {
- height: 32px;
- width: 32px;
-}
-/*!**********************************************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/fields/follow-status/style.scss ***!
- \**********************************************************************************************************************************************************************************************************************************************************************************/
-.activitypub-mutual {
- display: inline-block;
- padding: 2px 8px;
- background: #dcdcde;
- border-radius: 3px;
- font-size: 11px;
- font-weight: 600;
- text-transform: uppercase;
- color: #50575e;
-}
-
-/*# sourceMappingURL=style-feed-stage.css.map*/
\ No newline at end of file
+.app-layout[data-section=feed] .inspector-region{width:50%}.dataviews-footer:empty{border:0;padding:0}.dataviews-view-list .dataviews-view-list__item{cursor:pointer}.dataviews-view-list .dataviews-view-list__field{width:100%}.activitypub-feed-post{border-bottom:var(--wpds-border-width-control,1px) solid var(--wpds-color-stroke-neutral-weak,#dcdcde);max-width:100%;min-width:0}.activitypub-feed-post:last-child{border-bottom:none}.activitypub-feed-post-meta{align-items:center;color:var(--wpds-color-fg-secondary,#646970);display:flex;font-size:var(--wpds-font-size-small,13px);gap:var(--wpds-spacing-20,8px);margin-bottom:var(--wpds-spacing-30,12px)}.activitypub-feed-post-meta .activitypub-feed-avatar{background-color:var(--wpds-color-bg-neutral-weak,#f0f0f1);border-radius:50%;flex-shrink:0;height:var(--wpds-spacing-50,20px);-o-object-fit:cover;object-fit:cover;width:var(--wpds-spacing-50,20px)}.activitypub-feed-post-meta .author{color:var(--wpds-color-fg-primary,#1d2327);font-weight:var(--wpds-font-weight-medium,500)}.activitypub-feed-post-meta .separator{color:var(--wpds-color-fg-tertiary,#c3c4c7)}.activitypub-feed-post-meta .date{color:var(--wpds-color-fg-secondary,#646970)}.activitypub-feed-post-title{color:var(--wpds-color-fg-primary,#1d2327);font-size:inherit;font-weight:400;line-height:1.4;margin:0 0 var(--wpds-spacing-30,12px);max-width:100%;overflow-wrap:break-word;word-wrap:break-word}.activitypub-feed-post-title>*{margin:0}.activitypub-feed-excerpt{color:var(--wpds-color-fg-secondary,#50575e);font-size:var(--wpds-font-size-small,13px);line-height:1.6;margin-top:var(--wpds-spacing-15,6px);max-width:100%;overflow-wrap:break-word;word-wrap:break-word}.dataviews-view-list .activitypub-feed-post-title{font-size:1.3em;font-weight:var(--wpds-font-weight-semibold,600)}.activitypub-feed-content{color:var(--wpds-color-fg-primary,#2c3338);line-height:1.6;max-width:100%;min-width:0;overflow-wrap:break-word;word-wrap:break-word}.activitypub-feed-content>:first-child{margin-top:0}.activitypub-feed-content>:last-child{margin-bottom:0}.activitypub-feed-content img{border-radius:var(--wpds-border-radius-small,4px);height:auto;margin:var(--wpds-spacing-30,12px) 0;max-width:100%}.activitypub-feed-content img.alignleft{float:left;margin:0 var(--wpds-spacing-40,16px) var(--wpds-spacing-30,12px) 0;max-width:50%}.activitypub-feed-content img.alignright{float:right;margin:0 0 var(--wpds-spacing-30,12px) var(--wpds-spacing-40,16px);max-width:50%}.activitypub-feed-content img.aligncenter{display:block;margin-left:auto;margin-right:auto}.activitypub-feed-content:after{clear:both;content:"";display:table}.activitypub-inspector{height:100%;overflow:auto}.activitypub-inspector-loading{padding:var(--wpds-spacing-50,20px);text-align:center}.activitypub-inspector-card{background:transparent!important;border:none!important;border-radius:0!important;box-shadow:none!important;margin-bottom:var(--wpds-spacing-60,24px)!important;padding:0!important}.activitypub-inspector-card .components-card__header{border:none!important;border-bottom:var(--wpds-border-width-control,1px) solid var(--wpds-color-stroke-neutral-weak,#dcdcde)!important;border-radius:0!important;padding:var(--wpds-spacing-60,24px) var(--wpds-spacing-60,24px) var(--wpds-spacing-40,16px)!important}.activitypub-inspector-card .components-card__body{padding:var(--wpds-spacing-40,16px) var(--wpds-spacing-60,24px) 0!important}.activitypub-inspector-comments-card{border-top:var(--wpds-border-width-control,1px) solid var(--wpds-color-stroke-neutral-weak,#dcdcde)!important;margin-top:var(--wpds-spacing-60,24px)!important;padding-top:var(--wpds-spacing-60,24px)!important}.activitypub-inspector-comments-card .components-card__header{border-bottom:none!important;font-size:var(--wpds-font-size-medium,16px);font-weight:var(--wpds-font-weight-semibold,600);padding-bottom:var(--wpds-spacing-30,12px)!important}.activitypub-inspector-header{align-items:center;display:flex;gap:var(--wpds-spacing-30,12px);width:100%}.activitypub-inspector-close{flex-shrink:0;margin-left:auto}.activitypub-inspector-avatar{background-color:var(--wpds-color-bg-neutral-weak,#f0f0f1);border-radius:50%;flex-shrink:0;height:var(--wpds-spacing-120,48px);-o-object-fit:cover;object-fit:cover;width:var(--wpds-spacing-120,48px)}.activitypub-inspector-author{display:flex;flex-direction:column;gap:var(--wpds-spacing-10,4px)}.activitypub-inspector-author-name{color:var(--wpds-color-fg-primary,#1d2327);font-size:var(--wpds-font-size-small,14px);font-weight:var(--wpds-font-weight-semibold,600);text-decoration:none}.activitypub-inspector-author-name:hover{color:var(--wpds-color-fg-brand,#135e96);text-decoration:underline}.activitypub-inspector-meta{align-items:center;display:flex;font-size:var(--wpds-font-size-small,13px);gap:var(--wpds-spacing-15,6px)}.activitypub-inspector-webfinger{color:var(--wpds-color-fg-secondary,#646970)}.activitypub-inspector-separator{color:var(--wpds-color-fg-tertiary,#c3c4c7)}.activitypub-inspector-timestamp{color:var(--wpds-color-fg-secondary,#646970);text-decoration:none}.activitypub-inspector-timestamp:hover{color:var(--wpds-color-fg-brand,#135e96);text-decoration:underline}.activitypub-inspector-card .components-card__body h2{color:var(--wpds-color-fg-primary,#1d2327);font-size:var(--wpds-font-size-large,20px);font-weight:var(--wpds-font-weight-semibold,600);line-height:1.4;margin:0 0 var(--wpds-spacing-40,16px)}.activitypub-inspector-card .components-card__body>div{color:var(--wpds-color-fg-primary,#2c3338);line-height:1.6;margin-bottom:var(--wpds-spacing-40,16px)}.activitypub-inspector-card .components-card__body>div img{height:auto;max-width:100%}.activitypub-inspector-card .components-card__body>div a{color:var(--wpds-color-fg-brand,#135e96);text-decoration:none;word-wrap:break-word;overflow-wrap:break-word}.activitypub-inspector-card .components-card__body>div a:hover{text-decoration:underline}.activitypub-inspector-card .components-card__body>div a .invisible{display:none}.activitypub-inspector-card .components-card__body>div a .ellipsis:after{content:"…"}.activitypub-inspector-link{margin-top:var(--wpds-spacing-40,16px)}.activitypub-inspector-comment{border-bottom:var(--wpds-border-width-control,1px) solid var(--wpds-color-stroke-neutral-weak,#f0f0f1);margin-bottom:var(--wpds-spacing-50,20px);padding-bottom:var(--wpds-spacing-50,20px)}.activitypub-inspector-comment:last-child{border-bottom:none;margin-bottom:0;padding-bottom:0}.activitypub-inspector-comment-meta{margin-bottom:var(--wpds-spacing-20,8px)}.activitypub-inspector-comment-meta strong{color:var(--wpds-color-fg-primary,#1d2327);font-size:var(--wpds-font-size-small,14px)}.activitypub-inspector-comment-date{color:var(--wpds-color-fg-secondary,#646970);font-size:var(--wpds-font-size-small,13px);margin-left:var(--wpds-spacing-20,8px)}
+.page{display:flex;flex-direction:column;height:100%;min-width:0}.header{flex-shrink:0;padding:var(--wpds-spacing-60,24px)}.header.has-border{border-bottom:var(--wpds-border-width-focus,1px) solid var(--wpds-color-stroke-surface-neutral,#ddd)}.title-row{gap:var(--wpds-spacing-40,16px);justify-content:space-between}.title-group,.title-row{align-items:center;display:flex}.title-group{gap:var(--wpds-spacing-30,12px)}.title{color:var(--wpds-color-fg-primary,#1e1e1e);font-size:var(--wpds-font-size-large,20px);font-weight:500;margin:0}.sub-title{color:var(--wpds-color-fg-secondary,#757575);font-size:var(--wpds-font-size-small,13px);margin:var(--wpds-spacing-20,8px) 0 0}.content{display:flex;flex:1;flex-direction:column;gap:var(--wpds-spacing-60,24px);overflow:auto}.content.padded{padding:var(--wpds-spacing-60,24px)}.content.constrained{margin:0 auto;max-width:960px;width:100%}.content.full{padding:0}
+.dataviews-view-table .activitypub-avatar-field__image{height:32px;width:32px}
+.activitypub-mutual{background:#dcdcde;border-radius:3px;color:#50575e;display:inline-block;font-size:11px;font-weight:600;padding:2px 8px;text-transform:uppercase}
diff --git a/build/social-web/style-index-rtl.css b/build/social-web/style-index-rtl.css
index 70a9f5eb59..b765d58f3f 100644
--- a/build/social-web/style-index-rtl.css
+++ b/build/social-web/style-index-rtl.css
@@ -1,357 +1,8 @@
-/*!***********************************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/site-icon/style.scss ***!
- \***********************************************************************************************************************************************************************************************************************************************************************/
-/**
- * Site Icon Component Styles
- */
-.site-icon {
- display: flex;
- justify-content: center;
- align-items: center;
-}
-.site-icon__image {
- -o-object-fit: cover;
- object-fit: cover;
-}
-.site-icon__icon {
- fill: currentColor;
-}
-/*!**********************************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/site-hub/style.scss ***!
- \**********************************************************************************************************************************************************************************************************************************************************************/
-@charset "UTF-8";
-/**
- * Site Hub Component Styles
- */
-.site-hub {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: var(--wpds-spacing-20, 8px);
- margin-left: var(--wpds-spacing-30, 12px);
- height: var(--wpds-spacing-160, 64px);
-}
-.site-hub__actions {
- flex-shrink: 0;
-}
-.site-hub__icon-container {
- height: var(--wpds-spacing-160, 64px);
- width: var(--wpds-spacing-160, 64px);
- flex-shrink: 0;
-}
-.site-hub__icon-container.has-transparent-background .site-hub__icon-container {
- background: transparent;
-}
-.site-hub__icon-button.components-button {
- /* stylelint-disable -- Disable reason: View Transitions not supported properly by stylelint. */
- view-transition-name: toggle;
- /* stylelint-enable */
- position: relative;
- color: var(--wpds-color-fg-inverted-primary, #ffffff);
- height: var(--wpds-spacing-160, 64px);
- width: var(--wpds-spacing-160, 64px);
- overflow: hidden;
- padding: 0;
- display: flex;
- align-items: center;
- justify-content: center;
- background: var(--wpds-color-bg-surface-neutral-weak, #1e1e1e);
- border-radius: 0;
-}
-.site-hub__icon-button.components-button:hover, .site-hub__icon-button.components-button:active {
- color: var(--wpds-color-fg-inverted-primary, #ffffff);
-}
-.site-hub__icon-button.components-button:focus-visible, .site-hub__icon-button.components-button:focus {
- box-shadow: 0 0 0 3px #1e1e1e, 0 0 0 6px var(--wp-admin-theme-color);
- outline: 4px solid rgba(0, 0, 0, 0);
- outline-offset: 4px;
-}
-.site-hub__icon-button.components-button::before {
- content: "";
- display: block;
- position: absolute;
- top: calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));
- left: calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));
- bottom: calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));
- right: calc(var(--wpds-spacing-40, 16px) + var(--wpds-border-width-focus, 1px));
- border-radius: var(--wpds-border-radius-large, 8px);
- box-shadow: none;
-}
-@media not (prefers-reduced-motion) {
- .site-hub__icon-button.components-button::before {
- transition: box-shadow 0.1s ease;
- }
-}
-.site-hub__icon-button.components-button .site-icon {
- height: var(--wpds-spacing-160, 64px);
- width: var(--wpds-spacing-160, 64px);
-}
-.site-hub__icon-button.components-button .site-icon__icon {
- height: 100%;
- width: 100%;
-}
-.site-hub__title .components-button {
- color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
- display: block;
- flex-grow: 1;
- font-size: var(--wpds-font-size-medium, 15px);
- font-weight: var(--wpds-font-weight-medium, 500);
- overflow: hidden;
- padding-left: var(--wpds-spacing-40, 16px);
- margin-right: -4px;
- position: relative;
- text-decoration: none;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-.site-hub__title .components-button:hover, .site-hub__title .components-button:focus, .site-hub__title .components-button:active {
- color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
-}
-.site-hub__title .components-button:focus {
- box-shadow: none;
- outline: none;
-}
-.site-hub__title .components-button:focus-visible {
- box-shadow: 0 0 0 var(--wp-admin-border-width-focus) #1e1e1e, 0 0 0 calc(2 * var(--wp-admin-border-width-focus)) var(--wpds-color-stroke-focus-brand, #0675c4);
- outline: 2px solid transparent;
- outline-offset: 2px;
-}
-.site-hub__title .components-button::after {
- content: "↗";
- font-weight: 400;
- opacity: 0;
- position: absolute;
- left: 0;
-}
-@media not (prefers-reduced-motion) {
- .site-hub__title .components-button::after {
- transition: opacity 0.1s linear;
- }
-}
-.site-hub__title .components-button:hover::after, .site-hub__title .components-button:focus::after, .site-hub__title .components-button:active::after {
- opacity: 1;
-}
-.site-hub__command-button {
- color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
-}
-.site-hub__command-button:hover svg, .site-hub__command-button:active svg {
- fill: var(--wpds-color-private-bg-fg-fill, #f0f0f0);
-}
-/*!****************************************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/actor-switcher/style.scss ***!
- \****************************************************************************************************************************************************************************************************************************************************************************/
-.actor-switcher {
- display: flex;
- align-items: center;
- text-decoration: none;
- color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
- transition: color 0.2s ease;
- min-width: 0;
- padding-right: 2px;
-}
-.actor-switcher:hover:not(:disabled) {
- color: var(--wpds-color-fg-inverted-primary, #ffffff);
-}
-.actor-switcher__avatar {
- width: 32px;
- height: 32px;
- border-radius: 50%;
- flex-shrink: 0;
-}
-.actor-switcher__name {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-/*!*********************************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/sidebar/style.scss ***!
- \*********************************************************************************************************************************************************************************************************************************************************************/
-.sidebar {
- display: flex;
- flex-direction: column;
- flex: 1;
- color: var(--wpds-color-fg-inverted-secondary, #cccccc);
-}
-.sidebar .nav {
- flex: 1;
- padding: 0 var(--wpds-spacing-30, 12px);
- overflow-y: auto;
-}
-.sidebar .sidebar-navigation__icon-title {
- position: sticky;
- top: 0;
- background: var(--wpds-color-bg-surface-neutral-weak, #1e1e1e);
- padding-top: var(--wpds-spacing-120, 48px);
- margin-bottom: var(--wpds-spacing-20, 8px);
- padding-bottom: var(--wpds-spacing-20, 8px);
-}
-.sidebar .sidebar-navigation__button {
- color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
- flex-shrink: 0;
-}
-.sidebar .sidebar-navigation__button:focus:not(:disabled) {
- box-shadow: none;
- outline: none;
-}
-.sidebar .sidebar-navigation__button:focus-visible:not(:disabled) {
- box-shadow: 0 0 0 var(--wpds-border-width-focus, 1.5px) var(--wp-admin-theme-color);
- outline: 3px solid transparent;
-}
-.sidebar .sidebar-navigation__button:hover:not(:disabled, [aria-disabled=true]), .sidebar .sidebar-navigation__button:focus-visible, .sidebar .sidebar-navigation__button:focus, .sidebar .sidebar-navigation__button:not(:disabled, [aria-disabled=true]):active, .sidebar .sidebar-navigation__button[aria-expanded=true] {
- color: var(--wpds-color-private-bg-fg-fill, #f0f0f0);
-}
-.sidebar .sidebar-navigation__title {
- color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
- flex-grow: 1;
- overflow-wrap: break-word;
- line-height: var(--wpds-spacing-80, 32px);
-}
-.sidebar .menu-item {
- display: flex;
- align-items: center;
- gap: var(--wpds-spacing-20, 8px);
- color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
-}
-.sidebar .menu-item:hover {
- background-color: var(--wpds-color-bg-interactive-neutral-hover, rgba(255, 255, 255, 0.1));
- color: var(--wpds-color-fg-inverted-primary, #ffffff);
-}
-.sidebar .menu-item.is-selected {
- background-color: var(--wpds-color-bg-interactive-neutral-active, rgba(255, 255, 255, 0.15));
- color: var(--wpds-color-fg-inverted-primary, #ffffff);
-}
-.sidebar .menu-item svg {
- flex-shrink: 0;
-}
-.sidebar .footer {
- padding: var(--wpds-spacing-40, 16px);
- border-top: 1px solid var(--wpds-color-stroke-inverted, rgba(255, 255, 255, 0.1));
-}
-.sidebar .footer > .components-h-stack {
- padding: 2px 0;
-}
-.sidebar .footer .footer-settings-button {
- color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
- flex-shrink: 0;
-}
-.sidebar .footer .footer-settings-button:hover:not(:disabled) {
- color: var(--wpds-color-fg-inverted-primary, #ffffff);
-}
-/*!****************************************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/themed-surface/style.scss ***!
- \****************************************************************************************************************************************************************************************************************************************************************************/
-/**
- * ThemedSurface styles
- *
- * Provides themed container for light content areas.
- * Uses wpds tokens directly for consistent theming.
- */
-.themed-surface {
- background: var(--wpds-color-bg-surface-neutral-strong, #ffffff);
- border-radius: var(--wpds-border-radius-large, 8px);
- overflow: hidden;
- display: flex;
- flex-direction: column;
- flex: 1;
- min-height: 0;
-}
-/*!*******************************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/panel/style.scss ***!
- \*******************************************************************************************************************************************************************************************************************************************************************/
-.panel {
- margin: var(--wpds-spacing-40, 16px) 0 var(--wpds-spacing-40, 16px) var(--wpds-spacing-40, 16px);
- flex: 1;
- min-height: 0;
- display: flex;
- flex-direction: column;
-}
-/*!********************************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/layout/style.scss ***!
- \********************************************************************************************************************************************************************************************************************************************************************/
-/* Ensure provider wrappers (SlotFillProvider, ShortcutProvider) fill height */
-#activitypub-social-web-root > div {
- height: 100%;
-}
-.app-layout {
- display: flex;
- flex-direction: column;
- width: 100%;
- height: 100%;
- background-color: var(--wpds-color-bg-surface-neutral-weak, #1e1e1e);
- overflow: hidden;
-}
-.app-content {
- width: 100%;
- height: 100%;
- flex-grow: 1;
- display: flex;
- background-color: var(--wpds-color-bg-surface-neutral-weak, #1e1e1e);
- overflow: hidden;
-}
-.sidebar-region {
- flex-shrink: 0;
- width: 300px;
- display: flex;
- flex-direction: column;
-}
-.stage-region {
- flex-grow: 1;
- min-width: 0;
- display: flex;
- flex-direction: column;
- overflow: hidden;
-}
-.inspector-region {
- width: var(--sw-inspector-width);
- flex-shrink: 0;
- display: flex;
- flex-direction: column;
-}
-.components-snackbar-list {
- position: fixed;
- bottom: 20px;
- right: 20px;
- z-index: 100000;
-}
-@media (max-width: 782px) {
- .app-content {
- flex-direction: column;
- }
- .sidebar-region,
- .inspector-region {
- width: 100%;
- }
- .components-snackbar-list {
- right: 10px;
- left: 10px;
- bottom: 10px;
- }
-}
-/*!**************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/style.scss ***!
- \**************************************************************************************************************************************************************************************************************************************************/
-/**
- * Main stylesheet entry point for Social Web
- * This compiles to style-index.css
- */
-/**
- * Design Tokens for ActivityPub Social Web
- *
- * Uses wpds design tokens directly for colors, spacing, typography, etc.
- * Only defines app-specific layout dimensions.
- */
-:root {
- /* Layout dimensions (app-specific) */
- --sw-sidebar-width: 300px;
- --sw-inspector-width: 380px;
-}
-.activitypub-social-web-layout {
- position: fixed;
- top: 0;
- right: 0;
- left: 0;
- bottom: 0;
-}
-#wpfooter {
- display: none;
-}
+.site-icon{align-items:center;display:flex;justify-content:center}.site-icon__image{-o-object-fit:cover;object-fit:cover}.site-icon__icon{fill:currentColor}
+.site-hub{align-items:center;display:flex;gap:var(--wpds-spacing-20,8px);height:var(--wpds-spacing-160,64px);justify-content:space-between;margin-left:var(--wpds-spacing-30,12px)}.site-hub__actions{flex-shrink:0}.site-hub__icon-container{flex-shrink:0;height:var(--wpds-spacing-160,64px);width:var(--wpds-spacing-160,64px)}.site-hub__icon-container.has-transparent-background .site-hub__icon-container{background:transparent}.site-hub__icon-button.components-button{align-items:center;background:var(--wpds-color-bg-surface-neutral-weak,#1e1e1e);border-radius:0;display:flex;height:var(--wpds-spacing-160,64px);justify-content:center;overflow:hidden;padding:0;position:relative;view-transition-name:toggle;width:var(--wpds-spacing-160,64px)}.site-hub__icon-button.components-button,.site-hub__icon-button.components-button:active,.site-hub__icon-button.components-button:hover{color:var(--wpds-color-fg-inverted-primary,#fff)}.site-hub__icon-button.components-button:focus,.site-hub__icon-button.components-button:focus-visible{box-shadow:0 0 0 3px #1e1e1e,0 0 0 6px var(--wp-admin-theme-color);outline:4px solid transparent;outline-offset:4px}.site-hub__icon-button.components-button:before{border-radius:var(--wpds-border-radius-large,8px);bottom:calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));box-shadow:none;content:"";display:block;right:calc(var(--wpds-spacing-40, 16px) + var(--wpds-border-width-focus, 1px));position:absolute;left:calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));top:calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px))}@media not (prefers-reduced-motion){.site-hub__icon-button.components-button:before{transition:box-shadow .1s ease}}.site-hub__icon-button.components-button .site-icon{height:var(--wpds-spacing-160,64px);width:var(--wpds-spacing-160,64px)}.site-hub__icon-button.components-button .site-icon__icon{height:100%;width:100%}.site-hub__title .components-button{display:block;flex-grow:1;font-size:var(--wpds-font-size-medium,15px);font-weight:var(--wpds-font-weight-medium,500);margin-right:-4px;overflow:hidden;padding-left:var(--wpds-spacing-40,16px);position:relative;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.site-hub__title .components-button,.site-hub__title .components-button:active,.site-hub__title .components-button:focus,.site-hub__title .components-button:hover{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0)}.site-hub__title .components-button:focus{box-shadow:none;outline:none}.site-hub__title .components-button:focus-visible{box-shadow:0 0 0 var(--wp-admin-border-width-focus) #1e1e1e,0 0 0 calc(var(--wp-admin-border-width-focus)*2) var(--wpds-color-stroke-focus-brand,#0675c4);outline:2px solid transparent;outline-offset:2px}.site-hub__title .components-button:after{content:"↗";font-weight:400;opacity:0;position:absolute;left:0}@media not (prefers-reduced-motion){.site-hub__title .components-button:after{transition:opacity .1s linear}}.site-hub__title .components-button:active:after,.site-hub__title .components-button:focus:after,.site-hub__title .components-button:hover:after{opacity:1}.site-hub__command-button{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0)}.site-hub__command-button:active svg,.site-hub__command-button:hover svg{fill:var(--wpds-color-private-bg-fg-fill,#f0f0f0)}
+.actor-switcher{align-items:center;color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);display:flex;min-width:0;padding-right:2px;text-decoration:none;transition:color .2s ease}.actor-switcher:hover:not(:disabled){color:var(--wpds-color-fg-inverted-primary,#fff)}.actor-switcher__avatar{border-radius:50%;flex-shrink:0;height:32px;width:32px}.actor-switcher__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
+.sidebar{color:var(--wpds-color-fg-inverted-secondary,#ccc);display:flex;flex:1;flex-direction:column}.sidebar .nav{flex:1;overflow-y:auto;padding:0 var(--wpds-spacing-30,12px)}.sidebar .sidebar-navigation__icon-title{background:var(--wpds-color-bg-surface-neutral-weak,#1e1e1e);margin-bottom:var(--wpds-spacing-20,8px);padding-bottom:var(--wpds-spacing-20,8px);padding-top:var(--wpds-spacing-120,48px);position:sticky;top:0}.sidebar .sidebar-navigation__button{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);flex-shrink:0}.sidebar .sidebar-navigation__button:focus:not(:disabled){box-shadow:none;outline:none}.sidebar .sidebar-navigation__button:focus-visible:not(:disabled){box-shadow:0 0 0 var(--wpds-border-width-focus,1.5px) var(--wp-admin-theme-color);outline:3px solid transparent}.sidebar .sidebar-navigation__button:focus,.sidebar .sidebar-navigation__button:focus-visible,.sidebar .sidebar-navigation__button:hover:not(:disabled,[aria-disabled=true]),.sidebar .sidebar-navigation__button:not(:disabled,[aria-disabled=true]):active,.sidebar .sidebar-navigation__button[aria-expanded=true]{color:var(--wpds-color-private-bg-fg-fill,#f0f0f0)}.sidebar .sidebar-navigation__title{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);flex-grow:1;line-height:var(--wpds-spacing-80,32px);overflow-wrap:break-word}.sidebar .menu-item{align-items:center;color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);display:flex;gap:var(--wpds-spacing-20,8px)}.sidebar .menu-item:hover{background-color:var(--wpds-color-bg-interactive-neutral-hover,hsla(0,0%,100%,.1));color:var(--wpds-color-fg-inverted-primary,#fff)}.sidebar .menu-item.is-selected{background-color:var(--wpds-color-bg-interactive-neutral-active,hsla(0,0%,100%,.15));color:var(--wpds-color-fg-inverted-primary,#fff)}.sidebar .menu-item svg{flex-shrink:0}.sidebar .footer{border-top:1px solid var(--wpds-color-stroke-inverted,hsla(0,0%,100%,.1));padding:var(--wpds-spacing-40,16px)}.sidebar .footer>.components-h-stack{padding:2px 0}.sidebar .footer .footer-settings-button{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);flex-shrink:0}.sidebar .footer .footer-settings-button:hover:not(:disabled){color:var(--wpds-color-fg-inverted-primary,#fff)}
+.themed-surface{background:var(--wpds-color-bg-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-large,8px);display:flex;flex:1;flex-direction:column;min-height:0;overflow:hidden}
+.panel{display:flex;flex:1;flex-direction:column;margin:var(--wpds-spacing-40,16px) 0 var(--wpds-spacing-40,16px) var(--wpds-spacing-40,16px);min-height:0}
+#activitypub-social-web-root>div{height:100%}.app-layout{flex-direction:column}.app-content,.app-layout{background-color:var(--wpds-color-bg-surface-neutral-weak,#1e1e1e);display:flex;height:100%;overflow:hidden;width:100%}.app-content{flex-grow:1}.sidebar-region{flex-shrink:0;width:300px}.sidebar-region,.stage-region{display:flex;flex-direction:column}.stage-region{flex-grow:1;min-width:0;overflow:hidden}.inspector-region{display:flex;flex-direction:column;flex-shrink:0;width:var(--sw-inspector-width)}.components-snackbar-list{bottom:20px;right:20px;position:fixed;z-index:100000}@media(max-width:782px){.app-content{flex-direction:column}.inspector-region,.sidebar-region{width:100%}.components-snackbar-list{bottom:10px;right:10px;left:10px}}
+:root{--sw-sidebar-width:300px;--sw-inspector-width:380px}.activitypub-social-web-layout{bottom:0;right:0;position:fixed;left:0;top:0}#wpfooter{display:none}
diff --git a/build/social-web/style-index.css b/build/social-web/style-index.css
index 0d96978893..eb2b7dd569 100644
--- a/build/social-web/style-index.css
+++ b/build/social-web/style-index.css
@@ -1,359 +1,8 @@
-/*!***********************************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/site-icon/style.scss ***!
- \***********************************************************************************************************************************************************************************************************************************************************************/
-/**
- * Site Icon Component Styles
- */
-.site-icon {
- display: flex;
- justify-content: center;
- align-items: center;
-}
-.site-icon__image {
- -o-object-fit: cover;
- object-fit: cover;
-}
-.site-icon__icon {
- fill: currentColor;
-}
-/*!**********************************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/site-hub/style.scss ***!
- \**********************************************************************************************************************************************************************************************************************************************************************/
-@charset "UTF-8";
-/**
- * Site Hub Component Styles
- */
-.site-hub {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: var(--wpds-spacing-20, 8px);
- margin-right: var(--wpds-spacing-30, 12px);
- height: var(--wpds-spacing-160, 64px);
-}
-.site-hub__actions {
- flex-shrink: 0;
-}
-.site-hub__icon-container {
- height: var(--wpds-spacing-160, 64px);
- width: var(--wpds-spacing-160, 64px);
- flex-shrink: 0;
-}
-.site-hub__icon-container.has-transparent-background .site-hub__icon-container {
- background: transparent;
-}
-.site-hub__icon-button.components-button {
- /* stylelint-disable -- Disable reason: View Transitions not supported properly by stylelint. */
- view-transition-name: toggle;
- /* stylelint-enable */
- position: relative;
- color: var(--wpds-color-fg-inverted-primary, #ffffff);
- height: var(--wpds-spacing-160, 64px);
- width: var(--wpds-spacing-160, 64px);
- overflow: hidden;
- padding: 0;
- display: flex;
- align-items: center;
- justify-content: center;
- background: var(--wpds-color-bg-surface-neutral-weak, #1e1e1e);
- border-radius: 0;
-}
-.site-hub__icon-button.components-button:hover, .site-hub__icon-button.components-button:active {
- color: var(--wpds-color-fg-inverted-primary, #ffffff);
-}
-.site-hub__icon-button.components-button:focus-visible, .site-hub__icon-button.components-button:focus {
- box-shadow: 0 0 0 3px #1e1e1e, 0 0 0 6px var(--wp-admin-theme-color);
- outline: 4px solid rgba(0, 0, 0, 0);
- outline-offset: 4px;
-}
-.site-hub__icon-button.components-button::before {
- content: "";
- display: block;
- position: absolute;
- top: calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));
- right: calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));
- bottom: calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));
- left: calc(var(--wpds-spacing-40, 16px) + var(--wpds-border-width-focus, 1px));
- border-radius: var(--wpds-border-radius-large, 8px);
- box-shadow: none;
-}
-@media not (prefers-reduced-motion) {
- .site-hub__icon-button.components-button::before {
- transition: box-shadow 0.1s ease;
- }
-}
-.site-hub__icon-button.components-button .site-icon {
- height: var(--wpds-spacing-160, 64px);
- width: var(--wpds-spacing-160, 64px);
-}
-.site-hub__icon-button.components-button .site-icon__icon {
- height: 100%;
- width: 100%;
-}
-.site-hub__title .components-button {
- color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
- display: block;
- flex-grow: 1;
- font-size: var(--wpds-font-size-medium, 15px);
- font-weight: var(--wpds-font-weight-medium, 500);
- overflow: hidden;
- padding-right: var(--wpds-spacing-40, 16px);
- margin-left: -4px;
- position: relative;
- text-decoration: none;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-.site-hub__title .components-button:hover, .site-hub__title .components-button:focus, .site-hub__title .components-button:active {
- color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
-}
-.site-hub__title .components-button:focus {
- box-shadow: none;
- outline: none;
-}
-.site-hub__title .components-button:focus-visible {
- box-shadow: 0 0 0 var(--wp-admin-border-width-focus) #1e1e1e, 0 0 0 calc(2 * var(--wp-admin-border-width-focus)) var(--wpds-color-stroke-focus-brand, #0675c4);
- outline: 2px solid transparent;
- outline-offset: 2px;
-}
-.site-hub__title .components-button::after {
- content: "↗";
- font-weight: 400;
- opacity: 0;
- position: absolute;
- right: 0;
-}
-@media not (prefers-reduced-motion) {
- .site-hub__title .components-button::after {
- transition: opacity 0.1s linear;
- }
-}
-.site-hub__title .components-button:hover::after, .site-hub__title .components-button:focus::after, .site-hub__title .components-button:active::after {
- opacity: 1;
-}
-.site-hub__command-button {
- color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
-}
-.site-hub__command-button:hover svg, .site-hub__command-button:active svg {
- fill: var(--wpds-color-private-bg-fg-fill, #f0f0f0);
-}
-/*!****************************************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/actor-switcher/style.scss ***!
- \****************************************************************************************************************************************************************************************************************************************************************************/
-.actor-switcher {
- display: flex;
- align-items: center;
- text-decoration: none;
- color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
- transition: color 0.2s ease;
- min-width: 0;
- padding-left: 2px;
-}
-.actor-switcher:hover:not(:disabled) {
- color: var(--wpds-color-fg-inverted-primary, #ffffff);
-}
-.actor-switcher__avatar {
- width: 32px;
- height: 32px;
- border-radius: 50%;
- flex-shrink: 0;
-}
-.actor-switcher__name {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-/*!*********************************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/sidebar/style.scss ***!
- \*********************************************************************************************************************************************************************************************************************************************************************/
-.sidebar {
- display: flex;
- flex-direction: column;
- flex: 1;
- color: var(--wpds-color-fg-inverted-secondary, #cccccc);
-}
-.sidebar .nav {
- flex: 1;
- padding: 0 var(--wpds-spacing-30, 12px);
- overflow-y: auto;
-}
-.sidebar .sidebar-navigation__icon-title {
- position: sticky;
- top: 0;
- background: var(--wpds-color-bg-surface-neutral-weak, #1e1e1e);
- padding-top: var(--wpds-spacing-120, 48px);
- margin-bottom: var(--wpds-spacing-20, 8px);
- padding-bottom: var(--wpds-spacing-20, 8px);
-}
-.sidebar .sidebar-navigation__button {
- color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
- flex-shrink: 0;
-}
-.sidebar .sidebar-navigation__button:focus:not(:disabled) {
- box-shadow: none;
- outline: none;
-}
-.sidebar .sidebar-navigation__button:focus-visible:not(:disabled) {
- box-shadow: 0 0 0 var(--wpds-border-width-focus, 1.5px) var(--wp-admin-theme-color);
- outline: 3px solid transparent;
-}
-.sidebar .sidebar-navigation__button:hover:not(:disabled, [aria-disabled=true]), .sidebar .sidebar-navigation__button:focus-visible, .sidebar .sidebar-navigation__button:focus, .sidebar .sidebar-navigation__button:not(:disabled, [aria-disabled=true]):active, .sidebar .sidebar-navigation__button[aria-expanded=true] {
- color: var(--wpds-color-private-bg-fg-fill, #f0f0f0);
-}
-.sidebar .sidebar-navigation__title {
- color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
- flex-grow: 1;
- overflow-wrap: break-word;
- line-height: var(--wpds-spacing-80, 32px);
-}
-.sidebar .menu-item {
- display: flex;
- align-items: center;
- gap: var(--wpds-spacing-20, 8px);
- color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
-}
-.sidebar .menu-item:hover {
- background-color: var(--wpds-color-bg-interactive-neutral-hover, rgba(255, 255, 255, 0.1));
- color: var(--wpds-color-fg-inverted-primary, #ffffff);
-}
-.sidebar .menu-item.is-selected {
- background-color: var(--wpds-color-bg-interactive-neutral-active, rgba(255, 255, 255, 0.15));
- color: var(--wpds-color-fg-inverted-primary, #ffffff);
-}
-.sidebar .menu-item svg {
- flex-shrink: 0;
-}
-.sidebar .footer {
- padding: var(--wpds-spacing-40, 16px);
- border-top: 1px solid var(--wpds-color-stroke-inverted, rgba(255, 255, 255, 0.1));
-}
-.sidebar .footer > .components-h-stack {
- padding: 2px 0;
-}
-.sidebar .footer .footer-settings-button {
- color: var(--wpds-color-fg-inverted-secondary, #e0e0e0);
- flex-shrink: 0;
-}
-.sidebar .footer .footer-settings-button:hover:not(:disabled) {
- color: var(--wpds-color-fg-inverted-primary, #ffffff);
-}
-/*!****************************************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/themed-surface/style.scss ***!
- \****************************************************************************************************************************************************************************************************************************************************************************/
-/**
- * ThemedSurface styles
- *
- * Provides themed container for light content areas.
- * Uses wpds tokens directly for consistent theming.
- */
-.themed-surface {
- background: var(--wpds-color-bg-surface-neutral-strong, #ffffff);
- border-radius: var(--wpds-border-radius-large, 8px);
- overflow: hidden;
- display: flex;
- flex-direction: column;
- flex: 1;
- min-height: 0;
-}
-/*!*******************************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/panel/style.scss ***!
- \*******************************************************************************************************************************************************************************************************************************************************************/
-.panel {
- margin: var(--wpds-spacing-40, 16px) var(--wpds-spacing-40, 16px) var(--wpds-spacing-40, 16px) 0;
- flex: 1;
- min-height: 0;
- display: flex;
- flex-direction: column;
-}
-/*!********************************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/components/layout/style.scss ***!
- \********************************************************************************************************************************************************************************************************************************************************************/
-/* Ensure provider wrappers (SlotFillProvider, ShortcutProvider) fill height */
-#activitypub-social-web-root > div {
- height: 100%;
-}
-.app-layout {
- display: flex;
- flex-direction: column;
- width: 100%;
- height: 100%;
- background-color: var(--wpds-color-bg-surface-neutral-weak, #1e1e1e);
- overflow: hidden;
-}
-.app-content {
- width: 100%;
- height: 100%;
- flex-grow: 1;
- display: flex;
- background-color: var(--wpds-color-bg-surface-neutral-weak, #1e1e1e);
- overflow: hidden;
-}
-.sidebar-region {
- flex-shrink: 0;
- width: 300px;
- display: flex;
- flex-direction: column;
-}
-.stage-region {
- flex-grow: 1;
- min-width: 0;
- display: flex;
- flex-direction: column;
- overflow: hidden;
-}
-.inspector-region {
- width: var(--sw-inspector-width);
- flex-shrink: 0;
- display: flex;
- flex-direction: column;
-}
-.components-snackbar-list {
- position: fixed;
- bottom: 20px;
- left: 20px;
- z-index: 100000;
-}
-@media (max-width: 782px) {
- .app-content {
- flex-direction: column;
- }
- .sidebar-region,
- .inspector-region {
- width: 100%;
- }
- .components-snackbar-list {
- left: 10px;
- right: 10px;
- bottom: 10px;
- }
-}
-/*!**************************************************************************************************************************************************************************************************************************************************!*\
- !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/social-web/style.scss ***!
- \**************************************************************************************************************************************************************************************************************************************************/
-/**
- * Main stylesheet entry point for Social Web
- * This compiles to style-index.css
- */
-/**
- * Design Tokens for ActivityPub Social Web
- *
- * Uses wpds design tokens directly for colors, spacing, typography, etc.
- * Only defines app-specific layout dimensions.
- */
-:root {
- /* Layout dimensions (app-specific) */
- --sw-sidebar-width: 300px;
- --sw-inspector-width: 380px;
-}
-.activitypub-social-web-layout {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
-}
-#wpfooter {
- display: none;
-}
-
-/*# sourceMappingURL=style-index.css.map*/
\ No newline at end of file
+.site-icon{align-items:center;display:flex;justify-content:center}.site-icon__image{-o-object-fit:cover;object-fit:cover}.site-icon__icon{fill:currentColor}
+.site-hub{align-items:center;display:flex;gap:var(--wpds-spacing-20,8px);height:var(--wpds-spacing-160,64px);justify-content:space-between;margin-right:var(--wpds-spacing-30,12px)}.site-hub__actions{flex-shrink:0}.site-hub__icon-container{flex-shrink:0;height:var(--wpds-spacing-160,64px);width:var(--wpds-spacing-160,64px)}.site-hub__icon-container.has-transparent-background .site-hub__icon-container{background:transparent}.site-hub__icon-button.components-button{align-items:center;background:var(--wpds-color-bg-surface-neutral-weak,#1e1e1e);border-radius:0;display:flex;height:var(--wpds-spacing-160,64px);justify-content:center;overflow:hidden;padding:0;position:relative;view-transition-name:toggle;width:var(--wpds-spacing-160,64px)}.site-hub__icon-button.components-button,.site-hub__icon-button.components-button:active,.site-hub__icon-button.components-button:hover{color:var(--wpds-color-fg-inverted-primary,#fff)}.site-hub__icon-button.components-button:focus,.site-hub__icon-button.components-button:focus-visible{box-shadow:0 0 0 3px #1e1e1e,0 0 0 6px var(--wp-admin-theme-color);outline:4px solid transparent;outline-offset:4px}.site-hub__icon-button.components-button:before{border-radius:var(--wpds-border-radius-large,8px);bottom:calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));box-shadow:none;content:"";display:block;left:calc(var(--wpds-spacing-40, 16px) + var(--wpds-border-width-focus, 1px));position:absolute;right:calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));top:calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px))}@media not (prefers-reduced-motion){.site-hub__icon-button.components-button:before{transition:box-shadow .1s ease}}.site-hub__icon-button.components-button .site-icon{height:var(--wpds-spacing-160,64px);width:var(--wpds-spacing-160,64px)}.site-hub__icon-button.components-button .site-icon__icon{height:100%;width:100%}.site-hub__title .components-button{display:block;flex-grow:1;font-size:var(--wpds-font-size-medium,15px);font-weight:var(--wpds-font-weight-medium,500);margin-left:-4px;overflow:hidden;padding-right:var(--wpds-spacing-40,16px);position:relative;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.site-hub__title .components-button,.site-hub__title .components-button:active,.site-hub__title .components-button:focus,.site-hub__title .components-button:hover{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0)}.site-hub__title .components-button:focus{box-shadow:none;outline:none}.site-hub__title .components-button:focus-visible{box-shadow:0 0 0 var(--wp-admin-border-width-focus) #1e1e1e,0 0 0 calc(var(--wp-admin-border-width-focus)*2) var(--wpds-color-stroke-focus-brand,#0675c4);outline:2px solid transparent;outline-offset:2px}.site-hub__title .components-button:after{content:"↗";font-weight:400;opacity:0;position:absolute;right:0}@media not (prefers-reduced-motion){.site-hub__title .components-button:after{transition:opacity .1s linear}}.site-hub__title .components-button:active:after,.site-hub__title .components-button:focus:after,.site-hub__title .components-button:hover:after{opacity:1}.site-hub__command-button{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0)}.site-hub__command-button:active svg,.site-hub__command-button:hover svg{fill:var(--wpds-color-private-bg-fg-fill,#f0f0f0)}
+.actor-switcher{align-items:center;color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);display:flex;min-width:0;padding-left:2px;text-decoration:none;transition:color .2s ease}.actor-switcher:hover:not(:disabled){color:var(--wpds-color-fg-inverted-primary,#fff)}.actor-switcher__avatar{border-radius:50%;flex-shrink:0;height:32px;width:32px}.actor-switcher__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
+.sidebar{color:var(--wpds-color-fg-inverted-secondary,#ccc);display:flex;flex:1;flex-direction:column}.sidebar .nav{flex:1;overflow-y:auto;padding:0 var(--wpds-spacing-30,12px)}.sidebar .sidebar-navigation__icon-title{background:var(--wpds-color-bg-surface-neutral-weak,#1e1e1e);margin-bottom:var(--wpds-spacing-20,8px);padding-bottom:var(--wpds-spacing-20,8px);padding-top:var(--wpds-spacing-120,48px);position:sticky;top:0}.sidebar .sidebar-navigation__button{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);flex-shrink:0}.sidebar .sidebar-navigation__button:focus:not(:disabled){box-shadow:none;outline:none}.sidebar .sidebar-navigation__button:focus-visible:not(:disabled){box-shadow:0 0 0 var(--wpds-border-width-focus,1.5px) var(--wp-admin-theme-color);outline:3px solid transparent}.sidebar .sidebar-navigation__button:focus,.sidebar .sidebar-navigation__button:focus-visible,.sidebar .sidebar-navigation__button:hover:not(:disabled,[aria-disabled=true]),.sidebar .sidebar-navigation__button:not(:disabled,[aria-disabled=true]):active,.sidebar .sidebar-navigation__button[aria-expanded=true]{color:var(--wpds-color-private-bg-fg-fill,#f0f0f0)}.sidebar .sidebar-navigation__title{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);flex-grow:1;line-height:var(--wpds-spacing-80,32px);overflow-wrap:break-word}.sidebar .menu-item{align-items:center;color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);display:flex;gap:var(--wpds-spacing-20,8px)}.sidebar .menu-item:hover{background-color:var(--wpds-color-bg-interactive-neutral-hover,hsla(0,0%,100%,.1));color:var(--wpds-color-fg-inverted-primary,#fff)}.sidebar .menu-item.is-selected{background-color:var(--wpds-color-bg-interactive-neutral-active,hsla(0,0%,100%,.15));color:var(--wpds-color-fg-inverted-primary,#fff)}.sidebar .menu-item svg{flex-shrink:0}.sidebar .footer{border-top:1px solid var(--wpds-color-stroke-inverted,hsla(0,0%,100%,.1));padding:var(--wpds-spacing-40,16px)}.sidebar .footer>.components-h-stack{padding:2px 0}.sidebar .footer .footer-settings-button{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);flex-shrink:0}.sidebar .footer .footer-settings-button:hover:not(:disabled){color:var(--wpds-color-fg-inverted-primary,#fff)}
+.themed-surface{background:var(--wpds-color-bg-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-large,8px);display:flex;flex:1;flex-direction:column;min-height:0;overflow:hidden}
+.panel{display:flex;flex:1;flex-direction:column;margin:var(--wpds-spacing-40,16px) var(--wpds-spacing-40,16px) var(--wpds-spacing-40,16px) 0;min-height:0}
+#activitypub-social-web-root>div{height:100%}.app-layout{flex-direction:column}.app-content,.app-layout{background-color:var(--wpds-color-bg-surface-neutral-weak,#1e1e1e);display:flex;height:100%;overflow:hidden;width:100%}.app-content{flex-grow:1}.sidebar-region{flex-shrink:0;width:300px}.sidebar-region,.stage-region{display:flex;flex-direction:column}.stage-region{flex-grow:1;min-width:0;overflow:hidden}.inspector-region{display:flex;flex-direction:column;flex-shrink:0;width:var(--sw-inspector-width)}.components-snackbar-list{bottom:20px;left:20px;position:fixed;z-index:100000}@media(max-width:782px){.app-content{flex-direction:column}.inspector-region,.sidebar-region{width:100%}.components-snackbar-list{bottom:10px;left:10px;right:10px}}
+:root{--sw-sidebar-width:300px;--sw-inspector-width:380px}.activitypub-social-web-layout{bottom:0;left:0;position:fixed;right:0;top:0}#wpfooter{display:none}
diff --git a/build/social-web/vendors.asset.php b/build/social-web/vendors.asset.php
index 215385aaa3..63f2690385 100644
--- a/build/social-web/vendors.asset.php
+++ b/build/social-web/vendors.asset.php
@@ -1 +1 @@
- array(), 'version' => '38e63120ab50ddcf3954');
+ array(), 'version' => '75855a84b95a5c8323d7');
diff --git a/build/social-web/vendors.js b/build/social-web/vendors.js
index 9396ae83c3..3a811787d3 100644
--- a/build/social-web/vendors.js
+++ b/build/social-web/vendors.js
@@ -1,22189 +1,103 @@
-(globalThis["webpackChunkwordpress_activitypub"] = globalThis["webpackChunkwordpress_activitypub"] || []).push([["social-web/vendors"],{
-
-/***/ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js":
-/*!*************************************************************!*\
- !*** ./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js ***!
- \*************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ canUseDOM: () => (/* binding */ canUseDOM),
-/* harmony export */ contains: () => (/* binding */ contains),
-/* harmony export */ getActiveElement: () => (/* binding */ getActiveElement),
-/* harmony export */ getDocument: () => (/* binding */ getDocument),
-/* harmony export */ getPopupItemRole: () => (/* binding */ getPopupItemRole),
-/* harmony export */ getPopupRole: () => (/* binding */ getPopupRole),
-/* harmony export */ getScrollingElement: () => (/* binding */ getScrollingElement),
-/* harmony export */ getTextboxSelection: () => (/* binding */ getTextboxSelection),
-/* harmony export */ getTextboxValue: () => (/* binding */ getTextboxValue),
-/* harmony export */ getWindow: () => (/* binding */ getWindow),
-/* harmony export */ isButton: () => (/* binding */ isButton),
-/* harmony export */ isFrame: () => (/* binding */ isFrame),
-/* harmony export */ isPartiallyHidden: () => (/* binding */ isPartiallyHidden),
-/* harmony export */ isTextField: () => (/* binding */ isTextField),
-/* harmony export */ isTextbox: () => (/* binding */ isTextbox),
-/* harmony export */ isVisible: () => (/* binding */ isVisible),
-/* harmony export */ scrollIntoViewIfNeeded: () => (/* binding */ scrollIntoViewIfNeeded),
-/* harmony export */ setSelectionRange: () => (/* binding */ setSelectionRange),
-/* harmony export */ sortBasedOnDOMPosition: () => (/* binding */ sortBasedOnDOMPosition)
-/* harmony export */ });
-"use client";
-
-// src/utils/dom.ts
-var canUseDOM = checkIsBrowser();
-function checkIsBrowser() {
- var _a;
- return typeof window !== "undefined" && !!((_a = window.document) == null ? void 0 : _a.createElement);
-}
-function getDocument(node) {
- if (!node) return document;
- if ("self" in node) return node.document;
- return node.ownerDocument || document;
-}
-function getWindow(node) {
- if (!node) return self;
- if ("self" in node) return node.self;
- return getDocument(node).defaultView || window;
-}
-function getActiveElement(node, activeDescendant = false) {
- const { activeElement } = getDocument(node);
- if (!(activeElement == null ? void 0 : activeElement.nodeName)) {
- return null;
- }
- if (isFrame(activeElement) && activeElement.contentDocument) {
- return getActiveElement(
- activeElement.contentDocument.body,
- activeDescendant
- );
- }
- if (activeDescendant) {
- const id = activeElement.getAttribute("aria-activedescendant");
- if (id) {
- const element = getDocument(activeElement).getElementById(id);
- if (element) {
- return element;
- }
- }
- }
- return activeElement;
-}
-function contains(parent, child) {
- return parent === child || parent.contains(child);
-}
-function isFrame(element) {
- return element.tagName === "IFRAME";
-}
-function isButton(element) {
- const tagName = element.tagName.toLowerCase();
- if (tagName === "button") return true;
- if (tagName === "input" && element.type) {
- return buttonInputTypes.indexOf(element.type) !== -1;
- }
- return false;
-}
-var buttonInputTypes = [
- "button",
- "color",
- "file",
- "image",
- "reset",
- "submit"
-];
-function isVisible(element) {
- if (typeof element.checkVisibility === "function") {
- return element.checkVisibility();
- }
- const htmlElement = element;
- return htmlElement.offsetWidth > 0 || htmlElement.offsetHeight > 0 || element.getClientRects().length > 0;
-}
-function isTextField(element) {
- try {
- const isTextInput = element instanceof HTMLInputElement && element.selectionStart !== null;
- const isTextArea = element.tagName === "TEXTAREA";
- return isTextInput || isTextArea || false;
- } catch (_error) {
- return false;
- }
-}
-function isTextbox(element) {
- return element.isContentEditable || isTextField(element);
-}
-function getTextboxValue(element) {
- if (isTextField(element)) {
- return element.value;
- }
- if (element.isContentEditable) {
- const range = getDocument(element).createRange();
- range.selectNodeContents(element);
- return range.toString();
- }
- return "";
-}
-function getTextboxSelection(element) {
- let start = 0;
- let end = 0;
- if (isTextField(element)) {
- start = element.selectionStart || 0;
- end = element.selectionEnd || 0;
- } else if (element.isContentEditable) {
- const selection = 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);
- nextRange.setEnd(range.startContainer, range.startOffset);
- start = nextRange.toString().length;
- nextRange.setEnd(range.endContainer, range.endOffset);
- end = nextRange.toString().length;
- }
- }
- return { start, end };
-}
-function getPopupRole(element, fallback) {
- const allowedPopupRoles = ["dialog", "menu", "listbox", "tree", "grid"];
- const role = element == null ? void 0 : element.getAttribute("role");
- if (role && allowedPopupRoles.indexOf(role) !== -1) {
- return role;
- }
- return fallback;
-}
-function getPopupItemRole(element, fallback) {
- var _a;
- const itemRoleByPopupRole = {
- menu: "menuitem",
- listbox: "option",
- tree: "treeitem"
- };
- const popupRole = getPopupRole(element);
- if (!popupRole) return fallback;
- const key = popupRole;
- return (_a = itemRoleByPopupRole[key]) != null ? _a : fallback;
-}
-function scrollIntoViewIfNeeded(element, arg) {
- if (isPartiallyHidden(element) && "scrollIntoView" in element) {
- element.scrollIntoView(arg);
- }
-}
-function getScrollingElement(element) {
- if (!element) return null;
- const isScrollableOverflow = (overflow) => {
- if (overflow === "auto") return true;
- if (overflow === "scroll") return true;
- return false;
- };
- if (element.clientHeight && element.scrollHeight > element.clientHeight) {
- const { overflowY } = getComputedStyle(element);
- if (isScrollableOverflow(overflowY)) return element;
- } else if (element.clientWidth && element.scrollWidth > element.clientWidth) {
- const { overflowX } = getComputedStyle(element);
- if (isScrollableOverflow(overflowX)) return element;
- }
- return getScrollingElement(element.parentElement) || document.scrollingElement || document.body;
-}
-function isPartiallyHidden(element) {
- const elementRect = element.getBoundingClientRect();
- const scroller = getScrollingElement(element);
- if (!scroller) return false;
- const scrollerRect = scroller.getBoundingClientRect();
- const isHTML = scroller.tagName === "HTML";
- const scrollerTop = isHTML ? scrollerRect.top + scroller.scrollTop : scrollerRect.top;
- const scrollerBottom = isHTML ? scroller.clientHeight : scrollerRect.bottom;
- const scrollerLeft = isHTML ? scrollerRect.left + scroller.scrollLeft : scrollerRect.left;
- const scrollerRight = isHTML ? scroller.clientWidth : scrollerRect.right;
- const top = elementRect.top < scrollerTop;
- const left = elementRect.left < scrollerLeft;
- const bottom = elementRect.bottom > scrollerBottom;
- 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);
- }
-}
-function sortBasedOnDOMPosition(items, getElement) {
- const pairs = items.map((item, index) => [index, item]);
- let isOrderDifferent = false;
- pairs.sort(([indexA, a], [indexB, b]) => {
- const elementA = getElement(a);
- const elementB = getElement(b);
- if (elementA === elementB) return 0;
- if (!elementA || !elementB) return 0;
- if (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 isElementPreceding(a, b) {
- return Boolean(
- b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING
- );
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js":
-/*!*************************************************************!*\
- !*** ./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js ***!
- \*************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ __objRest: () => (/* binding */ __objRest),
-/* harmony export */ __spreadProps: () => (/* binding */ __spreadProps),
-/* harmony export */ __spreadValues: () => (/* binding */ __spreadValues)
-/* harmony export */ });
-"use client";
-var __defProp = Object.defineProperty;
-var __defProps = Object.defineProperties;
-var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
-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 __spreadValues = (a, b) => {
- for (var prop in b || (b = {}))
- if (__hasOwnProp.call(b, prop))
- __defNormalProp(a, prop, b[prop]);
- if (__getOwnPropSymbols)
- for (var prop of __getOwnPropSymbols(b)) {
- if (__propIsEnum.call(b, prop))
- __defNormalProp(a, prop, b[prop]);
- }
- return a;
-};
-var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
-var __objRest = (source, exclude) => {
- var target = {};
- for (var prop in source)
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
- target[prop] = source[prop];
- if (source != null && __getOwnPropSymbols)
- for (var prop of __getOwnPropSymbols(source)) {
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
- target[prop] = source[prop];
- }
- return target;
-};
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/core/esm/__chunks/43IPP2F4.js":
-/*!*************************************************************!*\
- !*** ./node_modules/@ariakit/core/esm/__chunks/43IPP2F4.js ***!
- \*************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ createDisclosureStore: () => (/* binding */ createDisclosureStore)
-/* harmony export */ });
-/* harmony import */ var _EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./EWA2WL6G.js */ "./node_modules/@ariakit/core/esm/__chunks/EWA2WL6G.js");
-/* harmony import */ var _PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PBFD2E7P.js */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
-/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js");
-"use client";
-
-
-
-
-// src/disclosure/disclosure-store.ts
-function createDisclosureStore(props = {}) {
- const store = (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_0__.mergeStore)(
- props.store,
- (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_0__.omit)(props.disclosure, ["contentElement", "disclosureElement"])
- );
- (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_0__.throwOnConflictingProps)(props, store);
- const syncState = store == null ? void 0 : store.getState();
- const open = (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_1__.defaultValue)(
- props.open,
- syncState == null ? void 0 : syncState.open,
- props.defaultOpen,
- false
- );
- const animated = (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_1__.defaultValue)(props.animated, syncState == null ? void 0 : syncState.animated, false);
- const initialState = {
- open,
- animated,
- animating: !!animated && open,
- mounted: open,
- contentElement: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_1__.defaultValue)(syncState == null ? void 0 : syncState.contentElement, null),
- disclosureElement: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_1__.defaultValue)(syncState == null ? void 0 : syncState.disclosureElement, null)
- };
- const disclosure = (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_0__.createStore)(initialState, store);
- (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_0__.setup)(
- disclosure,
- () => (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_0__.sync)(disclosure, ["animated", "animating"], (state) => {
- if (state.animated) return;
- disclosure.setState("animating", false);
- })
- );
- (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_0__.setup)(
- disclosure,
- () => (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_0__.subscribe)(disclosure, ["open"], () => {
- if (!disclosure.getState().animated) return;
- disclosure.setState("animating", true);
- })
- );
- (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_0__.setup)(
- disclosure,
- () => (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_0__.sync)(disclosure, ["open", "animating"], (state) => {
- disclosure.setState("mounted", state.open || state.animating);
- })
- );
- return (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadValues)({}, disclosure), {
- disclosure: props.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)
- });
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/core/esm/__chunks/7PRQYBBV.js":
-/*!*************************************************************!*\
- !*** ./node_modules/@ariakit/core/esm/__chunks/7PRQYBBV.js ***!
- \*************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ addItemToArray: () => (/* binding */ addItemToArray),
-/* harmony export */ flatten2DArray: () => (/* binding */ flatten2DArray),
-/* harmony export */ reverseArray: () => (/* binding */ reverseArray),
-/* harmony export */ toArray: () => (/* binding */ toArray)
-/* harmony export */ });
-"use client";
-
-// src/utils/array.ts
-function 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();
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/core/esm/__chunks/C34RJTDU.js":
-/*!*************************************************************!*\
- !*** ./node_modules/@ariakit/core/esm/__chunks/C34RJTDU.js ***!
- \*************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ createCompositeStore: () => (/* binding */ createCompositeStore)
-/* harmony export */ });
-/* harmony import */ var _7PRQYBBV_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./7PRQYBBV.js */ "./node_modules/@ariakit/core/esm/__chunks/7PRQYBBV.js");
-/* harmony import */ var _K2KIGYQU_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./K2KIGYQU.js */ "./node_modules/@ariakit/core/esm/__chunks/K2KIGYQU.js");
-/* harmony import */ var _EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./EWA2WL6G.js */ "./node_modules/@ariakit/core/esm/__chunks/EWA2WL6G.js");
-/* harmony import */ var _PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PBFD2E7P.js */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
-/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js");
-"use client";
-
-
-
-
-
-
-// src/composite/composite-store.ts
-var NULL_ITEM = { id: null };
-function 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 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 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 ? findFirstEnabledItem(row) : row[i - 1];
- row[i] = previousItem && activeId !== previousItem.id && focusShift ? previousItem : createEmptyItem(previousItem == null ? void 0 : previousItem.rowId);
- }
- }
- }
- return rows;
-}
-function 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((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__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 = (0,_K2KIGYQU_js__WEBPACK_IMPORTED_MODULE_1__.createCollectionStore)(props);
- const activeId = (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_3__.defaultValue)(
- props.activeId,
- syncState == null ? void 0 : syncState.activeId,
- props.defaultActiveId
- );
- const initialState = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__spreadValues)({}, collection.getState()), {
- id: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_3__.defaultValue)(
- props.id,
- syncState == null ? void 0 : syncState.id,
- `id-${Math.random().toString(36).slice(2, 8)}`
- ),
- activeId,
- baseElement: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_3__.defaultValue)(syncState == null ? void 0 : syncState.baseElement, null),
- includesBaseElement: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_3__.defaultValue)(
- props.includesBaseElement,
- syncState == null ? void 0 : syncState.includesBaseElement,
- activeId === null
- ),
- moves: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_3__.defaultValue)(syncState == null ? void 0 : syncState.moves, 0),
- orientation: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_3__.defaultValue)(
- props.orientation,
- syncState == null ? void 0 : syncState.orientation,
- "both"
- ),
- rtl: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_3__.defaultValue)(props.rtl, syncState == null ? void 0 : syncState.rtl, false),
- virtualFocus: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_3__.defaultValue)(
- props.virtualFocus,
- syncState == null ? void 0 : syncState.virtualFocus,
- false
- ),
- focusLoop: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_3__.defaultValue)(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, false),
- focusWrap: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_3__.defaultValue)(props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false),
- focusShift: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_3__.defaultValue)(props.focusShift, syncState == null ? void 0 : syncState.focusShift, false)
- });
- const composite = (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_2__.createStore)(initialState, collection, props.store);
- (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_2__.setup)(
- composite,
- () => (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_2__.sync)(composite, ["renderedItems", "activeId"], (state) => {
- composite.setState("activeId", (activeId2) => {
- var _a2;
- if (activeId2 !== void 0) return activeId2;
- return (_a2 = findFirstEnabledItem(state.renderedItems)) == null ? void 0 : _a2.id;
- });
- })
- );
- const getNextId = (direction = "next", options = {}) => {
- var _a2, _b;
- const defaultState = composite.getState();
- const {
- skip = 0,
- activeId: activeId2 = defaultState.activeId,
- focusShift = defaultState.focusShift,
- focusLoop = defaultState.focusLoop,
- focusWrap = defaultState.focusWrap,
- includesBaseElement = defaultState.includesBaseElement,
- renderedItems = defaultState.renderedItems,
- rtl = defaultState.rtl
- } = options;
- const isVerticalDirection = direction === "up" || direction === "down";
- const isNextDirection = direction === "next" || direction === "down";
- const canReverse = isNextDirection ? rtl && !isVerticalDirection : !rtl || isVerticalDirection;
- const canShift = focusShift && !skip;
- let items = !isVerticalDirection ? renderedItems : (0,_7PRQYBBV_js__WEBPACK_IMPORTED_MODULE_0__.flatten2DArray)(
- normalizeRows(groupItemsByRows(renderedItems), activeId2, canShift)
- );
- items = canReverse ? (0,_7PRQYBBV_js__WEBPACK_IMPORTED_MODULE_0__.reverseArray)(items) : items;
- items = isVerticalDirection ? verticalizeItems(items) : items;
- if (activeId2 == null) {
- return (_a2 = findFirstEnabledItem(items)) == null ? void 0 : _a2.id;
- }
- const activeItem = items.find((item) => item.id === activeId2);
- if (!activeItem) {
- return (_b = findFirstEnabledItem(items)) == null ? void 0 : _b.id;
- }
- const isGrid = items.some((item) => item.rowId);
- const activeIndex = items.indexOf(activeItem);
- const nextItems = items.slice(activeIndex + 1);
- const nextItemsInRow = getItemsInRow(nextItems, activeItem.rowId);
- if (skip) {
- 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 canLoop = focusLoop && (isVerticalDirection ? focusLoop !== "horizontal" : focusLoop !== "vertical");
- const canWrap = isGrid && focusWrap && (isVerticalDirection ? focusWrap !== "horizontal" : focusWrap !== "vertical");
- const hasNullItem = isNextDirection ? (!isGrid || isVerticalDirection) && canLoop && includesBaseElement : isVerticalDirection ? includesBaseElement : false;
- if (canLoop) {
- const loopItems = canWrap && !hasNullItem ? items : getItemsInRow(items, activeItem.rowId);
- const sortedItems = flipItems(loopItems, activeId2, hasNullItem);
- const nextItem2 = findFirstEnabledItem(sortedItems, activeId2);
- return nextItem2 == null ? void 0 : nextItem2.id;
- }
- if (canWrap) {
- const nextItem2 = 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 = findFirstEnabledItem(nextItemsInRow, activeId2);
- if (!nextItem && hasNullItem) {
- return null;
- }
- return nextItem == null ? void 0 : nextItem.id;
- };
- return (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__spreadValues)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__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 = findFirstEnabledItem(composite.getState().renderedItems)) == null ? void 0 : _a2.id;
- },
- last: () => {
- var _a2;
- return (_a2 = findFirstEnabledItem((0,_7PRQYBBV_js__WEBPACK_IMPORTED_MODULE_0__.reverseArray)(composite.getState().renderedItems))) == null ? void 0 : _a2.id;
- },
- next: (options) => {
- if (options !== void 0 && typeof options === "number") {
- options = { skip: options };
- }
- return getNextId("next", options);
- },
- previous: (options) => {
- if (options !== void 0 && typeof options === "number") {
- options = { skip: options };
- }
- return getNextId("previous", options);
- },
- down: (options) => {
- if (options !== void 0 && typeof options === "number") {
- options = { skip: options };
- }
- return getNextId("down", options);
- },
- up: (options) => {
- if (options !== void 0 && typeof options === "number") {
- options = { skip: options };
- }
- return getNextId("up", options);
- }
- });
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/core/esm/__chunks/EWA2WL6G.js":
-/*!*************************************************************!*\
- !*** ./node_modules/@ariakit/core/esm/__chunks/EWA2WL6G.js ***!
- \*************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ batch: () => (/* binding */ batch),
-/* harmony export */ createStore: () => (/* binding */ createStore),
-/* harmony export */ init: () => (/* binding */ init),
-/* harmony export */ mergeStore: () => (/* binding */ mergeStore),
-/* harmony export */ omit: () => (/* binding */ omit2),
-/* harmony export */ pick: () => (/* binding */ pick2),
-/* harmony export */ setup: () => (/* binding */ setup),
-/* harmony export */ subscribe: () => (/* binding */ subscribe),
-/* harmony export */ sync: () => (/* binding */ sync),
-/* harmony export */ throwOnConflictingProps: () => (/* binding */ throwOnConflictingProps)
-/* harmony export */ });
-/* harmony import */ var _PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PBFD2E7P.js */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
-/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js");
-"use client";
-
-
-
-// src/utils/store.ts
-function getInternal(store, key) {
- const internals = store.__unstableInternals;
- (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_0__.invariant)(internals, "Invalid store");
- return internals[key];
-}
-function createStore(initialState, ...stores) {
- let state = initialState;
- let prevStateBatch = state;
- let lastUpdate = Symbol();
- let destroy = _PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_0__.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 = (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_0__.getKeys)(state).map(
- (key) => (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_0__.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 (!(0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_0__.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 = [];
- for (const setup2 of setups) {
- teardowns.push(setup2());
- }
- const cleanups = stores.map(init);
- destroy = (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_0__.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((0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_0__.pick)(state, keys), finalStore);
- const storeOmit = (keys) => createStore((0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_0__.omit)(state, keys), finalStore);
- const getState = () => state;
- const setState = (key, value, fromStores = false) => {
- var _a;
- if (!(0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_0__.hasOwnProperty)(state, key)) return;
- const nextValue = (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_0__.applyState)(value, state[key]);
- if (nextValue === state[key]) return;
- if (!fromStores) {
- for (const store of stores) {
- (_a = store == null ? void 0 : store.setState) == null ? void 0 : _a.call(store, key, nextValue);
- }
- }
- const prevState = state;
- state = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadValues)({}, state), { [key]: nextValue });
- const thisUpdate = Symbol();
- lastUpdate = thisUpdate;
- updatedKeys.add(key);
- const run = (listener, prev, uKeys) => {
- var _a2;
- const keys = listenerKeys.get(listener);
- const updated = (k) => uKeys ? uKeys.has(k) : k === key;
- if (!keys || keys.some(updated)) {
- (_a2 = disposables.get(listener)) == null ? void 0 : _a2();
- disposables.set(listener, listener(state, prev));
- }
- };
- for (const listener of listeners) {
- run(listener, prevState);
- }
- queueMicrotask(() => {
- if (lastUpdate !== thisUpdate) return;
- const snapshot = state;
- for (const listener of batchListeners) {
- 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 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) {
- var _a;
- const initialState = {};
- for (const store2 of stores) {
- const nextState = (_a = store2 == null ? void 0 : store2.getState) == null ? void 0 : _a.call(store2);
- if (nextState) {
- Object.assign(initialState, nextState);
- }
- }
- const store = createStore(initialState, ...stores);
- return Object.assign({}, ...stores, store);
-}
-function throwOnConflictingProps(props, store) {
- if (false) // removed by dead control flow
-{}
- 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) => (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_0__.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();
-
- ^ ^
-
-Instead, pass the default state to the topmost store:
-
-const store = useSelectStore({ defaultValue: "Apple" });
-
-
-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
-`
- );
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/core/esm/__chunks/K2KIGYQU.js":
-/*!*************************************************************!*\
- !*** ./node_modules/@ariakit/core/esm/__chunks/K2KIGYQU.js ***!
- \*************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ createCollectionStore: () => (/* binding */ createCollectionStore)
-/* harmony export */ });
-/* harmony import */ var _37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./37JWRFYW.js */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js");
-/* harmony import */ var _EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./EWA2WL6G.js */ "./node_modules/@ariakit/core/esm/__chunks/EWA2WL6G.js");
-/* harmony import */ var _PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PBFD2E7P.js */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
-/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js");
-"use client";
-
-
-
-
-
-// src/collection/collection-store.ts
-function 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 (0,_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.getDocument)(parentElement).body;
-}
-function getPrivateStore(store) {
- return store == null ? void 0 : store.__unstablePrivateStore;
-}
-function createCollectionStore(props = {}) {
- var _a;
- (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.throwOnConflictingProps)(props, props.store);
- const syncState = (_a = props.store) == null ? void 0 : _a.getState();
- const items = (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_2__.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: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_2__.defaultValue)(syncState == null ? void 0 : syncState.renderedItems, [])
- };
- const syncPrivateStore = getPrivateStore(props.store);
- const privateStore = (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.createStore)(
- { items, renderedItems: initialState.renderedItems },
- syncPrivateStore
- );
- const collection = (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.createStore)(initialState, props.store);
- const sortItems = (renderedItems) => {
- const sortedItems = (0,_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.sortBasedOnDOMPosition)(renderedItems, (i) => i.element);
- privateStore.setState("renderedItems", sortedItems);
- collection.setState("renderedItems", sortedItems);
- };
- (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.setup)(collection, () => (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.init)(privateStore));
- (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.setup)(privateStore, () => {
- return (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.batch)(privateStore, ["items"], (state) => {
- collection.setState("items", state.items);
- });
- });
- (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.setup)(privateStore, () => {
- return (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.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);
- }
- const ioCallback = () => {
- if (firstRun) {
- firstRun = false;
- return;
- }
- 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);
- }
- 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 = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__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) => privateStore.setState("items", getItems),
- true
- );
- return (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)({}, collection), {
- registerItem,
- renderItem: (item) => (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_2__.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 } = privateStore.getState();
- item = items2.find((item2) => item2.id === id);
- if (item) {
- itemsMap.set(id, item);
- }
- }
- return item || null;
- },
- // @ts-expect-error Internal
- __unstablePrivateStore: privateStore
- });
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/core/esm/__chunks/MD3RIO2T.js":
-/*!*************************************************************!*\
- !*** ./node_modules/@ariakit/core/esm/__chunks/MD3RIO2T.js ***!
- \*************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ createPopoverStore: () => (/* binding */ createPopoverStore)
-/* harmony export */ });
-/* harmony import */ var _RZDDWCDV_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./RZDDWCDV.js */ "./node_modules/@ariakit/core/esm/__chunks/RZDDWCDV.js");
-/* harmony import */ var _EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./EWA2WL6G.js */ "./node_modules/@ariakit/core/esm/__chunks/EWA2WL6G.js");
-/* harmony import */ var _PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PBFD2E7P.js */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
-/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js");
-"use client";
-
-
-
-
-
-// src/popover/popover-store.ts
-function createPopoverStore(_a = {}) {
- var _b = _a, {
- popover: otherPopover
- } = _b, props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__objRest)(_b, [
- "popover"
- ]);
- const store = (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.mergeStore)(
- props.store,
- (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.omit)(otherPopover, [
- "arrowElement",
- "anchorElement",
- "contentElement",
- "popoverElement",
- "disclosureElement"
- ])
- );
- (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.throwOnConflictingProps)(props, store);
- const syncState = store == null ? void 0 : store.getState();
- const dialog = (0,_RZDDWCDV_js__WEBPACK_IMPORTED_MODULE_0__.createDialogStore)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)({}, props), { store }));
- const placement = (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_2__.defaultValue)(
- props.placement,
- syncState == null ? void 0 : syncState.placement,
- "bottom"
- );
- const initialState = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)({}, dialog.getState()), {
- placement,
- currentPlacement: placement,
- anchorElement: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_2__.defaultValue)(syncState == null ? void 0 : syncState.anchorElement, null),
- popoverElement: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_2__.defaultValue)(syncState == null ? void 0 : syncState.popoverElement, null),
- arrowElement: (0,_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_2__.defaultValue)(syncState == null ? void 0 : syncState.arrowElement, null),
- rendered: Symbol("rendered")
- });
- const popover = (0,_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_1__.createStore)(initialState, dialog, store);
- return (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__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"))
- });
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/core/esm/__chunks/O6E4ZWCP.js":
-/*!*************************************************************!*\
- !*** ./node_modules/@ariakit/core/esm/__chunks/O6E4ZWCP.js ***!
- \*************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ isApple: () => (/* binding */ isApple),
-/* harmony export */ isFirefox: () => (/* binding */ isFirefox),
-/* harmony export */ isMac: () => (/* binding */ isMac),
-/* harmony export */ isSafari: () => (/* binding */ isSafari),
-/* harmony export */ isTouchDevice: () => (/* binding */ isTouchDevice)
-/* harmony export */ });
-/* harmony import */ var _37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./37JWRFYW.js */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js");
-"use client";
-
-
-// src/utils/platform.ts
-function isTouchDevice() {
- return _37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.canUseDOM && !!navigator.maxTouchPoints;
-}
-function isApple() {
- if (!_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.canUseDOM) return false;
- return /mac|iphone|ipad|ipod/i.test(navigator.platform);
-}
-function isSafari() {
- return _37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.canUseDOM && isApple() && /apple/i.test(navigator.vendor);
-}
-function isFirefox() {
- return _37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.canUseDOM && /firefox\//i.test(navigator.userAgent);
-}
-function isMac() {
- return _37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice();
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js":
-/*!*************************************************************!*\
- !*** ./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js ***!
- \*************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ afterPaint: () => (/* binding */ afterPaint),
-/* harmony export */ applyState: () => (/* binding */ applyState),
-/* harmony export */ beforePaint: () => (/* binding */ beforePaint),
-/* harmony export */ chain: () => (/* binding */ chain),
-/* harmony export */ cx: () => (/* binding */ cx),
-/* harmony export */ defaultValue: () => (/* binding */ defaultValue),
-/* harmony export */ disabledFromProps: () => (/* binding */ disabledFromProps),
-/* harmony export */ getKeys: () => (/* binding */ getKeys),
-/* harmony export */ hasOwnProperty: () => (/* binding */ hasOwnProperty),
-/* harmony export */ identity: () => (/* binding */ identity),
-/* harmony export */ invariant: () => (/* binding */ invariant),
-/* harmony export */ isEmpty: () => (/* binding */ isEmpty),
-/* harmony export */ isFalsyBooleanCallback: () => (/* binding */ isFalsyBooleanCallback),
-/* harmony export */ isInteger: () => (/* binding */ isInteger),
-/* harmony export */ isObject: () => (/* binding */ isObject),
-/* harmony export */ noop: () => (/* binding */ noop),
-/* harmony export */ normalizeString: () => (/* binding */ normalizeString),
-/* harmony export */ omit: () => (/* binding */ omit),
-/* harmony export */ pick: () => (/* binding */ pick),
-/* harmony export */ removeUndefinedValues: () => (/* binding */ removeUndefinedValues),
-/* harmony export */ shallowEqual: () => (/* binding */ shallowEqual)
-/* harmony export */ });
-/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js");
-"use client";
-
-
-// src/utils/misc.ts
-function noop(..._) {
-}
-function shallowEqual(a, b) {
- if (a === b) return true;
- if (!a) return false;
- if (!b) return false;
- if (typeof a !== "object") return false;
- if (typeof b !== "object") return false;
- const aKeys = Object.keys(a);
- const bKeys = Object.keys(b);
- const { length } = aKeys;
- if (bKeys.length !== length) return false;
- for (const key of aKeys) {
- if (a[key] !== b[key]) {
- return false;
- }
- }
- return true;
-}
-function applyState(argument, currentValue) {
- if (isUpdater(argument)) {
- const value = isLazyValue(currentValue) ? currentValue() : currentValue;
- return argument(value);
- }
- return argument;
-}
-function isUpdater(argument) {
- return typeof argument === "function";
-}
-function isLazyValue(value) {
- return typeof value === "function";
-}
-function isObject(arg) {
- return typeof arg === "object" && arg != null;
-}
-function isEmpty(arg) {
- if (Array.isArray(arg)) return !arg.length;
- if (isObject(arg)) return !Object.keys(arg).length;
- if (arg == null) return true;
- if (arg === "") return true;
- return false;
-}
-function isInteger(arg) {
- if (typeof arg === "number") {
- return Math.floor(arg) === arg;
- }
- return String(Math.floor(Number(arg))) === arg;
-}
-function hasOwnProperty(object, prop) {
- if (typeof Object.hasOwn === "function") {
- return Object.hasOwn(object, prop);
- }
- return Object.prototype.hasOwnProperty.call(object, prop);
-}
-function chain(...fns) {
- return (...args) => {
- for (const fn of fns) {
- if (typeof fn === "function") {
- fn(...args);
- }
- }
- };
-}
-function cx(...args) {
- return args.filter(Boolean).join(" ") || void 0;
-}
-function normalizeString(str) {
- return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
-}
-function omit(object, keys) {
- const result = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_0__.__spreadValues)({}, object);
- for (const key of keys) {
- if (hasOwnProperty(result, key)) {
- delete result[key];
- }
- }
- return result;
-}
-function pick(object, paths) {
- const result = {};
- for (const key of paths) {
- if (hasOwnProperty(object, key)) {
- result[key] = object[key];
- }
- }
- return result;
-}
-function identity(value) {
- return value;
-}
-function beforePaint(cb = noop) {
- const raf = requestAnimationFrame(cb);
- return () => cancelAnimationFrame(raf);
-}
-function afterPaint(cb = noop) {
- let raf = requestAnimationFrame(() => {
- raf = requestAnimationFrame(cb);
- });
- return () => cancelAnimationFrame(raf);
-}
-function invariant(condition, message) {
- if (condition) return;
- if (typeof message !== "string") throw new Error("Invariant failed");
- throw new Error(message);
-}
-function getKeys(obj) {
- return Object.keys(obj);
-}
-function isFalsyBooleanCallback(booleanOrCallback, ...args) {
- const result = typeof booleanOrCallback === "function" ? booleanOrCallback(...args) : booleanOrCallback;
- if (result == null) return false;
- return !result;
-}
-function disabledFromProps(props) {
- return props.disabled || props["aria-disabled"] === true || props["aria-disabled"] === "true";
-}
-function removeUndefinedValues(obj) {
- const result = {};
- for (const key in obj) {
- if (obj[key] !== void 0) {
- result[key] = obj[key];
- }
- }
- return result;
-}
-function defaultValue(...values) {
- for (const value of values) {
- if (value !== void 0) return value;
- }
- return void 0;
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/core/esm/__chunks/RZDDWCDV.js":
-/*!*************************************************************!*\
- !*** ./node_modules/@ariakit/core/esm/__chunks/RZDDWCDV.js ***!
- \*************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ createDialogStore: () => (/* binding */ createDialogStore)
-/* harmony export */ });
-/* harmony import */ var _43IPP2F4_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./43IPP2F4.js */ "./node_modules/@ariakit/core/esm/__chunks/43IPP2F4.js");
-"use client";
-
-
-// src/dialog/dialog-store.ts
-function createDialogStore(props = {}) {
- return (0,_43IPP2F4_js__WEBPACK_IMPORTED_MODULE_0__.createDisclosureStore)(props);
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/core/esm/combobox/combobox-store.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/core/esm/combobox/combobox-store.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ createComboboxStore: () => (/* binding */ createComboboxStore)
-/* harmony export */ });
-/* harmony import */ var _chunks_O6E4ZWCP_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../__chunks/O6E4ZWCP.js */ "./node_modules/@ariakit/core/esm/__chunks/O6E4ZWCP.js");
-/* harmony import */ var _chunks_MD3RIO2T_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../__chunks/MD3RIO2T.js */ "./node_modules/@ariakit/core/esm/__chunks/MD3RIO2T.js");
-/* harmony import */ var _chunks_C34RJTDU_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../__chunks/C34RJTDU.js */ "./node_modules/@ariakit/core/esm/__chunks/C34RJTDU.js");
-/* harmony import */ var _chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../__chunks/EWA2WL6G.js */ "./node_modules/@ariakit/core/esm/__chunks/EWA2WL6G.js");
-/* harmony import */ var _chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../__chunks/PBFD2E7P.js */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
-/* harmony import */ var _chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../__chunks/3YLGPPWQ.js */ "./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js");
-"use client";
-
-
-
-
-
-
-
-
-
-
-
-
-// src/combobox/combobox-store.ts
-var isTouchSafari = (0,_chunks_O6E4ZWCP_js__WEBPACK_IMPORTED_MODULE_0__.isSafari)() && (0,_chunks_O6E4ZWCP_js__WEBPACK_IMPORTED_MODULE_0__.isTouchDevice)();
-function createComboboxStore(_a = {}) {
- var _b = _a, {
- tag
- } = _b, props = (0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__objRest)(_b, [
- "tag"
- ]);
- const store = (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.mergeStore)(props.store, (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.pick)(tag, ["value", "rtl"]));
- (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.throwOnConflictingProps)(props, store);
- const tagState = tag == null ? void 0 : tag.getState();
- const syncState = store == null ? void 0 : store.getState();
- const activeId = (0,_chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__.defaultValue)(
- props.activeId,
- syncState == null ? void 0 : syncState.activeId,
- props.defaultActiveId,
- null
- );
- const composite = (0,_chunks_C34RJTDU_js__WEBPACK_IMPORTED_MODULE_2__.createCompositeStore)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadProps)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({}, props), {
- activeId,
- includesBaseElement: (0,_chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__.defaultValue)(
- props.includesBaseElement,
- syncState == null ? void 0 : syncState.includesBaseElement,
- true
- ),
- orientation: (0,_chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__.defaultValue)(
- props.orientation,
- syncState == null ? void 0 : syncState.orientation,
- "vertical"
- ),
- focusLoop: (0,_chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__.defaultValue)(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true),
- focusWrap: (0,_chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__.defaultValue)(props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, true),
- virtualFocus: (0,_chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__.defaultValue)(
- props.virtualFocus,
- syncState == null ? void 0 : syncState.virtualFocus,
- true
- )
- }));
- const popover = (0,_chunks_MD3RIO2T_js__WEBPACK_IMPORTED_MODULE_1__.createPopoverStore)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadProps)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({}, props), {
- placement: (0,_chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__.defaultValue)(
- props.placement,
- syncState == null ? void 0 : syncState.placement,
- "bottom-start"
- )
- }));
- const value = (0,_chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__.defaultValue)(
- props.value,
- syncState == null ? void 0 : syncState.value,
- props.defaultValue,
- ""
- );
- const selectedValue = (0,_chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__.defaultValue)(
- props.selectedValue,
- syncState == null ? void 0 : syncState.selectedValue,
- tagState == null ? void 0 : tagState.values,
- props.defaultSelectedValue,
- ""
- );
- const multiSelectable = Array.isArray(selectedValue);
- const initialState = (0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadProps)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({}, composite.getState()), popover.getState()), {
- value,
- selectedValue,
- resetValueOnSelect: (0,_chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__.defaultValue)(
- props.resetValueOnSelect,
- syncState == null ? void 0 : syncState.resetValueOnSelect,
- multiSelectable
- ),
- resetValueOnHide: (0,_chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__.defaultValue)(
- props.resetValueOnHide,
- syncState == null ? void 0 : syncState.resetValueOnHide,
- multiSelectable && !tag
- ),
- activeValue: syncState == null ? void 0 : syncState.activeValue
- });
- const combobox = (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.createStore)(initialState, composite, popover, store);
- if (isTouchSafari) {
- (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.setup)(
- combobox,
- () => (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.sync)(combobox, ["virtualFocus"], () => {
- combobox.setState("virtualFocus", false);
- })
- );
- }
- (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.setup)(combobox, () => {
- if (!tag) return;
- return (0,_chunks_PBFD2E7P_js__WEBPACK_IMPORTED_MODULE_4__.chain)(
- (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.sync)(combobox, ["selectedValue"], (state) => {
- if (!Array.isArray(state.selectedValue)) return;
- tag.setValues(state.selectedValue);
- }),
- (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.sync)(tag, ["values"], (state) => {
- combobox.setState("selectedValue", state.values);
- })
- );
- });
- (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.setup)(
- combobox,
- () => (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.sync)(combobox, ["resetValueOnHide", "mounted"], (state) => {
- if (!state.resetValueOnHide) return;
- if (state.mounted) return;
- combobox.setState("value", value);
- })
- );
- (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.setup)(
- combobox,
- () => (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.sync)(combobox, ["open"], (state) => {
- if (state.open) return;
- combobox.setState("activeId", activeId);
- combobox.setState("moves", 0);
- })
- );
- (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.setup)(
- combobox,
- () => (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.sync)(combobox, ["moves", "activeId"], (state, prevState) => {
- if (state.moves === prevState.moves) {
- combobox.setState("activeValue", void 0);
- }
- })
- );
- (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.setup)(
- combobox,
- () => (0,_chunks_EWA2WL6G_js__WEBPACK_IMPORTED_MODULE_3__.batch)(combobox, ["moves", "renderedItems"], (state, prev) => {
- if (state.moves === prev.moves) return;
- const { activeId: activeId2 } = combobox.getState();
- const activeItem = composite.item(activeId2);
- combobox.setState("activeValue", activeItem == null ? void 0 : activeItem.value);
- })
- );
- return (0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadProps)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({}, popover), composite), combobox), {
- tag,
- setValue: (value2) => combobox.setState("value", value2),
- resetValue: () => combobox.setState("value", initialState.value),
- setSelectedValue: (selectedValue2) => combobox.setState("selectedValue", selectedValue2)
- });
-}
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/core/esm/utils/events.js":
-/*!********************************************************!*\
- !*** ./node_modules/@ariakit/core/esm/utils/events.js ***!
- \********************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ addGlobalEventListener: () => (/* binding */ addGlobalEventListener),
-/* harmony export */ fireBlurEvent: () => (/* binding */ fireBlurEvent),
-/* harmony export */ fireClickEvent: () => (/* binding */ fireClickEvent),
-/* harmony export */ fireEvent: () => (/* binding */ fireEvent),
-/* harmony export */ fireFocusEvent: () => (/* binding */ fireFocusEvent),
-/* harmony export */ fireKeyboardEvent: () => (/* binding */ fireKeyboardEvent),
-/* harmony export */ getInputType: () => (/* binding */ getInputType),
-/* harmony export */ isDownloading: () => (/* binding */ isDownloading),
-/* harmony export */ isFocusEventOutside: () => (/* binding */ isFocusEventOutside),
-/* harmony export */ isOpeningInNewTab: () => (/* binding */ isOpeningInNewTab),
-/* harmony export */ isPortalEvent: () => (/* binding */ isPortalEvent),
-/* harmony export */ isSelfTarget: () => (/* binding */ isSelfTarget),
-/* harmony export */ queueBeforeEvent: () => (/* binding */ queueBeforeEvent)
-/* harmony export */ });
-/* harmony import */ var _chunks_O6E4ZWCP_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../__chunks/O6E4ZWCP.js */ "./node_modules/@ariakit/core/esm/__chunks/O6E4ZWCP.js");
-/* harmony import */ var _chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../__chunks/37JWRFYW.js */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js");
-/* harmony import */ var _chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../__chunks/3YLGPPWQ.js */ "./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js");
-"use client";
-
-
-
-
-// src/utils/events.ts
-function isPortalEvent(event) {
- return Boolean(
- event.currentTarget && !(0,_chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_1__.contains)(event.currentTarget, event.target)
- );
-}
-function isSelfTarget(event) {
- return event.target === event.currentTarget;
-}
-function isOpeningInNewTab(event) {
- const element = event.currentTarget;
- if (!element) return false;
- const isAppleDevice = (0,_chunks_O6E4ZWCP_js__WEBPACK_IMPORTED_MODULE_0__.isApple)();
- if (isAppleDevice && !event.metaKey) return false;
- if (!isAppleDevice && !event.ctrlKey) return false;
- const tagName = element.tagName.toLowerCase();
- if (tagName === "a") return true;
- if (tagName === "button" && element.type === "submit") return true;
- if (tagName === "input" && element.type === "submit") return true;
- return false;
-}
-function isDownloading(event) {
- const element = event.currentTarget;
- if (!element) return false;
- const tagName = element.tagName.toLowerCase();
- if (!event.altKey) return false;
- if (tagName === "a") return true;
- if (tagName === "button" && element.type === "submit") return true;
- if (tagName === "input" && element.type === "submit") return true;
- return false;
-}
-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 = (0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadProps)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__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 = (0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadProps)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadValues)({}, eventInit), { bubbles: true });
- element.dispatchEvent(new FocusEvent("focusin", bubbleInit));
- return defaultAllowed;
-}
-function fireKeyboardEvent(element, type, eventInit) {
- const event = new KeyboardEvent(type, eventInit);
- return element.dispatchEvent(event);
-}
-function fireClickEvent(element, eventInit) {
- const event = new MouseEvent("click", eventInit);
- return element.dispatchEvent(event);
-}
-function isFocusEventOutside(event, container) {
- const containerElement = container || event.currentTarget;
- const relatedTarget = event.relatedTarget;
- return !relatedTarget || !(0,_chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_1__.contains)(containerElement, relatedTarget);
-}
-function getInputType(event) {
- const nativeEvent = "nativeEvent" in event ? event.nativeEvent : event;
- if (!nativeEvent) return;
- if (!("inputType" in nativeEvent)) return;
- if (typeof nativeEvent.inputType !== "string") return;
- return nativeEvent.inputType;
-}
-function queueBeforeEvent(element, type, callback, timeout) {
- const createTimer = (callback2) => {
- if (timeout) {
- const timerId2 = setTimeout(callback2, timeout);
- return () => clearTimeout(timerId2);
- }
- const timerId = requestAnimationFrame(callback2);
- return () => cancelAnimationFrame(timerId);
- };
- const cancelTimer = createTimer(() => {
- element.removeEventListener(type, callSync, true);
- callback();
- });
- const callSync = () => {
- cancelTimer();
- callback();
- };
- element.addEventListener(type, callSync, { once: true, capture: true });
- return cancelTimer;
-}
-function addGlobalEventListener(type, listener, options, scope = window) {
- const children = [];
- try {
- scope.document.addEventListener(type, listener, options);
- 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) {
- }
- for (const remove of children) {
- remove();
- }
- };
- return removeEventListener;
-}
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/core/esm/utils/focus.js":
-/*!*******************************************************!*\
- !*** ./node_modules/@ariakit/core/esm/utils/focus.js ***!
- \*******************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ disableFocus: () => (/* binding */ disableFocus),
-/* harmony export */ disableFocusIn: () => (/* binding */ disableFocusIn),
-/* harmony export */ focusIfNeeded: () => (/* binding */ focusIfNeeded),
-/* harmony export */ focusIntoView: () => (/* binding */ focusIntoView),
-/* harmony export */ getAllFocusable: () => (/* binding */ getAllFocusable),
-/* harmony export */ getAllFocusableIn: () => (/* binding */ getAllFocusableIn),
-/* harmony export */ getAllTabbable: () => (/* binding */ getAllTabbable),
-/* harmony export */ getAllTabbableIn: () => (/* binding */ getAllTabbableIn),
-/* harmony export */ getClosestFocusable: () => (/* binding */ getClosestFocusable),
-/* harmony export */ getFirstFocusable: () => (/* binding */ getFirstFocusable),
-/* harmony export */ getFirstFocusableIn: () => (/* binding */ getFirstFocusableIn),
-/* harmony export */ getFirstTabbable: () => (/* binding */ getFirstTabbable),
-/* harmony export */ getFirstTabbableIn: () => (/* binding */ getFirstTabbableIn),
-/* harmony export */ getLastTabbable: () => (/* binding */ getLastTabbable),
-/* harmony export */ getLastTabbableIn: () => (/* binding */ getLastTabbableIn),
-/* harmony export */ getNextTabbable: () => (/* binding */ getNextTabbable),
-/* harmony export */ getNextTabbableIn: () => (/* binding */ getNextTabbableIn),
-/* harmony export */ getPreviousTabbable: () => (/* binding */ getPreviousTabbable),
-/* harmony export */ getPreviousTabbableIn: () => (/* binding */ getPreviousTabbableIn),
-/* harmony export */ hasFocus: () => (/* binding */ hasFocus),
-/* harmony export */ hasFocusWithin: () => (/* binding */ hasFocusWithin),
-/* harmony export */ isFocusable: () => (/* binding */ isFocusable),
-/* harmony export */ isTabbable: () => (/* binding */ isTabbable),
-/* harmony export */ restoreFocusIn: () => (/* binding */ restoreFocusIn)
-/* harmony export */ });
-/* harmony import */ var _chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../__chunks/37JWRFYW.js */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js");
-/* harmony import */ var _chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../__chunks/3YLGPPWQ.js */ "./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js");
-"use client";
-
-
-
-// src/utils/focus.ts
-var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";
-function hasNegativeTabIndex(element) {
- const tabIndex = Number.parseInt(element.getAttribute("tabindex") || "0", 10);
- return tabIndex < 0;
-}
-function isFocusable(element) {
- if (!element.matches(selector)) return false;
- if (!(0,_chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.isVisible)(element)) return false;
- if (element.closest("[inert]")) return false;
- return true;
-}
-function isTabbable(element) {
- if (!isFocusable(element)) return false;
- if (hasNegativeTabIndex(element)) return false;
- if (!("form" in element)) return true;
- if (!element.form) return true;
- if (element.checked) return true;
- if (element.type !== "radio") return true;
- const radioGroup = element.form.elements.namedItem(element.name);
- if (!radioGroup) return true;
- if (!("length" in radioGroup)) return true;
- const activeElement = (0,_chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.getActiveElement)(element);
- if (!activeElement) return true;
- if (activeElement === element) return true;
- if (!("form" in activeElement)) return true;
- if (activeElement.form !== element.form) return true;
- if (activeElement.name !== element.name) return true;
- return false;
-}
-function getAllFocusableIn(container, includeContainer) {
- const elements = Array.from(
- container.querySelectorAll(selector)
- );
- if (includeContainer) {
- elements.unshift(container);
- }
- const focusableElements = elements.filter(isFocusable);
- focusableElements.forEach((element, i) => {
- if ((0,_chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.isFrame)(element) && element.contentDocument) {
- const frameBody = element.contentDocument.body;
- focusableElements.splice(i, 1, ...getAllFocusableIn(frameBody));
- }
- });
- return focusableElements;
-}
-function getAllFocusable(includeBody) {
- return getAllFocusableIn(document.body, includeBody);
-}
-function getFirstFocusableIn(container, includeContainer) {
- const [first] = getAllFocusableIn(container, includeContainer);
- return first || null;
-}
-function getFirstFocusable(includeBody) {
- return getFirstFocusableIn(document.body, includeBody);
-}
-function getAllTabbableIn(container, includeContainer, fallbackToFocusable) {
- const elements = Array.from(
- container.querySelectorAll(selector)
- );
- const tabbableElements = elements.filter(isTabbable);
- if (includeContainer && isTabbable(container)) {
- tabbableElements.unshift(container);
- }
- tabbableElements.forEach((element, i) => {
- if ((0,_chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.isFrame)(element) && element.contentDocument) {
- const frameBody = element.contentDocument.body;
- const allFrameTabbable = getAllTabbableIn(
- frameBody,
- false,
- fallbackToFocusable
- );
- tabbableElements.splice(i, 1, ...allFrameTabbable);
- }
- });
- if (!tabbableElements.length && fallbackToFocusable) {
- return elements;
- }
- return tabbableElements;
-}
-function getAllTabbable(fallbackToFocusable) {
- return getAllTabbableIn(document.body, false, fallbackToFocusable);
-}
-function getFirstTabbableIn(container, includeContainer, fallbackToFocusable) {
- const [first] = getAllTabbableIn(
- container,
- includeContainer,
- fallbackToFocusable
- );
- return first || null;
-}
-function getFirstTabbable(fallbackToFocusable) {
- return getFirstTabbableIn(document.body, false, fallbackToFocusable);
-}
-function getLastTabbableIn(container, includeContainer, fallbackToFocusable) {
- const allTabbable = getAllTabbableIn(
- container,
- includeContainer,
- fallbackToFocusable
- );
- return allTabbable[allTabbable.length - 1] || null;
-}
-function getLastTabbable(fallbackToFocusable) {
- return getLastTabbableIn(document.body, false, fallbackToFocusable);
-}
-function getNextTabbableIn(container, includeContainer, fallbackToFirst, fallbackToFocusable) {
- const activeElement = (0,_chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.getActiveElement)(container);
- const allFocusable = getAllFocusableIn(container, includeContainer);
- const activeIndex = allFocusable.indexOf(activeElement);
- const nextFocusableElements = allFocusable.slice(activeIndex + 1);
- return nextFocusableElements.find(isTabbable) || (fallbackToFirst ? allFocusable.find(isTabbable) : null) || (fallbackToFocusable ? nextFocusableElements[0] : null) || null;
-}
-function getNextTabbable(fallbackToFirst, fallbackToFocusable) {
- return getNextTabbableIn(
- document.body,
- false,
- fallbackToFirst,
- fallbackToFocusable
- );
-}
-function getPreviousTabbableIn(container, includeContainer, fallbackToLast, fallbackToFocusable) {
- const activeElement = (0,_chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.getActiveElement)(container);
- const allFocusable = getAllFocusableIn(container, includeContainer).reverse();
- const activeIndex = allFocusable.indexOf(activeElement);
- const previousFocusableElements = allFocusable.slice(activeIndex + 1);
- return previousFocusableElements.find(isTabbable) || (fallbackToLast ? allFocusable.find(isTabbable) : null) || (fallbackToFocusable ? previousFocusableElements[0] : null) || null;
-}
-function getPreviousTabbable(fallbackToFirst, fallbackToFocusable) {
- return getPreviousTabbableIn(
- document.body,
- false,
- fallbackToFirst,
- fallbackToFocusable
- );
-}
-function getClosestFocusable(element) {
- while (element && !isFocusable(element)) {
- element = element.closest(selector);
- }
- return element || null;
-}
-function hasFocus(element) {
- const activeElement = (0,_chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.getActiveElement)(element);
- if (!activeElement) return false;
- if (activeElement === element) return true;
- const activeDescendant = activeElement.getAttribute("aria-activedescendant");
- if (!activeDescendant) return false;
- return activeDescendant === element.id;
-}
-function hasFocusWithin(element) {
- const activeElement = (0,_chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.getActiveElement)(element);
- if (!activeElement) return false;
- if ((0,_chunks_37JWRFYW_js__WEBPACK_IMPORTED_MODULE_0__.contains)(element, activeElement)) return true;
- const activeDescendant = activeElement.getAttribute("aria-activedescendant");
- if (!activeDescendant) return false;
- if (!("id" in element)) return false;
- if (activeDescendant === element.id) return true;
- return !!element.querySelector(`#${CSS.escape(activeDescendant)}`);
-}
-function focusIfNeeded(element) {
- if (!hasFocusWithin(element) && isFocusable(element)) {
- element.focus();
- }
-}
-function disableFocus(element) {
- var _a;
- const currentTabindex = (_a = element.getAttribute("tabindex")) != null ? _a : "";
- element.setAttribute("data-tabindex", currentTabindex);
- element.setAttribute("tabindex", "-1");
-}
-function disableFocusIn(container, includeContainer) {
- const tabbableElements = getAllTabbableIn(container, includeContainer);
- for (const element of tabbableElements) {
- disableFocus(element);
- }
-}
-function restoreFocusIn(container) {
- const elements = container.querySelectorAll("[data-tabindex]");
- const restoreTabIndex = (element) => {
- const tabindex = element.getAttribute("data-tabindex");
- element.removeAttribute("data-tabindex");
- if (tabindex) {
- element.setAttribute("tabindex", tabindex);
- } else {
- element.removeAttribute("tabindex");
- }
- };
- if (container.hasAttribute("data-tabindex")) {
- restoreTabIndex(container);
- }
- for (const element of elements) {
- restoreTabIndex(element);
- }
-}
-function focusIntoView(element, options) {
- if (!("scrollIntoView" in element)) {
- element.focus();
- } else {
- element.focus({ preventScroll: true });
- element.scrollIntoView((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadValues)({ block: "nearest", inline: "nearest" }, options));
- }
-}
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/2W3RN7C5.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/2W3RN7C5.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ Command: () => (/* binding */ Command),
-/* harmony export */ useCommand: () => (/* binding */ useCommand)
-/* harmony export */ });
-/* harmony import */ var _OE2EFRVA_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./OE2EFRVA.js */ "./node_modules/@ariakit/react-core/esm/__chunks/OE2EFRVA.js");
-/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
-/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
-/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
-/* harmony import */ var _ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ariakit/core/utils/dom */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js");
-/* harmony import */ var _ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ariakit/core/utils/events */ "./node_modules/@ariakit/core/esm/utils/events.js");
-/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
-/* harmony import */ var _ariakit_core_utils_platform__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ariakit/core/utils/platform */ "./node_modules/@ariakit/core/esm/__chunks/O6E4ZWCP.js");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react */ "react");
-"use client";
-
-
-
-
-
-// src/command/command.tsx
-
-
-
-
-
-var TagName = "button";
-function isNativeClick(event) {
- if (!event.isTrusted) return false;
- const element = event.currentTarget;
- if (event.key === "Enter") {
- return (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_4__.isButton)(element) || element.tagName === "SUMMARY" || element.tagName === "A";
- }
- if (event.key === " ") {
- return (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_4__.isButton)(element) || element.tagName === "SUMMARY" || element.tagName === "INPUT" || element.tagName === "SELECT";
- }
- return false;
-}
-var symbol = Symbol("command");
-var useCommand = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createHook)(
- function useCommand2(_a) {
- var _b = _a, { clickOnEnter = true, clickOnSpace = true } = _b, props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__objRest)(_b, ["clickOnEnter", "clickOnSpace"]);
- const ref = (0,react__WEBPACK_IMPORTED_MODULE_8__.useRef)(null);
- const [isNativeButton, setIsNativeButton] = (0,react__WEBPACK_IMPORTED_MODULE_8__.useState)(false);
- (0,react__WEBPACK_IMPORTED_MODULE_8__.useEffect)(() => {
- if (!ref.current) return;
- setIsNativeButton((0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_4__.isButton)(ref.current));
- }, []);
- const [active, setActive] = (0,react__WEBPACK_IMPORTED_MODULE_8__.useState)(false);
- const activeRef = (0,react__WEBPACK_IMPORTED_MODULE_8__.useRef)(false);
- const disabled = (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_6__.disabledFromProps)(props);
- const [isDuplicate, metadataProps] = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useMetadataProps)(props, symbol, true);
- const onKeyDownProp = props.onKeyDown;
- const onKeyDown = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useEvent)((event) => {
- onKeyDownProp == null ? void 0 : onKeyDownProp(event);
- const element = event.currentTarget;
- if (event.defaultPrevented) return;
- if (isDuplicate) return;
- if (disabled) return;
- if (!(0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.isSelfTarget)(event)) return;
- if ((0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_4__.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 = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__objRest)(_a2, ["view"]);
- const click = () => (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.fireClickEvent)(element, eventInit);
- if ((0,_ariakit_core_utils_platform__WEBPACK_IMPORTED_MODULE_7__.isFirefox)()) {
- (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.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 = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.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 = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__objRest)(_a2, ["view"]);
- queueMicrotask(() => (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.fireClickEvent)(element, eventInit));
- }
- }
- });
- props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)({
- "data-active": active || void 0,
- type: isNativeButton ? "button" : void 0
- }, metadataProps), props), {
- ref: (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useMergeRefs)(ref, props.ref),
- onKeyDown,
- onKeyUp
- });
- props = (0,_OE2EFRVA_js__WEBPACK_IMPORTED_MODULE_0__.useFocusable)(props);
- return props;
- }
-);
-var Command = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function Command2(props) {
- const htmlProps = useCommand(props);
- return (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createElement)(TagName, htmlProps);
-});
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ __objRest: () => (/* binding */ __objRest),
-/* harmony export */ __spreadProps: () => (/* binding */ __spreadProps),
-/* harmony export */ __spreadValues: () => (/* binding */ __spreadValues)
-/* harmony export */ });
-"use client";
-var __defProp = Object.defineProperty;
-var __defProps = Object.defineProperties;
-var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
-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 __spreadValues = (a, b) => {
- for (var prop in b || (b = {}))
- if (__hasOwnProp.call(b, prop))
- __defNormalProp(a, prop, b[prop]);
- if (__getOwnPropSymbols)
- for (var prop of __getOwnPropSymbols(b)) {
- if (__propIsEnum.call(b, prop))
- __defNormalProp(a, prop, b[prop]);
- }
- return a;
-};
-var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
-var __objRest = (source, exclude) => {
- var target = {};
- for (var prop in source)
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
- target[prop] = source[prop];
- if (source != null && __getOwnPropSymbols)
- for (var prop of __getOwnPropSymbols(source)) {
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
- target[prop] = source[prop];
- }
- return target;
-};
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/5CPL3B7G.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/5CPL3B7G.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ CollectionContextProvider: () => (/* binding */ CollectionContextProvider),
-/* harmony export */ CollectionScopedContextProvider: () => (/* binding */ CollectionScopedContextProvider),
-/* harmony export */ useCollectionContext: () => (/* binding */ useCollectionContext),
-/* harmony export */ useCollectionProviderContext: () => (/* binding */ useCollectionProviderContext),
-/* harmony export */ useCollectionScopedContext: () => (/* binding */ useCollectionScopedContext)
-/* harmony export */ });
-/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
-"use client";
-
-
-// src/collection/collection-context.tsx
-var ctx = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_0__.createStoreContext)();
-var useCollectionContext = ctx.useContext;
-var useCollectionScopedContext = ctx.useScopedContext;
-var useCollectionProviderContext = ctx.useProviderContext;
-var CollectionContextProvider = ctx.ContextProvider;
-var CollectionScopedContextProvider = ctx.ScopedContextProvider;
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-var react__WEBPACK_IMPORTED_MODULE_4___namespace_cache;
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ useAttribute: () => (/* binding */ useAttribute),
-/* harmony export */ useBooleanEvent: () => (/* binding */ useBooleanEvent),
-/* harmony export */ useDeferredValue: () => (/* binding */ useDeferredValue),
-/* harmony export */ useEvent: () => (/* binding */ useEvent),
-/* harmony export */ useForceUpdate: () => (/* binding */ useForceUpdate),
-/* harmony export */ useId: () => (/* binding */ useId),
-/* harmony export */ useInitialValue: () => (/* binding */ useInitialValue),
-/* harmony export */ useIsMouseMoving: () => (/* binding */ useIsMouseMoving),
-/* harmony export */ useLazyValue: () => (/* binding */ useLazyValue),
-/* harmony export */ useLiveRef: () => (/* binding */ useLiveRef),
-/* harmony export */ useMergeRefs: () => (/* binding */ useMergeRefs),
-/* harmony export */ useMetadataProps: () => (/* binding */ useMetadataProps),
-/* harmony export */ usePortalRef: () => (/* binding */ usePortalRef),
-/* harmony export */ usePreviousValue: () => (/* binding */ usePreviousValue),
-/* harmony export */ useSafeLayoutEffect: () => (/* binding */ useSafeLayoutEffect),
-/* harmony export */ useTagName: () => (/* binding */ useTagName),
-/* harmony export */ useTransactionState: () => (/* binding */ useTransactionState),
-/* harmony export */ useUpdateEffect: () => (/* binding */ useUpdateEffect),
-/* harmony export */ useUpdateLayoutEffect: () => (/* binding */ useUpdateLayoutEffect),
-/* harmony export */ useWrapElement: () => (/* binding */ useWrapElement)
-/* harmony export */ });
-/* harmony import */ var _SK3NAZA3_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SK3NAZA3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/SK3NAZA3.js");
-/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
-/* harmony import */ var _ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ariakit/core/utils/dom */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js");
-/* harmony import */ var _ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ariakit/core/utils/events */ "./node_modules/@ariakit/core/esm/utils/events.js");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "react");
-"use client";
-
-
-
-// src/utils/hooks.ts
-
-
-
-
-var _React = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadValues)({}, /*#__PURE__*/ (react__WEBPACK_IMPORTED_MODULE_4___namespace_cache || (react__WEBPACK_IMPORTED_MODULE_4___namespace_cache = __webpack_require__.t(react__WEBPACK_IMPORTED_MODULE_4__, 2))));
-var useReactId = _React.useId;
-var useReactDeferredValue = _React.useDeferredValue;
-var useReactInsertionEffect = _React.useInsertionEffect;
-var useSafeLayoutEffect = _ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_2__.canUseDOM ? react__WEBPACK_IMPORTED_MODULE_4__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_4__.useEffect;
-function useInitialValue(value) {
- const [initialValue] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(value);
- return initialValue;
-}
-function useLazyValue(init) {
- const ref = (0,react__WEBPACK_IMPORTED_MODULE_4__.useRef)();
- if (ref.current === void 0) {
- ref.current = init();
- }
- return ref.current;
-}
-function useLiveRef(value) {
- const ref = (0,react__WEBPACK_IMPORTED_MODULE_4__.useRef)(value);
- useSafeLayoutEffect(() => {
- ref.current = value;
- });
- return ref;
-}
-function usePreviousValue(value) {
- const [previousValue, setPreviousValue] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(value);
- if (value !== previousValue) {
- setPreviousValue(value);
- }
- return previousValue;
-}
-function useEvent(callback) {
- const ref = (0,react__WEBPACK_IMPORTED_MODULE_4__.useRef)(() => {
- throw new Error("Cannot call an event handler while rendering.");
- });
- if (useReactInsertionEffect) {
- useReactInsertionEffect(() => {
- ref.current = callback;
- });
- } else {
- ref.current = callback;
- }
- return (0,react__WEBPACK_IMPORTED_MODULE_4__.useCallback)((...args) => {
- var _a;
- return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args);
- }, []);
-}
-function useTransactionState(callback) {
- const [state, setState] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(null);
- useSafeLayoutEffect(() => {
- if (state == null) return;
- if (!callback) return;
- let prevState = null;
- callback((prev) => {
- prevState = prev;
- return state;
- });
- return () => {
- callback(prevState);
- };
- }, [state, callback]);
- return [state, setState];
-}
-function useMergeRefs(...refs) {
- return (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(() => {
- if (!refs.some(Boolean)) return;
- return (value) => {
- for (const ref of refs) {
- (0,_SK3NAZA3_js__WEBPACK_IMPORTED_MODULE_0__.setRef)(ref, value);
- }
- };
- }, refs);
-}
-function useId(defaultId) {
- if (useReactId) {
- const reactId = useReactId();
- if (defaultId) return defaultId;
- return reactId;
- }
- const [id, setId] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(defaultId);
- useSafeLayoutEffect(() => {
- if (defaultId || id) return;
- const random = Math.random().toString(36).slice(2, 8);
- setId(`id-${random}`);
- }, [defaultId, id]);
- return defaultId || id;
-}
-function useDeferredValue(value) {
- if (useReactDeferredValue) {
- return useReactDeferredValue(value);
- }
- const [deferredValue, setDeferredValue] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(value);
- (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
- const raf = requestAnimationFrame(() => setDeferredValue(value));
- return () => cancelAnimationFrame(raf);
- }, [value]);
- return deferredValue;
-}
-function useTagName(refOrElement, type) {
- const stringOrUndefined = (type2) => {
- if (typeof type2 !== "string") return;
- return type2;
- };
- const [tagName, setTagName] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(() => stringOrUndefined(type));
- useSafeLayoutEffect(() => {
- const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement;
- setTagName((element == null ? void 0 : element.tagName.toLowerCase()) || stringOrUndefined(type));
- }, [refOrElement, type]);
- return tagName;
-}
-function useAttribute(refOrElement, attributeName, defaultValue) {
- const initialValue = useInitialValue(defaultValue);
- const [attribute, setAttribute] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(initialValue);
- (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
- const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement;
- if (!element) return;
- const callback = () => {
- const value = element.getAttribute(attributeName);
- setAttribute(value == null ? initialValue : value);
- };
- const observer = new MutationObserver(callback);
- observer.observe(element, { attributeFilter: [attributeName] });
- callback();
- return () => observer.disconnect();
- }, [refOrElement, attributeName, initialValue]);
- return attribute;
-}
-function useUpdateEffect(effect, deps) {
- const mounted = (0,react__WEBPACK_IMPORTED_MODULE_4__.useRef)(false);
- (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
- if (mounted.current) {
- return effect();
- }
- mounted.current = true;
- }, deps);
- (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(
- () => () => {
- mounted.current = false;
- },
- []
- );
-}
-function useUpdateLayoutEffect(effect, deps) {
- const mounted = (0,react__WEBPACK_IMPORTED_MODULE_4__.useRef)(false);
- useSafeLayoutEffect(() => {
- if (mounted.current) {
- return effect();
- }
- mounted.current = true;
- }, deps);
- useSafeLayoutEffect(
- () => () => {
- mounted.current = false;
- },
- []
- );
-}
-function useForceUpdate() {
- return (0,react__WEBPACK_IMPORTED_MODULE_4__.useReducer)(() => [], []);
-}
-function useBooleanEvent(booleanOrCallback) {
- return useEvent(
- typeof booleanOrCallback === "function" ? booleanOrCallback : () => booleanOrCallback
- );
-}
-function useWrapElement(props, callback, deps = []) {
- const wrapElement = (0,react__WEBPACK_IMPORTED_MODULE_4__.useCallback)(
- (element) => {
- if (props.wrapElement) {
- element = props.wrapElement(element);
- }
- return callback(element);
- },
- [...deps, props.wrapElement]
- );
- return (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadValues)({}, props), { wrapElement });
-}
-function usePortalRef(portalProp = false, portalRefProp) {
- const [portalNode, setPortalNode] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(null);
- const portalRef = useMergeRefs(setPortalNode, portalRefProp);
- const domReady = !portalProp || portalNode;
- return { portalRef, portalNode, domReady };
-}
-function useMetadataProps(props, key, value) {
- const parent = props.onLoadedMetadataCapture;
- const onLoadedMetadataCapture = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(() => {
- return Object.assign(() => {
- }, (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadValues)({}, parent), { [key]: value }));
- }, [parent, key, value]);
- return [parent == null ? void 0 : parent[key], { onLoadedMetadataCapture }];
-}
-var hasInstalledGlobalEventListeners = false;
-function useIsMouseMoving() {
- (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
- if (hasInstalledGlobalEventListeners) return;
- (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_3__.addGlobalEventListener)("mousemove", setMouseMoving, true);
- (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_3__.addGlobalEventListener)("mousedown", resetMouseMoving, true);
- (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_3__.addGlobalEventListener)("mouseup", resetMouseMoving, true);
- (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_3__.addGlobalEventListener)("keydown", resetMouseMoving, true);
- (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_3__.addGlobalEventListener)("scroll", resetMouseMoving, true);
- hasInstalledGlobalEventListeners = true;
- }, []);
- const isMouseMoving = useEvent(() => mouseMoving);
- return isMouseMoving;
-}
-var mouseMoving = false;
-var previousScreenX = 0;
-var previousScreenY = 0;
-function hasMouseMovement(event) {
- const movementX = event.movementX || event.screenX - previousScreenX;
- const movementY = event.movementY || event.screenY - previousScreenY;
- previousScreenX = event.screenX;
- previousScreenY = event.screenY;
- return movementX || movementY || "development" === "test";
-}
-function setMouseMoving(event) {
- if (!hasMouseMovement(event)) return;
- mouseMoving = true;
-}
-function resetMouseMoving() {
- mouseMoving = false;
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/5VQZOHHZ.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/5VQZOHHZ.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ findFirstEnabledItem: () => (/* binding */ findFirstEnabledItem),
-/* harmony export */ flipItems: () => (/* binding */ flipItems),
-/* harmony export */ focusSilently: () => (/* binding */ focusSilently),
-/* harmony export */ getEnabledItem: () => (/* binding */ getEnabledItem),
-/* harmony export */ groupItemsByRows: () => (/* binding */ groupItemsByRows),
-/* harmony export */ isItem: () => (/* binding */ isItem),
-/* harmony export */ selectTextField: () => (/* binding */ selectTextField),
-/* harmony export */ silentlyFocused: () => (/* binding */ silentlyFocused)
-/* harmony export */ });
-/* harmony import */ var _ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ariakit/core/utils/dom */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.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 ((0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_0__.isTextField)(element)) {
- element.setSelectionRange(
- collapseToEnd ? element.value.length : 0,
- element.value.length
- );
- } else if (element.isContentEditable) {
- const selection = (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_0__.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;
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/ABN76PSX.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/ABN76PSX.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ DisclosureContextProvider: () => (/* binding */ DisclosureContextProvider),
-/* harmony export */ DisclosureScopedContextProvider: () => (/* binding */ DisclosureScopedContextProvider),
-/* harmony export */ useDisclosureContext: () => (/* binding */ useDisclosureContext),
-/* harmony export */ useDisclosureProviderContext: () => (/* binding */ useDisclosureProviderContext),
-/* harmony export */ useDisclosureScopedContext: () => (/* binding */ useDisclosureScopedContext)
-/* harmony export */ });
-/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
-"use client";
-
-
-// src/disclosure/disclosure-context.tsx
-var ctx = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_0__.createStoreContext)();
-var useDisclosureContext = ctx.useContext;
-var useDisclosureScopedContext = ctx.useScopedContext;
-var useDisclosureProviderContext = ctx.useProviderContext;
-var DisclosureContextProvider = ctx.ContextProvider;
-var DisclosureScopedContextProvider = ctx.ScopedContextProvider;
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/AMMIPFT4.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/AMMIPFT4.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ useCollectionStore: () => (/* binding */ useCollectionStore),
-/* harmony export */ useCollectionStoreProps: () => (/* binding */ useCollectionStoreProps)
-/* harmony export */ });
-/* harmony import */ var _RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./RTNCFSKZ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/RTNCFSKZ.js");
-/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
-/* harmony import */ var _ariakit_core_collection_collection_store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ariakit/core/collection/collection-store */ "./node_modules/@ariakit/core/esm/__chunks/K2KIGYQU.js");
-"use client";
-
-
-
-// src/collection/collection-store.ts
-
-function useCollectionStoreProps(store, update, props) {
- (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_1__.useUpdateEffect)(update, [props.store]);
- (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_0__.useStoreProps)(store, props, "items", "setItems");
- return store;
-}
-function useCollectionStore(props = {}) {
- const [store, update] = (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_0__.useStore)(_ariakit_core_collection_collection_store__WEBPACK_IMPORTED_MODULE_2__.createCollectionStore, props);
- return useCollectionStoreProps(store, update, props);
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/APTFW6PT.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/APTFW6PT.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ CompositeContextProvider: () => (/* binding */ CompositeContextProvider),
-/* harmony export */ CompositeItemContext: () => (/* binding */ CompositeItemContext),
-/* harmony export */ CompositeRowContext: () => (/* binding */ CompositeRowContext),
-/* harmony export */ CompositeScopedContextProvider: () => (/* binding */ CompositeScopedContextProvider),
-/* harmony export */ useCompositeContext: () => (/* binding */ useCompositeContext),
-/* harmony export */ useCompositeProviderContext: () => (/* binding */ useCompositeProviderContext),
-/* harmony export */ useCompositeScopedContext: () => (/* binding */ useCompositeScopedContext)
-/* harmony export */ });
-/* harmony import */ var _5CPL3B7G_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./5CPL3B7G.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5CPL3B7G.js");
-/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
-"use client";
-
-
-
-// src/composite/composite-context.tsx
-
-var ctx = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createStoreContext)(
- [_5CPL3B7G_js__WEBPACK_IMPORTED_MODULE_0__.CollectionContextProvider],
- [_5CPL3B7G_js__WEBPACK_IMPORTED_MODULE_0__.CollectionScopedContextProvider]
-);
-var useCompositeContext = ctx.useContext;
-var useCompositeScopedContext = ctx.useScopedContext;
-var useCompositeProviderContext = ctx.useProviderContext;
-var CompositeContextProvider = ctx.ContextProvider;
-var CompositeScopedContextProvider = ctx.ScopedContextProvider;
-var CompositeItemContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.createContext)(
- void 0
-);
-var CompositeRowContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.createContext)(
- void 0
-);
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/B7UTNDHN.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/B7UTNDHN.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ useCompositeStore: () => (/* binding */ useCompositeStore),
-/* harmony export */ useCompositeStoreOptions: () => (/* binding */ useCompositeStoreOptions),
-/* harmony export */ useCompositeStoreProps: () => (/* binding */ useCompositeStoreProps)
-/* harmony export */ });
-/* harmony import */ var _AMMIPFT4_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AMMIPFT4.js */ "./node_modules/@ariakit/react-core/esm/__chunks/AMMIPFT4.js");
-/* harmony import */ var _RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RTNCFSKZ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/RTNCFSKZ.js");
-/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
-/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
-/* harmony import */ var _ariakit_core_composite_composite_store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ariakit/core/composite/composite-store */ "./node_modules/@ariakit/core/esm/__chunks/C34RJTDU.js");
-"use client";
-
-
-
-
-
-// src/composite/composite-store.ts
-
-function useCompositeStoreOptions(props) {
- const id = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useId)(props.id);
- return (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)({ id }, props);
-}
-function useCompositeStoreProps(store, update, props) {
- store = (0,_AMMIPFT4_js__WEBPACK_IMPORTED_MODULE_0__.useCollectionStoreProps)(store, update, props);
- (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStoreProps)(store, props, "activeId", "setActiveId");
- (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStoreProps)(store, props, "includesBaseElement");
- (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStoreProps)(store, props, "virtualFocus");
- (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStoreProps)(store, props, "orientation");
- (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStoreProps)(store, props, "rtl");
- (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStoreProps)(store, props, "focusLoop");
- (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStoreProps)(store, props, "focusWrap");
- (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStoreProps)(store, props, "focusShift");
- return store;
-}
-function useCompositeStore(props = {}) {
- props = useCompositeStoreOptions(props);
- const [store, update] = (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStore)(_ariakit_core_composite_composite_store__WEBPACK_IMPORTED_MODULE_4__.createCompositeStore, props);
- return useCompositeStoreProps(store, update, props);
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/D7FSM5GC.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/D7FSM5GC.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ ComboboxItem: () => (/* binding */ ComboboxItem),
-/* harmony export */ useComboboxItem: () => (/* binding */ useComboboxItem)
-/* harmony export */ });
-/* harmony import */ var _IABE5EV2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./IABE5EV2.js */ "./node_modules/@ariakit/react-core/esm/__chunks/IABE5EV2.js");
-/* harmony import */ var _SBSPVDDI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SBSPVDDI.js */ "./node_modules/@ariakit/react-core/esm/__chunks/SBSPVDDI.js");
-/* harmony import */ var _OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./OLVWQA7U.js */ "./node_modules/@ariakit/react-core/esm/__chunks/OLVWQA7U.js");
-/* harmony import */ var _RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./RTNCFSKZ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/RTNCFSKZ.js");
-/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
-/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
-/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
-/* harmony import */ var _ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ariakit/core/utils/dom */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js");
-/* harmony import */ var _ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ariakit/core/utils/events */ "./node_modules/@ariakit/core/esm/utils/events.js");
-/* harmony import */ var _ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ariakit/core/utils/focus */ "./node_modules/@ariakit/core/esm/utils/focus.js");
-/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react */ "react");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-"use client";
-
-
-
-
-
-
-
-
-// src/combobox/combobox-item.tsx
-
-
-
-
-
-
-var TagName = "div";
-function isSelected(storeValue, itemValue) {
- if (itemValue == null) return;
- if (storeValue == null) return false;
- if (Array.isArray(storeValue)) {
- return storeValue.includes(itemValue);
- }
- return storeValue === itemValue;
-}
-function getItemRole(popupRole) {
- var _a;
- const itemRoleByPopupRole = {
- menu: "menuitem",
- listbox: "option",
- tree: "treeitem"
- };
- const key = popupRole;
- return (_a = itemRoleByPopupRole[key]) != null ? _a : "option";
-}
-var useComboboxItem = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_4__.createHook)(
- function useComboboxItem2(_a) {
- var _b = _a, {
- store,
- value,
- hideOnClick,
- setValueOnClick,
- selectValueOnClick = true,
- resetValueOnSelect,
- focusOnHover = false,
- moveOnKeyPress = true,
- getItem: getItemProp
- } = _b, props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_6__.__objRest)(_b, [
- "store",
- "value",
- "hideOnClick",
- "setValueOnClick",
- "selectValueOnClick",
- "resetValueOnSelect",
- "focusOnHover",
- "moveOnKeyPress",
- "getItem"
- ]);
- var _a2;
- const context = (0,_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_2__.useComboboxScopedContext)();
- store = store || context;
- (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_10__.invariant)(
- store,
- true && "ComboboxItem must be wrapped in a ComboboxList or ComboboxPopover component."
- );
- const { resetValueOnSelectState, multiSelectable, selected } = (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_3__.useStoreStateObject)(store, {
- resetValueOnSelectState: "resetValueOnSelect",
- multiSelectable(state) {
- return Array.isArray(state.selectedValue);
- },
- selected(state) {
- return isSelected(state.selectedValue, value);
- }
- });
- const getItem = (0,react__WEBPACK_IMPORTED_MODULE_11__.useCallback)(
- (item) => {
- const nextItem = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_6__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_6__.__spreadValues)({}, item), { value });
- if (getItemProp) {
- return getItemProp(nextItem);
- }
- return nextItem;
- },
- [value, getItemProp]
- );
- setValueOnClick = setValueOnClick != null ? setValueOnClick : !multiSelectable;
- hideOnClick = hideOnClick != null ? hideOnClick : value != null && !multiSelectable;
- const onClickProp = props.onClick;
- const setValueOnClickProp = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_5__.useBooleanEvent)(setValueOnClick);
- const selectValueOnClickProp = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_5__.useBooleanEvent)(selectValueOnClick);
- const resetValueOnSelectProp = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_5__.useBooleanEvent)(
- (_a2 = resetValueOnSelect != null ? resetValueOnSelect : resetValueOnSelectState) != null ? _a2 : multiSelectable
- );
- const hideOnClickProp = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_5__.useBooleanEvent)(hideOnClick);
- const onClick = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_5__.useEvent)((event) => {
- onClickProp == null ? void 0 : onClickProp(event);
- if (event.defaultPrevented) return;
- if ((0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.isDownloading)(event)) return;
- if ((0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.isOpeningInNewTab)(event)) return;
- if (value != null) {
- if (selectValueOnClickProp(event)) {
- if (resetValueOnSelectProp(event)) {
- store == null ? void 0 : store.resetValue();
- }
- store == null ? void 0 : store.setSelectedValue((prevValue) => {
- if (!Array.isArray(prevValue)) return value;
- if (prevValue.includes(value)) {
- return prevValue.filter((v) => v !== value);
- }
- return [...prevValue, value];
- });
- }
- if (setValueOnClickProp(event)) {
- store == null ? void 0 : store.setValue(value);
- }
- }
- if (hideOnClickProp(event)) {
- store == null ? void 0 : store.hide();
- }
- });
- const onKeyDownProp = props.onKeyDown;
- const onKeyDown = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_5__.useEvent)((event) => {
- onKeyDownProp == null ? void 0 : onKeyDownProp(event);
- if (event.defaultPrevented) return;
- const baseElement = store == null ? void 0 : store.getState().baseElement;
- if (!baseElement) return;
- if ((0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_9__.hasFocus)(baseElement)) return;
- const printable = event.key.length === 1;
- if (printable || event.key === "Backspace" || event.key === "Delete") {
- queueMicrotask(() => baseElement.focus());
- if ((0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_7__.isTextField)(baseElement)) {
- store == null ? void 0 : store.setValue(baseElement.value);
- }
- }
- });
- if (multiSelectable && selected != null) {
- props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_6__.__spreadValues)({
- "aria-selected": selected
- }, props);
- }
- props = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_5__.useWrapElement)(
- props,
- (element) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_2__.ComboboxItemValueContext.Provider, { value, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_2__.ComboboxItemCheckedContext.Provider, { value: selected != null ? selected : false, children: element }) }),
- [value, selected]
- );
- const popupRole = (0,react__WEBPACK_IMPORTED_MODULE_11__.useContext)(_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_2__.ComboboxListRoleContext);
- props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_6__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_6__.__spreadValues)({
- role: getItemRole(popupRole),
- children: value
- }, props), {
- onClick,
- onKeyDown
- });
- const moveOnKeyPressProp = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_5__.useBooleanEvent)(moveOnKeyPress);
- props = (0,_SBSPVDDI_js__WEBPACK_IMPORTED_MODULE_1__.useCompositeItem)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_6__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_6__.__spreadValues)({
- store
- }, props), {
- getItem,
- // Dispatch a custom event on the combobox input when moving to an item
- // with the keyboard so the Combobox component can enable inline
- // autocompletion.
- moveOnKeyPress: (event) => {
- if (!moveOnKeyPressProp(event)) return false;
- const moveEvent = new Event("combobox-item-move");
- const baseElement = store == null ? void 0 : store.getState().baseElement;
- baseElement == null ? void 0 : baseElement.dispatchEvent(moveEvent);
- return true;
- }
- }));
- props = (0,_IABE5EV2_js__WEBPACK_IMPORTED_MODULE_0__.useCompositeHover)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_6__.__spreadValues)({ store, focusOnHover }, props));
- return props;
- }
-);
-var ComboboxItem = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_4__.memo)(
- (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_4__.forwardRef)(function ComboboxItem2(props) {
- const htmlProps = useComboboxItem(props);
- return (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_4__.createElement)(TagName, htmlProps);
- })
-);
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/HI6DYBVE.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/HI6DYBVE.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ useComboboxStore: () => (/* binding */ useComboboxStore),
-/* harmony export */ useComboboxStoreOptions: () => (/* binding */ useComboboxStoreOptions),
-/* harmony export */ useComboboxStoreProps: () => (/* binding */ useComboboxStoreProps)
-/* harmony export */ });
-/* harmony import */ var _VJQU3YUE_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VJQU3YUE.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VJQU3YUE.js");
-/* harmony import */ var _RUY5BUJG_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RUY5BUJG.js */ "./node_modules/@ariakit/react-core/esm/__chunks/RUY5BUJG.js");
-/* harmony import */ var _B7UTNDHN_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./B7UTNDHN.js */ "./node_modules/@ariakit/react-core/esm/__chunks/B7UTNDHN.js");
-/* harmony import */ var _RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./RTNCFSKZ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/RTNCFSKZ.js");
-/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
-/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
-/* harmony import */ var _ariakit_core_combobox_combobox_store__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ariakit/core/combobox/combobox-store */ "./node_modules/@ariakit/core/esm/combobox/combobox-store.js");
-"use client";
-
-
-
-
-
-
-
-// src/combobox/combobox-store.ts
-
-function useComboboxStoreOptions(props) {
- const tag = (0,_VJQU3YUE_js__WEBPACK_IMPORTED_MODULE_0__.useTagContext)();
- props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({}, props), {
- tag: props.tag !== void 0 ? props.tag : tag
- });
- return (0,_B7UTNDHN_js__WEBPACK_IMPORTED_MODULE_2__.useCompositeStoreOptions)(props);
-}
-function useComboboxStoreProps(store, update, props) {
- (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useUpdateEffect)(update, [props.tag]);
- (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_3__.useStoreProps)(store, props, "value", "setValue");
- (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_3__.useStoreProps)(store, props, "selectedValue", "setSelectedValue");
- (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_3__.useStoreProps)(store, props, "resetValueOnHide");
- (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_3__.useStoreProps)(store, props, "resetValueOnSelect");
- return Object.assign(
- (0,_B7UTNDHN_js__WEBPACK_IMPORTED_MODULE_2__.useCompositeStoreProps)(
- (0,_RUY5BUJG_js__WEBPACK_IMPORTED_MODULE_1__.usePopoverStoreProps)(store, update, props),
- update,
- props
- ),
- { tag: props.tag }
- );
-}
-function useComboboxStore(props = {}) {
- props = useComboboxStoreOptions(props);
- const [store, update] = (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_3__.useStore)(_ariakit_core_combobox_combobox_store__WEBPACK_IMPORTED_MODULE_6__.createComboboxStore, props);
- return useComboboxStoreProps(store, update, props);
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/HMCFFQCB.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/HMCFFQCB.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ PopoverAnchor: () => (/* binding */ PopoverAnchor),
-/* harmony export */ usePopoverAnchor: () => (/* binding */ usePopoverAnchor)
-/* harmony export */ });
-/* harmony import */ var _Y67KZUMI_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Y67KZUMI.js */ "./node_modules/@ariakit/react-core/esm/__chunks/Y67KZUMI.js");
-/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
-/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
-/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
-"use client";
-
-
-
-
-
-// src/popover/popover-anchor.tsx
-var TagName = "div";
-var usePopoverAnchor = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createHook)(
- function usePopoverAnchor2(_a) {
- var _b = _a, { store } = _b, props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__objRest)(_b, ["store"]);
- const context = (0,_Y67KZUMI_js__WEBPACK_IMPORTED_MODULE_0__.usePopoverProviderContext)();
- store = store || context;
- props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)({}, props), {
- ref: (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useMergeRefs)(store == null ? void 0 : store.setAnchorElement, props.ref)
- });
- return props;
- }
-);
-var PopoverAnchor = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function PopoverAnchor2(props) {
- const htmlProps = usePopoverAnchor(props);
- return (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createElement)(TagName, htmlProps);
-});
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/IABE5EV2.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/IABE5EV2.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ CompositeHover: () => (/* binding */ CompositeHover),
-/* harmony export */ useCompositeHover: () => (/* binding */ useCompositeHover)
-/* harmony export */ });
-/* harmony import */ var _APTFW6PT_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./APTFW6PT.js */ "./node_modules/@ariakit/react-core/esm/__chunks/APTFW6PT.js");
-/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
-/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
-/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
-/* harmony import */ var _ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ariakit/core/utils/dom */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js");
-/* harmony import */ var _ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ariakit/core/utils/focus */ "./node_modules/@ariakit/core/esm/utils/focus.js");
-/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react */ "react");
-"use client";
-
-
-
-
-
-// src/composite/composite-hover.tsx
-
-
-
-
-var TagName = "div";
-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 (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_4__.contains)(event.currentTarget, nextElement);
-}
-var symbol = Symbol("composite-hover");
-function movingToAnotherItem(event) {
- let dest = getMouseDestination(event);
- if (!dest) return false;
- do {
- if ((0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_6__.hasOwnProperty)(dest, symbol) && dest[symbol]) return true;
- dest = dest.parentElement;
- } while (dest);
- return false;
-}
-var useCompositeHover = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createHook)(
- function useCompositeHover2(_a) {
- var _b = _a, {
- store,
- focusOnHover = true,
- blurOnHoverEnd = !!focusOnHover
- } = _b, props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__objRest)(_b, [
- "store",
- "focusOnHover",
- "blurOnHoverEnd"
- ]);
- const context = (0,_APTFW6PT_js__WEBPACK_IMPORTED_MODULE_0__.useCompositeContext)();
- store = store || context;
- (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_6__.invariant)(
- store,
- true && "CompositeHover must be wrapped in a Composite component."
- );
- const isMouseMoving = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useIsMouseMoving)();
- const onMouseMoveProp = props.onMouseMove;
- const focusOnHoverProp = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useBooleanEvent)(focusOnHover);
- const onMouseMove = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useEvent)((event) => {
- onMouseMoveProp == null ? void 0 : onMouseMoveProp(event);
- if (event.defaultPrevented) return;
- if (!isMouseMoving()) return;
- if (!focusOnHoverProp(event)) return;
- if (!(0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_5__.hasFocusWithin)(event.currentTarget)) {
- const baseElement = store == null ? void 0 : store.getState().baseElement;
- if (baseElement && !(0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_5__.hasFocus)(baseElement)) {
- baseElement.focus();
- }
- }
- store == null ? void 0 : store.setActiveId(event.currentTarget.id);
- });
- const onMouseLeaveProp = props.onMouseLeave;
- const blurOnHoverEndProp = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useBooleanEvent)(blurOnHoverEnd);
- const onMouseLeave = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.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,react__WEBPACK_IMPORTED_MODULE_7__.useCallback)((element) => {
- if (!element) return;
- element[symbol] = true;
- }, []);
- props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)({}, props), {
- ref: (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useMergeRefs)(ref, props.ref),
- onMouseMove,
- onMouseLeave
- });
- return (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_6__.removeUndefinedValues)(props);
- }
-);
-var CompositeHover = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.memo)(
- (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function CompositeHover2(props) {
- const htmlProps = useCompositeHover(props);
- return (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createElement)(TagName, htmlProps);
- })
-);
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/K4R5DNTX.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/K4R5DNTX.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ DisclosureContent: () => (/* binding */ DisclosureContent),
-/* harmony export */ isHidden: () => (/* binding */ isHidden),
-/* harmony export */ useDisclosureContent: () => (/* binding */ useDisclosureContent)
-/* harmony export */ });
-/* harmony import */ var _T2AZQXQU_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./T2AZQXQU.js */ "./node_modules/@ariakit/react-core/esm/__chunks/T2AZQXQU.js");
-/* harmony import */ var _ABN76PSX_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ABN76PSX.js */ "./node_modules/@ariakit/react-core/esm/__chunks/ABN76PSX.js");
-/* harmony import */ var _RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./RTNCFSKZ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/RTNCFSKZ.js");
-/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
-/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
-/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
-/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react */ "react");
-/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react-dom */ "react-dom");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-"use client";
-
-
-
-
-
-
-
-// src/disclosure/disclosure-content.tsx
-
-
-
-
-var TagName = "div";
-function afterTimeout(timeoutMs, cb) {
- const timeoutId = setTimeout(cb, timeoutMs);
- return () => clearTimeout(timeoutId);
-}
-function afterPaint(cb) {
- let raf = requestAnimationFrame(() => {
- raf = requestAnimationFrame(cb);
- });
- return () => cancelAnimationFrame(raf);
-}
-function parseCSSTime(...times) {
- return times.join(", ").split(", ").reduce((longestTime, currentTimeString) => {
- const multiplier = currentTimeString.endsWith("ms") ? 1 : 1e3;
- const currentTime = Number.parseFloat(currentTimeString || "0s") * multiplier;
- if (currentTime > longestTime) return currentTime;
- return longestTime;
- }, 0);
-}
-function isHidden(mounted, hidden, alwaysVisible) {
- return !alwaysVisible && hidden !== false && (!mounted || !!hidden);
-}
-var useDisclosureContent = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__.createHook)(function useDisclosureContent2(_a) {
- var _b = _a, { store, alwaysVisible } = _b, props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__objRest)(_b, ["store", "alwaysVisible"]);
- const context = (0,_ABN76PSX_js__WEBPACK_IMPORTED_MODULE_1__.useDisclosureProviderContext)();
- store = store || context;
- (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_6__.invariant)(
- store,
- true && "DisclosureContent must receive a `store` prop or be wrapped in a DisclosureProvider component."
- );
- const ref = (0,react__WEBPACK_IMPORTED_MODULE_7__.useRef)(null);
- const id = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useId)(props.id);
- const [transition, setTransition] = (0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(null);
- const open = store.useState("open");
- const mounted = store.useState("mounted");
- const animated = store.useState("animated");
- const contentElement = store.useState("contentElement");
- const otherElement = (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_2__.useStoreState)(store.disclosure, "contentElement");
- (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useSafeLayoutEffect)(() => {
- if (!ref.current) return;
- store == null ? void 0 : store.setContentElement(ref.current);
- }, [store]);
- (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useSafeLayoutEffect)(() => {
- let previousAnimated;
- store == null ? void 0 : store.setState("animated", (animated2) => {
- previousAnimated = animated2;
- return true;
- });
- return () => {
- if (previousAnimated === void 0) return;
- store == null ? void 0 : store.setState("animated", previousAnimated);
- };
- }, [store]);
- (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useSafeLayoutEffect)(() => {
- if (!animated) return;
- if (!(contentElement == null ? void 0 : contentElement.isConnected)) {
- setTransition(null);
- return;
- }
- return afterPaint(() => {
- setTransition(open ? "enter" : mounted ? "leave" : null);
- });
- }, [animated, contentElement, open, mounted]);
- (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useSafeLayoutEffect)(() => {
- if (!store) return;
- if (!animated) return;
- if (!transition) return;
- if (!contentElement) return;
- const stopAnimation = () => store == null ? void 0 : store.setState("animating", false);
- const stopAnimationSync = () => (0,react_dom__WEBPACK_IMPORTED_MODULE_8__.flushSync)(stopAnimation);
- if (transition === "leave" && open) return;
- if (transition === "enter" && !open) return;
- if (typeof animated === "number") {
- const timeout2 = animated;
- return afterTimeout(timeout2, stopAnimationSync);
- }
- const {
- transitionDuration,
- animationDuration,
- transitionDelay,
- animationDelay
- } = getComputedStyle(contentElement);
- const {
- transitionDuration: transitionDuration2 = "0",
- animationDuration: animationDuration2 = "0",
- transitionDelay: transitionDelay2 = "0",
- animationDelay: animationDelay2 = "0"
- } = otherElement ? getComputedStyle(otherElement) : {};
- const delay = parseCSSTime(
- transitionDelay,
- animationDelay,
- transitionDelay2,
- animationDelay2
- );
- const duration = parseCSSTime(
- transitionDuration,
- animationDuration,
- transitionDuration2,
- animationDuration2
- );
- const timeout = delay + duration;
- if (!timeout) {
- if (transition === "enter") {
- store.setState("animated", false);
- }
- stopAnimation();
- return;
- }
- const frameRate = 1e3 / 60;
- const maxTimeout = Math.max(timeout - frameRate, 0);
- return afterTimeout(maxTimeout, stopAnimationSync);
- }, [store, animated, contentElement, otherElement, open, transition]);
- props = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useWrapElement)(
- props,
- (element) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_T2AZQXQU_js__WEBPACK_IMPORTED_MODULE_0__.DialogScopedContextProvider, { value: store, children: element }),
- [store]
- );
- const hidden = isHidden(mounted, props.hidden, alwaysVisible);
- const styleProp = props.style;
- const style = (0,react__WEBPACK_IMPORTED_MODULE_7__.useMemo)(() => {
- if (hidden) {
- return (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({}, styleProp), { display: "none" });
- }
- return styleProp;
- }, [hidden, styleProp]);
- props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({
- id,
- "data-open": open || void 0,
- "data-enter": transition === "enter" || void 0,
- "data-leave": transition === "leave" || void 0,
- hidden
- }, props), {
- ref: (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useMergeRefs)(id ? store.setContentElement : null, ref, props.ref),
- style
- });
- return (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_6__.removeUndefinedValues)(props);
-});
-var DisclosureContentImpl = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__.forwardRef)(function DisclosureContentImpl2(props) {
- const htmlProps = useDisclosureContent(props);
- return (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__.createElement)(TagName, htmlProps);
-});
-var DisclosureContent = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__.forwardRef)(function DisclosureContent2(_a) {
- var _b = _a, {
- unmountOnHide
- } = _b, props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__objRest)(_b, [
- "unmountOnHide"
- ]);
- const context = (0,_ABN76PSX_js__WEBPACK_IMPORTED_MODULE_1__.useDisclosureProviderContext)();
- const store = props.store || context;
- const mounted = (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_2__.useStoreState)(
- store,
- (state) => !unmountOnHide || (state == null ? void 0 : state.mounted)
- );
- if (mounted === false) return null;
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(DisclosureContentImpl, (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({}, props));
-});
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/MNJRSAAC.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/MNJRSAAC.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ ComboboxList: () => (/* binding */ ComboboxList),
-/* harmony export */ useComboboxList: () => (/* binding */ useComboboxList)
-/* harmony export */ });
-/* harmony import */ var _K4R5DNTX_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./K4R5DNTX.js */ "./node_modules/@ariakit/react-core/esm/__chunks/K4R5DNTX.js");
-/* harmony import */ var _OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./OLVWQA7U.js */ "./node_modules/@ariakit/react-core/esm/__chunks/OLVWQA7U.js");
-/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
-/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
-/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
-/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react */ "react");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-"use client";
-
-
-
-
-
-
-// src/combobox/combobox-list.tsx
-
-
-
-var TagName = "div";
-var useComboboxList = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_2__.createHook)(
- function useComboboxList2(_a) {
- var _b = _a, { store, alwaysVisible } = _b, props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__objRest)(_b, ["store", "alwaysVisible"]);
- const scopedContext = (0,_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_1__.useComboboxScopedContext)(true);
- const context = (0,_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_1__.useComboboxContext)();
- store = store || context;
- const scopedContextSameStore = !!store && store === scopedContext;
- (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_5__.invariant)(
- store,
- true && "ComboboxList must receive a `store` prop or be wrapped in a ComboboxProvider component."
- );
- const ref = (0,react__WEBPACK_IMPORTED_MODULE_6__.useRef)(null);
- const id = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_3__.useId)(props.id);
- const mounted = store.useState("mounted");
- const hidden = (0,_K4R5DNTX_js__WEBPACK_IMPORTED_MODULE_0__.isHidden)(mounted, props.hidden, alwaysVisible);
- const style = hidden ? (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__spreadValues)({}, props.style), { display: "none" }) : props.style;
- const multiSelectable = store.useState(
- (state) => Array.isArray(state.selectedValue)
- );
- const role = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_3__.useAttribute)(ref, "role", props.role);
- const isCompositeRole = role === "listbox" || role === "tree" || role === "grid";
- const ariaMultiSelectable = isCompositeRole ? multiSelectable || void 0 : void 0;
- const [hasListboxInside, setHasListboxInside] = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)(false);
- const contentElement = store.useState("contentElement");
- (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_3__.useSafeLayoutEffect)(() => {
- if (!mounted) return;
- const element = ref.current;
- if (!element) return;
- if (contentElement !== element) return;
- const callback = () => {
- setHasListboxInside(!!element.querySelector("[role='listbox']"));
- };
- const observer = new MutationObserver(callback);
- observer.observe(element, {
- subtree: true,
- childList: true,
- attributeFilter: ["role"]
- });
- callback();
- return () => observer.disconnect();
- }, [mounted, contentElement]);
- if (!hasListboxInside) {
- props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__spreadValues)({
- role: "listbox",
- "aria-multiselectable": ariaMultiSelectable
- }, props);
- }
- props = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_3__.useWrapElement)(
- props,
- (element) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_1__.ComboboxScopedContextProvider, { value: store, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_1__.ComboboxListRoleContext.Provider, { value: role, children: element }) }),
- [store, role]
- );
- const setContentElement = id && (!scopedContext || !scopedContextSameStore) ? store.setContentElement : null;
- props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_4__.__spreadValues)({
- id,
- hidden
- }, props), {
- ref: (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_3__.useMergeRefs)(setContentElement, ref, props.ref),
- style
- });
- return (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_5__.removeUndefinedValues)(props);
- }
-);
-var ComboboxList = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(function ComboboxList2(props) {
- const htmlProps = useComboboxList(props);
- return (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_2__.createElement)(TagName, htmlProps);
-});
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/NSTBQJLB.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/NSTBQJLB.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ Composite: () => (/* binding */ Composite),
-/* harmony export */ useComposite: () => (/* binding */ useComposite)
-/* harmony export */ });
-/* harmony import */ var _5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./5VQZOHHZ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5VQZOHHZ.js");
-/* harmony import */ var _APTFW6PT_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./APTFW6PT.js */ "./node_modules/@ariakit/react-core/esm/__chunks/APTFW6PT.js");
-/* harmony import */ var _OE2EFRVA_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./OE2EFRVA.js */ "./node_modules/@ariakit/react-core/esm/__chunks/OE2EFRVA.js");
-/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
-/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
-/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
-/* harmony import */ var _ariakit_core_utils_array__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ariakit/core/utils/array */ "./node_modules/@ariakit/core/esm/__chunks/7PRQYBBV.js");
-/* harmony import */ var _ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ariakit/core/utils/dom */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js");
-/* harmony import */ var _ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ariakit/core/utils/events */ "./node_modules/@ariakit/core/esm/utils/events.js");
-/* harmony import */ var _ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ariakit/core/utils/focus */ "./node_modules/@ariakit/core/esm/utils/focus.js");
-/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react */ "react");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-"use client";
-
-
-
-
-
-
-
-// src/composite/composite.tsx
-
-
-
-
-
-
-
-var TagName = "div";
-function isGrid(items) {
- return items.some((item) => !!item.rowId);
-}
-function isPrintableKey(event) {
- const target = event.target;
- if (target && !(0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_7__.isTextField)(target)) return false;
- 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 useKeyboardEventProxy(store, onKeyboardEvent, previousElementRef) {
- return (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useEvent)((event) => {
- var _a;
- onKeyboardEvent == null ? void 0 : onKeyboardEvent(event);
- if (event.defaultPrevented) return;
- if (event.isPropagationStopped()) return;
- if (!(0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.isSelfTarget)(event)) return;
- if (isModifierKey(event)) return;
- if (isPrintableKey(event)) return;
- const state = store.getState();
- const activeElement = (_a = (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.getEnabledItem)(store, state.activeId)) == null ? void 0 : _a.element;
- if (!activeElement) return;
- const _b = event, { view } = _b, eventInit = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__objRest)(_b, ["view"]);
- const previousElement = previousElementRef == null ? void 0 : previousElementRef.current;
- if (activeElement !== previousElement) {
- activeElement.focus();
- }
- if (!(0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.fireKeyboardEvent)(activeElement, event.type, eventInit)) {
- event.preventDefault();
- }
- if (event.currentTarget.contains(activeElement)) {
- event.stopPropagation();
- }
- });
-}
-function findFirstEnabledItemInTheLastRow(items) {
- return (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.findFirstEnabledItem)(
- (0,_ariakit_core_utils_array__WEBPACK_IMPORTED_MODULE_6__.flatten2DArray)((0,_ariakit_core_utils_array__WEBPACK_IMPORTED_MODULE_6__.reverseArray)((0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.groupItemsByRows)(items)))
- );
-}
-function useScheduleFocus(store) {
- const [scheduled, setScheduled] = (0,react__WEBPACK_IMPORTED_MODULE_11__.useState)(false);
- const schedule = (0,react__WEBPACK_IMPORTED_MODULE_11__.useCallback)(() => setScheduled(true), []);
- const activeItem = store.useState(
- (state) => (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.getEnabledItem)(store, state.activeId)
- );
- (0,react__WEBPACK_IMPORTED_MODULE_11__.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 = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__.createHook)(
- function useComposite2(_a) {
- var _b = _a, {
- store,
- composite = true,
- focusOnMove = composite,
- moveOnKeyPress = true
- } = _b, props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__objRest)(_b, [
- "store",
- "composite",
- "focusOnMove",
- "moveOnKeyPress"
- ]);
- const context = (0,_APTFW6PT_js__WEBPACK_IMPORTED_MODULE_1__.useCompositeProviderContext)();
- store = store || context;
- (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_10__.invariant)(
- store,
- true && "Composite must receive a `store` prop or be wrapped in a CompositeProvider component."
- );
- const ref = (0,react__WEBPACK_IMPORTED_MODULE_11__.useRef)(null);
- const previousElementRef = (0,react__WEBPACK_IMPORTED_MODULE_11__.useRef)(null);
- const scheduleFocus = useScheduleFocus(store);
- const moves = store.useState("moves");
- const [, setBaseElement] = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useTransactionState)(
- composite ? store.setBaseElement : null
- );
- (0,react__WEBPACK_IMPORTED_MODULE_11__.useEffect)(() => {
- var _a2;
- if (!store) return;
- if (!moves) return;
- if (!composite) return;
- if (!focusOnMove) return;
- const { activeId: activeId2 } = store.getState();
- const itemElement = (_a2 = (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.getEnabledItem)(store, activeId2)) == null ? void 0 : _a2.element;
- if (!itemElement) return;
- (0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_9__.focusIntoView)(itemElement);
- }, [store, moves, composite, focusOnMove]);
- (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.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) {
- (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.fireBlurEvent)(previousElement, { relatedTarget: baseElement });
- }
- if (!(0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_9__.hasFocus)(baseElement)) {
- baseElement.focus();
- }
- }, [store, moves, composite]);
- const activeId = store.useState("activeId");
- const virtualFocus = store.useState("virtualFocus");
- (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.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 = (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.getEnabledItem)(store, activeId)) == null ? void 0 : _a2.element;
- const relatedTarget = activeElement || (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_7__.getActiveElement)(previousElement);
- if (relatedTarget === previousElement) return;
- (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.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 = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.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 = (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.silentlyFocused)(event.currentTarget);
- if ((0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.isSelfTarget)(event) && isSilentlyFocused) {
- event.stopPropagation();
- previousElementRef.current = previousActiveElement;
- }
- });
- const onFocusProp = props.onFocus;
- const onFocus = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.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 ((0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.isSelfTarget)(event) && !(0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.isItem)(store, relatedTarget)) {
- queueMicrotask(scheduleFocus);
- }
- } else if ((0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.isSelfTarget)(event)) {
- store.setActiveId(null);
- }
- });
- const onBlurCaptureProp = props.onBlurCapture;
- const onBlurCapture = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.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 = (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.getEnabledItem)(store, activeId2)) == null ? void 0 : _a2.element;
- const nextActiveElement = event.relatedTarget;
- const nextActiveElementIsItem = (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.isItem)(store, nextActiveElement);
- const previousElement = previousElementRef.current;
- previousElementRef.current = null;
- if ((0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.isSelfTarget)(event) && nextActiveElementIsItem) {
- if (nextActiveElement === activeElement) {
- if (previousElement && previousElement !== nextActiveElement) {
- (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.fireBlurEvent)(previousElement, event);
- }
- } else if (activeElement) {
- (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.fireBlurEvent)(activeElement, event);
- } else if (previousElement) {
- (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.fireBlurEvent)(previousElement, event);
- }
- event.stopPropagation();
- } else {
- const targetIsItem = (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.isItem)(store, event.target);
- if (!targetIsItem && activeElement) {
- (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.fireBlurEvent)(activeElement, event);
- }
- }
- });
- const onKeyDownProp = props.onKeyDown;
- const moveOnKeyPressProp = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useBooleanEvent)(moveOnKeyPress);
- const onKeyDown = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useEvent)((event) => {
- var _a2;
- onKeyDownProp == null ? void 0 : onKeyDownProp(event);
- if (event.nativeEvent.isComposing) return;
- if (event.defaultPrevented) return;
- if (!store) return;
- if (!(0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_8__.isSelfTarget)(event)) return;
- const { orientation, renderedItems, activeId: activeId2 } = store.getState();
- const activeItem = (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.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 && (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_7__.isTextField)(event.currentTarget)) return;
- const up = () => {
- if (grid) {
- const item = findFirstEnabledItemInTheLastRow(renderedItems);
- return item == null ? void 0 : item.id;
- }
- return store == null ? void 0 : 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 = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useWrapElement)(
- props,
- (element) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_APTFW6PT_js__WEBPACK_IMPORTED_MODULE_1__.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 = (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.getEnabledItem)(store, state.activeId)) == null ? void 0 : _a2.id;
- });
- props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({
- "aria-activedescendant": activeDescendant
- }, props), {
- ref: (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useMergeRefs)(ref, setBaseElement, props.ref),
- onKeyDownCapture,
- onKeyUpCapture,
- onFocusCapture,
- onFocus,
- onBlurCapture,
- onKeyDown
- });
- const focusable = store.useState(
- (state) => composite && (state.virtualFocus || state.activeId === null)
- );
- props = (0,_OE2EFRVA_js__WEBPACK_IMPORTED_MODULE_2__.useFocusable)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({ focusable }, props));
- return props;
- }
-);
-var Composite = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__.forwardRef)(function Composite2(props) {
- const htmlProps = useComposite(props);
- return (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__.createElement)(TagName, htmlProps);
-});
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/OE2EFRVA.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/OE2EFRVA.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ Focusable: () => (/* binding */ Focusable),
-/* harmony export */ isSafariFocusAncestor: () => (/* binding */ isSafariFocusAncestor),
-/* harmony export */ useFocusable: () => (/* binding */ useFocusable)
-/* harmony export */ });
-/* harmony import */ var _SWN3JYXT_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SWN3JYXT.js */ "./node_modules/@ariakit/react-core/esm/__chunks/SWN3JYXT.js");
-/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
-/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
-/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
-/* harmony import */ var _ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ariakit/core/utils/dom */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js");
-/* harmony import */ var _ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ariakit/core/utils/events */ "./node_modules/@ariakit/core/esm/utils/events.js");
-/* harmony import */ var _ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ariakit/core/utils/focus */ "./node_modules/@ariakit/core/esm/utils/focus.js");
-/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
-/* harmony import */ var _ariakit_core_utils_platform__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ariakit/core/utils/platform */ "./node_modules/@ariakit/core/esm/__chunks/O6E4ZWCP.js");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react */ "react");
-"use client";
-
-
-
-
-
-// src/focusable/focusable.tsx
-
-
-
-
-
-
-var TagName = "div";
-var isSafariBrowser = (0,_ariakit_core_utils_platform__WEBPACK_IMPORTED_MODULE_8__.isSafari)();
-var alwaysFocusVisibleInputTypes = [
- "text",
- "search",
- "url",
- "tel",
- "email",
- "password",
- "number",
- "date",
- "month",
- "week",
- "time",
- "datetime",
- "datetime-local"
-];
-var safariFocusAncestorSymbol = Symbol("safariFocusAncestor");
-function isSafariFocusAncestor(element) {
- if (!element) return false;
- return !!element[safariFocusAncestorSymbol];
-}
-function markSafariFocusAncestor(element, value) {
- if (!element) return;
- element[safariFocusAncestorSymbol] = value;
-}
-function isAlwaysFocusVisible(element) {
- const { tagName, readOnly, type } = element;
- if (tagName === "TEXTAREA" && !readOnly) return true;
- if (tagName === "SELECT" && !readOnly) return true;
- if (tagName === "INPUT" && !readOnly) {
- return alwaysFocusVisibleInputTypes.includes(type);
- }
- if (element.isContentEditable) return true;
- const role = element.getAttribute("role");
- if (role === "combobox" && element.dataset.name) {
- return true;
- }
- return false;
-}
-function getLabels(element) {
- if ("labels" in element) {
- return element.labels;
- }
- return null;
-}
-function isNativeCheckboxOrRadio(element) {
- const tagName = element.tagName.toLowerCase();
- if (tagName === "input" && element.type) {
- return element.type === "radio" || element.type === "checkbox";
- }
- return false;
-}
-function isNativeTabbable(tagName) {
- if (!tagName) return true;
- return tagName === "button" || tagName === "summary" || tagName === "input" || tagName === "select" || tagName === "textarea" || tagName === "a";
-}
-function supportsDisabledAttribute(tagName) {
- if (!tagName) return true;
- return tagName === "button" || tagName === "input" || tagName === "select" || tagName === "textarea";
-}
-function getTabIndex(focusable, trulyDisabled, nativeTabbable, supportsDisabled, tabIndexProp) {
- if (!focusable) {
- return tabIndexProp;
- }
- if (trulyDisabled) {
- if (nativeTabbable && !supportsDisabled) {
- return -1;
- }
- return;
- }
- if (nativeTabbable) {
- return tabIndexProp;
- }
- return tabIndexProp || 0;
-}
-function useDisableEvent(onEvent, disabled) {
- return (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useEvent)((event) => {
- onEvent == null ? void 0 : onEvent(event);
- if (event.defaultPrevented) return;
- if (disabled) {
- event.stopPropagation();
- event.preventDefault();
- }
- });
-}
-var hasInstalledGlobalEventListeners = false;
-var isKeyboardModality = true;
-function onGlobalMouseDown(event) {
- const target = event.target;
- if (target && "hasAttribute" in target) {
- if (!target.hasAttribute("data-focus-visible")) {
- isKeyboardModality = false;
- }
- }
-}
-function onGlobalKeyDown(event) {
- if (event.metaKey) return;
- if (event.ctrlKey) return;
- if (event.altKey) return;
- isKeyboardModality = true;
-}
-var useFocusable = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createHook)(
- function useFocusable2(_a) {
- var _b = _a, {
- focusable = true,
- accessibleWhenDisabled,
- autoFocus,
- onFocusVisible
- } = _b, props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__objRest)(_b, [
- "focusable",
- "accessibleWhenDisabled",
- "autoFocus",
- "onFocusVisible"
- ]);
- const ref = (0,react__WEBPACK_IMPORTED_MODULE_9__.useRef)(null);
- (0,react__WEBPACK_IMPORTED_MODULE_9__.useEffect)(() => {
- if (!focusable) return;
- if (hasInstalledGlobalEventListeners) return;
- (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.addGlobalEventListener)("mousedown", onGlobalMouseDown, true);
- (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.addGlobalEventListener)("keydown", onGlobalKeyDown, true);
- hasInstalledGlobalEventListeners = true;
- }, [focusable]);
- if (isSafariBrowser) {
- (0,react__WEBPACK_IMPORTED_MODULE_9__.useEffect)(() => {
- if (!focusable) return;
- const element = ref.current;
- if (!element) return;
- if (!isNativeCheckboxOrRadio(element)) return;
- const labels = getLabels(element);
- if (!labels) return;
- const onMouseUp = () => queueMicrotask(() => element.focus());
- for (const label of labels) {
- label.addEventListener("mouseup", onMouseUp);
- }
- return () => {
- for (const label of labels) {
- label.removeEventListener("mouseup", onMouseUp);
- }
- };
- }, [focusable]);
- }
- const disabled = focusable && (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_7__.disabledFromProps)(props);
- const trulyDisabled = !!disabled && !accessibleWhenDisabled;
- const [focusVisible, setFocusVisible] = (0,react__WEBPACK_IMPORTED_MODULE_9__.useState)(false);
- (0,react__WEBPACK_IMPORTED_MODULE_9__.useEffect)(() => {
- if (!focusable) return;
- if (trulyDisabled && focusVisible) {
- setFocusVisible(false);
- }
- }, [focusable, trulyDisabled, focusVisible]);
- (0,react__WEBPACK_IMPORTED_MODULE_9__.useEffect)(() => {
- if (!focusable) return;
- if (!focusVisible) return;
- const element = ref.current;
- if (!element) return;
- if (typeof IntersectionObserver === "undefined") return;
- const observer = new IntersectionObserver(() => {
- if (!(0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_6__.isFocusable)(element)) {
- setFocusVisible(false);
- }
- });
- observer.observe(element);
- return () => observer.disconnect();
- }, [focusable, focusVisible]);
- const onKeyPressCapture = useDisableEvent(
- props.onKeyPressCapture,
- disabled
- );
- const onMouseDownCapture = useDisableEvent(
- props.onMouseDownCapture,
- disabled
- );
- const onClickCapture = useDisableEvent(props.onClickCapture, disabled);
- const onMouseDownProp = props.onMouseDown;
- const onMouseDown = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useEvent)((event) => {
- onMouseDownProp == null ? void 0 : onMouseDownProp(event);
- if (event.defaultPrevented) return;
- if (!focusable) return;
- const element = event.currentTarget;
- if (!isSafariBrowser) return;
- if ((0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.isPortalEvent)(event)) return;
- if (!(0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_4__.isButton)(element) && !isNativeCheckboxOrRadio(element)) return;
- let receivedFocus = false;
- const onFocus = () => {
- receivedFocus = true;
- };
- const options = { capture: true, once: true };
- element.addEventListener("focusin", onFocus, options);
- const focusableContainer = (0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_6__.getClosestFocusable)(element.parentElement);
- markSafariFocusAncestor(focusableContainer, true);
- (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.queueBeforeEvent)(element, "mouseup", () => {
- element.removeEventListener("focusin", onFocus, true);
- markSafariFocusAncestor(focusableContainer, false);
- if (receivedFocus) return;
- (0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_6__.focusIfNeeded)(element);
- });
- });
- const handleFocusVisible = (event, currentTarget) => {
- if (currentTarget) {
- event.currentTarget = currentTarget;
- }
- if (!focusable) return;
- const element = event.currentTarget;
- if (!element) return;
- if (!(0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_6__.hasFocus)(element)) return;
- onFocusVisible == null ? void 0 : onFocusVisible(event);
- if (event.defaultPrevented) return;
- element.dataset.focusVisible = "true";
- setFocusVisible(true);
- };
- const onKeyDownCaptureProp = props.onKeyDownCapture;
- const onKeyDownCapture = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useEvent)((event) => {
- onKeyDownCaptureProp == null ? void 0 : onKeyDownCaptureProp(event);
- if (event.defaultPrevented) return;
- if (!focusable) return;
- if (focusVisible) return;
- if (event.metaKey) return;
- if (event.altKey) return;
- if (event.ctrlKey) return;
- if (!(0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.isSelfTarget)(event)) return;
- const element = event.currentTarget;
- const applyFocusVisible = () => handleFocusVisible(event, element);
- (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.queueBeforeEvent)(element, "focusout", applyFocusVisible);
- });
- const onFocusCaptureProp = props.onFocusCapture;
- const onFocusCapture = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useEvent)((event) => {
- onFocusCaptureProp == null ? void 0 : onFocusCaptureProp(event);
- if (event.defaultPrevented) return;
- if (!focusable) return;
- if (!(0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.isSelfTarget)(event)) {
- setFocusVisible(false);
- return;
- }
- const element = event.currentTarget;
- const applyFocusVisible = () => handleFocusVisible(event, element);
- if (isKeyboardModality || isAlwaysFocusVisible(event.target)) {
- (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.queueBeforeEvent)(event.target, "focusout", applyFocusVisible);
- } else {
- setFocusVisible(false);
- }
- });
- const onBlurProp = props.onBlur;
- const onBlur = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useEvent)((event) => {
- onBlurProp == null ? void 0 : onBlurProp(event);
- if (!focusable) return;
- if (!(0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_5__.isFocusEventOutside)(event)) return;
- event.currentTarget.removeAttribute("data-focus-visible");
- setFocusVisible(false);
- });
- const autoFocusOnShow = (0,react__WEBPACK_IMPORTED_MODULE_9__.useContext)(_SWN3JYXT_js__WEBPACK_IMPORTED_MODULE_0__.FocusableContext);
- const autoFocusRef = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useEvent)((element) => {
- if (!focusable) return;
- if (!autoFocus) return;
- if (!element) return;
- if (!autoFocusOnShow) return;
- queueMicrotask(() => {
- if ((0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_6__.hasFocus)(element)) return;
- if (!(0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_6__.isFocusable)(element)) return;
- element.focus();
- });
- });
- const tagName = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useTagName)(ref);
- const nativeTabbable = focusable && isNativeTabbable(tagName);
- const supportsDisabled = focusable && supportsDisabledAttribute(tagName);
- const styleProp = props.style;
- const style = (0,react__WEBPACK_IMPORTED_MODULE_9__.useMemo)(() => {
- if (trulyDisabled) {
- return (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)({ pointerEvents: "none" }, styleProp);
- }
- return styleProp;
- }, [trulyDisabled, styleProp]);
- props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)({
- "data-focus-visible": focusable && focusVisible || void 0,
- "data-autofocus": autoFocus || void 0,
- "aria-disabled": disabled || void 0
- }, props), {
- ref: (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useMergeRefs)(ref, autoFocusRef, props.ref),
- style,
- tabIndex: getTabIndex(
- focusable,
- trulyDisabled,
- nativeTabbable,
- supportsDisabled,
- props.tabIndex
- ),
- disabled: supportsDisabled && trulyDisabled ? true : void 0,
- // TODO: Test Focusable contentEditable.
- contentEditable: disabled ? void 0 : props.contentEditable,
- onKeyPressCapture,
- onClickCapture,
- onMouseDownCapture,
- onMouseDown,
- onKeyDownCapture,
- onFocusCapture,
- onBlur
- });
- return (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_7__.removeUndefinedValues)(props);
- }
-);
-var Focusable = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function Focusable2(props) {
- const htmlProps = useFocusable(props);
- return (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createElement)(TagName, htmlProps);
-});
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/OLVWQA7U.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/OLVWQA7U.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ ComboboxContextProvider: () => (/* binding */ ComboboxContextProvider),
-/* harmony export */ ComboboxItemCheckedContext: () => (/* binding */ ComboboxItemCheckedContext),
-/* harmony export */ ComboboxItemValueContext: () => (/* binding */ ComboboxItemValueContext),
-/* harmony export */ ComboboxListRoleContext: () => (/* binding */ ComboboxListRoleContext),
-/* harmony export */ ComboboxScopedContextProvider: () => (/* binding */ ComboboxScopedContextProvider),
-/* harmony export */ useComboboxContext: () => (/* binding */ useComboboxContext),
-/* harmony export */ useComboboxProviderContext: () => (/* binding */ useComboboxProviderContext),
-/* harmony export */ useComboboxScopedContext: () => (/* binding */ useComboboxScopedContext)
-/* harmony export */ });
-/* harmony import */ var _Y67KZUMI_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Y67KZUMI.js */ "./node_modules/@ariakit/react-core/esm/__chunks/Y67KZUMI.js");
-/* harmony import */ var _APTFW6PT_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./APTFW6PT.js */ "./node_modules/@ariakit/react-core/esm/__chunks/APTFW6PT.js");
-/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "react");
-"use client";
-
-
-
-
-// src/combobox/combobox-context.tsx
-
-var ComboboxListRoleContext = (0,react__WEBPACK_IMPORTED_MODULE_3__.createContext)(
- void 0
-);
-var ctx = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_2__.createStoreContext)(
- [_Y67KZUMI_js__WEBPACK_IMPORTED_MODULE_0__.PopoverContextProvider, _APTFW6PT_js__WEBPACK_IMPORTED_MODULE_1__.CompositeContextProvider],
- [_Y67KZUMI_js__WEBPACK_IMPORTED_MODULE_0__.PopoverScopedContextProvider, _APTFW6PT_js__WEBPACK_IMPORTED_MODULE_1__.CompositeScopedContextProvider]
-);
-var useComboboxContext = ctx.useContext;
-var useComboboxScopedContext = ctx.useScopedContext;
-var useComboboxProviderContext = ctx.useProviderContext;
-var ComboboxContextProvider = ctx.ContextProvider;
-var ComboboxScopedContextProvider = ctx.ScopedContextProvider;
-var ComboboxItemValueContext = (0,react__WEBPACK_IMPORTED_MODULE_3__.createContext)(
- void 0
-);
-var ComboboxItemCheckedContext = (0,react__WEBPACK_IMPORTED_MODULE_3__.createContext)(false);
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/RTNCFSKZ.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/RTNCFSKZ.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ useStore: () => (/* binding */ useStore),
-/* harmony export */ useStoreProps: () => (/* binding */ useStoreProps),
-/* harmony export */ useStoreState: () => (/* binding */ useStoreState),
-/* harmony export */ useStoreStateObject: () => (/* binding */ useStoreStateObject)
-/* harmony export */ });
-/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
-/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
-/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
-/* harmony import */ var _ariakit_core_utils_store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ariakit/core/utils/store */ "./node_modules/@ariakit/core/esm/__chunks/EWA2WL6G.js");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "react");
-/* harmony import */ var use_sync_external_store_shim_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! use-sync-external-store/shim/index.js */ "./node_modules/use-sync-external-store/shim/index.js");
-"use client";
-
-
-
-// src/utils/store.tsx
-
-
-
-
-var { useSyncExternalStore } = use_sync_external_store_shim_index_js__WEBPACK_IMPORTED_MODULE_5__;
-var noopSubscribe = () => () => {
-};
-function useStoreState(store, keyOrSelector = _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_2__.identity) {
- const storeSubscribe = react__WEBPACK_IMPORTED_MODULE_4__.useCallback(
- (callback) => {
- if (!store) return noopSubscribe();
- return (0,_ariakit_core_utils_store__WEBPACK_IMPORTED_MODULE_3__.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 (!(0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_2__.hasOwnProperty)(state, key)) return;
- return state[key];
- };
- return useSyncExternalStore(storeSubscribe, getSnapshot, getSnapshot);
-}
-function useStoreStateObject(store, object) {
- const objRef = react__WEBPACK_IMPORTED_MODULE_4__.useRef(
- {}
- );
- const storeSubscribe = react__WEBPACK_IMPORTED_MODULE_4__.useCallback(
- (callback) => {
- if (!store) return noopSubscribe();
- return (0,_ariakit_core_utils_store__WEBPACK_IMPORTED_MODULE_3__.subscribe)(store, null, callback);
- },
- [store]
- );
- const getSnapshot = () => {
- const state = store == null ? void 0 : store.getState();
- let updated = false;
- const obj = objRef.current;
- for (const prop in object) {
- const keyOrSelector = object[prop];
- if (typeof keyOrSelector === "function") {
- const value = keyOrSelector(state);
- if (value !== obj[prop]) {
- obj[prop] = value;
- updated = true;
- }
- }
- if (typeof keyOrSelector === "string") {
- if (!state) continue;
- if (!(0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_2__.hasOwnProperty)(state, keyOrSelector)) continue;
- const value = state[keyOrSelector];
- if (value !== obj[prop]) {
- obj[prop] = value;
- updated = true;
- }
- }
- }
- if (updated) {
- objRef.current = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadValues)({}, obj);
- }
- return objRef.current;
- };
- return useSyncExternalStore(storeSubscribe, getSnapshot, getSnapshot);
-}
-function useStoreProps(store, props, key, setKey) {
- const value = (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_2__.hasOwnProperty)(props, key) ? props[key] : void 0;
- const setValue = setKey ? props[setKey] : void 0;
- const propsRef = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_0__.useLiveRef)({ value, setValue });
- (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_0__.useSafeLayoutEffect)(() => {
- return (0,_ariakit_core_utils_store__WEBPACK_IMPORTED_MODULE_3__.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]);
- (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_0__.useSafeLayoutEffect)(() => {
- if (value === void 0) return;
- store.setState(key, value);
- return (0,_ariakit_core_utils_store__WEBPACK_IMPORTED_MODULE_3__.batch)(store, [key], () => {
- if (value === void 0) return;
- store.setState(key, value);
- });
- });
-}
-function useStore(createStore, props) {
- const [store, setStore] = react__WEBPACK_IMPORTED_MODULE_4__.useState(() => createStore(props));
- (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_0__.useSafeLayoutEffect)(() => (0,_ariakit_core_utils_store__WEBPACK_IMPORTED_MODULE_3__.init)(store), [store]);
- const useState2 = react__WEBPACK_IMPORTED_MODULE_4__.useCallback(
- (keyOrSelector) => useStoreState(store, keyOrSelector),
- [store]
- );
- const memoizedStore = react__WEBPACK_IMPORTED_MODULE_4__.useMemo(
- () => (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadValues)({}, store), { useState: useState2 }),
- [store, useState2]
- );
- const updateStore = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_0__.useEvent)(() => {
- setStore((store2) => createStore((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadValues)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_1__.__spreadValues)({}, props), store2.getState())));
- });
- return [memoizedStore, updateStore];
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/RUY5BUJG.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/RUY5BUJG.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ usePopoverStore: () => (/* binding */ usePopoverStore),
-/* harmony export */ usePopoverStoreProps: () => (/* binding */ usePopoverStoreProps)
-/* harmony export */ });
-/* harmony import */ var _Y2U4BRIM_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Y2U4BRIM.js */ "./node_modules/@ariakit/react-core/esm/__chunks/Y2U4BRIM.js");
-/* harmony import */ var _RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RTNCFSKZ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/RTNCFSKZ.js");
-/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
-/* harmony import */ var _ariakit_core_popover_popover_store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ariakit/core/popover/popover-store */ "./node_modules/@ariakit/core/esm/__chunks/MD3RIO2T.js");
-"use client";
-
-
-
-
-// src/popover/popover-store.ts
-
-function usePopoverStoreProps(store, update, props) {
- (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useUpdateEffect)(update, [props.popover]);
- (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStoreProps)(store, props, "placement");
- return (0,_Y2U4BRIM_js__WEBPACK_IMPORTED_MODULE_0__.useDialogStoreProps)(store, update, props);
-}
-function usePopoverStore(props = {}) {
- const [store, update] = (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStore)(_ariakit_core_popover_popover_store__WEBPACK_IMPORTED_MODULE_3__.createPopoverStore, props);
- return usePopoverStoreProps(store, update, props);
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/SBSPVDDI.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/SBSPVDDI.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ CompositeItem: () => (/* binding */ CompositeItem),
-/* harmony export */ useCompositeItem: () => (/* binding */ useCompositeItem)
-/* harmony export */ });
-/* harmony import */ var _5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./5VQZOHHZ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5VQZOHHZ.js");
-/* harmony import */ var _Y62RTBST_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Y62RTBST.js */ "./node_modules/@ariakit/react-core/esm/__chunks/Y62RTBST.js");
-/* harmony import */ var _APTFW6PT_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./APTFW6PT.js */ "./node_modules/@ariakit/react-core/esm/__chunks/APTFW6PT.js");
-/* harmony import */ var _2W3RN7C5_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./2W3RN7C5.js */ "./node_modules/@ariakit/react-core/esm/__chunks/2W3RN7C5.js");
-/* harmony import */ var _RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./RTNCFSKZ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/RTNCFSKZ.js");
-/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
-/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
-/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
-/* harmony import */ var _ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ariakit/core/utils/dom */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js");
-/* harmony import */ var _ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ariakit/core/utils/events */ "./node_modules/@ariakit/core/esm/utils/events.js");
-/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
-/* harmony import */ var _ariakit_core_utils_platform__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ariakit/core/utils/platform */ "./node_modules/@ariakit/core/esm/__chunks/O6E4ZWCP.js");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react */ "react");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-"use client";
-
-
-
-
-
-
-
-
-
-// src/composite/composite-item.tsx
-
-
-
-
-
-
-var TagName = "button";
-function isEditableElement(element) {
- if ((0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_8__.isTextbox)(element)) return true;
- return element.tagName === "INPUT" && !(0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_8__.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 = (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_8__.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 = (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.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 ((0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_9__.isSelfTarget)(event)) return false;
- return (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.isItem)(store, event.target);
-}
-var useCompositeItem = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_5__.createHook)(
- function useCompositeItem2(_a) {
- var _b = _a, {
- store,
- rowId: rowIdProp,
- preventScrollOnKeyDown = false,
- moveOnKeyPress = true,
- tabbable = false,
- getItem: getItemProp,
- "aria-setsize": ariaSetSizeProp,
- "aria-posinset": ariaPosInSetProp
- } = _b, props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_7__.__objRest)(_b, [
- "store",
- "rowId",
- "preventScrollOnKeyDown",
- "moveOnKeyPress",
- "tabbable",
- "getItem",
- "aria-setsize",
- "aria-posinset"
- ]);
- const context = (0,_APTFW6PT_js__WEBPACK_IMPORTED_MODULE_2__.useCompositeContext)();
- store = store || context;
- const id = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_6__.useId)(props.id);
- const ref = (0,react__WEBPACK_IMPORTED_MODULE_12__.useRef)(null);
- const row = (0,react__WEBPACK_IMPORTED_MODULE_12__.useContext)(_APTFW6PT_js__WEBPACK_IMPORTED_MODULE_2__.CompositeRowContext);
- const disabled = (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_10__.disabledFromProps)(props);
- const trulyDisabled = disabled && !props.accessibleWhenDisabled;
- const {
- rowId,
- baseElement,
- isActiveItem,
- ariaSetSize,
- ariaPosInSet,
- isTabbable
- } = (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_4__.useStoreStateObject)(store, {
- rowId(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;
- },
- baseElement(state) {
- return (state == null ? void 0 : state.baseElement) || void 0;
- },
- isActiveItem(state) {
- return !!state && state.activeId === id;
- },
- ariaSetSize(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;
- },
- ariaPosInSet(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);
- },
- isTabbable(state) {
- if (!(state == null ? void 0 : state.renderedItems.length)) return true;
- if (state.virtualFocus) return false;
- if (tabbable) return true;
- if (state.activeId === null) return false;
- const item = store == null ? void 0 : store.item(state.activeId);
- if (item == null ? void 0 : item.disabled) return true;
- if (!(item == null ? void 0 : item.element)) return true;
- return state.activeId === id;
- }
- });
- const getItem = (0,react__WEBPACK_IMPORTED_MODULE_12__.useCallback)(
- (item) => {
- var _a2;
- const nextItem = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_7__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_7__.__spreadValues)({}, item), {
- id: id || item.id,
- rowId,
- disabled: !!trulyDisabled,
- children: (_a2 = item.element) == null ? void 0 : _a2.textContent
- });
- if (getItemProp) {
- return getItemProp(nextItem);
- }
- return nextItem;
- },
- [id, rowId, trulyDisabled, getItemProp]
- );
- const onFocusProp = props.onFocus;
- const hasFocusedComposite = (0,react__WEBPACK_IMPORTED_MODULE_12__.useRef)(false);
- const onFocus = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_6__.useEvent)((event) => {
- onFocusProp == null ? void 0 : onFocusProp(event);
- if (event.defaultPrevented) return;
- if ((0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_9__.isPortalEvent)(event)) return;
- if (!id) return;
- if (!store) return;
- if (targetIsAnotherItem(event, store)) return;
- const { virtualFocus, baseElement: baseElement2 } = store.getState();
- store.setActiveId(id);
- if ((0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_8__.isTextbox)(event.currentTarget)) {
- (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.selectTextField)(event.currentTarget);
- }
- if (!virtualFocus) return;
- if (!(0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_9__.isSelfTarget)(event)) return;
- if (isEditableElement(event.currentTarget)) return;
- if (!(baseElement2 == null ? void 0 : baseElement2.isConnected)) return;
- if ((0,_ariakit_core_utils_platform__WEBPACK_IMPORTED_MODULE_11__.isSafari)() && event.currentTarget.hasAttribute("data-autofocus")) {
- event.currentTarget.scrollIntoView({
- block: "nearest",
- inline: "nearest"
- });
- }
- hasFocusedComposite.current = true;
- const fromComposite = event.relatedTarget === baseElement2 || (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.isItem)(store, event.relatedTarget);
- if (fromComposite) {
- (0,_5VQZOHHZ_js__WEBPACK_IMPORTED_MODULE_0__.focusSilently)(baseElement2);
- } else {
- baseElement2.focus();
- }
- });
- const onBlurCaptureProp = props.onBlurCapture;
- const onBlurCapture = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_6__.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 = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_6__.useBooleanEvent)(preventScrollOnKeyDown);
- const moveOnKeyPressProp = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_6__.useBooleanEvent)(moveOnKeyPress);
- const onKeyDown = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_6__.useEvent)((event) => {
- onKeyDownProp == null ? void 0 : onKeyDownProp(event);
- if (event.defaultPrevented) return;
- if (!(0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_9__.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 (!(0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_8__.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) {
- if ((0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_8__.isTextbox)(currentTarget)) {
- const selection = (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_8__.getTextboxSelection)(currentTarget);
- const isLeft = isHorizontal && event.key === "ArrowLeft";
- const isRight = isHorizontal && event.key === "ArrowRight";
- const isUp = isVertical && event.key === "ArrowUp";
- const isDown = isVertical && event.key === "ArrowDown";
- if (isRight || isDown) {
- const { length: valueLength } = (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_8__.getTextboxValue)(currentTarget);
- if (selection.end !== valueLength) return;
- } else if ((isLeft || isUp) && selection.start !== 0) return;
- }
- const nextId = action();
- if (preventScrollOnKeyDownProp(event) || nextId !== void 0) {
- if (!moveOnKeyPressProp(event)) return;
- event.preventDefault();
- store.move(nextId);
- }
- }
- });
- const providerValue = (0,react__WEBPACK_IMPORTED_MODULE_12__.useMemo)(
- () => ({ id, baseElement }),
- [id, baseElement]
- );
- props = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_6__.useWrapElement)(
- props,
- (element) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_APTFW6PT_js__WEBPACK_IMPORTED_MODULE_2__.CompositeItemContext.Provider, { value: providerValue, children: element }),
- [providerValue]
- );
- props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_7__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_7__.__spreadValues)({
- id,
- "data-active-item": isActiveItem || void 0
- }, props), {
- ref: (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_6__.useMergeRefs)(ref, props.ref),
- tabIndex: isTabbable ? props.tabIndex : -1,
- onFocus,
- onBlurCapture,
- onKeyDown
- });
- props = (0,_2W3RN7C5_js__WEBPACK_IMPORTED_MODULE_3__.useCommand)(props);
- props = (0,_Y62RTBST_js__WEBPACK_IMPORTED_MODULE_1__.useCollectionItem)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_7__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_7__.__spreadValues)({
- store
- }, props), {
- getItem,
- shouldRegisterItem: id ? props.shouldRegisterItem : false
- }));
- return (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_10__.removeUndefinedValues)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_7__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_7__.__spreadValues)({}, props), {
- "aria-setsize": ariaSetSize,
- "aria-posinset": ariaPosInSet
- }));
- }
-);
-var CompositeItem = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_5__.memo)(
- (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_5__.forwardRef)(function CompositeItem2(props) {
- const htmlProps = useCompositeItem(props);
- return (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_5__.createElement)(TagName, htmlProps);
- })
-);
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/SK3NAZA3.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/SK3NAZA3.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ getRefProperty: () => (/* binding */ getRefProperty),
-/* harmony export */ isValidElementWithRef: () => (/* binding */ isValidElementWithRef),
-/* harmony export */ mergeProps: () => (/* binding */ mergeProps),
-/* harmony export */ setRef: () => (/* binding */ setRef)
-/* harmony export */ });
-/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
-/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
-"use client";
-
-
-// src/utils/misc.ts
-
-
-function setRef(ref, value) {
- if (typeof ref === "function") {
- ref(value);
- } else if (ref) {
- ref.current = value;
- }
-}
-function isValidElementWithRef(element) {
- if (!element) return false;
- if (!(0,react__WEBPACK_IMPORTED_MODULE_2__.isValidElement)(element)) return false;
- if ("ref" in element.props) return true;
- if ("ref" in element) return true;
- return false;
-}
-function getRefProperty(element) {
- if (!isValidElementWithRef(element)) return null;
- const props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_0__.__spreadValues)({}, element.props);
- return props.ref || element.ref;
-}
-function mergeProps(base, overrides) {
- const props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_0__.__spreadValues)({}, base);
- for (const key in overrides) {
- if (!(0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_1__.hasOwnProperty)(overrides, key)) continue;
- if (key === "className") {
- const prop = "className";
- props[prop] = base[prop] ? `${base[prop]} ${overrides[prop]}` : overrides[prop];
- continue;
- }
- if (key === "style") {
- const prop = "style";
- props[prop] = base[prop] ? (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_0__.__spreadValues)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_0__.__spreadValues)({}, base[prop]), overrides[prop]) : overrides[prop];
- continue;
- }
- const overrideValue = overrides[key];
- if (typeof overrideValue === "function" && key.startsWith("on")) {
- const baseValue = base[key];
- if (typeof baseValue === "function") {
- props[key] = (...args) => {
- overrideValue(...args);
- baseValue(...args);
- };
- continue;
- }
- }
- props[key] = overrideValue;
- }
- return props;
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/SWN3JYXT.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/SWN3JYXT.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ FocusableContext: () => (/* binding */ FocusableContext)
-/* harmony export */ });
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
-"use client";
-
-// src/focusable/focusable-context.tsx
-
-var FocusableContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(true);
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/T22PY7TE.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/T22PY7TE.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ useDisclosureStore: () => (/* binding */ useDisclosureStore),
-/* harmony export */ useDisclosureStoreProps: () => (/* binding */ useDisclosureStoreProps)
-/* harmony export */ });
-/* harmony import */ var _RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./RTNCFSKZ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/RTNCFSKZ.js");
-/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
-/* harmony import */ var _ariakit_core_disclosure_disclosure_store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ariakit/core/disclosure/disclosure-store */ "./node_modules/@ariakit/core/esm/__chunks/43IPP2F4.js");
-"use client";
-
-
-
-// src/disclosure/disclosure-store.ts
-
-function useDisclosureStoreProps(store, update, props) {
- (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_1__.useUpdateEffect)(update, [props.store, props.disclosure]);
- (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_0__.useStoreProps)(store, props, "open", "setOpen");
- (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_0__.useStoreProps)(store, props, "mounted", "setMounted");
- (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_0__.useStoreProps)(store, props, "animated");
- return Object.assign(store, { disclosure: props.disclosure });
-}
-function useDisclosureStore(props = {}) {
- const [store, update] = (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_0__.useStore)(_ariakit_core_disclosure_disclosure_store__WEBPACK_IMPORTED_MODULE_2__.createDisclosureStore, props);
- return useDisclosureStoreProps(store, update, props);
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/T2AZQXQU.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/T2AZQXQU.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ DialogContextProvider: () => (/* binding */ DialogContextProvider),
-/* harmony export */ DialogDescriptionContext: () => (/* binding */ DialogDescriptionContext),
-/* harmony export */ DialogHeadingContext: () => (/* binding */ DialogHeadingContext),
-/* harmony export */ DialogScopedContextProvider: () => (/* binding */ DialogScopedContextProvider),
-/* harmony export */ useDialogContext: () => (/* binding */ useDialogContext),
-/* harmony export */ useDialogProviderContext: () => (/* binding */ useDialogProviderContext),
-/* harmony export */ useDialogScopedContext: () => (/* binding */ useDialogScopedContext)
-/* harmony export */ });
-/* harmony import */ var _ABN76PSX_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ABN76PSX.js */ "./node_modules/@ariakit/react-core/esm/__chunks/ABN76PSX.js");
-/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
-"use client";
-
-
-
-// src/dialog/dialog-context.tsx
-
-var ctx = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createStoreContext)(
- [_ABN76PSX_js__WEBPACK_IMPORTED_MODULE_0__.DisclosureContextProvider],
- [_ABN76PSX_js__WEBPACK_IMPORTED_MODULE_0__.DisclosureScopedContextProvider]
-);
-var useDialogContext = ctx.useContext;
-var useDialogScopedContext = ctx.useScopedContext;
-var useDialogProviderContext = ctx.useProviderContext;
-var DialogContextProvider = ctx.ContextProvider;
-var DialogScopedContextProvider = ctx.ScopedContextProvider;
-var DialogHeadingContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.createContext)(void 0);
-var DialogDescriptionContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.createContext)(void 0);
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/VJQU3YUE.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/VJQU3YUE.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TagContextProvider: () => (/* binding */ TagContextProvider),
-/* harmony export */ TagRemoveIdContext: () => (/* binding */ TagRemoveIdContext),
-/* harmony export */ TagScopedContextProvider: () => (/* binding */ TagScopedContextProvider),
-/* harmony export */ TagValueContext: () => (/* binding */ TagValueContext),
-/* harmony export */ useTagContext: () => (/* binding */ useTagContext),
-/* harmony export */ useTagProviderContext: () => (/* binding */ useTagProviderContext),
-/* harmony export */ useTagScopedContext: () => (/* binding */ useTagScopedContext)
-/* harmony export */ });
-/* harmony import */ var _APTFW6PT_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./APTFW6PT.js */ "./node_modules/@ariakit/react-core/esm/__chunks/APTFW6PT.js");
-/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
-"use client";
-
-
-
-// src/tag/tag-context.tsx
-
-var TagValueContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.createContext)(null);
-var TagRemoveIdContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.createContext)(
- null
-);
-var ctx = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createStoreContext)(
- [_APTFW6PT_js__WEBPACK_IMPORTED_MODULE_0__.CompositeContextProvider],
- [_APTFW6PT_js__WEBPACK_IMPORTED_MODULE_0__.CompositeScopedContextProvider]
-);
-var useTagContext = ctx.useContext;
-var useTagScopedContext = ctx.useScopedContext;
-var useTagProviderContext = ctx.useProviderContext;
-var TagContextProvider = ctx.ContextProvider;
-var TagScopedContextProvider = ctx.ScopedContextProvider;
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ createElement: () => (/* binding */ createElement),
-/* harmony export */ createHook: () => (/* binding */ createHook),
-/* harmony export */ createStoreContext: () => (/* binding */ createStoreContext),
-/* harmony export */ forwardRef: () => (/* binding */ forwardRef2),
-/* harmony export */ memo: () => (/* binding */ memo2)
-/* harmony export */ });
-/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
-/* harmony import */ var _SK3NAZA3_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SK3NAZA3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/SK3NAZA3.js");
-/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "react");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-"use client";
-
-
-
-
-// src/utils/system.tsx
-
-
-function forwardRef2(render) {
- const Role = react__WEBPACK_IMPORTED_MODULE_3__.forwardRef((props, ref) => render((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadValues)({}, props), { ref })));
- Role.displayName = render.displayName || render.name;
- return Role;
-}
-function memo2(Component, propsAreEqual) {
- return react__WEBPACK_IMPORTED_MODULE_3__.memo(Component, propsAreEqual);
-}
-function createElement(Type, props) {
- const _a = props, { wrapElement, render } = _a, rest = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__objRest)(_a, ["wrapElement", "render"]);
- const mergedRef = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_0__.useMergeRefs)(props.ref, (0,_SK3NAZA3_js__WEBPACK_IMPORTED_MODULE_1__.getRefProperty)(render));
- let element;
- if (react__WEBPACK_IMPORTED_MODULE_3__.isValidElement(render)) {
- const renderProps = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadValues)({}, render.props), { ref: mergedRef });
- element = react__WEBPACK_IMPORTED_MODULE_3__.cloneElement(render, (0,_SK3NAZA3_js__WEBPACK_IMPORTED_MODULE_1__.mergeProps)(rest, renderProps));
- } else if (render) {
- element = render(rest);
- } else {
- element = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Type, (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadValues)({}, rest));
- }
- if (wrapElement) {
- return wrapElement(element);
- }
- return element;
-}
-function createHook(useProps) {
- const useRole = (props = {}) => {
- return useProps(props);
- };
- useRole.displayName = useProps.name;
- return useRole;
-}
-function createStoreContext(providers = [], scopedProviders = []) {
- const context = react__WEBPACK_IMPORTED_MODULE_3__.createContext(void 0);
- const scopedContext = react__WEBPACK_IMPORTED_MODULE_3__.createContext(void 0);
- const useContext2 = () => react__WEBPACK_IMPORTED_MODULE_3__.useContext(context);
- const useScopedContext = (onlyScoped = false) => {
- const scoped = react__WEBPACK_IMPORTED_MODULE_3__.useContext(scopedContext);
- const store = useContext2();
- if (onlyScoped) return scoped;
- return scoped || store;
- };
- const useProviderContext = () => {
- const scoped = react__WEBPACK_IMPORTED_MODULE_3__.useContext(scopedContext);
- const store = useContext2();
- if (scoped && scoped === store) return;
- return store;
- };
- const ContextProvider = (props) => {
- return providers.reduceRight(
- (children, Provider) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Provider, (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadValues)({}, props), { children })),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(context.Provider, (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadValues)({}, props))
- );
- };
- const ScopedContextProvider = (props) => {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ContextProvider, (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadValues)({}, props), { children: scopedProviders.reduceRight(
- (children, Provider) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Provider, (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadValues)({}, props), { children })),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(scopedContext.Provider, (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadValues)({}, props))
- ) }));
- };
- return {
- context,
- scopedContext,
- useContext: useContext2,
- useScopedContext,
- useProviderContext,
- ContextProvider,
- ScopedContextProvider
- };
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/Y2U4BRIM.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/Y2U4BRIM.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ useDialogStore: () => (/* binding */ useDialogStore),
-/* harmony export */ useDialogStoreProps: () => (/* binding */ useDialogStoreProps)
-/* harmony export */ });
-/* harmony import */ var _T22PY7TE_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./T22PY7TE.js */ "./node_modules/@ariakit/react-core/esm/__chunks/T22PY7TE.js");
-/* harmony import */ var _RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RTNCFSKZ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/RTNCFSKZ.js");
-/* harmony import */ var _ariakit_core_dialog_dialog_store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ariakit/core/dialog/dialog-store */ "./node_modules/@ariakit/core/esm/__chunks/RZDDWCDV.js");
-"use client";
-
-
-
-// src/dialog/dialog-store.ts
-
-function useDialogStoreProps(store, update, props) {
- return (0,_T22PY7TE_js__WEBPACK_IMPORTED_MODULE_0__.useDisclosureStoreProps)(store, update, props);
-}
-function useDialogStore(props = {}) {
- const [store, update] = (0,_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStore)(_ariakit_core_dialog_dialog_store__WEBPACK_IMPORTED_MODULE_2__.createDialogStore, props);
- return useDialogStoreProps(store, update, props);
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/Y62RTBST.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/Y62RTBST.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ CollectionItem: () => (/* binding */ CollectionItem),
-/* harmony export */ useCollectionItem: () => (/* binding */ useCollectionItem)
-/* harmony export */ });
-/* harmony import */ var _5CPL3B7G_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./5CPL3B7G.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5CPL3B7G.js");
-/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
-/* harmony import */ var _5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
-/* harmony import */ var _3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
-/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "react");
-"use client";
-
-
-
-
-
-// src/collection/collection-item.tsx
-
-
-var TagName = "div";
-var useCollectionItem = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createHook)(
- function useCollectionItem2(_a) {
- var _b = _a, {
- store,
- shouldRegisterItem = true,
- getItem = _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_4__.identity,
- element: element
- } = _b, props = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__objRest)(_b, [
- "store",
- "shouldRegisterItem",
- "getItem",
- // @ts-expect-error This prop may come from a collection renderer.
- "element"
- ]);
- const context = (0,_5CPL3B7G_js__WEBPACK_IMPORTED_MODULE_0__.useCollectionContext)();
- store = store || context;
- const id = (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useId)(props.id);
- const ref = (0,react__WEBPACK_IMPORTED_MODULE_5__.useRef)(element);
- (0,react__WEBPACK_IMPORTED_MODULE_5__.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 = (0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadProps)((0,_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)({}, props), {
- ref: (0,_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_2__.useMergeRefs)(ref, props.ref)
- });
- return (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_4__.removeUndefinedValues)(props);
- }
-);
-var CollectionItem = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function CollectionItem2(props) {
- const htmlProps = useCollectionItem(props);
- return (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createElement)(TagName, htmlProps);
-});
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/__chunks/Y67KZUMI.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/__chunks/Y67KZUMI.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ PopoverContextProvider: () => (/* binding */ PopoverContextProvider),
-/* harmony export */ PopoverScopedContextProvider: () => (/* binding */ PopoverScopedContextProvider),
-/* harmony export */ usePopoverContext: () => (/* binding */ usePopoverContext),
-/* harmony export */ usePopoverProviderContext: () => (/* binding */ usePopoverProviderContext),
-/* harmony export */ usePopoverScopedContext: () => (/* binding */ usePopoverScopedContext)
-/* harmony export */ });
-/* harmony import */ var _T2AZQXQU_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./T2AZQXQU.js */ "./node_modules/@ariakit/react-core/esm/__chunks/T2AZQXQU.js");
-/* harmony import */ var _VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
-"use client";
-
-
-
-// src/popover/popover-context.tsx
-var ctx = (0,_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createStoreContext)(
- [_T2AZQXQU_js__WEBPACK_IMPORTED_MODULE_0__.DialogContextProvider],
- [_T2AZQXQU_js__WEBPACK_IMPORTED_MODULE_0__.DialogScopedContextProvider]
-);
-var usePopoverContext = ctx.useContext;
-var usePopoverScopedContext = ctx.useScopedContext;
-var usePopoverProviderContext = ctx.useProviderContext;
-var PopoverContextProvider = ctx.ContextProvider;
-var PopoverScopedContextProvider = ctx.ScopedContextProvider;
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/combobox/combobox-item-value.js":
-/*!******************************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/combobox/combobox-item-value.js ***!
- \******************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ ComboboxItemValue: () => (/* binding */ ComboboxItemValue),
-/* harmony export */ useComboboxItemValue: () => (/* binding */ useComboboxItemValue)
-/* harmony export */ });
-/* harmony import */ var _chunks_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../__chunks/OLVWQA7U.js */ "./node_modules/@ariakit/react-core/esm/__chunks/OLVWQA7U.js");
-/* harmony import */ var _chunks_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../__chunks/RTNCFSKZ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/RTNCFSKZ.js");
-/* harmony import */ var _chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../__chunks/VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
-/* harmony import */ var _chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../__chunks/3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
-/* harmony import */ var _ariakit_core_utils_array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ariakit/core/utils/array */ "./node_modules/@ariakit/core/esm/__chunks/7PRQYBBV.js");
-/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react */ "react");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-"use client";
-
-
-
-
-
-
-
-
-
-
-
-
-// src/combobox/combobox-item-value.tsx
-
-
-
-
-var TagName = "span";
-function normalizeValue(value) {
- return (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_5__.normalizeString)(value).toLowerCase();
-}
-function getOffsets(string, values) {
- const offsets = [];
- for (const value of values) {
- let pos = 0;
- const length = value.length;
- while (string.indexOf(value, pos) !== -1) {
- const index = string.indexOf(value, pos);
- if (index !== -1) {
- offsets.push([index, length]);
- }
- pos = index + 1;
- }
- }
- return offsets;
-}
-function filterOverlappingOffsets(offsets) {
- return offsets.filter(([offset, length], i, arr) => {
- return !arr.some(
- ([o, l], j) => j !== i && o <= offset && o + l >= offset + length
- );
- });
-}
-function sortOffsets(offsets) {
- return offsets.sort(([a], [b]) => a - b);
-}
-function splitValue(itemValue, userValue) {
- if (!itemValue) return itemValue;
- if (!userValue) return itemValue;
- const userValues = (0,_ariakit_core_utils_array__WEBPACK_IMPORTED_MODULE_4__.toArray)(userValue).filter(Boolean).map(normalizeValue);
- const parts = [];
- const span = (value, autocomplete = false) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
- "span",
- {
- "data-autocomplete-value": autocomplete ? "" : void 0,
- "data-user-value": autocomplete ? void 0 : "",
- children: value
- },
- parts.length
- );
- const offsets = sortOffsets(
- filterOverlappingOffsets(
- // Convert userValues into a set to avoid duplicates
- getOffsets(normalizeValue(itemValue), new Set(userValues))
- )
- );
- if (!offsets.length) {
- parts.push(span(itemValue, true));
- return parts;
- }
- const [firstOffset] = offsets[0];
- const values = [
- itemValue.slice(0, firstOffset),
- ...offsets.flatMap(([offset, length], i) => {
- var _a;
- const value = itemValue.slice(offset, offset + length);
- const nextOffset = (_a = offsets[i + 1]) == null ? void 0 : _a[0];
- const nextValue = itemValue.slice(offset + length, nextOffset);
- return [value, nextValue];
- })
- ];
- values.forEach((value, i) => {
- if (!value) return;
- parts.push(span(value, i % 2 === 0));
- });
- return parts;
-}
-var useComboboxItemValue = (0,_chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_2__.createHook)(function useComboboxItemValue2(_a) {
- var _b = _a, { store, value, userValue } = _b, props = (0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__objRest)(_b, ["store", "value", "userValue"]);
- const context = (0,_chunks_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_0__.useComboboxScopedContext)();
- store = store || context;
- const itemContext = (0,react__WEBPACK_IMPORTED_MODULE_6__.useContext)(_chunks_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_0__.ComboboxItemValueContext);
- const itemValue = value != null ? value : itemContext;
- const inputValue = (0,_chunks_RTNCFSKZ_js__WEBPACK_IMPORTED_MODULE_1__.useStoreState)(store, (state) => userValue != null ? userValue : state == null ? void 0 : state.value);
- const children = (0,react__WEBPACK_IMPORTED_MODULE_6__.useMemo)(() => {
- if (!itemValue) return;
- if (!inputValue) return itemValue;
- return splitValue(itemValue, inputValue);
- }, [itemValue, inputValue]);
- props = (0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_3__.__spreadValues)({
- children
- }, props);
- return (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_5__.removeUndefinedValues)(props);
-});
-var ComboboxItemValue = (0,_chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(function ComboboxItemValue2(props) {
- const htmlProps = useComboboxItemValue(props);
- return (0,_chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_2__.createElement)(TagName, htmlProps);
-});
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/combobox/combobox-label.js":
-/*!*************************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/combobox/combobox-label.js ***!
- \*************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ ComboboxLabel: () => (/* binding */ ComboboxLabel),
-/* harmony export */ useComboboxLabel: () => (/* binding */ useComboboxLabel)
-/* harmony export */ });
-/* harmony import */ var _chunks_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../__chunks/OLVWQA7U.js */ "./node_modules/@ariakit/react-core/esm/__chunks/OLVWQA7U.js");
-/* harmony import */ var _chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../__chunks/VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
-/* harmony import */ var _chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../__chunks/3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
-/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
-"use client";
-
-
-
-
-
-
-
-
-
-
-
-// src/combobox/combobox-label.tsx
-
-var TagName = "label";
-var useComboboxLabel = (0,_chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createHook)(
- function useComboboxLabel2(_a) {
- var _b = _a, { store } = _b, props = (0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__objRest)(_b, ["store"]);
- const context = (0,_chunks_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_0__.useComboboxProviderContext)();
- store = store || context;
- (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_3__.invariant)(
- store,
- true && "ComboboxLabel must receive a `store` prop or be wrapped in a ComboboxProvider component."
- );
- const comboboxId = store.useState((state) => {
- var _a2;
- return (_a2 = state.baseElement) == null ? void 0 : _a2.id;
- });
- props = (0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_2__.__spreadValues)({
- htmlFor: comboboxId
- }, props);
- return (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_3__.removeUndefinedValues)(props);
- }
-);
-var ComboboxLabel = (0,_chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.memo)(
- (0,_chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function ComboboxLabel2(props) {
- const htmlProps = useComboboxLabel(props);
- return (0,_chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_1__.createElement)(TagName, htmlProps);
- })
-);
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/combobox/combobox-provider.js":
-/*!****************************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/combobox/combobox-provider.js ***!
- \****************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ ComboboxProvider: () => (/* binding */ ComboboxProvider)
-/* harmony export */ });
-/* harmony import */ var _chunks_HI6DYBVE_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../__chunks/HI6DYBVE.js */ "./node_modules/@ariakit/react-core/esm/__chunks/HI6DYBVE.js");
-/* harmony import */ var _chunks_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../__chunks/OLVWQA7U.js */ "./node_modules/@ariakit/react-core/esm/__chunks/OLVWQA7U.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-"use client";
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// src/combobox/combobox-provider.tsx
-
-function ComboboxProvider(props = {}) {
- const store = (0,_chunks_HI6DYBVE_js__WEBPACK_IMPORTED_MODULE_0__.useComboboxStore)(props);
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_chunks_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_1__.ComboboxContextProvider, { value: store, children: props.children });
-}
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@ariakit/react-core/esm/combobox/combobox.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@ariakit/react-core/esm/combobox/combobox.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ Combobox: () => (/* binding */ Combobox),
-/* harmony export */ useCombobox: () => (/* binding */ useCombobox)
-/* harmony export */ });
-/* harmony import */ var _chunks_NSTBQJLB_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../__chunks/NSTBQJLB.js */ "./node_modules/@ariakit/react-core/esm/__chunks/NSTBQJLB.js");
-/* harmony import */ var _chunks_HMCFFQCB_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../__chunks/HMCFFQCB.js */ "./node_modules/@ariakit/react-core/esm/__chunks/HMCFFQCB.js");
-/* harmony import */ var _chunks_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../__chunks/OLVWQA7U.js */ "./node_modules/@ariakit/react-core/esm/__chunks/OLVWQA7U.js");
-/* harmony import */ var _chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../__chunks/VOQWLFSQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/VOQWLFSQ.js");
-/* harmony import */ var _chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../__chunks/5GGHRIN3.js */ "./node_modules/@ariakit/react-core/esm/__chunks/5GGHRIN3.js");
-/* harmony import */ var _chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../__chunks/3YLGPPWQ.js */ "./node_modules/@ariakit/react-core/esm/__chunks/3YLGPPWQ.js");
-/* harmony import */ var _ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ariakit/core/utils/dom */ "./node_modules/@ariakit/core/esm/__chunks/37JWRFYW.js");
-/* harmony import */ var _ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ariakit/core/utils/events */ "./node_modules/@ariakit/core/esm/utils/events.js");
-/* harmony import */ var _ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ariakit/core/utils/focus */ "./node_modules/@ariakit/core/esm/utils/focus.js");
-/* harmony import */ var _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ariakit/core/utils/misc */ "./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js");
-/* harmony import */ var _ariakit_core_utils_store__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ariakit/core/utils/store */ "./node_modules/@ariakit/core/esm/__chunks/EWA2WL6G.js");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react */ "react");
-"use client";
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// src/combobox/combobox.tsx
-
-
-
-
-
-
-var TagName = "input";
-function isFirstItemAutoSelected(items, activeValue, autoSelect) {
- if (!autoSelect) return false;
- const firstItem = items.find((item) => !item.disabled && item.value);
- return (firstItem == null ? void 0 : firstItem.value) === activeValue;
-}
-function hasCompletionString(value, activeValue) {
- if (!activeValue) return false;
- if (value == null) return false;
- value = (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_9__.normalizeString)(value);
- return activeValue.length > value.length && activeValue.toLowerCase().indexOf(value.toLowerCase()) === 0;
-}
-function isInputEvent(event) {
- return event.type === "input";
-}
-function isAriaAutoCompleteValue(value) {
- return value === "inline" || value === "list" || value === "both" || value === "none";
-}
-function getDefaultAutoSelectId(items) {
- const item = items.find((item2) => {
- var _a;
- if (item2.disabled) return false;
- return ((_a = item2.element) == null ? void 0 : _a.getAttribute("role")) !== "tab";
- });
- return item == null ? void 0 : item.id;
-}
-var useCombobox = (0,_chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__.createHook)(
- function useCombobox2(_a) {
- var _b = _a, {
- store,
- focusable = true,
- autoSelect: autoSelectProp = false,
- getAutoSelectId,
- setValueOnChange,
- showMinLength = 0,
- showOnChange,
- showOnMouseDown,
- showOnClick = showOnMouseDown,
- showOnKeyDown,
- showOnKeyPress = showOnKeyDown,
- blurActiveItemOnClick,
- setValueOnClick = true,
- moveOnKeyPress = true,
- autoComplete = "list"
- } = _b, props = (0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__objRest)(_b, [
- "store",
- "focusable",
- "autoSelect",
- "getAutoSelectId",
- "setValueOnChange",
- "showMinLength",
- "showOnChange",
- "showOnMouseDown",
- "showOnClick",
- "showOnKeyDown",
- "showOnKeyPress",
- "blurActiveItemOnClick",
- "setValueOnClick",
- "moveOnKeyPress",
- "autoComplete"
- ]);
- const context = (0,_chunks_OLVWQA7U_js__WEBPACK_IMPORTED_MODULE_2__.useComboboxProviderContext)();
- store = store || context;
- (0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_9__.invariant)(
- store,
- true && "Combobox must receive a `store` prop or be wrapped in a ComboboxProvider component."
- );
- const ref = (0,react__WEBPACK_IMPORTED_MODULE_11__.useRef)(null);
- const [valueUpdated, forceValueUpdate] = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useForceUpdate)();
- const canAutoSelectRef = (0,react__WEBPACK_IMPORTED_MODULE_11__.useRef)(false);
- const composingRef = (0,react__WEBPACK_IMPORTED_MODULE_11__.useRef)(false);
- const autoSelect = store.useState(
- (state) => state.virtualFocus && autoSelectProp
- );
- const inline = autoComplete === "inline" || autoComplete === "both";
- const [canInline, setCanInline] = (0,react__WEBPACK_IMPORTED_MODULE_11__.useState)(inline);
- (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useUpdateLayoutEffect)(() => {
- if (!inline) return;
- setCanInline(true);
- }, [inline]);
- const storeValue = store.useState("value");
- const prevSelectedValueRef = (0,react__WEBPACK_IMPORTED_MODULE_11__.useRef)();
- (0,react__WEBPACK_IMPORTED_MODULE_11__.useEffect)(() => {
- return (0,_ariakit_core_utils_store__WEBPACK_IMPORTED_MODULE_10__.sync)(store, ["selectedValue", "activeId"], (_, prev) => {
- prevSelectedValueRef.current = prev.selectedValue;
- });
- }, []);
- const inlineActiveValue = store.useState((state) => {
- var _a2;
- if (!inline) return;
- if (!canInline) return;
- if (state.activeValue && Array.isArray(state.selectedValue)) {
- if (state.selectedValue.includes(state.activeValue)) return;
- if ((_a2 = prevSelectedValueRef.current) == null ? void 0 : _a2.includes(state.activeValue)) return;
- }
- return state.activeValue;
- });
- const items = store.useState("renderedItems");
- const open = store.useState("open");
- const contentElement = store.useState("contentElement");
- const value = (0,react__WEBPACK_IMPORTED_MODULE_11__.useMemo)(() => {
- if (!inline) return storeValue;
- if (!canInline) return storeValue;
- const firstItemAutoSelected = isFirstItemAutoSelected(
- items,
- inlineActiveValue,
- autoSelect
- );
- if (firstItemAutoSelected) {
- if (hasCompletionString(storeValue, inlineActiveValue)) {
- const slice = (inlineActiveValue == null ? void 0 : inlineActiveValue.slice(storeValue.length)) || "";
- return storeValue + slice;
- }
- return storeValue;
- }
- return inlineActiveValue || storeValue;
- }, [inline, canInline, items, inlineActiveValue, autoSelect, storeValue]);
- (0,react__WEBPACK_IMPORTED_MODULE_11__.useEffect)(() => {
- const element = ref.current;
- if (!element) return;
- const onCompositeItemMove = () => setCanInline(true);
- element.addEventListener("combobox-item-move", onCompositeItemMove);
- return () => {
- element.removeEventListener("combobox-item-move", onCompositeItemMove);
- };
- }, []);
- (0,react__WEBPACK_IMPORTED_MODULE_11__.useEffect)(() => {
- if (!inline) return;
- if (!canInline) return;
- if (!inlineActiveValue) return;
- const firstItemAutoSelected = isFirstItemAutoSelected(
- items,
- inlineActiveValue,
- autoSelect
- );
- if (!firstItemAutoSelected) return;
- if (!hasCompletionString(storeValue, inlineActiveValue)) return;
- let cleanup = _ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_9__.noop;
- queueMicrotask(() => {
- const element = ref.current;
- if (!element) return;
- const { start: prevStart, end: prevEnd } = (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_6__.getTextboxSelection)(element);
- const nextStart = storeValue.length;
- const nextEnd = inlineActiveValue.length;
- (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_6__.setSelectionRange)(element, nextStart, nextEnd);
- cleanup = () => {
- if (!(0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_8__.hasFocus)(element)) return;
- const { start, end } = (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_6__.getTextboxSelection)(element);
- if (start !== nextStart) return;
- if (end !== nextEnd) return;
- (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_6__.setSelectionRange)(element, prevStart, prevEnd);
- };
- });
- return () => cleanup();
- }, [
- valueUpdated,
- inline,
- canInline,
- inlineActiveValue,
- items,
- autoSelect,
- storeValue
- ]);
- const scrollingElementRef = (0,react__WEBPACK_IMPORTED_MODULE_11__.useRef)(null);
- const getAutoSelectIdProp = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useEvent)(getAutoSelectId);
- const autoSelectIdRef = (0,react__WEBPACK_IMPORTED_MODULE_11__.useRef)(null);
- (0,react__WEBPACK_IMPORTED_MODULE_11__.useEffect)(() => {
- if (!open) return;
- if (!contentElement) return;
- const scrollingElement = (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_6__.getScrollingElement)(contentElement);
- if (!scrollingElement) return;
- scrollingElementRef.current = scrollingElement;
- const onUserScroll = () => {
- canAutoSelectRef.current = false;
- };
- const onScroll = () => {
- if (!store) return;
- if (!canAutoSelectRef.current) return;
- const { activeId } = store.getState();
- if (activeId === null) return;
- if (activeId === autoSelectIdRef.current) return;
- canAutoSelectRef.current = false;
- };
- const options = { passive: true, capture: true };
- scrollingElement.addEventListener("wheel", onUserScroll, options);
- scrollingElement.addEventListener("touchmove", onUserScroll, options);
- scrollingElement.addEventListener("scroll", onScroll, options);
- return () => {
- scrollingElement.removeEventListener("wheel", onUserScroll, true);
- scrollingElement.removeEventListener("touchmove", onUserScroll, true);
- scrollingElement.removeEventListener("scroll", onScroll, true);
- };
- }, [open, contentElement, store]);
- (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useSafeLayoutEffect)(() => {
- if (!storeValue) return;
- if (composingRef.current) return;
- canAutoSelectRef.current = true;
- }, [storeValue]);
- (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useSafeLayoutEffect)(() => {
- if (autoSelect !== "always" && open) return;
- canAutoSelectRef.current = open;
- }, [autoSelect, open]);
- const resetValueOnSelect = store.useState("resetValueOnSelect");
- (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useUpdateEffect)(() => {
- var _a2, _b2;
- const canAutoSelect = canAutoSelectRef.current;
- if (!store) return;
- if (!open) return;
- if (!canAutoSelect && !resetValueOnSelect) return;
- const { baseElement, contentElement: contentElement2, activeId } = store.getState();
- if (baseElement && !(0,_ariakit_core_utils_focus__WEBPACK_IMPORTED_MODULE_8__.hasFocus)(baseElement)) return;
- if (contentElement2 == null ? void 0 : contentElement2.hasAttribute("data-placing")) {
- const observer = new MutationObserver(forceValueUpdate);
- observer.observe(contentElement2, { attributeFilter: ["data-placing"] });
- return () => observer.disconnect();
- }
- if (autoSelect && canAutoSelect) {
- const userAutoSelectId = getAutoSelectIdProp(items);
- const autoSelectId = userAutoSelectId !== void 0 ? userAutoSelectId : (_a2 = getDefaultAutoSelectId(items)) != null ? _a2 : store.first();
- autoSelectIdRef.current = autoSelectId;
- store.move(autoSelectId != null ? autoSelectId : null);
- } else {
- const element = (_b2 = store.item(activeId || store.first())) == null ? void 0 : _b2.element;
- if (element && "scrollIntoView" in element) {
- element.scrollIntoView({ block: "nearest", inline: "nearest" });
- }
- }
- return;
- }, [
- store,
- open,
- valueUpdated,
- storeValue,
- autoSelect,
- resetValueOnSelect,
- getAutoSelectIdProp,
- items
- ]);
- (0,react__WEBPACK_IMPORTED_MODULE_11__.useEffect)(() => {
- if (!inline) return;
- const combobox = ref.current;
- if (!combobox) return;
- const elements = [combobox, contentElement].filter(
- (value2) => !!value2
- );
- const onBlur2 = (event) => {
- if (elements.every((el) => (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_7__.isFocusEventOutside)(event, el))) {
- store == null ? void 0 : store.setValue(value);
- }
- };
- for (const element of elements) {
- element.addEventListener("focusout", onBlur2);
- }
- return () => {
- for (const element of elements) {
- element.removeEventListener("focusout", onBlur2);
- }
- };
- }, [inline, contentElement, store, value]);
- const canShow = (event) => {
- const currentTarget = event.currentTarget;
- return currentTarget.value.length >= showMinLength;
- };
- const onChangeProp = props.onChange;
- const showOnChangeProp = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useBooleanEvent)(showOnChange != null ? showOnChange : canShow);
- const setValueOnChangeProp = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useBooleanEvent)(
- // If the combobox is combined with tags, the value will be set by the tag
- // input component.
- setValueOnChange != null ? setValueOnChange : !store.tag
- );
- const onChange = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useEvent)((event) => {
- onChangeProp == null ? void 0 : onChangeProp(event);
- if (event.defaultPrevented) return;
- if (!store) return;
- const currentTarget = event.currentTarget;
- const { value: value2, selectionStart, selectionEnd } = currentTarget;
- const nativeEvent = event.nativeEvent;
- canAutoSelectRef.current = true;
- if (isInputEvent(nativeEvent)) {
- if (nativeEvent.isComposing) {
- canAutoSelectRef.current = false;
- composingRef.current = true;
- }
- if (inline) {
- const textInserted = nativeEvent.inputType === "insertText" || nativeEvent.inputType === "insertCompositionText";
- const caretAtEnd = selectionStart === value2.length;
- setCanInline(textInserted && caretAtEnd);
- }
- }
- if (setValueOnChangeProp(event)) {
- const isSameValue = value2 === store.getState().value;
- store.setValue(value2);
- queueMicrotask(() => {
- (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_6__.setSelectionRange)(currentTarget, selectionStart, selectionEnd);
- });
- if (inline && autoSelect && isSameValue) {
- forceValueUpdate();
- }
- }
- if (showOnChangeProp(event)) {
- store.show();
- }
- if (!autoSelect || !canAutoSelectRef.current) {
- store.setActiveId(null);
- }
- });
- const onCompositionEndProp = props.onCompositionEnd;
- const onCompositionEnd = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useEvent)((event) => {
- canAutoSelectRef.current = true;
- composingRef.current = false;
- onCompositionEndProp == null ? void 0 : onCompositionEndProp(event);
- if (event.defaultPrevented) return;
- if (!autoSelect) return;
- forceValueUpdate();
- });
- const onMouseDownProp = props.onMouseDown;
- const blurActiveItemOnClickProp = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useBooleanEvent)(
- blurActiveItemOnClick != null ? blurActiveItemOnClick : () => !!(store == null ? void 0 : store.getState().includesBaseElement)
- );
- const setValueOnClickProp = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useBooleanEvent)(setValueOnClick);
- const showOnClickProp = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useBooleanEvent)(showOnClick != null ? showOnClick : canShow);
- const onMouseDown = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useEvent)((event) => {
- onMouseDownProp == null ? void 0 : onMouseDownProp(event);
- if (event.defaultPrevented) return;
- if (event.button) return;
- if (event.ctrlKey) return;
- if (!store) return;
- if (blurActiveItemOnClickProp(event)) {
- store.setActiveId(null);
- }
- if (setValueOnClickProp(event)) {
- store.setValue(value);
- }
- if (showOnClickProp(event)) {
- (0,_ariakit_core_utils_events__WEBPACK_IMPORTED_MODULE_7__.queueBeforeEvent)(event.currentTarget, "mouseup", store.show);
- }
- });
- const onKeyDownProp = props.onKeyDown;
- const showOnKeyPressProp = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useBooleanEvent)(showOnKeyPress != null ? showOnKeyPress : canShow);
- const onKeyDown = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useEvent)((event) => {
- onKeyDownProp == null ? void 0 : onKeyDownProp(event);
- if (!event.repeat) {
- canAutoSelectRef.current = false;
- }
- if (event.defaultPrevented) return;
- if (event.ctrlKey) return;
- if (event.altKey) return;
- if (event.shiftKey) return;
- if (event.metaKey) return;
- if (!store) return;
- const { open: open2 } = store.getState();
- if (open2) return;
- if (event.key === "ArrowUp" || event.key === "ArrowDown") {
- if (showOnKeyPressProp(event)) {
- event.preventDefault();
- store.show();
- }
- }
- });
- const onBlurProp = props.onBlur;
- const onBlur = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useEvent)((event) => {
- canAutoSelectRef.current = false;
- onBlurProp == null ? void 0 : onBlurProp(event);
- if (event.defaultPrevented) return;
- });
- const id = (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useId)(props.id);
- const ariaAutoComplete = isAriaAutoCompleteValue(autoComplete) ? autoComplete : void 0;
- const isActiveItem = store.useState((state) => state.activeId === null);
- props = (0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadProps)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({
- id,
- role: "combobox",
- "aria-autocomplete": ariaAutoComplete,
- "aria-haspopup": (0,_ariakit_core_utils_dom__WEBPACK_IMPORTED_MODULE_6__.getPopupRole)(contentElement, "listbox"),
- "aria-expanded": open,
- "aria-controls": contentElement == null ? void 0 : contentElement.id,
- "data-active-item": isActiveItem || void 0,
- value
- }, props), {
- ref: (0,_chunks_5GGHRIN3_js__WEBPACK_IMPORTED_MODULE_4__.useMergeRefs)(ref, props.ref),
- onChange,
- onCompositionEnd,
- onMouseDown,
- onKeyDown,
- onBlur
- });
- props = (0,_chunks_NSTBQJLB_js__WEBPACK_IMPORTED_MODULE_0__.useComposite)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadProps)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({
- store,
- focusable
- }, props), {
- // Enable inline autocomplete when the user moves from the combobox input
- // to an item.
- moveOnKeyPress: (event) => {
- if ((0,_ariakit_core_utils_misc__WEBPACK_IMPORTED_MODULE_9__.isFalsyBooleanCallback)(moveOnKeyPress, event)) return false;
- if (inline) setCanInline(true);
- return true;
- }
- }));
- props = (0,_chunks_HMCFFQCB_js__WEBPACK_IMPORTED_MODULE_1__.usePopoverAnchor)((0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({ store }, props));
- return (0,_chunks_3YLGPPWQ_js__WEBPACK_IMPORTED_MODULE_5__.__spreadValues)({ autoComplete: "off" }, props);
- }
-);
-var Combobox = (0,_chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__.forwardRef)(function Combobox2(props) {
- const htmlProps = useCombobox(props);
- return (0,_chunks_VOQWLFSQ_js__WEBPACK_IMPORTED_MODULE_3__.createElement)(TagName, htmlProps);
-});
-
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-bulk-actions/index.js":
-/*!***************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-bulk-actions/index.js ***!
- \***************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ BulkActionsFooter: () => (/* binding */ BulkActionsFooter),
-/* harmony export */ BulkSelectionCheckbox: () => (/* binding */ BulkSelectionCheckbox),
-/* harmony export */ useHasAPossibleBulkAction: () => (/* binding */ useHasAPossibleBulkAction),
-/* harmony export */ useSomeItemHasAPossibleBulkAction: () => (/* binding */ useSomeItemHasAPossibleBulkAction)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/close-small.js");
-/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
-/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__);
-/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
-/* harmony import */ var _dataviews_item_actions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../dataviews-item-actions */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-item-actions/index.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__);
-// packages/dataviews/src/components/dataviews-bulk-actions/index.tsx
-
-
-
-
-
-
-
-
-
-function ActionWithModal({
- action,
- items,
- ActionTriggerComponent
-}) {
- const [isModalOpen, setIsModalOpen] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
- const actionTriggerProps = {
- action,
- onClick: () => {
- setIsModalOpen(true);
- },
- items
- };
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.Fragment, { children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(ActionTriggerComponent, { ...actionTriggerProps }),
- isModalOpen && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(
- _dataviews_item_actions__WEBPACK_IMPORTED_MODULE_7__.ActionModal,
- {
- action,
- items,
- closeModal: () => setIsModalOpen(false)
- }
- )
- ] });
-}
-function useHasAPossibleBulkAction(actions, item) {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
- return actions.some((action) => {
- return action.supportsBulk && (!action.isEligible || action.isEligible(item));
- });
- }, [actions, item]);
-}
-function useSomeItemHasAPossibleBulkAction(actions, data) {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
- return data.some((item) => {
- return actions.some((action) => {
- return action.supportsBulk && (!action.isEligible || action.isEligible(item));
- });
- });
- }, [actions, data]);
-}
-function BulkSelectionCheckbox({
- selection,
- onChangeSelection,
- data,
- actions,
- getItemId
-}) {
- const selectableItems = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
- return data.filter((item) => {
- return actions.some(
- (action) => action.supportsBulk && (!action.isEligible || action.isEligible(item))
- );
- });
- }, [data, actions]);
- const selectedItems = data.filter(
- (item) => selection.includes(getItemId(item)) && selectableItems.includes(item)
- );
- const areAllSelected = selectedItems.length === selectableItems.length;
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.CheckboxControl,
- {
- className: "dataviews-view-table-selection-checkbox",
- __nextHasNoMarginBottom: true,
- checked: areAllSelected,
- indeterminate: !areAllSelected && !!selectedItems.length,
- onChange: () => {
- if (areAllSelected) {
- onChangeSelection([]);
- } else {
- onChangeSelection(
- selectableItems.map((item) => getItemId(item))
- );
- }
- },
- "aria-label": areAllSelected ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Deselect all") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Select all")
- }
- );
-}
-function ActionTrigger({
- action,
- onClick,
- isBusy,
- items
-}) {
- const label = typeof action.label === "string" ? action.label : action.label(items);
- const isMobile = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__.useViewportMatch)("medium", "<");
- if (isMobile) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
- {
- disabled: isBusy,
- accessibleWhenDisabled: true,
- label,
- icon: action.icon,
- size: "compact",
- onClick,
- isBusy
- }
- );
- }
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
- {
- disabled: isBusy,
- accessibleWhenDisabled: true,
- size: "compact",
- onClick,
- isBusy,
- children: label
- }
- );
-}
-var EMPTY_ARRAY = [];
-function ActionButton({
- action,
- selectedItems,
- actionInProgress,
- setActionInProgress
-}) {
- const registry = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useRegistry)();
- const selectedEligibleItems = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
- return selectedItems.filter((item) => {
- return !action.isEligible || action.isEligible(item);
- });
- }, [action, selectedItems]);
- if ("RenderModal" in action) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(
- ActionWithModal,
- {
- action,
- items: selectedEligibleItems,
- ActionTriggerComponent: ActionTrigger
- },
- action.id
- );
- }
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(
- ActionTrigger,
- {
- action,
- onClick: async () => {
- setActionInProgress(action.id);
- await action.callback(selectedItems, {
- registry
- });
- setActionInProgress(null);
- },
- items: selectedEligibleItems,
- isBusy: actionInProgress === action.id
- },
- action.id
- );
-}
-function renderFooterContent(data, actions, getItemId, selection, actionsToShow, selectedItems, actionInProgress, setActionInProgress, onChangeSelection) {
- const message = selectedItems.length > 0 ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(
- /* translators: %d: number of items. */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._n)(
- "%d Item selected",
- "%d Items selected",
- selectedItems.length
- ),
- selectedItems.length
- ) : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(
- /* translators: %d: number of items. */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._n)("%d Item", "%d Items", data.length),
- data.length
- );
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack,
- {
- expanded: false,
- className: "dataviews-bulk-actions-footer__container",
- spacing: 3,
- children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(
- BulkSelectionCheckbox,
- {
- selection,
- onChangeSelection,
- data,
- actions,
- getItemId
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("span", { className: "dataviews-bulk-actions-footer__item-count", children: message }),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack,
- {
- className: "dataviews-bulk-actions-footer__action-buttons",
- expanded: false,
- spacing: 1,
- children: [
- actionsToShow.map((action) => {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(
- ActionButton,
- {
- action,
- selectedItems,
- actionInProgress,
- setActionInProgress
- },
- action.id
- );
- }),
- selectedItems.length > 0 && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
- {
- icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__["default"],
- showTooltip: true,
- tooltipPosition: "top",
- size: "compact",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Cancel"),
- disabled: !!actionInProgress,
- accessibleWhenDisabled: false,
- onClick: () => {
- onChangeSelection(EMPTY_ARRAY);
- }
- }
- )
- ]
- }
- )
- ]
- }
- );
-}
-function FooterContent({
- selection,
- actions,
- onChangeSelection,
- data,
- getItemId
-}) {
- const [actionInProgress, setActionInProgress] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(
- null
- );
- const footerContentRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);
- const isMobile = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__.useViewportMatch)("medium", "<");
- const bulkActions = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(
- () => actions.filter((action) => action.supportsBulk),
- [actions]
- );
- const selectableItems = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
- return data.filter((item) => {
- return bulkActions.some(
- (action) => !action.isEligible || action.isEligible(item)
- );
- });
- }, [data, bulkActions]);
- const selectedItems = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
- return data.filter(
- (item) => selection.includes(getItemId(item)) && selectableItems.includes(item)
- );
- }, [selection, data, getItemId, selectableItems]);
- const actionsToShow = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(
- () => actions.filter((action) => {
- return action.supportsBulk && (!isMobile || action.icon) && selectedItems.some(
- (item) => !action.isEligible || action.isEligible(item)
- );
- }),
- [actions, selectedItems, isMobile]
- );
- if (!actionInProgress) {
- if (footerContentRef.current) {
- footerContentRef.current = null;
- }
- return renderFooterContent(
- data,
- actions,
- getItemId,
- selection,
- actionsToShow,
- selectedItems,
- actionInProgress,
- setActionInProgress,
- onChangeSelection
- );
- } else if (!footerContentRef.current) {
- footerContentRef.current = renderFooterContent(
- data,
- actions,
- getItemId,
- selection,
- actionsToShow,
- selectedItems,
- actionInProgress,
- setActionInProgress,
- onChangeSelection
- );
- }
- return footerContentRef.current;
-}
-function BulkActionsFooter() {
- const {
- data,
- selection,
- actions = EMPTY_ARRAY,
- onChangeSelection,
- getItemId
- } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_6__["default"]);
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(
- FooterContent,
- {
- selection,
- onChangeSelection,
- data,
- actions,
- getItemId
- }
- );
-}
-
-//# sourceMappingURL=index.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js":
-/*!**********************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js ***!
- \**********************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ dataviews_context_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-// packages/dataviews/src/components/dataviews-context/index.ts
-
-
-var DataViewsContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createContext)({
- view: { type: _constants__WEBPACK_IMPORTED_MODULE_1__.LAYOUT_TABLE },
- onChangeView: () => {
- },
- fields: [],
- data: [],
- paginationInfo: {
- totalItems: 0,
- totalPages: 0
- },
- selection: [],
- onChangeSelection: () => {
- },
- setOpenedFilter: () => {
- },
- openedFilter: null,
- getItemId: (item) => item.id,
- isItemClickable: () => true,
- renderItemLink: void 0,
- containerWidth: 0,
- containerRef: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createRef)(),
- resizeObserverRef: () => {
- },
- defaultLayouts: { list: {}, grid: {}, table: {} },
- filters: [],
- isShowingFilter: false,
- setIsShowingFilter: () => {
- },
- hasInfiniteScrollHandler: false,
- config: {
- perPageSizes: []
- }
-});
-DataViewsContext.displayName = "DataViewsContext";
-var dataviews_context_default = DataViewsContext;
-
-//# sourceMappingURL=index.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/add-filter.js":
-/*!***************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/add-filter.js ***!
- \***************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ AddFilterMenu: () => (/* binding */ AddFilterMenu),
-/* harmony export */ "default": () => (/* binding */ add_filter_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
-// packages/dataviews/src/components/dataviews-filters/add-filter.tsx
-
-
-
-
-
-var { Menu } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_3__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.privateApis);
-function AddFilterMenu({
- filters,
- view,
- onChangeView,
- setOpenedFilter,
- triggerProps
-}) {
- const inactiveFilters = filters.filter((filter) => !filter.isVisible);
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(Menu, { children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Menu.TriggerButton, { ...triggerProps }),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Menu.Popover, { children: inactiveFilters.map((filter) => {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
- Menu.Item,
- {
- onClick: () => {
- setOpenedFilter(filter.field);
- onChangeView({
- ...view,
- page: 1,
- filters: [
- ...view.filters || [],
- {
- field: filter.field,
- value: void 0,
- operator: filter.operators[0]
- }
- ]
- });
- },
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Menu.ItemLabel, { children: filter.name })
- },
- filter.field
- );
- }) })
- ] });
-}
-function AddFilter({ filters, view, onChangeView, setOpenedFilter }, ref) {
- if (!filters.length || filters.every(({ isPrimary }) => isPrimary)) {
- return null;
- }
- const inactiveFilters = filters.filter((filter) => !filter.isVisible);
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
- AddFilterMenu,
- {
- triggerProps: {
- render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
- {
- accessibleWhenDisabled: true,
- size: "compact",
- className: "dataviews-filters-button",
- variant: "tertiary",
- disabled: !inactiveFilters.length,
- ref
- }
- ),
- children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Add filter")
- },
- ...{ filters, view, onChangeView, setOpenedFilter }
- }
- );
-}
-var add_filter_default = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(AddFilter);
-
-//# sourceMappingURL=add-filter.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filter.js":
-/*!***********************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filter.js ***!
- \***********************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Filter)
-/* harmony export */ });
-/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/close-small.js");
-/* harmony import */ var _search_widget__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./search-widget */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/search-widget.js");
-/* harmony import */ var _input_widget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./input-widget */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/input-widget.js");
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-/* harmony import */ var _hooks_use_elements__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../hooks/use-elements */ "./node_modules/@wordpress/dataviews/build-module/hooks/use-elements.js");
-/* harmony import */ var _field_types_utils_parse_date_time__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../field-types/utils/parse-date-time */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/parse-date-time.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__);
-// packages/dataviews/src/components/dataviews-filters/filter.tsx
-
-
-
-
-
-
-
-
-
-
-
-var ENTER = "Enter";
-var SPACE = " ";
-var FilterText = ({
- activeElements,
- filterInView,
- filter
-}) => {
- if (activeElements === void 0 || activeElements.length === 0) {
- return filter.name;
- }
- const filterTextWrappers = {
- Name: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", { className: "dataviews-filters__summary-filter-text-name" }),
- Value: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", { className: "dataviews-filters__summary-filter-text-value" })
- };
- if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_IS_ANY) {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- /* translators: 1: Filter name. 2: Filter value. e.g.: "Author is any: Admin, Editor". */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is any: %2$s"),
- filter.name,
- activeElements.map((element) => element.label).join(", ")
- ),
- filterTextWrappers
- );
- }
- if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_IS_NONE) {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- /* translators: 1: Filter name. 2: Filter value. e.g.: "Author is none: Admin, Editor". */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is none: %2$s"),
- filter.name,
- activeElements.map((element) => element.label).join(", ")
- ),
- filterTextWrappers
- );
- }
- if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_IS_ALL) {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- /* translators: 1: Filter name. 2: Filter value. e.g.: "Author is all: Admin, Editor". */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is all: %2$s"),
- filter.name,
- activeElements.map((element) => element.label).join(", ")
- ),
- filterTextWrappers
- );
- }
- if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_IS_NOT_ALL) {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- /* translators: 1: Filter name. 2: Filter value. e.g.: "Author is not all: Admin, Editor". */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is not all: %2$s"),
- filter.name,
- activeElements.map((element) => element.label).join(", ")
- ),
- filterTextWrappers
- );
- }
- if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_IS) {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- /* translators: 1: Filter name. 2: Filter value. e.g.: "Author is: Admin". */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is: %2$s"),
- filter.name,
- activeElements[0].label
- ),
- filterTextWrappers
- );
- }
- if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_IS_NOT) {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- /* translators: 1: Filter name. 2: Filter value. e.g.: "Author is not: Admin". */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is not: %2$s"),
- filter.name,
- activeElements[0].label
- ),
- filterTextWrappers
- );
- }
- if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_LESS_THAN) {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- /* translators: 1: Filter name. 2: Filter value. e.g.: "Price is less than: 10". */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is less than: %2$s"),
- filter.name,
- activeElements[0].label
- ),
- filterTextWrappers
- );
- }
- if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_GREATER_THAN) {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- /* translators: 1: Filter name. 2: Filter value. e.g.: "Price is greater than: 10". */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is greater than: %2$s"),
- filter.name,
- activeElements[0].label
- ),
- filterTextWrappers
- );
- }
- if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_LESS_THAN_OR_EQUAL) {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- /* translators: 1: Filter name. 2: Filter value. e.g.: "Price is less than or equal to: 10". */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)(
- "%1$s is less than or equal to: %2$s"
- ),
- filter.name,
- activeElements[0].label
- ),
- filterTextWrappers
- );
- }
- if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_GREATER_THAN_OR_EQUAL) {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- /* translators: 1: Filter name. 2: Filter value. e.g.: "Price is greater than or equal to: 10". */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)(
- "%1$s is greater than or equal to: %2$s"
- ),
- filter.name,
- activeElements[0].label
- ),
- filterTextWrappers
- );
- }
- if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_CONTAINS) {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- /* translators: 1: Filter name. 2: Filter value. e.g.: "Title contains: Mars". */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s contains: %2$s"),
- filter.name,
- activeElements[0].label
- ),
- filterTextWrappers
- );
- }
- if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_NOT_CONTAINS) {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- /* translators: 1: Filter name. 2: Filter value. e.g.: "Description doesn't contain: photo". */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s doesn't contain: %2$s"),
- filter.name,
- activeElements[0].label
- ),
- filterTextWrappers
- );
- }
- if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_STARTS_WITH) {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- /* translators: 1: Filter name. 2: Filter value. e.g.: "Title starts with: Mar". */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s starts with: %2$s"),
- filter.name,
- activeElements[0].label
- ),
- filterTextWrappers
- );
- }
- if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_BEFORE) {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- /* translators: 1: Filter name. 2: Filter value. e.g.: "Date is before: 2024-01-01". */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is before: %2$s"),
- filter.name,
- activeElements[0].label
- ),
- filterTextWrappers
- );
- }
- if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_AFTER) {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- /* translators: 1: Filter name. 2: Filter value. e.g.: "Date is after: 2024-01-01". */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is after: %2$s"),
- filter.name,
- activeElements[0].label
- ),
- filterTextWrappers
- );
- }
- if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_BEFORE_INC) {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- /* translators: 1: Filter name. 2: Filter value. e.g.: "Date is on or before: 2024-01-01". */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is on or before: %2$s"),
- filter.name,
- activeElements[0].label
- ),
- filterTextWrappers
- );
- }
- if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_AFTER_INC) {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- /* translators: 1: Filter name. 2: Filter value. e.g.: "Date is on or after: 2024-01-01". */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is on or after: %2$s"),
- filter.name,
- activeElements[0].label
- ),
- filterTextWrappers
- );
- }
- if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_BETWEEN) {
- const { label } = activeElements[0];
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- /* translators: 1: Filter name. 2: Min value. 3: Max value. e.g.: "Item count between (inc): 10 and 180". */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)(
- "%1$s between (inc): %2$s and %3$s"
- ),
- filter.name,
- label[0],
- label[1]
- ),
- filterTextWrappers
- );
- }
- if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_ON) {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- /* translators: 1: Filter name. 2: Filter value. e.g.: "Date is: 2024-01-01". */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is: %2$s"),
- filter.name,
- activeElements[0].label
- ),
- filterTextWrappers
- );
- }
- if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_NOT_ON) {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- /* translators: 1: Filter name. 2: Filter value. e.g.: "Date is not: 2024-01-01". */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is not: %2$s"),
- filter.name,
- activeElements[0].label
- ),
- filterTextWrappers
- );
- }
- if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_IN_THE_PAST) {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- /* translators: 1: Filter name. 2: Filter value. e.g.: "Date is in the past: 1 days". */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is in the past: %2$s"),
- filter.name,
- `${activeElements[0].value.value} ${activeElements[0].value.unit}`
- ),
- filterTextWrappers
- );
- }
- if (filterInView?.operator === _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_OVER) {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.createInterpolateElement)(
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- /* translators: 1: Filter name. 2: Filter value. e.g.: "Date is over: 1 days ago". */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s is over: %2$s ago"),
- filter.name,
- `${activeElements[0].value.value} ${activeElements[0].value.unit}`
- ),
- filterTextWrappers
- );
- }
- return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- /* translators: 1: Filter name e.g.: "Unknown status for Author". */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Unknown status for %1$s"),
- filter.name
- );
-};
-function OperatorSelector({
- filter,
- view,
- onChangeView
-}) {
- const operatorOptions = filter.operators?.map((operator) => ({
- value: operator,
- label: _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATORS[operator]?.label
- }));
- const currentFilter = view.filters?.find(
- (_filter) => _filter.field === filter.field
- );
- const value = currentFilter?.operator || filter.operators[0];
- return operatorOptions.length > 1 && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHStack,
- {
- spacing: 2,
- justify: "flex-start",
- className: "dataviews-filters__summary-operators-container",
- children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.FlexItem, { className: "dataviews-filters__summary-operators-filter-name", children: filter.name }),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl,
- {
- className: "dataviews-filters__summary-operators-filter-select",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Conditions"),
- value,
- options: operatorOptions,
- onChange: (newValue) => {
- const operator = newValue;
- const currentOperator = currentFilter?.operator;
- const newFilters = currentFilter ? [
- ...(view.filters ?? []).map(
- (_filter) => {
- if (_filter.field === filter.field) {
- const OPERATORS_SHOULD_RESET_VALUE = [
- _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_BETWEEN,
- _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_IN_THE_PAST,
- _constants__WEBPACK_IMPORTED_MODULE_7__.OPERATOR_OVER
- ];
- const shouldResetValue = currentOperator && (OPERATORS_SHOULD_RESET_VALUE.includes(
- currentOperator
- ) || OPERATORS_SHOULD_RESET_VALUE.includes(
- operator
- ));
- return {
- ..._filter,
- value: shouldResetValue ? void 0 : _filter.value,
- operator
- };
- }
- return _filter;
- }
- )
- ] : [
- ...view.filters ?? [],
- {
- field: filter.field,
- operator,
- value: void 0
- }
- ];
- onChangeView({
- ...view,
- page: 1,
- filters: newFilters
- });
- },
- size: "small",
- variant: "minimal",
- __nextHasNoMarginBottom: true,
- hideLabelFromVision: true
- }
- )
- ]
- }
- );
-}
-function Filter({
- addFilterRef,
- openedFilter,
- fields,
- ...commonProps
-}) {
- const toggleRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)(null);
- const { filter, view, onChangeView } = commonProps;
- const filterInView = view.filters?.find(
- (f) => f.field === filter.field
- );
- let activeElements = [];
- const { elements } = (0,_hooks_use_elements__WEBPACK_IMPORTED_MODULE_8__["default"])({
- elements: filter.elements,
- getElements: filter.getElements
- });
- if (elements.length > 0) {
- activeElements = elements.filter((element) => {
- if (filter.singleSelection) {
- return element.value === filterInView?.value;
- }
- return filterInView?.value?.includes(element.value);
- });
- } else if (filterInView?.value !== void 0) {
- const field = fields.find((f) => f.id === filter.field);
- let label = filterInView.value;
- if (field?.type === "datetime" && typeof label === "string") {
- try {
- const dateValue = (0,_field_types_utils_parse_date_time__WEBPACK_IMPORTED_MODULE_9__["default"])(label);
- if (dateValue !== null) {
- label = dateValue.toLocaleString();
- }
- } catch (e) {
- label = filterInView.value;
- }
- }
- activeElements = [
- {
- value: filterInView.value,
- label
- }
- ];
- }
- const isPrimary = filter.isPrimary;
- const isLocked = filterInView?.isLocked;
- const hasValues = !isLocked && filterInView?.value !== void 0;
- const canResetOrRemove = !isLocked && (!isPrimary || hasValues);
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Dropdown,
- {
- defaultOpen: openedFilter === filter.field,
- contentClassName: "dataviews-filters__summary-popover",
- popoverProps: { placement: "bottom-start", role: "dialog" },
- onClose: () => {
- toggleRef.current?.focus();
- },
- renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { className: "dataviews-filters__summary-chip-container", children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Tooltip,
- {
- text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- /* translators: 1: Filter name. */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Filter by: %1$s"),
- filter.name.toLowerCase()
- ),
- placement: "top",
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
- "div",
- {
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])(
- "dataviews-filters__summary-chip",
- {
- "has-reset": canResetOrRemove,
- "has-values": hasValues,
- "is-not-clickable": isLocked
- }
- ),
- role: "button",
- tabIndex: isLocked ? -1 : 0,
- onClick: () => {
- if (!isLocked) {
- onToggle();
- }
- },
- onKeyDown: (event) => {
- if (!isLocked && [ENTER, SPACE].includes(event.key)) {
- onToggle();
- event.preventDefault();
- }
- },
- "aria-disabled": isLocked,
- "aria-pressed": isOpen,
- "aria-expanded": isOpen,
- ref: toggleRef,
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
- FilterText,
- {
- activeElements,
- filterInView,
- filter
- }
- )
- }
- )
- }
- ),
- canResetOrRemove && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Tooltip,
- {
- text: isPrimary ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Reset") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Remove"),
- placement: "top",
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
- "button",
- {
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])(
- "dataviews-filters__summary-chip-remove",
- { "has-values": hasValues }
- ),
- onClick: () => {
- onChangeView({
- ...view,
- page: 1,
- filters: view.filters?.filter(
- (_filter) => _filter.field !== filter.field
- )
- });
- if (!isPrimary) {
- addFilterRef.current?.focus();
- } else {
- toggleRef.current?.focus();
- }
- },
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Icon, { icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__["default"] })
- }
- )
- }
- )
- ] }),
- renderContent: () => {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalVStack, { spacing: 0, justify: "flex-start", children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(OperatorSelector, { ...commonProps }),
- commonProps.filter.hasElements ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
- _search_widget__WEBPACK_IMPORTED_MODULE_5__["default"],
- {
- ...commonProps,
- filter: {
- ...commonProps.filter,
- elements
- }
- }
- ) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_input_widget__WEBPACK_IMPORTED_MODULE_6__["default"], { ...commonProps, fields })
- ] });
- }
- }
- );
-}
-
-//# sourceMappingURL=filter.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filters-toggled.js":
-/*!********************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filters-toggled.js ***!
- \********************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ filters_toggled_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
-/* harmony import */ var _filters__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./filters */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filters.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
-// packages/dataviews/src/components/dataviews-filters/filters-toggled.tsx
-
-
-
-
-function FiltersToggled(props) {
- const { isShowingFilter } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_1__["default"]);
- if (!isShowingFilter) {
- return null;
- }
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_filters__WEBPACK_IMPORTED_MODULE_2__["default"], { ...props });
-}
-var filters_toggled_default = FiltersToggled;
-
-//# sourceMappingURL=filters-toggled.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filters.js":
-/*!************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filters.js ***!
- \************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ filters_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./filter */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filter.js");
-/* harmony import */ var _add_filter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./add-filter */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/add-filter.js");
-/* harmony import */ var _reset_filters__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./reset-filters */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/reset-filters.js");
-/* harmony import */ var _use_filters__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./use-filters */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/use-filters.js");
-/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__);
-// packages/dataviews/src/components/dataviews-filters/filters.tsx
-
-
-
-
-
-
-
-
-function Filters({ className }) {
- const { fields, view, onChangeView, openedFilter, setOpenedFilter } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_6__["default"]);
- const addFilterRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
- const filters = (0,_use_filters__WEBPACK_IMPORTED_MODULE_5__["default"])(fields, view);
- const addFilter = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
- _add_filter__WEBPACK_IMPORTED_MODULE_3__["default"],
- {
- filters,
- view,
- onChangeView,
- ref: addFilterRef,
- setOpenedFilter
- },
- "add-filter"
- );
- const visibleFilters = filters.filter((filter) => filter.isVisible);
- if (visibleFilters.length === 0) {
- return null;
- }
- const filterComponents = [
- ...visibleFilters.map((filter) => {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
- _filter__WEBPACK_IMPORTED_MODULE_2__["default"],
- {
- filter,
- view,
- fields,
- onChangeView,
- addFilterRef,
- openedFilter
- },
- filter.field
- );
- }),
- addFilter
- ];
- filterComponents.push(
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
- _reset_filters__WEBPACK_IMPORTED_MODULE_4__["default"],
- {
- filters,
- view,
- onChangeView
- },
- "reset-filters"
- )
- );
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHStack,
- {
- justify: "flex-start",
- style: { width: "fit-content" },
- wrap: true,
- className,
- children: filterComponents
- }
- );
-}
-var filters_default = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.memo)(Filters);
-
-//# sourceMappingURL=filters.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/input-widget.js":
-/*!*****************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/input-widget.js ***!
- \*****************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ InputWidget)
-/* harmony export */ });
-/* harmony import */ var fast_deep_equal_es6__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fast-deep-equal/es6 */ "./node_modules/fast-deep-equal/es6/index.js");
-/* harmony import */ var fast_deep_equal_es6__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fast_deep_equal_es6__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
-/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/utils.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
-// packages/dataviews/src/components/dataviews-filters/input-widget.tsx
-
-
-
-
-
-
-function InputWidget({
- filter,
- view,
- onChangeView,
- fields
-}) {
- const currentFilter = view.filters?.find(
- (f) => f.field === filter.field
- );
- const currentValue = (0,_utils__WEBPACK_IMPORTED_MODULE_4__.getCurrentValue)(filter, currentFilter);
- const field = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
- const currentField = fields.find((f) => f.id === filter.field);
- if (currentField) {
- return {
- ...currentField,
- // Deactivate validation for filters.
- isValid: {
- required: false,
- custom: () => null
- },
- // Configure getValue/setValue as if Item was a plain object.
- getValue: ({ item }) => item[currentField.id],
- setValue: ({ value }) => ({
- [currentField.id]: value
- })
- };
- }
- return currentField;
- }, [fields, filter.field]);
- const data = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
- return (view.filters ?? []).reduce(
- (acc, activeFilter) => {
- acc[activeFilter.field] = activeFilter.value;
- return acc;
- },
- {}
- );
- }, [view.filters]);
- const handleChange = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__.useEvent)((updatedData) => {
- if (!field || !currentFilter) {
- return;
- }
- const nextValue = field.getValue({ item: updatedData });
- if (fast_deep_equal_es6__WEBPACK_IMPORTED_MODULE_0___default()(nextValue, currentValue)) {
- return;
- }
- onChangeView({
- ...view,
- filters: (view.filters ?? []).map(
- (_filter) => _filter.field === filter.field ? {
- ..._filter,
- operator: currentFilter.operator || filter.operators[0],
- // Consider empty strings as undefined:
- //
- // - undefined as value means the filter is unset: the filter widget displays no value and the search returns all records
- // - empty string as value means "search empty string": returns only the records that have an empty string as value
- //
- // In practice, this means the filter will not be able to find an empty string as the value.
- value: nextValue === "" ? void 0 : nextValue
- } : _filter
- )
- });
- });
- if (!field || !field.Edit || !currentFilter) {
- return null;
- }
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Flex,
- {
- className: "dataviews-filters__user-input-widget",
- gap: 2.5,
- direction: "column",
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
- field.Edit,
- {
- hideLabelFromVision: true,
- data,
- field,
- operator: currentFilter.operator,
- onChange: handleChange
- }
- )
- }
- );
-}
-
-//# sourceMappingURL=input-widget.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/reset-filters.js":
-/*!******************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/reset-filters.js ***!
- \******************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ ResetFilter)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
-// packages/dataviews/src/components/dataviews-filters/reset-filters.tsx
-
-
-
-function ResetFilter({
- filters,
- view,
- onChangeView
-}) {
- const isPrimary = (field) => filters.some(
- (_filter) => _filter.field === field && _filter.isPrimary
- );
- const isDisabled = !view.search && !view.filters?.some(
- (_filter) => !_filter.isLocked && (_filter.value !== void 0 || !isPrimary(_filter.field))
- );
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
- {
- disabled: isDisabled,
- accessibleWhenDisabled: true,
- size: "compact",
- variant: "tertiary",
- className: "dataviews-filters__reset-button",
- onClick: () => {
- onChangeView({
- ...view,
- page: 1,
- search: "",
- filters: view.filters?.filter((f) => !!f.isLocked) || []
- });
- },
- children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Reset")
- }
- );
-}
-
-//# sourceMappingURL=reset-filters.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/search-widget.js":
-/*!******************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/search-widget.js ***!
- \******************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ SearchWidget)
-/* harmony export */ });
-/* harmony import */ var _ariakit_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ariakit/react */ "./node_modules/@ariakit/react-core/esm/combobox/combobox.js");
-/* harmony import */ var _ariakit_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ariakit/react */ "./node_modules/@ariakit/react-core/esm/__chunks/MNJRSAAC.js");
-/* harmony import */ var _ariakit_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ariakit/react */ "./node_modules/@ariakit/react-core/esm/__chunks/D7FSM5GC.js");
-/* harmony import */ var _ariakit_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ariakit/react */ "./node_modules/@ariakit/react-core/esm/combobox/combobox-item-value.js");
-/* harmony import */ var _ariakit_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ariakit/react */ "./node_modules/@ariakit/react-core/esm/combobox/combobox-label.js");
-/* harmony import */ var _ariakit_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ariakit/react */ "./node_modules/@ariakit/react-core/esm/combobox/combobox-provider.js");
-/* harmony import */ var remove_accents__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! remove-accents */ "./node_modules/remove-accents/index.js");
-/* harmony import */ var remove_accents__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(remove_accents__WEBPACK_IMPORTED_MODULE_6__);
-/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
-/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
-/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_8__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_10__);
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__);
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/check.js");
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/search.js");
-/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/utils.js");
-/* harmony import */ var _hooks_use_elements__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../hooks/use-elements */ "./node_modules/@wordpress/dataviews/build-module/hooks/use-elements.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__);
-// packages/dataviews/src/components/dataviews-filters/search-widget.tsx
-
-
-
-
-
-
-
-
-
-
-
-function normalizeSearchInput(input = "") {
- return remove_accents__WEBPACK_IMPORTED_MODULE_6___default()(input.trim().toLowerCase());
-}
-var getNewValue = (filterDefinition, currentFilter, value) => {
- if (filterDefinition.singleSelection) {
- return value;
- }
- if (Array.isArray(currentFilter?.value)) {
- return currentFilter.value.includes(value) ? currentFilter.value.filter((v) => v !== value) : [...currentFilter.value, value];
- }
- return [value];
-};
-function generateFilterElementCompositeItemId(prefix, filterElementValue) {
- return `${prefix}-${filterElementValue}`;
-}
-var MultiSelectionOption = ({ selected }) => {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
- "span",
- {
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_7__["default"])(
- "dataviews-filters__search-widget-listitem-multi-selection",
- { "is-selected": selected }
- ),
- children: selected && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__.Icon, { icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_12__["default"] })
- }
- );
-};
-var SingleSelectionOption = ({ selected }) => {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
- "span",
- {
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_7__["default"])(
- "dataviews-filters__search-widget-listitem-single-selection",
- { "is-selected": selected }
- )
- }
- );
-};
-function ListBox({ view, filter, onChangeView }) {
- const baseId = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_8__.useInstanceId)(ListBox, "dataviews-filter-list-box");
- const [activeCompositeId, setActiveCompositeId] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_10__.useState)(
- // When there are one or less operators, the first item is set as active
- // (by setting the initial `activeId` to `undefined`).
- // With 2 or more operators, the focus is moved on the operators control
- // (by setting the initial `activeId` to `null`), meaning that there won't
- // be an active item initially. Focus is then managed via the
- // `onFocusVisible` callback.
- filter.operators?.length === 1 ? void 0 : null
- );
- const currentFilter = view.filters?.find(
- (f) => f.field === filter.field
- );
- const currentValue = (0,_utils__WEBPACK_IMPORTED_MODULE_14__.getCurrentValue)(filter, currentFilter);
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_11__.Composite,
- {
- virtualFocus: true,
- focusLoop: true,
- activeId: activeCompositeId,
- setActiveId: setActiveCompositeId,
- role: "listbox",
- className: "dataviews-filters__search-widget-listbox",
- "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.sprintf)(
- /* translators: List of items for a filter. 1: Filter name. e.g.: "List of: Author". */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)("List of: %1$s"),
- filter.name
- ),
- onFocusVisible: () => {
- if (!activeCompositeId && filter.elements.length) {
- setActiveCompositeId(
- generateFilterElementCompositeItemId(
- baseId,
- filter.elements[0].value
- )
- );
- }
- },
- render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__.Composite.Typeahead, {}),
- children: filter.elements.map((element) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_11__.Composite.Hover,
- {
- render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_11__.Composite.Item,
- {
- id: generateFilterElementCompositeItemId(
- baseId,
- element.value
- ),
- render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
- "div",
- {
- "aria-label": element.label,
- role: "option",
- className: "dataviews-filters__search-widget-listitem"
- }
- ),
- onClick: () => {
- const newFilters = currentFilter ? [
- ...(view.filters ?? []).map(
- (_filter) => {
- if (_filter.field === filter.field) {
- return {
- ..._filter,
- operator: currentFilter.operator || filter.operators[0],
- value: getNewValue(
- filter,
- currentFilter,
- element.value
- )
- };
- }
- return _filter;
- }
- )
- ] : [
- ...view.filters ?? [],
- {
- field: filter.field,
- operator: filter.operators[0],
- value: getNewValue(
- filter,
- currentFilter,
- element.value
- )
- }
- ];
- onChangeView({
- ...view,
- page: 1,
- filters: newFilters
- });
- }
- }
- ),
- children: [
- filter.singleSelection && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
- SingleSelectionOption,
- {
- selected: currentValue === element.value
- }
- ),
- !filter.singleSelection && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
- MultiSelectionOption,
- {
- selected: currentValue.includes(element.value)
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("span", { children: element.label })
- ]
- },
- element.value
- ))
- }
- );
-}
-function ComboboxList2({ view, filter, onChangeView }) {
- const [searchValue, setSearchValue] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_10__.useState)("");
- const deferredSearchValue = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_10__.useDeferredValue)(searchValue);
- const currentFilter = view.filters?.find(
- (_filter) => _filter.field === filter.field
- );
- const currentValue = (0,_utils__WEBPACK_IMPORTED_MODULE_14__.getCurrentValue)(filter, currentFilter);
- const matches = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_10__.useMemo)(() => {
- const normalizedSearch = normalizeSearchInput(deferredSearchValue);
- return filter.elements.filter(
- (item) => normalizeSearchInput(item.label).includes(normalizedSearch)
- );
- }, [filter.elements, deferredSearchValue]);
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(
- _ariakit_react__WEBPACK_IMPORTED_MODULE_5__.ComboboxProvider,
- {
- selectedValue: currentValue,
- setSelectedValue: (value) => {
- const newFilters = currentFilter ? [
- ...(view.filters ?? []).map((_filter) => {
- if (_filter.field === filter.field) {
- return {
- ..._filter,
- operator: currentFilter.operator || filter.operators[0],
- value
- };
- }
- return _filter;
- })
- ] : [
- ...view.filters ?? [],
- {
- field: filter.field,
- operator: filter.operators[0],
- value
- }
- ];
- onChangeView({
- ...view,
- page: 1,
- filters: newFilters
- });
- },
- setValue: setSearchValue,
- children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div", { className: "dataviews-filters__search-widget-filter-combobox__wrapper", children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
- _ariakit_react__WEBPACK_IMPORTED_MODULE_4__.ComboboxLabel,
- {
- render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__.VisuallyHidden, { children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)("Search items") }),
- children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)("Search items")
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
- _ariakit_react__WEBPACK_IMPORTED_MODULE_0__.Combobox,
- {
- autoSelect: "always",
- placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)("Search"),
- className: "dataviews-filters__search-widget-filter-combobox__input"
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("div", { className: "dataviews-filters__search-widget-filter-combobox__icon", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__.Icon, { icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_13__["default"] }) })
- ] }),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(
- _ariakit_react__WEBPACK_IMPORTED_MODULE_1__.ComboboxList,
- {
- className: "dataviews-filters__search-widget-filter-combobox-list",
- alwaysVisible: true,
- children: [
- matches.map((element) => {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(
- _ariakit_react__WEBPACK_IMPORTED_MODULE_2__.ComboboxItem,
- {
- resetValueOnSelect: false,
- value: element.value,
- className: "dataviews-filters__search-widget-listitem",
- hideOnClick: false,
- setValueOnClick: false,
- focusOnHover: true,
- children: [
- filter.singleSelection && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
- SingleSelectionOption,
- {
- selected: currentValue === element.value
- }
- ),
- !filter.singleSelection && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
- MultiSelectionOption,
- {
- selected: currentValue.includes(
- element.value
- )
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("span", { children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
- _ariakit_react__WEBPACK_IMPORTED_MODULE_3__.ComboboxItemValue,
- {
- className: "dataviews-filters__search-widget-filter-combobox-item-value",
- value: element.label
- }
- ),
- !!element.description && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("span", { className: "dataviews-filters__search-widget-listitem-description", children: element.description })
- ] })
- ]
- },
- element.value
- );
- }),
- !matches.length && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("p", { children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)("No results found") })
- ]
- }
- )
- ]
- }
- );
-}
-function SearchWidget(props) {
- const { elements, isLoading } = (0,_hooks_use_elements__WEBPACK_IMPORTED_MODULE_15__["default"])({
- elements: props.filter.elements,
- getElements: props.filter.getElements
- });
- if (isLoading) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("div", { className: "dataviews-filters__search-widget-no-elements", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_11__.Spinner, {}) });
- }
- if (elements.length === 0) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("div", { className: "dataviews-filters__search-widget-no-elements", children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)("No elements found") });
- }
- const Widget = elements.length > 10 ? ComboboxList2 : ListBox;
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(Widget, { ...props, filter: { ...props.filter, elements } });
-}
-
-//# sourceMappingURL=search-widget.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/toggle.js":
-/*!***********************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/toggle.js ***!
- \***********************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ toggle_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/funnel.js");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _add_filter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./add-filter */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/add-filter.js");
-/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__);
-// packages/dataviews/src/components/dataviews-filters/toggle.tsx
-
-
-
-
-
-
-
-function FiltersToggle() {
- const {
- filters,
- view,
- onChangeView,
- setOpenedFilter,
- isShowingFilter,
- setIsShowingFilter
- } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_5__["default"]);
- const buttonRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
- const onChangeViewWithFilterVisibility = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(
- (_view) => {
- onChangeView(_view);
- setIsShowingFilter(true);
- },
- [onChangeView, setIsShowingFilter]
- );
- const visibleFilters = filters.filter((filter) => filter.isVisible);
- const hasVisibleFilters = !!visibleFilters.length;
- if (filters.length === 0) {
- return null;
- }
- const addFilterButtonProps = {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Add filter"),
- "aria-expanded": false,
- isPressed: false
- };
- const toggleFiltersButtonProps = {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__._x)("Filter", "verb"),
- "aria-expanded": isShowingFilter,
- isPressed: isShowingFilter,
- onClick: () => {
- if (!isShowingFilter) {
- setOpenedFilter(null);
- }
- setIsShowingFilter(!isShowingFilter);
- }
- };
- const buttonComponent = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button,
- {
- ref: buttonRef,
- className: "dataviews-filters__visibility-toggle",
- size: "compact",
- icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"],
- ...hasVisibleFilters ? toggleFiltersButtonProps : addFilterButtonProps
- }
- );
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", { className: "dataviews-filters__container-visibility-toggle", children: !hasVisibleFilters ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
- _add_filter__WEBPACK_IMPORTED_MODULE_4__.AddFilterMenu,
- {
- filters,
- view,
- onChangeView: onChangeViewWithFilterVisibility,
- setOpenedFilter,
- triggerProps: { render: buttonComponent }
- }
- ) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
- FilterVisibilityToggle,
- {
- buttonRef,
- filtersCount: view.filters?.length,
- children: buttonComponent
- }
- ) });
-}
-function FilterVisibilityToggle({
- buttonRef,
- filtersCount,
- children
-}) {
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(
- () => () => {
- buttonRef.current?.focus();
- },
- [buttonRef]
- );
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, { children: [
- children,
- !!filtersCount && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("span", { className: "dataviews-filters-toggle__count", children: filtersCount })
- ] });
-}
-var toggle_default = FiltersToggle;
-
-//# sourceMappingURL=toggle.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/use-filters.js":
-/*!****************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/use-filters.js ***!
- \****************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ use_filters_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-// packages/dataviews/src/components/dataviews-filters/use-filters.ts
-
-
-function useFilters(fields, view) {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
- const filters = [];
- fields.forEach((field) => {
- if (field.filterBy === false || !field.hasElements && !field.Edit) {
- return;
- }
- const operators = field.filterBy.operators;
- const isPrimary = !!field.filterBy?.isPrimary;
- const isLocked = view.filters?.some(
- (f) => f.field === field.id && !!f.isLocked
- ) ?? false;
- filters.push({
- field: field.id,
- name: field.label,
- elements: field.elements,
- getElements: field.getElements,
- hasElements: field.hasElements,
- singleSelection: operators.some(
- (op) => _constants__WEBPACK_IMPORTED_MODULE_1__.SINGLE_SELECTION_OPERATORS.includes(op)
- ),
- operators,
- isVisible: isLocked || isPrimary || !!view.filters?.some(
- (f) => f.field === field.id && _constants__WEBPACK_IMPORTED_MODULE_1__.ALL_OPERATORS.includes(f.operator)
- ),
- isPrimary,
- isLocked
- });
- });
- filters.sort((a, b) => {
- if (a.isLocked && !b.isLocked) {
- return -1;
- }
- if (!a.isLocked && b.isLocked) {
- return 1;
- }
- if (a.isPrimary && !b.isPrimary) {
- return -1;
- }
- if (!a.isPrimary && b.isPrimary) {
- return 1;
- }
- return a.name.localeCompare(b.name);
- });
- return filters;
- }, [fields, view]);
-}
-var use_filters_default = useFilters;
-
-//# sourceMappingURL=use-filters.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/utils.js":
-/*!**********************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/utils.js ***!
- \**********************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ getCurrentValue: () => (/* binding */ getCurrentValue)
-/* harmony export */ });
-// packages/dataviews/src/components/dataviews-filters/utils.ts
-var EMPTY_ARRAY = [];
-var getCurrentValue = (filterDefinition, currentFilter) => {
- if (filterDefinition.singleSelection) {
- return currentFilter?.value;
- }
- if (Array.isArray(currentFilter?.value)) {
- return currentFilter.value;
- }
- if (!Array.isArray(currentFilter?.value) && !!currentFilter?.value) {
- return [currentFilter.value];
- }
- return EMPTY_ARRAY;
-};
-
-//# sourceMappingURL=utils.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-footer/index.js":
-/*!*********************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-footer/index.js ***!
- \*********************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ DataViewsFooter)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
-/* harmony import */ var _dataviews_pagination__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../dataviews-pagination */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-pagination/index.js");
-/* harmony import */ var _dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../dataviews-bulk-actions */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-bulk-actions/index.js");
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__);
-// packages/dataviews/src/components/dataviews-footer/index.tsx
-
-
-
-
-
-
-
-var EMPTY_ARRAY = [];
-function DataViewsFooter() {
- const {
- view,
- paginationInfo: { totalItems = 0, totalPages },
- data,
- actions = EMPTY_ARRAY
- } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_2__["default"]);
- const hasBulkActions = (0,_dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_4__.useSomeItemHasAPossibleBulkAction)(actions, data) && [_constants__WEBPACK_IMPORTED_MODULE_5__.LAYOUT_TABLE, _constants__WEBPACK_IMPORTED_MODULE_5__.LAYOUT_GRID].includes(view.type);
- if (!totalItems || !totalPages || totalPages <= 1 && !hasBulkActions) {
- return null;
- }
- return !!totalItems && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack,
- {
- expanded: false,
- justify: "end",
- className: "dataviews-footer",
- children: [
- hasBulkActions && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_4__.BulkActionsFooter, {}),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_dataviews_pagination__WEBPACK_IMPORTED_MODULE_3__["default"], {})
- ]
- }
- );
-}
-
-//# sourceMappingURL=index.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-item-actions/index.js":
-/*!***************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-item-actions/index.js ***!
- \***************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ ActionModal: () => (/* binding */ ActionModal),
-/* harmony export */ ActionsMenuGroup: () => (/* binding */ ActionsMenuGroup),
-/* harmony export */ "default": () => (/* binding */ ItemActions)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/more-vertical.js");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__);
-/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
-/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__);
-/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__);
-// packages/dataviews/src/components/dataviews-item-actions/index.tsx
-
-
-
-
-
-
-
-
-var { Menu, kebabCase } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_6__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.privateApis);
-function ButtonTrigger({
- action,
- onClick,
- items
-}) {
- const label = typeof action.label === "string" ? action.label : action.label(items);
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
- {
- disabled: !!action.disabled,
- accessibleWhenDisabled: true,
- size: "compact",
- onClick,
- children: label
- }
- );
-}
-function MenuItemTrigger({
- action,
- onClick,
- items
-}) {
- const label = typeof action.label === "string" ? action.label : action.label(items);
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(Menu.Item, { disabled: action.disabled, onClick, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(Menu.ItemLabel, { children: label }) });
-}
-function ActionModal({
- action,
- items,
- closeModal
-}) {
- const label = typeof action.label === "string" ? action.label : action.label(items);
- const modalHeader = typeof action.modalHeader === "function" ? action.modalHeader(items) : action.modalHeader;
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Modal,
- {
- title: modalHeader || label,
- __experimentalHideHeader: !!action.hideModalHeader,
- onRequestClose: closeModal,
- focusOnMount: action.modalFocusOnMount ?? true,
- size: action.modalSize || "medium",
- overlayClassName: `dataviews-action-modal dataviews-action-modal__${kebabCase(
- action.id
- )}`,
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(action.RenderModal, { items, closeModal })
- }
- );
-}
-function ActionsMenuGroup({
- actions,
- item,
- registry,
- setActiveModalAction
-}) {
- const { primaryActions, regularActions } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
- return actions.reduce(
- (acc, action) => {
- (action.isPrimary ? acc.primaryActions : acc.regularActions).push(action);
- return acc;
- },
- {
- primaryActions: [],
- regularActions: []
- }
- );
- }, [actions]);
- const renderActionGroup = (actionList) => actionList.map((action) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
- MenuItemTrigger,
- {
- action,
- onClick: () => {
- if ("RenderModal" in action) {
- setActiveModalAction(action);
- return;
- }
- action.callback([item], { registry });
- },
- items: [item]
- },
- action.id
- ));
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(Menu.Group, { children: [
- renderActionGroup(primaryActions),
- primaryActions.length > 0 && regularActions.length > 0 && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(Menu.Separator, {}),
- renderActionGroup(regularActions)
- ] });
-}
-function ItemActions({
- item,
- actions,
- isCompact
-}) {
- const registry = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.useRegistry)();
- const { primaryActions, eligibleActions } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
- const _eligibleActions = actions.filter(
- (action) => !action.isEligible || action.isEligible(item)
- );
- const _primaryActions = _eligibleActions.filter(
- (action) => action.isPrimary
- );
- return {
- primaryActions: _primaryActions,
- eligibleActions: _eligibleActions
- };
- }, [actions, item]);
- if (isCompact) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
- CompactItemActions,
- {
- item,
- actions: eligibleActions,
- isSmall: true,
- registry
- }
- );
- }
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack,
- {
- spacing: 0,
- justify: "flex-end",
- className: "dataviews-item-actions",
- style: {
- flexShrink: 0,
- width: "auto"
- },
- children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
- PrimaryActions,
- {
- item,
- actions: primaryActions,
- registry
- }
- ),
- primaryActions.length < eligibleActions.length && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
- CompactItemActions,
- {
- item,
- actions: eligibleActions,
- registry
- }
- )
- ]
- }
- );
-}
-function CompactItemActions({
- item,
- actions,
- isSmall,
- registry
-}) {
- const [activeModalAction, setActiveModalAction] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(
- null
- );
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment, { children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(Menu, { placement: "bottom-end", children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
- Menu.TriggerButton,
- {
- render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
- {
- size: isSmall ? "small" : "compact",
- icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"],
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Actions"),
- accessibleWhenDisabled: true,
- disabled: !actions.length,
- className: "dataviews-all-actions-button"
- }
- )
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(Menu.Popover, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
- ActionsMenuGroup,
- {
- actions,
- item,
- registry,
- setActiveModalAction
- }
- ) })
- ] }),
- !!activeModalAction && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
- ActionModal,
- {
- action: activeModalAction,
- items: [item],
- closeModal: () => setActiveModalAction(null)
- }
- )
- ] });
-}
-function PrimaryActions({
- item,
- actions,
- registry
-}) {
- const [activeModalAction, setActiveModalAction] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(null);
- const isMobileViewport = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__.useViewportMatch)("medium", "<");
- if (isMobileViewport) {
- return null;
- }
- if (!Array.isArray(actions) || actions.length === 0) {
- return null;
- }
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment, { children: [
- actions.map((action) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
- ButtonTrigger,
- {
- action,
- onClick: () => {
- if ("RenderModal" in action) {
- setActiveModalAction(action);
- return;
- }
- action.callback([item], { registry });
- },
- items: [item]
- },
- action.id
- )),
- !!activeModalAction && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(
- ActionModal,
- {
- action: activeModalAction,
- items: [item],
- closeModal: () => setActiveModalAction(null)
- }
- )
- ] });
-}
-
-//# sourceMappingURL=index.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-layout/index.js":
-/*!*********************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-layout/index.js ***!
- \*********************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ DataViewsLayout)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
-/* harmony import */ var _dataviews_layouts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../dataviews-layouts */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/index.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
-// packages/dataviews/src/components/dataviews-layout/index.tsx
-
-
-
-
-
-function DataViewsLayout({ className }) {
- const {
- actions = [],
- data,
- fields,
- getItemId,
- getItemLevel,
- isLoading,
- view,
- onChangeView,
- selection,
- onChangeSelection,
- setOpenedFilter,
- onClickItem,
- isItemClickable,
- renderItemLink,
- defaultLayouts,
- empty = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", { children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("No results") })
- } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_2__["default"]);
- const ViewComponent = _dataviews_layouts__WEBPACK_IMPORTED_MODULE_3__.VIEW_LAYOUTS.find(
- (v) => v.type === view.type && defaultLayouts[v.type]
- )?.component;
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
- ViewComponent,
- {
- className,
- actions,
- data,
- fields,
- getItemId,
- getItemLevel,
- isLoading,
- onChangeView,
- onChangeSelection,
- selection,
- setOpenedFilter,
- onClickItem,
- renderItemLink,
- isItemClickable,
- view,
- empty
- }
- );
-}
-
-//# sourceMappingURL=index.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-pagination/index.js":
-/*!*************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-pagination/index.js ***!
- \*************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ DataViewsPagination: () => (/* binding */ DataViewsPagination),
-/* harmony export */ "default": () => (/* binding */ dataviews_pagination_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/next.js");
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/previous.js");
-/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__);
-// packages/dataviews/src/components/dataviews-pagination/index.tsx
-
-
-
-
-
-
-function DataViewsPagination() {
- const {
- view,
- onChangeView,
- paginationInfo: { totalItems = 0, totalPages }
- } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_5__["default"]);
- if (!totalItems || !totalPages || view.infiniteScrollEnabled) {
- return null;
- }
- const currentPage = view.page ?? 1;
- const pageSelectOptions = Array.from(Array(totalPages)).map(
- (_, i) => {
- const page = i + 1;
- return {
- value: page.toString(),
- label: page.toString(),
- "aria-label": currentPage === page ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- // translators: 1: current page number. 2: total number of pages.
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Page %1$d of %2$d"),
- currentPage,
- totalPages
- ) : page.toString()
- };
- }
- );
- return !!totalItems && totalPages !== 1 && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack,
- {
- expanded: false,
- className: "dataviews-pagination",
- justify: "end",
- spacing: 6,
- children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack,
- {
- justify: "flex-start",
- expanded: false,
- spacing: 1,
- className: "dataviews-pagination__page-select",
- children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createInterpolateElement)(
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- // translators: 1: Current page number, 2: Total number of pages.
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__._x)(
- "Page
%1$sof %2$d
",
- "paging"
- ),
- "",
- totalPages
- ),
- {
- div: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", { "aria-hidden": true }),
- CurrentPage: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.SelectControl,
- {
- "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Current page"),
- value: currentPage.toString(),
- options: pageSelectOptions,
- onChange: (newValue) => {
- onChangeView({
- ...view,
- page: +newValue
- });
- },
- size: "small",
- __nextHasNoMarginBottom: true,
- variant: "minimal"
- }
- )
- }
- )
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack, { expanded: false, spacing: 1, children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
- {
- onClick: () => onChangeView({
- ...view,
- page: currentPage - 1
- }),
- disabled: currentPage === 1,
- accessibleWhenDisabled: true,
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Previous page"),
- icon: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.isRTL)() ? _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"] : _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__["default"],
- showTooltip: true,
- size: "compact",
- tooltipPosition: "top"
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
- {
- onClick: () => onChangeView({ ...view, page: currentPage + 1 }),
- disabled: currentPage >= totalPages,
- accessibleWhenDisabled: true,
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Next page"),
- icon: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.isRTL)() ? _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__["default"] : _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"],
- showTooltip: true,
- size: "compact",
- tooltipPosition: "top"
- }
- )
- ] })
- ]
- }
- );
-}
-var dataviews_pagination_default = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.memo)(DataViewsPagination);
-
-//# sourceMappingURL=index.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-picker/footer.js":
-/*!**********************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-picker/footer.js ***!
- \**********************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ DataViewsPickerFooter: () => (/* binding */ DataViewsPickerFooter),
-/* harmony export */ useIsMultiselectPicker: () => (/* binding */ useIsMultiselectPicker)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _dataviews_pagination__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../dataviews-pagination */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-pagination/index.js");
-/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__);
-// packages/dataviews/src/components/dataviews-picker/footer.tsx
-
-
-
-
-
-
-
-var EMPTY_ARRAY = [];
-function useIsMultiselectPicker(actions) {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
- return actions?.every((action) => action.supportsBulk);
- }, [actions]);
-}
-function BulkSelectionCheckbox({
- selection,
- selectedItems,
- onChangeSelection,
- data,
- getItemId
-}) {
- const areAllSelected = selectedItems.length === data.length;
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.CheckboxControl,
- {
- className: "dataviews-view-table-selection-checkbox",
- __nextHasNoMarginBottom: true,
- checked: areAllSelected,
- indeterminate: !areAllSelected && !!selectedItems.length,
- onChange: () => {
- if (areAllSelected) {
- onChangeSelection(
- selection.filter(
- (id) => !data.some(
- (item) => id === getItemId(item)
- )
- )
- );
- } else {
- const selectionSet = /* @__PURE__ */ new Set([
- ...selection,
- ...data.map((item) => getItemId(item))
- ]);
- onChangeSelection(Array.from(selectionSet));
- }
- },
- "aria-label": areAllSelected ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Deselect all") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Select all")
- }
- );
-}
-function ActionButtons({
- actions,
- items,
- selection
-}) {
- const registry = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useRegistry)();
- const [actionInProgress, setActionInProgress] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(
- null
- );
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack, { expanded: false, spacing: 1, children: actions.map((action) => {
- if (!("callback" in action)) {
- return null;
- }
- const { id, label, icon, isPrimary, callback } = action;
- const _label = typeof label === "string" ? label : label(items);
- const variant = isPrimary ? "primary" : "tertiary";
- const isInProgress = id === actionInProgress;
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
- {
- accessibleWhenDisabled: true,
- icon,
- disabled: isInProgress || !selection?.length,
- isBusy: isInProgress,
- onClick: async () => {
- setActionInProgress(id);
- await callback(items, {
- registry
- });
- setActionInProgress(null);
- },
- size: "compact",
- variant,
- children: _label
- },
- id
- );
- }) });
-}
-function DataViewsPickerFooter() {
- const {
- data,
- selection,
- onChangeSelection,
- getItemId,
- actions = EMPTY_ARRAY
- } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_5__["default"]);
- const selectionCount = selection.length;
- const isMultiselect = useIsMultiselectPicker(actions);
- const message = selectionCount > 0 ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.sprintf)(
- /* translators: %d: number of items. */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__._n)(
- "%d Item selected",
- "%d Items selected",
- selectionCount
- ),
- selectionCount
- ) : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.sprintf)(
- /* translators: %d: number of items. */
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__._n)("%d Item", "%d Items", data.length),
- data.length
- );
- const selectedItems = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(
- () => data.filter((item) => selection.includes(getItemId(item))),
- [selection, getItemId, data]
- );
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack,
- {
- expanded: false,
- justify: "space-between",
- className: "dataviews-footer",
- children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack,
- {
- className: "dataviews-picker-footer__bulk-selection",
- expanded: false,
- spacing: 3,
- children: [
- isMultiselect && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
- BulkSelectionCheckbox,
- {
- selection,
- selectedItems,
- onChangeSelection,
- data,
- getItemId
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("span", { className: "dataviews-bulk-actions-footer__item-count", children: message })
- ]
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_dataviews_pagination__WEBPACK_IMPORTED_MODULE_4__["default"], {}),
- Boolean(actions?.length) && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", { className: "dataviews-picker-footer__actions", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
- ActionButtons,
- {
- actions,
- items: selectedItems,
- selection
- }
- ) })
- ]
- }
- );
-}
-
-//# sourceMappingURL=footer.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-search/index.js":
-/*!*********************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-search/index.js ***!
- \*********************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ dataviews_search_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
-/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
-// packages/dataviews/src/components/dataviews-search/index.tsx
-
-
-
-
-
-
-var DataViewsSearch = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.memo)(function Search({ label }) {
- const { view, onChangeView } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_4__["default"]);
- const [search, setSearch, debouncedSearch] = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__.useDebouncedInput)(
- view.search
- );
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
- setSearch(view.search ?? "");
- }, [view.search, setSearch]);
- const onChangeViewRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(onChangeView);
- const viewRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(view);
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
- onChangeViewRef.current = onChangeView;
- viewRef.current = view;
- }, [onChangeView, view]);
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
- if (debouncedSearch !== viewRef.current?.search) {
- onChangeViewRef.current({
- ...viewRef.current,
- page: 1,
- search: debouncedSearch
- });
- }
- }, [debouncedSearch]);
- const searchLabel = label || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Search");
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.SearchControl,
- {
- className: "dataviews-search",
- __nextHasNoMarginBottom: true,
- onChange: setSearch,
- value: search,
- label: searchLabel,
- placeholder: searchLabel,
- size: "compact"
- }
- );
-});
-var dataviews_search_default = DataViewsSearch;
-
-//# sourceMappingURL=index.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-selection-checkbox/index.js":
-/*!*********************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-selection-checkbox/index.js ***!
- \*********************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ DataViewsSelectionCheckbox)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
-// packages/dataviews/src/components/dataviews-selection-checkbox/index.tsx
-
-
-
-function DataViewsSelectionCheckbox({
- selection,
- onChangeSelection,
- item,
- getItemId,
- titleField,
- disabled,
- ...extraProps
-}) {
- const id = getItemId(item);
- const checked = !disabled && selection.includes(id);
- const selectionLabel = titleField?.getValue?.({ item }) || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("(no title)");
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.CheckboxControl,
- {
- className: "dataviews-selection-checkbox",
- __nextHasNoMarginBottom: true,
- "aria-label": selectionLabel,
- "aria-disabled": disabled,
- checked,
- onChange: () => {
- if (disabled) {
- return;
- }
- onChangeSelection(
- selection.includes(id) ? selection.filter((itemId) => id !== itemId) : [...selection, id]
- );
- },
- ...extraProps
- }
- );
-}
-
-//# sourceMappingURL=index.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/index.js":
-/*!**************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/index.js ***!
- \**************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ DataviewsViewConfigDropdown: () => (/* binding */ DataviewsViewConfigDropdown),
-/* harmony export */ ViewTypeMenu: () => (/* binding */ ViewTypeMenu),
-/* harmony export */ "default": () => (/* binding */ dataviews_view_config_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/cog.js");
-/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/warning */ "@wordpress/warning");
-/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_4__);
-/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
-/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__);
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-/* harmony import */ var _dataviews_layouts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../dataviews-layouts */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/index.js");
-/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
-/* harmony import */ var _infinite_scroll_toggle__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./infinite-scroll-toggle */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/infinite-scroll-toggle.js");
-/* harmony import */ var _properties_section__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./properties-section */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/properties-section.js");
-/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__);
-// packages/dataviews/src/components/dataviews-view-config/index.tsx
-
-
-
-
-
-
-
-
-
-
-
-
-
-var { Menu } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_11__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.privateApis);
-var DATAVIEWS_CONFIG_POPOVER_PROPS = {
- className: "dataviews-config__popover",
- placement: "bottom-end",
- offset: 9
-};
-function ViewTypeMenu() {
- const { view, onChangeView, defaultLayouts } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_8__["default"]);
- const availableLayouts = Object.keys(defaultLayouts);
- if (availableLayouts.length <= 1) {
- return null;
- }
- const activeView = _dataviews_layouts__WEBPACK_IMPORTED_MODULE_7__.VIEW_LAYOUTS.find((v) => view.type === v.type);
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(Menu, { children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- Menu.TriggerButton,
- {
- render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
- {
- size: "compact",
- icon: activeView?.icon,
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Layout")
- }
- )
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(Menu.Popover, { children: availableLayouts.map((layout) => {
- const config = _dataviews_layouts__WEBPACK_IMPORTED_MODULE_7__.VIEW_LAYOUTS.find(
- (v) => v.type === layout
- );
- if (!config) {
- return null;
- }
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- Menu.RadioItem,
- {
- value: layout,
- name: "view-actions-available-view",
- checked: layout === view.type,
- hideOnClick: true,
- onChange: (e) => {
- switch (e.target.value) {
- case "list":
- case "grid":
- case "table":
- case "pickerGrid":
- case "pickerTable":
- const viewWithoutLayout = { ...view };
- if ("layout" in viewWithoutLayout) {
- delete viewWithoutLayout.layout;
- }
- return onChangeView({
- ...viewWithoutLayout,
- type: e.target.value,
- ...defaultLayouts[e.target.value]
- });
- }
- _wordpress_warning__WEBPACK_IMPORTED_MODULE_4___default()("Invalid dataview");
- },
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(Menu.ItemLabel, { children: config.label })
- },
- layout
- );
- }) })
- ] });
-}
-function SortFieldControl() {
- const { view, fields, onChangeView } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_8__["default"]);
- const orderOptions = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
- const sortableFields = fields.filter(
- (field) => field.enableSorting !== false
- );
- return sortableFields.map((field) => {
- return {
- label: field.label,
- value: field.id
- };
- });
- }, [fields]);
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.SelectControl,
- {
- __nextHasNoMarginBottom: true,
- __next40pxDefaultSize: true,
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Sort by"),
- value: view.sort?.field,
- options: orderOptions,
- onChange: (value) => {
- onChangeView({
- ...view,
- sort: {
- direction: view?.sort?.direction || "desc",
- field: value
- },
- showLevels: false
- });
- }
- }
- );
-}
-function SortDirectionControl() {
- const { view, fields, onChangeView } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_8__["default"]);
- const sortableFields = fields.filter(
- (field) => field.enableSorting !== false
- );
- if (sortableFields.length === 0) {
- return null;
- }
- let value = view.sort?.direction;
- if (!value && view.sort?.field) {
- value = "desc";
- }
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalToggleGroupControl,
- {
- className: "dataviews-view-config__sort-direction",
- __nextHasNoMarginBottom: true,
- __next40pxDefaultSize: true,
- isBlock: true,
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Order"),
- value,
- onChange: (newDirection) => {
- if (newDirection === "asc" || newDirection === "desc") {
- onChangeView({
- ...view,
- sort: {
- direction: newDirection,
- field: view.sort?.field || // If there is no field assigned as the sorting field assign the first sortable field.
- fields.find(
- (field) => field.enableSorting !== false
- )?.id || ""
- },
- showLevels: false
- });
- return;
- }
- _wordpress_warning__WEBPACK_IMPORTED_MODULE_4___default()("Invalid direction");
- },
- children: _constants__WEBPACK_IMPORTED_MODULE_6__.SORTING_DIRECTIONS.map((direction) => {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalToggleGroupControlOptionIcon,
- {
- value: direction,
- icon: _constants__WEBPACK_IMPORTED_MODULE_6__.sortIcons[direction],
- label: _constants__WEBPACK_IMPORTED_MODULE_6__.sortLabels[direction]
- },
- direction
- );
- })
- }
- );
-}
-function ItemsPerPageControl() {
- const { view, config, onChangeView } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_8__["default"]);
- const { infiniteScrollEnabled } = view;
- if (!config || !config.perPageSizes || config.perPageSizes.length < 2 || config.perPageSizes.length > 6 || infiniteScrollEnabled) {
- return null;
- }
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalToggleGroupControl,
- {
- __nextHasNoMarginBottom: true,
- __next40pxDefaultSize: true,
- isBlock: true,
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Items per page"),
- value: view.perPage || 10,
- disabled: !view?.sort?.field,
- onChange: (newItemsPerPage) => {
- const newItemsPerPageNumber = typeof newItemsPerPage === "number" || newItemsPerPage === void 0 ? newItemsPerPage : parseInt(newItemsPerPage, 10);
- onChangeView({
- ...view,
- perPage: newItemsPerPageNumber,
- page: 1
- });
- },
- children: config.perPageSizes.map((value) => {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalToggleGroupControlOption,
- {
- value,
- label: value.toString()
- },
- value
- );
- })
- }
- );
-}
-function SettingsSection({
- title,
- description,
- children
-}) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalGrid, { columns: 12, className: "dataviews-settings-section", gap: 4, children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", { className: "dataviews-settings-section__sidebar", children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHeading,
- {
- level: 2,
- className: "dataviews-settings-section__title",
- children: title
- }
- ),
- description && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalText,
- {
- variant: "muted",
- className: "dataviews-settings-section__description",
- children: description
- }
- )
- ] }),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalGrid,
- {
- columns: 8,
- gap: 4,
- className: "dataviews-settings-section__content",
- children
- }
- )
- ] });
-}
-function DataviewsViewConfigDropdown() {
- const { view } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_8__["default"]);
- const popoverId = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__.useInstanceId)(
- _DataViewsViewConfig,
- "dataviews-view-config-dropdown"
- );
- const activeLayout = _dataviews_layouts__WEBPACK_IMPORTED_MODULE_7__.VIEW_LAYOUTS.find(
- (layout) => layout.type === view.type
- );
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Dropdown,
- {
- expandOnMobile: true,
- popoverProps: {
- ...DATAVIEWS_CONFIG_POPOVER_PROPS,
- id: popoverId
- },
- renderToggle: ({ onToggle, isOpen }) => {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
- {
- size: "compact",
- icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"],
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x)("View options", "View is used as a noun"),
- onClick: onToggle,
- "aria-expanded": isOpen ? "true" : "false",
- "aria-controls": popoverId
- }
- );
- },
- renderContent: () => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalDropdownContentWrapper,
- {
- paddingSize: "medium",
- className: "dataviews-config__popover-content-wrapper",
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalVStack, { className: "dataviews-view-config", spacing: 6, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(SettingsSection, { title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Appearance"), children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack, { expanded: true, className: "is-divided-in-two", children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(SortFieldControl, {}),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(SortDirectionControl, {})
- ] }),
- !!activeLayout?.viewConfigOptions && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(activeLayout.viewConfigOptions, {}),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_infinite_scroll_toggle__WEBPACK_IMPORTED_MODULE_9__["default"], {}),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(ItemsPerPageControl, {}),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_properties_section__WEBPACK_IMPORTED_MODULE_10__.PropertiesSection, {})
- ] }) })
- }
- )
- }
- );
-}
-function _DataViewsViewConfig() {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.Fragment, { children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(ViewTypeMenu, {}),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(DataviewsViewConfigDropdown, {})
- ] });
-}
-var DataViewsViewConfig = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.memo)(_DataViewsViewConfig);
-var dataviews_view_config_default = DataViewsViewConfig;
-
-//# sourceMappingURL=index.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/infinite-scroll-toggle.js":
-/*!*******************************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/infinite-scroll-toggle.js ***!
- \*******************************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ InfiniteScrollToggle)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
-// packages/dataviews/src/components/dataviews-view-config/infinite-scroll-toggle.tsx
-
-
-
-
-
-function InfiniteScrollToggle() {
- const context = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_3__["default"]);
- const { view, onChangeView } = context;
- const infiniteScrollEnabled = view.infiniteScrollEnabled ?? false;
- if (!context.hasInfiniteScrollHandler) {
- return null;
- }
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.ToggleControl,
- {
- __nextHasNoMarginBottom: true,
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Enable infinite scroll"),
- help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)(
- "Automatically load more content as you scroll, instead of showing pagination links."
- ),
- checked: infiniteScrollEnabled,
- onChange: (newValue) => {
- onChangeView({
- ...view,
- infiniteScrollEnabled: newValue
- });
- }
- }
- );
-}
-
-//# sourceMappingURL=infinite-scroll-toggle.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/properties-section.js":
-/*!***************************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/properties-section.js ***!
- \***************************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ PropertiesSection: () => (/* binding */ PropertiesSection)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/check.js");
-/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
-// packages/dataviews/src/components/dataviews-view-config/properties-section.tsx
-
-
-
-
-
-
-function FieldItem({
- field,
- isVisible,
- onToggleVisibility
-}) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalItem, { onClick: field.enableHiding ? onToggleVisibility : void 0, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack, { expanded: true, justify: "flex-start", alignment: "center", children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", { style: { height: 24, width: 24 }, children: isVisible && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Icon, { icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"] }) }),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("span", { className: "dataviews-view-config__label", children: field.label })
- ] }) });
-}
-function isDefined(item) {
- return !!item;
-}
-function PropertiesSection({
- showLabel = true
-}) {
- const { view, fields, onChangeView } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useContext)(_dataviews_context__WEBPACK_IMPORTED_MODULE_4__["default"]);
- const togglableFields = [
- view?.titleField,
- view?.mediaField,
- view?.descriptionField
- ].filter(Boolean);
- const regularFields = fields.filter(
- (f) => !togglableFields.includes(f.id) && f.type !== "media" && f.enableHiding !== false
- );
- if (!regularFields?.length) {
- return null;
- }
- const titleField = fields.find((f) => f.id === view.titleField);
- const previewField = fields.find((f) => f.id === view.mediaField);
- const descriptionField = fields.find(
- (f) => f.id === view.descriptionField
- );
- const lockedFields = [
- {
- field: titleField,
- isVisibleFlag: "showTitle"
- },
- {
- field: previewField,
- isVisibleFlag: "showMedia"
- },
- {
- field: descriptionField,
- isVisibleFlag: "showDescription"
- }
- ].filter(({ field }) => isDefined(field));
- const visibleFieldIds = view.fields ?? [];
- const visibleRegularFieldsCount = regularFields.filter(
- (f) => visibleFieldIds.includes(f.id)
- ).length;
- let visibleLockedFields = lockedFields.filter(
- ({ field, isVisibleFlag }) => (
- // @ts-expect-error
- isDefined(field) && (view[isVisibleFlag] ?? true)
- )
- );
- const totalVisibleFields = visibleLockedFields.length + visibleRegularFieldsCount;
- if (totalVisibleFields === 1) {
- if (visibleLockedFields.length === 1) {
- visibleLockedFields = visibleLockedFields.map((locked) => ({
- ...locked,
- field: { ...locked.field, enableHiding: false }
- }));
- }
- }
- const hiddenLockedFields = lockedFields.filter(
- ({ field, isVisibleFlag }) => (
- // @ts-expect-error
- isDefined(field) && !(view[isVisibleFlag] ?? true)
- )
- );
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalVStack, { className: "dataviews-field-control", spacing: 0, children: [
- showLabel && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.BaseControl.VisualLabel, { children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Properties") }),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalVStack, { className: "dataviews-view-config__properties", spacing: 0, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalItemGroup, { isBordered: true, isSeparated: true, size: "medium", children: [
- visibleLockedFields.map(({ field, isVisibleFlag }) => {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
- FieldItem,
- {
- field,
- isVisible: true,
- onToggleVisibility: () => {
- onChangeView({
- ...view,
- [isVisibleFlag]: false
- });
- }
- },
- field.id
- );
- }),
- hiddenLockedFields.map(({ field, isVisibleFlag }) => {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
- FieldItem,
- {
- field,
- isVisible: false,
- onToggleVisibility: () => {
- onChangeView({
- ...view,
- [isVisibleFlag]: true
- });
- }
- },
- field.id
- );
- }),
- regularFields.map((field) => {
- const isVisible = visibleFieldIds.includes(field.id);
- const isLastVisible = totalVisibleFields === 1 && isVisible;
- const fieldToRender = isLastVisible ? { ...field, enableHiding: false } : field;
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
- FieldItem,
- {
- field: fieldToRender,
- isVisible,
- onToggleVisibility: () => {
- onChangeView({
- ...view,
- fields: isVisible ? visibleFieldIds.filter(
- (fieldId) => fieldId !== field.id
- ) : [...visibleFieldIds, field.id]
- });
- }
- },
- field.id
- );
- })
- ] }) })
- ] });
-}
-
-//# sourceMappingURL=properties-section.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/components/dataviews/index.js":
-/*!**************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/components/dataviews/index.js ***!
- \**************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ dataviews_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
-/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _dataviews_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
-/* harmony import */ var _dataviews_layouts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../dataviews-layouts */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/index.js");
-/* harmony import */ var _dataviews_filters__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dataviews-filters */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filters.js");
-/* harmony import */ var _dataviews_filters__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../dataviews-filters */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/toggle.js");
-/* harmony import */ var _dataviews_filters__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../dataviews-filters */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/use-filters.js");
-/* harmony import */ var _dataviews_filters__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../dataviews-filters */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filters-toggled.js");
-/* harmony import */ var _dataviews_layout__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../dataviews-layout */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-layout/index.js");
-/* harmony import */ var _dataviews_footer__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../dataviews-footer */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-footer/index.js");
-/* harmony import */ var _dataviews_search__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../dataviews-search */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-search/index.js");
-/* harmony import */ var _dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../dataviews-bulk-actions */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-bulk-actions/index.js");
-/* harmony import */ var _dataviews_pagination__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../dataviews-pagination */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-pagination/index.js");
-/* harmony import */ var _dataviews_view_config__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../dataviews-view-config */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/index.js");
-/* harmony import */ var _utils_normalize_fields__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../utils/normalize-fields */ "./node_modules/@wordpress/dataviews/build-module/utils/normalize-fields.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__);
-// packages/dataviews/src/components/dataviews/index.tsx
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-var defaultGetItemId = (item) => item.id;
-var defaultIsItemClickable = () => true;
-var EMPTY_ARRAY = [];
-var dataViewsLayouts = _dataviews_layouts__WEBPACK_IMPORTED_MODULE_4__.VIEW_LAYOUTS.filter(
- (viewLayout) => !viewLayout.isPicker
-);
-function DefaultUI({
- header,
- search = true,
- searchLabel = void 0
-}) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.Fragment, { children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack,
- {
- alignment: "top",
- justify: "space-between",
- className: "dataviews__view-actions",
- spacing: 1,
- children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack,
- {
- justify: "start",
- expanded: false,
- className: "dataviews__search",
- children: [
- search && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_dataviews_search__WEBPACK_IMPORTED_MODULE_11__["default"], { label: searchLabel }),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_dataviews_filters__WEBPACK_IMPORTED_MODULE_6__["default"], {})
- ]
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack,
- {
- spacing: 1,
- expanded: false,
- style: { flexShrink: 0 },
- children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_dataviews_view_config__WEBPACK_IMPORTED_MODULE_14__["default"], {}),
- header
- ]
- }
- )
- ]
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_dataviews_filters__WEBPACK_IMPORTED_MODULE_8__["default"], { className: "dataviews-filters__container" }),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_dataviews_layout__WEBPACK_IMPORTED_MODULE_9__["default"], {}),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_dataviews_footer__WEBPACK_IMPORTED_MODULE_10__["default"], {})
- ] });
-}
-function DataViews({
- view,
- onChangeView,
- fields,
- search = true,
- searchLabel = void 0,
- actions = EMPTY_ARRAY,
- data,
- getItemId = defaultGetItemId,
- getItemLevel,
- isLoading = false,
- paginationInfo,
- defaultLayouts: defaultLayoutsProperty,
- selection: selectionProperty,
- onChangeSelection,
- onClickItem,
- renderItemLink,
- isItemClickable = defaultIsItemClickable,
- header,
- children,
- config = { perPageSizes: [10, 20, 50, 100] },
- empty
-}) {
- const { infiniteScrollHandler } = paginationInfo;
- const containerRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
- const [containerWidth, setContainerWidth] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(0);
- const resizeObserverRef = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__.useResizeObserver)(
- (resizeObserverEntries) => {
- setContainerWidth(
- resizeObserverEntries[0].borderBoxSize[0].inlineSize
- );
- },
- { box: "border-box" }
- );
- const [selectionState, setSelectionState] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
- const isUncontrolled = selectionProperty === void 0 || onChangeSelection === void 0;
- const selection = isUncontrolled ? selectionState : selectionProperty;
- const [openedFilter, setOpenedFilter] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(null);
- function setSelectionWithChange(value) {
- const newValue = typeof value === "function" ? value(selection) : value;
- if (isUncontrolled) {
- setSelectionState(newValue);
- }
- if (onChangeSelection) {
- onChangeSelection(newValue);
- }
- }
- const _fields = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => (0,_utils_normalize_fields__WEBPACK_IMPORTED_MODULE_15__["default"])(fields), [fields]);
- const _selection = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
- return selection.filter(
- (id) => data.some((item) => getItemId(item) === id)
- );
- }, [selection, data, getItemId]);
- const filters = (0,_dataviews_filters__WEBPACK_IMPORTED_MODULE_7__["default"])(_fields, view);
- const hasPrimaryOrLockedFilters = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
- () => (filters || []).some(
- (filter) => filter.isPrimary || filter.isLocked
- ),
- [filters]
- );
- const [isShowingFilter, setIsShowingFilter] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(
- hasPrimaryOrLockedFilters
- );
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
- if (hasPrimaryOrLockedFilters && !isShowingFilter) {
- setIsShowingFilter(true);
- }
- }, [hasPrimaryOrLockedFilters, isShowingFilter]);
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
- if (!view.infiniteScrollEnabled || !containerRef.current) {
- return;
- }
- const handleScroll = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__.throttle)((event) => {
- const target = event.target;
- const scrollTop = target.scrollTop;
- const scrollHeight = target.scrollHeight;
- const clientHeight = target.clientHeight;
- if (scrollTop + clientHeight >= scrollHeight - 100) {
- infiniteScrollHandler?.();
- }
- }, 100);
- const container = containerRef.current;
- container.addEventListener("scroll", handleScroll);
- return () => {
- container.removeEventListener("scroll", handleScroll);
- handleScroll.cancel();
- };
- }, [infiniteScrollHandler, view.infiniteScrollEnabled]);
- const defaultLayouts = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
- () => Object.fromEntries(
- Object.entries(defaultLayoutsProperty).filter(
- ([layoutType]) => {
- return dataViewsLayouts.some(
- (viewLayout) => viewLayout.type === layoutType
- );
- }
- )
- ),
- [defaultLayoutsProperty]
- );
- if (!defaultLayouts[view.type]) {
- return null;
- }
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
- _dataviews_context__WEBPACK_IMPORTED_MODULE_3__["default"].Provider,
- {
- value: {
- view,
- onChangeView,
- fields: _fields,
- actions,
- data,
- isLoading,
- paginationInfo,
- selection: _selection,
- onChangeSelection: setSelectionWithChange,
- openedFilter,
- setOpenedFilter,
- getItemId,
- getItemLevel,
- isItemClickable,
- onClickItem,
- renderItemLink,
- containerWidth,
- containerRef,
- resizeObserverRef,
- defaultLayouts,
- filters,
- isShowingFilter,
- setIsShowingFilter,
- config,
- empty,
- hasInfiniteScrollHandler: !!infiniteScrollHandler
- },
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("div", { className: "dataviews-wrapper", ref: containerRef, children: children ?? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(
- DefaultUI,
- {
- header,
- search,
- searchLabel
- }
- ) })
- }
- );
-}
-var DataViewsSubComponents = DataViews;
-DataViewsSubComponents.BulkActionToolbar = _dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_12__.BulkActionsFooter;
-DataViewsSubComponents.Filters = _dataviews_filters__WEBPACK_IMPORTED_MODULE_5__["default"];
-DataViewsSubComponents.FiltersToggled = _dataviews_filters__WEBPACK_IMPORTED_MODULE_8__["default"];
-DataViewsSubComponents.FiltersToggle = _dataviews_filters__WEBPACK_IMPORTED_MODULE_6__["default"];
-DataViewsSubComponents.Layout = _dataviews_layout__WEBPACK_IMPORTED_MODULE_9__["default"];
-DataViewsSubComponents.LayoutSwitcher = _dataviews_view_config__WEBPACK_IMPORTED_MODULE_14__.ViewTypeMenu;
-DataViewsSubComponents.Pagination = _dataviews_pagination__WEBPACK_IMPORTED_MODULE_13__.DataViewsPagination;
-DataViewsSubComponents.Search = _dataviews_search__WEBPACK_IMPORTED_MODULE_11__["default"];
-DataViewsSubComponents.ViewConfig = _dataviews_view_config__WEBPACK_IMPORTED_MODULE_14__.DataviewsViewConfigDropdown;
-DataViewsSubComponents.Footer = _dataviews_footer__WEBPACK_IMPORTED_MODULE_10__["default"];
-var dataviews_default = DataViewsSubComponents;
-
-//# sourceMappingURL=index.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/constants.js":
-/*!*********************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/constants.js ***!
- \*********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ ALL_OPERATORS: () => (/* binding */ ALL_OPERATORS),
-/* harmony export */ LAYOUT_GRID: () => (/* binding */ LAYOUT_GRID),
-/* harmony export */ LAYOUT_LIST: () => (/* binding */ LAYOUT_LIST),
-/* harmony export */ LAYOUT_PICKER_GRID: () => (/* binding */ LAYOUT_PICKER_GRID),
-/* harmony export */ LAYOUT_PICKER_TABLE: () => (/* binding */ LAYOUT_PICKER_TABLE),
-/* harmony export */ LAYOUT_TABLE: () => (/* binding */ LAYOUT_TABLE),
-/* harmony export */ OPERATORS: () => (/* binding */ OPERATORS),
-/* harmony export */ OPERATOR_AFTER: () => (/* binding */ OPERATOR_AFTER),
-/* harmony export */ OPERATOR_AFTER_INC: () => (/* binding */ OPERATOR_AFTER_INC),
-/* harmony export */ OPERATOR_BEFORE: () => (/* binding */ OPERATOR_BEFORE),
-/* harmony export */ OPERATOR_BEFORE_INC: () => (/* binding */ OPERATOR_BEFORE_INC),
-/* harmony export */ OPERATOR_BETWEEN: () => (/* binding */ OPERATOR_BETWEEN),
-/* harmony export */ OPERATOR_CONTAINS: () => (/* binding */ OPERATOR_CONTAINS),
-/* harmony export */ OPERATOR_GREATER_THAN: () => (/* binding */ OPERATOR_GREATER_THAN),
-/* harmony export */ OPERATOR_GREATER_THAN_OR_EQUAL: () => (/* binding */ OPERATOR_GREATER_THAN_OR_EQUAL),
-/* harmony export */ OPERATOR_IN_THE_PAST: () => (/* binding */ OPERATOR_IN_THE_PAST),
-/* harmony export */ OPERATOR_IS: () => (/* binding */ OPERATOR_IS),
-/* harmony export */ OPERATOR_IS_ALL: () => (/* binding */ OPERATOR_IS_ALL),
-/* harmony export */ OPERATOR_IS_ANY: () => (/* binding */ OPERATOR_IS_ANY),
-/* harmony export */ OPERATOR_IS_NONE: () => (/* binding */ OPERATOR_IS_NONE),
-/* harmony export */ OPERATOR_IS_NOT: () => (/* binding */ OPERATOR_IS_NOT),
-/* harmony export */ OPERATOR_IS_NOT_ALL: () => (/* binding */ OPERATOR_IS_NOT_ALL),
-/* harmony export */ OPERATOR_LESS_THAN: () => (/* binding */ OPERATOR_LESS_THAN),
-/* harmony export */ OPERATOR_LESS_THAN_OR_EQUAL: () => (/* binding */ OPERATOR_LESS_THAN_OR_EQUAL),
-/* harmony export */ OPERATOR_NOT_CONTAINS: () => (/* binding */ OPERATOR_NOT_CONTAINS),
-/* harmony export */ OPERATOR_NOT_ON: () => (/* binding */ OPERATOR_NOT_ON),
-/* harmony export */ OPERATOR_ON: () => (/* binding */ OPERATOR_ON),
-/* harmony export */ OPERATOR_OVER: () => (/* binding */ OPERATOR_OVER),
-/* harmony export */ OPERATOR_STARTS_WITH: () => (/* binding */ OPERATOR_STARTS_WITH),
-/* harmony export */ SINGLE_SELECTION_OPERATORS: () => (/* binding */ SINGLE_SELECTION_OPERATORS),
-/* harmony export */ SORTING_DIRECTIONS: () => (/* binding */ SORTING_DIRECTIONS),
-/* harmony export */ sortArrows: () => (/* binding */ sortArrows),
-/* harmony export */ sortIcons: () => (/* binding */ sortIcons),
-/* harmony export */ sortLabels: () => (/* binding */ sortLabels),
-/* harmony export */ sortValues: () => (/* binding */ sortValues)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/arrow-down.js");
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/arrow-up.js");
-// packages/dataviews/src/constants.ts
-
-
-var OPERATOR_IS = "is";
-var OPERATOR_IS_NOT = "isNot";
-var OPERATOR_IS_ANY = "isAny";
-var OPERATOR_IS_NONE = "isNone";
-var OPERATOR_IS_ALL = "isAll";
-var OPERATOR_IS_NOT_ALL = "isNotAll";
-var OPERATOR_LESS_THAN = "lessThan";
-var OPERATOR_GREATER_THAN = "greaterThan";
-var OPERATOR_LESS_THAN_OR_EQUAL = "lessThanOrEqual";
-var OPERATOR_GREATER_THAN_OR_EQUAL = "greaterThanOrEqual";
-var OPERATOR_BEFORE = "before";
-var OPERATOR_AFTER = "after";
-var OPERATOR_BEFORE_INC = "beforeInc";
-var OPERATOR_AFTER_INC = "afterInc";
-var OPERATOR_CONTAINS = "contains";
-var OPERATOR_NOT_CONTAINS = "notContains";
-var OPERATOR_STARTS_WITH = "startsWith";
-var OPERATOR_BETWEEN = "between";
-var OPERATOR_ON = "on";
-var OPERATOR_NOT_ON = "notOn";
-var OPERATOR_IN_THE_PAST = "inThePast";
-var OPERATOR_OVER = "over";
-var ALL_OPERATORS = [
- OPERATOR_IS,
- OPERATOR_IS_NOT,
- OPERATOR_IS_ANY,
- OPERATOR_IS_NONE,
- OPERATOR_IS_ALL,
- OPERATOR_IS_NOT_ALL,
- OPERATOR_LESS_THAN,
- OPERATOR_GREATER_THAN,
- OPERATOR_LESS_THAN_OR_EQUAL,
- OPERATOR_GREATER_THAN_OR_EQUAL,
- OPERATOR_BEFORE,
- OPERATOR_AFTER,
- OPERATOR_BEFORE_INC,
- OPERATOR_AFTER_INC,
- OPERATOR_CONTAINS,
- OPERATOR_NOT_CONTAINS,
- OPERATOR_STARTS_WITH,
- OPERATOR_BETWEEN,
- OPERATOR_ON,
- OPERATOR_NOT_ON,
- OPERATOR_IN_THE_PAST,
- OPERATOR_OVER
-];
-var SINGLE_SELECTION_OPERATORS = [
- OPERATOR_IS,
- OPERATOR_IS_NOT,
- OPERATOR_LESS_THAN,
- OPERATOR_GREATER_THAN,
- OPERATOR_LESS_THAN_OR_EQUAL,
- OPERATOR_GREATER_THAN_OR_EQUAL,
- OPERATOR_BEFORE,
- OPERATOR_AFTER,
- OPERATOR_BEFORE_INC,
- OPERATOR_AFTER_INC,
- OPERATOR_CONTAINS,
- OPERATOR_NOT_CONTAINS,
- OPERATOR_STARTS_WITH,
- OPERATOR_ON,
- OPERATOR_NOT_ON
-];
-var OPERATORS = {
- [OPERATOR_IS]: {
- key: "is-filter",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Is")
- },
- [OPERATOR_IS_NOT]: {
- key: "is-not-filter",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Is not")
- },
- [OPERATOR_IS_ANY]: {
- key: "is-any-filter",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Is any")
- },
- [OPERATOR_IS_NONE]: {
- key: "is-none-filter",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Is none")
- },
- [OPERATOR_IS_ALL]: {
- key: "is-all-filter",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Is all")
- },
- [OPERATOR_IS_NOT_ALL]: {
- key: "is-not-all-filter",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Is not all")
- },
- [OPERATOR_LESS_THAN]: {
- key: "less-than-filter",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Less than")
- },
- [OPERATOR_GREATER_THAN]: {
- key: "greater-than-filter",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Greater than")
- },
- [OPERATOR_LESS_THAN_OR_EQUAL]: {
- key: "less-than-or-equal-filter",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Less than or equal")
- },
- [OPERATOR_GREATER_THAN_OR_EQUAL]: {
- key: "greater-than-or-equal-filter",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Greater than or equal")
- },
- [OPERATOR_BEFORE]: {
- key: "before-filter",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Before")
- },
- [OPERATOR_AFTER]: {
- key: "after-filter",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("After")
- },
- [OPERATOR_BEFORE_INC]: {
- key: "before-inc-filter",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Before (inc)")
- },
- [OPERATOR_AFTER_INC]: {
- key: "after-inc-filter",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("After (inc)")
- },
- [OPERATOR_CONTAINS]: {
- key: "contains-filter",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Contains")
- },
- [OPERATOR_NOT_CONTAINS]: {
- key: "not-contains-filter",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Doesn't contain")
- },
- [OPERATOR_STARTS_WITH]: {
- key: "starts-with-filter",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Starts with")
- },
- [OPERATOR_BETWEEN]: {
- key: "between-filter",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Between (inc)")
- },
- [OPERATOR_ON]: {
- key: "on-filter",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("On")
- },
- [OPERATOR_NOT_ON]: {
- key: "not-on-filter",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Not on")
- },
- [OPERATOR_IN_THE_PAST]: {
- key: "in-the-past-filter",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("In the past")
- },
- [OPERATOR_OVER]: {
- key: "over-filter",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Over")
- }
-};
-var SORTING_DIRECTIONS = ["asc", "desc"];
-var sortArrows = { asc: "\u2191", desc: "\u2193" };
-var sortValues = { asc: "ascending", desc: "descending" };
-var sortLabels = {
- asc: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Sort ascending"),
- desc: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Sort descending")
-};
-var sortIcons = {
- asc: _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"],
- desc: _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__["default"]
-};
-var LAYOUT_TABLE = "table";
-var LAYOUT_GRID = "grid";
-var LAYOUT_LIST = "list";
-var LAYOUT_PICKER_GRID = "pickerGrid";
-var LAYOUT_PICKER_TABLE = "pickerTable";
-
-//# sourceMappingURL=constants.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/array.js":
-/*!***********************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/array.js ***!
- \***********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ ArrayControl)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
-/* harmony import */ var _utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/get-custom-validity */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js");
-/* harmony import */ var _hooks_use_elements__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../hooks/use-elements */ "./node_modules/@wordpress/dataviews/build-module/hooks/use-elements.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
-// packages/dataviews/src/dataform-controls/array.tsx
-
-
-
-
-
-
-var { ValidatedFormTokenField } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_2__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.privateApis);
-function ArrayControl({
- data,
- field,
- onChange,
- hideLabelFromVision,
- validity
-}) {
- const { label, placeholder, getValue, setValue, isValid } = field;
- const value = getValue({ item: data });
- const { elements, isLoading } = (0,_hooks_use_elements__WEBPACK_IMPORTED_MODULE_4__["default"])({
- elements: field.elements,
- getElements: field.getElements
- });
- const arrayValueAsElements = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
- () => Array.isArray(value) ? value.map((token) => {
- const element = elements?.find(
- (suggestion) => suggestion.value === token
- );
- return element || { value: token, label: token };
- }) : [],
- [value, elements]
- );
- const onChangeControl = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
- (tokens) => {
- const valueTokens = tokens.map((token) => {
- if (typeof token === "object" && "value" in token) {
- return token.value;
- }
- return token;
- });
- onChange(setValue({ item: data, value: valueTokens }));
- },
- [onChange, setValue, data]
- );
- if (isLoading) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Spinner, {});
- }
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
- ValidatedFormTokenField,
- {
- required: !!isValid?.required,
- customValidity: (0,_utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__["default"])(isValid, validity),
- label: hideLabelFromVision ? void 0 : label,
- value: arrayValueAsElements,
- onChange: onChangeControl,
- placeholder,
- suggestions: elements?.map((element) => element.value),
- __experimentalValidateInput: (token) => {
- if (field.isValid?.elements && elements) {
- return elements.some(
- (element) => element.value === token || element.label === token
- );
- }
- return true;
- },
- __experimentalExpandOnFocus: elements && elements.length > 0,
- __experimentalShowHowTo: !field.isValid?.elements,
- displayTransform: (token) => {
- if (typeof token === "object" && "label" in token) {
- return token.label;
- }
- if (typeof token === "string" && elements) {
- const element = elements.find(
- (el) => el.value === token
- );
- return element?.label || token;
- }
- return token;
- },
- __experimentalRenderItem: ({ item }) => {
- if (typeof item === "string" && elements) {
- const element = elements.find(
- (el) => el.value === item
- );
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("span", { children: element?.label || item });
- }
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("span", { children: item });
- }
- }
- );
-}
-
-//# sourceMappingURL=array.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/checkbox.js":
-/*!**************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/checkbox.js ***!
- \**************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Checkbox)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
-/* harmony import */ var _utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/get-custom-validity */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
-// packages/dataviews/src/dataform-controls/checkbox.tsx
-
-
-
-
-
-var { ValidatedCheckboxControl } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_2__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.privateApis);
-function Checkbox({
- field,
- onChange,
- data,
- hideLabelFromVision,
- validity
-}) {
- const { getValue, setValue, label, description, isValid } = field;
- const onChangeControl = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
- onChange(
- setValue({ item: data, value: !getValue({ item: data }) })
- );
- }, [data, getValue, onChange, setValue]);
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
- ValidatedCheckboxControl,
- {
- required: !!field.isValid?.required,
- customValidity: (0,_utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__["default"])(isValid, validity),
- hidden: hideLabelFromVision,
- label,
- help: description,
- checked: getValue({ item: data }),
- onChange: onChangeControl
- }
- );
-}
-
-//# sourceMappingURL=checkbox.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/color.js":
-/*!***********************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/color.js ***!
- \***********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Color)
-/* harmony export */ });
-/* harmony import */ var colord__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! colord */ "./node_modules/colord/index.mjs");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
-/* harmony import */ var _utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/get-custom-validity */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
-// packages/dataviews/src/dataform-controls/color.tsx
-
-
-
-
-
-
-var { ValidatedInputControl, Picker } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_3__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.privateApis);
-var ColorPicker = ({
- color,
- onColorChange
-}) => {
- const validColor = color && (0,colord__WEBPACK_IMPORTED_MODULE_0__.colord)(color).isValid() ? color : "#ffffff";
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Dropdown,
- {
- renderToggle: ({ onToggle, isOpen }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
- "button",
- {
- type: "button",
- onClick: onToggle,
- style: {
- width: "24px",
- height: "24px",
- borderRadius: "50%",
- backgroundColor: validColor,
- border: "1px solid #ddd",
- cursor: "pointer",
- outline: isOpen ? "2px solid #007cba" : "none",
- outlineOffset: "2px",
- display: "flex",
- alignItems: "center",
- justifyContent: "center",
- padding: 0,
- margin: 0
- },
- "aria-label": "Open color picker"
- }
- ) }),
- renderContent: () => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", { style: { padding: "16px" }, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
- Picker,
- {
- color: (0,colord__WEBPACK_IMPORTED_MODULE_0__.colord)(validColor),
- onChange: onColorChange,
- enableAlpha: true
- }
- ) })
- }
- );
-};
-function Color({
- data,
- field,
- onChange,
- hideLabelFromVision,
- validity
-}) {
- const { label, placeholder, description, setValue, isValid } = field;
- const value = field.getValue({ item: data }) || "";
- const handleColorChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(
- (colorObject) => {
- onChange(setValue({ item: data, value: colorObject.toHex() }));
- },
- [data, onChange, setValue]
- );
- const handleInputChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(
- (newValue) => {
- onChange(setValue({ item: data, value: newValue || "" }));
- },
- [data, onChange, setValue]
- );
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
- ValidatedInputControl,
- {
- required: !!field.isValid?.required,
- customValidity: (0,_utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_4__["default"])(isValid, validity),
- label,
- placeholder,
- value,
- help: description,
- onChange: handleInputChange,
- hideLabelFromVision,
- type: "text",
- prefix: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
- ColorPicker,
- {
- color: value,
- onColorChange: handleColorChange
- }
- )
- }
- );
-}
-
-//# sourceMappingURL=color.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/date.js":
-/*!**********************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/date.js ***!
- \**********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ DateControl)
-/* harmony export */ });
-/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
-/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! date-fns */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/format.js");
-/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! date-fns */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/isValid.js");
-/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! date-fns */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfMonth.js");
-/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! date-fns */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfYear.js");
-/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! date-fns */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/subDays.js");
-/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! date-fns */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/subMonths.js");
-/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! date-fns */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/subYears.js");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__);
-/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/date */ "@wordpress/date");
-/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_11__);
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/error.js");
-/* harmony import */ var _utils_relative_date_control__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./utils/relative-date-control */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/relative-date-control.js");
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
-/* harmony import */ var _utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./utils/get-custom-validity */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__);
-// packages/dataviews/src/dataform-controls/date.tsx
-
-
-
-
-
-
-
-
-
-
-
-
-var { DateCalendar, DateRangeCalendar } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_15__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__.privateApis);
-var DATE_PRESETS = [
- {
- id: "today",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Today"),
- getValue: () => (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_11__.getDate)(null)
- },
- {
- id: "yesterday",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Yesterday"),
- getValue: () => {
- const today = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_11__.getDate)(null);
- return (0,date_fns__WEBPACK_IMPORTED_MODULE_5__.subDays)(today, 1);
- }
- },
- {
- id: "past-week",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Past week"),
- getValue: () => {
- const today = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_11__.getDate)(null);
- return (0,date_fns__WEBPACK_IMPORTED_MODULE_5__.subDays)(today, 7);
- }
- },
- {
- id: "past-month",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Past month"),
- getValue: () => {
- const today = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_11__.getDate)(null);
- return (0,date_fns__WEBPACK_IMPORTED_MODULE_6__.subMonths)(today, 1);
- }
- }
-];
-var DATE_RANGE_PRESETS = [
- {
- id: "last-7-days",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Last 7 days"),
- getValue: () => {
- const today = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_11__.getDate)(null);
- return [(0,date_fns__WEBPACK_IMPORTED_MODULE_5__.subDays)(today, 7), today];
- }
- },
- {
- id: "last-30-days",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Last 30 days"),
- getValue: () => {
- const today = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_11__.getDate)(null);
- return [(0,date_fns__WEBPACK_IMPORTED_MODULE_5__.subDays)(today, 30), today];
- }
- },
- {
- id: "month-to-date",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Month to date"),
- getValue: () => {
- const today = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_11__.getDate)(null);
- return [(0,date_fns__WEBPACK_IMPORTED_MODULE_3__.startOfMonth)(today), today];
- }
- },
- {
- id: "last-year",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Last year"),
- getValue: () => {
- const today = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_11__.getDate)(null);
- return [(0,date_fns__WEBPACK_IMPORTED_MODULE_7__.subYears)(today, 1), today];
- }
- },
- {
- id: "year-to-date",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Year to date"),
- getValue: () => {
- const today = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_11__.getDate)(null);
- return [(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.startOfYear)(today), today];
- }
- }
-];
-var parseDate = (dateString) => {
- if (!dateString) {
- return null;
- }
- const parsed = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_11__.getDate)(dateString);
- return parsed && (0,date_fns__WEBPACK_IMPORTED_MODULE_2__.isValid)(parsed) ? parsed : null;
-};
-var formatDate = (date) => {
- if (!date) {
- return "";
- }
- return typeof date === "string" ? date : (0,date_fns__WEBPACK_IMPORTED_MODULE_1__.format)(date, "yyyy-MM-dd");
-};
-function ValidatedDateControl({
- field,
- validity,
- inputRefs,
- isTouched,
- setIsTouched,
- children
-}) {
- const { isValid } = field;
- const [customValidity, setCustomValidity] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useState)(void 0);
- const validateRefs = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)(() => {
- const refs = Array.isArray(inputRefs) ? inputRefs : [inputRefs];
- for (const ref of refs) {
- const input = ref.current;
- if (input && !input.validity.valid) {
- setCustomValidity({
- type: "invalid",
- message: input.validationMessage
- });
- return;
- }
- }
- setCustomValidity(void 0);
- }, [inputRefs]);
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useEffect)(() => {
- if (isTouched) {
- const timeoutId = setTimeout(() => {
- if (validity) {
- setCustomValidity((0,_utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_16__["default"])(isValid, validity));
- } else {
- validateRefs();
- }
- }, 0);
- return () => clearTimeout(timeoutId);
- }
- return void 0;
- }, [isTouched, isValid, validity, validateRefs]);
- const onBlur = (event) => {
- if (isTouched) {
- return;
- }
- if (!event.relatedTarget || !event.currentTarget.contains(event.relatedTarget)) {
- setIsTouched(true);
- }
- };
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)("div", { onBlur, children: [
- children,
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)("div", { "aria-live": "polite", children: customValidity && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)(
- "p",
- {
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])(
- "components-validated-control__indicator",
- customValidity.type === "invalid" ? "is-invalid" : void 0,
- customValidity.type === "valid" ? "is-valid" : void 0
- ),
- children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_8__.Icon,
- {
- className: "components-validated-control__indicator-icon",
- icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_12__["default"],
- size: 16,
- fill: "currentColor"
- }
- ),
- customValidity.message
- ]
- }
- ) })
- ] });
-}
-function CalendarDateControl({
- data,
- field,
- onChange,
- hideLabelFromVision,
- validity
-}) {
- const { id, label, setValue, getValue, isValid } = field;
- const [selectedPresetId, setSelectedPresetId] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useState)(
- null
- );
- const fieldValue = getValue({ item: data });
- const value = typeof fieldValue === "string" ? fieldValue : void 0;
- const [calendarMonth, setCalendarMonth] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useState)(() => {
- const parsedDate = parseDate(value);
- return parsedDate || /* @__PURE__ */ new Date();
- });
- const [isTouched, setIsTouched] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useState)(false);
- const validityTargetRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useRef)(null);
- const onChangeCallback = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)(
- (newValue) => onChange(setValue({ item: data, value: newValue })),
- [data, onChange, setValue]
- );
- const onSelectDate = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)(
- (newDate) => {
- const dateValue = newDate ? (0,date_fns__WEBPACK_IMPORTED_MODULE_1__.format)(newDate, "yyyy-MM-dd") : void 0;
- onChangeCallback(dateValue);
- setSelectedPresetId(null);
- setIsTouched(true);
- },
- [onChangeCallback]
- );
- const handlePresetClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)(
- (preset) => {
- const presetDate = preset.getValue();
- const dateValue = formatDate(presetDate);
- setCalendarMonth(presetDate);
- onChangeCallback(dateValue);
- setSelectedPresetId(preset.id);
- setIsTouched(true);
- },
- [onChangeCallback]
- );
- const handleManualDateChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)(
- (newValue) => {
- onChangeCallback(newValue);
- if (newValue) {
- const parsedDate = parseDate(newValue);
- if (parsedDate) {
- setCalendarMonth(parsedDate);
- }
- }
- setSelectedPresetId(null);
- setIsTouched(true);
- },
- [onChangeCallback]
- );
- const {
- timezone: { string: timezoneString },
- l10n: { startOfWeek }
- } = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_11__.getSettings)();
- const displayLabel = isValid?.required ? `${label} (${(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Required")})` : label;
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
- ValidatedDateControl,
- {
- field,
- validity,
- inputRefs: validityTargetRef,
- isTouched,
- setIsTouched,
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_8__.BaseControl,
- {
- __nextHasNoMarginBottom: true,
- id,
- className: "dataviews-controls__date",
- label: displayLabel,
- hideLabelFromVision,
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__.__experimentalVStack, { spacing: 4, children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__.__experimentalHStack, { spacing: 2, wrap: true, justify: "flex-start", children: [
- DATE_PRESETS.map((preset) => {
- const isSelected = selectedPresetId === preset.id;
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_8__.Button,
- {
- className: "dataviews-controls__date-preset",
- variant: "tertiary",
- isPressed: isSelected,
- size: "small",
- onClick: () => handlePresetClick(preset),
- children: preset.label
- },
- preset.id
- );
- }),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_8__.Button,
- {
- className: "dataviews-controls__date-preset",
- variant: "tertiary",
- isPressed: !selectedPresetId,
- size: "small",
- disabled: !!selectedPresetId,
- accessibleWhenDisabled: false,
- children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Custom")
- }
- )
- ] }),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_8__.__experimentalInputControl,
- {
- __next40pxDefaultSize: true,
- ref: validityTargetRef,
- type: "date",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Date"),
- hideLabelFromVision: true,
- value,
- onChange: handleManualDateChange,
- required: !!field.isValid?.required
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
- DateCalendar,
- {
- style: { width: "100%" },
- selected: value ? parseDate(value) || void 0 : void 0,
- onSelect: onSelectDate,
- month: calendarMonth,
- onMonthChange: setCalendarMonth,
- timeZone: timezoneString || void 0,
- weekStartsOn: startOfWeek
- }
- )
- ] })
- }
- )
- }
- );
-}
-function CalendarDateRangeControl({
- data,
- field,
- onChange,
- hideLabelFromVision,
- validity
-}) {
- const { id, label, getValue, setValue } = field;
- let value;
- const fieldValue = getValue({ item: data });
- if (Array.isArray(fieldValue) && fieldValue.length === 2 && fieldValue.every((date) => typeof date === "string")) {
- value = fieldValue;
- }
- const onChangeCallback = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)(
- (newValue) => {
- onChange(
- setValue({
- item: data,
- value: newValue
- })
- );
- },
- [data, onChange, setValue]
- );
- const [selectedPresetId, setSelectedPresetId] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useState)(
- null
- );
- const selectedRange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useMemo)(() => {
- if (!value) {
- return { from: void 0, to: void 0 };
- }
- const [from, to] = value;
- return {
- from: parseDate(from) || void 0,
- to: parseDate(to) || void 0
- };
- }, [value]);
- const [calendarMonth, setCalendarMonth] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useState)(() => {
- return selectedRange.from || /* @__PURE__ */ new Date();
- });
- const [isTouched, setIsTouched] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useState)(false);
- const fromInputRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useRef)(null);
- const toInputRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useRef)(null);
- const updateDateRange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)(
- (fromDate, toDate) => {
- if (fromDate && toDate) {
- onChangeCallback([
- formatDate(fromDate),
- formatDate(toDate)
- ]);
- } else if (!fromDate && !toDate) {
- onChangeCallback(void 0);
- }
- },
- [onChangeCallback]
- );
- const onSelectCalendarRange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)(
- (newRange) => {
- updateDateRange(newRange?.from, newRange?.to);
- setSelectedPresetId(null);
- setIsTouched(true);
- },
- [updateDateRange]
- );
- const handlePresetClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)(
- (preset) => {
- const [startDate, endDate] = preset.getValue();
- setCalendarMonth(startDate);
- updateDateRange(startDate, endDate);
- setSelectedPresetId(preset.id);
- setIsTouched(true);
- },
- [updateDateRange]
- );
- const handleManualDateChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)(
- (fromOrTo, newValue) => {
- const [currentFrom, currentTo] = value || [
- void 0,
- void 0
- ];
- const updatedFrom = fromOrTo === "from" ? newValue : currentFrom;
- const updatedTo = fromOrTo === "to" ? newValue : currentTo;
- updateDateRange(updatedFrom, updatedTo);
- if (newValue) {
- const parsedDate = parseDate(newValue);
- if (parsedDate) {
- setCalendarMonth(parsedDate);
- }
- }
- setSelectedPresetId(null);
- setIsTouched(true);
- },
- [value, updateDateRange]
- );
- const { timezone, l10n } = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_11__.getSettings)();
- const displayLabel = field.isValid?.required ? `${label} (${(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Required")})` : label;
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
- ValidatedDateControl,
- {
- field,
- validity,
- inputRefs: [fromInputRef, toInputRef],
- isTouched,
- setIsTouched,
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_8__.BaseControl,
- {
- __nextHasNoMarginBottom: true,
- id,
- className: "dataviews-controls__date",
- label: displayLabel,
- hideLabelFromVision,
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__.__experimentalVStack, { spacing: 4, children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__.__experimentalHStack, { spacing: 2, wrap: true, justify: "flex-start", children: [
- DATE_RANGE_PRESETS.map((preset) => {
- const isSelected = selectedPresetId === preset.id;
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_8__.Button,
- {
- className: "dataviews-controls__date-preset",
- variant: "tertiary",
- isPressed: isSelected,
- size: "small",
- onClick: () => handlePresetClick(preset),
- children: preset.label
- },
- preset.id
- );
- }),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_8__.Button,
- {
- className: "dataviews-controls__date-preset",
- variant: "tertiary",
- isPressed: !selectedPresetId,
- size: "small",
- accessibleWhenDisabled: false,
- disabled: !!selectedPresetId,
- children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("Custom")
- }
- )
- ] }),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_8__.__experimentalHStack, { spacing: 2, children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_8__.__experimentalInputControl,
- {
- __next40pxDefaultSize: true,
- ref: fromInputRef,
- type: "date",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("From"),
- hideLabelFromVision: true,
- value: value?.[0],
- onChange: (newValue) => handleManualDateChange("from", newValue),
- required: !!field.isValid?.required
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_8__.__experimentalInputControl,
- {
- __next40pxDefaultSize: true,
- ref: toInputRef,
- type: "date",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__.__)("To"),
- hideLabelFromVision: true,
- value: value?.[1],
- onChange: (newValue) => handleManualDateChange("to", newValue),
- required: !!field.isValid?.required
- }
- )
- ] }),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
- DateRangeCalendar,
- {
- style: { width: "100%" },
- selected: selectedRange,
- onSelect: onSelectCalendarRange,
- month: calendarMonth,
- onMonthChange: setCalendarMonth,
- timeZone: timezone.string || void 0,
- weekStartsOn: l10n.startOfWeek
- }
- )
- ] })
- }
- )
- }
- );
-}
-function DateControl({
- data,
- field,
- onChange,
- hideLabelFromVision,
- operator,
- validity
-}) {
- if (operator === _constants__WEBPACK_IMPORTED_MODULE_14__.OPERATOR_IN_THE_PAST || operator === _constants__WEBPACK_IMPORTED_MODULE_14__.OPERATOR_OVER) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
- _utils_relative_date_control__WEBPACK_IMPORTED_MODULE_13__["default"],
- {
- className: "dataviews-controls__date",
- data,
- field,
- onChange,
- hideLabelFromVision,
- operator
- }
- );
- }
- if (operator === _constants__WEBPACK_IMPORTED_MODULE_14__.OPERATOR_BETWEEN) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
- CalendarDateRangeControl,
- {
- data,
- field,
- onChange,
- hideLabelFromVision,
- validity
- }
- );
- }
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(
- CalendarDateControl,
- {
- data,
- field,
- onChange,
- hideLabelFromVision,
- validity
- }
- );
-}
-
-//# sourceMappingURL=date.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/datetime.js":
-/*!**************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/datetime.js ***!
- \**************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ DateTime)
-/* harmony export */ });
-/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! date-fns */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/format.js");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/date */ "@wordpress/date");
-/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_4__);
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-/* harmony import */ var _utils_relative_date_control__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/relative-date-control */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/relative-date-control.js");
-/* harmony import */ var _utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/get-custom-validity */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js");
-/* harmony import */ var _field_types_utils_parse_date_time__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../field-types/utils/parse-date-time */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/parse-date-time.js");
-/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__);
-// packages/dataviews/src/dataform-controls/datetime.tsx
-
-
-
-
-
-
-
-
-
-
-
-var { DateCalendar, ValidatedInputControl } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_9__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.privateApis);
-var formatDateTime = (date) => {
- if (!date) {
- return "";
- }
- if (typeof date === "string") {
- return date;
- }
- return (0,date_fns__WEBPACK_IMPORTED_MODULE_0__.format)(date, "yyyy-MM-dd'T'HH:mm");
-};
-function CalendarDateTimeControl({
- data,
- field,
- onChange,
- hideLabelFromVision,
- validity
-}) {
- const { id, label, description, setValue, getValue, isValid } = field;
- const fieldValue = getValue({ item: data });
- const value = typeof fieldValue === "string" ? fieldValue : void 0;
- const [calendarMonth, setCalendarMonth] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(() => {
- const parsedDate = (0,_field_types_utils_parse_date_time__WEBPACK_IMPORTED_MODULE_8__["default"])(value);
- return parsedDate || /* @__PURE__ */ new Date();
- });
- const inputControlRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);
- const validationTimeoutRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)();
- const previousFocusRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);
- const onChangeCallback = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(
- (newValue) => onChange(setValue({ item: data, value: newValue })),
- [data, onChange, setValue]
- );
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
- return () => {
- if (validationTimeoutRef.current) {
- clearTimeout(validationTimeoutRef.current);
- }
- };
- }, []);
- const onSelectDate = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(
- (newDate) => {
- let dateTimeValue;
- if (newDate) {
- let finalDateTime = newDate;
- if (value) {
- const currentDateTime = (0,_field_types_utils_parse_date_time__WEBPACK_IMPORTED_MODULE_8__["default"])(value);
- if (currentDateTime) {
- finalDateTime = new Date(newDate);
- finalDateTime.setHours(currentDateTime.getHours());
- finalDateTime.setMinutes(
- currentDateTime.getMinutes()
- );
- }
- }
- dateTimeValue = finalDateTime.toISOString();
- onChangeCallback(dateTimeValue);
- if (validationTimeoutRef.current) {
- clearTimeout(validationTimeoutRef.current);
- }
- } else {
- onChangeCallback(void 0);
- }
- previousFocusRef.current = inputControlRef.current && inputControlRef.current.ownerDocument.activeElement;
- validationTimeoutRef.current = setTimeout(() => {
- if (inputControlRef.current) {
- inputControlRef.current.focus();
- inputControlRef.current.blur();
- onChangeCallback(dateTimeValue);
- if (previousFocusRef.current && previousFocusRef.current instanceof HTMLElement) {
- previousFocusRef.current.focus();
- }
- }
- }, 0);
- },
- [onChangeCallback, value]
- );
- const handleManualDateTimeChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(
- (newValue) => {
- if (newValue) {
- const dateTime = new Date(newValue);
- onChangeCallback(dateTime.toISOString());
- const parsedDate = (0,_field_types_utils_parse_date_time__WEBPACK_IMPORTED_MODULE_8__["default"])(dateTime.toISOString());
- if (parsedDate) {
- setCalendarMonth(parsedDate);
- }
- } else {
- onChangeCallback(void 0);
- }
- },
- [onChangeCallback]
- );
- const {
- timezone: { string: timezoneString },
- l10n: { startOfWeek }
- } = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_4__.getSettings)();
- const displayLabel = isValid?.required && !hideLabelFromVision ? `${label} (${(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Required")})` : label;
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.BaseControl,
- {
- __nextHasNoMarginBottom: true,
- id,
- label: displayLabel,
- help: description,
- hideLabelFromVision,
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalVStack, { spacing: 4, children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
- DateCalendar,
- {
- style: { width: "100%" },
- selected: value ? (0,_field_types_utils_parse_date_time__WEBPACK_IMPORTED_MODULE_8__["default"])(value) || void 0 : void 0,
- onSelect: onSelectDate,
- month: calendarMonth,
- onMonthChange: setCalendarMonth,
- timeZone: timezoneString || void 0,
- weekStartsOn: startOfWeek
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
- ValidatedInputControl,
- {
- ref: inputControlRef,
- __next40pxDefaultSize: true,
- required: !!isValid?.required,
- customValidity: (0,_utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_7__["default"])(isValid, validity),
- type: "datetime-local",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Date time"),
- hideLabelFromVision: true,
- value: value ? formatDateTime(
- (0,_field_types_utils_parse_date_time__WEBPACK_IMPORTED_MODULE_8__["default"])(value) || void 0
- ) : "",
- onChange: handleManualDateTimeChange
- }
- )
- ] })
- }
- );
-}
-function DateTime({
- data,
- field,
- onChange,
- hideLabelFromVision,
- operator,
- validity
-}) {
- if (operator === _constants__WEBPACK_IMPORTED_MODULE_5__.OPERATOR_IN_THE_PAST || operator === _constants__WEBPACK_IMPORTED_MODULE_5__.OPERATOR_OVER) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
- _utils_relative_date_control__WEBPACK_IMPORTED_MODULE_6__["default"],
- {
- className: "dataviews-controls__datetime",
- data,
- field,
- onChange,
- hideLabelFromVision,
- operator
- }
- );
- }
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(
- CalendarDateTimeControl,
- {
- data,
- field,
- onChange,
- hideLabelFromVision,
- validity
- }
- );
-}
-
-//# sourceMappingURL=datetime.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/email.js":
-/*!***********************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/email.js ***!
- \***********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Email)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/at-symbol.js");
-/* harmony import */ var _utils_validated_input__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/validated-input */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/validated-input.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
-// packages/dataviews/src/dataform-controls/email.tsx
-
-
-
-
-function Email({
- data,
- field,
- onChange,
- hideLabelFromVision,
- validity
-}) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(
- _utils_validated_input__WEBPACK_IMPORTED_MODULE_2__["default"],
- {
- ...{
- data,
- field,
- onChange,
- hideLabelFromVision,
- validity,
- type: "email",
- prefix: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Icon, { icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__["default"] }) })
- }
- }
- );
-}
-
-//# sourceMappingURL=email.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/index.js":
-/*!***********************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/index.js ***!
- \***********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ getControl: () => (/* binding */ getControl),
-/* harmony export */ getControlByType: () => (/* binding */ getControlByType)
-/* harmony export */ });
-/* harmony import */ var _checkbox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./checkbox */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/checkbox.js");
-/* harmony import */ var _datetime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./datetime */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/datetime.js");
-/* harmony import */ var _date__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./date */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/date.js");
-/* harmony import */ var _email__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./email */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/email.js");
-/* harmony import */ var _telephone__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./telephone */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/telephone.js");
-/* harmony import */ var _url__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./url */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/url.js");
-/* harmony import */ var _integer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./integer */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/integer.js");
-/* harmony import */ var _number__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./number */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/number.js");
-/* harmony import */ var _radio__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./radio */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/radio.js");
-/* harmony import */ var _select__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./select */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/select.js");
-/* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./text */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/text.js");
-/* harmony import */ var _toggle__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./toggle */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/toggle.js");
-/* harmony import */ var _textarea__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./textarea */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/textarea.js");
-/* harmony import */ var _toggle_group__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./toggle-group */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/toggle-group.js");
-/* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./array */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/array.js");
-/* harmony import */ var _color__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./color */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/color.js");
-/* harmony import */ var _password__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./password */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/password.js");
-/* harmony import */ var _utils_has_elements__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../utils/has-elements */ "./node_modules/@wordpress/dataviews/build-module/utils/has-elements.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__);
-// packages/dataviews/src/dataform-controls/index.tsx
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-var FORM_CONTROLS = {
- array: _array__WEBPACK_IMPORTED_MODULE_14__["default"],
- checkbox: _checkbox__WEBPACK_IMPORTED_MODULE_0__["default"],
- color: _color__WEBPACK_IMPORTED_MODULE_15__["default"],
- datetime: _datetime__WEBPACK_IMPORTED_MODULE_1__["default"],
- date: _date__WEBPACK_IMPORTED_MODULE_2__["default"],
- email: _email__WEBPACK_IMPORTED_MODULE_3__["default"],
- telephone: _telephone__WEBPACK_IMPORTED_MODULE_4__["default"],
- url: _url__WEBPACK_IMPORTED_MODULE_5__["default"],
- integer: _integer__WEBPACK_IMPORTED_MODULE_6__["default"],
- number: _number__WEBPACK_IMPORTED_MODULE_7__["default"],
- password: _password__WEBPACK_IMPORTED_MODULE_16__["default"],
- radio: _radio__WEBPACK_IMPORTED_MODULE_8__["default"],
- select: _select__WEBPACK_IMPORTED_MODULE_9__["default"],
- text: _text__WEBPACK_IMPORTED_MODULE_10__["default"],
- toggle: _toggle__WEBPACK_IMPORTED_MODULE_11__["default"],
- textarea: _textarea__WEBPACK_IMPORTED_MODULE_12__["default"],
- toggleGroup: _toggle_group__WEBPACK_IMPORTED_MODULE_13__["default"]
-};
-function isEditConfig(value) {
- return value && typeof value === "object" && typeof value.control === "string";
-}
-function createConfiguredControl(config) {
- const { control, ...controlConfig } = config;
- const BaseControlType = getControlByType(control);
- return function ConfiguredControl(props) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(BaseControlType, { ...props, config: controlConfig });
- };
-}
-function getControl(field, fieldTypeDefinition) {
- if (typeof field.Edit === "function") {
- return field.Edit;
- }
- if (typeof field.Edit === "string") {
- return getControlByType(field.Edit);
- }
- if (isEditConfig(field.Edit)) {
- return createConfiguredControl(field.Edit);
- }
- if ((0,_utils_has_elements__WEBPACK_IMPORTED_MODULE_17__["default"])(field) && field.type !== "array") {
- return getControlByType("select");
- }
- if (typeof fieldTypeDefinition.Edit === "string") {
- return getControlByType(fieldTypeDefinition.Edit);
- }
- if (isEditConfig(fieldTypeDefinition.Edit)) {
- return createConfiguredControl(fieldTypeDefinition.Edit);
- }
- return fieldTypeDefinition.Edit;
-}
-function getControlByType(type) {
- if (Object.keys(FORM_CONTROLS).includes(type)) {
- return FORM_CONTROLS[type];
- }
- throw "Control " + type + " not found";
-}
-
-//# sourceMappingURL=index.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/integer.js":
-/*!*************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/integer.js ***!
- \*************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Number)
-/* harmony export */ });
-/* harmony import */ var _utils_validated_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/validated-number */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/validated-number.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/dataviews/src/dataform-controls/integer.tsx
-
-
-function Number(props) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_utils_validated_number__WEBPACK_IMPORTED_MODULE_0__["default"], { ...props, decimals: 0 });
-}
-
-//# sourceMappingURL=integer.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/number.js":
-/*!************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/number.js ***!
- \************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Number)
-/* harmony export */ });
-/* harmony import */ var _utils_validated_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/validated-number */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/validated-number.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/dataviews/src/dataform-controls/number.tsx
-
-
-function Number(props) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_utils_validated_number__WEBPACK_IMPORTED_MODULE_0__["default"], { ...props, decimals: 2 });
-}
-
-//# sourceMappingURL=number.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/password.js":
-/*!**************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/password.js ***!
- \**************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Password)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/seen.js");
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/unseen.js");
-/* harmony import */ var _utils_validated_input__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/validated-input */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/validated-input.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__);
-// packages/dataviews/src/dataform-controls/password.tsx
-
-
-
-
-
-
-function Password({
- data,
- field,
- onChange,
- hideLabelFromVision,
- validity
-}) {
- const [isVisible, setIsVisible] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
- const toggleVisibility = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
- setIsVisible((prev) => !prev);
- }, []);
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
- _utils_validated_input__WEBPACK_IMPORTED_MODULE_5__["default"],
- {
- ...{
- data,
- field,
- onChange,
- hideLabelFromVision,
- validity,
- type: isVisible ? "text" : "password",
- suffix: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalInputControlSuffixWrapper, { variant: "control", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Button,
- {
- icon: isVisible ? _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__["default"] : _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"],
- onClick: toggleVisibility,
- size: "small",
- label: isVisible ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Hide password") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Show password")
- }
- ) })
- }
- }
- );
-}
-
-//# sourceMappingURL=password.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/radio.js":
-/*!***********************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/radio.js ***!
- \***********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Radio)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
-/* harmony import */ var _utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/get-custom-validity */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js");
-/* harmony import */ var _hooks_use_elements__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../hooks/use-elements */ "./node_modules/@wordpress/dataviews/build-module/hooks/use-elements.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
-// packages/dataviews/src/dataform-controls/radio.tsx
-
-
-
-
-
-
-var { ValidatedRadioControl } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_2__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.privateApis);
-function Radio({
- data,
- field,
- onChange,
- hideLabelFromVision,
- validity
-}) {
- const { label, description, getValue, setValue, isValid } = field;
- const { elements, isLoading } = (0,_hooks_use_elements__WEBPACK_IMPORTED_MODULE_4__["default"])({
- elements: field.elements,
- getElements: field.getElements
- });
- const value = getValue({ item: data });
- const onChangeControl = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
- (newValue) => onChange(setValue({ item: data, value: newValue })),
- [data, onChange, setValue]
- );
- if (isLoading) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Spinner, {});
- }
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
- ValidatedRadioControl,
- {
- required: !!field.isValid?.required,
- customValidity: (0,_utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__["default"])(isValid, validity),
- label,
- help: description,
- onChange: onChangeControl,
- options: elements,
- selected: value,
- hideLabelFromVision
- }
- );
-}
-
-//# sourceMappingURL=radio.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/select.js":
-/*!************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/select.js ***!
- \************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Select)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _hooks_use_elements__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../hooks/use-elements */ "./node_modules/@wordpress/dataviews/build-module/hooks/use-elements.js");
-/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
-/* harmony import */ var _utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/get-custom-validity */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
-// packages/dataviews/src/dataform-controls/select.tsx
-
-
-
-
-
-
-var { ValidatedSelectControl } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_3__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.privateApis);
-function Select({
- data,
- field,
- onChange,
- hideLabelFromVision,
- validity
-}) {
- const { type, label, description, getValue, setValue, isValid } = field;
- const isMultiple = type === "array";
- const value = getValue({ item: data }) ?? (isMultiple ? [] : "");
- const onChangeControl = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
- (newValue) => onChange(setValue({ item: data, value: newValue })),
- [data, onChange, setValue]
- );
- const { elements, isLoading } = (0,_hooks_use_elements__WEBPACK_IMPORTED_MODULE_2__["default"])({
- elements: field.elements,
- getElements: field.getElements
- });
- if (isLoading) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Spinner, {});
- }
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
- ValidatedSelectControl,
- {
- required: !!field.isValid?.required,
- customValidity: (0,_utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_4__["default"])(isValid, validity),
- label,
- value,
- help: description,
- options: elements,
- onChange: onChangeControl,
- __next40pxDefaultSize: true,
- __nextHasNoMarginBottom: true,
- hideLabelFromVision,
- multiple: isMultiple
- }
- );
-}
-
-//# sourceMappingURL=select.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/telephone.js":
-/*!***************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/telephone.js ***!
- \***************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Telephone)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/mobile.js");
-/* harmony import */ var _utils_validated_input__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/validated-input */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/validated-input.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
-// packages/dataviews/src/dataform-controls/telephone.tsx
-
-
-
-
-function Telephone({
- data,
- field,
- onChange,
- hideLabelFromVision,
- validity
-}) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(
- _utils_validated_input__WEBPACK_IMPORTED_MODULE_2__["default"],
- {
- ...{
- data,
- field,
- onChange,
- hideLabelFromVision,
- validity,
- type: "tel",
- prefix: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Icon, { icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__["default"] }) })
- }
- }
- );
-}
-
-//# sourceMappingURL=telephone.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/text.js":
-/*!**********************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/text.js ***!
- \**********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Text)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _utils_validated_input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/validated-input */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/validated-input.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
-// packages/dataviews/src/dataform-controls/text.tsx
-
-
-
-function Text({
- data,
- field,
- onChange,
- hideLabelFromVision,
- config,
- validity
-}) {
- const { prefix, suffix } = config || {};
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(
- _utils_validated_input__WEBPACK_IMPORTED_MODULE_1__["default"],
- {
- ...{
- data,
- field,
- onChange,
- hideLabelFromVision,
- validity,
- prefix: prefix ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(prefix) : void 0,
- suffix: suffix ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(suffix) : void 0
- }
- }
- );
-}
-
-//# sourceMappingURL=text.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/textarea.js":
-/*!**************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/textarea.js ***!
- \**************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Textarea)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
-/* harmony import */ var _utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/get-custom-validity */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
-// packages/dataviews/src/dataform-controls/textarea.tsx
-
-
-
-
-
-var { ValidatedTextareaControl } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_2__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.privateApis);
-function Textarea({
- data,
- field,
- onChange,
- hideLabelFromVision,
- config,
- validity
-}) {
- const { rows = 4 } = config || {};
- const { label, placeholder, description, setValue, isValid } = field;
- const value = field.getValue({ item: data });
- const onChangeControl = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
- (newValue) => onChange(setValue({ item: data, value: newValue })),
- [data, onChange, setValue]
- );
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
- ValidatedTextareaControl,
- {
- required: !!isValid?.required,
- customValidity: (0,_utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__["default"])(isValid, validity),
- label,
- placeholder,
- value: value ?? "",
- help: description,
- onChange: onChangeControl,
- rows,
- __next40pxDefaultSize: true,
- __nextHasNoMarginBottom: true,
- hideLabelFromVision
- }
- );
-}
-
-//# sourceMappingURL=textarea.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/toggle-group.js":
-/*!******************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/toggle-group.js ***!
- \******************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ ToggleGroup)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
-/* harmony import */ var _utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/get-custom-validity */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js");
-/* harmony import */ var _hooks_use_elements__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../hooks/use-elements */ "./node_modules/@wordpress/dataviews/build-module/hooks/use-elements.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
-// packages/dataviews/src/dataform-controls/toggle-group.tsx
-
-
-
-
-
-
-var { ValidatedToggleGroupControl } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_2__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.privateApis);
-function ToggleGroup({
- data,
- field,
- onChange,
- hideLabelFromVision,
- validity
-}) {
- const { getValue, setValue, isValid } = field;
- const value = getValue({ item: data });
- const onChangeControl = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
- (newValue) => onChange(setValue({ item: data, value: newValue })),
- [data, onChange, setValue]
- );
- const { elements, isLoading } = (0,_hooks_use_elements__WEBPACK_IMPORTED_MODULE_4__["default"])({
- elements: field.elements,
- getElements: field.getElements
- });
- if (isLoading) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Spinner, {});
- }
- if (elements.length === 0) {
- return null;
- }
- const selectedOption = elements.find((el) => el.value === value);
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
- ValidatedToggleGroupControl,
- {
- required: !!field.isValid?.required,
- customValidity: (0,_utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__["default"])(isValid, validity),
- __next40pxDefaultSize: true,
- __nextHasNoMarginBottom: true,
- isBlock: true,
- label: field.label,
- help: selectedOption?.description || field.description,
- onChange: onChangeControl,
- value,
- hideLabelFromVision,
- children: elements.map((el) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalToggleGroupControlOption,
- {
- label: el.label,
- value: el.value
- },
- el.value
- ))
- }
- );
-}
-
-//# sourceMappingURL=toggle-group.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/toggle.js":
-/*!************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/toggle.js ***!
- \************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Toggle)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
-/* harmony import */ var _utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/get-custom-validity */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
-// packages/dataviews/src/dataform-controls/toggle.tsx
-
-
-
-
-
-var { ValidatedToggleControl } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_2__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.privateApis);
-function Toggle({
- field,
- onChange,
- data,
- hideLabelFromVision,
- validity
-}) {
- const { label, description, getValue, setValue, isValid } = field;
- const onChangeControl = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
- onChange(
- setValue({ item: data, value: !getValue({ item: data }) })
- );
- }, [onChange, setValue, data, getValue]);
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
- ValidatedToggleControl,
- {
- required: !!isValid.required,
- customValidity: (0,_utils_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__["default"])(isValid, validity),
- hidden: hideLabelFromVision,
- __nextHasNoMarginBottom: true,
- label,
- help: description,
- checked: getValue({ item: data }),
- onChange: onChangeControl
- }
- );
-}
-
-//# sourceMappingURL=toggle.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/url.js":
-/*!*********************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/url.js ***!
- \*********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Url)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/link.js");
-/* harmony import */ var _utils_validated_input__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/validated-input */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/validated-input.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
-// packages/dataviews/src/dataform-controls/url.tsx
-
-
-
-
-function Url({
- data,
- field,
- onChange,
- hideLabelFromVision,
- validity
-}) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(
- _utils_validated_input__WEBPACK_IMPORTED_MODULE_2__["default"],
- {
- ...{
- data,
- field,
- onChange,
- hideLabelFromVision,
- validity,
- type: "url",
- prefix: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Icon, { icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__["default"] }) })
- }
- }
- );
-}
-
-//# sourceMappingURL=url.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js":
-/*!*******************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js ***!
- \*******************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ getCustomValidity)
-/* harmony export */ });
-// packages/dataviews/src/dataform-controls/utils/get-custom-validity.ts
-function getCustomValidity(isValid, validity) {
- let customValidity;
- if (isValid?.required && validity?.required) {
- customValidity = validity?.required?.message ? validity.required : void 0;
- } else if (isValid?.elements && validity?.elements) {
- customValidity = validity.elements;
- } else if (validity?.custom) {
- customValidity = validity.custom;
- }
- return customValidity;
-}
-
-//# sourceMappingURL=get-custom-validity.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/relative-date-control.js":
-/*!*********************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/relative-date-control.js ***!
- \*********************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ RelativeDateControl)
-/* harmony export */ });
-/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
-// packages/dataviews/src/dataform-controls/utils/relative-date-control.tsx
-
-
-
-
-
-
-var TIME_UNITS_OPTIONS = {
- [_constants__WEBPACK_IMPORTED_MODULE_4__.OPERATOR_IN_THE_PAST]: [
- { value: "days", label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Days") },
- { value: "weeks", label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Weeks") },
- { value: "months", label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Months") },
- { value: "years", label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Years") }
- ],
- [_constants__WEBPACK_IMPORTED_MODULE_4__.OPERATOR_OVER]: [
- { value: "days", label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Days ago") },
- { value: "weeks", label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Weeks ago") },
- { value: "months", label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Months ago") },
- { value: "years", label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Years ago") }
- ]
-};
-function RelativeDateControl({
- className,
- data,
- field,
- onChange,
- hideLabelFromVision,
- operator
-}) {
- const options = TIME_UNITS_OPTIONS[operator === _constants__WEBPACK_IMPORTED_MODULE_4__.OPERATOR_IN_THE_PAST ? "inThePast" : "over"];
- const { id, label, getValue, setValue } = field;
- const fieldValue = getValue({ item: data });
- const { value: relValue = "", unit = options[0].value } = fieldValue && typeof fieldValue === "object" ? fieldValue : {};
- const onChangeValue = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(
- (newValue) => onChange(
- setValue({
- item: data,
- value: { value: Number(newValue), unit }
- })
- ),
- [onChange, setValue, data, unit]
- );
- const onChangeUnit = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(
- (newUnit) => onChange(
- setValue({
- item: data,
- value: { value: relValue, unit: newUnit }
- })
- ),
- [onChange, setValue, data, relValue]
- );
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.BaseControl,
- {
- id,
- __nextHasNoMarginBottom: true,
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])(className, "dataviews-controls__relative-date"),
- label,
- hideLabelFromVision,
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHStack, { spacing: 2.5, children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalNumberControl,
- {
- __next40pxDefaultSize: true,
- className: "dataviews-controls__relative-date-number",
- spinControls: "none",
- min: 1,
- step: 1,
- value: relValue,
- onChange: onChangeValue
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl,
- {
- className: "dataviews-controls__relative-date-unit",
- __next40pxDefaultSize: true,
- __nextHasNoMarginBottom: true,
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Unit"),
- value: unit,
- options,
- onChange: onChangeUnit,
- hideLabelFromVision: true
- }
- )
- ] })
- }
- );
-}
-
-//# sourceMappingURL=relative-date-control.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/validated-input.js":
-/*!***************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/validated-input.js ***!
- \***************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ ValidatedText)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
-/* harmony import */ var _get_custom_validity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./get-custom-validity */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
-// packages/dataviews/src/dataform-controls/utils/validated-input.tsx
-
-
-
-
-
-var { ValidatedInputControl } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_2__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.privateApis);
-function ValidatedText({
- data,
- field,
- onChange,
- hideLabelFromVision,
- type,
- prefix,
- suffix,
- validity
-}) {
- const { label, placeholder, description, getValue, setValue, isValid } = field;
- const value = getValue({ item: data });
- const onChangeControl = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
- (newValue) => onChange(
- setValue({
- item: data,
- value: newValue
- })
- ),
- [data, setValue, onChange]
- );
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
- ValidatedInputControl,
- {
- required: !!isValid?.required,
- customValidity: (0,_get_custom_validity__WEBPACK_IMPORTED_MODULE_3__["default"])(isValid, validity),
- label,
- placeholder,
- value: value ?? "",
- help: description,
- onChange: onChangeControl,
- hideLabelFromVision,
- type,
- prefix,
- suffix,
- __next40pxDefaultSize: true
- }
- );
-}
-
-//# sourceMappingURL=validated-input.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/validated-number.js":
-/*!****************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/validated-number.js ***!
- \****************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ ValidatedNumber)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
-/* harmony import */ var _get_custom_validity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./get-custom-validity */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/utils/get-custom-validity.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__);
-// packages/dataviews/src/dataform-controls/utils/validated-number.tsx
-
-
-
-
-
-
-
-var { ValidatedNumberControl } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_4__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.privateApis);
-function toNumberOrEmpty(value) {
- if (value === "" || value === void 0) {
- return "";
- }
- const number = Number(value);
- return Number.isFinite(number) ? number : "";
-}
-function BetweenControls({
- value,
- onChange,
- hideLabelFromVision,
- step
-}) {
- const [min = "", max = ""] = value;
- const onChangeMin = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
- (newValue) => onChange([toNumberOrEmpty(newValue), max]),
- [onChange, max]
- );
- const onChangeMax = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
- (newValue) => onChange([min, toNumberOrEmpty(newValue)]),
- [onChange, min]
- );
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.BaseControl,
- {
- __nextHasNoMarginBottom: true,
- help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("The max. value must be greater than the min. value."),
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.Flex, { direction: "row", gap: 4, children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalNumberControl,
- {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Min."),
- value: min,
- max: max ? Number(max) - step : void 0,
- onChange: onChangeMin,
- __next40pxDefaultSize: true,
- hideLabelFromVision,
- step
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalNumberControl,
- {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Max."),
- value: max,
- min: min ? Number(min) + step : void 0,
- onChange: onChangeMax,
- __next40pxDefaultSize: true,
- hideLabelFromVision,
- step
- }
- )
- ] })
- }
- );
-}
-function ValidatedNumber({
- data,
- field,
- onChange,
- hideLabelFromVision,
- operator,
- decimals,
- validity
-}) {
- const step = Math.pow(10, Math.abs(decimals) * -1);
- const { label, description, getValue, setValue, isValid } = field;
- const value = getValue({ item: data }) ?? "";
- const onChangeControl = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
- (newValue) => {
- onChange(
- setValue({
- item: data,
- // Do not convert an empty string or undefined to a number,
- // otherwise there's a mismatch between the UI control (empty)
- // and the data relied by onChange (0).
- value: ["", void 0].includes(newValue) ? void 0 : Number(newValue)
- })
- );
- },
- [data, onChange, setValue]
- );
- const onChangeBetweenControls = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
- (newValue) => {
- onChange(
- setValue({
- item: data,
- value: newValue
- })
- );
- },
- [data, onChange, setValue]
- );
- if (operator === _constants__WEBPACK_IMPORTED_MODULE_3__.OPERATOR_BETWEEN) {
- let valueBetween = ["", ""];
- if (Array.isArray(value) && value.length === 2 && value.every(
- (element) => typeof element === "number" || element === ""
- )) {
- valueBetween = value;
- }
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
- BetweenControls,
- {
- value: valueBetween,
- onChange: onChangeBetweenControls,
- hideLabelFromVision,
- step
- }
- );
- }
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(
- ValidatedNumberControl,
- {
- required: !!isValid?.required,
- customValidity: (0,_get_custom_validity__WEBPACK_IMPORTED_MODULE_5__["default"])(isValid, validity),
- label,
- help: description,
- value,
- onChange: onChangeControl,
- __next40pxDefaultSize: true,
- hideLabelFromVision,
- step
- }
- );
-}
-
-//# sourceMappingURL=validated-number.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/grid/index.js":
-/*!****************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/grid/index.js ***!
- \****************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ grid_default)
-/* harmony export */ });
-/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
-/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes");
-/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__);
-/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
-/* harmony import */ var _components_dataviews_item_actions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../components/dataviews-item-actions */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-item-actions/index.js");
-/* harmony import */ var _components_dataviews_selection_checkbox__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../components/dataviews-selection-checkbox */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-selection-checkbox/index.js");
-/* harmony import */ var _components_dataviews_context__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../components/dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
-/* harmony import */ var _components_dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../components/dataviews-bulk-actions */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-bulk-actions/index.js");
-/* harmony import */ var _utils_item_click_wrapper__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../utils/item-click-wrapper */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/item-click-wrapper.js");
-/* harmony import */ var _utils_grid_items__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../utils/grid-items */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/grid-items.js");
-/* harmony import */ var _utils_get_data_by_group__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../utils/get-data-by-group */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/get-data-by-group.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__);
-// packages/dataviews/src/dataviews-layouts/grid/index.tsx
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-var { Badge } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_6__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.privateApis);
-function GridItem({
- view,
- selection,
- onChangeSelection,
- onClickItem,
- isItemClickable,
- renderItemLink,
- getItemId,
- item,
- actions,
- mediaField,
- titleField,
- descriptionField,
- regularFields,
- badgeFields,
- hasBulkActions,
- config,
- posinset
-}) {
- const {
- showTitle = true,
- showMedia = true,
- showDescription = true,
- infiniteScrollEnabled
- } = view;
- const hasBulkAction = (0,_components_dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_10__.useHasAPossibleBulkAction)(actions, item);
- const id = getItemId(item);
- const instanceId = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__.useInstanceId)(GridItem);
- const isSelected = selection.includes(id);
- const renderedMediaField = mediaField?.render ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
- mediaField.render,
- {
- item,
- field: mediaField,
- config
- }
- ) : null;
- const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(titleField.render, { item, field: titleField }) : null;
- const shouldRenderMedia = showMedia && renderedMediaField;
- let mediaA11yProps;
- let titleA11yProps;
- if (isItemClickable(item) && onClickItem) {
- if (renderedTitleField) {
- mediaA11yProps = {
- "aria-labelledby": `dataviews-view-grid__title-field-${instanceId}`
- };
- titleA11yProps = {
- id: `dataviews-view-grid__title-field-${instanceId}`
- };
- } else {
- mediaA11yProps = {
- "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Navigate to item")
- };
- }
- }
- const { paginationInfo } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useContext)(_components_dataviews_context__WEBPACK_IMPORTED_MODULE_9__["default"]);
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalVStack,
- {
- spacing: 0,
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])("dataviews-view-grid__card", {
- "is-selected": hasBulkAction && isSelected
- }),
- onClickCapture: (event) => {
- if ((0,_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4__.isAppleOS)() ? event.metaKey : event.ctrlKey) {
- event.stopPropagation();
- event.preventDefault();
- if (!hasBulkAction) {
- return;
- }
- onChangeSelection(
- selection.includes(id) ? selection.filter((itemId) => id !== itemId) : [...selection, id]
- );
- }
- },
- role: infiniteScrollEnabled ? "article" : void 0,
- "aria-setsize": infiniteScrollEnabled ? paginationInfo.totalItems : void 0,
- "aria-posinset": posinset,
- children: [
- shouldRenderMedia && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
- _utils_item_click_wrapper__WEBPACK_IMPORTED_MODULE_11__.ItemClickWrapper,
- {
- item,
- isItemClickable,
- onClickItem,
- renderItemLink,
- className: "dataviews-view-grid__media",
- ...mediaA11yProps,
- children: renderedMediaField
- }
- ),
- hasBulkActions && shouldRenderMedia && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
- _components_dataviews_selection_checkbox__WEBPACK_IMPORTED_MODULE_8__["default"],
- {
- item,
- selection,
- onChangeSelection,
- getItemId,
- titleField,
- disabled: !hasBulkAction
- }
- ),
- !showTitle && shouldRenderMedia && !!actions?.length && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)("div", { className: "dataviews-view-grid__media-actions", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_components_dataviews_item_actions__WEBPACK_IMPORTED_MODULE_7__["default"], { item, actions, isCompact: true }) }),
- showTitle && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHStack,
- {
- justify: "space-between",
- className: "dataviews-view-grid__title-actions",
- children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
- _utils_item_click_wrapper__WEBPACK_IMPORTED_MODULE_11__.ItemClickWrapper,
- {
- item,
- isItemClickable,
- onClickItem,
- renderItemLink,
- className: "dataviews-view-grid__title-field dataviews-title-field",
- ...titleA11yProps,
- children: renderedTitleField
- }
- ),
- !!actions?.length && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
- _components_dataviews_item_actions__WEBPACK_IMPORTED_MODULE_7__["default"],
- {
- item,
- actions,
- isCompact: true
- }
- )
- ]
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalVStack, { spacing: 1, children: [
- showDescription && descriptionField?.render && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
- descriptionField.render,
- {
- item,
- field: descriptionField
- }
- ),
- !!badgeFields?.length && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHStack,
- {
- className: "dataviews-view-grid__badge-fields",
- spacing: 2,
- wrap: true,
- alignment: "top",
- justify: "flex-start",
- children: badgeFields.map((field) => {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
- Badge,
- {
- className: "dataviews-view-grid__field-value",
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
- field.render,
- {
- item,
- field
- }
- )
- },
- field.id
- );
- })
- }
- ),
- !!regularFields?.length && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalVStack,
- {
- className: "dataviews-view-grid__fields",
- spacing: 1,
- children: regularFields.map((field) => {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Flex,
- {
- className: "dataviews-view-grid__field",
- gap: 1,
- justify: "flex-start",
- expanded: true,
- style: { height: "auto" },
- direction: "row",
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.Fragment, { children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Tooltip, { text: field.label, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.FlexItem, { className: "dataviews-view-grid__field-name", children: field.header }) }),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.FlexItem,
- {
- className: "dataviews-view-grid__field-value",
- style: { maxHeight: "none" },
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
- field.render,
- {
- item,
- field
- }
- )
- }
- )
- ] })
- },
- field.id
- );
- })
- }
- )
- ] })
- ]
- },
- id
- );
-}
-function ViewGrid({
- actions,
- data,
- fields,
- getItemId,
- isLoading,
- onChangeSelection,
- onClickItem,
- isItemClickable,
- renderItemLink,
- selection,
- view,
- className,
- empty
-}) {
- const { resizeObserverRef } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useContext)(_components_dataviews_context__WEBPACK_IMPORTED_MODULE_9__["default"]);
- const titleField = fields.find(
- (field) => field.id === view?.titleField
- );
- const mediaField = fields.find(
- (field) => field.id === view?.mediaField
- );
- const descriptionField = fields.find(
- (field) => field.id === view?.descriptionField
- );
- const otherFields = view.fields ?? [];
- const { regularFields, badgeFields } = otherFields.reduce(
- (accumulator, fieldId) => {
- const field = fields.find((f) => f.id === fieldId);
- if (!field) {
- return accumulator;
- }
- const key = view.layout?.badgeFields?.includes(fieldId) ? "badgeFields" : "regularFields";
- accumulator[key].push(field);
- return accumulator;
- },
- { regularFields: [], badgeFields: [] }
- );
- const hasData = !!data?.length;
- const hasBulkActions = (0,_components_dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_10__.useSomeItemHasAPossibleBulkAction)(actions, data);
- const usedPreviewSize = view.layout?.previewSize;
- const size = "900px";
- const groupField = view.groupByField ? fields.find((f) => f.id === view.groupByField) : null;
- const dataByGroup = groupField ? (0,_utils_get_data_by_group__WEBPACK_IMPORTED_MODULE_13__["default"])(data, groupField) : null;
- const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup;
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.Fragment, {
- // Render multiple groups.
- children: [
- hasData && groupField && dataByGroup && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalVStack, { spacing: 4, children: Array.from(dataByGroup.entries()).map(
- ([groupName, groupItems]) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalVStack, { spacing: 2, children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)("h3", { className: "dataviews-view-grid__group-header", children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s: %2$s"),
- groupField.label,
- groupName
- ) }),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
- _utils_grid_items__WEBPACK_IMPORTED_MODULE_12__.GridItems,
- {
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])(
- "dataviews-view-grid",
- className
- ),
- previewSize: usedPreviewSize,
- "aria-busy": isLoading,
- ref: resizeObserverRef,
- children: groupItems.map((item) => {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
- GridItem,
- {
- view,
- selection,
- onChangeSelection,
- onClickItem,
- isItemClickable,
- renderItemLink,
- getItemId,
- item,
- actions,
- mediaField,
- titleField,
- descriptionField,
- regularFields,
- badgeFields,
- hasBulkActions,
- config: {
- sizes: size
- }
- },
- getItemId(item)
- );
- })
- }
- )
- ] }, groupName)
- ) }),
- // Render a single grid with all data.
- hasData && !dataByGroup && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
- _utils_grid_items__WEBPACK_IMPORTED_MODULE_12__.GridItems,
- {
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])("dataviews-view-grid", className),
- previewSize: usedPreviewSize,
- "aria-busy": isLoading,
- ref: resizeObserverRef,
- role: isInfiniteScroll ? "feed" : void 0,
- children: data.map((item, index) => {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
- GridItem,
- {
- view,
- selection,
- onChangeSelection,
- onClickItem,
- isItemClickable,
- renderItemLink,
- getItemId,
- item,
- actions,
- mediaField,
- titleField,
- descriptionField,
- regularFields,
- badgeFields,
- hasBulkActions,
- config: {
- sizes: size
- },
- posinset: isInfiniteScroll ? index + 1 : void 0
- },
- getItemId(item)
- );
- })
- }
- ),
- // Render empty state.
- !hasData && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(
- "div",
- {
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])({
- "dataviews-loading": isLoading,
- "dataviews-no-results": !isLoading
- }),
- children: isLoading ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)("p", { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Spinner, {}) }) : empty
- }
- ),
- hasData && isLoading && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Spinner, {}) })
- ]
- });
-}
-var grid_default = ViewGrid;
-
-//# sourceMappingURL=index.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/index.js":
-/*!***********************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/index.js ***!
- \***********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ VIEW_LAYOUTS: () => (/* binding */ VIEW_LAYOUTS)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/block-table.js");
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/category.js");
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/format-list-bullets-rtl.js");
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/format-list-bullets.js");
-/* harmony import */ var _table__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./table */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/index.js");
-/* harmony import */ var _grid__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./grid */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/grid/index.js");
-/* harmony import */ var _list__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./list */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/list/index.js");
-/* harmony import */ var _picker_grid__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./picker-grid */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/picker-grid/index.js");
-/* harmony import */ var _picker_table__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./picker-table */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/picker-table/index.js");
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-/* harmony import */ var _utils_preview_size_picker__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils/preview-size-picker */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/preview-size-picker.js");
-/* harmony import */ var _table_density_picker__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./table/density-picker */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/density-picker.js");
-// packages/dataviews/src/dataviews-layouts/index.ts
-
-
-
-
-
-
-
-
-
-
-var VIEW_LAYOUTS = [
- {
- type: _constants__WEBPACK_IMPORTED_MODULE_10__.LAYOUT_TABLE,
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Table"),
- component: _table__WEBPACK_IMPORTED_MODULE_5__["default"],
- icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__["default"],
- viewConfigOptions: _table_density_picker__WEBPACK_IMPORTED_MODULE_12__["default"]
- },
- {
- type: _constants__WEBPACK_IMPORTED_MODULE_10__.LAYOUT_GRID,
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Grid"),
- component: _grid__WEBPACK_IMPORTED_MODULE_6__["default"],
- icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"],
- viewConfigOptions: _utils_preview_size_picker__WEBPACK_IMPORTED_MODULE_11__["default"]
- },
- {
- type: _constants__WEBPACK_IMPORTED_MODULE_10__.LAYOUT_LIST,
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("List"),
- component: _list__WEBPACK_IMPORTED_MODULE_7__["default"],
- icon: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.isRTL)() ? _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"] : _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__["default"]
- },
- {
- type: _constants__WEBPACK_IMPORTED_MODULE_10__.LAYOUT_PICKER_GRID,
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Grid"),
- component: _picker_grid__WEBPACK_IMPORTED_MODULE_8__["default"],
- icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"],
- viewConfigOptions: _utils_preview_size_picker__WEBPACK_IMPORTED_MODULE_11__["default"],
- isPicker: true
- },
- {
- type: _constants__WEBPACK_IMPORTED_MODULE_10__.LAYOUT_PICKER_TABLE,
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Table"),
- component: _picker_table__WEBPACK_IMPORTED_MODULE_9__["default"],
- icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__["default"],
- viewConfigOptions: _table_density_picker__WEBPACK_IMPORTED_MODULE_12__["default"],
- isPicker: true
- }
-];
-
-//# sourceMappingURL=index.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/list/index.js":
-/*!****************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/list/index.js ***!
- \****************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ ViewList)
-/* harmony export */ });
-/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
-/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
-/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/more-vertical.js");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__);
-/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
-/* harmony import */ var _components_dataviews_item_actions__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../components/dataviews-item-actions */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-item-actions/index.js");
-/* harmony import */ var _components_dataviews_context__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../components/dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
-/* harmony import */ var _utils_get_data_by_group__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils/get-data-by-group */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/get-data-by-group.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__);
-// packages/dataviews/src/dataviews-layouts/list/index.tsx
-
-
-
-
-
-
-
-
-
-
-
-
-var { Menu } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_7__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.privateApis);
-function generateItemWrapperCompositeId(idPrefix) {
- return `${idPrefix}-item-wrapper`;
-}
-function generatePrimaryActionCompositeId(idPrefix, primaryActionId) {
- return `${idPrefix}-primary-action-${primaryActionId}`;
-}
-function generateDropdownTriggerCompositeId(idPrefix) {
- return `${idPrefix}-dropdown`;
-}
-function PrimaryActionGridCell({
- idPrefix,
- primaryAction,
- item
-}) {
- const registry = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_6__.useRegistry)();
- const [isModalOpen, setIsModalOpen] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(false);
- const compositeItemId = generatePrimaryActionCompositeId(
- idPrefix,
- primaryAction.id
- );
- const label = typeof primaryAction.label === "string" ? primaryAction.label : primaryAction.label([item]);
- return "RenderModal" in primaryAction ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", { role: "gridcell", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Composite.Item,
- {
- id: compositeItemId,
- render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button,
- {
- disabled: !!primaryAction.disabled,
- accessibleWhenDisabled: true,
- text: label,
- size: "small",
- onClick: () => setIsModalOpen(true)
- }
- ),
- children: isModalOpen && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _components_dataviews_item_actions__WEBPACK_IMPORTED_MODULE_8__.ActionModal,
- {
- action: primaryAction,
- items: [item],
- closeModal: () => setIsModalOpen(false)
- }
- )
- }
- ) }, primaryAction.id) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", { role: "gridcell", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Composite.Item,
- {
- id: compositeItemId,
- render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button,
- {
- disabled: !!primaryAction.disabled,
- accessibleWhenDisabled: true,
- size: "small",
- onClick: () => {
- primaryAction.callback([item], { registry });
- },
- children: label
- }
- )
- }
- ) }, primaryAction.id);
-}
-function ListItem({
- view,
- actions,
- idPrefix,
- isSelected,
- item,
- titleField,
- mediaField,
- descriptionField,
- onSelect,
- otherFields,
- onDropdownTriggerKeyDown,
- posinset
-}) {
- const {
- showTitle = true,
- showMedia = true,
- showDescription = true,
- infiniteScrollEnabled
- } = view;
- const itemRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)(null);
- const labelId = `${idPrefix}-label`;
- const descriptionId = `${idPrefix}-description`;
- const registry = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_6__.useRegistry)();
- const [isHovered, setIsHovered] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(false);
- const [activeModalAction, setActiveModalAction] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(
- null
- );
- const handleHover = ({ type }) => {
- const isHover = type === "mouseenter";
- setIsHovered(isHover);
- };
- const { paginationInfo } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useContext)(_components_dataviews_context__WEBPACK_IMPORTED_MODULE_9__["default"]);
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
- if (isSelected) {
- itemRef.current?.scrollIntoView({
- behavior: "auto",
- block: "nearest",
- inline: "nearest"
- });
- }
- }, [isSelected]);
- const { primaryAction, eligibleActions } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useMemo)(() => {
- const _eligibleActions = actions.filter(
- (action) => !action.isEligible || action.isEligible(item)
- );
- const _primaryActions = _eligibleActions.filter(
- (action) => action.isPrimary
- );
- return {
- primaryAction: _primaryActions[0],
- eligibleActions: _eligibleActions
- };
- }, [actions, item]);
- const hasOnlyOnePrimaryAction = primaryAction && actions.length === 1;
- const renderedMediaField = showMedia && mediaField?.render ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", { className: "dataviews-view-list__media-wrapper", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- mediaField.render,
- {
- item,
- field: mediaField,
- config: { sizes: "52px" }
- }
- ) }) : null;
- const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(titleField.render, { item, field: titleField }) : null;
- const usedActions = eligibleActions?.length > 0 && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalHStack, { spacing: 3, className: "dataviews-view-list__item-actions", children: [
- primaryAction && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- PrimaryActionGridCell,
- {
- idPrefix,
- primaryAction,
- item
- }
- ),
- !hasOnlyOnePrimaryAction && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", { role: "gridcell", children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(Menu, { placement: "bottom-end", children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- Menu.TriggerButton,
- {
- render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Composite.Item,
- {
- id: generateDropdownTriggerCompositeId(
- idPrefix
- ),
- render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button,
- {
- size: "small",
- icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__["default"],
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)("Actions"),
- accessibleWhenDisabled: true,
- disabled: !actions.length,
- onKeyDown: onDropdownTriggerKeyDown
- }
- )
- }
- )
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(Menu.Popover, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _components_dataviews_item_actions__WEBPACK_IMPORTED_MODULE_8__.ActionsMenuGroup,
- {
- actions: eligibleActions,
- item,
- registry,
- setActiveModalAction
- }
- ) })
- ] }),
- !!activeModalAction && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _components_dataviews_item_actions__WEBPACK_IMPORTED_MODULE_8__.ActionModal,
- {
- action: activeModalAction,
- items: [item],
- closeModal: () => setActiveModalAction(null)
- }
- )
- ] })
- ] });
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Composite.Row,
- {
- ref: itemRef,
- render: (
- /* aria-posinset breaks Composite.Row if passed to it directly. */
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- "div",
- {
- "aria-posinset": posinset,
- "aria-setsize": infiniteScrollEnabled ? paginationInfo.totalItems : void 0
- }
- )
- ),
- role: infiniteScrollEnabled ? "article" : "row",
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])({
- "is-selected": isSelected,
- "is-hovered": isHovered
- }),
- onMouseEnter: handleHover,
- onMouseLeave: handleHover,
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalHStack, { className: "dataviews-view-list__item-wrapper", spacing: 0, children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", { role: "gridcell", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Composite.Item,
- {
- id: generateItemWrapperCompositeId(idPrefix),
- "aria-pressed": isSelected,
- "aria-labelledby": labelId,
- "aria-describedby": descriptionId,
- className: "dataviews-view-list__item",
- onClick: () => onSelect(item)
- }
- ) }),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalHStack, { spacing: 3, justify: "start", alignment: "flex-start", children: [
- renderedMediaField,
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalVStack,
- {
- spacing: 1,
- className: "dataviews-view-list__field-wrapper",
- children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalHStack, { spacing: 0, children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- "div",
- {
- className: "dataviews-title-field",
- id: labelId,
- children: renderedTitleField
- }
- ),
- usedActions
- ] }),
- showDescription && descriptionField?.render && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", { className: "dataviews-view-list__field", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- descriptionField.render,
- {
- item,
- field: descriptionField
- }
- ) }),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- "div",
- {
- className: "dataviews-view-list__fields",
- id: descriptionId,
- children: otherFields.map((field) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(
- "div",
- {
- className: "dataviews-view-list__field",
- children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.VisuallyHidden,
- {
- as: "span",
- className: "dataviews-view-list__field-label",
- children: field.label
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", { className: "dataviews-view-list__field-value", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- field.render,
- {
- item,
- field
- }
- ) })
- ]
- },
- field.id
- ))
- }
- )
- ]
- }
- )
- ] })
- ] })
- }
- );
-}
-function isDefined(item) {
- return !!item;
-}
-function ViewList(props) {
- const {
- actions,
- data,
- fields,
- getItemId,
- isLoading,
- onChangeSelection,
- selection,
- view,
- className,
- empty
- } = props;
- const baseId = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__.useInstanceId)(ViewList, "view-list");
- const selectedItem = data?.findLast(
- (item) => selection.includes(getItemId(item))
- );
- const titleField = fields.find((field) => field.id === view.titleField);
- const mediaField = fields.find((field) => field.id === view.mediaField);
- const descriptionField = fields.find(
- (field) => field.id === view.descriptionField
- );
- const otherFields = (view?.fields ?? []).map((fieldId) => fields.find((f) => fieldId === f.id)).filter(isDefined);
- const onSelect = (item) => onChangeSelection([getItemId(item)]);
- const generateCompositeItemIdPrefix = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(
- (item) => `${baseId}-${getItemId(item)}`,
- [baseId, getItemId]
- );
- const isActiveCompositeItem = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(
- (item, idToCheck) => {
- return idToCheck.startsWith(
- generateCompositeItemIdPrefix(item)
- );
- },
- [generateCompositeItemIdPrefix]
- );
- const [activeCompositeId, setActiveCompositeId] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(void 0);
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
- if (selectedItem) {
- setActiveCompositeId(
- generateItemWrapperCompositeId(
- generateCompositeItemIdPrefix(selectedItem)
- )
- );
- }
- }, [selectedItem, generateCompositeItemIdPrefix]);
- const activeItemIndex = data.findIndex(
- (item) => isActiveCompositeItem(item, activeCompositeId ?? "")
- );
- const previousActiveItemIndex = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__.usePrevious)(activeItemIndex);
- const isActiveIdInList = activeItemIndex !== -1;
- const selectCompositeItem = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(
- (targetIndex, generateCompositeId) => {
- const clampedIndex = Math.min(
- data.length - 1,
- Math.max(0, targetIndex)
- );
- if (!data[clampedIndex]) {
- return;
- }
- const itemIdPrefix = generateCompositeItemIdPrefix(
- data[clampedIndex]
- );
- const targetCompositeItemId = generateCompositeId(itemIdPrefix);
- setActiveCompositeId(targetCompositeItemId);
- document.getElementById(targetCompositeItemId)?.focus();
- },
- [data, generateCompositeItemIdPrefix]
- );
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
- const wasActiveIdInList = previousActiveItemIndex !== void 0 && previousActiveItemIndex !== -1;
- if (!isActiveIdInList && wasActiveIdInList) {
- selectCompositeItem(
- previousActiveItemIndex,
- generateItemWrapperCompositeId
- );
- }
- }, [isActiveIdInList, selectCompositeItem, previousActiveItemIndex]);
- const onDropdownTriggerKeyDown = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(
- (event) => {
- if (event.key === "ArrowDown") {
- event.preventDefault();
- selectCompositeItem(
- activeItemIndex + 1,
- generateDropdownTriggerCompositeId
- );
- }
- if (event.key === "ArrowUp") {
- event.preventDefault();
- selectCompositeItem(
- activeItemIndex - 1,
- generateDropdownTriggerCompositeId
- );
- }
- },
- [selectCompositeItem, activeItemIndex]
- );
- const hasData = data?.length;
- if (!hasData) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- "div",
- {
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])({
- "dataviews-loading": isLoading,
- "dataviews-no-results": !hasData && !isLoading
- }),
- children: !hasData && (isLoading ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("p", { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Spinner, {}) }) : empty)
- }
- );
- }
- const groupField = view.groupByField ? fields.find((field) => field.id === view.groupByField) : null;
- const dataByGroup = groupField ? (0,_utils_get_data_by_group__WEBPACK_IMPORTED_MODULE_10__["default"])(data, groupField) : null;
- if (hasData && groupField && dataByGroup) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Composite,
- {
- id: `${baseId}`,
- render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {}),
- className: "dataviews-view-list__group",
- role: "grid",
- activeId: activeCompositeId,
- setActiveId: setActiveCompositeId,
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalVStack,
- {
- spacing: 4,
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])("dataviews-view-list", className),
- children: Array.from(dataByGroup.entries()).map(
- ([groupName, groupItems]) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalVStack, { spacing: 2, children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("h3", { className: "dataviews-view-list__group-header", children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.sprintf)(
- // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)("%1$s: %2$s"),
- groupField.label,
- groupName
- ) }),
- groupItems.map((item) => {
- const id = generateCompositeItemIdPrefix(item);
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- ListItem,
- {
- view,
- idPrefix: id,
- actions,
- item,
- isSelected: item === selectedItem,
- onSelect,
- mediaField,
- titleField,
- descriptionField,
- otherFields,
- onDropdownTriggerKeyDown
- },
- id
- );
- })
- ] }, groupName)
- )
- }
- )
- }
- );
- }
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.Fragment, { children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Composite,
- {
- id: baseId,
- render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {}),
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])("dataviews-view-list", className),
- role: view.infiniteScrollEnabled ? "feed" : "grid",
- activeId: activeCompositeId,
- setActiveId: setActiveCompositeId,
- children: data.map((item, index) => {
- const id = generateCompositeItemIdPrefix(item);
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- ListItem,
- {
- view,
- idPrefix: id,
- actions,
- item,
- isSelected: item === selectedItem,
- onSelect,
- mediaField,
- titleField,
- descriptionField,
- otherFields,
- onDropdownTriggerKeyDown,
- posinset: view.infiniteScrollEnabled ? index + 1 : void 0
- },
- id
- );
- })
- }
- ),
- hasData && isLoading && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Spinner, {}) })
- ] });
-}
-
-//# sourceMappingURL=index.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/picker-grid/index.js":
-/*!***********************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/picker-grid/index.js ***!
- \***********************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ picker_grid_default)
-/* harmony export */ });
-/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
-/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__);
-/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
-/* harmony import */ var _components_dataviews_selection_checkbox__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../components/dataviews-selection-checkbox */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-selection-checkbox/index.js");
-/* harmony import */ var _components_dataviews_context__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../components/dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
-/* harmony import */ var _components_dataviews_picker_footer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../components/dataviews-picker/footer */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-picker/footer.js");
-/* harmony import */ var _utils_grid_items__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../utils/grid-items */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/grid-items.js");
-/* harmony import */ var _utils_get_data_by_group__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils/get-data-by-group */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/get-data-by-group.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__);
-// packages/dataviews/src/dataviews-layouts/picker-grid/index.tsx
-
-
-
-
-
-
-
-
-
-
-
-
-var { Badge } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_5__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.privateApis);
-function GridItem({
- view,
- multiselect,
- selection,
- onChangeSelection,
- getItemId,
- item,
- mediaField,
- titleField,
- descriptionField,
- regularFields,
- badgeFields,
- config,
- posinset,
- setsize
-}) {
- const { showTitle = true, showMedia = true, showDescription = true } = view;
- const id = getItemId(item);
- const isSelected = selection.includes(id);
- const renderedMediaField = mediaField?.render ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- mediaField.render,
- {
- item,
- field: mediaField,
- config
- }
- ) : null;
- const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(titleField.render, { item, field: titleField }) : null;
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Composite.Item,
- {
- "aria-label": titleField ? titleField.getValue({ item }) || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("(no title)") : void 0,
- render: ({ children, ...props }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalVStack, { spacing: 0, children, ...props }),
- role: "option",
- "aria-posinset": posinset,
- "aria-setsize": setsize,
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])("dataviews-view-picker-grid__card", {
- "is-selected": isSelected
- }),
- "aria-selected": isSelected,
- onClick: () => {
- if (isSelected) {
- onChangeSelection(
- selection.filter((itemId) => id !== itemId)
- );
- } else {
- const newSelection = multiselect ? [...selection, id] : [id];
- onChangeSelection(newSelection);
- }
- },
- children: [
- showMedia && renderedMediaField && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", { className: "dataviews-view-picker-grid__media", children: renderedMediaField }),
- showMedia && renderedMediaField && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _components_dataviews_selection_checkbox__WEBPACK_IMPORTED_MODULE_6__["default"],
- {
- item,
- selection,
- onChangeSelection,
- getItemId,
- titleField,
- disabled: false,
- "aria-hidden": true,
- tabIndex: -1
- }
- ),
- showTitle && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHStack,
- {
- justify: "space-between",
- className: "dataviews-view-picker-grid__title-actions",
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", { className: "dataviews-view-picker-grid__title-field dataviews-title-field", children: renderedTitleField })
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalVStack, { spacing: 1, children: [
- showDescription && descriptionField?.render && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- descriptionField.render,
- {
- item,
- field: descriptionField
- }
- ),
- !!badgeFields?.length && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalHStack,
- {
- className: "dataviews-view-picker-grid__badge-fields",
- spacing: 2,
- wrap: true,
- alignment: "top",
- justify: "flex-start",
- children: badgeFields.map((field) => {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- Badge,
- {
- className: "dataviews-view-picker-grid__field-value",
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- field.render,
- {
- item,
- field
- }
- )
- },
- field.id
- );
- })
- }
- ),
- !!regularFields?.length && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalVStack,
- {
- className: "dataviews-view-picker-grid__fields",
- spacing: 1,
- children: regularFields.map((field) => {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Flex,
- {
- className: "dataviews-view-picker-grid__field",
- gap: 1,
- justify: "flex-start",
- expanded: true,
- style: { height: "auto" },
- direction: "row",
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.Fragment, { children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.FlexItem, { className: "dataviews-view-picker-grid__field-name", children: field.header }),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.FlexItem,
- {
- className: "dataviews-view-picker-grid__field-value",
- style: { maxHeight: "none" },
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- field.render,
- {
- item,
- field
- }
- )
- }
- )
- ] })
- },
- field.id
- );
- })
- }
- )
- ] })
- ]
- },
- id
- );
-}
-function GridGroup({
- groupName,
- groupField,
- children
-}) {
- const headerId = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__.useInstanceId)(
- GridGroup,
- "dataviews-view-picker-grid-group__header"
- );
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalVStack,
- {
- spacing: 2,
- role: "group",
- "aria-labelledby": headerId,
- children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- "h3",
- {
- className: "dataviews-view-picker-grid-group__header",
- id: headerId,
- children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
- // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("%1$s: %2$s"),
- groupField.label,
- groupName
- )
- }
- ),
- children
- ]
- },
- groupName
- );
-}
-function ViewPickerGrid({
- actions,
- data,
- fields,
- getItemId,
- isLoading,
- onChangeSelection,
- selection,
- view,
- className,
- empty
-}) {
- const { resizeObserverRef, paginationInfo, itemListLabel } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useContext)(_components_dataviews_context__WEBPACK_IMPORTED_MODULE_7__["default"]);
- const titleField = fields.find(
- (field) => field.id === view?.titleField
- );
- const mediaField = fields.find(
- (field) => field.id === view?.mediaField
- );
- const descriptionField = fields.find(
- (field) => field.id === view?.descriptionField
- );
- const otherFields = view.fields ?? [];
- const { regularFields, badgeFields } = otherFields.reduce(
- (accumulator, fieldId) => {
- const field = fields.find((f) => f.id === fieldId);
- if (!field) {
- return accumulator;
- }
- const key = view.layout?.badgeFields?.includes(fieldId) ? "badgeFields" : "regularFields";
- accumulator[key].push(field);
- return accumulator;
- },
- { regularFields: [], badgeFields: [] }
- );
- const hasData = !!data?.length;
- const usedPreviewSize = view.layout?.previewSize;
- const isMultiselect = (0,_components_dataviews_picker_footer__WEBPACK_IMPORTED_MODULE_8__.useIsMultiselectPicker)(actions);
- const size = "900px";
- const groupField = view.groupByField ? fields.find((f) => f.id === view.groupByField) : null;
- const dataByGroup = groupField ? (0,_utils_get_data_by_group__WEBPACK_IMPORTED_MODULE_10__["default"])(data, groupField) : null;
- const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup;
- const currentPage = view?.page ?? 1;
- const perPage = view?.perPage ?? 0;
- const setSize = isInfiniteScroll ? paginationInfo?.totalItems : void 0;
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.Fragment, {
- // Render multiple groups.
- children: [
- hasData && groupField && dataByGroup && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Composite,
- {
- virtualFocus: true,
- orientation: "horizontal",
- role: "listbox",
- "aria-multiselectable": isMultiselect,
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])(
- "dataviews-view-picker-grid",
- className
- ),
- "aria-label": itemListLabel,
- render: ({ children, ...props }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.__experimentalVStack,
- {
- spacing: 4,
- children,
- ...props
- }
- ),
- children: Array.from(dataByGroup.entries()).map(
- ([groupName, groupItems]) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- GridGroup,
- {
- groupName,
- groupField,
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _utils_grid_items__WEBPACK_IMPORTED_MODULE_9__.GridItems,
- {
- previewSize: usedPreviewSize,
- style: {
- gridTemplateColumns: usedPreviewSize && `repeat(auto-fill, minmax(${usedPreviewSize}px, 1fr))`
- },
- "aria-busy": isLoading,
- ref: resizeObserverRef,
- children: groupItems.map((item) => {
- const posInSet = (currentPage - 1) * perPage + data.indexOf(item) + 1;
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- GridItem,
- {
- view,
- multiselect: isMultiselect,
- selection,
- onChangeSelection,
- getItemId,
- item,
- mediaField,
- titleField,
- descriptionField,
- regularFields,
- badgeFields,
- config: {
- sizes: size
- },
- posinset: posInSet,
- setsize: setSize
- },
- getItemId(item)
- );
- })
- }
- )
- },
- groupName
- )
- )
- }
- ),
- // Render a single grid with all data.
- hasData && !dataByGroup && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Composite,
- {
- render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- _utils_grid_items__WEBPACK_IMPORTED_MODULE_9__.GridItems,
- {
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])(
- "dataviews-view-picker-grid",
- className
- ),
- previewSize: usedPreviewSize,
- "aria-busy": isLoading,
- ref: resizeObserverRef
- }
- ),
- virtualFocus: true,
- orientation: "horizontal",
- role: "listbox",
- "aria-multiselectable": isMultiselect,
- "aria-label": itemListLabel,
- children: data.map((item, index) => {
- let posinset = isInfiniteScroll ? index + 1 : void 0;
- if (!isInfiniteScroll) {
- posinset = (currentPage - 1) * perPage + index + 1;
- }
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- GridItem,
- {
- view,
- multiselect: isMultiselect,
- selection,
- onChangeSelection,
- getItemId,
- item,
- mediaField,
- titleField,
- descriptionField,
- regularFields,
- badgeFields,
- config: {
- sizes: size
- },
- posinset,
- setsize: setSize
- },
- getItemId(item)
- );
- })
- }
- ),
- // Render empty state.
- !hasData && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(
- "div",
- {
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])({
- "dataviews-loading": isLoading,
- "dataviews-no-results": !isLoading
- }),
- children: isLoading ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("p", { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Spinner, {}) }) : empty
- }
- ),
- hasData && isLoading && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Spinner, {}) })
- ]
- });
-}
-var picker_grid_default = ViewPickerGrid;
-
-//# sourceMappingURL=index.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/picker-table/index.js":
-/*!************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/picker-table/index.js ***!
- \************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ picker_table_default)
-/* harmony export */ });
-/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _components_dataviews_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../components/dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
-/* harmony import */ var _components_dataviews_selection_checkbox__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../components/dataviews-selection-checkbox */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-selection-checkbox/index.js");
-/* harmony import */ var _components_dataviews_picker_footer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../components/dataviews-picker/footer */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-picker/footer.js");
-/* harmony import */ var _components_dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../components/dataviews-bulk-actions */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-bulk-actions/index.js");
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-/* harmony import */ var _table_column_header_menu__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../table/column-header-menu */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/column-header-menu.js");
-/* harmony import */ var _table_column_primary__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../table/column-primary */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/column-primary.js");
-/* harmony import */ var _utils_get_data_by_group__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../utils/get-data-by-group */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/get-data-by-group.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__);
-// packages/dataviews/src/dataviews-layouts/picker-table/index.tsx
-
-
-
-
-
-
-
-
-
-
-
-
-
-function TableColumnField({
- item,
- fields,
- column,
- align
-}) {
- const field = fields.find((f) => f.id === column);
- if (!field) {
- return null;
- }
- const className = (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])("dataviews-view-table__cell-content-wrapper", {
- "dataviews-view-table__cell-align-end": align === "end",
- "dataviews-view-table__cell-align-center": align === "center"
- });
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div", { className, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(field.render, { item, field }) });
-}
-function TableRow({
- item,
- fields,
- id,
- view,
- titleField,
- mediaField,
- descriptionField,
- selection,
- getItemId,
- onChangeSelection,
- multiselect,
- posinset
-}) {
- const { paginationInfo } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useContext)(_components_dataviews_context__WEBPACK_IMPORTED_MODULE_4__["default"]);
- const isSelected = selection.includes(id);
- const [isHovered, setIsHovered] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(false);
- const {
- showTitle = true,
- showMedia = true,
- showDescription = true,
- infiniteScrollEnabled
- } = view;
- const handleMouseEnter = () => {
- setIsHovered(true);
- };
- const handleMouseLeave = () => {
- setIsHovered(false);
- };
- const columns = view.fields ?? [];
- const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField && showDescription;
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Composite.Item,
- {
- render: ({ children, ...props }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- "tr",
- {
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])("dataviews-view-table__row", {
- "is-selected": isSelected,
- "is-hovered": isHovered
- }),
- onMouseEnter: handleMouseEnter,
- onMouseLeave: handleMouseLeave,
- children,
- ...props
- }
- ),
- "aria-selected": isSelected,
- "aria-setsize": paginationInfo.totalItems || void 0,
- "aria-posinset": posinset,
- role: infiniteScrollEnabled ? "article" : "option",
- onClick: () => {
- if (isSelected) {
- onChangeSelection(
- selection.filter((itemId) => id !== itemId)
- );
- } else {
- const newSelection = multiselect ? [...selection, id] : [id];
- onChangeSelection(newSelection);
- }
- },
- children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- "td",
- {
- className: "dataviews-view-table__checkbox-column",
- role: "presentation",
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div", { className: "dataviews-view-table__cell-content-wrapper", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- _components_dataviews_selection_checkbox__WEBPACK_IMPORTED_MODULE_5__["default"],
- {
- item,
- selection,
- onChangeSelection,
- getItemId,
- titleField,
- disabled: false,
- "aria-hidden": true,
- tabIndex: -1
- }
- ) })
- }
- ),
- hasPrimaryColumn && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td", { role: "presentation", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- _table_column_primary__WEBPACK_IMPORTED_MODULE_10__["default"],
- {
- item,
- titleField: showTitle ? titleField : void 0,
- mediaField: showMedia ? mediaField : void 0,
- descriptionField: showDescription ? descriptionField : void 0,
- isItemClickable: () => false
- }
- ) }),
- columns.map((column) => {
- const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {};
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- "td",
- {
- style: {
- width,
- maxWidth,
- minWidth
- },
- role: "presentation",
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- TableColumnField,
- {
- fields,
- item,
- column,
- align
- }
- )
- },
- column
- );
- })
- ]
- },
- id
- );
-}
-function ViewPickerTable({
- actions,
- data,
- fields,
- getItemId,
- isLoading = false,
- onChangeView,
- onChangeSelection,
- selection,
- setOpenedFilter,
- view,
- className,
- empty
-}) {
- const headerMenuRefs = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)(/* @__PURE__ */ new Map());
- const headerMenuToFocusRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)();
- const [nextHeaderMenuToFocus, setNextHeaderMenuToFocus] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)();
- const isMultiselect = (0,_components_dataviews_picker_footer__WEBPACK_IMPORTED_MODULE_6__.useIsMultiselectPicker)(actions) ?? false;
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
- if (headerMenuToFocusRef.current) {
- headerMenuToFocusRef.current.focus();
- headerMenuToFocusRef.current = void 0;
- }
- });
- const tableNoticeId = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useId)();
- if (nextHeaderMenuToFocus) {
- headerMenuToFocusRef.current = nextHeaderMenuToFocus;
- setNextHeaderMenuToFocus(void 0);
- return;
- }
- const onHide = (field) => {
- const hidden = headerMenuRefs.current.get(field.id);
- const fallback = hidden ? headerMenuRefs.current.get(hidden.fallback) : void 0;
- setNextHeaderMenuToFocus(fallback?.node);
- };
- const hasData = !!data?.length;
- const titleField = fields.find((field) => field.id === view.titleField);
- const mediaField = fields.find((field) => field.id === view.mediaField);
- const descriptionField = fields.find(
- (field) => field.id === view.descriptionField
- );
- const groupField = view.groupByField ? fields.find((f) => f.id === view.groupByField) : null;
- const dataByGroup = groupField ? (0,_utils_get_data_by_group__WEBPACK_IMPORTED_MODULE_11__["default"])(data, groupField) : null;
- const { showTitle = true, showMedia = true, showDescription = true } = view;
- const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField && showDescription;
- const columns = view.fields ?? [];
- const headerMenuRef = (column, index) => (node) => {
- if (node) {
- headerMenuRefs.current.set(column, {
- node,
- fallback: columns[index > 0 ? index - 1 : 1]
- });
- } else {
- headerMenuRefs.current.delete(column);
- }
- };
- const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup;
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.Fragment, { children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(
- "table",
- {
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])(
- "dataviews-view-table",
- "dataviews-view-picker-table",
- className,
- {
- [`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes(
- view.layout.density
- )
- }
- ),
- "aria-busy": isLoading,
- "aria-describedby": tableNoticeId,
- role: isInfiniteScroll ? "feed" : "listbox",
- children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("thead", { role: "presentation", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(
- "tr",
- {
- className: "dataviews-view-table__row",
- role: "presentation",
- children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("th", { className: "dataviews-view-table__checkbox-column", children: isMultiselect && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- _components_dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_7__.BulkSelectionCheckbox,
- {
- selection,
- onChangeSelection,
- data,
- actions,
- getItemId
- }
- ) }),
- hasPrimaryColumn && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("th", { children: titleField && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- _table_column_header_menu__WEBPACK_IMPORTED_MODULE_9__["default"],
- {
- ref: headerMenuRef(
- titleField.id,
- 0
- ),
- fieldId: titleField.id,
- view,
- fields,
- onChangeView,
- onHide,
- setOpenedFilter,
- canMove: false
- }
- ) }),
- columns.map((column, index) => {
- const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {};
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- "th",
- {
- style: {
- width,
- maxWidth,
- minWidth,
- textAlign: align
- },
- "aria-sort": view.sort?.direction && view.sort?.field === column ? _constants__WEBPACK_IMPORTED_MODULE_8__.sortValues[view.sort.direction] : void 0,
- scope: "col",
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- _table_column_header_menu__WEBPACK_IMPORTED_MODULE_9__["default"],
- {
- ref: headerMenuRef(column, index),
- fieldId: column,
- view,
- fields,
- onChangeView,
- onHide,
- setOpenedFilter,
- canMove: view.layout?.enableMoving ?? true
- }
- )
- },
- column
- );
- })
- ]
- }
- ) }),
- hasData && groupField && dataByGroup ? Array.from(dataByGroup.entries()).map(
- ([groupName, groupItems]) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Composite,
- {
- virtualFocus: true,
- orientation: "vertical",
- render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("tbody", { role: "group" }),
- children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- "tr",
- {
- className: "dataviews-view-table__group-header-row",
- role: "presentation",
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- "td",
- {
- colSpan: columns.length + (hasPrimaryColumn ? 1 : 0) + 1,
- className: "dataviews-view-table__group-header-cell",
- role: "presentation",
- children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(
- // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("%1$s: %2$s"),
- groupField.label,
- groupName
- )
- }
- )
- }
- ),
- groupItems.map((item, index) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- TableRow,
- {
- item,
- fields,
- id: getItemId(item) || index.toString(),
- view,
- titleField,
- mediaField,
- descriptionField,
- selection,
- getItemId,
- onChangeSelection,
- multiselect: isMultiselect
- },
- getItemId(item)
- ))
- ]
- },
- `group-${groupName}`
- )
- ) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Composite,
- {
- render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("tbody", { role: "presentation" }),
- virtualFocus: true,
- orientation: "vertical",
- children: hasData && data.map((item, index) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
- TableRow,
- {
- item,
- fields,
- id: getItemId(item) || index.toString(),
- view,
- titleField,
- mediaField,
- descriptionField,
- selection,
- getItemId,
- onChangeSelection,
- multiselect: isMultiselect,
- posinset: index + 1
- },
- getItemId(item)
- ))
- }
- )
- ]
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(
- "div",
- {
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])({
- "dataviews-loading": isLoading,
- "dataviews-no-results": !hasData && !isLoading
- }),
- id: tableNoticeId,
- children: [
- !hasData && (isLoading ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("p", { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Spinner, {}) }) : empty),
- hasData && isLoading && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Spinner, {}) })
- ]
- }
- )
- ] });
-}
-var picker_table_default = ViewPickerTable;
-
-//# sourceMappingURL=index.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/column-header-menu.js":
-/*!******************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/column-header-menu.js ***!
- \******************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ column_header_menu_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/arrow-left.js");
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/arrow-right.js");
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/funnel.js");
-/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/unseen.js");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
-/* harmony import */ var _lock_unlock__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../lock-unlock */ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js");
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__);
-// packages/dataviews/src/dataviews-layouts/table/column-header-menu.tsx
-
-
-
-
-
-
-
-var { Menu } = (0,_lock_unlock__WEBPACK_IMPORTED_MODULE_7__.unlock)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.privateApis);
-function WithMenuSeparators({ children }) {
- return _wordpress_element__WEBPACK_IMPORTED_MODULE_6__.Children.toArray(children).filter(Boolean).map((child, i) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.Fragment, { children: [
- i > 0 && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Menu.Separator, {}),
- child
- ] }, i));
-}
-var _HeaderMenu = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.forwardRef)(function HeaderMenu({
- fieldId,
- view,
- fields,
- onChangeView,
- onHide,
- setOpenedFilter,
- canMove = true
-}, ref) {
- const visibleFieldIds = view.fields ?? [];
- const index = visibleFieldIds?.indexOf(fieldId);
- const isSorted = view.sort?.field === fieldId;
- let isHidable = false;
- let isSortable = false;
- let canAddFilter = false;
- let operators = [];
- const field = fields.find((f) => f.id === fieldId);
- if (!field) {
- return null;
- }
- isHidable = field.enableHiding !== false;
- isSortable = field.enableSorting !== false;
- const header = field.header;
- operators = !!field.filterBy && field.filterBy?.operators || [];
- canAddFilter = !view.filters?.some((_filter) => fieldId === _filter.field) && !!(field.hasElements || field.Edit) && field.filterBy !== false && !field.filterBy?.isPrimary;
- if (!isSortable && !canMove && !isHidable && !canAddFilter) {
- return header;
- }
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(Menu, { children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(
- Menu.TriggerButton,
- {
- render: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_5__.Button,
- {
- size: "compact",
- className: "dataviews-view-table-header-button",
- ref,
- variant: "tertiary"
- }
- ),
- children: [
- header,
- view.sort && isSorted && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("span", { "aria-hidden": "true", children: _constants__WEBPACK_IMPORTED_MODULE_8__.sortArrows[view.sort.direction] })
- ]
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Menu.Popover, { style: { minWidth: "240px" }, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(WithMenuSeparators, { children: [
- isSortable && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Menu.Group, { children: _constants__WEBPACK_IMPORTED_MODULE_8__.SORTING_DIRECTIONS.map(
- (direction) => {
- const isChecked = view.sort && isSorted && view.sort.direction === direction;
- const value = `${fieldId}-${direction}`;
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(
- Menu.RadioItem,
- {
- name: "view-table-sorting",
- value,
- checked: isChecked,
- onChange: () => {
- onChangeView({
- ...view,
- sort: {
- field: fieldId,
- direction
- },
- showLevels: false
- });
- },
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Menu.ItemLabel, { children: _constants__WEBPACK_IMPORTED_MODULE_8__.sortLabels[direction] })
- },
- value
- );
- }
- ) }),
- canAddFilter && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Menu.Group, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(
- Menu.Item,
- {
- prefix: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.Icon, { icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"] }),
- onClick: () => {
- setOpenedFilter(fieldId);
- onChangeView({
- ...view,
- page: 1,
- filters: [
- ...view.filters || [],
- {
- field: fieldId,
- value: void 0,
- operator: operators[0]
- }
- ]
- });
- },
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Menu.ItemLabel, { children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Add filter") })
- }
- ) }),
- (canMove || isHidable) && field && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(Menu.Group, { children: [
- canMove && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(
- Menu.Item,
- {
- prefix: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.Icon, { icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__["default"] }),
- disabled: index < 1,
- onClick: () => {
- onChangeView({
- ...view,
- fields: [
- ...visibleFieldIds.slice(
- 0,
- index - 1
- ) ?? [],
- fieldId,
- visibleFieldIds[index - 1],
- ...visibleFieldIds.slice(
- index + 1
- )
- ]
- });
- },
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Menu.ItemLabel, { children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Move left") })
- }
- ),
- canMove && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(
- Menu.Item,
- {
- prefix: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.Icon, { icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["default"] }),
- disabled: index >= visibleFieldIds.length - 1,
- onClick: () => {
- onChangeView({
- ...view,
- fields: [
- ...visibleFieldIds.slice(
- 0,
- index
- ) ?? [],
- visibleFieldIds[index + 1],
- fieldId,
- ...visibleFieldIds.slice(
- index + 2
- )
- ]
- });
- },
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Menu.ItemLabel, { children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Move right") })
- }
- ),
- isHidable && field && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(
- Menu.Item,
- {
- prefix: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.Icon, { icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__["default"] }),
- onClick: () => {
- onHide(field);
- onChangeView({
- ...view,
- fields: visibleFieldIds.filter(
- (id) => id !== fieldId
- )
- });
- },
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Menu.ItemLabel, { children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Hide column") })
- }
- )
- ] })
- ] }) })
- ] });
-});
-var ColumnHeaderMenu = _HeaderMenu;
-var column_header_menu_default = ColumnHeaderMenu;
-
-//# sourceMappingURL=column-header-menu.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/column-primary.js":
-/*!**************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/column-primary.js ***!
- \**************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ column_primary_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _utils_item_click_wrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/item-click-wrapper */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/item-click-wrapper.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
-// packages/dataviews/src/dataviews-layouts/table/column-primary.tsx
-
-
-
-function ColumnPrimary({
- item,
- level,
- titleField,
- mediaField,
- descriptionField,
- onClickItem,
- renderItemLink,
- isItemClickable
-}) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalHStack, { spacing: 3, justify: "flex-start", children: [
- mediaField && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(
- _utils_item_click_wrapper__WEBPACK_IMPORTED_MODULE_1__.ItemClickWrapper,
- {
- item,
- isItemClickable,
- onClickItem,
- renderItemLink,
- className: "dataviews-view-table__cell-content-wrapper dataviews-column-primary__media",
- "aria-label": isItemClickable(item) && (!!onClickItem || !!renderItemLink) && !!titleField ? titleField.getValue?.({ item }) : void 0,
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(
- mediaField.render,
- {
- item,
- field: mediaField,
- config: { sizes: "32px" }
- }
- )
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalVStack,
- {
- spacing: 0,
- alignment: "flex-start",
- className: "dataviews-view-table__primary-column-content",
- children: [
- titleField && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(
- _utils_item_click_wrapper__WEBPACK_IMPORTED_MODULE_1__.ItemClickWrapper,
- {
- item,
- isItemClickable,
- onClickItem,
- renderItemLink,
- className: "dataviews-view-table__cell-content-wrapper dataviews-title-field",
- children: [
- level !== void 0 && level > 0 && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("span", { className: "dataviews-view-table__level", children: [
- "\u2014".repeat(level),
- "\xA0"
- ] }),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(titleField.render, { item, field: titleField })
- ]
- }
- ),
- descriptionField && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(
- descriptionField.render,
- {
- item,
- field: descriptionField
- }
- )
- ]
- }
- )
- ] });
-}
-var column_primary_default = ColumnPrimary;
-
-//# sourceMappingURL=column-primary.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/density-picker.js":
-/*!**************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/density-picker.js ***!
- \**************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ DensityPicker)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _components_dataviews_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../components/dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
-// packages/dataviews/src/dataviews-layouts/table/density-picker.tsx
-
-
-
-
-
-function DensityPicker() {
- const context = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useContext)(_components_dataviews_context__WEBPACK_IMPORTED_MODULE_3__["default"]);
- const view = context.view;
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalToggleGroupControl,
- {
- __nextHasNoMarginBottom: true,
- size: "__unstable-large",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Density"),
- value: view.layout?.density || "balanced",
- onChange: (value) => {
- context.onChangeView({
- ...view,
- layout: {
- ...view.layout,
- density: value
- }
- });
- },
- isBlock: true,
- children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalToggleGroupControlOption,
- {
- value: "comfortable",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x)(
- "Comfortable",
- "Density option for DataView layout"
- )
- },
- "comfortable"
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalToggleGroupControlOption,
- {
- value: "balanced",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x)("Balanced", "Density option for DataView layout")
- },
- "balanced"
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.__experimentalToggleGroupControlOption,
- {
- value: "compact",
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x)("Compact", "Density option for DataView layout")
- },
- "compact"
- )
- ]
- }
- );
-}
-
-//# sourceMappingURL=density-picker.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/index.js":
-/*!*****************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/index.js ***!
- \*****************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ table_default)
-/* harmony export */ });
-/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes");
-/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4__);
-/* harmony import */ var _components_dataviews_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../components/dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
-/* harmony import */ var _components_dataviews_selection_checkbox__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../components/dataviews-selection-checkbox */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-selection-checkbox/index.js");
-/* harmony import */ var _components_dataviews_item_actions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../components/dataviews-item-actions */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-item-actions/index.js");
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-/* harmony import */ var _components_dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../components/dataviews-bulk-actions */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-bulk-actions/index.js");
-/* harmony import */ var _column_header_menu__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./column-header-menu */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/column-header-menu.js");
-/* harmony import */ var _column_primary__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./column-primary */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/column-primary.js");
-/* harmony import */ var _use_is_horizontal_scroll_end__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./use-is-horizontal-scroll-end */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/use-is-horizontal-scroll-end.js");
-/* harmony import */ var _utils_get_data_by_group__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../utils/get-data-by-group */ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/get-data-by-group.js");
-/* harmony import */ var _components_dataviews_view_config_properties_section__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../components/dataviews-view-config/properties-section */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/properties-section.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__);
-// packages/dataviews/src/dataviews-layouts/table/index.tsx
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-function TableColumnField({
- item,
- fields,
- column,
- align
-}) {
- const field = fields.find((f) => f.id === column);
- if (!field) {
- return null;
- }
- const className = (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])("dataviews-view-table__cell-content-wrapper", {
- "dataviews-view-table__cell-align-end": align === "end",
- "dataviews-view-table__cell-align-center": align === "center"
- });
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("div", { className, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(field.render, { item, field }) });
-}
-function TableRow({
- hasBulkActions,
- item,
- level,
- actions,
- fields,
- id,
- view,
- titleField,
- mediaField,
- descriptionField,
- selection,
- getItemId,
- isItemClickable,
- onClickItem,
- renderItemLink,
- onChangeSelection,
- isActionsColumnSticky,
- posinset
-}) {
- const { paginationInfo } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useContext)(_components_dataviews_context__WEBPACK_IMPORTED_MODULE_5__["default"]);
- const hasPossibleBulkAction = (0,_components_dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_9__.useHasAPossibleBulkAction)(actions, item);
- const isSelected = hasPossibleBulkAction && selection.includes(id);
- const [isHovered, setIsHovered] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(false);
- const {
- showTitle = true,
- showMedia = true,
- showDescription = true,
- infiniteScrollEnabled
- } = view;
- const handleMouseEnter = () => {
- setIsHovered(true);
- };
- const handleMouseLeave = () => {
- setIsHovered(false);
- };
- const isTouchDeviceRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)(false);
- const columns = view.fields ?? [];
- const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField && showDescription;
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsxs)(
- "tr",
- {
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])("dataviews-view-table__row", {
- "is-selected": hasPossibleBulkAction && isSelected,
- "is-hovered": isHovered,
- "has-bulk-actions": hasPossibleBulkAction
- }),
- onMouseEnter: handleMouseEnter,
- onMouseLeave: handleMouseLeave,
- onTouchStart: () => {
- isTouchDeviceRef.current = true;
- },
- "aria-setsize": infiniteScrollEnabled ? paginationInfo.totalItems : void 0,
- "aria-posinset": posinset,
- role: infiniteScrollEnabled ? "article" : void 0,
- onClick: (event) => {
- if (!hasPossibleBulkAction) {
- return;
- }
- if (!isTouchDeviceRef.current && document.getSelection()?.type !== "Range") {
- if ((0,_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4__.isAppleOS)() ? event.metaKey : event.ctrlKey) {
- onChangeSelection(
- selection.includes(id) ? selection.filter(
- (itemId) => id !== itemId
- ) : [...selection, id]
- );
- } else {
- onChangeSelection(
- selection.includes(id) ? selection.filter(
- (itemId) => id !== itemId
- ) : [id]
- );
- }
- }
- },
- children: [
- hasBulkActions && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("td", { className: "dataviews-view-table__checkbox-column", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("div", { className: "dataviews-view-table__cell-content-wrapper", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
- _components_dataviews_selection_checkbox__WEBPACK_IMPORTED_MODULE_6__["default"],
- {
- item,
- selection,
- onChangeSelection,
- getItemId,
- titleField,
- disabled: !hasPossibleBulkAction
- }
- ) }) }),
- hasPrimaryColumn && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("td", { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
- _column_primary__WEBPACK_IMPORTED_MODULE_11__["default"],
- {
- item,
- level,
- titleField: showTitle ? titleField : void 0,
- mediaField: showMedia ? mediaField : void 0,
- descriptionField: showDescription ? descriptionField : void 0,
- isItemClickable,
- onClickItem,
- renderItemLink
- }
- ) }),
- columns.map((column) => {
- const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {};
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
- "td",
- {
- style: {
- width,
- maxWidth,
- minWidth
- },
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
- TableColumnField,
- {
- fields,
- item,
- column,
- align
- }
- )
- },
- column
- );
- }),
- !!actions?.length && // Disable reason: we are not making the element interactive,
- // but preventing any click events from bubbling up to the
- // table row. This allows us to add a click handler to the row
- // itself (to toggle row selection) without erroneously
- // intercepting click events from ItemActions.
- /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
- "td",
- {
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])("dataviews-view-table__actions-column", {
- "dataviews-view-table__actions-column--sticky": true,
- "dataviews-view-table__actions-column--stuck": isActionsColumnSticky
- }),
- onClick: (e) => e.stopPropagation(),
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_components_dataviews_item_actions__WEBPACK_IMPORTED_MODULE_7__["default"], { item, actions })
- }
- )
- ]
- }
- );
-}
-function ViewTable({
- actions,
- data,
- fields,
- getItemId,
- getItemLevel,
- isLoading = false,
- onChangeView,
- onChangeSelection,
- selection,
- setOpenedFilter,
- onClickItem,
- isItemClickable,
- renderItemLink,
- view,
- className,
- empty
-}) {
- const { containerRef } = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useContext)(_components_dataviews_context__WEBPACK_IMPORTED_MODULE_5__["default"]);
- const headerMenuRefs = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)(/* @__PURE__ */ new Map());
- const headerMenuToFocusRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)();
- const [nextHeaderMenuToFocus, setNextHeaderMenuToFocus] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)();
- const hasBulkActions = (0,_components_dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_9__.useSomeItemHasAPossibleBulkAction)(actions, data);
- const [contextMenuAnchor, setContextMenuAnchor] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(null);
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
- if (headerMenuToFocusRef.current) {
- headerMenuToFocusRef.current.focus();
- headerMenuToFocusRef.current = void 0;
- }
- });
- const tableNoticeId = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useId)();
- const isHorizontalScrollEnd = (0,_use_is_horizontal_scroll_end__WEBPACK_IMPORTED_MODULE_12__.useIsHorizontalScrollEnd)({
- scrollContainerRef: containerRef,
- enabled: !!actions?.length
- });
- if (nextHeaderMenuToFocus) {
- headerMenuToFocusRef.current = nextHeaderMenuToFocus;
- setNextHeaderMenuToFocus(void 0);
- return;
- }
- const onHide = (field) => {
- const hidden = headerMenuRefs.current.get(field.id);
- const fallback = hidden ? headerMenuRefs.current.get(hidden.fallback) : void 0;
- setNextHeaderMenuToFocus(fallback?.node);
- };
- const handleHeaderContextMenu = (event) => {
- event.preventDefault();
- event.stopPropagation();
- const virtualAnchor = {
- getBoundingClientRect: () => ({
- x: event.clientX,
- y: event.clientY,
- top: event.clientY,
- left: event.clientX,
- right: event.clientX,
- bottom: event.clientY,
- width: 0,
- height: 0,
- toJSON: () => ({})
- })
- };
- window.requestAnimationFrame(() => {
- setContextMenuAnchor(virtualAnchor);
- });
- };
- const hasData = !!data?.length;
- const titleField = fields.find((field) => field.id === view.titleField);
- const mediaField = fields.find((field) => field.id === view.mediaField);
- const descriptionField = fields.find(
- (field) => field.id === view.descriptionField
- );
- const groupField = view.groupByField ? fields.find((f) => f.id === view.groupByField) : null;
- const dataByGroup = groupField ? (0,_utils_get_data_by_group__WEBPACK_IMPORTED_MODULE_13__["default"])(data, groupField) : null;
- const { showTitle = true, showMedia = true, showDescription = true } = view;
- const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField && showDescription;
- const columns = view.fields ?? [];
- const headerMenuRef = (column, index) => (node) => {
- if (node) {
- headerMenuRefs.current.set(column, {
- node,
- fallback: columns[index > 0 ? index - 1 : 1]
- });
- } else {
- headerMenuRefs.current.delete(column);
- }
- };
- const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup;
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.Fragment, { children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsxs)(
- "table",
- {
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])("dataviews-view-table", className, {
- [`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes(
- view.layout.density
- )
- }),
- "aria-busy": isLoading,
- "aria-describedby": tableNoticeId,
- role: isInfiniteScroll ? "feed" : void 0,
- children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsxs)("colgroup", { children: [
- hasBulkActions && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("col", { className: "dataviews-view-table__col-checkbox" }),
- hasPrimaryColumn && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("col", { className: "dataviews-view-table__col-primary" }),
- columns.map((column) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
- "col",
- {
- className: `dataviews-view-table__col-${column}`
- },
- `col-${column}`
- )),
- !!actions?.length && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("col", { className: "dataviews-view-table__col-actions" })
- ] }),
- contextMenuAnchor && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Popover,
- {
- anchor: contextMenuAnchor,
- onClose: () => setContextMenuAnchor(null),
- placement: "bottom-start",
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_components_dataviews_view_config_properties_section__WEBPACK_IMPORTED_MODULE_14__.PropertiesSection, { showLabel: false })
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("thead", { onContextMenu: handleHeaderContextMenu, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsxs)("tr", { className: "dataviews-view-table__row", children: [
- hasBulkActions && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
- "th",
- {
- className: "dataviews-view-table__checkbox-column",
- scope: "col",
- onContextMenu: handleHeaderContextMenu,
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
- _components_dataviews_bulk_actions__WEBPACK_IMPORTED_MODULE_9__.BulkSelectionCheckbox,
- {
- selection,
- onChangeSelection,
- data,
- actions,
- getItemId
- }
- )
- }
- ),
- hasPrimaryColumn && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("th", { scope: "col", children: titleField && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
- _column_header_menu__WEBPACK_IMPORTED_MODULE_10__["default"],
- {
- ref: headerMenuRef(
- titleField.id,
- 0
- ),
- fieldId: titleField.id,
- view,
- fields,
- onChangeView,
- onHide,
- setOpenedFilter,
- canMove: false
- }
- ) }),
- columns.map((column, index) => {
- const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {};
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
- "th",
- {
- style: {
- width,
- maxWidth,
- minWidth,
- textAlign: align
- },
- "aria-sort": view.sort?.direction && view.sort?.field === column ? _constants__WEBPACK_IMPORTED_MODULE_8__.sortValues[view.sort.direction] : void 0,
- scope: "col",
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
- _column_header_menu__WEBPACK_IMPORTED_MODULE_10__["default"],
- {
- ref: headerMenuRef(column, index),
- fieldId: column,
- view,
- fields,
- onChangeView,
- onHide,
- setOpenedFilter,
- canMove: view.layout?.enableMoving ?? true
- }
- )
- },
- column
- );
- }),
- !!actions?.length && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
- "th",
- {
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])(
- "dataviews-view-table__actions-column",
- {
- "dataviews-view-table__actions-column--sticky": true,
- "dataviews-view-table__actions-column--stuck": !isHorizontalScrollEnd
- }
- ),
- children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("span", { className: "dataviews-view-table-header", children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Actions") })
- }
- )
- ] }) }),
- hasData && groupField && dataByGroup ? Array.from(dataByGroup.entries()).map(
- ([groupName, groupItems]) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsxs)("tbody", { children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("tr", { className: "dataviews-view-table__group-header-row", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
- "td",
- {
- colSpan: columns.length + (hasPrimaryColumn ? 1 : 0) + (hasBulkActions ? 1 : 0) + (actions?.length ? 1 : 0),
- className: "dataviews-view-table__group-header-cell",
- children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(
- // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
- (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("%1$s: %2$s"),
- groupField.label,
- groupName
- )
- }
- ) }),
- groupItems.map((item, index) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
- TableRow,
- {
- item,
- level: view.showLevels && typeof getItemLevel === "function" ? getItemLevel(item) : void 0,
- hasBulkActions,
- actions,
- fields,
- id: getItemId(item) || index.toString(),
- view,
- titleField,
- mediaField,
- descriptionField,
- selection,
- getItemId,
- onChangeSelection,
- onClickItem,
- renderItemLink,
- isItemClickable,
- isActionsColumnSticky: !isHorizontalScrollEnd
- },
- getItemId(item)
- ))
- ] }, `group-${groupName}`)
- ) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("tbody", { children: hasData && data.map((item, index) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(
- TableRow,
- {
- item,
- level: view.showLevels && typeof getItemLevel === "function" ? getItemLevel(item) : void 0,
- hasBulkActions,
- actions,
- fields,
- id: getItemId(item) || index.toString(),
- view,
- titleField,
- mediaField,
- descriptionField,
- selection,
- getItemId,
- onChangeSelection,
- onClickItem,
- renderItemLink,
- isItemClickable,
- isActionsColumnSticky: !isHorizontalScrollEnd,
- posinset: isInfiniteScroll ? index + 1 : void 0
- },
- getItemId(item)
- )) })
- ]
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsxs)(
- "div",
- {
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__["default"])({
- "dataviews-loading": isLoading,
- "dataviews-no-results": !hasData && !isLoading
- }),
- id: tableNoticeId,
- children: [
- !hasData && (isLoading ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("p", { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Spinner, {}) }) : empty),
- hasData && isLoading && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Spinner, {}) })
- ]
- }
- )
- ] });
-}
-var table_default = ViewTable;
-
-//# sourceMappingURL=index.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/use-is-horizontal-scroll-end.js":
-/*!****************************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/table/use-is-horizontal-scroll-end.js ***!
- \****************************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ useIsHorizontalScrollEnd: () => (/* binding */ useIsHorizontalScrollEnd)
-/* harmony export */ });
-/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
-/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
-// packages/dataviews/src/dataviews-layouts/table/use-is-horizontal-scroll-end.ts
-
-
-
-var isScrolledToEnd = (element) => {
- if ((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.isRTL)()) {
- const scrollLeft = Math.abs(element.scrollLeft);
- return scrollLeft <= 1;
- }
- return element.scrollLeft + element.clientWidth >= element.scrollWidth - 1;
-};
-function useIsHorizontalScrollEnd({
- scrollContainerRef,
- enabled = false
-}) {
- const [isHorizontalScrollEnd, setIsHorizontalScrollEnd] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
- const handleIsHorizontalScrollEnd = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_0__.useDebounce)(
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
- const scrollContainer = scrollContainerRef.current;
- if (scrollContainer) {
- setIsHorizontalScrollEnd(isScrolledToEnd(scrollContainer));
- }
- }, [scrollContainerRef, setIsHorizontalScrollEnd]),
- 200
- );
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
- if (typeof window === "undefined" || !enabled || !scrollContainerRef.current) {
- return () => {
- };
- }
- handleIsHorizontalScrollEnd();
- scrollContainerRef.current.addEventListener(
- "scroll",
- handleIsHorizontalScrollEnd
- );
- window.addEventListener("resize", handleIsHorizontalScrollEnd);
- return () => {
- scrollContainerRef.current?.removeEventListener(
- "scroll",
- handleIsHorizontalScrollEnd
- );
- window.removeEventListener("resize", handleIsHorizontalScrollEnd);
- };
- }, [scrollContainerRef, enabled]);
- return isHorizontalScrollEnd;
-}
-
-//# sourceMappingURL=use-is-horizontal-scroll-end.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/get-data-by-group.js":
-/*!*****************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/get-data-by-group.js ***!
- \*****************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ getDataByGroup)
-/* harmony export */ });
-// packages/dataviews/src/dataviews-layouts/utils/get-data-by-group.ts
-function getDataByGroup(data, groupByField) {
- return data.reduce((groups, item) => {
- const groupName = groupByField.getValue({ item });
- if (!groups.has(groupName)) {
- groups.set(groupName, []);
- }
- groups.get(groupName)?.push(item);
- return groups;
- }, /* @__PURE__ */ new Map());
-}
-
-//# sourceMappingURL=get-data-by-group.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/grid-items.js":
-/*!**********************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/grid-items.js ***!
- \**********************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ GridItems: () => (/* binding */ GridItems)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
-// packages/dataviews/src/dataviews-layouts/utils/grid-items.tsx
-
-
-
-var GridItems = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(({ className, previewSize, ...props }, ref) => {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(
- "div",
- {
- ref,
- className: (0,clsx__WEBPACK_IMPORTED_MODULE_1__["default"])("dataviews-view-grid-items", className),
- style: {
- gridTemplateColumns: previewSize && `repeat(auto-fill, minmax(${previewSize}px, 1fr))`
- },
- ...props
- }
- );
-});
-
-//# sourceMappingURL=grid-items.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/item-click-wrapper.js":
-/*!******************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/item-click-wrapper.js ***!
- \******************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ ItemClickWrapper: () => (/* binding */ ItemClickWrapper)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/dataviews/src/dataviews-layouts/utils/item-click-wrapper.tsx
-
-
-function getClickableItemProps({
- item,
- isItemClickable,
- onClickItem,
- className
-}) {
- if (!isItemClickable(item) || !onClickItem) {
- return { className };
- }
- return {
- className: className ? `${className} ${className}--clickable` : void 0,
- role: "button",
- tabIndex: 0,
- onClick: (event) => {
- event.stopPropagation();
- onClickItem(item);
- },
- onKeyDown: (event) => {
- if (event.key === "Enter" || event.key === "" || event.key === " ") {
- event.stopPropagation();
- onClickItem(item);
- }
- }
- };
-}
-function ItemClickWrapper({
- item,
- isItemClickable,
- onClickItem,
- renderItemLink,
- className,
- children,
- ...extraProps
-}) {
- if (!isItemClickable(item)) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", { className, ...extraProps, children });
- }
- if (renderItemLink) {
- const renderedElement = renderItemLink({
- item,
- className: `${className} ${className}--clickable`,
- ...extraProps,
- children
- });
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(renderedElement, {
- onClick: (event) => {
- event.stopPropagation();
- if (renderedElement.props.onClick) {
- renderedElement.props.onClick(event);
- }
- },
- onKeyDown: (event) => {
- if (event.key === "Enter" || event.key === "" || event.key === " ") {
- event.stopPropagation();
- if (renderedElement.props.onKeyDown) {
- renderedElement.props.onKeyDown(event);
- }
- }
- }
- });
- }
- const clickProps = getClickableItemProps({
- item,
- isItemClickable,
- onClickItem,
- className
- });
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", { ...clickProps, ...extraProps, children });
-}
-
-//# sourceMappingURL=item-click-wrapper.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/preview-size-picker.js":
-/*!*******************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/dataviews-layouts/utils/preview-size-picker.js ***!
- \*******************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ PreviewSizePicker)
-/* harmony export */ });
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
-/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _components_dataviews_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../components/dataviews-context */ "./node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
-// packages/dataviews/src/dataviews-layouts/utils/preview-size-picker.tsx
-
-
-
-
-
-var imageSizes = [
- {
- value: 120,
- breakpoint: 1
- },
- {
- value: 170,
- breakpoint: 1
- },
- {
- value: 230,
- breakpoint: 1
- },
- {
- value: 290,
- breakpoint: 1112
- // at minimum image width, 4 images display at this container size
- },
- {
- value: 350,
- breakpoint: 1636
- // at minimum image width, 6 images display at this container size
- },
- {
- value: 430,
- breakpoint: 588
- // at minimum image width, 2 images display at this container size
- }
-];
-function PreviewSizePicker() {
- const context = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useContext)(_components_dataviews_context__WEBPACK_IMPORTED_MODULE_3__["default"]);
- const view = context.view;
- const breakValues = imageSizes.filter((size) => {
- return context.containerWidth >= size.breakpoint;
- });
- const layoutPreviewSize = view.layout?.previewSize ?? 230;
- const previewSizeToUse = breakValues.map((size, index) => ({ ...size, index })).filter((size) => size.value <= layoutPreviewSize).sort((a, b) => b.value - a.value)[0]?.index ?? 0;
- const marks = breakValues.map((size, index) => {
- return {
- value: index
- };
- });
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
- _wordpress_components__WEBPACK_IMPORTED_MODULE_0__.RangeControl,
- {
- __nextHasNoMarginBottom: true,
- __next40pxDefaultSize: true,
- showTooltip: false,
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Preview size"),
- value: previewSizeToUse,
- min: 0,
- max: breakValues.length - 1,
- withInputField: false,
- onChange: (value = 0) => {
- context.onChangeView({
- ...view,
- layout: {
- ...view.layout,
- previewSize: breakValues[value].value
- }
- });
- },
- step: 1,
- marks
- }
- );
-}
-
-//# sourceMappingURL=preview-size-picker.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/array.js":
-/*!*****************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/field-types/array.js ***!
- \*****************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ array_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-// packages/dataviews/src/field-types/array.tsx
-
-
-function sort(valueA, valueB, direction) {
- const arrA = Array.isArray(valueA) ? valueA : [];
- const arrB = Array.isArray(valueB) ? valueB : [];
- if (arrA.length !== arrB.length) {
- return direction === "asc" ? arrA.length - arrB.length : arrB.length - arrA.length;
- }
- const joinedA = arrA.join(",");
- const joinedB = arrB.join(",");
- return direction === "asc" ? joinedA.localeCompare(joinedB) : joinedB.localeCompare(joinedA);
-}
-function render({ item, field }) {
- const value = field.getValue({ item }) || [];
- return value.join(", ");
-}
-var arrayFieldType = {
- sort,
- isValid: {
- elements: true,
- custom: (item, field) => {
- const value = field.getValue({ item });
- if (![void 0, "", null].includes(value) && !Array.isArray(value)) {
- return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Value must be an array.");
- }
- if (!value.every((v) => typeof v === "string")) {
- return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Every value must be a string.");
- }
- return null;
- }
- },
- Edit: "array",
- // Use array control
- render,
- enableSorting: true,
- filterBy: {
- defaultOperators: [_constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ANY, _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NONE],
- validOperators: [
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ANY,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NONE,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ALL,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NOT_ALL
- ]
- }
-};
-var array_default = arrayFieldType;
-
-//# sourceMappingURL=array.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/boolean.js":
-/*!*******************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/field-types/boolean.js ***!
- \*******************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ boolean_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _utils_render_from_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/render-from-elements */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js");
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
-// packages/dataviews/src/field-types/boolean.tsx
-
-
-
-
-function sort(a, b, direction) {
- const boolA = Boolean(a);
- const boolB = Boolean(b);
- if (boolA === boolB) {
- return 0;
- }
- if (direction === "asc") {
- return boolA ? 1 : -1;
- }
- return boolA ? -1 : 1;
-}
-var boolean_default = {
- sort,
- isValid: {
- elements: true,
- custom: (item, field) => {
- const value = field.getValue({ item });
- if (![void 0, "", null].includes(value) && ![true, false].includes(value)) {
- return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Value must be true, false, or undefined");
- }
- return null;
- }
- },
- Edit: "checkbox",
- render: ({ item, field }) => {
- if (field.hasElements) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_utils_render_from_elements__WEBPACK_IMPORTED_MODULE_1__["default"], { item, field });
- }
- if (field.getValue({ item }) === true) {
- return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("True");
- }
- if (field.getValue({ item }) === false) {
- return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("False");
- }
- return null;
- },
- enableSorting: true,
- filterBy: {
- defaultOperators: [_constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS, _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_NOT],
- validOperators: [_constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS, _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_NOT]
- }
-};
-
-//# sourceMappingURL=boolean.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/color.js":
-/*!*****************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/field-types/color.js ***!
- \*****************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ color_default)
-/* harmony export */ });
-/* harmony import */ var colord__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! colord */ "./node_modules/colord/index.mjs");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _utils_render_from_elements__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/render-from-elements */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js");
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
-// packages/dataviews/src/field-types/color.tsx
-
-
-
-
-
-function sort(valueA, valueB, direction) {
- const colorA = (0,colord__WEBPACK_IMPORTED_MODULE_0__.colord)(valueA);
- const colorB = (0,colord__WEBPACK_IMPORTED_MODULE_0__.colord)(valueB);
- if (!colorA.isValid() && !colorB.isValid()) {
- return 0;
- }
- if (!colorA.isValid()) {
- return direction === "asc" ? 1 : -1;
- }
- if (!colorB.isValid()) {
- return direction === "asc" ? -1 : 1;
- }
- const hslA = colorA.toHsl();
- const hslB = colorB.toHsl();
- if (hslA.h !== hslB.h) {
- return direction === "asc" ? hslA.h - hslB.h : hslB.h - hslA.h;
- }
- if (hslA.s !== hslB.s) {
- return direction === "asc" ? hslA.s - hslB.s : hslB.s - hslA.s;
- }
- return direction === "asc" ? hslA.l - hslB.l : hslB.l - hslA.l;
-}
-var color_default = {
- sort,
- isValid: {
- elements: true,
- custom: (item, field) => {
- const value = field.getValue({ item });
- if (![void 0, "", null].includes(value) && !(0,colord__WEBPACK_IMPORTED_MODULE_0__.colord)(value).isValid()) {
- return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Value must be a valid color.");
- }
- return null;
- }
- },
- Edit: "color",
- render: ({ item, field }) => {
- if (field.hasElements) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_utils_render_from_elements__WEBPACK_IMPORTED_MODULE_2__["default"], { item, field });
- }
- const value = field.getValue({ item });
- if (!value || !(0,colord__WEBPACK_IMPORTED_MODULE_0__.colord)(value).isValid()) {
- return value;
- }
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(
- "div",
- {
- style: { display: "flex", alignItems: "center", gap: "8px" },
- children: [
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
- "div",
- {
- style: {
- width: "16px",
- height: "16px",
- borderRadius: "50%",
- backgroundColor: value,
- border: "1px solid #ddd",
- flexShrink: 0
- }
- }
- ),
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", { children: value })
- ]
- }
- );
- },
- enableSorting: true,
- filterBy: {
- defaultOperators: [_constants__WEBPACK_IMPORTED_MODULE_3__.OPERATOR_IS_ANY, _constants__WEBPACK_IMPORTED_MODULE_3__.OPERATOR_IS_NONE],
- validOperators: [_constants__WEBPACK_IMPORTED_MODULE_3__.OPERATOR_IS, _constants__WEBPACK_IMPORTED_MODULE_3__.OPERATOR_IS_NOT]
- }
-};
-
-//# sourceMappingURL=color.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/date.js":
-/*!****************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/field-types/date.js ***!
- \****************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ date_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/date */ "@wordpress/date");
-/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _utils_render_from_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/render-from-elements */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js");
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
-// packages/dataviews/src/field-types/date.tsx
-
-
-
-
-var getFormattedDate = (dateToDisplay) => (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_0__.dateI18n)((0,_wordpress_date__WEBPACK_IMPORTED_MODULE_0__.getSettings)().formats.date, (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_0__.getDate)(dateToDisplay));
-function sort(a, b, direction) {
- const timeA = new Date(a).getTime();
- const timeB = new Date(b).getTime();
- return direction === "asc" ? timeA - timeB : timeB - timeA;
-}
-var date_default = {
- sort,
- Edit: "date",
- isValid: {
- elements: true,
- custom: () => null
- },
- render: ({ item, field }) => {
- if (field.hasElements) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_utils_render_from_elements__WEBPACK_IMPORTED_MODULE_1__["default"], { item, field });
- }
- const value = field.getValue({ item });
- if (!value) {
- return "";
- }
- return getFormattedDate(value);
- },
- enableSorting: true,
- filterBy: {
- defaultOperators: [
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_ON,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_NOT_ON,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BEFORE,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_AFTER,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BEFORE_INC,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_AFTER_INC,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IN_THE_PAST,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_OVER,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BETWEEN
- ],
- validOperators: [
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_ON,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_NOT_ON,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BEFORE,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_AFTER,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BEFORE_INC,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_AFTER_INC,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IN_THE_PAST,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_OVER,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BETWEEN
- ]
- }
-};
-
-//# sourceMappingURL=date.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/datetime.js":
-/*!********************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/field-types/datetime.js ***!
- \********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ datetime_default)
-/* harmony export */ });
-/* harmony import */ var _utils_render_from_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/render-from-elements */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js");
-/* harmony import */ var _utils_parse_date_time__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/parse-date-time */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/parse-date-time.js");
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
-// packages/dataviews/src/field-types/datetime.tsx
-
-
-
-
-function sort(a, b, direction) {
- const timeA = new Date(a).getTime();
- const timeB = new Date(b).getTime();
- return direction === "asc" ? timeA - timeB : timeB - timeA;
-}
-var datetime_default = {
- sort,
- isValid: {
- elements: true,
- custom: () => null
- },
- Edit: "datetime",
- render: ({ item, field }) => {
- if (field.elements) {
- return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_utils_render_from_elements__WEBPACK_IMPORTED_MODULE_0__["default"], { item, field });
- }
- const value = field.getValue({ item });
- if (["", void 0, null].includes(value)) {
- return null;
- }
- try {
- const dateValue = (0,_utils_parse_date_time__WEBPACK_IMPORTED_MODULE_1__["default"])(value);
- return dateValue?.toLocaleString();
- } catch (error) {
- return null;
- }
- },
- enableSorting: true,
- filterBy: {
- defaultOperators: [
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_ON,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_NOT_ON,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BEFORE,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_AFTER,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BEFORE_INC,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_AFTER_INC,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IN_THE_PAST,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_OVER
- ],
- validOperators: [
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_ON,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_NOT_ON,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BEFORE,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_AFTER,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BEFORE_INC,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_AFTER_INC,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IN_THE_PAST,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_OVER
- ]
- }
-};
-
-//# sourceMappingURL=datetime.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/email.js":
-/*!*****************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/field-types/email.js ***!
- \*****************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ email_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _utils_render_from_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/render-from-elements */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js");
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
-// packages/dataviews/src/field-types/email.tsx
-
-
-
-
-function sort(valueA, valueB, direction) {
- return direction === "asc" ? valueA.localeCompare(valueB) : valueB.localeCompare(valueA);
-}
-var emailRegex = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
-var email_default = {
- sort,
- isValid: {
- elements: true,
- custom: (item, field) => {
- const value = field.getValue({ item });
- if (![void 0, "", null].includes(value) && !emailRegex.test(value)) {
- return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Value must be a valid email address.");
- }
- return null;
- }
- },
- Edit: "email",
- render: ({ item, field }) => {
- return field.hasElements ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_utils_render_from_elements__WEBPACK_IMPORTED_MODULE_1__["default"], { item, field }) : field.getValue({ item });
- },
- enableSorting: true,
- filterBy: {
- defaultOperators: [_constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_ANY, _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_NONE],
- validOperators: [
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_NOT,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_CONTAINS,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_NOT_CONTAINS,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_STARTS_WITH,
- // Multiple selection
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_ANY,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_NONE,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_ALL,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_NOT_ALL
- ]
- }
-};
-
-//# sourceMappingURL=email.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/index.js":
-/*!*****************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/field-types/index.js ***!
- \*****************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ getFieldTypeDefinition)
-/* harmony export */ });
-/* harmony import */ var _email__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./email */ "./node_modules/@wordpress/dataviews/build-module/field-types/email.js");
-/* harmony import */ var _integer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./integer */ "./node_modules/@wordpress/dataviews/build-module/field-types/integer.js");
-/* harmony import */ var _number__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./number */ "./node_modules/@wordpress/dataviews/build-module/field-types/number.js");
-/* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./text */ "./node_modules/@wordpress/dataviews/build-module/field-types/text.js");
-/* harmony import */ var _datetime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./datetime */ "./node_modules/@wordpress/dataviews/build-module/field-types/datetime.js");
-/* harmony import */ var _date__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./date */ "./node_modules/@wordpress/dataviews/build-module/field-types/date.js");
-/* harmony import */ var _boolean__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./boolean */ "./node_modules/@wordpress/dataviews/build-module/field-types/boolean.js");
-/* harmony import */ var _media__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./media */ "./node_modules/@wordpress/dataviews/build-module/field-types/media.js");
-/* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./array */ "./node_modules/@wordpress/dataviews/build-module/field-types/array.js");
-/* harmony import */ var _password__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./password */ "./node_modules/@wordpress/dataviews/build-module/field-types/password.js");
-/* harmony import */ var _telephone__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./telephone */ "./node_modules/@wordpress/dataviews/build-module/field-types/telephone.js");
-/* harmony import */ var _color__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./color */ "./node_modules/@wordpress/dataviews/build-module/field-types/color.js");
-/* harmony import */ var _url__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./url */ "./node_modules/@wordpress/dataviews/build-module/field-types/url.js");
-/* harmony import */ var _utils_render_from_elements__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./utils/render-from-elements */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js");
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__);
-// packages/dataviews/src/field-types/index.tsx
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-function getFieldTypeDefinition(type) {
- if ("email" === type) {
- return _email__WEBPACK_IMPORTED_MODULE_0__["default"];
- }
- if ("integer" === type) {
- return _integer__WEBPACK_IMPORTED_MODULE_1__["default"];
- }
- if ("number" === type) {
- return _number__WEBPACK_IMPORTED_MODULE_2__["default"];
- }
- if ("text" === type) {
- return _text__WEBPACK_IMPORTED_MODULE_3__["default"];
- }
- if ("datetime" === type) {
- return _datetime__WEBPACK_IMPORTED_MODULE_4__["default"];
- }
- if ("date" === type) {
- return _date__WEBPACK_IMPORTED_MODULE_5__["default"];
- }
- if ("boolean" === type) {
- return _boolean__WEBPACK_IMPORTED_MODULE_6__["default"];
- }
- if ("media" === type) {
- return _media__WEBPACK_IMPORTED_MODULE_7__["default"];
- }
- if ("array" === type) {
- return _array__WEBPACK_IMPORTED_MODULE_8__["default"];
- }
- if ("password" === type) {
- return _password__WEBPACK_IMPORTED_MODULE_9__["default"];
- }
- if ("telephone" === type) {
- return _telephone__WEBPACK_IMPORTED_MODULE_10__["default"];
- }
- if ("color" === type) {
- return _color__WEBPACK_IMPORTED_MODULE_11__["default"];
- }
- if ("url" === type) {
- return _url__WEBPACK_IMPORTED_MODULE_12__["default"];
- }
- return {
- sort: (a, b, direction) => {
- if (typeof a === "number" && typeof b === "number") {
- return direction === "asc" ? a - b : b - a;
- }
- return direction === "asc" ? a.localeCompare(b) : b.localeCompare(a);
- },
- isValid: {
- elements: true,
- custom: () => null
- },
- Edit: null,
- render: ({ item, field }) => {
- return field.hasElements ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_utils_render_from_elements__WEBPACK_IMPORTED_MODULE_13__["default"], { item, field }) : field.getValue({ item });
- },
- enableSorting: true,
- filterBy: {
- defaultOperators: [_constants__WEBPACK_IMPORTED_MODULE_14__.OPERATOR_IS, _constants__WEBPACK_IMPORTED_MODULE_14__.OPERATOR_IS_NOT],
- validOperators: _constants__WEBPACK_IMPORTED_MODULE_14__.ALL_OPERATORS
- }
- };
-}
-
-//# sourceMappingURL=index.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/integer.js":
-/*!*******************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/field-types/integer.js ***!
- \*******************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ integer_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _utils_render_from_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/render-from-elements */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js");
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
-// packages/dataviews/src/field-types/integer.tsx
-
-
-
-
-function sort(a, b, direction) {
- return direction === "asc" ? a - b : b - a;
-}
-var integer_default = {
- sort,
- isValid: {
- elements: true,
- custom: (item, field) => {
- const value = field.getValue({ item });
- if (![void 0, "", null].includes(value) && !Number.isInteger(value)) {
- return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Value must be an integer.");
- }
- return null;
- }
- },
- Edit: "integer",
- render: ({ item, field }) => {
- return field.hasElements ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_utils_render_from_elements__WEBPACK_IMPORTED_MODULE_1__["default"], { item, field }) : field.getValue({ item });
- },
- enableSorting: true,
- filterBy: {
- defaultOperators: [
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_NOT,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_LESS_THAN,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_GREATER_THAN,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_LESS_THAN_OR_EQUAL,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_GREATER_THAN_OR_EQUAL,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BETWEEN
- ],
- validOperators: [
- // Single-selection
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_NOT,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_LESS_THAN,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_GREATER_THAN,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_LESS_THAN_OR_EQUAL,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_GREATER_THAN_OR_EQUAL,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BETWEEN,
- // Multiple-selection
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_ANY,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_NONE,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_ALL,
- _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_IS_NOT_ALL
- ]
- }
-};
-
-//# sourceMappingURL=integer.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/media.js":
-/*!*****************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/field-types/media.js ***!
- \*****************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ media_default)
-/* harmony export */ });
-// packages/dataviews/src/field-types/media.tsx
-function sort() {
- return 0;
-}
-var media_default = {
- sort,
- isValid: {
- elements: true,
- custom: () => null
- },
- Edit: null,
- render: () => null,
- enableSorting: false,
- filterBy: false
-};
-
-//# sourceMappingURL=media.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/number.js":
-/*!******************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/field-types/number.js ***!
- \******************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ number_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-/* harmony import */ var _utils_render_from_elements__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/render-from-elements */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
-// packages/dataviews/src/field-types/number.tsx
-
-
-
-
-function sort(a, b, direction) {
- return direction === "asc" ? a - b : b - a;
-}
-function isEmpty(value) {
- return value === "" || value === void 0 || value === null;
-}
-var number_default = {
- sort,
- isValid: {
- elements: true,
- custom: (item, field) => {
- const value = field.getValue({ item });
- if (!isEmpty(value) && !Number.isFinite(value)) {
- return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Value must be a number.");
- }
- return null;
- }
- },
- Edit: "number",
- render: ({ item, field }) => {
- if (field.hasElements) {
- /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_utils_render_from_elements__WEBPACK_IMPORTED_MODULE_2__["default"], { item, field });
- }
- const value = field.getValue({ item });
- if (![null, void 0].includes(value)) {
- return Number(value).toFixed(2);
- }
- return null;
- },
- enableSorting: true,
- filterBy: {
- defaultOperators: [
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NOT,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_LESS_THAN,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_GREATER_THAN,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_LESS_THAN_OR_EQUAL,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_GREATER_THAN_OR_EQUAL,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_BETWEEN
- ],
- validOperators: [
- // Single-selection
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NOT,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_LESS_THAN,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_GREATER_THAN,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_LESS_THAN_OR_EQUAL,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_GREATER_THAN_OR_EQUAL,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_BETWEEN,
- // Multiple-selection
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ANY,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NONE,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ALL,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NOT_ALL
- ]
- }
-};
-
-//# sourceMappingURL=number.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/password.js":
-/*!********************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/field-types/password.js ***!
- \********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ password_default)
-/* harmony export */ });
-/* harmony import */ var _utils_render_from_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/render-from-elements */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/dataviews/src/field-types/password.tsx
-
-
-function sort(valueA, valueB, direction) {
- return 0;
-}
-var password_default = {
- sort,
- isValid: {
- elements: true,
- custom: () => null
- },
- Edit: "password",
- render: ({ item, field }) => {
- return field.hasElements ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_utils_render_from_elements__WEBPACK_IMPORTED_MODULE_0__["default"], { item, field }) : "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022";
- },
- enableSorting: false,
- filterBy: false
-};
-
-//# sourceMappingURL=password.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/telephone.js":
-/*!*********************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/field-types/telephone.js ***!
- \*********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ telephone_default)
-/* harmony export */ });
-/* harmony import */ var _utils_render_from_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/render-from-elements */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js");
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
-// packages/dataviews/src/field-types/telephone.tsx
-
-
-
-function sort(valueA, valueB, direction) {
- return direction === "asc" ? valueA.localeCompare(valueB) : valueB.localeCompare(valueA);
-}
-var telephone_default = {
- sort,
- isValid: {
- elements: true,
- custom: () => null
- },
- Edit: "telephone",
- render: ({ item, field }) => {
- return field.hasElements ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_utils_render_from_elements__WEBPACK_IMPORTED_MODULE_0__["default"], { item, field }) : field.getValue({ item });
- },
- enableSorting: true,
- filterBy: {
- defaultOperators: [_constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ANY, _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NONE],
- validOperators: [
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NOT,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_CONTAINS,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_NOT_CONTAINS,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_STARTS_WITH,
- // Multiple selection
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ANY,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NONE,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ALL,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NOT_ALL
- ]
- }
-};
-
-//# sourceMappingURL=telephone.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/text.js":
-/*!****************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/field-types/text.js ***!
- \****************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ text_default)
-/* harmony export */ });
-/* harmony import */ var _utils_render_from_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/render-from-elements */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js");
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
-// packages/dataviews/src/field-types/text.tsx
-
-
-
-function sort(valueA, valueB, direction) {
- return direction === "asc" ? valueA.localeCompare(valueB) : valueB.localeCompare(valueA);
-}
-var text_default = {
- sort,
- isValid: {
- elements: true,
- custom: () => null
- },
- Edit: "text",
- render: ({ item, field }) => {
- return field.hasElements ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_utils_render_from_elements__WEBPACK_IMPORTED_MODULE_0__["default"], { item, field }) : field.getValue({ item });
- },
- enableSorting: true,
- filterBy: {
- defaultOperators: [_constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ANY, _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NONE],
- validOperators: [
- // Single selection
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NOT,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_CONTAINS,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_NOT_CONTAINS,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_STARTS_WITH,
- // Multiple selection
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ANY,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NONE,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ALL,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NOT_ALL
- ]
- }
-};
-
-//# sourceMappingURL=text.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/url.js":
-/*!***************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/field-types/url.js ***!
- \***************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ url_default)
-/* harmony export */ });
-/* harmony import */ var _utils_render_from_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/render-from-elements */ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js");
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
-// packages/dataviews/src/field-types/url.tsx
-
-
-
-function sort(valueA, valueB, direction) {
- return direction === "asc" ? valueA.localeCompare(valueB) : valueB.localeCompare(valueA);
-}
-var url_default = {
- sort,
- isValid: {
- elements: true,
- custom: () => null
- },
- Edit: "url",
- render: ({ item, field }) => {
- return field.hasElements ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_utils_render_from_elements__WEBPACK_IMPORTED_MODULE_0__["default"], { item, field }) : field.getValue({ item });
- },
- enableSorting: true,
- filterBy: {
- defaultOperators: [_constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ANY, _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NONE],
- validOperators: [
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NOT,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_CONTAINS,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_NOT_CONTAINS,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_STARTS_WITH,
- // Multiple selection
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ANY,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NONE,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_ALL,
- _constants__WEBPACK_IMPORTED_MODULE_1__.OPERATOR_IS_NOT_ALL
- ]
- }
-};
-
-//# sourceMappingURL=url.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/parse-date-time.js":
-/*!*********************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/field-types/utils/parse-date-time.js ***!
- \*********************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ parseDateTime)
-/* harmony export */ });
-/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! date-fns */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/isValid.js");
-/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/date */ "@wordpress/date");
-/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_1__);
-// packages/dataviews/src/field-types/utils/parse-date-time.ts
-
-
-function parseDateTime(dateTimeString) {
- if (!dateTimeString) {
- return null;
- }
- const parsed = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_1__.getDate)(dateTimeString);
- return parsed && (0,date_fns__WEBPACK_IMPORTED_MODULE_0__.isValid)(parsed) ? parsed : null;
-}
-
-//# sourceMappingURL=parse-date-time.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js":
-/*!**************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.js ***!
- \**************************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ RenderFromElements)
-/* harmony export */ });
-/* harmony import */ var _hooks_use_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../hooks/use-elements */ "./node_modules/@wordpress/dataviews/build-module/hooks/use-elements.js");
-// packages/dataviews/src/field-types/utils/render-from-elements.tsx
-
-function RenderFromElements({
- item,
- field
-}) {
- const { elements, isLoading } = (0,_hooks_use_elements__WEBPACK_IMPORTED_MODULE_0__["default"])({
- elements: field.elements,
- getElements: field.getElements
- });
- const value = field.getValue({ item });
- if (isLoading) {
- return value;
- }
- if (elements.length === 0) {
- return value;
- }
- return elements?.find((element) => element.value === value)?.label || field.getValue({ item });
-}
-
-//# sourceMappingURL=render-from-elements.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/hooks/use-elements.js":
-/*!******************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/hooks/use-elements.js ***!
- \******************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ useElements)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-// packages/dataviews/src/hooks/use-elements.ts
-
-var EMPTY_ARRAY = [];
-function useElements({
- elements,
- getElements
-}) {
- const staticElements = Array.isArray(elements) && elements.length > 0 ? elements : EMPTY_ARRAY;
- const [records, setRecords] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(staticElements);
- const [isLoading, setIsLoading] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
- if (!getElements) {
- setRecords(staticElements);
- return;
- }
- let cancelled = false;
- setIsLoading(true);
- getElements().then((fetchedElements) => {
- if (!cancelled) {
- const dynamicElements = Array.isArray(fetchedElements) && fetchedElements.length > 0 ? fetchedElements : staticElements;
- setRecords(dynamicElements);
- }
- }).catch(() => {
- if (!cancelled) {
- setRecords(staticElements);
- }
- }).finally(() => {
- if (!cancelled) {
- setIsLoading(false);
- }
- });
- return () => {
- cancelled = true;
- };
- }, [getElements, staticElements]);
- return {
- elements: records,
- isLoading
- };
-}
-
-//# sourceMappingURL=use-elements.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/lock-unlock.js":
-/*!***********************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/lock-unlock.js ***!
- \***********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ lock: () => (/* binding */ lock),
-/* harmony export */ unlock: () => (/* binding */ unlock)
-/* harmony export */ });
-/* harmony import */ var _wordpress_private_apis__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/private-apis */ "@wordpress/private-apis");
-/* harmony import */ var _wordpress_private_apis__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_private_apis__WEBPACK_IMPORTED_MODULE_0__);
-// packages/dataviews/src/lock-unlock.ts
-
-var { lock, unlock } = (0,_wordpress_private_apis__WEBPACK_IMPORTED_MODULE_0__.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
- "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
- "@wordpress/dataviews"
-);
-
-//# sourceMappingURL=lock-unlock.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/utils/has-elements.js":
-/*!******************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/utils/has-elements.js ***!
- \******************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ hasElements)
-/* harmony export */ });
-// packages/dataviews/src/utils/has-elements.ts
-function hasElements(field) {
- return Array.isArray(field.elements) && field.elements.length > 0 || typeof field.getElements === "function";
-}
-
-//# sourceMappingURL=has-elements.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/build-module/utils/normalize-fields.js":
-/*!**********************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/build-module/utils/normalize-fields.js ***!
- \**********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ normalizeFields)
-/* harmony export */ });
-/* harmony import */ var _field_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../field-types */ "./node_modules/@wordpress/dataviews/build-module/field-types/index.js");
-/* harmony import */ var _dataform_controls__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dataform-controls */ "./node_modules/@wordpress/dataviews/build-module/dataform-controls/index.js");
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants */ "./node_modules/@wordpress/dataviews/build-module/constants.js");
-/* harmony import */ var _has_elements__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./has-elements */ "./node_modules/@wordpress/dataviews/build-module/utils/has-elements.js");
-// packages/dataviews/src/utils/normalize-fields.ts
-
-
-
-
-var getValueFromId = (id) => ({ item }) => {
- const path = id.split(".");
- let value = item;
- for (const segment of path) {
- if (value.hasOwnProperty(segment)) {
- value = value[segment];
- } else {
- value = void 0;
- }
- }
- return value;
-};
-var setValueFromId = (id) => ({ value }) => {
- const path = id.split(".");
- const result = {};
- let current = result;
- for (const segment of path.slice(0, -1)) {
- current[segment] = {};
- current = current[segment];
- }
- current[path.at(-1)] = value;
- return result;
-};
-function getFilterBy(field, fieldTypeDefinition) {
- if (field.filterBy === false) {
- return false;
- }
- if (typeof field.filterBy === "object") {
- let operators = field.filterBy.operators;
- if (!operators || !Array.isArray(operators)) {
- operators = !!fieldTypeDefinition.filterBy ? fieldTypeDefinition.filterBy.defaultOperators : [];
- }
- let validOperators = _constants__WEBPACK_IMPORTED_MODULE_2__.ALL_OPERATORS;
- if (typeof fieldTypeDefinition.filterBy === "object") {
- validOperators = fieldTypeDefinition.filterBy.validOperators;
- }
- operators = operators.filter(
- (operator) => validOperators.includes(operator)
- );
- if ((0,_has_elements__WEBPACK_IMPORTED_MODULE_3__["default"])(field) && operators.includes(_constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BETWEEN)) {
- operators = operators.filter(
- (operator) => operator !== _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BETWEEN
- );
- }
- const hasSingleSelectionOperator = operators.some(
- (operator) => _constants__WEBPACK_IMPORTED_MODULE_2__.SINGLE_SELECTION_OPERATORS.includes(operator)
- );
- if (hasSingleSelectionOperator) {
- operators = operators.filter(
- (operator) => (
- // The 'Between' operator is unique as it can be combined with single selection operators.
- [..._constants__WEBPACK_IMPORTED_MODULE_2__.SINGLE_SELECTION_OPERATORS, _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BETWEEN].includes(
- operator
- )
- )
- );
- }
- if (operators.length === 0) {
- return false;
- }
- return {
- isPrimary: !!field.filterBy.isPrimary,
- operators
- };
- }
- if (fieldTypeDefinition.filterBy === false) {
- return false;
- }
- let defaultOperators = fieldTypeDefinition.filterBy.defaultOperators;
- if ((0,_has_elements__WEBPACK_IMPORTED_MODULE_3__["default"])(field) && defaultOperators.includes(_constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BETWEEN)) {
- defaultOperators = defaultOperators.filter(
- (operator) => operator !== _constants__WEBPACK_IMPORTED_MODULE_2__.OPERATOR_BETWEEN
- );
- }
- return {
- operators: defaultOperators
- };
-}
-function normalizeFields(fields) {
- return fields.map((field) => {
- const fieldTypeDefinition = (0,_field_types__WEBPACK_IMPORTED_MODULE_0__["default"])(
- field.type
- );
- const getValue = field.getValue || getValueFromId(field.id);
- const setValue = field.setValue || setValueFromId(field.id);
- const sort = field.sort ?? function sort2(a, b, direction) {
- return fieldTypeDefinition.sort(
- getValue({ item: a }),
- getValue({ item: b }),
- direction
- );
- };
- const isValid = {
- ...fieldTypeDefinition.isValid,
- ...field.isValid
- };
- const Edit = (0,_dataform_controls__WEBPACK_IMPORTED_MODULE_1__.getControl)(field, fieldTypeDefinition);
- const render = field.render ?? function render2({
- item,
- field: renderedField
- }) {
- return fieldTypeDefinition.render({ item, field: renderedField });
- };
- const filterBy = getFilterBy(field, fieldTypeDefinition);
- return {
- ...field,
- label: field.label || field.id,
- header: field.header || field.label || field.id,
- getValue,
- setValue,
- render,
- sort,
- isValid,
- Edit,
- hasElements: (0,_has_elements__WEBPACK_IMPORTED_MODULE_3__["default"])(field),
- enableHiding: field.enableHiding ?? true,
- enableSorting: field.enableSorting ?? fieldTypeDefinition.enableSorting ?? true,
- filterBy,
- readOnly: field.readOnly ?? fieldTypeDefinition.readOnly ?? false
- };
- });
-}
-
-//# sourceMappingURL=normalize-fields.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/addLeadingZeros.js":
-/*!*****************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/addLeadingZeros.js ***!
- \*****************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ addLeadingZeros: () => (/* binding */ addLeadingZeros)
-/* harmony export */ });
-function addLeadingZeros(number, targetLength) {
- const sign = number < 0 ? "-" : "";
- const output = Math.abs(number).toString().padStart(targetLength, "0");
- return sign + output;
-}
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/defaultOptions.js":
-/*!****************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/defaultOptions.js ***!
- \****************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ getDefaultOptions: () => (/* binding */ getDefaultOptions),
-/* harmony export */ setDefaultOptions: () => (/* binding */ setDefaultOptions)
-/* harmony export */ });
-let defaultOptions = {};
-
-function getDefaultOptions() {
- return defaultOptions;
-}
-
-function setDefaultOptions(newOptions) {
- defaultOptions = newOptions;
-}
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/format/formatters.js":
-/*!*******************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/format/formatters.js ***!
- \*******************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ formatters: () => (/* binding */ formatters)
-/* harmony export */ });
-/* harmony import */ var _getDayOfYear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../getDayOfYear.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/getDayOfYear.js");
-/* harmony import */ var _getISOWeek_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../getISOWeek.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/getISOWeek.js");
-/* harmony import */ var _getISOWeekYear_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../getISOWeekYear.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/getISOWeekYear.js");
-/* harmony import */ var _getWeek_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../getWeek.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/getWeek.js");
-/* harmony import */ var _getWeekYear_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../getWeekYear.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/getWeekYear.js");
-/* harmony import */ var _addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../addLeadingZeros.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/addLeadingZeros.js");
-/* harmony import */ var _lightFormatters_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./lightFormatters.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/format/lightFormatters.js");
-
-
-
-
-
-
-
-
-
-const dayPeriodEnum = {
- am: "am",
- pm: "pm",
- midnight: "midnight",
- noon: "noon",
- morning: "morning",
- afternoon: "afternoon",
- evening: "evening",
- night: "night",
-};
-
-/*
- * | | Unit | | Unit |
- * |-----|--------------------------------|-----|--------------------------------|
- * | a | AM, PM | A* | Milliseconds in day |
- * | b | AM, PM, noon, midnight | B | Flexible day period |
- * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
- * | d | Day of month | D | Day of year |
- * | e | Local day of week | E | Day of week |
- * | f | | F* | Day of week in month |
- * | g* | Modified Julian day | G | Era |
- * | h | Hour [1-12] | H | Hour [0-23] |
- * | i! | ISO day of week | I! | ISO week of year |
- * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
- * | k | Hour [1-24] | K | Hour [0-11] |
- * | l* | (deprecated) | L | Stand-alone month |
- * | m | Minute | M | Month |
- * | n | | N | |
- * | o! | Ordinal number modifier | O | Timezone (GMT) |
- * | p! | Long localized time | P! | Long localized date |
- * | q | Stand-alone quarter | Q | Quarter |
- * | r* | Related Gregorian year | R! | ISO week-numbering year |
- * | s | Second | S | Fraction of second |
- * | t! | Seconds timestamp | T! | Milliseconds timestamp |
- * | u | Extended year | U* | Cyclic year |
- * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
- * | w | Local week of year | W* | Week of month |
- * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
- * | y | Year (abs) | Y | Local week-numbering year |
- * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
- *
- * Letters marked by * are not implemented but reserved by Unicode standard.
- *
- * Letters marked by ! are non-standard, but implemented by date-fns:
- * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
- * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
- * i.e. 7 for Sunday, 1 for Monday, etc.
- * - `I` is ISO week of year, as opposed to `w` which is local week of year.
- * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
- * `R` is supposed to be used in conjunction with `I` and `i`
- * for universal ISO week-numbering date, whereas
- * `Y` is supposed to be used in conjunction with `w` and `e`
- * for week-numbering date specific to the locale.
- * - `P` is long localized date format
- * - `p` is long localized time format
- */
-
-const formatters = {
- // Era
- G: function (date, token, localize) {
- const era = date.getFullYear() > 0 ? 1 : 0;
- switch (token) {
- // AD, BC
- case "G":
- case "GG":
- case "GGG":
- return localize.era(era, { width: "abbreviated" });
- // A, B
- case "GGGGG":
- return localize.era(era, { width: "narrow" });
- // Anno Domini, Before Christ
- case "GGGG":
- default:
- return localize.era(era, { width: "wide" });
- }
- },
-
- // Year
- y: function (date, token, localize) {
- // Ordinal number
- if (token === "yo") {
- const signedYear = date.getFullYear();
- // Returns 1 for 1 BC (which is year 0 in JavaScript)
- const year = signedYear > 0 ? signedYear : 1 - signedYear;
- return localize.ordinalNumber(year, { unit: "year" });
- }
-
- return _lightFormatters_js__WEBPACK_IMPORTED_MODULE_6__.lightFormatters.y(date, token);
- },
-
- // Local week-numbering year
- Y: function (date, token, localize, options) {
- const signedWeekYear = (0,_getWeekYear_js__WEBPACK_IMPORTED_MODULE_4__.getWeekYear)(date, options);
- // Returns 1 for 1 BC (which is year 0 in JavaScript)
- const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
-
- // Two digit year
- if (token === "YY") {
- const twoDigitYear = weekYear % 100;
- return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(twoDigitYear, 2);
- }
-
- // Ordinal number
- if (token === "Yo") {
- return localize.ordinalNumber(weekYear, { unit: "year" });
- }
-
- // Padding
- return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(weekYear, token.length);
- },
-
- // ISO week-numbering year
- R: function (date, token) {
- const isoWeekYear = (0,_getISOWeekYear_js__WEBPACK_IMPORTED_MODULE_2__.getISOWeekYear)(date);
-
- // Padding
- return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(isoWeekYear, token.length);
- },
-
- // Extended year. This is a single number designating the year of this calendar system.
- // The main difference between `y` and `u` localizers are B.C. years:
- // | Year | `y` | `u` |
- // |------|-----|-----|
- // | AC 1 | 1 | 1 |
- // | BC 1 | 1 | 0 |
- // | BC 2 | 2 | -1 |
- // Also `yy` always returns the last two digits of a year,
- // while `uu` pads single digit years to 2 characters and returns other years unchanged.
- u: function (date, token) {
- const year = date.getFullYear();
- return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(year, token.length);
- },
-
- // Quarter
- Q: function (date, token, localize) {
- const quarter = Math.ceil((date.getMonth() + 1) / 3);
- switch (token) {
- // 1, 2, 3, 4
- case "Q":
- return String(quarter);
- // 01, 02, 03, 04
- case "QQ":
- return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(quarter, 2);
- // 1st, 2nd, 3rd, 4th
- case "Qo":
- return localize.ordinalNumber(quarter, { unit: "quarter" });
- // Q1, Q2, Q3, Q4
- case "QQQ":
- return localize.quarter(quarter, {
- width: "abbreviated",
- context: "formatting",
- });
- // 1, 2, 3, 4 (narrow quarter; could be not numerical)
- case "QQQQQ":
- return localize.quarter(quarter, {
- width: "narrow",
- context: "formatting",
- });
- // 1st quarter, 2nd quarter, ...
- case "QQQQ":
- default:
- return localize.quarter(quarter, {
- width: "wide",
- context: "formatting",
- });
- }
- },
-
- // Stand-alone quarter
- q: function (date, token, localize) {
- const quarter = Math.ceil((date.getMonth() + 1) / 3);
- switch (token) {
- // 1, 2, 3, 4
- case "q":
- return String(quarter);
- // 01, 02, 03, 04
- case "qq":
- return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(quarter, 2);
- // 1st, 2nd, 3rd, 4th
- case "qo":
- return localize.ordinalNumber(quarter, { unit: "quarter" });
- // Q1, Q2, Q3, Q4
- case "qqq":
- return localize.quarter(quarter, {
- width: "abbreviated",
- context: "standalone",
- });
- // 1, 2, 3, 4 (narrow quarter; could be not numerical)
- case "qqqqq":
- return localize.quarter(quarter, {
- width: "narrow",
- context: "standalone",
- });
- // 1st quarter, 2nd quarter, ...
- case "qqqq":
- default:
- return localize.quarter(quarter, {
- width: "wide",
- context: "standalone",
- });
- }
- },
-
- // Month
- M: function (date, token, localize) {
- const month = date.getMonth();
- switch (token) {
- case "M":
- case "MM":
- return _lightFormatters_js__WEBPACK_IMPORTED_MODULE_6__.lightFormatters.M(date, token);
- // 1st, 2nd, ..., 12th
- case "Mo":
- return localize.ordinalNumber(month + 1, { unit: "month" });
- // Jan, Feb, ..., Dec
- case "MMM":
- return localize.month(month, {
- width: "abbreviated",
- context: "formatting",
- });
- // J, F, ..., D
- case "MMMMM":
- return localize.month(month, {
- width: "narrow",
- context: "formatting",
- });
- // January, February, ..., December
- case "MMMM":
- default:
- return localize.month(month, { width: "wide", context: "formatting" });
- }
- },
-
- // Stand-alone month
- L: function (date, token, localize) {
- const month = date.getMonth();
- switch (token) {
- // 1, 2, ..., 12
- case "L":
- return String(month + 1);
- // 01, 02, ..., 12
- case "LL":
- return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(month + 1, 2);
- // 1st, 2nd, ..., 12th
- case "Lo":
- return localize.ordinalNumber(month + 1, { unit: "month" });
- // Jan, Feb, ..., Dec
- case "LLL":
- return localize.month(month, {
- width: "abbreviated",
- context: "standalone",
- });
- // J, F, ..., D
- case "LLLLL":
- return localize.month(month, {
- width: "narrow",
- context: "standalone",
- });
- // January, February, ..., December
- case "LLLL":
- default:
- return localize.month(month, { width: "wide", context: "standalone" });
- }
- },
-
- // Local week of year
- w: function (date, token, localize, options) {
- const week = (0,_getWeek_js__WEBPACK_IMPORTED_MODULE_3__.getWeek)(date, options);
-
- if (token === "wo") {
- return localize.ordinalNumber(week, { unit: "week" });
- }
-
- return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(week, token.length);
- },
-
- // ISO week of year
- I: function (date, token, localize) {
- const isoWeek = (0,_getISOWeek_js__WEBPACK_IMPORTED_MODULE_1__.getISOWeek)(date);
-
- if (token === "Io") {
- return localize.ordinalNumber(isoWeek, { unit: "week" });
- }
-
- return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(isoWeek, token.length);
- },
-
- // Day of the month
- d: function (date, token, localize) {
- if (token === "do") {
- return localize.ordinalNumber(date.getDate(), { unit: "date" });
- }
-
- return _lightFormatters_js__WEBPACK_IMPORTED_MODULE_6__.lightFormatters.d(date, token);
- },
-
- // Day of year
- D: function (date, token, localize) {
- const dayOfYear = (0,_getDayOfYear_js__WEBPACK_IMPORTED_MODULE_0__.getDayOfYear)(date);
-
- if (token === "Do") {
- return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
- }
-
- return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(dayOfYear, token.length);
- },
-
- // Day of week
- E: function (date, token, localize) {
- const dayOfWeek = date.getDay();
- switch (token) {
- // Tue
- case "E":
- case "EE":
- case "EEE":
- return localize.day(dayOfWeek, {
- width: "abbreviated",
- context: "formatting",
- });
- // T
- case "EEEEE":
- return localize.day(dayOfWeek, {
- width: "narrow",
- context: "formatting",
- });
- // Tu
- case "EEEEEE":
- return localize.day(dayOfWeek, {
- width: "short",
- context: "formatting",
- });
- // Tuesday
- case "EEEE":
- default:
- return localize.day(dayOfWeek, {
- width: "wide",
- context: "formatting",
- });
- }
- },
-
- // Local day of week
- e: function (date, token, localize, options) {
- const dayOfWeek = date.getDay();
- const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
- switch (token) {
- // Numerical value (Nth day of week with current locale or weekStartsOn)
- case "e":
- return String(localDayOfWeek);
- // Padded numerical value
- case "ee":
- return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(localDayOfWeek, 2);
- // 1st, 2nd, ..., 7th
- case "eo":
- return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
- case "eee":
- return localize.day(dayOfWeek, {
- width: "abbreviated",
- context: "formatting",
- });
- // T
- case "eeeee":
- return localize.day(dayOfWeek, {
- width: "narrow",
- context: "formatting",
- });
- // Tu
- case "eeeeee":
- return localize.day(dayOfWeek, {
- width: "short",
- context: "formatting",
- });
- // Tuesday
- case "eeee":
- default:
- return localize.day(dayOfWeek, {
- width: "wide",
- context: "formatting",
- });
- }
- },
-
- // Stand-alone local day of week
- c: function (date, token, localize, options) {
- const dayOfWeek = date.getDay();
- const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
- switch (token) {
- // Numerical value (same as in `e`)
- case "c":
- return String(localDayOfWeek);
- // Padded numerical value
- case "cc":
- return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(localDayOfWeek, token.length);
- // 1st, 2nd, ..., 7th
- case "co":
- return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
- case "ccc":
- return localize.day(dayOfWeek, {
- width: "abbreviated",
- context: "standalone",
- });
- // T
- case "ccccc":
- return localize.day(dayOfWeek, {
- width: "narrow",
- context: "standalone",
- });
- // Tu
- case "cccccc":
- return localize.day(dayOfWeek, {
- width: "short",
- context: "standalone",
- });
- // Tuesday
- case "cccc":
- default:
- return localize.day(dayOfWeek, {
- width: "wide",
- context: "standalone",
- });
- }
- },
-
- // ISO day of week
- i: function (date, token, localize) {
- const dayOfWeek = date.getDay();
- const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
- switch (token) {
- // 2
- case "i":
- return String(isoDayOfWeek);
- // 02
- case "ii":
- return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(isoDayOfWeek, token.length);
- // 2nd
- case "io":
- return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
- // Tue
- case "iii":
- return localize.day(dayOfWeek, {
- width: "abbreviated",
- context: "formatting",
- });
- // T
- case "iiiii":
- return localize.day(dayOfWeek, {
- width: "narrow",
- context: "formatting",
- });
- // Tu
- case "iiiiii":
- return localize.day(dayOfWeek, {
- width: "short",
- context: "formatting",
- });
- // Tuesday
- case "iiii":
- default:
- return localize.day(dayOfWeek, {
- width: "wide",
- context: "formatting",
- });
- }
- },
-
- // AM or PM
- a: function (date, token, localize) {
- const hours = date.getHours();
- const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
-
- switch (token) {
- case "a":
- case "aa":
- return localize.dayPeriod(dayPeriodEnumValue, {
- width: "abbreviated",
- context: "formatting",
- });
- case "aaa":
- return localize
- .dayPeriod(dayPeriodEnumValue, {
- width: "abbreviated",
- context: "formatting",
- })
- .toLowerCase();
- case "aaaaa":
- return localize.dayPeriod(dayPeriodEnumValue, {
- width: "narrow",
- context: "formatting",
- });
- case "aaaa":
- default:
- return localize.dayPeriod(dayPeriodEnumValue, {
- width: "wide",
- context: "formatting",
- });
- }
- },
-
- // AM, PM, midnight, noon
- b: function (date, token, localize) {
- const hours = date.getHours();
- let dayPeriodEnumValue;
- if (hours === 12) {
- dayPeriodEnumValue = dayPeriodEnum.noon;
- } else if (hours === 0) {
- dayPeriodEnumValue = dayPeriodEnum.midnight;
- } else {
- dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
- }
-
- switch (token) {
- case "b":
- case "bb":
- return localize.dayPeriod(dayPeriodEnumValue, {
- width: "abbreviated",
- context: "formatting",
- });
- case "bbb":
- return localize
- .dayPeriod(dayPeriodEnumValue, {
- width: "abbreviated",
- context: "formatting",
- })
- .toLowerCase();
- case "bbbbb":
- return localize.dayPeriod(dayPeriodEnumValue, {
- width: "narrow",
- context: "formatting",
- });
- case "bbbb":
- default:
- return localize.dayPeriod(dayPeriodEnumValue, {
- width: "wide",
- context: "formatting",
- });
- }
- },
-
- // in the morning, in the afternoon, in the evening, at night
- B: function (date, token, localize) {
- const hours = date.getHours();
- let dayPeriodEnumValue;
- if (hours >= 17) {
- dayPeriodEnumValue = dayPeriodEnum.evening;
- } else if (hours >= 12) {
- dayPeriodEnumValue = dayPeriodEnum.afternoon;
- } else if (hours >= 4) {
- dayPeriodEnumValue = dayPeriodEnum.morning;
- } else {
- dayPeriodEnumValue = dayPeriodEnum.night;
- }
-
- switch (token) {
- case "B":
- case "BB":
- case "BBB":
- return localize.dayPeriod(dayPeriodEnumValue, {
- width: "abbreviated",
- context: "formatting",
- });
- case "BBBBB":
- return localize.dayPeriod(dayPeriodEnumValue, {
- width: "narrow",
- context: "formatting",
- });
- case "BBBB":
- default:
- return localize.dayPeriod(dayPeriodEnumValue, {
- width: "wide",
- context: "formatting",
- });
- }
- },
-
- // Hour [1-12]
- h: function (date, token, localize) {
- if (token === "ho") {
- let hours = date.getHours() % 12;
- if (hours === 0) hours = 12;
- return localize.ordinalNumber(hours, { unit: "hour" });
- }
-
- return _lightFormatters_js__WEBPACK_IMPORTED_MODULE_6__.lightFormatters.h(date, token);
- },
-
- // Hour [0-23]
- H: function (date, token, localize) {
- if (token === "Ho") {
- return localize.ordinalNumber(date.getHours(), { unit: "hour" });
- }
-
- return _lightFormatters_js__WEBPACK_IMPORTED_MODULE_6__.lightFormatters.H(date, token);
- },
-
- // Hour [0-11]
- K: function (date, token, localize) {
- const hours = date.getHours() % 12;
-
- if (token === "Ko") {
- return localize.ordinalNumber(hours, { unit: "hour" });
- }
-
- return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(hours, token.length);
- },
-
- // Hour [1-24]
- k: function (date, token, localize) {
- let hours = date.getHours();
- if (hours === 0) hours = 24;
-
- if (token === "ko") {
- return localize.ordinalNumber(hours, { unit: "hour" });
- }
-
- return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(hours, token.length);
- },
-
- // Minute
- m: function (date, token, localize) {
- if (token === "mo") {
- return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
- }
-
- return _lightFormatters_js__WEBPACK_IMPORTED_MODULE_6__.lightFormatters.m(date, token);
- },
-
- // Second
- s: function (date, token, localize) {
- if (token === "so") {
- return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
- }
-
- return _lightFormatters_js__WEBPACK_IMPORTED_MODULE_6__.lightFormatters.s(date, token);
- },
-
- // Fraction of second
- S: function (date, token) {
- return _lightFormatters_js__WEBPACK_IMPORTED_MODULE_6__.lightFormatters.S(date, token);
- },
-
- // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
- X: function (date, token, _localize) {
- const timezoneOffset = date.getTimezoneOffset();
-
- if (timezoneOffset === 0) {
- return "Z";
- }
-
- switch (token) {
- // Hours and optional minutes
- case "X":
- return formatTimezoneWithOptionalMinutes(timezoneOffset);
-
- // Hours, minutes and optional seconds without `:` delimiter
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
- // so this token always has the same output as `XX`
- case "XXXX":
- case "XX": // Hours and minutes without `:` delimiter
- return formatTimezone(timezoneOffset);
-
- // Hours, minutes and optional seconds with `:` delimiter
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
- // so this token always has the same output as `XXX`
- case "XXXXX":
- case "XXX": // Hours and minutes with `:` delimiter
- default:
- return formatTimezone(timezoneOffset, ":");
- }
- },
-
- // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
- x: function (date, token, _localize) {
- const timezoneOffset = date.getTimezoneOffset();
-
- switch (token) {
- // Hours and optional minutes
- case "x":
- return formatTimezoneWithOptionalMinutes(timezoneOffset);
-
- // Hours, minutes and optional seconds without `:` delimiter
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
- // so this token always has the same output as `xx`
- case "xxxx":
- case "xx": // Hours and minutes without `:` delimiter
- return formatTimezone(timezoneOffset);
-
- // Hours, minutes and optional seconds with `:` delimiter
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
- // so this token always has the same output as `xxx`
- case "xxxxx":
- case "xxx": // Hours and minutes with `:` delimiter
- default:
- return formatTimezone(timezoneOffset, ":");
- }
- },
-
- // Timezone (GMT)
- O: function (date, token, _localize) {
- const timezoneOffset = date.getTimezoneOffset();
-
- switch (token) {
- // Short
- case "O":
- case "OO":
- case "OOO":
- return "GMT" + formatTimezoneShort(timezoneOffset, ":");
- // Long
- case "OOOO":
- default:
- return "GMT" + formatTimezone(timezoneOffset, ":");
- }
- },
-
- // Timezone (specific non-location)
- z: function (date, token, _localize) {
- const timezoneOffset = date.getTimezoneOffset();
-
- switch (token) {
- // Short
- case "z":
- case "zz":
- case "zzz":
- return "GMT" + formatTimezoneShort(timezoneOffset, ":");
- // Long
- case "zzzz":
- default:
- return "GMT" + formatTimezone(timezoneOffset, ":");
- }
- },
-
- // Seconds timestamp
- t: function (date, token, _localize) {
- const timestamp = Math.trunc(+date / 1000);
- return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(timestamp, token.length);
- },
-
- // Milliseconds timestamp
- T: function (date, token, _localize) {
- return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(+date, token.length);
- },
-};
-
-function formatTimezoneShort(offset, delimiter = "") {
- const sign = offset > 0 ? "-" : "+";
- const absOffset = Math.abs(offset);
- const hours = Math.trunc(absOffset / 60);
- const minutes = absOffset % 60;
- if (minutes === 0) {
- return sign + String(hours);
- }
- return sign + String(hours) + delimiter + (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(minutes, 2);
-}
-
-function formatTimezoneWithOptionalMinutes(offset, delimiter) {
- if (offset % 60 === 0) {
- const sign = offset > 0 ? "-" : "+";
- return sign + (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(Math.abs(offset) / 60, 2);
- }
- return formatTimezone(offset, delimiter);
-}
-
-function formatTimezone(offset, delimiter = "") {
- const sign = offset > 0 ? "-" : "+";
- const absOffset = Math.abs(offset);
- const hours = (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(Math.trunc(absOffset / 60), 2);
- const minutes = (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_5__.addLeadingZeros)(absOffset % 60, 2);
- return sign + hours + delimiter + minutes;
-}
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/format/lightFormatters.js":
-/*!************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/format/lightFormatters.js ***!
- \************************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ lightFormatters: () => (/* binding */ lightFormatters)
-/* harmony export */ });
-/* harmony import */ var _addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../addLeadingZeros.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/addLeadingZeros.js");
-
-
-/*
- * | | Unit | | Unit |
- * |-----|--------------------------------|-----|--------------------------------|
- * | a | AM, PM | A* | |
- * | d | Day of month | D | |
- * | h | Hour [1-12] | H | Hour [0-23] |
- * | m | Minute | M | Month |
- * | s | Second | S | Fraction of second |
- * | y | Year (abs) | Y | |
- *
- * Letters marked by * are not implemented but reserved by Unicode standard.
- */
-
-const lightFormatters = {
- // Year
- y(date, token) {
- // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
- // | Year | y | yy | yyy | yyyy | yyyyy |
- // |----------|-------|----|-------|-------|-------|
- // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
- // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
- // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
- // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
- // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
-
- const signedYear = date.getFullYear();
- // Returns 1 for 1 BC (which is year 0 in JavaScript)
- const year = signedYear > 0 ? signedYear : 1 - signedYear;
- return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_0__.addLeadingZeros)(token === "yy" ? year % 100 : year, token.length);
- },
-
- // Month
- M(date, token) {
- const month = date.getMonth();
- return token === "M" ? String(month + 1) : (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_0__.addLeadingZeros)(month + 1, 2);
- },
-
- // Day of the month
- d(date, token) {
- return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_0__.addLeadingZeros)(date.getDate(), token.length);
- },
-
- // AM or PM
- a(date, token) {
- const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
-
- switch (token) {
- case "a":
- case "aa":
- return dayPeriodEnumValue.toUpperCase();
- case "aaa":
- return dayPeriodEnumValue;
- case "aaaaa":
- return dayPeriodEnumValue[0];
- case "aaaa":
- default:
- return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
- }
- },
-
- // Hour [1-12]
- h(date, token) {
- return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_0__.addLeadingZeros)(date.getHours() % 12 || 12, token.length);
- },
-
- // Hour [0-23]
- H(date, token) {
- return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_0__.addLeadingZeros)(date.getHours(), token.length);
- },
-
- // Minute
- m(date, token) {
- return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_0__.addLeadingZeros)(date.getMinutes(), token.length);
- },
-
- // Second
- s(date, token) {
- return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_0__.addLeadingZeros)(date.getSeconds(), token.length);
- },
-
- // Fraction of second
- S(date, token) {
- const numberOfDigits = token.length;
- const milliseconds = date.getMilliseconds();
- const fractionalSeconds = Math.trunc(
- milliseconds * Math.pow(10, numberOfDigits - 3),
- );
- return (0,_addLeadingZeros_js__WEBPACK_IMPORTED_MODULE_0__.addLeadingZeros)(fractionalSeconds, token.length);
- },
-};
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/format/longFormatters.js":
-/*!***********************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/format/longFormatters.js ***!
- \***********************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ longFormatters: () => (/* binding */ longFormatters)
-/* harmony export */ });
-const dateLongFormatter = (pattern, formatLong) => {
- switch (pattern) {
- case "P":
- return formatLong.date({ width: "short" });
- case "PP":
- return formatLong.date({ width: "medium" });
- case "PPP":
- return formatLong.date({ width: "long" });
- case "PPPP":
- default:
- return formatLong.date({ width: "full" });
- }
-};
-
-const timeLongFormatter = (pattern, formatLong) => {
- switch (pattern) {
- case "p":
- return formatLong.time({ width: "short" });
- case "pp":
- return formatLong.time({ width: "medium" });
- case "ppp":
- return formatLong.time({ width: "long" });
- case "pppp":
- default:
- return formatLong.time({ width: "full" });
- }
-};
-
-const dateTimeLongFormatter = (pattern, formatLong) => {
- const matchResult = pattern.match(/(P+)(p+)?/) || [];
- const datePattern = matchResult[1];
- const timePattern = matchResult[2];
-
- if (!timePattern) {
- return dateLongFormatter(pattern, formatLong);
- }
-
- let dateTimeFormat;
-
- switch (datePattern) {
- case "P":
- dateTimeFormat = formatLong.dateTime({ width: "short" });
- break;
- case "PP":
- dateTimeFormat = formatLong.dateTime({ width: "medium" });
- break;
- case "PPP":
- dateTimeFormat = formatLong.dateTime({ width: "long" });
- break;
- case "PPPP":
- default:
- dateTimeFormat = formatLong.dateTime({ width: "full" });
- break;
- }
-
- return dateTimeFormat
- .replace("{{date}}", dateLongFormatter(datePattern, formatLong))
- .replace("{{time}}", timeLongFormatter(timePattern, formatLong));
-};
-
-const longFormatters = {
- p: timeLongFormatter,
- P: dateTimeLongFormatter,
-};
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js":
-/*!*********************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js ***!
- \*********************************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ getTimezoneOffsetInMilliseconds: () => (/* binding */ getTimezoneOffsetInMilliseconds)
-/* harmony export */ });
-/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
-
-
-/**
- * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
- * They usually appear for dates that denote time before the timezones were introduced
- * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
- * and GMT+01:00:00 after that date)
- *
- * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
- * which would lead to incorrect calculations.
- *
- * This function returns the timezone offset in milliseconds that takes seconds in account.
- */
-function getTimezoneOffsetInMilliseconds(date) {
- const _date = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_0__.toDate)(date);
- const utcDate = new Date(
- Date.UTC(
- _date.getFullYear(),
- _date.getMonth(),
- _date.getDate(),
- _date.getHours(),
- _date.getMinutes(),
- _date.getSeconds(),
- _date.getMilliseconds(),
- ),
- );
- utcDate.setUTCFullYear(_date.getFullYear());
- return +date - +utcDate;
-}
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/normalizeDates.js":
-/*!****************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/normalizeDates.js ***!
- \****************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ normalizeDates: () => (/* binding */ normalizeDates)
-/* harmony export */ });
-/* harmony import */ var _constructFrom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constructFrom.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constructFrom.js");
-
-
-function normalizeDates(context, ...dates) {
- const normalize = _constructFrom_js__WEBPACK_IMPORTED_MODULE_0__.constructFrom.bind(
- null,
- context || dates.find((date) => typeof date === "object"),
- );
- return dates.map(normalize);
-}
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/protectedTokens.js":
-/*!*****************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/protectedTokens.js ***!
- \*****************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ isProtectedDayOfYearToken: () => (/* binding */ isProtectedDayOfYearToken),
-/* harmony export */ isProtectedWeekYearToken: () => (/* binding */ isProtectedWeekYearToken),
-/* harmony export */ warnOrThrowProtectedError: () => (/* binding */ warnOrThrowProtectedError)
-/* harmony export */ });
-const dayOfYearTokenRE = /^D+$/;
-const weekYearTokenRE = /^Y+$/;
-
-const throwTokens = ["D", "DD", "YY", "YYYY"];
-
-function isProtectedDayOfYearToken(token) {
- return dayOfYearTokenRE.test(token);
-}
-
-function isProtectedWeekYearToken(token) {
- return weekYearTokenRE.test(token);
-}
-
-function warnOrThrowProtectedError(token, format, input) {
- const _message = message(token, format, input);
- console.warn(_message);
- if (throwTokens.includes(token)) throw new RangeError(_message);
-}
-
-function message(token, format, input) {
- const subject = token[0] === "Y" ? "years" : "days of the month";
- return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
-}
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/addDays.js":
-/*!****************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/addDays.js ***!
- \****************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ addDays: () => (/* binding */ addDays),
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
-/* harmony export */ });
-/* harmony import */ var _constructFrom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constructFrom.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constructFrom.js");
-/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
-
-
-
-/**
- * The {@link addDays} function options.
- */
-
-/**
- * @name addDays
- * @category Day Helpers
- * @summary Add the specified number of days to the given date.
- *
- * @description
- * Add the specified number of days to the given date.
- *
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
- *
- * @param date - The date to be changed
- * @param amount - The amount of days to be added.
- * @param options - An object with options
- *
- * @returns The new date with the days added
- *
- * @example
- * // Add 10 days to 1 September 2014:
- * const result = addDays(new Date(2014, 8, 1), 10)
- * //=> Thu Sep 11 2014 00:00:00
- */
-function addDays(date, amount, options) {
- const _date = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_1__.toDate)(date, options?.in);
- if (isNaN(amount)) return (0,_constructFrom_js__WEBPACK_IMPORTED_MODULE_0__.constructFrom)(options?.in || date, NaN);
-
- // If 0 days, no-op to avoid changing times in the hour before end of DST
- if (!amount) return _date;
-
- _date.setDate(_date.getDate() + amount);
- return _date;
-}
-
-// Fallback for modularized imports:
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (addDays);
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/addMonths.js":
-/*!******************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/addMonths.js ***!
- \******************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ addMonths: () => (/* binding */ addMonths),
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
-/* harmony export */ });
-/* harmony import */ var _constructFrom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constructFrom.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constructFrom.js");
-/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
-
-
-
-/**
- * The {@link addMonths} function options.
- */
-
-/**
- * @name addMonths
- * @category Month Helpers
- * @summary Add the specified number of months to the given date.
- *
- * @description
- * Add the specified number of months to the given date.
- *
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
- *
- * @param date - The date to be changed
- * @param amount - The amount of months to be added.
- * @param options - The options object
- *
- * @returns The new date with the months added
- *
- * @example
- * // Add 5 months to 1 September 2014:
- * const result = addMonths(new Date(2014, 8, 1), 5)
- * //=> Sun Feb 01 2015 00:00:00
- *
- * // Add one month to 30 January 2023:
- * const result = addMonths(new Date(2023, 0, 30), 1)
- * //=> Tue Feb 28 2023 00:00:00
- */
-function addMonths(date, amount, options) {
- const _date = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_1__.toDate)(date, options?.in);
- if (isNaN(amount)) return (0,_constructFrom_js__WEBPACK_IMPORTED_MODULE_0__.constructFrom)(options?.in || date, NaN);
- if (!amount) {
- // If 0 months, no-op to avoid changing times in the hour before end of DST
- return _date;
- }
- const dayOfMonth = _date.getDate();
-
- // The JS Date object supports date math by accepting out-of-bounds values for
- // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
- // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we
- // want except that dates will wrap around the end of a month, meaning that
- // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
- // we'll default to the end of the desired month by adding 1 to the desired
- // month and using a date of 0 to back up one day to the end of the desired
- // month.
- const endOfDesiredMonth = (0,_constructFrom_js__WEBPACK_IMPORTED_MODULE_0__.constructFrom)(options?.in || date, _date.getTime());
- endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
- const daysInMonth = endOfDesiredMonth.getDate();
- if (dayOfMonth >= daysInMonth) {
- // If we're already at the end of the month, then this is the correct date
- // and we're done.
- return endOfDesiredMonth;
- } else {
- // Otherwise, we now know that setting the original day-of-month value won't
- // cause an overflow, so set the desired day-of-month. Note that we can't
- // just set the date of `endOfDesiredMonth` because that object may have had
- // its time changed in the unusual case where where a DST transition was on
- // the last day of the month and its local time was in the hour skipped or
- // repeated next to a DST transition. So we use `date` instead which is
- // guaranteed to still have the original time.
- _date.setFullYear(
- endOfDesiredMonth.getFullYear(),
- endOfDesiredMonth.getMonth(),
- dayOfMonth,
- );
- return _date;
- }
-}
-
-// Fallback for modularized imports:
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (addMonths);
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/addYears.js":
-/*!*****************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/addYears.js ***!
- \*****************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ addYears: () => (/* binding */ addYears),
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
-/* harmony export */ });
-/* harmony import */ var _addMonths_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./addMonths.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/addMonths.js");
-
-
-/**
- * The {@link addYears} function options.
- */
-
-/**
- * @name addYears
- * @category Year Helpers
- * @summary Add the specified number of years to the given date.
- *
- * @description
- * Add the specified number of years to the given date.
- *
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
- * @typeParam ResultDate - The result `Date` type.
- *
- * @param date - The date to be changed
- * @param amount - The amount of years to be added.
- * @param options - The options
- *
- * @returns The new date with the years added
- *
- * @example
- * // Add 5 years to 1 September 2014:
- * const result = addYears(new Date(2014, 8, 1), 5)
- * //=> Sun Sep 01 2019 00:00:00
- */
-function addYears(date, amount, options) {
- return (0,_addMonths_js__WEBPACK_IMPORTED_MODULE_0__.addMonths)(date, amount * 12, options);
-}
-
-// Fallback for modularized imports:
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (addYears);
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constants.js":
-/*!******************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/constants.js ***!
- \******************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ constructFromSymbol: () => (/* binding */ constructFromSymbol),
-/* harmony export */ daysInWeek: () => (/* binding */ daysInWeek),
-/* harmony export */ daysInYear: () => (/* binding */ daysInYear),
-/* harmony export */ maxTime: () => (/* binding */ maxTime),
-/* harmony export */ millisecondsInDay: () => (/* binding */ millisecondsInDay),
-/* harmony export */ millisecondsInHour: () => (/* binding */ millisecondsInHour),
-/* harmony export */ millisecondsInMinute: () => (/* binding */ millisecondsInMinute),
-/* harmony export */ millisecondsInSecond: () => (/* binding */ millisecondsInSecond),
-/* harmony export */ millisecondsInWeek: () => (/* binding */ millisecondsInWeek),
-/* harmony export */ minTime: () => (/* binding */ minTime),
-/* harmony export */ minutesInDay: () => (/* binding */ minutesInDay),
-/* harmony export */ minutesInHour: () => (/* binding */ minutesInHour),
-/* harmony export */ minutesInMonth: () => (/* binding */ minutesInMonth),
-/* harmony export */ minutesInYear: () => (/* binding */ minutesInYear),
-/* harmony export */ monthsInQuarter: () => (/* binding */ monthsInQuarter),
-/* harmony export */ monthsInYear: () => (/* binding */ monthsInYear),
-/* harmony export */ quartersInYear: () => (/* binding */ quartersInYear),
-/* harmony export */ secondsInDay: () => (/* binding */ secondsInDay),
-/* harmony export */ secondsInHour: () => (/* binding */ secondsInHour),
-/* harmony export */ secondsInMinute: () => (/* binding */ secondsInMinute),
-/* harmony export */ secondsInMonth: () => (/* binding */ secondsInMonth),
-/* harmony export */ secondsInQuarter: () => (/* binding */ secondsInQuarter),
-/* harmony export */ secondsInWeek: () => (/* binding */ secondsInWeek),
-/* harmony export */ secondsInYear: () => (/* binding */ secondsInYear)
-/* harmony export */ });
-/**
- * @module constants
- * @summary Useful constants
- * @description
- * Collection of useful date constants.
- *
- * The constants could be imported from `date-fns/constants`:
- *
- * ```ts
- * import { maxTime, minTime } from "./constants/date-fns/constants";
- *
- * function isAllowedTime(time) {
- * return time <= maxTime && time >= minTime;
- * }
- * ```
- */
-
-/**
- * @constant
- * @name daysInWeek
- * @summary Days in 1 week.
- */
-const daysInWeek = 7;
-
-/**
- * @constant
- * @name daysInYear
- * @summary Days in 1 year.
- *
- * @description
- * How many days in a year.
- *
- * One years equals 365.2425 days according to the formula:
- *
- * > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400.
- * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days
- */
-const daysInYear = 365.2425;
-
-/**
- * @constant
- * @name maxTime
- * @summary Maximum allowed time.
- *
- * @example
- * import { maxTime } from "./constants/date-fns/constants";
- *
- * const isValid = 8640000000000001 <= maxTime;
- * //=> false
- *
- * new Date(8640000000000001);
- * //=> Invalid Date
- */
-const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;
-
-/**
- * @constant
- * @name minTime
- * @summary Minimum allowed time.
- *
- * @example
- * import { minTime } from "./constants/date-fns/constants";
- *
- * const isValid = -8640000000000001 >= minTime;
- * //=> false
- *
- * new Date(-8640000000000001)
- * //=> Invalid Date
- */
-const minTime = -maxTime;
-
-/**
- * @constant
- * @name millisecondsInWeek
- * @summary Milliseconds in 1 week.
- */
-const millisecondsInWeek = 604800000;
-
-/**
- * @constant
- * @name millisecondsInDay
- * @summary Milliseconds in 1 day.
- */
-const millisecondsInDay = 86400000;
-
-/**
- * @constant
- * @name millisecondsInMinute
- * @summary Milliseconds in 1 minute
- */
-const millisecondsInMinute = 60000;
-
-/**
- * @constant
- * @name millisecondsInHour
- * @summary Milliseconds in 1 hour
- */
-const millisecondsInHour = 3600000;
-
-/**
- * @constant
- * @name millisecondsInSecond
- * @summary Milliseconds in 1 second
- */
-const millisecondsInSecond = 1000;
-
-/**
- * @constant
- * @name minutesInYear
- * @summary Minutes in 1 year.
- */
-const minutesInYear = 525600;
-
-/**
- * @constant
- * @name minutesInMonth
- * @summary Minutes in 1 month.
- */
-const minutesInMonth = 43200;
-
-/**
- * @constant
- * @name minutesInDay
- * @summary Minutes in 1 day.
- */
-const minutesInDay = 1440;
-
-/**
- * @constant
- * @name minutesInHour
- * @summary Minutes in 1 hour.
- */
-const minutesInHour = 60;
-
-/**
- * @constant
- * @name monthsInQuarter
- * @summary Months in 1 quarter.
- */
-const monthsInQuarter = 3;
-
-/**
- * @constant
- * @name monthsInYear
- * @summary Months in 1 year.
- */
-const monthsInYear = 12;
-
-/**
- * @constant
- * @name quartersInYear
- * @summary Quarters in 1 year
- */
-const quartersInYear = 4;
-
-/**
- * @constant
- * @name secondsInHour
- * @summary Seconds in 1 hour.
- */
-const secondsInHour = 3600;
-
-/**
- * @constant
- * @name secondsInMinute
- * @summary Seconds in 1 minute.
- */
-const secondsInMinute = 60;
-
-/**
- * @constant
- * @name secondsInDay
- * @summary Seconds in 1 day.
- */
-const secondsInDay = secondsInHour * 24;
-
-/**
- * @constant
- * @name secondsInWeek
- * @summary Seconds in 1 week.
- */
-const secondsInWeek = secondsInDay * 7;
-
-/**
- * @constant
- * @name secondsInYear
- * @summary Seconds in 1 year.
- */
-const secondsInYear = secondsInDay * daysInYear;
-
-/**
- * @constant
- * @name secondsInMonth
- * @summary Seconds in 1 month
- */
-const secondsInMonth = secondsInYear / 12;
-
-/**
- * @constant
- * @name secondsInQuarter
- * @summary Seconds in 1 quarter.
- */
-const secondsInQuarter = secondsInMonth * 3;
-
-/**
- * @constant
- * @name constructFromSymbol
- * @summary Symbol enabling Date extensions to inherit properties from the reference date.
- *
- * The symbol is used to enable the `constructFrom` function to construct a date
- * using a reference date and a value. It allows to transfer extra properties
- * from the reference date to the new date. It's useful for extensions like
- * [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as
- * a constructor argument.
- */
-const constructFromSymbol = Symbol.for("constructDateFrom");
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constructFrom.js":
-/*!**********************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/constructFrom.js ***!
- \**********************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ constructFrom: () => (/* binding */ constructFrom),
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
-/* harmony export */ });
-/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constants.js");
-
-
-/**
- * @name constructFrom
- * @category Generic Helpers
- * @summary Constructs a date using the reference date and the value
- *
- * @description
- * The function constructs a new date using the constructor from the reference
- * date and the given value. It helps to build generic functions that accept
- * date extensions.
- *
- * It defaults to `Date` if the passed reference date is a number or a string.
- *
- * Starting from v3.7.0, it allows to construct a date using `[Symbol.for("constructDateFrom")]`
- * enabling to transfer extra properties from the reference date to the new date.
- * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
- * that accept a time zone as a constructor argument.
- *
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
- *
- * @param date - The reference date to take constructor from
- * @param value - The value to create the date
- *
- * @returns Date initialized using the given date and value
- *
- * @example
- * import { constructFrom } from "./constructFrom/date-fns";
- *
- * // A function that clones a date preserving the original type
- * function cloneDate(date: DateType): DateType {
- * return constructFrom(
- * date, // Use constructor from the given date
- * date.getTime() // Use the date value to create a new date
- * );
- * }
- */
-function constructFrom(date, value) {
- if (typeof date === "function") return date(value);
-
- if (date && typeof date === "object" && _constants_js__WEBPACK_IMPORTED_MODULE_0__.constructFromSymbol in date)
- return date[_constants_js__WEBPACK_IMPORTED_MODULE_0__.constructFromSymbol](value);
-
- if (date instanceof Date) return new date.constructor(value);
-
- return new Date(value);
-}
-
-// Fallback for modularized imports:
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (constructFrom);
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/differenceInCalendarDays.js":
-/*!*********************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/differenceInCalendarDays.js ***!
- \*********************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
-/* harmony export */ differenceInCalendarDays: () => (/* binding */ differenceInCalendarDays)
-/* harmony export */ });
-/* harmony import */ var _lib_getTimezoneOffsetInMilliseconds_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_lib/getTimezoneOffsetInMilliseconds.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js");
-/* harmony import */ var _lib_normalizeDates_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_lib/normalizeDates.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/normalizeDates.js");
-/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constants.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constants.js");
-/* harmony import */ var _startOfDay_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./startOfDay.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfDay.js");
-
-
-
-
-
-/**
- * The {@link differenceInCalendarDays} function options.
- */
-
-/**
- * @name differenceInCalendarDays
- * @category Day Helpers
- * @summary Get the number of calendar days between the given dates.
- *
- * @description
- * Get the number of calendar days between the given dates. This means that the times are removed
- * from the dates and then the difference in days is calculated.
- *
- * @param laterDate - The later date
- * @param earlierDate - The earlier date
- * @param options - The options object
- *
- * @returns The number of calendar days
- *
- * @example
- * // How many calendar days are between
- * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
- * const result = differenceInCalendarDays(
- * new Date(2012, 6, 2, 0, 0),
- * new Date(2011, 6, 2, 23, 0)
- * )
- * //=> 366
- * // How many calendar days are between
- * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
- * const result = differenceInCalendarDays(
- * new Date(2011, 6, 3, 0, 1),
- * new Date(2011, 6, 2, 23, 59)
- * )
- * //=> 1
- */
-function differenceInCalendarDays(laterDate, earlierDate, options) {
- const [laterDate_, earlierDate_] = (0,_lib_normalizeDates_js__WEBPACK_IMPORTED_MODULE_1__.normalizeDates)(
- options?.in,
- laterDate,
- earlierDate,
- );
-
- const laterStartOfDay = (0,_startOfDay_js__WEBPACK_IMPORTED_MODULE_3__.startOfDay)(laterDate_);
- const earlierStartOfDay = (0,_startOfDay_js__WEBPACK_IMPORTED_MODULE_3__.startOfDay)(earlierDate_);
-
- const laterTimestamp =
- +laterStartOfDay - (0,_lib_getTimezoneOffsetInMilliseconds_js__WEBPACK_IMPORTED_MODULE_0__.getTimezoneOffsetInMilliseconds)(laterStartOfDay);
- const earlierTimestamp =
- +earlierStartOfDay - (0,_lib_getTimezoneOffsetInMilliseconds_js__WEBPACK_IMPORTED_MODULE_0__.getTimezoneOffsetInMilliseconds)(earlierStartOfDay);
-
- // Round the number of days to the nearest integer because the number of
- // milliseconds in a day is not constant (e.g. it's different in the week of
- // the daylight saving time clock shift).
- return Math.round((laterTimestamp - earlierTimestamp) / _constants_js__WEBPACK_IMPORTED_MODULE_2__.millisecondsInDay);
-}
-
-// Fallback for modularized imports:
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (differenceInCalendarDays);
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/format.js":
-/*!***************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/format.js ***!
- \***************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
-/* harmony export */ format: () => (/* binding */ format),
-/* harmony export */ formatDate: () => (/* binding */ format),
-/* harmony export */ formatters: () => (/* reexport safe */ _lib_format_formatters_js__WEBPACK_IMPORTED_MODULE_2__.formatters),
-/* harmony export */ longFormatters: () => (/* reexport safe */ _lib_format_longFormatters_js__WEBPACK_IMPORTED_MODULE_3__.longFormatters)
-/* harmony export */ });
-/* harmony import */ var _lib_defaultLocale_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_lib/defaultLocale.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US.js");
-/* harmony import */ var _lib_defaultOptions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_lib/defaultOptions.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/defaultOptions.js");
-/* harmony import */ var _lib_format_formatters_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_lib/format/formatters.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/format/formatters.js");
-/* harmony import */ var _lib_format_longFormatters_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_lib/format/longFormatters.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/format/longFormatters.js");
-/* harmony import */ var _lib_protectedTokens_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_lib/protectedTokens.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/protectedTokens.js");
-/* harmony import */ var _isValid_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isValid.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/isValid.js");
-/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
-
-
-
-
-
-
-
-
-// Rexports of internal for libraries to use.
-// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874
-
-
-// This RegExp consists of three parts separated by `|`:
-// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
-// (one of the certain letters followed by `o`)
-// - (\w)\1* matches any sequences of the same letter
-// - '' matches two quote characters in a row
-// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
-// except a single quote symbol, which ends the sequence.
-// Two quote characters do not end the sequence.
-// If there is no matching single quote
-// then the sequence will continue until the end of the string.
-// - . matches any single character unmatched by previous parts of the RegExps
-const formattingTokensRegExp =
- /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
-
-// This RegExp catches symbols escaped by quotes, and also
-// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
-const longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
-
-const escapedStringRegExp = /^'([^]*?)'?$/;
-const doubleQuoteRegExp = /''/g;
-const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
-
-
-
-/**
- * The {@link format} function options.
- */
-
-/**
- * @name format
- * @alias formatDate
- * @category Common Helpers
- * @summary Format the date.
- *
- * @description
- * Return the formatted date string in the given format. The result may vary by locale.
- *
- * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
- * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
- *
- * The characters wrapped between two single quotes characters (') are escaped.
- * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
- * (see the last example)
- *
- * Format of the string is based on Unicode Technical Standard #35:
- * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
- * with a few additions (see note 7 below the table).
- *
- * Accepted patterns:
- * | Unit | Pattern | Result examples | Notes |
- * |---------------------------------|---------|-----------------------------------|-------|
- * | Era | G..GGG | AD, BC | |
- * | | GGGG | Anno Domini, Before Christ | 2 |
- * | | GGGGG | A, B | |
- * | Calendar year | y | 44, 1, 1900, 2017 | 5 |
- * | | yo | 44th, 1st, 0th, 17th | 5,7 |
- * | | yy | 44, 01, 00, 17 | 5 |
- * | | yyy | 044, 001, 1900, 2017 | 5 |
- * | | yyyy | 0044, 0001, 1900, 2017 | 5 |
- * | | yyyyy | ... | 3,5 |
- * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
- * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
- * | | YY | 44, 01, 00, 17 | 5,8 |
- * | | YYY | 044, 001, 1900, 2017 | 5 |
- * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
- * | | YYYYY | ... | 3,5 |
- * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
- * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
- * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
- * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
- * | | RRRRR | ... | 3,5,7 |
- * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
- * | | uu | -43, 01, 1900, 2017 | 5 |
- * | | uuu | -043, 001, 1900, 2017 | 5 |
- * | | uuuu | -0043, 0001, 1900, 2017 | 5 |
- * | | uuuuu | ... | 3,5 |
- * | Quarter (formatting) | Q | 1, 2, 3, 4 | |
- * | | Qo | 1st, 2nd, 3rd, 4th | 7 |
- * | | QQ | 01, 02, 03, 04 | |
- * | | QQQ | Q1, Q2, Q3, Q4 | |
- * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
- * | | QQQQQ | 1, 2, 3, 4 | 4 |
- * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
- * | | qo | 1st, 2nd, 3rd, 4th | 7 |
- * | | qq | 01, 02, 03, 04 | |
- * | | qqq | Q1, Q2, Q3, Q4 | |
- * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
- * | | qqqqq | 1, 2, 3, 4 | 4 |
- * | Month (formatting) | M | 1, 2, ..., 12 | |
- * | | Mo | 1st, 2nd, ..., 12th | 7 |
- * | | MM | 01, 02, ..., 12 | |
- * | | MMM | Jan, Feb, ..., Dec | |
- * | | MMMM | January, February, ..., December | 2 |
- * | | MMMMM | J, F, ..., D | |
- * | Month (stand-alone) | L | 1, 2, ..., 12 | |
- * | | Lo | 1st, 2nd, ..., 12th | 7 |
- * | | LL | 01, 02, ..., 12 | |
- * | | LLL | Jan, Feb, ..., Dec | |
- * | | LLLL | January, February, ..., December | 2 |
- * | | LLLLL | J, F, ..., D | |
- * | Local week of year | w | 1, 2, ..., 53 | |
- * | | wo | 1st, 2nd, ..., 53th | 7 |
- * | | ww | 01, 02, ..., 53 | |
- * | ISO week of year | I | 1, 2, ..., 53 | 7 |
- * | | Io | 1st, 2nd, ..., 53th | 7 |
- * | | II | 01, 02, ..., 53 | 7 |
- * | Day of month | d | 1, 2, ..., 31 | |
- * | | do | 1st, 2nd, ..., 31st | 7 |
- * | | dd | 01, 02, ..., 31 | |
- * | Day of year | D | 1, 2, ..., 365, 366 | 9 |
- * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
- * | | DD | 01, 02, ..., 365, 366 | 9 |
- * | | DDD | 001, 002, ..., 365, 366 | |
- * | | DDDD | ... | 3 |
- * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
- * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
- * | | EEEEE | M, T, W, T, F, S, S | |
- * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
- * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
- * | | io | 1st, 2nd, ..., 7th | 7 |
- * | | ii | 01, 02, ..., 07 | 7 |
- * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
- * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
- * | | iiiii | M, T, W, T, F, S, S | 7 |
- * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
- * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
- * | | eo | 2nd, 3rd, ..., 1st | 7 |
- * | | ee | 02, 03, ..., 01 | |
- * | | eee | Mon, Tue, Wed, ..., Sun | |
- * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
- * | | eeeee | M, T, W, T, F, S, S | |
- * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
- * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
- * | | co | 2nd, 3rd, ..., 1st | 7 |
- * | | cc | 02, 03, ..., 01 | |
- * | | ccc | Mon, Tue, Wed, ..., Sun | |
- * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
- * | | ccccc | M, T, W, T, F, S, S | |
- * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
- * | AM, PM | a..aa | AM, PM | |
- * | | aaa | am, pm | |
- * | | aaaa | a.m., p.m. | 2 |
- * | | aaaaa | a, p | |
- * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
- * | | bbb | am, pm, noon, midnight | |
- * | | bbbb | a.m., p.m., noon, midnight | 2 |
- * | | bbbbb | a, p, n, mi | |
- * | Flexible day period | B..BBB | at night, in the morning, ... | |
- * | | BBBB | at night, in the morning, ... | 2 |
- * | | BBBBB | at night, in the morning, ... | |
- * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
- * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
- * | | hh | 01, 02, ..., 11, 12 | |
- * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
- * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
- * | | HH | 00, 01, 02, ..., 23 | |
- * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
- * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
- * | | KK | 01, 02, ..., 11, 00 | |
- * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
- * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
- * | | kk | 24, 01, 02, ..., 23 | |
- * | Minute | m | 0, 1, ..., 59 | |
- * | | mo | 0th, 1st, ..., 59th | 7 |
- * | | mm | 00, 01, ..., 59 | |
- * | Second | s | 0, 1, ..., 59 | |
- * | | so | 0th, 1st, ..., 59th | 7 |
- * | | ss | 00, 01, ..., 59 | |
- * | Fraction of second | S | 0, 1, ..., 9 | |
- * | | SS | 00, 01, ..., 99 | |
- * | | SSS | 000, 001, ..., 999 | |
- * | | SSSS | ... | 3 |
- * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
- * | | XX | -0800, +0530, Z | |
- * | | XXX | -08:00, +05:30, Z | |
- * | | XXXX | -0800, +0530, Z, +123456 | 2 |
- * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
- * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
- * | | xx | -0800, +0530, +0000 | |
- * | | xxx | -08:00, +05:30, +00:00 | 2 |
- * | | xxxx | -0800, +0530, +0000, +123456 | |
- * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
- * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
- * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
- * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
- * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
- * | Seconds timestamp | t | 512969520 | 7 |
- * | | tt | ... | 3,7 |
- * | Milliseconds timestamp | T | 512969520900 | 7 |
- * | | TT | ... | 3,7 |
- * | Long localized date | P | 04/29/1453 | 7 |
- * | | PP | Apr 29, 1453 | 7 |
- * | | PPP | April 29th, 1453 | 7 |
- * | | PPPP | Friday, April 29th, 1453 | 2,7 |
- * | Long localized time | p | 12:00 AM | 7 |
- * | | pp | 12:00:00 AM | 7 |
- * | | ppp | 12:00:00 AM GMT+2 | 7 |
- * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
- * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
- * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
- * | | PPPppp | April 29th, 1453 at ... | 7 |
- * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
- * Notes:
- * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
- * are the same as "stand-alone" units, but are different in some languages.
- * "Formatting" units are declined according to the rules of the language
- * in the context of a date. "Stand-alone" units are always nominative singular:
- *
- * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
- *
- * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
- *
- * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
- * the single quote characters (see below).
- * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
- * the output will be the same as default pattern for this unit, usually
- * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
- * are marked with "2" in the last column of the table.
- *
- * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
- *
- * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
- *
- * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
- *
- * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
- *
- * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
- *
- * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
- * The output will be padded with zeros to match the length of the pattern.
- *
- * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
- *
- * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
- * These tokens represent the shortest form of the quarter.
- *
- * 5. The main difference between `y` and `u` patterns are B.C. years:
- *
- * | Year | `y` | `u` |
- * |------|-----|-----|
- * | AC 1 | 1 | 1 |
- * | BC 1 | 1 | 0 |
- * | BC 2 | 2 | -1 |
- *
- * Also `yy` always returns the last two digits of a year,
- * while `uu` pads single digit years to 2 characters and returns other years unchanged:
- *
- * | Year | `yy` | `uu` |
- * |------|------|------|
- * | 1 | 01 | 01 |
- * | 14 | 14 | 14 |
- * | 376 | 76 | 376 |
- * | 1453 | 53 | 1453 |
- *
- * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
- * except local week-numbering years are dependent on `options.weekStartsOn`
- * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)
- * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).
- *
- * 6. Specific non-location timezones are currently unavailable in `date-fns`,
- * so right now these tokens fall back to GMT timezones.
- *
- * 7. These patterns are not in the Unicode Technical Standard #35:
- * - `i`: ISO day of week
- * - `I`: ISO week of year
- * - `R`: ISO week-numbering year
- * - `t`: seconds timestamp
- * - `T`: milliseconds timestamp
- * - `o`: ordinal number modifier
- * - `P`: long localized date
- * - `p`: long localized time
- *
- * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
- * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
- *
- * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
- * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
- *
- * @param date - The original date
- * @param format - The string of tokens
- * @param options - An object with options
- *
- * @returns The formatted date string
- *
- * @throws `date` must not be Invalid Date
- * @throws `options.locale` must contain `localize` property
- * @throws `options.locale` must contain `formatLong` property
- * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
- * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
- * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
- * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
- * @throws format string contains an unescaped latin alphabet character
- *
- * @example
- * // Represent 11 February 2014 in middle-endian format:
- * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
- * //=> '02/11/2014'
- *
- * @example
- * // Represent 2 July 2014 in Esperanto:
- * import { eoLocale } from 'date-fns/locale/eo'
- * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
- * locale: eoLocale
- * })
- * //=> '2-a de julio 2014'
- *
- * @example
- * // Escape string by single quote characters:
- * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
- * //=> "3 o'clock"
- */
-function format(date, formatStr, options) {
- const defaultOptions = (0,_lib_defaultOptions_js__WEBPACK_IMPORTED_MODULE_1__.getDefaultOptions)();
- const locale = options?.locale ?? defaultOptions.locale ?? _lib_defaultLocale_js__WEBPACK_IMPORTED_MODULE_0__.enUS;
-
- const firstWeekContainsDate =
- options?.firstWeekContainsDate ??
- options?.locale?.options?.firstWeekContainsDate ??
- defaultOptions.firstWeekContainsDate ??
- defaultOptions.locale?.options?.firstWeekContainsDate ??
- 1;
-
- const weekStartsOn =
- options?.weekStartsOn ??
- options?.locale?.options?.weekStartsOn ??
- defaultOptions.weekStartsOn ??
- defaultOptions.locale?.options?.weekStartsOn ??
- 0;
-
- const originalDate = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_6__.toDate)(date, options?.in);
-
- if (!(0,_isValid_js__WEBPACK_IMPORTED_MODULE_5__.isValid)(originalDate)) {
- throw new RangeError("Invalid time value");
- }
-
- let parts = formatStr
- .match(longFormattingTokensRegExp)
- .map((substring) => {
- const firstCharacter = substring[0];
- if (firstCharacter === "p" || firstCharacter === "P") {
- const longFormatter = _lib_format_longFormatters_js__WEBPACK_IMPORTED_MODULE_3__.longFormatters[firstCharacter];
- return longFormatter(substring, locale.formatLong);
- }
- return substring;
- })
- .join("")
- .match(formattingTokensRegExp)
- .map((substring) => {
- // Replace two single quote characters with one single quote character
- if (substring === "''") {
- return { isToken: false, value: "'" };
- }
-
- const firstCharacter = substring[0];
- if (firstCharacter === "'") {
- return { isToken: false, value: cleanEscapedString(substring) };
- }
-
- if (_lib_format_formatters_js__WEBPACK_IMPORTED_MODULE_2__.formatters[firstCharacter]) {
- return { isToken: true, value: substring };
- }
-
- if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
- throw new RangeError(
- "Format string contains an unescaped latin alphabet character `" +
- firstCharacter +
- "`",
- );
- }
-
- return { isToken: false, value: substring };
- });
-
- // invoke localize preprocessor (only for french locales at the moment)
- if (locale.localize.preprocessor) {
- parts = locale.localize.preprocessor(originalDate, parts);
- }
-
- const formatterOptions = {
- firstWeekContainsDate,
- weekStartsOn,
- locale,
- };
-
- return parts
- .map((part) => {
- if (!part.isToken) return part.value;
-
- const token = part.value;
-
- if (
- (!options?.useAdditionalWeekYearTokens &&
- (0,_lib_protectedTokens_js__WEBPACK_IMPORTED_MODULE_4__.isProtectedWeekYearToken)(token)) ||
- (!options?.useAdditionalDayOfYearTokens &&
- (0,_lib_protectedTokens_js__WEBPACK_IMPORTED_MODULE_4__.isProtectedDayOfYearToken)(token))
- ) {
- (0,_lib_protectedTokens_js__WEBPACK_IMPORTED_MODULE_4__.warnOrThrowProtectedError)(token, formatStr, String(date));
- }
-
- const formatter = _lib_format_formatters_js__WEBPACK_IMPORTED_MODULE_2__.formatters[token[0]];
- return formatter(originalDate, token, locale.localize, formatterOptions);
- })
- .join("");
-}
-
-function cleanEscapedString(input) {
- const matched = input.match(escapedStringRegExp);
-
- if (!matched) {
- return input;
- }
-
- return matched[1].replace(doubleQuoteRegExp, "'");
-}
-
-// Fallback for modularized imports:
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (format);
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/getDayOfYear.js":
-/*!*********************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/getDayOfYear.js ***!
- \*********************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
-/* harmony export */ getDayOfYear: () => (/* binding */ getDayOfYear)
-/* harmony export */ });
-/* harmony import */ var _differenceInCalendarDays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./differenceInCalendarDays.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/differenceInCalendarDays.js");
-/* harmony import */ var _startOfYear_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./startOfYear.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfYear.js");
-/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
-
-
-
-
-/**
- * The {@link getDayOfYear} function options.
- */
-
-/**
- * @name getDayOfYear
- * @category Day Helpers
- * @summary Get the day of the year of the given date.
- *
- * @description
- * Get the day of the year of the given date.
- *
- * @param date - The given date
- * @param options - The options
- *
- * @returns The day of year
- *
- * @example
- * // Which day of the year is 2 July 2014?
- * const result = getDayOfYear(new Date(2014, 6, 2))
- * //=> 183
- */
-function getDayOfYear(date, options) {
- const _date = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_2__.toDate)(date, options?.in);
- const diff = (0,_differenceInCalendarDays_js__WEBPACK_IMPORTED_MODULE_0__.differenceInCalendarDays)(_date, (0,_startOfYear_js__WEBPACK_IMPORTED_MODULE_1__.startOfYear)(_date));
- const dayOfYear = diff + 1;
- return dayOfYear;
-}
-
-// Fallback for modularized imports:
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getDayOfYear);
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/getISOWeek.js":
-/*!*******************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/getISOWeek.js ***!
- \*******************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
-/* harmony export */ getISOWeek: () => (/* binding */ getISOWeek)
-/* harmony export */ });
-/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constants.js");
-/* harmony import */ var _startOfISOWeek_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./startOfISOWeek.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfISOWeek.js");
-/* harmony import */ var _startOfISOWeekYear_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./startOfISOWeekYear.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfISOWeekYear.js");
-/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
-
-
-
-
-
-/**
- * The {@link getISOWeek} function options.
- */
-
-/**
- * @name getISOWeek
- * @category ISO Week Helpers
- * @summary Get the ISO week of the given date.
- *
- * @description
- * Get the ISO week of the given date.
- *
- * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
- *
- * @param date - The given date
- * @param options - The options
- *
- * @returns The ISO week
- *
- * @example
- * // Which week of the ISO-week numbering year is 2 January 2005?
- * const result = getISOWeek(new Date(2005, 0, 2))
- * //=> 53
- */
-function getISOWeek(date, options) {
- const _date = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_3__.toDate)(date, options?.in);
- const diff = +(0,_startOfISOWeek_js__WEBPACK_IMPORTED_MODULE_1__.startOfISOWeek)(_date) - +(0,_startOfISOWeekYear_js__WEBPACK_IMPORTED_MODULE_2__.startOfISOWeekYear)(_date);
-
- // Round the number of weeks to the nearest integer because the number of
- // milliseconds in a week is not constant (e.g. it's different in the week of
- // the daylight saving time clock shift).
- return Math.round(diff / _constants_js__WEBPACK_IMPORTED_MODULE_0__.millisecondsInWeek) + 1;
-}
-
-// Fallback for modularized imports:
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getISOWeek);
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/getISOWeekYear.js":
-/*!***********************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/getISOWeekYear.js ***!
- \***********************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
-/* harmony export */ getISOWeekYear: () => (/* binding */ getISOWeekYear)
-/* harmony export */ });
-/* harmony import */ var _constructFrom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constructFrom.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constructFrom.js");
-/* harmony import */ var _startOfISOWeek_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./startOfISOWeek.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfISOWeek.js");
-/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
-
-
-
-
-/**
- * The {@link getISOWeekYear} function options.
- */
-
-/**
- * @name getISOWeekYear
- * @category ISO Week-Numbering Year Helpers
- * @summary Get the ISO week-numbering year of the given date.
- *
- * @description
- * Get the ISO week-numbering year of the given date,
- * which always starts 3 days before the year's first Thursday.
- *
- * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
- *
- * @param date - The given date
- *
- * @returns The ISO week-numbering year
- *
- * @example
- * // Which ISO-week numbering year is 2 January 2005?
- * const result = getISOWeekYear(new Date(2005, 0, 2))
- * //=> 2004
- */
-function getISOWeekYear(date, options) {
- const _date = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_2__.toDate)(date, options?.in);
- const year = _date.getFullYear();
-
- const fourthOfJanuaryOfNextYear = (0,_constructFrom_js__WEBPACK_IMPORTED_MODULE_0__.constructFrom)(_date, 0);
- fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
- fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
- const startOfNextYear = (0,_startOfISOWeek_js__WEBPACK_IMPORTED_MODULE_1__.startOfISOWeek)(fourthOfJanuaryOfNextYear);
-
- const fourthOfJanuaryOfThisYear = (0,_constructFrom_js__WEBPACK_IMPORTED_MODULE_0__.constructFrom)(_date, 0);
- fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
- fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
- const startOfThisYear = (0,_startOfISOWeek_js__WEBPACK_IMPORTED_MODULE_1__.startOfISOWeek)(fourthOfJanuaryOfThisYear);
-
- if (_date.getTime() >= startOfNextYear.getTime()) {
- return year + 1;
- } else if (_date.getTime() >= startOfThisYear.getTime()) {
- return year;
- } else {
- return year - 1;
- }
-}
-
-// Fallback for modularized imports:
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getISOWeekYear);
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/getWeek.js":
-/*!****************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/getWeek.js ***!
- \****************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
-/* harmony export */ getWeek: () => (/* binding */ getWeek)
-/* harmony export */ });
-/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constants.js");
-/* harmony import */ var _startOfWeek_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./startOfWeek.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfWeek.js");
-/* harmony import */ var _startOfWeekYear_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./startOfWeekYear.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfWeekYear.js");
-/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
-
-
-
-
-
-/**
- * The {@link getWeek} function options.
- */
-
-/**
- * @name getWeek
- * @category Week Helpers
- * @summary Get the local week index of the given date.
- *
- * @description
- * Get the local week index of the given date.
- * The exact calculation depends on the values of
- * `options.weekStartsOn` (which is the index of the first day of the week)
- * and `options.firstWeekContainsDate` (which is the day of January, which is always in
- * the first week of the week-numbering year)
- *
- * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
- *
- * @param date - The given date
- * @param options - An object with options
- *
- * @returns The week
- *
- * @example
- * // Which week of the local week numbering year is 2 January 2005 with default options?
- * const result = getWeek(new Date(2005, 0, 2))
- * //=> 2
- *
- * @example
- * // Which week of the local week numbering year is 2 January 2005,
- * // if Monday is the first day of the week,
- * // and the first week of the year always contains 4 January?
- * const result = getWeek(new Date(2005, 0, 2), {
- * weekStartsOn: 1,
- * firstWeekContainsDate: 4
- * })
- * //=> 53
- */
-function getWeek(date, options) {
- const _date = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_3__.toDate)(date, options?.in);
- const diff = +(0,_startOfWeek_js__WEBPACK_IMPORTED_MODULE_1__.startOfWeek)(_date, options) - +(0,_startOfWeekYear_js__WEBPACK_IMPORTED_MODULE_2__.startOfWeekYear)(_date, options);
-
- // Round the number of weeks to the nearest integer because the number of
- // milliseconds in a week is not constant (e.g. it's different in the week of
- // the daylight saving time clock shift).
- return Math.round(diff / _constants_js__WEBPACK_IMPORTED_MODULE_0__.millisecondsInWeek) + 1;
-}
-
-// Fallback for modularized imports:
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getWeek);
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/getWeekYear.js":
-/*!********************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/getWeekYear.js ***!
- \********************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
-/* harmony export */ getWeekYear: () => (/* binding */ getWeekYear)
-/* harmony export */ });
-/* harmony import */ var _lib_defaultOptions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_lib/defaultOptions.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/defaultOptions.js");
-/* harmony import */ var _constructFrom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constructFrom.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constructFrom.js");
-/* harmony import */ var _startOfWeek_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./startOfWeek.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfWeek.js");
-/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
-
-
-
-
-
-/**
- * The {@link getWeekYear} function options.
- */
-
-/**
- * @name getWeekYear
- * @category Week-Numbering Year Helpers
- * @summary Get the local week-numbering year of the given date.
- *
- * @description
- * Get the local week-numbering year of the given date.
- * The exact calculation depends on the values of
- * `options.weekStartsOn` (which is the index of the first day of the week)
- * and `options.firstWeekContainsDate` (which is the day of January, which is always in
- * the first week of the week-numbering year)
- *
- * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
- *
- * @param date - The given date
- * @param options - An object with options.
- *
- * @returns The local week-numbering year
- *
- * @example
- * // Which week numbering year is 26 December 2004 with the default settings?
- * const result = getWeekYear(new Date(2004, 11, 26))
- * //=> 2005
- *
- * @example
- * // Which week numbering year is 26 December 2004 if week starts on Saturday?
- * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })
- * //=> 2004
- *
- * @example
- * // Which week numbering year is 26 December 2004 if the first week contains 4 January?
- * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })
- * //=> 2004
- */
-function getWeekYear(date, options) {
- const _date = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_3__.toDate)(date, options?.in);
- const year = _date.getFullYear();
-
- const defaultOptions = (0,_lib_defaultOptions_js__WEBPACK_IMPORTED_MODULE_0__.getDefaultOptions)();
- const firstWeekContainsDate =
- options?.firstWeekContainsDate ??
- options?.locale?.options?.firstWeekContainsDate ??
- defaultOptions.firstWeekContainsDate ??
- defaultOptions.locale?.options?.firstWeekContainsDate ??
- 1;
-
- const firstWeekOfNextYear = (0,_constructFrom_js__WEBPACK_IMPORTED_MODULE_1__.constructFrom)(options?.in || date, 0);
- firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
- firstWeekOfNextYear.setHours(0, 0, 0, 0);
- const startOfNextYear = (0,_startOfWeek_js__WEBPACK_IMPORTED_MODULE_2__.startOfWeek)(firstWeekOfNextYear, options);
-
- const firstWeekOfThisYear = (0,_constructFrom_js__WEBPACK_IMPORTED_MODULE_1__.constructFrom)(options?.in || date, 0);
- firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
- firstWeekOfThisYear.setHours(0, 0, 0, 0);
- const startOfThisYear = (0,_startOfWeek_js__WEBPACK_IMPORTED_MODULE_2__.startOfWeek)(firstWeekOfThisYear, options);
-
- if (+_date >= +startOfNextYear) {
- return year + 1;
- } else if (+_date >= +startOfThisYear) {
- return year;
- } else {
- return year - 1;
- }
-}
-
-// Fallback for modularized imports:
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getWeekYear);
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/isDate.js":
-/*!***************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/isDate.js ***!
- \***************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
-/* harmony export */ isDate: () => (/* binding */ isDate)
-/* harmony export */ });
-/**
- * @name isDate
- * @category Common Helpers
- * @summary Is the given value a date?
- *
- * @description
- * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
- *
- * @param value - The value to check
- *
- * @returns True if the given value is a date
- *
- * @example
- * // For a valid date:
- * const result = isDate(new Date())
- * //=> true
- *
- * @example
- * // For an invalid date:
- * const result = isDate(new Date(NaN))
- * //=> true
- *
- * @example
- * // For some value:
- * const result = isDate('2014-02-31')
- * //=> false
- *
- * @example
- * // For an object:
- * const result = isDate({})
- * //=> false
- */
-function isDate(value) {
- return (
- value instanceof Date ||
- (typeof value === "object" &&
- Object.prototype.toString.call(value) === "[object Date]")
- );
-}
-
-// Fallback for modularized imports:
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isDate);
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/isValid.js":
-/*!****************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/isValid.js ***!
- \****************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
-/* harmony export */ isValid: () => (/* binding */ isValid)
-/* harmony export */ });
-/* harmony import */ var _isDate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/isDate.js");
-/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
-
-
-
-/**
- * @name isValid
- * @category Common Helpers
- * @summary Is the given date valid?
- *
- * @description
- * Returns false if argument is Invalid Date and true otherwise.
- * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)
- * Invalid Date is a Date, whose time value is NaN.
- *
- * Time value of Date: http://es5.github.io/#x15.9.1.1
- *
- * @param date - The date to check
- *
- * @returns The date is valid
- *
- * @example
- * // For the valid date:
- * const result = isValid(new Date(2014, 1, 31))
- * //=> true
- *
- * @example
- * // For the value, convertible into a date:
- * const result = isValid(1393804800000)
- * //=> true
- *
- * @example
- * // For the invalid date:
- * const result = isValid(new Date(''))
- * //=> false
- */
-function isValid(date) {
- return !((!(0,_isDate_js__WEBPACK_IMPORTED_MODULE_0__.isDate)(date) && typeof date !== "number") || isNaN(+(0,_toDate_js__WEBPACK_IMPORTED_MODULE_1__.toDate)(date)));
-}
-
-// Fallback for modularized imports:
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isValid);
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildFormatLongFn.js":
-/*!**************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildFormatLongFn.js ***!
- \**************************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ buildFormatLongFn: () => (/* binding */ buildFormatLongFn)
-/* harmony export */ });
-function buildFormatLongFn(args) {
- return (options = {}) => {
- // TODO: Remove String()
- const width = options.width ? String(options.width) : args.defaultWidth;
- const format = args.formats[width] || args.formats[args.defaultWidth];
- return format;
- };
-}
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildLocalizeFn.js":
-/*!************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildLocalizeFn.js ***!
- \************************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ buildLocalizeFn: () => (/* binding */ buildLocalizeFn)
-/* harmony export */ });
-/**
- * The localize function argument callback which allows to convert raw value to
- * the actual type.
- *
- * @param value - The value to convert
- *
- * @returns The converted value
- */
-
-/**
- * The map of localized values for each width.
- */
-
-/**
- * The index type of the locale unit value. It types conversion of units of
- * values that don't start at 0 (i.e. quarters).
- */
-
-/**
- * Converts the unit value to the tuple of values.
- */
-
-/**
- * The tuple of localized era values. The first element represents BC,
- * the second element represents AD.
- */
-
-/**
- * The tuple of localized quarter values. The first element represents Q1.
- */
-
-/**
- * The tuple of localized day values. The first element represents Sunday.
- */
-
-/**
- * The tuple of localized month values. The first element represents January.
- */
-
-function buildLocalizeFn(args) {
- return (value, options) => {
- const context = options?.context ? String(options.context) : "standalone";
-
- let valuesArray;
- if (context === "formatting" && args.formattingValues) {
- const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
- const width = options?.width ? String(options.width) : defaultWidth;
-
- valuesArray =
- args.formattingValues[width] || args.formattingValues[defaultWidth];
- } else {
- const defaultWidth = args.defaultWidth;
- const width = options?.width ? String(options.width) : args.defaultWidth;
-
- valuesArray = args.values[width] || args.values[defaultWidth];
- }
- const index = args.argumentCallback ? args.argumentCallback(value) : value;
-
- // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
- return valuesArray[index];
- };
-}
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildMatchFn.js":
-/*!*********************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildMatchFn.js ***!
- \*********************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ buildMatchFn: () => (/* binding */ buildMatchFn)
-/* harmony export */ });
-function buildMatchFn(args) {
- return (string, options = {}) => {
- const width = options.width;
-
- const matchPattern =
- (width && args.matchPatterns[width]) ||
- args.matchPatterns[args.defaultMatchWidth];
- const matchResult = string.match(matchPattern);
-
- if (!matchResult) {
- return null;
- }
- const matchedString = matchResult[0];
-
- const parsePatterns =
- (width && args.parsePatterns[width]) ||
- args.parsePatterns[args.defaultParseWidth];
-
- const key = Array.isArray(parsePatterns)
- ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))
- : // [TODO] -- I challenge you to fix the type
- findKey(parsePatterns, (pattern) => pattern.test(matchedString));
-
- let value;
-
- value = args.valueCallback ? args.valueCallback(key) : key;
- value = options.valueCallback
- ? // [TODO] -- I challenge you to fix the type
- options.valueCallback(value)
- : value;
-
- const rest = string.slice(matchedString.length);
-
- return { value, rest };
- };
-}
-
-function findKey(object, predicate) {
- for (const key in object) {
- if (
- Object.prototype.hasOwnProperty.call(object, key) &&
- predicate(object[key])
- ) {
- return key;
- }
- }
- return undefined;
-}
-
-function findIndex(array, predicate) {
- for (let key = 0; key < array.length; key++) {
- if (predicate(array[key])) {
- return key;
- }
- }
- return undefined;
-}
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js":
-/*!****************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js ***!
- \****************************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ buildMatchPatternFn: () => (/* binding */ buildMatchPatternFn)
-/* harmony export */ });
-function buildMatchPatternFn(args) {
- return (string, options = {}) => {
- const matchResult = string.match(args.matchPattern);
- if (!matchResult) return null;
- const matchedString = matchResult[0];
-
- const parseResult = string.match(args.parsePattern);
- if (!parseResult) return null;
- let value = args.valueCallback
- ? args.valueCallback(parseResult[0])
- : parseResult[0];
-
- // [TODO] I challenge you to fix the type
- value = options.valueCallback ? options.valueCallback(value) : value;
-
- const rest = string.slice(matchedString.length);
-
- return { value, rest };
- };
-}
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US.js":
-/*!*********************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US.js ***!
- \*********************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
-/* harmony export */ enUS: () => (/* binding */ enUS)
-/* harmony export */ });
-/* harmony import */ var _en_US_lib_formatDistance_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./en-US/_lib/formatDistance.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/formatDistance.js");
-/* harmony import */ var _en_US_lib_formatLong_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./en-US/_lib/formatLong.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/formatLong.js");
-/* harmony import */ var _en_US_lib_formatRelative_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./en-US/_lib/formatRelative.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/formatRelative.js");
-/* harmony import */ var _en_US_lib_localize_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./en-US/_lib/localize.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/localize.js");
-/* harmony import */ var _en_US_lib_match_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./en-US/_lib/match.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/match.js");
-
-
-
-
-
-
-/**
- * @category Locales
- * @summary English locale (United States).
- * @language English
- * @iso-639-2 eng
- * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
- * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
- */
-const enUS = {
- code: "en-US",
- formatDistance: _en_US_lib_formatDistance_js__WEBPACK_IMPORTED_MODULE_0__.formatDistance,
- formatLong: _en_US_lib_formatLong_js__WEBPACK_IMPORTED_MODULE_1__.formatLong,
- formatRelative: _en_US_lib_formatRelative_js__WEBPACK_IMPORTED_MODULE_2__.formatRelative,
- localize: _en_US_lib_localize_js__WEBPACK_IMPORTED_MODULE_3__.localize,
- match: _en_US_lib_match_js__WEBPACK_IMPORTED_MODULE_4__.match,
- options: {
- weekStartsOn: 0 /* Sunday */,
- firstWeekContainsDate: 1,
- },
-};
-
-// Fallback for modularized imports:
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (enUS);
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/formatDistance.js":
-/*!*****************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/formatDistance.js ***!
- \*****************************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ formatDistance: () => (/* binding */ formatDistance)
-/* harmony export */ });
-const formatDistanceLocale = {
- lessThanXSeconds: {
- one: "less than a second",
- other: "less than {{count}} seconds",
- },
-
- xSeconds: {
- one: "1 second",
- other: "{{count}} seconds",
- },
-
- halfAMinute: "half a minute",
-
- lessThanXMinutes: {
- one: "less than a minute",
- other: "less than {{count}} minutes",
- },
-
- xMinutes: {
- one: "1 minute",
- other: "{{count}} minutes",
- },
-
- aboutXHours: {
- one: "about 1 hour",
- other: "about {{count}} hours",
- },
-
- xHours: {
- one: "1 hour",
- other: "{{count}} hours",
- },
-
- xDays: {
- one: "1 day",
- other: "{{count}} days",
- },
-
- aboutXWeeks: {
- one: "about 1 week",
- other: "about {{count}} weeks",
- },
-
- xWeeks: {
- one: "1 week",
- other: "{{count}} weeks",
- },
-
- aboutXMonths: {
- one: "about 1 month",
- other: "about {{count}} months",
- },
-
- xMonths: {
- one: "1 month",
- other: "{{count}} months",
- },
-
- aboutXYears: {
- one: "about 1 year",
- other: "about {{count}} years",
- },
-
- xYears: {
- one: "1 year",
- other: "{{count}} years",
- },
-
- overXYears: {
- one: "over 1 year",
- other: "over {{count}} years",
- },
-
- almostXYears: {
- one: "almost 1 year",
- other: "almost {{count}} years",
- },
-};
-
-const formatDistance = (token, count, options) => {
- let result;
-
- const tokenValue = formatDistanceLocale[token];
- if (typeof tokenValue === "string") {
- result = tokenValue;
- } else if (count === 1) {
- result = tokenValue.one;
- } else {
- result = tokenValue.other.replace("{{count}}", count.toString());
- }
-
- if (options?.addSuffix) {
- if (options.comparison && options.comparison > 0) {
- return "in " + result;
- } else {
- return result + " ago";
- }
- }
-
- return result;
-};
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/formatLong.js":
-/*!*************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/formatLong.js ***!
- \*************************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ formatLong: () => (/* binding */ formatLong)
-/* harmony export */ });
-/* harmony import */ var _lib_buildFormatLongFn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_lib/buildFormatLongFn.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildFormatLongFn.js");
-
-
-const dateFormats = {
- full: "EEEE, MMMM do, y",
- long: "MMMM do, y",
- medium: "MMM d, y",
- short: "MM/dd/yyyy",
-};
-
-const timeFormats = {
- full: "h:mm:ss a zzzz",
- long: "h:mm:ss a z",
- medium: "h:mm:ss a",
- short: "h:mm a",
-};
-
-const dateTimeFormats = {
- full: "{{date}} 'at' {{time}}",
- long: "{{date}} 'at' {{time}}",
- medium: "{{date}}, {{time}}",
- short: "{{date}}, {{time}}",
-};
-
-const formatLong = {
- date: (0,_lib_buildFormatLongFn_js__WEBPACK_IMPORTED_MODULE_0__.buildFormatLongFn)({
- formats: dateFormats,
- defaultWidth: "full",
- }),
-
- time: (0,_lib_buildFormatLongFn_js__WEBPACK_IMPORTED_MODULE_0__.buildFormatLongFn)({
- formats: timeFormats,
- defaultWidth: "full",
- }),
-
- dateTime: (0,_lib_buildFormatLongFn_js__WEBPACK_IMPORTED_MODULE_0__.buildFormatLongFn)({
- formats: dateTimeFormats,
- defaultWidth: "full",
- }),
-};
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/formatRelative.js":
-/*!*****************************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/formatRelative.js ***!
- \*****************************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ formatRelative: () => (/* binding */ formatRelative)
-/* harmony export */ });
-const formatRelativeLocale = {
- lastWeek: "'last' eeee 'at' p",
- yesterday: "'yesterday at' p",
- today: "'today at' p",
- tomorrow: "'tomorrow at' p",
- nextWeek: "eeee 'at' p",
- other: "P",
-};
-
-const formatRelative = (token, _date, _baseDate, _options) =>
- formatRelativeLocale[token];
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/localize.js":
-/*!***********************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/localize.js ***!
- \***********************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ localize: () => (/* binding */ localize)
-/* harmony export */ });
-/* harmony import */ var _lib_buildLocalizeFn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_lib/buildLocalizeFn.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildLocalizeFn.js");
-
-
-const eraValues = {
- narrow: ["B", "A"],
- abbreviated: ["BC", "AD"],
- wide: ["Before Christ", "Anno Domini"],
-};
-
-const quarterValues = {
- narrow: ["1", "2", "3", "4"],
- abbreviated: ["Q1", "Q2", "Q3", "Q4"],
- wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"],
-};
-
-// Note: in English, the names of days of the week and months are capitalized.
-// If you are making a new locale based on this one, check if the same is true for the language you're working on.
-// Generally, formatted dates should look like they are in the middle of a sentence,
-// e.g. in Spanish language the weekdays and months should be in the lowercase.
-const monthValues = {
- narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
- abbreviated: [
- "Jan",
- "Feb",
- "Mar",
- "Apr",
- "May",
- "Jun",
- "Jul",
- "Aug",
- "Sep",
- "Oct",
- "Nov",
- "Dec",
- ],
-
- wide: [
- "January",
- "February",
- "March",
- "April",
- "May",
- "June",
- "July",
- "August",
- "September",
- "October",
- "November",
- "December",
- ],
-};
-
-const dayValues = {
- narrow: ["S", "M", "T", "W", "T", "F", "S"],
- short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
- abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
- wide: [
- "Sunday",
- "Monday",
- "Tuesday",
- "Wednesday",
- "Thursday",
- "Friday",
- "Saturday",
- ],
-};
-
-const dayPeriodValues = {
- narrow: {
- am: "a",
- pm: "p",
- midnight: "mi",
- noon: "n",
- morning: "morning",
- afternoon: "afternoon",
- evening: "evening",
- night: "night",
- },
- abbreviated: {
- am: "AM",
- pm: "PM",
- midnight: "midnight",
- noon: "noon",
- morning: "morning",
- afternoon: "afternoon",
- evening: "evening",
- night: "night",
- },
- wide: {
- am: "a.m.",
- pm: "p.m.",
- midnight: "midnight",
- noon: "noon",
- morning: "morning",
- afternoon: "afternoon",
- evening: "evening",
- night: "night",
- },
-};
-
-const formattingDayPeriodValues = {
- narrow: {
- am: "a",
- pm: "p",
- midnight: "mi",
- noon: "n",
- morning: "in the morning",
- afternoon: "in the afternoon",
- evening: "in the evening",
- night: "at night",
- },
- abbreviated: {
- am: "AM",
- pm: "PM",
- midnight: "midnight",
- noon: "noon",
- morning: "in the morning",
- afternoon: "in the afternoon",
- evening: "in the evening",
- night: "at night",
- },
- wide: {
- am: "a.m.",
- pm: "p.m.",
- midnight: "midnight",
- noon: "noon",
- morning: "in the morning",
- afternoon: "in the afternoon",
- evening: "in the evening",
- night: "at night",
- },
-};
-
-const ordinalNumber = (dirtyNumber, _options) => {
- const number = Number(dirtyNumber);
-
- // If ordinal numbers depend on context, for example,
- // if they are different for different grammatical genders,
- // use `options.unit`.
- //
- // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
- // 'day', 'hour', 'minute', 'second'.
-
- const rem100 = number % 100;
- if (rem100 > 20 || rem100 < 10) {
- switch (rem100 % 10) {
- case 1:
- return number + "st";
- case 2:
- return number + "nd";
- case 3:
- return number + "rd";
- }
- }
- return number + "th";
-};
-
-const localize = {
- ordinalNumber,
-
- era: (0,_lib_buildLocalizeFn_js__WEBPACK_IMPORTED_MODULE_0__.buildLocalizeFn)({
- values: eraValues,
- defaultWidth: "wide",
- }),
-
- quarter: (0,_lib_buildLocalizeFn_js__WEBPACK_IMPORTED_MODULE_0__.buildLocalizeFn)({
- values: quarterValues,
- defaultWidth: "wide",
- argumentCallback: (quarter) => quarter - 1,
- }),
-
- month: (0,_lib_buildLocalizeFn_js__WEBPACK_IMPORTED_MODULE_0__.buildLocalizeFn)({
- values: monthValues,
- defaultWidth: "wide",
- }),
-
- day: (0,_lib_buildLocalizeFn_js__WEBPACK_IMPORTED_MODULE_0__.buildLocalizeFn)({
- values: dayValues,
- defaultWidth: "wide",
- }),
-
- dayPeriod: (0,_lib_buildLocalizeFn_js__WEBPACK_IMPORTED_MODULE_0__.buildLocalizeFn)({
- values: dayPeriodValues,
- defaultWidth: "wide",
- formattingValues: formattingDayPeriodValues,
- defaultFormattingWidth: "wide",
- }),
-};
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/match.js":
-/*!********************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/en-US/_lib/match.js ***!
- \********************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ match: () => (/* binding */ match)
-/* harmony export */ });
-/* harmony import */ var _lib_buildMatchFn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_lib/buildMatchFn.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildMatchFn.js");
-/* harmony import */ var _lib_buildMatchPatternFn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../_lib/buildMatchPatternFn.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js");
-
-
-
-const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
-const parseOrdinalNumberPattern = /\d+/i;
-
-const matchEraPatterns = {
- narrow: /^(b|a)/i,
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
- wide: /^(before christ|before common era|anno domini|common era)/i,
-};
-const parseEraPatterns = {
- any: [/^b/i, /^(a|c)/i],
-};
-
-const matchQuarterPatterns = {
- narrow: /^[1234]/i,
- abbreviated: /^q[1234]/i,
- wide: /^[1234](th|st|nd|rd)? quarter/i,
-};
-const parseQuarterPatterns = {
- any: [/1/i, /2/i, /3/i, /4/i],
-};
-
-const matchMonthPatterns = {
- narrow: /^[jfmasond]/i,
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,
-};
-const parseMonthPatterns = {
- narrow: [
- /^j/i,
- /^f/i,
- /^m/i,
- /^a/i,
- /^m/i,
- /^j/i,
- /^j/i,
- /^a/i,
- /^s/i,
- /^o/i,
- /^n/i,
- /^d/i,
- ],
-
- any: [
- /^ja/i,
- /^f/i,
- /^mar/i,
- /^ap/i,
- /^may/i,
- /^jun/i,
- /^jul/i,
- /^au/i,
- /^s/i,
- /^o/i,
- /^n/i,
- /^d/i,
- ],
-};
-
-const matchDayPatterns = {
- narrow: /^[smtwf]/i,
- short: /^(su|mo|tu|we|th|fr|sa)/i,
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,
-};
-const parseDayPatterns = {
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],
-};
-
-const matchDayPeriodPatterns = {
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,
-};
-const parseDayPeriodPatterns = {
- any: {
- am: /^a/i,
- pm: /^p/i,
- midnight: /^mi/i,
- noon: /^no/i,
- morning: /morning/i,
- afternoon: /afternoon/i,
- evening: /evening/i,
- night: /night/i,
- },
-};
-
-const match = {
- ordinalNumber: (0,_lib_buildMatchPatternFn_js__WEBPACK_IMPORTED_MODULE_1__.buildMatchPatternFn)({
- matchPattern: matchOrdinalNumberPattern,
- parsePattern: parseOrdinalNumberPattern,
- valueCallback: (value) => parseInt(value, 10),
- }),
-
- era: (0,_lib_buildMatchFn_js__WEBPACK_IMPORTED_MODULE_0__.buildMatchFn)({
- matchPatterns: matchEraPatterns,
- defaultMatchWidth: "wide",
- parsePatterns: parseEraPatterns,
- defaultParseWidth: "any",
- }),
-
- quarter: (0,_lib_buildMatchFn_js__WEBPACK_IMPORTED_MODULE_0__.buildMatchFn)({
- matchPatterns: matchQuarterPatterns,
- defaultMatchWidth: "wide",
- parsePatterns: parseQuarterPatterns,
- defaultParseWidth: "any",
- valueCallback: (index) => index + 1,
- }),
-
- month: (0,_lib_buildMatchFn_js__WEBPACK_IMPORTED_MODULE_0__.buildMatchFn)({
- matchPatterns: matchMonthPatterns,
- defaultMatchWidth: "wide",
- parsePatterns: parseMonthPatterns,
- defaultParseWidth: "any",
- }),
-
- day: (0,_lib_buildMatchFn_js__WEBPACK_IMPORTED_MODULE_0__.buildMatchFn)({
- matchPatterns: matchDayPatterns,
- defaultMatchWidth: "wide",
- parsePatterns: parseDayPatterns,
- defaultParseWidth: "any",
- }),
-
- dayPeriod: (0,_lib_buildMatchFn_js__WEBPACK_IMPORTED_MODULE_0__.buildMatchFn)({
- matchPatterns: matchDayPeriodPatterns,
- defaultMatchWidth: "any",
- parsePatterns: parseDayPeriodPatterns,
- defaultParseWidth: "any",
- }),
-};
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfDay.js":
-/*!*******************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfDay.js ***!
- \*******************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
-/* harmony export */ startOfDay: () => (/* binding */ startOfDay)
-/* harmony export */ });
-/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
-
-
-/**
- * The {@link startOfDay} function options.
- */
-
-/**
- * @name startOfDay
- * @category Day Helpers
- * @summary Return the start of a day for the given date.
- *
- * @description
- * Return the start of a day for the given date.
- * The result will be in the local timezone.
- *
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
- *
- * @param date - The original date
- * @param options - The options
- *
- * @returns The start of a day
- *
- * @example
- * // The start of a day for 2 September 2014 11:55:00:
- * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
- * //=> Tue Sep 02 2014 00:00:00
- */
-function startOfDay(date, options) {
- const _date = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_0__.toDate)(date, options?.in);
- _date.setHours(0, 0, 0, 0);
- return _date;
-}
-
-// Fallback for modularized imports:
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (startOfDay);
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfISOWeek.js":
-/*!***********************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfISOWeek.js ***!
- \***********************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
-/* harmony export */ startOfISOWeek: () => (/* binding */ startOfISOWeek)
-/* harmony export */ });
-/* harmony import */ var _startOfWeek_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./startOfWeek.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfWeek.js");
-
-
-/**
- * The {@link startOfISOWeek} function options.
- */
-
-/**
- * @name startOfISOWeek
- * @category ISO Week Helpers
- * @summary Return the start of an ISO week for the given date.
- *
- * @description
- * Return the start of an ISO week for the given date.
- * The result will be in the local timezone.
- *
- * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
- *
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
- *
- * @param date - The original date
- * @param options - An object with options
- *
- * @returns The start of an ISO week
- *
- * @example
- * // The start of an ISO week for 2 September 2014 11:55:00:
- * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
- * //=> Mon Sep 01 2014 00:00:00
- */
-function startOfISOWeek(date, options) {
- return (0,_startOfWeek_js__WEBPACK_IMPORTED_MODULE_0__.startOfWeek)(date, { ...options, weekStartsOn: 1 });
-}
-
-// Fallback for modularized imports:
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (startOfISOWeek);
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfISOWeekYear.js":
-/*!***************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfISOWeekYear.js ***!
- \***************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
-/* harmony export */ startOfISOWeekYear: () => (/* binding */ startOfISOWeekYear)
-/* harmony export */ });
-/* harmony import */ var _constructFrom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constructFrom.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constructFrom.js");
-/* harmony import */ var _getISOWeekYear_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getISOWeekYear.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/getISOWeekYear.js");
-/* harmony import */ var _startOfISOWeek_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./startOfISOWeek.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfISOWeek.js");
-
-
-
-
-/**
- * The {@link startOfISOWeekYear} function options.
- */
-
-/**
- * @name startOfISOWeekYear
- * @category ISO Week-Numbering Year Helpers
- * @summary Return the start of an ISO week-numbering year for the given date.
- *
- * @description
- * Return the start of an ISO week-numbering year,
- * which always starts 3 days before the year's first Thursday.
- * The result will be in the local timezone.
- *
- * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
- *
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
- *
- * @param date - The original date
- * @param options - An object with options
- *
- * @returns The start of an ISO week-numbering year
- *
- * @example
- * // The start of an ISO week-numbering year for 2 July 2005:
- * const result = startOfISOWeekYear(new Date(2005, 6, 2))
- * //=> Mon Jan 03 2005 00:00:00
- */
-function startOfISOWeekYear(date, options) {
- const year = (0,_getISOWeekYear_js__WEBPACK_IMPORTED_MODULE_1__.getISOWeekYear)(date, options);
- const fourthOfJanuary = (0,_constructFrom_js__WEBPACK_IMPORTED_MODULE_0__.constructFrom)(options?.in || date, 0);
- fourthOfJanuary.setFullYear(year, 0, 4);
- fourthOfJanuary.setHours(0, 0, 0, 0);
- return (0,_startOfISOWeek_js__WEBPACK_IMPORTED_MODULE_2__.startOfISOWeek)(fourthOfJanuary);
-}
-
-// Fallback for modularized imports:
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (startOfISOWeekYear);
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfMonth.js":
-/*!*********************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfMonth.js ***!
- \*********************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
-/* harmony export */ startOfMonth: () => (/* binding */ startOfMonth)
-/* harmony export */ });
-/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
-
-
-/**
- * The {@link startOfMonth} function options.
- */
-
-/**
- * @name startOfMonth
- * @category Month Helpers
- * @summary Return the start of a month for the given date.
- *
- * @description
- * Return the start of a month for the given date. The result will be in the local timezone.
- *
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments.
- * Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed,
- * or inferred from the arguments.
- *
- * @param date - The original date
- * @param options - An object with options
- *
- * @returns The start of a month
- *
- * @example
- * // The start of a month for 2 September 2014 11:55:00:
- * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
- * //=> Mon Sep 01 2014 00:00:00
- */
-function startOfMonth(date, options) {
- const _date = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_0__.toDate)(date, options?.in);
- _date.setDate(1);
- _date.setHours(0, 0, 0, 0);
- return _date;
-}
-
-// Fallback for modularized imports:
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (startOfMonth);
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfWeek.js":
-/*!********************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfWeek.js ***!
- \********************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
-/* harmony export */ startOfWeek: () => (/* binding */ startOfWeek)
-/* harmony export */ });
-/* harmony import */ var _lib_defaultOptions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_lib/defaultOptions.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/defaultOptions.js");
-/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
-
-
-
-/**
- * The {@link startOfWeek} function options.
- */
-
-/**
- * @name startOfWeek
- * @category Week Helpers
- * @summary Return the start of a week for the given date.
- *
- * @description
- * Return the start of a week for the given date.
- * The result will be in the local timezone.
- *
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
- *
- * @param date - The original date
- * @param options - An object with options
- *
- * @returns The start of a week
- *
- * @example
- * // The start of a week for 2 September 2014 11:55:00:
- * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
- * //=> Sun Aug 31 2014 00:00:00
- *
- * @example
- * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
- * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
- * //=> Mon Sep 01 2014 00:00:00
- */
-function startOfWeek(date, options) {
- const defaultOptions = (0,_lib_defaultOptions_js__WEBPACK_IMPORTED_MODULE_0__.getDefaultOptions)();
- const weekStartsOn =
- options?.weekStartsOn ??
- options?.locale?.options?.weekStartsOn ??
- defaultOptions.weekStartsOn ??
- defaultOptions.locale?.options?.weekStartsOn ??
- 0;
-
- const _date = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_1__.toDate)(date, options?.in);
- const day = _date.getDay();
- const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
-
- _date.setDate(_date.getDate() - diff);
- _date.setHours(0, 0, 0, 0);
- return _date;
-}
-
-// Fallback for modularized imports:
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (startOfWeek);
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfWeekYear.js":
-/*!************************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfWeekYear.js ***!
- \************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
-/* harmony export */ startOfWeekYear: () => (/* binding */ startOfWeekYear)
-/* harmony export */ });
-/* harmony import */ var _lib_defaultOptions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_lib/defaultOptions.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/_lib/defaultOptions.js");
-/* harmony import */ var _constructFrom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constructFrom.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constructFrom.js");
-/* harmony import */ var _getWeekYear_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getWeekYear.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/getWeekYear.js");
-/* harmony import */ var _startOfWeek_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./startOfWeek.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfWeek.js");
-
-
-
-
-
-/**
- * The {@link startOfWeekYear} function options.
- */
-
-/**
- * @name startOfWeekYear
- * @category Week-Numbering Year Helpers
- * @summary Return the start of a local week-numbering year for the given date.
- *
- * @description
- * Return the start of a local week-numbering year.
- * The exact calculation depends on the values of
- * `options.weekStartsOn` (which is the index of the first day of the week)
- * and `options.firstWeekContainsDate` (which is the day of January, which is always in
- * the first week of the week-numbering year)
- *
- * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
- *
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
- * @typeParam ResultDate - The result `Date` type.
- *
- * @param date - The original date
- * @param options - An object with options
- *
- * @returns The start of a week-numbering year
- *
- * @example
- * // The start of an a week-numbering year for 2 July 2005 with default settings:
- * const result = startOfWeekYear(new Date(2005, 6, 2))
- * //=> Sun Dec 26 2004 00:00:00
- *
- * @example
- * // The start of a week-numbering year for 2 July 2005
- * // if Monday is the first day of week
- * // and 4 January is always in the first week of the year:
- * const result = startOfWeekYear(new Date(2005, 6, 2), {
- * weekStartsOn: 1,
- * firstWeekContainsDate: 4
- * })
- * //=> Mon Jan 03 2005 00:00:00
- */
-function startOfWeekYear(date, options) {
- const defaultOptions = (0,_lib_defaultOptions_js__WEBPACK_IMPORTED_MODULE_0__.getDefaultOptions)();
- const firstWeekContainsDate =
- options?.firstWeekContainsDate ??
- options?.locale?.options?.firstWeekContainsDate ??
- defaultOptions.firstWeekContainsDate ??
- defaultOptions.locale?.options?.firstWeekContainsDate ??
- 1;
-
- const year = (0,_getWeekYear_js__WEBPACK_IMPORTED_MODULE_2__.getWeekYear)(date, options);
- const firstWeek = (0,_constructFrom_js__WEBPACK_IMPORTED_MODULE_1__.constructFrom)(options?.in || date, 0);
- firstWeek.setFullYear(year, 0, firstWeekContainsDate);
- firstWeek.setHours(0, 0, 0, 0);
- const _date = (0,_startOfWeek_js__WEBPACK_IMPORTED_MODULE_3__.startOfWeek)(firstWeek, options);
- return _date;
-}
-
-// Fallback for modularized imports:
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (startOfWeekYear);
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfYear.js":
-/*!********************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/startOfYear.js ***!
- \********************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
-/* harmony export */ startOfYear: () => (/* binding */ startOfYear)
-/* harmony export */ });
-/* harmony import */ var _toDate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toDate.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js");
-
-
-/**
- * The {@link startOfYear} function options.
- */
-
-/**
- * @name startOfYear
- * @category Year Helpers
- * @summary Return the start of a year for the given date.
- *
- * @description
- * Return the start of a year for the given date.
- * The result will be in the local timezone.
- *
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
- *
- * @param date - The original date
- * @param options - The options
- *
- * @returns The start of a year
- *
- * @example
- * // The start of a year for 2 September 2014 11:55:00:
- * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
- * //=> Wed Jan 01 2014 00:00:00
- */
-function startOfYear(date, options) {
- const date_ = (0,_toDate_js__WEBPACK_IMPORTED_MODULE_0__.toDate)(date, options?.in);
- date_.setFullYear(date_.getFullYear(), 0, 1);
- date_.setHours(0, 0, 0, 0);
- return date_;
-}
-
-// Fallback for modularized imports:
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (startOfYear);
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/subDays.js":
-/*!****************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/subDays.js ***!
- \****************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
-/* harmony export */ subDays: () => (/* binding */ subDays)
-/* harmony export */ });
-/* harmony import */ var _addDays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./addDays.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/addDays.js");
-
-
-/**
- * The {@link subDays} function options.
- */
-
-/**
- * @name subDays
- * @category Day Helpers
- * @summary Subtract the specified number of days from the given date.
- *
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
- *
- * @param date - The date to be changed
- * @param amount - The amount of days to be subtracted.
- * @param options - An object with options
- *
- * @returns The new date with the days subtracted
- *
- * @example
- * // Subtract 10 days from 1 September 2014:
- * const result = subDays(new Date(2014, 8, 1), 10)
- * //=> Fri Aug 22 2014 00:00:00
- */
-function subDays(date, amount, options) {
- return (0,_addDays_js__WEBPACK_IMPORTED_MODULE_0__.addDays)(date, -amount, options);
-}
-
-// Fallback for modularized imports:
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (subDays);
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/subMonths.js":
-/*!******************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/subMonths.js ***!
- \******************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
-/* harmony export */ subMonths: () => (/* binding */ subMonths)
-/* harmony export */ });
-/* harmony import */ var _addMonths_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./addMonths.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/addMonths.js");
-
-
-/**
- * The subMonths function options.
- */
-
-/**
- * @name subMonths
- * @category Month Helpers
- * @summary Subtract the specified number of months from the given date.
- *
- * @description
- * Subtract the specified number of months from the given date.
- *
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
- *
- * @param date - The date to be changed
- * @param amount - The amount of months to be subtracted.
- * @param options - An object with options
- *
- * @returns The new date with the months subtracted
- *
- * @example
- * // Subtract 5 months from 1 February 2015:
- * const result = subMonths(new Date(2015, 1, 1), 5)
- * //=> Mon Sep 01 2014 00:00:00
- */
-function subMonths(date, amount, options) {
- return (0,_addMonths_js__WEBPACK_IMPORTED_MODULE_0__.addMonths)(date, -amount, options);
-}
-
-// Fallback for modularized imports:
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (subMonths);
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/subYears.js":
-/*!*****************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/subYears.js ***!
- \*****************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
-/* harmony export */ subYears: () => (/* binding */ subYears)
-/* harmony export */ });
-/* harmony import */ var _addYears_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./addYears.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/addYears.js");
-
-
-/**
- * The {@link subYears} function options.
- */
-
-/**
- * @name subYears
- * @category Year Helpers
- * @summary Subtract the specified number of years from the given date.
- *
- * @description
- * Subtract the specified number of years from the given date.
- *
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
- *
- * @param date - The date to be changed
- * @param amount - The amount of years to be subtracted.
- * @param options - An object with options
- *
- * @returns The new date with the years subtracted
- *
- * @example
- * // Subtract 5 years from 1 September 2014:
- * const result = subYears(new Date(2014, 8, 1), 5)
- * //=> Tue Sep 01 2009 00:00:00
- */
-function subYears(date, amount, options) {
- return (0,_addYears_js__WEBPACK_IMPORTED_MODULE_0__.addYears)(date, -amount, options);
-}
-
-// Fallback for modularized imports:
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (subYears);
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js":
-/*!***************************************************************************!*\
- !*** ./node_modules/@wordpress/dataviews/node_modules/date-fns/toDate.js ***!
- \***************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
-/* harmony export */ toDate: () => (/* binding */ toDate)
-/* harmony export */ });
-/* harmony import */ var _constructFrom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constructFrom.js */ "./node_modules/@wordpress/dataviews/node_modules/date-fns/constructFrom.js");
-
-
-/**
- * @name toDate
- * @category Common Helpers
- * @summary Convert the given argument to an instance of Date.
- *
- * @description
- * Convert the given argument to an instance of Date.
- *
- * If the argument is an instance of Date, the function returns its clone.
- *
- * If the argument is a number, it is treated as a timestamp.
- *
- * If the argument is none of the above, the function returns Invalid Date.
- *
- * Starting from v3.7.0, it clones a date using `[Symbol.for("constructDateFrom")]`
- * enabling to transfer extra properties from the reference date to the new date.
- * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
- * that accept a time zone as a constructor argument.
- *
- * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
- *
- * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
- * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
- *
- * @param argument - The value to convert
- *
- * @returns The parsed date in the local time zone
- *
- * @example
- * // Clone the date:
- * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
- * //=> Tue Feb 11 2014 11:30:30
- *
- * @example
- * // Convert the timestamp to date:
- * const result = toDate(1392098430000)
- * //=> Tue Feb 11 2014 11:30:30
- */
-function toDate(argument, context) {
- // [TODO] Get rid of `toDate` or `constructFrom`?
- return (0,_constructFrom_js__WEBPACK_IMPORTED_MODULE_0__.constructFrom)(context || argument, argument);
-}
-
-// Fallback for modularized imports:
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (toDate);
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/arrow-down.js":
-/*!**************************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/arrow-down.js ***!
- \**************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ arrow_down_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/arrow-down.tsx
-
-
-var arrow_down_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z" }) });
-
-//# sourceMappingURL=arrow-down.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/arrow-left.js":
-/*!**************************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/arrow-left.js ***!
- \**************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ arrow_left_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/arrow-left.tsx
-
-
-var arrow_left_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z" }) });
-
-//# sourceMappingURL=arrow-left.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/arrow-right.js":
-/*!***************************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/arrow-right.js ***!
- \***************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ arrow_right_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/arrow-right.tsx
-
-
-var arrow_right_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z" }) });
-
-//# sourceMappingURL=arrow-right.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/arrow-up.js":
-/*!************************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/arrow-up.js ***!
- \************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ arrow_up_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/arrow-up.tsx
-
-
-var arrow_up_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M12 3.9 6.5 9.5l1 1 3.8-3.7V20h1.5V6.8l3.7 3.7 1-1z" }) });
-
-//# sourceMappingURL=arrow-up.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/at-symbol.js":
-/*!*************************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/at-symbol.js ***!
- \*************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ at_symbol_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/at-symbol.tsx
-
-
-var at_symbol_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M12.5939 21C14.1472 21 16.1269 20.5701 17.0711 20.1975L16.6447 18.879C16.0964 19.051 14.3299 19.6242 12.6548 19.6242C7.4467 19.6242 4.67513 16.8726 4.67513 12C4.67513 7.21338 7.50762 4.34713 12.2893 4.34713C17.132 4.34713 19.4162 7.55732 19.4162 10.7675C19.4162 14.035 19.0508 15.4968 17.4975 15.4968C16.5838 15.4968 16.0964 14.7803 16.0964 13.9777V7.5H14.4822V8.30255H14.3909C14.1777 7.67198 12.9898 7.12739 11.467 7.2707C9.18274 7.5 7.4467 9.27707 7.4467 11.8567C7.4467 14.5796 8.81726 16.672 11.467 16.758C13.203 16.8153 14.1168 16.0127 14.4822 15.1815H14.5736C14.7563 16.414 16.401 16.8439 17.467 16.8439C20.6954 16.8439 21 13.5764 21 10.7962C21 6.86943 18.0761 3 12.3807 3C6.50254 3 3 6.3535 3 11.9427C3 17.7325 6.38071 21 12.5939 21ZM11.7107 15.2962C9.73096 15.2962 9.03046 13.6051 9.03046 11.7707C9.03046 10.1083 10.0355 8.67516 11.7716 8.67516C13.599 8.67516 14.5736 9.36306 14.5736 11.7707C14.5736 14.1497 13.7513 15.2962 11.7107 15.2962Z" }) });
-
-//# sourceMappingURL=at-symbol.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/block-table.js":
-/*!***************************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/block-table.js ***!
- \***************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ block_table_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/block-table.tsx
-
-
-var block_table_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z" }) });
-
-//# sourceMappingURL=block-table.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/category.js":
-/*!************************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/category.js ***!
- \************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ category_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/category.tsx
-
-
-var category_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(
- _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path,
- {
- d: "M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",
- fillRule: "evenodd",
- clipRule: "evenodd"
- }
-) });
-
-//# sourceMappingURL=category.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/check.js":
-/*!*********************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/check.js ***!
- \*********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ check_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/check.tsx
-
-
-var check_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" }) });
-
-//# sourceMappingURL=check.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/chevron-left.js":
-/*!****************************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/chevron-left.js ***!
- \****************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ chevron_left_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/chevron-left.tsx
-
-
-var chevron_left_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" }) });
-
-//# sourceMappingURL=chevron-left.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/chevron-right.js":
-/*!*****************************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/chevron-right.js ***!
- \*****************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ chevron_right_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/chevron-right.tsx
-
-
-var chevron_right_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" }) });
-
-//# sourceMappingURL=chevron-right.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/close-small.js":
-/*!***************************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/close-small.js ***!
- \***************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ close_small_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/close-small.tsx
-
-
-var close_small_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.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" }) });
-
-//# sourceMappingURL=close-small.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/close.js":
-/*!*********************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/close.js ***!
- \*********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ close_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/close.tsx
-
-
-var close_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z" }) });
-
-//# sourceMappingURL=close.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/cog.js":
-/*!*******************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/cog.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ cog_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/cog.tsx
-
-
-var cog_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(
- _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path,
- {
- fillRule: "evenodd",
- d: "M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",
- clipRule: "evenodd"
- }
-) });
-
-//# sourceMappingURL=cog.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/error.js":
-/*!*********************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/error.js ***!
- \*********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ error_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/error.tsx
-
-
-var error_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(
- _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path,
- {
- fillRule: "evenodd",
- clipRule: "evenodd",
- d: "M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z"
- }
-) });
-
-//# sourceMappingURL=error.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/format-list-bullets-rtl.js":
-/*!***************************************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/format-list-bullets-rtl.js ***!
- \***************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ format_list_bullets_rtl_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/format-list-bullets-rtl.tsx
-
-
-var format_list_bullets_rtl_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z" }) });
-
-//# sourceMappingURL=format-list-bullets-rtl.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/format-list-bullets.js":
-/*!***********************************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/format-list-bullets.js ***!
- \***********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ format_list_bullets_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/format-list-bullets.tsx
-
-
-var format_list_bullets_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" }) });
-
-//# sourceMappingURL=format-list-bullets.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/funnel.js":
-/*!**********************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/funnel.js ***!
- \**********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ funnel_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/funnel.tsx
-
-
-var funnel_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z" }) });
-
-//# sourceMappingURL=funnel.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/link.js":
-/*!********************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/link.js ***!
- \********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ link_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/link.tsx
-
-
-var link_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.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" }) });
-
-//# sourceMappingURL=link.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/mobile.js":
-/*!**********************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/mobile.js ***!
- \**********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ mobile_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/mobile.tsx
-
-
-var mobile_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z" }) });
-
-//# sourceMappingURL=mobile.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/more-vertical.js":
-/*!*****************************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/more-vertical.js ***!
- \*****************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ more_vertical_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/more-vertical.tsx
-
-
-var more_vertical_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" }) });
-
-//# sourceMappingURL=more-vertical.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/next.js":
-/*!********************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/next.js ***!
- \********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ next_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/next.tsx
-
-
-var next_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z" }) });
-
-//# sourceMappingURL=next.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/previous.js":
-/*!************************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/previous.js ***!
- \************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ previous_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/previous.tsx
-
-
-var previous_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z" }) });
-
-//# sourceMappingURL=previous.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/search.js":
-/*!**********************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/search.js ***!
- \**********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ search_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/search.tsx
-
-
-var search_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.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" }) });
-
-//# sourceMappingURL=search.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/seen.js":
-/*!********************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/seen.js ***!
- \********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ seen_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/seen.tsx
-
-
-var seen_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z" }) });
-
-//# sourceMappingURL=seen.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/unseen.js":
-/*!**********************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/unseen.js ***!
- \**********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ unseen_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/unseen.tsx
-
-
-var unseen_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M20.7 12.7s0-.1-.1-.2c0-.2-.2-.4-.4-.6-.3-.5-.9-1.2-1.6-1.8-.7-.6-1.5-1.3-2.6-1.8l-.6 1.4c.9.4 1.6 1 2.1 1.5.6.6 1.1 1.2 1.4 1.6.1.2.3.4.3.5v.1l.7-.3.7-.3Zm-5.2-9.3-1.8 4c-.5-.1-1.1-.2-1.7-.2-3 0-5.2 1.4-6.6 2.7-.7.7-1.2 1.3-1.6 1.8-.2.3-.3.5-.4.6 0 0 0 .1-.1.2s0 0 .7.3l.7.3V13c0-.1.2-.3.3-.5.3-.4.7-1 1.4-1.6 1.2-1.2 3-2.3 5.5-2.3H13v.3c-.4 0-.8-.1-1.1-.1-1.9 0-3.5 1.6-3.5 3.5s.6 2.3 1.6 2.9l-2 4.4.9.4 7.6-16.2-.9-.4Zm-3 12.6c1.7-.2 3-1.7 3-3.5s-.2-1.4-.6-1.9L12.4 16Z" }) });
-
-//# sourceMappingURL=unseen.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/icons/build-module/library/wordpress.js":
-/*!*************************************************************************!*\
- !*** ./node_modules/@wordpress/icons/build-module/library/wordpress.js ***!
- \*************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ wordpress_default)
-/* harmony export */ });
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
-// packages/icons/src/library/wordpress.tsx
-
-
-var wordpress_default = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -2 24 24", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { d: "M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z" }) });
-
-//# sourceMappingURL=wordpress.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/views/build-module/index.js":
-/*!*************************************************************!*\
- !*** ./node_modules/@wordpress/views/build-module/index.js ***!
- \*************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ loadView: () => (/* reexport safe */ _load_view__WEBPACK_IMPORTED_MODULE_1__.loadView),
-/* harmony export */ useView: () => (/* reexport safe */ _use_view__WEBPACK_IMPORTED_MODULE_0__.useView)
-/* harmony export */ });
-/* harmony import */ var _use_view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./use-view */ "./node_modules/@wordpress/views/build-module/use-view.js");
-/* harmony import */ var _load_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./load-view */ "./node_modules/@wordpress/views/build-module/load-view.js");
-// packages/views/src/index.ts
-
-
-
-//# sourceMappingURL=index.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/views/build-module/load-view.js":
-/*!*****************************************************************!*\
- !*** ./node_modules/@wordpress/views/build-module/load-view.js ***!
- \*****************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ loadView: () => (/* binding */ loadView)
-/* harmony export */ });
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_preferences__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/preferences */ "@wordpress/preferences");
-/* harmony import */ var _wordpress_preferences__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_preferences__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _preference_keys__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./preference-keys */ "./node_modules/@wordpress/views/build-module/preference-keys.js");
-// packages/views/src/load-view.ts
-
-
-
-async function loadView(config) {
- const { kind, name, slug, defaultView, queryParams } = config;
- const preferenceKey = (0,_preference_keys__WEBPACK_IMPORTED_MODULE_2__.generatePreferenceKey)(kind, name, slug);
- const persistedView = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)(_wordpress_preferences__WEBPACK_IMPORTED_MODULE_1__.store).get(
- "core/views",
- preferenceKey
- );
- const baseView = persistedView ?? defaultView;
- const page = queryParams?.page ?? 1;
- const search = queryParams?.search ?? "";
- return {
- ...baseView,
- page,
- search
- };
-}
-
-//# sourceMappingURL=load-view.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/views/build-module/preference-keys.js":
-/*!***********************************************************************!*\
- !*** ./node_modules/@wordpress/views/build-module/preference-keys.js ***!
- \***********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ generatePreferenceKey: () => (/* binding */ generatePreferenceKey)
-/* harmony export */ });
-// packages/views/src/preference-keys.ts
-function generatePreferenceKey(kind, name, slug) {
- return `dataviews-${kind}-${name}-${slug}`;
-}
-
-//# sourceMappingURL=preference-keys.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/@wordpress/views/build-module/use-view.js":
-/*!****************************************************************!*\
- !*** ./node_modules/@wordpress/views/build-module/use-view.js ***!
- \****************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ useView: () => (/* binding */ useView)
-/* harmony export */ });
-/* harmony import */ var dequal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dequal */ "./node_modules/dequal/dist/index.mjs");
-/* harmony import */ var _preference_keys__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./preference-keys */ "./node_modules/@wordpress/views/build-module/preference-keys.js");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _wordpress_preferences__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/preferences */ "@wordpress/preferences");
-/* harmony import */ var _wordpress_preferences__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_preferences__WEBPACK_IMPORTED_MODULE_4__);
-// packages/views/src/use-view.ts
-
-
-
-
-
-function omit(obj, keys) {
- const result = { ...obj };
- for (const key of keys) {
- delete result[key];
- }
- return result;
-}
-function useView(config) {
- const { kind, name, slug, defaultView, queryParams, onChangeQueryParams } = config;
- const preferenceKey = (0,_preference_keys__WEBPACK_IMPORTED_MODULE_1__.generatePreferenceKey)(kind, name, slug);
- const persistedView = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(
- (select) => {
- return select(_wordpress_preferences__WEBPACK_IMPORTED_MODULE_4__.store).get(
- "core/views",
- preferenceKey
- );
- },
- [preferenceKey]
- );
- const { set } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_wordpress_preferences__WEBPACK_IMPORTED_MODULE_4__.store);
- const baseView = persistedView ?? defaultView;
- const page = Number(queryParams?.page ?? baseView.page ?? 1);
- const search = queryParams?.search ?? baseView.search ?? "";
- const view = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
- return {
- ...baseView,
- page,
- search
- };
- }, [baseView, page, search]);
- const isModified = !!persistedView;
- const updateView = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(
- (newView) => {
- const urlParams = {
- page: newView?.page,
- search: newView?.search
- };
- const preferenceView = omit(newView, ["page", "search"]);
- if (onChangeQueryParams && !(0,dequal__WEBPACK_IMPORTED_MODULE_0__.dequal)(urlParams, { page, search })) {
- onChangeQueryParams(urlParams);
- }
- if (!(0,dequal__WEBPACK_IMPORTED_MODULE_0__.dequal)(baseView, preferenceView)) {
- if ((0,dequal__WEBPACK_IMPORTED_MODULE_0__.dequal)(preferenceView, defaultView)) {
- set("core/views", preferenceKey, void 0);
- } else {
- set("core/views", preferenceKey, preferenceView);
- }
- }
- },
- [
- onChangeQueryParams,
- page,
- search,
- baseView,
- defaultView,
- set,
- preferenceKey
- ]
- );
- const resetToDefault = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(() => {
- set("core/views", preferenceKey, void 0);
- }, [preferenceKey, set]);
- return {
- view,
- isModified,
- updateView,
- resetToDefault
- };
-}
-
-//# sourceMappingURL=use-view.js.map
-
-
-/***/ }),
-
-/***/ "./node_modules/clsx/dist/clsx.mjs":
-/*!*****************************************!*\
- !*** ./node_modules/clsx/dist/clsx.mjs ***!
- \*****************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ clsx: () => (/* binding */ clsx),
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
-/* harmony export */ });
-function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ Colord: () => (/* binding */ j),
-/* harmony export */ colord: () => (/* binding */ w),
-/* harmony export */ extend: () => (/* binding */ k),
-/* harmony export */ getFormat: () => (/* binding */ I),
-/* harmony export */ random: () => (/* binding */ E)
-/* harmony export */ });
-var r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},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},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},a=function(r){return{r:e(r.r,0,255),g:e(r.g,0,255),b:e(r.b,0,255),a:e(r.a)}},o=function(r){return{r:n(r.r),g:n(r.g),b:n(r.b),a: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:e(r.s,0,100),l:e(r.l,0,100),a:e(r.a)}},d=function(r){return{h:n(r.h),s:n(r.s),l:n(r.l),a: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}));// removed by dead control flow
- 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};// removed by dead control flow
- 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?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?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: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)?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:e(r.s,0,100),v:e(r.v,0,100),a: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=.5},r.prototype.toHex=function(){return r=o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(n(255*a)):"","#"+s(t)+s(e)+s(u)+i;// removed by dead control flow
- var r, t, e, u, a, i; },r.prototype.toRgb=function(){return o(this.rgba)},r.prototype.toRgbString=function(){return r=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+")";// removed by dead control flow
- 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+"%)";// removed by dead control flow
- var r, t, n, e, u; },r.prototype.toHsv=function(){return r=h(this.rgba),{h:n(r.h),s:n(r.s),v:n(r.v),a:n(r.a,3)};// removed by dead control flow
- 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});// removed by dead control flow
- 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}):n(this.rgba.a,3);// removed by dead control flow
- 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}):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()})};
-
-
-/***/ }),
-
-/***/ "./node_modules/dequal/dist/index.mjs":
-/*!********************************************!*\
- !*** ./node_modules/dequal/dist/index.mjs ***!
- \********************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ dequal: () => (/* binding */ dequal)
-/* harmony export */ });
-var has = Object.prototype.hasOwnProperty;
-
-function find(iter, tar, key) {
- for (key of iter.keys()) {
- if (dequal(key, tar)) return key;
- }
-}
-
-function dequal(foo, bar) {
- var ctor, len, tmp;
- if (foo === bar) return true;
-
- if (foo && bar && (ctor=foo.constructor) === bar.constructor) {
- if (ctor === Date) return foo.getTime() === bar.getTime();
- if (ctor === RegExp) return foo.toString() === bar.toString();
-
- if (ctor === Array) {
- if ((len=foo.length) === bar.length) {
- while (len-- && dequal(foo[len], bar[len]));
- }
- return len === -1;
- }
-
- if (ctor === Set) {
- if (foo.size !== bar.size) {
- return false;
- }
- for (len of foo) {
- tmp = len;
- if (tmp && typeof tmp === 'object') {
- tmp = find(bar, tmp);
- if (!tmp) return false;
- }
- if (!bar.has(tmp)) return false;
- }
- return true;
- }
-
- if (ctor === Map) {
- if (foo.size !== bar.size) {
- return false;
- }
- for (len of foo) {
- tmp = len[0];
- if (tmp && typeof tmp === 'object') {
- tmp = find(bar, tmp);
- if (!tmp) return false;
- }
- if (!dequal(len[1], bar.get(tmp))) {
- return false;
- }
- }
- return true;
- }
-
- if (ctor === ArrayBuffer) {
- foo = new Uint8Array(foo);
- bar = new Uint8Array(bar);
- } else if (ctor === DataView) {
- if ((len=foo.byteLength) === bar.byteLength) {
- while (len-- && foo.getInt8(len) === bar.getInt8(len));
- }
- return len === -1;
- }
-
- if (ArrayBuffer.isView(foo)) {
- if ((len=foo.byteLength) === bar.byteLength) {
- while (len-- && foo[len] === bar[len]);
- }
- return len === -1;
- }
-
- if (!ctor || typeof foo === 'object') {
- len = 0;
- for (ctor in foo) {
- if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
- if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
- }
- return Object.keys(bar).length === len;
- }
- }
-
- return foo !== foo && bar !== bar;
-}
-
-
-/***/ }),
-
-/***/ "./node_modules/fast-deep-equal/es6/index.js":
-/*!***************************************************!*\
- !*** ./node_modules/fast-deep-equal/es6/index.js ***!
- \***************************************************/
-/***/ ((module) => {
-
-"use strict";
-
-
-// do not edit .js files directly - edit src/index.jst
-
-
- var envHasBigInt64Array = typeof BigInt64Array !== 'undefined';
-
-
-module.exports = function equal(a, b) {
- if (a === b) return true;
-
- if (a && b && typeof a == 'object' && typeof b == 'object') {
- if (a.constructor !== b.constructor) return false;
-
- var length, i, keys;
- if (Array.isArray(a)) {
- length = a.length;
- if (length != b.length) return false;
- for (i = length; i-- !== 0;)
- if (!equal(a[i], b[i])) return false;
- return true;
- }
-
-
- if ((a instanceof Map) && (b instanceof Map)) {
- if (a.size !== b.size) return false;
- for (i of a.entries())
- if (!b.has(i[0])) return false;
- for (i of a.entries())
- if (!equal(i[1], b.get(i[0]))) return false;
- return true;
- }
-
- if ((a instanceof Set) && (b instanceof Set)) {
- if (a.size !== b.size) return false;
- for (i of a.entries())
- if (!b.has(i[0])) return false;
- return true;
- }
-
- if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
- length = a.length;
- if (length != b.length) return false;
- for (i = length; i-- !== 0;)
- if (a[i] !== b[i]) return false;
- return true;
- }
-
-
- if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
- if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
- if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
-
- 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;) {
- var key = keys[i];
-
- if (!equal(a[key], b[key])) return false;
- }
-
- return true;
- }
-
- // true if both NaN, false otherwise
- return a!==a && b!==b;
-};
-
-
-/***/ }),
-
-/***/ "./node_modules/remove-accents/index.js":
-/*!**********************************************!*\
- !*** ./node_modules/remove-accents/index.js ***!
- \**********************************************/
-/***/ ((module) => {
-
-var characterMap = {
- "À": "A",
- "Á": "A",
- "Â": "A",
- "Ã": "A",
- "Ä": "A",
- "Å": "A",
- "Ấ": "A",
- "Ắ": "A",
- "Ẳ": "A",
- "Ẵ": "A",
- "Ặ": "A",
- "Æ": "AE",
- "Ầ": "A",
- "Ằ": "A",
- "Ȃ": "A",
- "Ả": "A",
- "Ạ": "A",
- "Ẩ": "A",
- "Ẫ": "A",
- "Ậ": "A",
- "Ç": "C",
- "Ḉ": "C",
- "È": "E",
- "É": "E",
- "Ê": "E",
- "Ë": "E",
- "Ế": "E",
- "Ḗ": "E",
- "Ề": "E",
- "Ḕ": "E",
- "Ḝ": "E",
- "Ȇ": "E",
- "Ẻ": "E",
- "Ẽ": "E",
- "Ẹ": "E",
- "Ể": "E",
- "Ễ": "E",
- "Ệ": "E",
- "Ì": "I",
- "Í": "I",
- "Î": "I",
- "Ï": "I",
- "Ḯ": "I",
- "Ȋ": "I",
- "Ỉ": "I",
- "Ị": "I",
- "Ð": "D",
- "Ñ": "N",
- "Ò": "O",
- "Ó": "O",
- "Ô": "O",
- "Õ": "O",
- "Ö": "O",
- "Ø": "O",
- "Ố": "O",
- "Ṍ": "O",
- "Ṓ": "O",
- "Ȏ": "O",
- "Ỏ": "O",
- "Ọ": "O",
- "Ổ": "O",
- "Ỗ": "O",
- "Ộ": "O",
- "Ờ": "O",
- "Ở": "O",
- "Ỡ": "O",
- "Ớ": "O",
- "Ợ": "O",
- "Ù": "U",
- "Ú": "U",
- "Û": "U",
- "Ü": "U",
- "Ủ": "U",
- "Ụ": "U",
- "Ử": "U",
- "Ữ": "U",
- "Ự": "U",
- "Ý": "Y",
- "à": "a",
- "á": "a",
- "â": "a",
- "ã": "a",
- "ä": "a",
- "å": "a",
- "ấ": "a",
- "ắ": "a",
- "ẳ": "a",
- "ẵ": "a",
- "ặ": "a",
- "æ": "ae",
- "ầ": "a",
- "ằ": "a",
- "ȃ": "a",
- "ả": "a",
- "ạ": "a",
- "ẩ": "a",
- "ẫ": "a",
- "ậ": "a",
- "ç": "c",
- "ḉ": "c",
- "è": "e",
- "é": "e",
- "ê": "e",
- "ë": "e",
- "ế": "e",
- "ḗ": "e",
- "ề": "e",
- "ḕ": "e",
- "ḝ": "e",
- "ȇ": "e",
- "ẻ": "e",
- "ẽ": "e",
- "ẹ": "e",
- "ể": "e",
- "ễ": "e",
- "ệ": "e",
- "ì": "i",
- "í": "i",
- "î": "i",
- "ï": "i",
- "ḯ": "i",
- "ȋ": "i",
- "ỉ": "i",
- "ị": "i",
- "ð": "d",
- "ñ": "n",
- "ò": "o",
- "ó": "o",
- "ô": "o",
- "õ": "o",
- "ö": "o",
- "ø": "o",
- "ố": "o",
- "ṍ": "o",
- "ṓ": "o",
- "ȏ": "o",
- "ỏ": "o",
- "ọ": "o",
- "ổ": "o",
- "ỗ": "o",
- "ộ": "o",
- "ờ": "o",
- "ở": "o",
- "ỡ": "o",
- "ớ": "o",
- "ợ": "o",
- "ù": "u",
- "ú": "u",
- "û": "u",
- "ü": "u",
- "ủ": "u",
- "ụ": "u",
- "ử": "u",
- "ữ": "u",
- "ự": "u",
- "ý": "y",
- "ÿ": "y",
- "Ā": "A",
- "ā": "a",
- "Ă": "A",
- "ă": "a",
- "Ą": "A",
- "ą": "a",
- "Ć": "C",
- "ć": "c",
- "Ĉ": "C",
- "ĉ": "c",
- "Ċ": "C",
- "ċ": "c",
- "Č": "C",
- "č": "c",
- "C̆": "C",
- "c̆": "c",
- "Ď": "D",
- "ď": "d",
- "Đ": "D",
- "đ": "d",
- "Ē": "E",
- "ē": "e",
- "Ĕ": "E",
- "ĕ": "e",
- "Ė": "E",
- "ė": "e",
- "Ę": "E",
- "ę": "e",
- "Ě": "E",
- "ě": "e",
- "Ĝ": "G",
- "Ǵ": "G",
- "ĝ": "g",
- "ǵ": "g",
- "Ğ": "G",
- "ğ": "g",
- "Ġ": "G",
- "ġ": "g",
- "Ģ": "G",
- "ģ": "g",
- "Ĥ": "H",
- "ĥ": "h",
- "Ħ": "H",
- "ħ": "h",
- "Ḫ": "H",
- "ḫ": "h",
- "Ĩ": "I",
- "ĩ": "i",
- "Ī": "I",
- "ī": "i",
- "Ĭ": "I",
- "ĭ": "i",
- "Į": "I",
- "į": "i",
- "İ": "I",
- "ı": "i",
- "IJ": "IJ",
- "ij": "ij",
- "Ĵ": "J",
- "ĵ": "j",
- "Ķ": "K",
- "ķ": "k",
- "Ḱ": "K",
- "ḱ": "k",
- "K̆": "K",
- "k̆": "k",
- "Ĺ": "L",
- "ĺ": "l",
- "Ļ": "L",
- "ļ": "l",
- "Ľ": "L",
- "ľ": "l",
- "Ŀ": "L",
- "ŀ": "l",
- "Ł": "l",
- "ł": "l",
- "Ḿ": "M",
- "ḿ": "m",
- "M̆": "M",
- "m̆": "m",
- "Ń": "N",
- "ń": "n",
- "Ņ": "N",
- "ņ": "n",
- "Ň": "N",
- "ň": "n",
- "ʼn": "n",
- "N̆": "N",
- "n̆": "n",
- "Ō": "O",
- "ō": "o",
- "Ŏ": "O",
- "ŏ": "o",
- "Ő": "O",
- "ő": "o",
- "Œ": "OE",
- "œ": "oe",
- "P̆": "P",
- "p̆": "p",
- "Ŕ": "R",
- "ŕ": "r",
- "Ŗ": "R",
- "ŗ": "r",
- "Ř": "R",
- "ř": "r",
- "R̆": "R",
- "r̆": "r",
- "Ȓ": "R",
- "ȓ": "r",
- "Ś": "S",
- "ś": "s",
- "Ŝ": "S",
- "ŝ": "s",
- "Ş": "S",
- "Ș": "S",
- "ș": "s",
- "ş": "s",
- "Š": "S",
- "š": "s",
- "Ţ": "T",
- "ţ": "t",
- "ț": "t",
- "Ț": "T",
- "Ť": "T",
- "ť": "t",
- "Ŧ": "T",
- "ŧ": "t",
- "T̆": "T",
- "t̆": "t",
- "Ũ": "U",
- "ũ": "u",
- "Ū": "U",
- "ū": "u",
- "Ŭ": "U",
- "ŭ": "u",
- "Ů": "U",
- "ů": "u",
- "Ű": "U",
- "ű": "u",
- "Ų": "U",
- "ų": "u",
- "Ȗ": "U",
- "ȗ": "u",
- "V̆": "V",
- "v̆": "v",
- "Ŵ": "W",
- "ŵ": "w",
- "Ẃ": "W",
- "ẃ": "w",
- "X̆": "X",
- "x̆": "x",
- "Ŷ": "Y",
- "ŷ": "y",
- "Ÿ": "Y",
- "Y̆": "Y",
- "y̆": "y",
- "Ź": "Z",
- "ź": "z",
- "Ż": "Z",
- "ż": "z",
- "Ž": "Z",
- "ž": "z",
- "ſ": "s",
- "ƒ": "f",
- "Ơ": "O",
- "ơ": "o",
- "Ư": "U",
- "ư": "u",
- "Ǎ": "A",
- "ǎ": "a",
- "Ǐ": "I",
- "ǐ": "i",
- "Ǒ": "O",
- "ǒ": "o",
- "Ǔ": "U",
- "ǔ": "u",
- "Ǖ": "U",
- "ǖ": "u",
- "Ǘ": "U",
- "ǘ": "u",
- "Ǚ": "U",
- "ǚ": "u",
- "Ǜ": "U",
- "ǜ": "u",
- "Ứ": "U",
- "ứ": "u",
- "Ṹ": "U",
- "ṹ": "u",
- "Ǻ": "A",
- "ǻ": "a",
- "Ǽ": "AE",
- "ǽ": "ae",
- "Ǿ": "O",
- "ǿ": "o",
- "Þ": "TH",
- "þ": "th",
- "Ṕ": "P",
- "ṕ": "p",
- "Ṥ": "S",
- "ṥ": "s",
- "X́": "X",
- "x́": "x",
- "Ѓ": "Г",
- "ѓ": "г",
- "Ќ": "К",
- "ќ": "к",
- "A̋": "A",
- "a̋": "a",
- "E̋": "E",
- "e̋": "e",
- "I̋": "I",
- "i̋": "i",
- "Ǹ": "N",
- "ǹ": "n",
- "Ồ": "O",
- "ồ": "o",
- "Ṑ": "O",
- "ṑ": "o",
- "Ừ": "U",
- "ừ": "u",
- "Ẁ": "W",
- "ẁ": "w",
- "Ỳ": "Y",
- "ỳ": "y",
- "Ȁ": "A",
- "ȁ": "a",
- "Ȅ": "E",
- "ȅ": "e",
- "Ȉ": "I",
- "ȉ": "i",
- "Ȍ": "O",
- "ȍ": "o",
- "Ȑ": "R",
- "ȑ": "r",
- "Ȕ": "U",
- "ȕ": "u",
- "B̌": "B",
- "b̌": "b",
- "Č̣": "C",
- "č̣": "c",
- "Ê̌": "E",
- "ê̌": "e",
- "F̌": "F",
- "f̌": "f",
- "Ǧ": "G",
- "ǧ": "g",
- "Ȟ": "H",
- "ȟ": "h",
- "J̌": "J",
- "ǰ": "j",
- "Ǩ": "K",
- "ǩ": "k",
- "M̌": "M",
- "m̌": "m",
- "P̌": "P",
- "p̌": "p",
- "Q̌": "Q",
- "q̌": "q",
- "Ř̩": "R",
- "ř̩": "r",
- "Ṧ": "S",
- "ṧ": "s",
- "V̌": "V",
- "v̌": "v",
- "W̌": "W",
- "w̌": "w",
- "X̌": "X",
- "x̌": "x",
- "Y̌": "Y",
- "y̌": "y",
- "A̧": "A",
- "a̧": "a",
- "B̧": "B",
- "b̧": "b",
- "Ḑ": "D",
- "ḑ": "d",
- "Ȩ": "E",
- "ȩ": "e",
- "Ɛ̧": "E",
- "ɛ̧": "e",
- "Ḩ": "H",
- "ḩ": "h",
- "I̧": "I",
- "i̧": "i",
- "Ɨ̧": "I",
- "ɨ̧": "i",
- "M̧": "M",
- "m̧": "m",
- "O̧": "O",
- "o̧": "o",
- "Q̧": "Q",
- "q̧": "q",
- "U̧": "U",
- "u̧": "u",
- "X̧": "X",
- "x̧": "x",
- "Z̧": "Z",
- "z̧": "z",
- "й":"и",
- "Й":"И",
- "ё":"е",
- "Ё":"Е",
-};
-
-var chars = Object.keys(characterMap).join('|');
-var allAccents = new RegExp(chars, 'g');
-var firstAccent = new RegExp(chars, '');
-
-function matcher(match) {
- return characterMap[match];
-}
-
-var removeAccents = function(string) {
- return string.replace(allAccents, matcher);
-};
-
-var hasAccents = function(string) {
- return !!string.match(firstAccent);
-};
-
-module.exports = removeAccents;
-module.exports.has = hasAccents;
-module.exports.remove = removeAccents;
-
-
-/***/ }),
-
-/***/ "./node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js":
-/*!**********************************************************************************************!*\
- !*** ./node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js ***!
- \**********************************************************************************************/
-/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
-
-"use strict";
-/**
- * @license React
- * use-sync-external-store-shim.development.js
- *
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-
- true &&
- (function () {
- function is(x, y) {
- return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
- }
- function useSyncExternalStore$2(subscribe, getSnapshot) {
- didWarnOld18Alpha ||
- void 0 === React.startTransition ||
- ((didWarnOld18Alpha = !0),
- console.error(
- "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
- ));
- var value = getSnapshot();
- if (!didWarnUncachedGetSnapshot) {
- var cachedValue = getSnapshot();
- objectIs(value, cachedValue) ||
- (console.error(
- "The result of getSnapshot should be cached to avoid an infinite loop"
- ),
- (didWarnUncachedGetSnapshot = !0));
- }
- cachedValue = useState({
- inst: { value: value, getSnapshot: getSnapshot }
- });
- var inst = cachedValue[0].inst,
- forceUpdate = cachedValue[1];
- useLayoutEffect(
- function () {
- inst.value = value;
- inst.getSnapshot = getSnapshot;
- checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
- },
- [subscribe, value, getSnapshot]
- );
- useEffect(
- function () {
- checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
- return subscribe(function () {
- checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
- });
- },
- [subscribe]
- );
- useDebugValue(value);
- return value;
- }
- function checkIfSnapshotChanged(inst) {
- var latestGetSnapshot = inst.getSnapshot;
- inst = inst.value;
- try {
- var nextValue = latestGetSnapshot();
- return !objectIs(inst, nextValue);
- } catch (error) {
- return !0;
- }
- }
- function useSyncExternalStore$1(subscribe, getSnapshot) {
- return getSnapshot();
- }
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
- "function" ===
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
- var React = __webpack_require__(/*! react */ "react"),
- objectIs = "function" === typeof Object.is ? Object.is : is,
- useState = React.useState,
- useEffect = React.useEffect,
- useLayoutEffect = React.useLayoutEffect,
- useDebugValue = React.useDebugValue,
- didWarnOld18Alpha = !1,
- didWarnUncachedGetSnapshot = !1,
- shim =
- "undefined" === typeof window ||
- "undefined" === typeof window.document ||
- "undefined" === typeof window.document.createElement
- ? useSyncExternalStore$1
- : useSyncExternalStore$2;
- exports.useSyncExternalStore =
- void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
- "function" ===
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
- })();
-
-
-/***/ }),
-
-/***/ "./node_modules/use-sync-external-store/shim/index.js":
-/*!************************************************************!*\
- !*** ./node_modules/use-sync-external-store/shim/index.js ***!
- \************************************************************/
-/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
-
-"use strict";
-
-
-if (false) // removed by dead control flow
-{} else {
- module.exports = __webpack_require__(/*! ../cjs/use-sync-external-store-shim.development.js */ "./node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js");
-}
-
-
-/***/ })
-
-}]);
-//# sourceMappingURL=vendors.js.map
\ No newline at end of file
+(globalThis.webpackChunkwordpress_activitypub=globalThis.webpackChunkwordpress_activitypub||[]).push([[803],{164:(e,t,n)=>{"use strict";function i(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;tr});const r=function(){for(var e,t,n=0,r="",a=arguments.length;n{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var i,r,a;if(Array.isArray(t)){if((i=t.length)!=n.length)return!1;for(r=i;0!==r--;)if(!e(t[r],n[r]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(r of t.entries())if(!n.has(r[0]))return!1;for(r of t.entries())if(!e(r[1],n.get(r[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(r of t.entries())if(!n.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((i=t.length)!=n.length)return!1;for(r=i;0!==r--;)if(t[r]!==n[r])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((i=(a=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=i;0!==r--;)if(!Object.prototype.hasOwnProperty.call(n,a[r]))return!1;for(r=i;0!==r--;){var s=a[r];if(!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n}},307:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(573),r=n(790),a=(0,r.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(i.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"})})},371:(e,t,n)=>{"use strict";n.d(t,{A:()=>uo});var i=n(427),r=n(87),a=n(491),s=n(723),l=n(573),o=n(790),u=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.Path,{d:"M12 3.9 6.5 9.5l1 1 3.8-3.7V20h1.5V6.8l3.7 3.7 1-1z"})}),c=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.Path,{d:"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"})}),d="is",f="isNot",m="isAny",v="isNone",p="isAll",h="isNotAll",g="lessThan",b="greaterThan",x="lessThanOrEqual",w="greaterThanOrEqual",y="before",_="after",C="beforeInc",j="afterInc",S="contains",k="notContains",V="startsWith",I="between",E="on",N="notOn",F="inThePast",M="over",A=[d,f,m,v,p,h,g,b,x,w,y,_,C,j,S,k,V,I,E,N,F,M],O=[d,f,g,b,x,w,y,_,C,j,S,k,V,E,N],P={[d]:{key:"is-filter",label:(0,s.__)("Is")},[f]:{key:"is-not-filter",label:(0,s.__)("Is not")},[m]:{key:"is-any-filter",label:(0,s.__)("Is any")},[v]:{key:"is-none-filter",label:(0,s.__)("Is none")},[p]:{key:"is-all-filter",label:(0,s.__)("Is all")},[h]:{key:"is-not-all-filter",label:(0,s.__)("Is not all")},[g]:{key:"less-than-filter",label:(0,s.__)("Less than")},[b]:{key:"greater-than-filter",label:(0,s.__)("Greater than")},[x]:{key:"less-than-or-equal-filter",label:(0,s.__)("Less than or equal")},[w]:{key:"greater-than-or-equal-filter",label:(0,s.__)("Greater than or equal")},[y]:{key:"before-filter",label:(0,s.__)("Before")},[_]:{key:"after-filter",label:(0,s.__)("After")},[C]:{key:"before-inc-filter",label:(0,s.__)("Before (inc)")},[j]:{key:"after-inc-filter",label:(0,s.__)("After (inc)")},[S]:{key:"contains-filter",label:(0,s.__)("Contains")},[k]:{key:"not-contains-filter",label:(0,s.__)("Doesn't contain")},[V]:{key:"starts-with-filter",label:(0,s.__)("Starts with")},[I]:{key:"between-filter",label:(0,s.__)("Between (inc)")},[E]:{key:"on-filter",label:(0,s.__)("On")},[N]:{key:"not-on-filter",label:(0,s.__)("Not on")},[F]:{key:"in-the-past-filter",label:(0,s.__)("In the past")},[M]:{key:"over-filter",label:(0,s.__)("Over")}},L=["asc","desc"],D={asc:"↑",desc:"↓"},T={asc:"ascending",desc:"descending"},B={asc:(0,s.__)("Sort ascending"),desc:(0,s.__)("Sort descending")},z={asc:u,desc:c},H="table",R="grid",$=(0,r.createContext)({view:{type:H},onChangeView:()=>{},fields:[],data:[],paginationInfo:{totalItems:0,totalPages:0},selection:[],onChangeSelection:()=>{},setOpenedFilter:()=>{},openedFilter:null,getItemId:e=>e.id,isItemClickable:()=>!0,renderItemLink:void 0,containerWidth:0,containerRef:(0,r.createRef)(),resizeObserverRef:()=>{},defaultLayouts:{list:{},grid:{},table:{}},filters:[],isShowingFilter:!1,setIsShowingFilter:()=>{},hasInfiniteScrollHandler:!1,config:{perPageSizes:[]}});$.displayName="DataViewsContext";var W=$,q=(0,o.jsx)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(l.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z"})}),K=(0,o.jsx)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(l.Path,{d:"M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",fillRule:"evenodd",clipRule:"evenodd"})}),G=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.Path,{d:"M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"})}),Y=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})}),U=n(164),Z=n(558);function X({selection:e,onChangeSelection:t,item:n,getItemId:r,titleField:a,disabled:l,...u}){const c=r(n),d=!l&&e.includes(c),f=a?.getValue?.({item:n})||(0,s.__)("(no title)");return(0,o.jsx)(i.CheckboxControl,{className:"dataviews-selection-checkbox",__nextHasNoMarginBottom:!0,"aria-label":f,"aria-disabled":l,checked:d,onChange:()=>{l||t(e.includes(c)?e.filter(e=>c!==e):[...e,c])},...u})}var Q=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})}),J=n(143),ee=n(53),{lock:te,unlock:ne}=(0,ee.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/dataviews"),{Menu:ie,kebabCase:re}=ne(i.privateApis);function ae({action:e,onClick:t,items:n}){const r="string"==typeof e.label?e.label:e.label(n);return(0,o.jsx)(i.Button,{disabled:!!e.disabled,accessibleWhenDisabled:!0,size:"compact",onClick:t,children:r})}function se({action:e,onClick:t,items:n}){const i="string"==typeof e.label?e.label:e.label(n);return(0,o.jsx)(ie.Item,{disabled:e.disabled,onClick:t,children:(0,o.jsx)(ie.ItemLabel,{children:i})})}function le({action:e,items:t,closeModal:n}){const r="string"==typeof e.label?e.label:e.label(t),a="function"==typeof e.modalHeader?e.modalHeader(t):e.modalHeader;return(0,o.jsx)(i.Modal,{title:a||r,__experimentalHideHeader:!!e.hideModalHeader,onRequestClose:n,focusOnMount:e.modalFocusOnMount??!0,size:e.modalSize||"medium",overlayClassName:`dataviews-action-modal dataviews-action-modal__${re(e.id)}`,children:(0,o.jsx)(e.RenderModal,{items:t,closeModal:n})})}function oe({actions:e,item:t,registry:n,setActiveModalAction:i}){const{primaryActions:a,regularActions:s}=(0,r.useMemo)(()=>e.reduce((e,t)=>((t.isPrimary?e.primaryActions:e.regularActions).push(t),e),{primaryActions:[],regularActions:[]}),[e]),l=e=>e.map(e=>(0,o.jsx)(se,{action:e,onClick:()=>{"RenderModal"in e?i(e):e.callback([t],{registry:n})},items:[t]},e.id));return(0,o.jsxs)(ie.Group,{children:[l(a),a.length>0&&s.length>0&&(0,o.jsx)(ie.Separator,{}),l(s)]})}function ue({item:e,actions:t,isCompact:n}){const a=(0,J.useRegistry)(),{primaryActions:s,eligibleActions:l}=(0,r.useMemo)(()=>{const n=t.filter(t=>!t.isEligible||t.isEligible(e));return{primaryActions:n.filter(e=>e.isPrimary),eligibleActions:n}},[t,e]);return n?(0,o.jsx)(ce,{item:e,actions:l,isSmall:!0,registry:a}):(0,o.jsxs)(i.__experimentalHStack,{spacing:0,justify:"flex-end",className:"dataviews-item-actions",style:{flexShrink:0,width:"auto"},children:[(0,o.jsx)(de,{item:e,actions:s,registry:a}),s.lengthu(null)})]})}function de({item:e,actions:t,registry:n}){const[i,s]=(0,r.useState)(null);return(0,a.useViewportMatch)("medium","<")?null:Array.isArray(t)&&0!==t.length?(0,o.jsxs)(o.Fragment,{children:[t.map(t=>(0,o.jsx)(ae,{action:t,onClick:()=>{"RenderModal"in t?s(t):t.callback([e],{registry:n})},items:[e]},t.id)),!!i&&(0,o.jsx)(le,{action:i,items:[e],closeModal:()=>s(null)})]}):null}var fe=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.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"})});function me({action:e,items:t,ActionTriggerComponent:n}){const[i,a]=(0,r.useState)(!1),s={action:e,onClick:()=>{a(!0)},items:t};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n,{...s}),i&&(0,o.jsx)(le,{action:e,items:t,closeModal:()=>a(!1)})]})}function ve(e,t){return(0,r.useMemo)(()=>e.some(e=>e.supportsBulk&&(!e.isEligible||e.isEligible(t))),[e,t])}function pe(e,t){return(0,r.useMemo)(()=>t.some(t=>e.some(e=>e.supportsBulk&&(!e.isEligible||e.isEligible(t)))),[e,t])}function he({selection:e,onChangeSelection:t,data:n,actions:a,getItemId:l}){const u=(0,r.useMemo)(()=>n.filter(e=>a.some(t=>t.supportsBulk&&(!t.isEligible||t.isEligible(e)))),[n,a]),c=n.filter(t=>e.includes(l(t))&&u.includes(t)),d=c.length===u.length;return(0,o.jsx)(i.CheckboxControl,{className:"dataviews-view-table-selection-checkbox",__nextHasNoMarginBottom:!0,checked:d,indeterminate:!d&&!!c.length,onChange:()=>{t(d?[]:u.map(e=>l(e)))},"aria-label":d?(0,s.__)("Deselect all"):(0,s.__)("Select all")})}function ge({action:e,onClick:t,isBusy:n,items:r}){const s="string"==typeof e.label?e.label:e.label(r);return(0,a.useViewportMatch)("medium","<")?(0,o.jsx)(i.Button,{disabled:n,accessibleWhenDisabled:!0,label:s,icon:e.icon,size:"compact",onClick:t,isBusy:n}):(0,o.jsx)(i.Button,{disabled:n,accessibleWhenDisabled:!0,size:"compact",onClick:t,isBusy:n,children:s})}var be=[];function xe({action:e,selectedItems:t,actionInProgress:n,setActionInProgress:i}){const a=(0,J.useRegistry)(),s=(0,r.useMemo)(()=>t.filter(t=>!e.isEligible||e.isEligible(t)),[e,t]);return"RenderModal"in e?(0,o.jsx)(me,{action:e,items:s,ActionTriggerComponent:ge},e.id):(0,o.jsx)(ge,{action:e,onClick:async()=>{i(e.id),await e.callback(t,{registry:a}),i(null)},items:s,isBusy:n===e.id},e.id)}function we(e,t,n,r,a,l,u,c,d){const f=l.length>0?(0,s.sprintf)(
+/* translators: %d: number of items. */
+/* translators: %d: number of items. */
+(0,s._n)("%d Item selected","%d Items selected",l.length),l.length):(0,s.sprintf)(
+/* translators: %d: number of items. */
+/* translators: %d: number of items. */
+(0,s._n)("%d Item","%d Items",e.length),e.length);return(0,o.jsxs)(i.__experimentalHStack,{expanded:!1,className:"dataviews-bulk-actions-footer__container",spacing:3,children:[(0,o.jsx)(he,{selection:r,onChangeSelection:d,data:e,actions:t,getItemId:n}),(0,o.jsx)("span",{className:"dataviews-bulk-actions-footer__item-count",children:f}),(0,o.jsxs)(i.__experimentalHStack,{className:"dataviews-bulk-actions-footer__action-buttons",expanded:!1,spacing:1,children:[a.map(e=>(0,o.jsx)(xe,{action:e,selectedItems:l,actionInProgress:u,setActionInProgress:c},e.id)),l.length>0&&(0,o.jsx)(i.Button,{icon:fe,showTooltip:!0,tooltipPosition:"top",size:"compact",label:(0,s.__)("Cancel"),disabled:!!u,accessibleWhenDisabled:!1,onClick:()=>{d(be)}})]})]})}function ye({selection:e,actions:t,onChangeSelection:n,data:i,getItemId:s}){const[l,o]=(0,r.useState)(null),u=(0,r.useRef)(null),c=(0,a.useViewportMatch)("medium","<"),d=(0,r.useMemo)(()=>t.filter(e=>e.supportsBulk),[t]),f=(0,r.useMemo)(()=>i.filter(e=>d.some(t=>!t.isEligible||t.isEligible(e))),[i,d]),m=(0,r.useMemo)(()=>i.filter(t=>e.includes(s(t))&&f.includes(t)),[e,i,s,f]),v=(0,r.useMemo)(()=>t.filter(e=>e.supportsBulk&&(!c||e.icon)&&m.some(t=>!e.isEligible||e.isEligible(t))),[t,m,c]);return l?(u.current||(u.current=we(i,t,s,e,v,m,l,o,n)),u.current):(u.current&&(u.current=null),we(i,t,s,e,v,m,l,o,n))}function _e(){const{data:e,selection:t,actions:n=be,onChangeSelection:i,getItemId:a}=(0,r.useContext)(W);return(0,o.jsx)(ye,{selection:t,onChangeSelection:i,data:e,actions:n,getItemId:a})}var Ce=(0,o.jsx)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(l.Path,{d:"M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z"})}),je=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"})}),Se=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})}),ke=(0,o.jsx)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(l.Path,{d:"M20.7 12.7s0-.1-.1-.2c0-.2-.2-.4-.4-.6-.3-.5-.9-1.2-1.6-1.8-.7-.6-1.5-1.3-2.6-1.8l-.6 1.4c.9.4 1.6 1 2.1 1.5.6.6 1.1 1.2 1.4 1.6.1.2.3.4.3.5v.1l.7-.3.7-.3Zm-5.2-9.3-1.8 4c-.5-.1-1.1-.2-1.7-.2-3 0-5.2 1.4-6.6 2.7-.7.7-1.2 1.3-1.6 1.8-.2.3-.3.5-.4.6 0 0 0 .1-.1.2s0 0 .7.3l.7.3V13c0-.1.2-.3.3-.5.3-.4.7-1 1.4-1.6 1.2-1.2 3-2.3 5.5-2.3H13v.3c-.4 0-.8-.1-1.1-.1-1.9 0-3.5 1.6-3.5 3.5s.6 2.3 1.6 2.9l-2 4.4.9.4 7.6-16.2-.9-.4Zm-3 12.6c1.7-.2 3-1.7 3-3.5s-.2-1.4-.6-1.9L12.4 16Z"})}),{Menu:Ve}=ne(i.privateApis);function Ie({children:e}){return r.Children.toArray(e).filter(Boolean).map((e,t)=>(0,o.jsxs)(r.Fragment,{children:[t>0&&(0,o.jsx)(Ve.Separator,{}),e]},t))}var Ee=(0,r.forwardRef)(function({fieldId:e,view:t,fields:n,onChangeView:r,onHide:a,setOpenedFilter:l,canMove:u=!0},c){const d=t.fields??[],f=d?.indexOf(e),m=t.sort?.field===e;let v=!1,p=!1,h=!1,g=[];const b=n.find(t=>t.id===e);if(!b)return null;v=!1!==b.enableHiding,p=!1!==b.enableSorting;const x=b.header;return g=!!b.filterBy&&b.filterBy?.operators||[],h=!(t.filters?.some(t=>e===t.field)||!b.hasElements&&!b.Edit||!1===b.filterBy||b.filterBy?.isPrimary),p||u||v||h?(0,o.jsxs)(Ve,{children:[(0,o.jsxs)(Ve.TriggerButton,{render:(0,o.jsx)(i.Button,{size:"compact",className:"dataviews-view-table-header-button",ref:c,variant:"tertiary"}),children:[x,t.sort&&m&&(0,o.jsx)("span",{"aria-hidden":"true",children:D[t.sort.direction]})]}),(0,o.jsx)(Ve.Popover,{style:{minWidth:"240px"},children:(0,o.jsxs)(Ie,{children:[p&&(0,o.jsx)(Ve.Group,{children:L.map(n=>{const i=t.sort&&m&&t.sort.direction===n,a=`${e}-${n}`;return(0,o.jsx)(Ve.RadioItem,{name:"view-table-sorting",value:a,checked:i,onChange:()=>{r({...t,sort:{field:e,direction:n},showLevels:!1})},children:(0,o.jsx)(Ve.ItemLabel,{children:B[n]})},a)})}),h&&(0,o.jsx)(Ve.Group,{children:(0,o.jsx)(Ve.Item,{prefix:(0,o.jsx)(i.Icon,{icon:Ce}),onClick:()=>{l(e),r({...t,page:1,filters:[...t.filters||[],{field:e,value:void 0,operator:g[0]}]})},children:(0,o.jsx)(Ve.ItemLabel,{children:(0,s.__)("Add filter")})})}),(u||v)&&b&&(0,o.jsxs)(Ve.Group,{children:[u&&(0,o.jsx)(Ve.Item,{prefix:(0,o.jsx)(i.Icon,{icon:je}),disabled:f<1,onClick:()=>{r({...t,fields:[...d.slice(0,f-1)??[],e,d[f-1],...d.slice(f+1)]})},children:(0,o.jsx)(Ve.ItemLabel,{children:(0,s.__)("Move left")})}),u&&(0,o.jsx)(Ve.Item,{prefix:(0,o.jsx)(i.Icon,{icon:Se}),disabled:f>=d.length-1,onClick:()=>{r({...t,fields:[...d.slice(0,f)??[],d[f+1],e,...d.slice(f+2)]})},children:(0,o.jsx)(Ve.ItemLabel,{children:(0,s.__)("Move right")})}),v&&b&&(0,o.jsx)(Ve.Item,{prefix:(0,o.jsx)(i.Icon,{icon:ke}),onClick:()=>{a(b),r({...t,fields:d.filter(t=>t!==e)})},children:(0,o.jsx)(Ve.ItemLabel,{children:(0,s.__)("Hide column")})})]})]})})]}):x}),Ne=Ee;function Fe({item:e,isItemClickable:t,onClickItem:n,renderItemLink:i,className:a,children:s,...l}){if(!t(e))return(0,o.jsx)("div",{className:a,...l,children:s});if(i){const t=i({item:e,className:`${a} ${a}--clickable`,...l,children:s});return(0,r.cloneElement)(t,{onClick:e=>{e.stopPropagation(),t.props.onClick&&t.props.onClick(e)},onKeyDown:e=>{"Enter"!==e.key&&""!==e.key&&" "!==e.key||(e.stopPropagation(),t.props.onKeyDown&&t.props.onKeyDown(e))}})}const u=function({item:e,isItemClickable:t,onClickItem:n,className:i}){return t(e)&&n?{className:i?`${i} ${i}--clickable`:void 0,role:"button",tabIndex:0,onClick:t=>{t.stopPropagation(),n(e)},onKeyDown:t=>{"Enter"!==t.key&&""!==t.key&&" "!==t.key||(t.stopPropagation(),n(e))}}:{className:i}}({item:e,isItemClickable:t,onClickItem:n,className:a});return(0,o.jsx)("div",{...u,...l,children:s})}var Me=function({item:e,level:t,titleField:n,mediaField:r,descriptionField:a,onClickItem:s,renderItemLink:l,isItemClickable:u}){return(0,o.jsxs)(i.__experimentalHStack,{spacing:3,justify:"flex-start",children:[r&&(0,o.jsx)(Fe,{item:e,isItemClickable:u,onClickItem:s,renderItemLink:l,className:"dataviews-view-table__cell-content-wrapper dataviews-column-primary__media","aria-label":u(e)&&(s||l)&&n?n.getValue?.({item:e}):void 0,children:(0,o.jsx)(r.render,{item:e,field:r,config:{sizes:"32px"}})}),(0,o.jsxs)(i.__experimentalVStack,{spacing:0,alignment:"flex-start",className:"dataviews-view-table__primary-column-content",children:[n&&(0,o.jsxs)(Fe,{item:e,isItemClickable:u,onClickItem:s,renderItemLink:l,className:"dataviews-view-table__cell-content-wrapper dataviews-title-field",children:[void 0!==t&&t>0&&(0,o.jsxs)("span",{className:"dataviews-view-table__level",children:["—".repeat(t)," "]}),(0,o.jsx)(n.render,{item:e,field:n})]}),a&&(0,o.jsx)(a.render,{item:e,field:a})]})]})};function Ae(e,t){return e.reduce((e,n)=>{const i=t.getValue({item:n});return e.has(i)||e.set(i,[]),e.get(i)?.push(n),e},new Map)}var Oe=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.Path,{d:"M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z"})});function Pe({field:e,isVisible:t,onToggleVisibility:n}){return(0,o.jsx)(i.__experimentalItem,{onClick:e.enableHiding?n:void 0,children:(0,o.jsxs)(i.__experimentalHStack,{expanded:!0,justify:"flex-start",alignment:"center",children:[(0,o.jsx)("div",{style:{height:24,width:24},children:t&&(0,o.jsx)(i.Icon,{icon:Oe})}),(0,o.jsx)("span",{className:"dataviews-view-config__label",children:e.label})]})})}function Le(e){return!!e}function De({showLabel:e=!0}){const{view:t,fields:n,onChangeView:a}=(0,r.useContext)(W),l=[t?.titleField,t?.mediaField,t?.descriptionField].filter(Boolean),u=n.filter(e=>!l.includes(e.id)&&"media"!==e.type&&!1!==e.enableHiding);if(!u?.length)return null;const c=n.find(e=>e.id===t.titleField),d=n.find(e=>e.id===t.mediaField),f=n.find(e=>e.id===t.descriptionField),m=[{field:c,isVisibleFlag:"showTitle"},{field:d,isVisibleFlag:"showMedia"},{field:f,isVisibleFlag:"showDescription"}].filter(({field:e})=>Le(e)),v=t.fields??[],p=u.filter(e=>v.includes(e.id)).length;let h=m.filter(({field:e,isVisibleFlag:n})=>Le(e)&&(t[n]??!0));const g=h.length+p;1===g&&1===h.length&&(h=h.map(e=>({...e,field:{...e.field,enableHiding:!1}})));const b=m.filter(({field:e,isVisibleFlag:n})=>Le(e)&&!(t[n]??1));return(0,o.jsxs)(i.__experimentalVStack,{className:"dataviews-field-control",spacing:0,children:[e&&(0,o.jsx)(i.BaseControl.VisualLabel,{children:(0,s.__)("Properties")}),(0,o.jsx)(i.__experimentalVStack,{className:"dataviews-view-config__properties",spacing:0,children:(0,o.jsxs)(i.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,size:"medium",children:[h.map(({field:e,isVisibleFlag:n})=>(0,o.jsx)(Pe,{field:e,isVisible:!0,onToggleVisibility:()=>{a({...t,[n]:!1})}},e.id)),b.map(({field:e,isVisibleFlag:n})=>(0,o.jsx)(Pe,{field:e,isVisible:!1,onToggleVisibility:()=>{a({...t,[n]:!0})}},e.id)),u.map(e=>{const n=v.includes(e.id),i=1===g&&n?{...e,enableHiding:!1}:e;return(0,o.jsx)(Pe,{field:i,isVisible:n,onToggleVisibility:()=>{a({...t,fields:n?v.filter(t=>t!==e.id):[...v,e.id]})}},e.id)})]})})]})}function Te({item:e,fields:t,column:n,align:i}){const r=t.find(e=>e.id===n);if(!r)return null;const a=(0,U.A)("dataviews-view-table__cell-content-wrapper",{"dataviews-view-table__cell-align-end":"end"===i,"dataviews-view-table__cell-align-center":"center"===i});return(0,o.jsx)("div",{className:a,children:(0,o.jsx)(r.render,{item:e,field:r})})}function Be({hasBulkActions:e,item:t,level:n,actions:i,fields:a,id:s,view:l,titleField:u,mediaField:c,descriptionField:d,selection:f,getItemId:m,isItemClickable:v,onClickItem:p,renderItemLink:h,onChangeSelection:g,isActionsColumnSticky:b,posinset:x}){const{paginationInfo:w}=(0,r.useContext)(W),y=ve(i,t),_=y&&f.includes(s),[C,j]=(0,r.useState)(!1),{showTitle:S=!0,showMedia:k=!0,showDescription:V=!0,infiniteScrollEnabled:I}=l,E=(0,r.useRef)(!1),N=l.fields??[],F=u&&S||c&&k||d&&V;return(0,o.jsxs)("tr",{className:(0,U.A)("dataviews-view-table__row",{"is-selected":y&&_,"is-hovered":C,"has-bulk-actions":y}),onMouseEnter:()=>{j(!0)},onMouseLeave:()=>{j(!1)},onTouchStart:()=>{E.current=!0},"aria-setsize":I?w.totalItems:void 0,"aria-posinset":x,role:I?"article":void 0,onClick:e=>{y&&(E.current||"Range"===document.getSelection()?.type||(((0,Z.isAppleOS)()?e.metaKey:e.ctrlKey)?g(f.includes(s)?f.filter(e=>s!==e):[...f,s]):g(f.includes(s)?f.filter(e=>s!==e):[s])))},children:[e&&(0,o.jsx)("td",{className:"dataviews-view-table__checkbox-column",children:(0,o.jsx)("div",{className:"dataviews-view-table__cell-content-wrapper",children:(0,o.jsx)(X,{item:t,selection:f,onChangeSelection:g,getItemId:m,titleField:u,disabled:!y})})}),F&&(0,o.jsx)("td",{children:(0,o.jsx)(Me,{item:t,level:n,titleField:S?u:void 0,mediaField:k?c:void 0,descriptionField:V?d:void 0,isItemClickable:v,onClickItem:p,renderItemLink:h})}),N.map(e=>{const{width:n,maxWidth:i,minWidth:r,align:s}=l.layout?.styles?.[e]??{};return(0,o.jsx)("td",{style:{width:n,maxWidth:i,minWidth:r},children:(0,o.jsx)(Te,{fields:a,item:t,column:e,align:s})},e)}),!!i?.length&&(0,o.jsx)("td",{className:(0,U.A)("dataviews-view-table__actions-column",{"dataviews-view-table__actions-column--sticky":!0,"dataviews-view-table__actions-column--stuck":b}),onClick:e=>e.stopPropagation(),children:(0,o.jsx)(ue,{item:t,actions:i})})]})}var ze=(0,r.forwardRef)(({className:e,previewSize:t,...n},i)=>(0,o.jsx)("div",{ref:i,className:(0,U.A)("dataviews-view-grid-items",e),style:{gridTemplateColumns:t&&`repeat(auto-fill, minmax(${t}px, 1fr))`},...n})),{Badge:He}=ne(i.privateApis);function Re({view:e,selection:t,onChangeSelection:n,onClickItem:l,isItemClickable:u,renderItemLink:c,getItemId:d,item:f,actions:m,mediaField:v,titleField:p,descriptionField:h,regularFields:g,badgeFields:b,hasBulkActions:x,config:w,posinset:y}){const{showTitle:_=!0,showMedia:C=!0,showDescription:j=!0,infiniteScrollEnabled:S}=e,k=ve(m,f),V=d(f),I=(0,a.useInstanceId)(Re),E=t.includes(V),N=v?.render?(0,o.jsx)(v.render,{item:f,field:v,config:w}):null,F=_&&p?.render?(0,o.jsx)(p.render,{item:f,field:p}):null,M=C&&N;let A,O;u(f)&&l&&(F?(A={"aria-labelledby":`dataviews-view-grid__title-field-${I}`},O={id:`dataviews-view-grid__title-field-${I}`}):A={"aria-label":(0,s.__)("Navigate to item")});const{paginationInfo:P}=(0,r.useContext)(W);return(0,o.jsxs)(i.__experimentalVStack,{spacing:0,className:(0,U.A)("dataviews-view-grid__card",{"is-selected":k&&E}),onClickCapture:e=>{if((0,Z.isAppleOS)()?e.metaKey:e.ctrlKey){if(e.stopPropagation(),e.preventDefault(),!k)return;n(t.includes(V)?t.filter(e=>V!==e):[...t,V])}},role:S?"article":void 0,"aria-setsize":S?P.totalItems:void 0,"aria-posinset":y,children:[M&&(0,o.jsx)(Fe,{item:f,isItemClickable:u,onClickItem:l,renderItemLink:c,className:"dataviews-view-grid__media",...A,children:N}),x&&M&&(0,o.jsx)(X,{item:f,selection:t,onChangeSelection:n,getItemId:d,titleField:p,disabled:!k}),!_&&M&&!!m?.length&&(0,o.jsx)("div",{className:"dataviews-view-grid__media-actions",children:(0,o.jsx)(ue,{item:f,actions:m,isCompact:!0})}),_&&(0,o.jsxs)(i.__experimentalHStack,{justify:"space-between",className:"dataviews-view-grid__title-actions",children:[(0,o.jsx)(Fe,{item:f,isItemClickable:u,onClickItem:l,renderItemLink:c,className:"dataviews-view-grid__title-field dataviews-title-field",...O,children:F}),!!m?.length&&(0,o.jsx)(ue,{item:f,actions:m,isCompact:!0})]}),(0,o.jsxs)(i.__experimentalVStack,{spacing:1,children:[j&&h?.render&&(0,o.jsx)(h.render,{item:f,field:h}),!!b?.length&&(0,o.jsx)(i.__experimentalHStack,{className:"dataviews-view-grid__badge-fields",spacing:2,wrap:!0,alignment:"top",justify:"flex-start",children:b.map(e=>(0,o.jsx)(He,{className:"dataviews-view-grid__field-value",children:(0,o.jsx)(e.render,{item:f,field:e})},e.id))}),!!g?.length&&(0,o.jsx)(i.__experimentalVStack,{className:"dataviews-view-grid__fields",spacing:1,children:g.map(e=>(0,o.jsx)(i.Flex,{className:"dataviews-view-grid__field",gap:1,justify:"flex-start",expanded:!0,style:{height:"auto"},direction:"row",children:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i.Tooltip,{text:e.label,children:(0,o.jsx)(i.FlexItem,{className:"dataviews-view-grid__field-name",children:e.header})}),(0,o.jsx)(i.FlexItem,{className:"dataviews-view-grid__field-value",style:{maxHeight:"none"},children:(0,o.jsx)(e.render,{item:f,field:e})})]})},e.id))})]})]},V)}var{Menu:$e}=ne(i.privateApis);function We(e){return`${e}-item-wrapper`}function qe(e){return`${e}-dropdown`}function Ke({idPrefix:e,primaryAction:t,item:n}){const a=(0,J.useRegistry)(),[s,l]=(0,r.useState)(!1),u=function(e,t){return`${e}-primary-action-${t}`}(e,t.id),c="string"==typeof t.label?t.label:t.label([n]);return"RenderModal"in t?(0,o.jsx)("div",{role:"gridcell",children:(0,o.jsx)(i.Composite.Item,{id:u,render:(0,o.jsx)(i.Button,{disabled:!!t.disabled,accessibleWhenDisabled:!0,text:c,size:"small",onClick:()=>l(!0)}),children:s&&(0,o.jsx)(le,{action:t,items:[n],closeModal:()=>l(!1)})})},t.id):(0,o.jsx)("div",{role:"gridcell",children:(0,o.jsx)(i.Composite.Item,{id:u,render:(0,o.jsx)(i.Button,{disabled:!!t.disabled,accessibleWhenDisabled:!0,size:"small",onClick:()=>{t.callback([n],{registry:a})},children:c})})},t.id)}function Ge({view:e,actions:t,idPrefix:n,isSelected:a,item:l,titleField:u,mediaField:c,descriptionField:d,onSelect:f,otherFields:m,onDropdownTriggerKeyDown:v,posinset:p}){const{showTitle:h=!0,showMedia:g=!0,showDescription:b=!0,infiniteScrollEnabled:x}=e,w=(0,r.useRef)(null),y=`${n}-label`,_=`${n}-description`,C=(0,J.useRegistry)(),[j,S]=(0,r.useState)(!1),[k,V]=(0,r.useState)(null),I=({type:e})=>{S("mouseenter"===e)},{paginationInfo:E}=(0,r.useContext)(W);(0,r.useEffect)(()=>{a&&w.current?.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"})},[a]);const{primaryAction:N,eligibleActions:F}=(0,r.useMemo)(()=>{const e=t.filter(e=>!e.isEligible||e.isEligible(l));return{primaryAction:e.filter(e=>e.isPrimary)[0],eligibleActions:e}},[t,l]),M=N&&1===t.length,A=g&&c?.render?(0,o.jsx)("div",{className:"dataviews-view-list__media-wrapper",children:(0,o.jsx)(c.render,{item:l,field:c,config:{sizes:"52px"}})}):null,O=h&&u?.render?(0,o.jsx)(u.render,{item:l,field:u}):null,P=F?.length>0&&(0,o.jsxs)(i.__experimentalHStack,{spacing:3,className:"dataviews-view-list__item-actions",children:[N&&(0,o.jsx)(Ke,{idPrefix:n,primaryAction:N,item:l}),!M&&(0,o.jsxs)("div",{role:"gridcell",children:[(0,o.jsxs)($e,{placement:"bottom-end",children:[(0,o.jsx)($e.TriggerButton,{render:(0,o.jsx)(i.Composite.Item,{id:qe(n),render:(0,o.jsx)(i.Button,{size:"small",icon:Q,label:(0,s.__)("Actions"),accessibleWhenDisabled:!0,disabled:!t.length,onKeyDown:v})})}),(0,o.jsx)($e.Popover,{children:(0,o.jsx)(oe,{actions:F,item:l,registry:C,setActiveModalAction:V})})]}),!!k&&(0,o.jsx)(le,{action:k,items:[l],closeModal:()=>V(null)})]})]});return(0,o.jsx)(i.Composite.Row,{ref:w,render:(0,o.jsx)("div",{"aria-posinset":p,"aria-setsize":x?E.totalItems:void 0}),role:x?"article":"row",className:(0,U.A)({"is-selected":a,"is-hovered":j}),onMouseEnter:I,onMouseLeave:I,children:(0,o.jsxs)(i.__experimentalHStack,{className:"dataviews-view-list__item-wrapper",spacing:0,children:[(0,o.jsx)("div",{role:"gridcell",children:(0,o.jsx)(i.Composite.Item,{id:We(n),"aria-pressed":a,"aria-labelledby":y,"aria-describedby":_,className:"dataviews-view-list__item",onClick:()=>f(l)})}),(0,o.jsxs)(i.__experimentalHStack,{spacing:3,justify:"start",alignment:"flex-start",children:[A,(0,o.jsxs)(i.__experimentalVStack,{spacing:1,className:"dataviews-view-list__field-wrapper",children:[(0,o.jsxs)(i.__experimentalHStack,{spacing:0,children:[(0,o.jsx)("div",{className:"dataviews-title-field",id:y,children:O}),P]}),b&&d?.render&&(0,o.jsx)("div",{className:"dataviews-view-list__field",children:(0,o.jsx)(d.render,{item:l,field:d})}),(0,o.jsx)("div",{className:"dataviews-view-list__fields",id:_,children:m.map(e=>(0,o.jsxs)("div",{className:"dataviews-view-list__field",children:[(0,o.jsx)(i.VisuallyHidden,{as:"span",className:"dataviews-view-list__field-label",children:e.label}),(0,o.jsx)("span",{className:"dataviews-view-list__field-value",children:(0,o.jsx)(e.render,{item:l,field:e})})]},e.id))})]})]})]})})}function Ye(e){return!!e}function Ue(e){return(0,r.useMemo)(()=>e?.every(e=>e.supportsBulk),[e])}var{Badge:Ze}=ne(i.privateApis);function Xe({view:e,multiselect:t,selection:n,onChangeSelection:r,getItemId:a,item:l,mediaField:u,titleField:c,descriptionField:d,regularFields:f,badgeFields:m,config:v,posinset:p,setsize:h}){const{showTitle:g=!0,showMedia:b=!0,showDescription:x=!0}=e,w=a(l),y=n.includes(w),_=u?.render?(0,o.jsx)(u.render,{item:l,field:u,config:v}):null,C=g&&c?.render?(0,o.jsx)(c.render,{item:l,field:c}):null;return(0,o.jsxs)(i.Composite.Item,{"aria-label":c?c.getValue({item:l})||(0,s.__)("(no title)"):void 0,render:({children:e,...t})=>(0,o.jsx)(i.__experimentalVStack,{spacing:0,children:e,...t}),role:"option","aria-posinset":p,"aria-setsize":h,className:(0,U.A)("dataviews-view-picker-grid__card",{"is-selected":y}),"aria-selected":y,onClick:()=>{if(y)r(n.filter(e=>w!==e));else{const e=t?[...n,w]:[w];r(e)}},children:[b&&_&&(0,o.jsx)("div",{className:"dataviews-view-picker-grid__media",children:_}),b&&_&&(0,o.jsx)(X,{item:l,selection:n,onChangeSelection:r,getItemId:a,titleField:c,disabled:!1,"aria-hidden":!0,tabIndex:-1}),g&&(0,o.jsx)(i.__experimentalHStack,{justify:"space-between",className:"dataviews-view-picker-grid__title-actions",children:(0,o.jsx)("div",{className:"dataviews-view-picker-grid__title-field dataviews-title-field",children:C})}),(0,o.jsxs)(i.__experimentalVStack,{spacing:1,children:[x&&d?.render&&(0,o.jsx)(d.render,{item:l,field:d}),!!m?.length&&(0,o.jsx)(i.__experimentalHStack,{className:"dataviews-view-picker-grid__badge-fields",spacing:2,wrap:!0,alignment:"top",justify:"flex-start",children:m.map(e=>(0,o.jsx)(Ze,{className:"dataviews-view-picker-grid__field-value",children:(0,o.jsx)(e.render,{item:l,field:e})},e.id))}),!!f?.length&&(0,o.jsx)(i.__experimentalVStack,{className:"dataviews-view-picker-grid__fields",spacing:1,children:f.map(e=>(0,o.jsx)(i.Flex,{className:"dataviews-view-picker-grid__field",gap:1,justify:"flex-start",expanded:!0,style:{height:"auto"},direction:"row",children:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i.FlexItem,{className:"dataviews-view-picker-grid__field-name",children:e.header}),(0,o.jsx)(i.FlexItem,{className:"dataviews-view-picker-grid__field-value",style:{maxHeight:"none"},children:(0,o.jsx)(e.render,{item:l,field:e})})]})},e.id))})]})]},w)}function Qe({groupName:e,groupField:t,children:n}){const r=(0,a.useInstanceId)(Qe,"dataviews-view-picker-grid-group__header");return(0,o.jsxs)(i.__experimentalVStack,{spacing:2,role:"group","aria-labelledby":r,children:[(0,o.jsx)("h3",{className:"dataviews-view-picker-grid-group__header",id:r,children:(0,s.sprintf)(
+// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
+// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
+(0,s.__)("%1$s: %2$s"),t.label,e)}),n]},e)}function Je({item:e,fields:t,column:n,align:i}){const r=t.find(e=>e.id===n);if(!r)return null;const a=(0,U.A)("dataviews-view-table__cell-content-wrapper",{"dataviews-view-table__cell-align-end":"end"===i,"dataviews-view-table__cell-align-center":"center"===i});return(0,o.jsx)("div",{className:a,children:(0,o.jsx)(r.render,{item:e,field:r})})}function et({item:e,fields:t,id:n,view:a,titleField:s,mediaField:l,descriptionField:u,selection:c,getItemId:d,onChangeSelection:f,multiselect:m,posinset:v}){const{paginationInfo:p}=(0,r.useContext)(W),h=c.includes(n),[g,b]=(0,r.useState)(!1),{showTitle:x=!0,showMedia:w=!0,showDescription:y=!0,infiniteScrollEnabled:_}=a,C=()=>{b(!0)},j=()=>{b(!1)},S=a.fields??[],k=s&&x||l&&w||u&&y;return(0,o.jsxs)(i.Composite.Item,{render:({children:e,...t})=>(0,o.jsx)("tr",{className:(0,U.A)("dataviews-view-table__row",{"is-selected":h,"is-hovered":g}),onMouseEnter:C,onMouseLeave:j,children:e,...t}),"aria-selected":h,"aria-setsize":p.totalItems||void 0,"aria-posinset":v,role:_?"article":"option",onClick:()=>{if(h)f(c.filter(e=>n!==e));else{const e=m?[...c,n]:[n];f(e)}},children:[(0,o.jsx)("td",{className:"dataviews-view-table__checkbox-column",role:"presentation",children:(0,o.jsx)("div",{className:"dataviews-view-table__cell-content-wrapper",children:(0,o.jsx)(X,{item:e,selection:c,onChangeSelection:f,getItemId:d,titleField:s,disabled:!1,"aria-hidden":!0,tabIndex:-1})})}),k&&(0,o.jsx)("td",{role:"presentation",children:(0,o.jsx)(Me,{item:e,titleField:x?s:void 0,mediaField:w?l:void 0,descriptionField:y?u:void 0,isItemClickable:()=>!1})}),S.map(n=>{const{width:i,maxWidth:r,minWidth:s,align:l}=a.layout?.styles?.[n]??{};return(0,o.jsx)("td",{style:{width:i,maxWidth:r,minWidth:s},role:"presentation",children:(0,o.jsx)(Je,{fields:t,item:e,column:n,align:l})},n)})]},n)}var tt=[{value:120,breakpoint:1},{value:170,breakpoint:1},{value:230,breakpoint:1},{value:290,breakpoint:1112},{value:350,breakpoint:1636},{value:430,breakpoint:588}];function nt(){const e=(0,r.useContext)(W),t=e.view,n=tt.filter(t=>e.containerWidth>=t.breakpoint),a=t.layout?.previewSize??230,l=n.map((e,t)=>({...e,index:t})).filter(e=>e.value<=a).sort((e,t)=>t.value-e.value)[0]?.index??0,u=n.map((e,t)=>({value:t}));return(0,o.jsx)(i.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,showTooltip:!1,label:(0,s.__)("Preview size"),value:l,min:0,max:n.length-1,withInputField:!1,onChange:(i=0)=>{e.onChangeView({...t,layout:{...t.layout,previewSize:n[i].value}})},step:1,marks:u})}function it(){const e=(0,r.useContext)(W),t=e.view;return(0,o.jsxs)(i.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:(0,s.__)("Density"),value:t.layout?.density||"balanced",onChange:n=>{e.onChangeView({...t,layout:{...t.layout,density:n}})},isBlock:!0,children:[(0,o.jsx)(i.__experimentalToggleGroupControlOption,{value:"comfortable",label:(0,s._x)("Comfortable","Density option for DataView layout")},"comfortable"),(0,o.jsx)(i.__experimentalToggleGroupControlOption,{value:"balanced",label:(0,s._x)("Balanced","Density option for DataView layout")},"balanced"),(0,o.jsx)(i.__experimentalToggleGroupControlOption,{value:"compact",label:(0,s._x)("Compact","Density option for DataView layout")},"compact")]})}var rt=[{type:H,label:(0,s.__)("Table"),component:function({actions:e,data:t,fields:n,getItemId:l,getItemLevel:u,isLoading:c=!1,onChangeView:d,onChangeSelection:f,selection:m,setOpenedFilter:v,onClickItem:p,isItemClickable:h,renderItemLink:g,view:b,className:x,empty:w}){const{containerRef:y}=(0,r.useContext)(W),_=(0,r.useRef)(new Map),C=(0,r.useRef)(),[j,S]=(0,r.useState)(),k=pe(e,t),[V,I]=(0,r.useState)(null);(0,r.useEffect)(()=>{C.current&&(C.current.focus(),C.current=void 0)});const E=(0,r.useId)(),N=function({scrollContainerRef:e,enabled:t=!1}){const[n,i]=(0,r.useState)(!1),l=(0,a.useDebounce)((0,r.useCallback)(()=>{const t=e.current;var n;t&&i((n=t,(0,s.isRTL)()?Math.abs(n.scrollLeft)<=1:n.scrollLeft+n.clientWidth>=n.scrollWidth-1))},[e,i]),200);return(0,r.useEffect)(()=>"undefined"!=typeof window&&t&&e.current?(l(),e.current.addEventListener("scroll",l),window.addEventListener("resize",l),()=>{e.current?.removeEventListener("scroll",l),window.removeEventListener("resize",l)}):()=>{},[e,t]),n}({scrollContainerRef:y,enabled:!!e?.length});if(j)return C.current=j,void S(void 0);const F=e=>{const t=_.current.get(e.id),n=t?_.current.get(t.fallback):void 0;S(n?.node)},M=e=>{e.preventDefault(),e.stopPropagation();const t={getBoundingClientRect:()=>({x:e.clientX,y:e.clientY,top:e.clientY,left:e.clientX,right:e.clientX,bottom:e.clientY,width:0,height:0,toJSON:()=>({})})};window.requestAnimationFrame(()=>{I(t)})},A=!!t?.length,O=n.find(e=>e.id===b.titleField),P=n.find(e=>e.id===b.mediaField),L=n.find(e=>e.id===b.descriptionField),D=b.groupByField?n.find(e=>e.id===b.groupByField):null,B=D?Ae(t,D):null,{showTitle:z=!0,showMedia:H=!0,showDescription:R=!0}=b,$=O&&z||P&&H||L&&R,q=b.fields??[],K=(e,t)=>n=>{n?_.current.set(e,{node:n,fallback:q[t>0?t-1:1]}):_.current.delete(e)},G=b.infiniteScrollEnabled&&!B;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("table",{className:(0,U.A)("dataviews-view-table",x,{[`has-${b.layout?.density}-density`]:b.layout?.density&&["compact","comfortable"].includes(b.layout.density)}),"aria-busy":c,"aria-describedby":E,role:G?"feed":void 0,children:[(0,o.jsxs)("colgroup",{children:[k&&(0,o.jsx)("col",{className:"dataviews-view-table__col-checkbox"}),$&&(0,o.jsx)("col",{className:"dataviews-view-table__col-primary"}),q.map(e=>(0,o.jsx)("col",{className:`dataviews-view-table__col-${e}`},`col-${e}`)),!!e?.length&&(0,o.jsx)("col",{className:"dataviews-view-table__col-actions"})]}),V&&(0,o.jsx)(i.Popover,{anchor:V,onClose:()=>I(null),placement:"bottom-start",children:(0,o.jsx)(De,{showLabel:!1})}),(0,o.jsx)("thead",{onContextMenu:M,children:(0,o.jsxs)("tr",{className:"dataviews-view-table__row",children:[k&&(0,o.jsx)("th",{className:"dataviews-view-table__checkbox-column",scope:"col",onContextMenu:M,children:(0,o.jsx)(he,{selection:m,onChangeSelection:f,data:t,actions:e,getItemId:l})}),$&&(0,o.jsx)("th",{scope:"col",children:O&&(0,o.jsx)(Ne,{ref:K(O.id,0),fieldId:O.id,view:b,fields:n,onChangeView:d,onHide:F,setOpenedFilter:v,canMove:!1})}),q.map((e,t)=>{const{width:i,maxWidth:r,minWidth:a,align:s}=b.layout?.styles?.[e]??{};return(0,o.jsx)("th",{style:{width:i,maxWidth:r,minWidth:a,textAlign:s},"aria-sort":b.sort?.direction&&b.sort?.field===e?T[b.sort.direction]:void 0,scope:"col",children:(0,o.jsx)(Ne,{ref:K(e,t),fieldId:e,view:b,fields:n,onChangeView:d,onHide:F,setOpenedFilter:v,canMove:b.layout?.enableMoving??!0})},e)}),!!e?.length&&(0,o.jsx)("th",{className:(0,U.A)("dataviews-view-table__actions-column",{"dataviews-view-table__actions-column--sticky":!0,"dataviews-view-table__actions-column--stuck":!N}),children:(0,o.jsx)("span",{className:"dataviews-view-table-header",children:(0,s.__)("Actions")})})]})}),A&&D&&B?Array.from(B.entries()).map(([t,i])=>(0,o.jsxs)("tbody",{children:[(0,o.jsx)("tr",{className:"dataviews-view-table__group-header-row",children:(0,o.jsx)("td",{colSpan:q.length+($?1:0)+(k?1:0)+(e?.length?1:0),className:"dataviews-view-table__group-header-cell",children:(0,s.sprintf)(
+// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
+// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
+(0,s.__)("%1$s: %2$s"),D.label,t)})}),i.map((t,i)=>(0,o.jsx)(Be,{item:t,level:b.showLevels&&"function"==typeof u?u(t):void 0,hasBulkActions:k,actions:e,fields:n,id:l(t)||i.toString(),view:b,titleField:O,mediaField:P,descriptionField:L,selection:m,getItemId:l,onChangeSelection:f,onClickItem:p,renderItemLink:g,isItemClickable:h,isActionsColumnSticky:!N},l(t)))]},`group-${t}`)):(0,o.jsx)("tbody",{children:A&&t.map((t,i)=>(0,o.jsx)(Be,{item:t,level:b.showLevels&&"function"==typeof u?u(t):void 0,hasBulkActions:k,actions:e,fields:n,id:l(t)||i.toString(),view:b,titleField:O,mediaField:P,descriptionField:L,selection:m,getItemId:l,onChangeSelection:f,onClickItem:p,renderItemLink:g,isItemClickable:h,isActionsColumnSticky:!N,posinset:G?i+1:void 0},l(t)))})]}),(0,o.jsxs)("div",{className:(0,U.A)({"dataviews-loading":c,"dataviews-no-results":!A&&!c}),id:E,children:[!A&&(c?(0,o.jsx)("p",{children:(0,o.jsx)(i.Spinner,{})}):w),A&&c&&(0,o.jsx)("p",{className:"dataviews-loading-more",children:(0,o.jsx)(i.Spinner,{})})]})]})},icon:q,viewConfigOptions:it},{type:R,label:(0,s.__)("Grid"),component:function({actions:e,data:t,fields:n,getItemId:a,isLoading:l,onChangeSelection:u,onClickItem:c,isItemClickable:d,renderItemLink:f,selection:m,view:v,className:p,empty:h}){const{resizeObserverRef:g}=(0,r.useContext)(W),b=n.find(e=>e.id===v?.titleField),x=n.find(e=>e.id===v?.mediaField),w=n.find(e=>e.id===v?.descriptionField),y=v.fields??[],{regularFields:_,badgeFields:C}=y.reduce((e,t)=>{const i=n.find(e=>e.id===t);return i?(e[v.layout?.badgeFields?.includes(t)?"badgeFields":"regularFields"].push(i),e):e},{regularFields:[],badgeFields:[]}),j=!!t?.length,S=pe(e,t),k=v.layout?.previewSize,V="900px",I=v.groupByField?n.find(e=>e.id===v.groupByField):null,E=I?Ae(t,I):null,N=v.infiniteScrollEnabled&&!E;return(0,o.jsxs)(o.Fragment,{children:[j&&I&&E&&(0,o.jsx)(i.__experimentalVStack,{spacing:4,children:Array.from(E.entries()).map(([t,n])=>(0,o.jsxs)(i.__experimentalVStack,{spacing:2,children:[(0,o.jsx)("h3",{className:"dataviews-view-grid__group-header",children:(0,s.sprintf)(
+// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
+// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
+(0,s.__)("%1$s: %2$s"),I.label,t)}),(0,o.jsx)(ze,{className:(0,U.A)("dataviews-view-grid",p),previewSize:k,"aria-busy":l,ref:g,children:n.map(t=>(0,o.jsx)(Re,{view:v,selection:m,onChangeSelection:u,onClickItem:c,isItemClickable:d,renderItemLink:f,getItemId:a,item:t,actions:e,mediaField:x,titleField:b,descriptionField:w,regularFields:_,badgeFields:C,hasBulkActions:S,config:{sizes:V}},a(t)))})]},t))}),j&&!E&&(0,o.jsx)(ze,{className:(0,U.A)("dataviews-view-grid",p),previewSize:k,"aria-busy":l,ref:g,role:N?"feed":void 0,children:t.map((t,n)=>(0,o.jsx)(Re,{view:v,selection:m,onChangeSelection:u,onClickItem:c,isItemClickable:d,renderItemLink:f,getItemId:a,item:t,actions:e,mediaField:x,titleField:b,descriptionField:w,regularFields:_,badgeFields:C,hasBulkActions:S,config:{sizes:V},posinset:N?n+1:void 0},a(t)))}),!j&&(0,o.jsx)("div",{className:(0,U.A)({"dataviews-loading":l,"dataviews-no-results":!l}),children:l?(0,o.jsx)("p",{children:(0,o.jsx)(i.Spinner,{})}):h}),j&&l&&(0,o.jsx)("p",{className:"dataviews-loading-more",children:(0,o.jsx)(i.Spinner,{})})]})},icon:K,viewConfigOptions:nt},{type:"list",label:(0,s.__)("List"),component:function e(t){const{actions:n,data:l,fields:u,getItemId:c,isLoading:d,onChangeSelection:f,selection:m,view:v,className:p,empty:h}=t,g=(0,a.useInstanceId)(e,"view-list"),b=l?.findLast(e=>m.includes(c(e))),x=u.find(e=>e.id===v.titleField),w=u.find(e=>e.id===v.mediaField),y=u.find(e=>e.id===v.descriptionField),_=(v?.fields??[]).map(e=>u.find(t=>e===t.id)).filter(Ye),C=e=>f([c(e)]),j=(0,r.useCallback)(e=>`${g}-${c(e)}`,[g,c]),S=(0,r.useCallback)((e,t)=>t.startsWith(j(e)),[j]),[k,V]=(0,r.useState)(void 0);(0,r.useEffect)(()=>{b&&V(We(j(b)))},[b,j]);const I=l.findIndex(e=>S(e,k??"")),E=(0,a.usePrevious)(I),N=-1!==I,F=(0,r.useCallback)((e,t)=>{const n=Math.min(l.length-1,Math.max(0,e));if(!l[n])return;const i=t(j(l[n]));V(i),document.getElementById(i)?.focus()},[l,j]);(0,r.useEffect)(()=>{!N&&void 0!==E&&-1!==E&&F(E,We)},[N,F,E]);const M=(0,r.useCallback)(e=>{"ArrowDown"===e.key&&(e.preventDefault(),F(I+1,qe)),"ArrowUp"===e.key&&(e.preventDefault(),F(I-1,qe))},[F,I]),A=l?.length;if(!A)return(0,o.jsx)("div",{className:(0,U.A)({"dataviews-loading":d,"dataviews-no-results":!A&&!d}),children:!A&&(d?(0,o.jsx)("p",{children:(0,o.jsx)(i.Spinner,{})}):h)});const O=v.groupByField?u.find(e=>e.id===v.groupByField):null,P=O?Ae(l,O):null;return A&&O&&P?(0,o.jsx)(i.Composite,{id:`${g}`,render:(0,o.jsx)("div",{}),className:"dataviews-view-list__group",role:"grid",activeId:k,setActiveId:V,children:(0,o.jsx)(i.__experimentalVStack,{spacing:4,className:(0,U.A)("dataviews-view-list",p),children:Array.from(P.entries()).map(([e,t])=>(0,o.jsxs)(i.__experimentalVStack,{spacing:2,children:[(0,o.jsx)("h3",{className:"dataviews-view-list__group-header",children:(0,s.sprintf)(
+// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
+// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
+(0,s.__)("%1$s: %2$s"),O.label,e)}),t.map(e=>{const t=j(e);return(0,o.jsx)(Ge,{view:v,idPrefix:t,actions:n,item:e,isSelected:e===b,onSelect:C,mediaField:w,titleField:x,descriptionField:y,otherFields:_,onDropdownTriggerKeyDown:M},t)})]},e))})}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i.Composite,{id:g,render:(0,o.jsx)("div",{}),className:(0,U.A)("dataviews-view-list",p),role:v.infiniteScrollEnabled?"feed":"grid",activeId:k,setActiveId:V,children:l.map((e,t)=>{const i=j(e);return(0,o.jsx)(Ge,{view:v,idPrefix:i,actions:n,item:e,isSelected:e===b,onSelect:C,mediaField:w,titleField:x,descriptionField:y,otherFields:_,onDropdownTriggerKeyDown:M,posinset:v.infiniteScrollEnabled?t+1:void 0},i)})}),A&&d&&(0,o.jsx)("p",{className:"dataviews-loading-more",children:(0,o.jsx)(i.Spinner,{})})]})},icon:(0,s.isRTL)()?G:Y},{type:"pickerGrid",label:(0,s.__)("Grid"),component:function({actions:e,data:t,fields:n,getItemId:a,isLoading:s,onChangeSelection:l,selection:u,view:c,className:d,empty:f}){const{resizeObserverRef:m,paginationInfo:v,itemListLabel:p}=(0,r.useContext)(W),h=n.find(e=>e.id===c?.titleField),g=n.find(e=>e.id===c?.mediaField),b=n.find(e=>e.id===c?.descriptionField),x=c.fields??[],{regularFields:w,badgeFields:y}=x.reduce((e,t)=>{const i=n.find(e=>e.id===t);return i?(e[c.layout?.badgeFields?.includes(t)?"badgeFields":"regularFields"].push(i),e):e},{regularFields:[],badgeFields:[]}),_=!!t?.length,C=c.layout?.previewSize,j=Ue(e),S="900px",k=c.groupByField?n.find(e=>e.id===c.groupByField):null,V=k?Ae(t,k):null,I=c.infiniteScrollEnabled&&!V,E=c?.page??1,N=c?.perPage??0,F=I?v?.totalItems:void 0;return(0,o.jsxs)(o.Fragment,{children:[_&&k&&V&&(0,o.jsx)(i.Composite,{virtualFocus:!0,orientation:"horizontal",role:"listbox","aria-multiselectable":j,className:(0,U.A)("dataviews-view-picker-grid",d),"aria-label":p,render:({children:e,...t})=>(0,o.jsx)(i.__experimentalVStack,{spacing:4,children:e,...t}),children:Array.from(V.entries()).map(([e,n])=>(0,o.jsx)(Qe,{groupName:e,groupField:k,children:(0,o.jsx)(ze,{previewSize:C,style:{gridTemplateColumns:C&&`repeat(auto-fill, minmax(${C}px, 1fr))`},"aria-busy":s,ref:m,children:n.map(e=>{const n=(E-1)*N+t.indexOf(e)+1;return(0,o.jsx)(Xe,{view:c,multiselect:j,selection:u,onChangeSelection:l,getItemId:a,item:e,mediaField:g,titleField:h,descriptionField:b,regularFields:w,badgeFields:y,config:{sizes:S},posinset:n,setsize:F},a(e))})})},e))}),_&&!V&&(0,o.jsx)(i.Composite,{render:(0,o.jsx)(ze,{className:(0,U.A)("dataviews-view-picker-grid",d),previewSize:C,"aria-busy":s,ref:m}),virtualFocus:!0,orientation:"horizontal",role:"listbox","aria-multiselectable":j,"aria-label":p,children:t.map((e,t)=>{let n=I?t+1:void 0;return I||(n=(E-1)*N+t+1),(0,o.jsx)(Xe,{view:c,multiselect:j,selection:u,onChangeSelection:l,getItemId:a,item:e,mediaField:g,titleField:h,descriptionField:b,regularFields:w,badgeFields:y,config:{sizes:S},posinset:n,setsize:F},a(e))})}),!_&&(0,o.jsx)("div",{className:(0,U.A)({"dataviews-loading":s,"dataviews-no-results":!s}),children:s?(0,o.jsx)("p",{children:(0,o.jsx)(i.Spinner,{})}):f}),_&&s&&(0,o.jsx)("p",{className:"dataviews-loading-more",children:(0,o.jsx)(i.Spinner,{})})]})},icon:K,viewConfigOptions:nt,isPicker:!0},{type:"pickerTable",label:(0,s.__)("Table"),component:function({actions:e,data:t,fields:n,getItemId:a,isLoading:l=!1,onChangeView:u,onChangeSelection:c,selection:d,setOpenedFilter:f,view:m,className:v,empty:p}){const h=(0,r.useRef)(new Map),g=(0,r.useRef)(),[b,x]=(0,r.useState)(),w=Ue(e)??!1;(0,r.useEffect)(()=>{g.current&&(g.current.focus(),g.current=void 0)});const y=(0,r.useId)();if(b)return g.current=b,void x(void 0);const _=e=>{const t=h.current.get(e.id),n=t?h.current.get(t.fallback):void 0;x(n?.node)},C=!!t?.length,j=n.find(e=>e.id===m.titleField),S=n.find(e=>e.id===m.mediaField),k=n.find(e=>e.id===m.descriptionField),V=m.groupByField?n.find(e=>e.id===m.groupByField):null,I=V?Ae(t,V):null,{showTitle:E=!0,showMedia:N=!0,showDescription:F=!0}=m,M=j&&E||S&&N||k&&F,A=m.fields??[],O=(e,t)=>n=>{n?h.current.set(e,{node:n,fallback:A[t>0?t-1:1]}):h.current.delete(e)},P=m.infiniteScrollEnabled&&!I;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("table",{className:(0,U.A)("dataviews-view-table","dataviews-view-picker-table",v,{[`has-${m.layout?.density}-density`]:m.layout?.density&&["compact","comfortable"].includes(m.layout.density)}),"aria-busy":l,"aria-describedby":y,role:P?"feed":"listbox",children:[(0,o.jsx)("thead",{role:"presentation",children:(0,o.jsxs)("tr",{className:"dataviews-view-table__row",role:"presentation",children:[(0,o.jsx)("th",{className:"dataviews-view-table__checkbox-column",children:w&&(0,o.jsx)(he,{selection:d,onChangeSelection:c,data:t,actions:e,getItemId:a})}),M&&(0,o.jsx)("th",{children:j&&(0,o.jsx)(Ne,{ref:O(j.id,0),fieldId:j.id,view:m,fields:n,onChangeView:u,onHide:_,setOpenedFilter:f,canMove:!1})}),A.map((e,t)=>{const{width:i,maxWidth:r,minWidth:a,align:s}=m.layout?.styles?.[e]??{};return(0,o.jsx)("th",{style:{width:i,maxWidth:r,minWidth:a,textAlign:s},"aria-sort":m.sort?.direction&&m.sort?.field===e?T[m.sort.direction]:void 0,scope:"col",children:(0,o.jsx)(Ne,{ref:O(e,t),fieldId:e,view:m,fields:n,onChangeView:u,onHide:_,setOpenedFilter:f,canMove:m.layout?.enableMoving??!0})},e)})]})}),C&&V&&I?Array.from(I.entries()).map(([e,t])=>(0,o.jsxs)(i.Composite,{virtualFocus:!0,orientation:"vertical",render:(0,o.jsx)("tbody",{role:"group"}),children:[(0,o.jsx)("tr",{className:"dataviews-view-table__group-header-row",role:"presentation",children:(0,o.jsx)("td",{colSpan:A.length+(M?1:0)+1,className:"dataviews-view-table__group-header-cell",role:"presentation",children:(0,s.sprintf)(
+// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
+// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
+(0,s.__)("%1$s: %2$s"),V.label,e)})}),t.map((e,t)=>(0,o.jsx)(et,{item:e,fields:n,id:a(e)||t.toString(),view:m,titleField:j,mediaField:S,descriptionField:k,selection:d,getItemId:a,onChangeSelection:c,multiselect:w},a(e)))]},`group-${e}`)):(0,o.jsx)(i.Composite,{render:(0,o.jsx)("tbody",{role:"presentation"}),virtualFocus:!0,orientation:"vertical",children:C&&t.map((e,t)=>(0,o.jsx)(et,{item:e,fields:n,id:a(e)||t.toString(),view:m,titleField:j,mediaField:S,descriptionField:k,selection:d,getItemId:a,onChangeSelection:c,multiselect:w,posinset:t+1},a(e)))})]}),(0,o.jsxs)("div",{className:(0,U.A)({"dataviews-loading":l,"dataviews-no-results":!C&&!l}),id:y,children:[!C&&(l?(0,o.jsx)("p",{children:(0,o.jsx)(i.Spinner,{})}):p),C&&l&&(0,o.jsx)("p",{className:"dataviews-loading-more",children:(0,o.jsx)(i.Spinner,{})})]})]})},icon:q,viewConfigOptions:it,isPicker:!0}],{Menu:at}=ne(i.privateApis);function st({filters:e,view:t,onChangeView:n,setOpenedFilter:i,triggerProps:r}){const a=e.filter(e=>!e.isVisible);return(0,o.jsxs)(at,{children:[(0,o.jsx)(at.TriggerButton,{...r}),(0,o.jsx)(at.Popover,{children:a.map(e=>(0,o.jsx)(at.Item,{onClick:()=>{i(e.field),n({...t,page:1,filters:[...t.filters||[],{field:e.field,value:void 0,operator:e.operators[0]}]})},children:(0,o.jsx)(at.ItemLabel,{children:e.name})},e.field))})]})}var lt=(0,r.forwardRef)(function({filters:e,view:t,onChangeView:n,setOpenedFilter:r},a){if(!e.length||e.every(({isPrimary:e})=>e))return null;const l=e.filter(e=>!e.isVisible);return(0,o.jsx)(st,{triggerProps:{render:(0,o.jsx)(i.Button,{accessibleWhenDisabled:!0,size:"compact",className:"dataviews-filters-button",variant:"tertiary",disabled:!l.length,ref:a}),children:(0,s.__)("Add filter")},filters:e,view:t,onChangeView:n,setOpenedFilter:r})});function ot({buttonRef:e,filtersCount:t,children:n}){return(0,r.useEffect)(()=>()=>{e.current?.focus()},[e]),(0,o.jsxs)(o.Fragment,{children:[n,!!t&&(0,o.jsx)("span",{className:"dataviews-filters-toggle__count",children:t})]})}var ut=function(){const{filters:e,view:t,onChangeView:n,setOpenedFilter:a,isShowingFilter:l,setIsShowingFilter:u}=(0,r.useContext)(W),c=(0,r.useRef)(null),d=(0,r.useCallback)(e=>{n(e),u(!0)},[n,u]),f=!!e.filter(e=>e.isVisible).length;if(0===e.length)return null;const m={label:(0,s.__)("Add filter"),"aria-expanded":!1,isPressed:!1},v={label:(0,s._x)("Filter","verb"),"aria-expanded":l,isPressed:l,onClick:()=>{l||a(null),u(!l)}},p=(0,o.jsx)(i.Button,{ref:c,className:"dataviews-filters__visibility-toggle",size:"compact",icon:Ce,...f?v:m});return(0,o.jsx)("div",{className:"dataviews-filters__container-visibility-toggle",children:f?(0,o.jsx)(ot,{buttonRef:c,filtersCount:t.filters?.length,children:p}):(0,o.jsx)(st,{filters:e,view:t,onChangeView:d,setOpenedFilter:a,triggerProps:{render:p}})})},ct=Object.defineProperty,dt=Object.defineProperties,ft=Object.getOwnPropertyDescriptors,mt=Object.getOwnPropertySymbols,vt=Object.prototype.hasOwnProperty,pt=Object.prototype.propertyIsEnumerable,ht=(e,t,n)=>t in e?ct(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gt=(e,t)=>{for(var n in t||(t={}))vt.call(t,n)&&ht(e,n,t[n]);if(mt)for(var n of mt(t))pt.call(t,n)&&ht(e,n,t[n]);return e},bt=(e,t)=>dt(e,ft(t)),xt=(e,t)=>{var n={};for(var i in e)vt.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&mt)for(var i of mt(e))t.indexOf(i)<0&&pt.call(e,i)&&(n[i]=e[i]);return n},wt=Object.defineProperty,yt=Object.defineProperties,_t=Object.getOwnPropertyDescriptors,Ct=Object.getOwnPropertySymbols,jt=Object.prototype.hasOwnProperty,St=Object.prototype.propertyIsEnumerable,kt=(e,t,n)=>t in e?wt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Vt=(e,t)=>{for(var n in t||(t={}))jt.call(t,n)&&kt(e,n,t[n]);if(Ct)for(var n of Ct(t))St.call(t,n)&&kt(e,n,t[n]);return e},It=(e,t)=>yt(e,_t(t)),Et=(e,t)=>{var n={};for(var i in e)jt.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&Ct)for(var i of Ct(e))t.indexOf(i)<0&&St.call(e,i)&&(n[i]=e[i]);return n};function Nt(...e){}function Ft(e,t){return"function"==typeof Object.hasOwn?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function Mt(...e){return(...t)=>{for(const n of e)"function"==typeof n&&n(...t)}}function At(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function Ot(e){return e}function Pt(e,t){if(!e){if("string"!=typeof t)throw new Error("Invariant failed");throw new Error(t)}}function Lt(e){return e.disabled||!0===e["aria-disabled"]||"true"===e["aria-disabled"]}function Dt(e){const t={};for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}function Tt(...e){for(const t of e)if(void 0!==t)return t}var Bt=n(609),zt=n.t(Bt,2);function Ht(e,t){"function"==typeof e?e(t):e&&(e.current=t)}var Rt,$t="undefined"!=typeof window&&!!(null==(Rt=window.document)?void 0:Rt.createElement);function Wt(e){return e?"self"in e?e.document:e.ownerDocument||document:document}function qt(e,t=!1){const{activeElement:n}=Wt(e);if(!(null==n?void 0:n.nodeName))return null;if("IFRAME"===n.tagName&&n.contentDocument)return qt(n.contentDocument.body,t);if(t){const e=n.getAttribute("aria-activedescendant");if(e){const t=Wt(n).getElementById(e);if(t)return t}}return n}function Kt(e,t){return e===t||e.contains(t)}function Gt(e){const t=e.tagName.toLowerCase();return"button"===t||!("input"!==t||!e.type)&&-1!==Yt.indexOf(e.type)}var Yt=["button","color","file","image","reset","submit"];function Ut(e){try{const t=e instanceof HTMLInputElement&&null!==e.selectionStart,n="TEXTAREA"===e.tagName;return t||n||!1}catch(e){return!1}}function Zt(e){return e.isContentEditable||Ut(e)}function Xt(e){let t=0,n=0;if(Ut(e))t=e.selectionStart||0,n=e.selectionEnd||0;else if(e.isContentEditable){const i=Wt(e).getSelection();if((null==i?void 0:i.rangeCount)&&i.anchorNode&&Kt(e,i.anchorNode)&&i.focusNode&&Kt(e,i.focusNode)){const r=i.getRangeAt(0),a=r.cloneRange();a.selectNodeContents(e),a.setEnd(r.startContainer,r.startOffset),t=a.toString().length,a.setEnd(r.endContainer,r.endOffset),n=a.toString().length}}return{start:t,end:n}}function Qt(e,t){const n=null==e?void 0:e.getAttribute("role");return n&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(n)?n:t}function Jt(e){if(!e)return null;const t=e=>"auto"===e||"scroll"===e;if(e.clientHeight&&e.scrollHeight>e.clientHeight){const{overflowY:n}=getComputedStyle(e);if(t(n))return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){const{overflowX:n}=getComputedStyle(e);if(t(n))return e}return Jt(e.parentElement)||document.scrollingElement||document.body}function en(e,...t){/text|search|password|tel|url/i.test(e.type)&&e.setSelectionRange(...t)}function tn(){return!!$t&&/mac|iphone|ipad|ipod/i.test(navigator.platform)}function nn(){return $t&&tn()&&/apple/i.test(navigator.vendor)}function rn(e){return Boolean(e.currentTarget&&!Kt(e.currentTarget,e.target))}function an(e){return e.target===e.currentTarget}function sn(e,t){const n=new FocusEvent("blur",t),i=e.dispatchEvent(n),r=It(Vt({},t),{bubbles:!0});return e.dispatchEvent(new FocusEvent("focusout",r)),i}function ln(e,t){const n=new MouseEvent("click",t);return e.dispatchEvent(n)}function on(e,t){const n=t||e.currentTarget,i=e.relatedTarget;return!i||!Kt(n,i)}function un(e,t,n,i){const r=(e=>{if(i){const t=setTimeout(e,i);return()=>clearTimeout(t)}const t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})(()=>{e.removeEventListener(t,a,!0),n()}),a=()=>{r(),n()};return e.addEventListener(t,a,{once:!0,capture:!0}),r}function cn(e,t,n,i=window){const r=[];try{i.document.addEventListener(e,t,n);for(const a of Array.from(i.frames))r.push(cn(e,t,n,a))}catch(e){}return()=>{try{i.document.removeEventListener(e,t,n)}catch(e){}for(const e of r)e()}}var dn=gt({},zt),fn=dn.useId,mn=(dn.useDeferredValue,dn.useInsertionEffect),vn=$t?Bt.useLayoutEffect:Bt.useEffect;function pn(e){const t=(0,Bt.useRef)(()=>{throw new Error("Cannot call an event handler while rendering.")});return mn?mn(()=>{t.current=e}):t.current=e,(0,Bt.useCallback)((...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)},[])}function hn(...e){return(0,Bt.useMemo)(()=>{if(e.some(Boolean))return t=>{for(const n of e)Ht(n,t)}},e)}function gn(e){if(fn){const t=fn();return e||t}const[t,n]=(0,Bt.useState)(e);return vn(()=>{if(e||t)return;const i=Math.random().toString(36).slice(2,8);n(`id-${i}`)},[e,t]),e||t}function bn(e,t){const n=(0,Bt.useRef)(!1);(0,Bt.useEffect)(()=>{if(n.current)return e();n.current=!0},t),(0,Bt.useEffect)(()=>()=>{n.current=!1},[])}function xn(e){return pn("function"==typeof e?e:()=>e)}function wn(e,t,n=[]){const i=(0,Bt.useCallback)(n=>(e.wrapElement&&(n=e.wrapElement(n)),t(n)),[...n,e.wrapElement]);return bt(gt({},e),{wrapElement:i})}var yn=!1,Cn=!1,jn=0,Sn=0;function kn(e){(function(e){const t=e.movementX||e.screenX-jn,n=e.movementY||e.screenY-Sn;return jn=e.screenX,Sn=e.screenY,t||n||!1})(e)&&(Cn=!0)}function Vn(){Cn=!1}function In(e){const t=Bt.forwardRef((t,n)=>e(bt(gt({},t),{ref:n})));return t.displayName=e.displayName||e.name,t}function En(e,t){return Bt.memo(e,t)}function Nn(e,t){const n=t,{wrapElement:i,render:r}=n,a=xt(n,["wrapElement","render"]),s=hn(t.ref,function(e){return function(e){return!!e&&!!(0,Bt.isValidElement)(e)&&("ref"in e.props||"ref"in e)}(e)?gt({},e.props).ref||e.ref:null}(r));let l;if(Bt.isValidElement(r)){const e=bt(gt({},r.props),{ref:s});l=Bt.cloneElement(r,function(e,t){const n=gt({},e);for(const i in t){if(!Ft(t,i))continue;if("className"===i){const i="className";n[i]=e[i]?`${e[i]} ${t[i]}`:t[i];continue}if("style"===i){const i="style";n[i]=e[i]?gt(gt({},e[i]),t[i]):t[i];continue}const r=t[i];if("function"==typeof r&&i.startsWith("on")){const t=e[i];if("function"==typeof t){n[i]=(...e)=>{r(...e),t(...e)};continue}}n[i]=r}return n}(a,e))}else l=r?r(a):(0,o.jsx)(e,gt({},a));return i?i(l):l}function Fn(e){const t=(t={})=>e(t);return t.displayName=e.name,t}function Mn(e=[],t=[]){const n=Bt.createContext(void 0),i=Bt.createContext(void 0),r=()=>Bt.useContext(n),a=t=>e.reduceRight((e,n)=>(0,o.jsx)(n,bt(gt({},t),{children:e})),(0,o.jsx)(n.Provider,gt({},t)));return{context:n,scopedContext:i,useContext:r,useScopedContext:(e=!1)=>{const t=Bt.useContext(i),n=r();return e?t:t||n},useProviderContext:()=>{const e=Bt.useContext(i),t=r();if(!e||e!==t)return t},ContextProvider:a,ScopedContextProvider:e=>(0,o.jsx)(a,bt(gt({},e),{children:t.reduceRight((t,n)=>(0,o.jsx)(n,bt(gt({},e),{children:t})),(0,o.jsx)(i.Provider,gt({},e)))}))}}var An=Mn(),On=An.useContext,Pn=(An.useScopedContext,An.useProviderContext,Mn([An.ContextProvider],[An.ScopedContextProvider])),Ln=Pn.useContext,Dn=(Pn.useScopedContext,Pn.useProviderContext),Tn=Pn.ContextProvider,Bn=Pn.ScopedContextProvider,zn=(0,Bt.createContext)(void 0),Hn=(0,Bt.createContext)(void 0),Rn=((0,Bt.createContext)(null),(0,Bt.createContext)(null),Mn([Tn],[Bn])),$n=Rn.useContext;function Wn(e,t){const n=e.__unstableInternals;return Pt(n,"Invalid store"),n[t]}function qn(e,...t){let n=e,i=n,r=Symbol(),a=Nt;const s=new Set,l=new Set,o=new Set,u=new Set,c=new Set,d=new WeakMap,f=new WeakMap,m=(e,t,n=u)=>(n.add(t),f.set(t,e),()=>{var e;null==(e=d.get(t))||e(),d.delete(t),f.delete(t),n.delete(t)}),v=(e,a,s=!1)=>{var o;if(!Ft(n,e))return;const m=(v=a,p=n[e],function(e){return"function"==typeof e}(v)?v(function(e){return"function"==typeof e}(p)?p():p):v);var v,p;if(m===n[e])return;if(!s)for(const n of t)null==(o=null==n?void 0:n.setState)||o.call(n,e,m);const h=n;n=It(Vt({},n),{[e]:m});const g=Symbol();r=g,l.add(e);const b=(t,i,r)=>{var a;const s=f.get(t);s&&!s.some(t=>r?r.has(t):t===e)||(null==(a=d.get(t))||a(),d.set(t,t(n,i)))};for(const e of u)b(e,h);queueMicrotask(()=>{if(r!==g)return;const e=n;for(const e of c)b(e,i,l);i=e,l.clear()})},p={getState:()=>n,setState:v,__unstableInternals:{setup:e=>(o.add(e),()=>o.delete(e)),init:()=>{const e=s.size,i=Symbol();s.add(i);const r=()=>{s.delete(i),s.size||a()};if(e)return r;const l=(u=n,Object.keys(u)).map(e=>Mt(...t.map(t=>{var n;const i=null==(n=null==t?void 0:t.getState)?void 0:n.call(t);if(i&&Ft(i,e))return Un(t,[e],t=>{v(e,t[e],!0)})})));var u;const c=[];for(const e of o)c.push(e());const d=t.map(Gn);return a=Mt(...l,...c,...d),r},subscribe:(e,t)=>m(e,t),sync:(e,t)=>(d.set(t,t(n,n)),m(e,t)),batch:(e,t)=>(d.set(t,t(n,i)),m(e,t,c)),pick:e=>qn(function(e,t){const n={};for(const i of t)Ft(e,i)&&(n[i]=e[i]);return n}(n,e),p),omit:e=>qn(function(e,t){const n=Vt({},e);for(const e of t)Ft(n,e)&&delete n[e];return n}(n,e),p)}};return p}function Kn(e,...t){if(e)return Wn(e,"setup")(...t)}function Gn(e,...t){if(e)return Wn(e,"init")(...t)}function Yn(e,...t){if(e)return Wn(e,"subscribe")(...t)}function Un(e,...t){if(e)return Wn(e,"sync")(...t)}function Zn(e,...t){if(e)return Wn(e,"batch")(...t)}function Xn(e,...t){if(e)return Wn(e,"omit")(...t)}function Qn(...e){var t;const n={};for(const i of e){const e=null==(t=null==i?void 0:i.getState)?void 0:t.call(i);e&&Object.assign(n,e)}const i=qn(n,...e);return Object.assign({},...e,i)}Rn.useScopedContext,Rn.useProviderContext,Rn.ContextProvider,Rn.ScopedContextProvider;var Jn=n(888),{useSyncExternalStore:ei}=Jn;function ti(e,t=Ot){const n=Bt.useCallback(t=>e?Yn(e,null,t):()=>{},[e]),i=()=>{const n="string"==typeof t?t:null,i="function"==typeof t?t:null,r=null==e?void 0:e.getState();return i?i(r):r&&n&&Ft(r,n)?r[n]:void 0};return ei(n,i,i)}function ni(e,t){const n=Bt.useRef({}),i=Bt.useCallback(t=>e?Yn(e,null,t):()=>{},[e]),r=()=>{const i=null==e?void 0:e.getState();let r=!1;const a=n.current;for(const e in t){const n=t[e];if("function"==typeof n){const t=n(i);t!==a[e]&&(a[e]=t,r=!0)}if("string"==typeof n){if(!i)continue;if(!Ft(i,n))continue;const t=i[n];t!==a[e]&&(a[e]=t,r=!0)}}return r&&(n.current=gt({},a)),n.current};return ei(i,r,r)}function ii(e,t,n,i){const r=Ft(t,n)?t[n]:void 0,a=i?t[i]:void 0,s=function(e){const t=(0,Bt.useRef)(e);return vn(()=>{t.current=e}),t}({value:r,setValue:a});vn(()=>Un(e,[n],(e,t)=>{const{value:i,setValue:r}=s.current;r&&e[n]!==t[n]&&e[n]!==i&&r(e[n])}),[e,n]),vn(()=>{if(void 0!==r)return e.setState(n,r),Zn(e,[n],()=>{void 0!==r&&e.setState(n,r)})})}function ri(e,t,n){return function(e,t,n){return bn(t,[n.store,n.disclosure]),ii(e,n,"open","setOpen"),ii(e,n,"mounted","setMounted"),ii(e,n,"animated"),Object.assign(e,{disclosure:n.disclosure})}(e,t,n)}function ai(e,t,n){return ii(e=function(e,t,n){return bn(t,[n.store]),ii(e,n,"items","setItems"),e}(e,t,n),n,"activeId","setActiveId"),ii(e,n,"includesBaseElement"),ii(e,n,"virtualFocus"),ii(e,n,"orientation"),ii(e,n,"rtl"),ii(e,n,"focusLoop"),ii(e,n,"focusWrap"),ii(e,n,"focusShift"),e}function si(e){const t=[];for(const n of e)t.push(...n);return t}function li(e){return e.slice().reverse()}function oi(e={}){var t;e.store;const n=null==(t=e.store)?void 0:t.getState(),i=Tt(e.items,null==n?void 0:n.items,e.defaultItems,[]),r=new Map(i.map(e=>[e.id,e])),a={items:i,renderedItems:Tt(null==n?void 0:n.renderedItems,[])},s=null==(l=e.store)?void 0:l.__unstablePrivateStore;var l;const o=qn({items:i,renderedItems:a.renderedItems},s),u=qn(a,e.store),c=e=>{const t=function(e,t){const n=e.map((e,t)=>[t,e]);let i=!1;return n.sort(([e,n],[r,a])=>{const s=t(n),l=t(a);return s===l?0:s&&l?function(e,t){return Boolean(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}(s,l)?(e>r&&(i=!0),-1):(et):e}(e,e=>e.element);o.setState("renderedItems",t),u.setState("renderedItems",t)};Kn(u,()=>Gn(o)),Kn(o,()=>Zn(o,["items"],e=>{u.setState("items",e.items)})),Kn(o,()=>Zn(o,["renderedItems"],e=>{let t=!0,n=requestAnimationFrame(()=>{const{renderedItems:t}=u.getState();e.renderedItems!==t&&c(e.renderedItems)});if("function"!=typeof IntersectionObserver)return()=>cancelAnimationFrame(n);const i=function(e){var t;const n=e.find(e=>!!e.element),i=[...e].reverse().find(e=>!!e.element);let r=null==(t=null==n?void 0:n.element)?void 0:t.parentElement;for(;r&&(null==i?void 0:i.element);){if(i&&r.contains(i.element))return r;r=r.parentElement}return Wt(r).body}(e.renderedItems),r=new IntersectionObserver(()=>{t?t=!1:(cancelAnimationFrame(n),n=requestAnimationFrame(()=>c(e.renderedItems)))},{root:i});for(const t of e.renderedItems)t.element&&r.observe(t.element);return()=>{cancelAnimationFrame(n),r.disconnect()}}));const d=(e,t,n=!1)=>{let i;return t(t=>{const n=t.findIndex(({id:t})=>t===e.id),a=t.slice();if(-1!==n){i=t[n];const s=Vt(Vt({},i),e);a[n]=s,r.set(e.id,s)}else a.push(e),r.set(e.id,e);return a}),()=>{t(t=>{if(!i)return n&&r.delete(e.id),t.filter(({id:t})=>t!==e.id);const a=t.findIndex(({id:t})=>t===e.id);if(-1===a)return t;const s=t.slice();return s[a]=i,r.set(e.id,i),s})}},f=e=>d(e,e=>o.setState("items",e),!0);return It(Vt({},u),{registerItem:f,renderItem:e=>Mt(f(e),d(e,e=>o.setState("renderedItems",e))),item:e=>{if(!e)return null;let t=r.get(e);if(!t){const{items:n}=o.getState();t=n.find(t=>t.id===e),t&&r.set(e,t)}return t||null},__unstablePrivateStore:o})}var ui={id:null};function ci(e,t){return e.find(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function di(e,t){return e.filter(e=>e.rowId===t)}function fi(e){const t=[];for(const n of e){const e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===n.rowId});e?e.push(n):t.push([n])}return t}function mi(e){let t=0;for(const{length:n}of e)n>t&&(t=n);return t}function vi(e){return{id:"__EMPTY_ITEM__",disabled:!0,rowId:e}}var pi=nn()&&$t&&!!navigator.maxTouchPoints;function hi(e={}){var t=e,{tag:n}=t,i=Et(t,["tag"]);const r=Qn(i.store,function(e,...t){if(e)return Wn(e,"pick")(...t)}(n,["value","rtl"])),a=null==n?void 0:n.getState(),s=null==r?void 0:r.getState(),l=Tt(i.activeId,null==s?void 0:s.activeId,i.defaultActiveId,null),o=function(e={}){var t;const n=null==(t=e.store)?void 0:t.getState(),i=oi(e),r=Tt(e.activeId,null==n?void 0:n.activeId,e.defaultActiveId),a=qn(It(Vt({},i.getState()),{id:Tt(e.id,null==n?void 0:n.id,`id-${Math.random().toString(36).slice(2,8)}`),activeId:r,baseElement:Tt(null==n?void 0:n.baseElement,null),includesBaseElement:Tt(e.includesBaseElement,null==n?void 0:n.includesBaseElement,null===r),moves:Tt(null==n?void 0:n.moves,0),orientation:Tt(e.orientation,null==n?void 0:n.orientation,"both"),rtl:Tt(e.rtl,null==n?void 0:n.rtl,!1),virtualFocus:Tt(e.virtualFocus,null==n?void 0:n.virtualFocus,!1),focusLoop:Tt(e.focusLoop,null==n?void 0:n.focusLoop,!1),focusWrap:Tt(e.focusWrap,null==n?void 0:n.focusWrap,!1),focusShift:Tt(e.focusShift,null==n?void 0:n.focusShift,!1)}),i,e.store);Kn(a,()=>Un(a,["renderedItems","activeId"],e=>{a.setState("activeId",t=>{var n;return void 0!==t?t:null==(n=ci(e.renderedItems))?void 0:n.id})}));const s=(e="next",t={})=>{var n,i;const r=a.getState(),{skip:s=0,activeId:l=r.activeId,focusShift:o=r.focusShift,focusLoop:u=r.focusLoop,focusWrap:c=r.focusWrap,includesBaseElement:d=r.includesBaseElement,renderedItems:f=r.renderedItems,rtl:m=r.rtl}=t,v="up"===e||"down"===e,p="next"===e||"down"===e,h=p?m&&!v:!m||v,g=o&&!s;let b=v?si(function(e,t,n){const i=mi(e);for(const r of e)for(let e=0;ee.id===l);if(!x)return null==(i=ci(b))?void 0:i.id;const w=b.some(e=>e.rowId),y=b.indexOf(x),_=b.slice(y+1),C=di(_,x.rowId);if(s){const e=function(e,t){return e.filter(e=>t?!e.disabled&&e.id!==t:!e.disabled)}(C,l),t=e.slice(s)[0]||e[e.length-1];return null==t?void 0:t.id}const j=u&&(v?"horizontal"!==u:"vertical"!==u),S=w&&c&&(v?"horizontal"!==c:"vertical"!==c),k=p?(!w||v)&&j&&d:!!v&&d;if(j){const e=function(e,t,n=!1){const i=e.findIndex(e=>e.id===t);return[...e.slice(i+1),...n?[ui]:[],...e.slice(0,i)]}(S&&!k?b:di(b,x.rowId),l,k),t=ci(e,l);return null==t?void 0:t.id}if(S){const e=ci(k?C:_,l);return k?(null==e?void 0:e.id)||null:null==e?void 0:e.id}const V=ci(C,l);return!V&&k?null:null==V?void 0:V.id};return It(Vt(Vt({},i),a),{setBaseElement:e=>a.setState("baseElement",e),setActiveId:e=>a.setState("activeId",e),move:e=>{void 0!==e&&(a.setState("activeId",e),a.setState("moves",e=>e+1))},first:()=>{var e;return null==(e=ci(a.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=ci(li(a.getState().renderedItems)))?void 0:e.id},next:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),s("next",e)),previous:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),s("previous",e)),down:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),s("down",e)),up:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),s("up",e))})}(It(Vt({},i),{activeId:l,includesBaseElement:Tt(i.includesBaseElement,null==s?void 0:s.includesBaseElement,!0),orientation:Tt(i.orientation,null==s?void 0:s.orientation,"vertical"),focusLoop:Tt(i.focusLoop,null==s?void 0:s.focusLoop,!0),focusWrap:Tt(i.focusWrap,null==s?void 0:s.focusWrap,!0),virtualFocus:Tt(i.virtualFocus,null==s?void 0:s.virtualFocus,!0)})),u=function(e={}){var t=e,{popover:n}=t,i=Et(t,["popover"]);const r=Qn(i.store,Xn(n,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"])),a=null==r?void 0:r.getState(),s=function(e={}){return function(e={}){const t=Qn(e.store,Xn(e.disclosure,["contentElement","disclosureElement"])),n=null==t?void 0:t.getState(),i=Tt(e.open,null==n?void 0:n.open,e.defaultOpen,!1),r=Tt(e.animated,null==n?void 0:n.animated,!1),a=qn({open:i,animated:r,animating:!!r&&i,mounted:i,contentElement:Tt(null==n?void 0:n.contentElement,null),disclosureElement:Tt(null==n?void 0:n.disclosureElement,null)},t);return Kn(a,()=>Un(a,["animated","animating"],e=>{e.animated||a.setState("animating",!1)})),Kn(a,()=>Yn(a,["open"],()=>{a.getState().animated&&a.setState("animating",!0)})),Kn(a,()=>Un(a,["open","animating"],e=>{a.setState("mounted",e.open||e.animating)})),It(Vt({},a),{disclosure:e.disclosure,setOpen:e=>a.setState("open",e),show:()=>a.setState("open",!0),hide:()=>a.setState("open",!1),toggle:()=>a.setState("open",e=>!e),stopAnimation:()=>a.setState("animating",!1),setContentElement:e=>a.setState("contentElement",e),setDisclosureElement:e=>a.setState("disclosureElement",e)})}(e)}(It(Vt({},i),{store:r})),l=Tt(i.placement,null==a?void 0:a.placement,"bottom"),o=qn(It(Vt({},s.getState()),{placement:l,currentPlacement:l,anchorElement:Tt(null==a?void 0:a.anchorElement,null),popoverElement:Tt(null==a?void 0:a.popoverElement,null),arrowElement:Tt(null==a?void 0:a.arrowElement,null),rendered:Symbol("rendered")}),s,r);return It(Vt(Vt({},s),o),{setAnchorElement:e=>o.setState("anchorElement",e),setPopoverElement:e=>o.setState("popoverElement",e),setArrowElement:e=>o.setState("arrowElement",e),render:()=>o.setState("rendered",Symbol("rendered"))})}(It(Vt({},i),{placement:Tt(i.placement,null==s?void 0:s.placement,"bottom-start")})),c=Tt(i.value,null==s?void 0:s.value,i.defaultValue,""),d=Tt(i.selectedValue,null==s?void 0:s.selectedValue,null==a?void 0:a.values,i.defaultSelectedValue,""),f=Array.isArray(d),m=It(Vt(Vt({},o.getState()),u.getState()),{value:c,selectedValue:d,resetValueOnSelect:Tt(i.resetValueOnSelect,null==s?void 0:s.resetValueOnSelect,f),resetValueOnHide:Tt(i.resetValueOnHide,null==s?void 0:s.resetValueOnHide,f&&!n),activeValue:null==s?void 0:s.activeValue}),v=qn(m,o,u,r);return pi&&Kn(v,()=>Un(v,["virtualFocus"],()=>{v.setState("virtualFocus",!1)})),Kn(v,()=>{if(n)return Mt(Un(v,["selectedValue"],e=>{Array.isArray(e.selectedValue)&&n.setValues(e.selectedValue)}),Un(n,["values"],e=>{v.setState("selectedValue",e.values)}))}),Kn(v,()=>Un(v,["resetValueOnHide","mounted"],e=>{e.resetValueOnHide&&(e.mounted||v.setState("value",c))})),Kn(v,()=>Un(v,["open"],e=>{e.open||(v.setState("activeId",l),v.setState("moves",0))})),Kn(v,()=>Un(v,["moves","activeId"],(e,t)=>{e.moves===t.moves&&v.setState("activeValue",void 0)})),Kn(v,()=>Zn(v,["moves","renderedItems"],(e,t)=>{if(e.moves===t.moves)return;const{activeId:n}=v.getState(),i=o.item(n);v.setState("activeValue",null==i?void 0:i.value)})),It(Vt(Vt(Vt({},u),o),v),{tag:n,setValue:e=>v.setState("value",e),resetValue:()=>v.setState("value",m.value),setSelectedValue:e=>v.setState("selectedValue",e)})}function gi(e={}){e=function(e){const t=$n();return function(e){const t=gn(e.id);return gt({id:t},e)}(e=bt(gt({},e),{tag:void 0!==e.tag?e.tag:t}))}(e);const[t,n]=function(e,t){const[n,i]=Bt.useState(()=>e(t));vn(()=>Gn(n),[n]);const r=Bt.useCallback(e=>ti(n,e),[n]);return[Bt.useMemo(()=>bt(gt({},n),{useState:r}),[n,r]),pn(()=>{i(n=>e(gt(gt({},t),n.getState())))})]}(hi,e);return function(e,t,n){return bn(t,[n.tag]),ii(e,n,"value","setValue"),ii(e,n,"selectedValue","setSelectedValue"),ii(e,n,"resetValueOnHide"),ii(e,n,"resetValueOnSelect"),Object.assign(ai(function(e,t,n){return bn(t,[n.popover]),ii(e,n,"placement"),ri(e,t,n)}(e,t,n),t,n),{tag:n.tag})}(t,n,e)}var bi=Mn(),xi=(bi.useContext,bi.useScopedContext,bi.useProviderContext),wi=Mn([bi.ContextProvider],[bi.ScopedContextProvider]),yi=(wi.useContext,wi.useScopedContext,wi.useProviderContext,wi.ContextProvider),_i=wi.ScopedContextProvider,Ci=((0,Bt.createContext)(void 0),(0,Bt.createContext)(void 0),Mn([yi],[_i])),ji=(Ci.useContext,Ci.useScopedContext,Ci.useProviderContext),Si=Ci.ContextProvider,ki=Ci.ScopedContextProvider,Vi=(0,Bt.createContext)(void 0),Ii=Mn([Si,Tn],[ki,Bn]),Ei=Ii.useContext,Ni=Ii.useScopedContext,Fi=Ii.useProviderContext,Mi=Ii.ContextProvider,Ai=Ii.ScopedContextProvider,Oi=(0,Bt.createContext)(void 0),Pi=(0,Bt.createContext)(!1);function Li(e={}){const t=gi(e);return(0,o.jsx)(Mi,{value:t,children:e.children})}var Di=Fn(function(e){var t=e,{store:n}=t,i=xt(t,["store"]);const r=Fi();Pt(n=n||r,!1);const a=n.useState(e=>{var t;return null==(t=e.baseElement)?void 0:t.id});return Dt(i=gt({htmlFor:a},i))}),Ti=En(In(function(e){return Nn("label",Di(e))}));function Bi(e,t){return t&&e.item(t)||null}var zi=Symbol("FOCUS_SILENTLY");function Hi(e,t,n){if(!t)return!1;if(t===n)return!1;const i=e.item(t.id);return!(!i||n&&i.element===n)}var Ri=(0,Bt.createContext)(!0),$i="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function Wi(e){return!!e.matches($i)&&!!function(e){if("function"==typeof e.checkVisibility)return e.checkVisibility();const t=e;return t.offsetWidth>0||t.offsetHeight>0||e.getClientRects().length>0}(e)&&!e.closest("[inert]")}function qi(e){const t=qt(e);if(!t)return!1;if(t===e)return!0;const n=t.getAttribute("aria-activedescendant");return!!n&&n===e.id}function Ki(e){const t=qt(e);if(!t)return!1;if(Kt(e,t))return!0;const n=t.getAttribute("aria-activedescendant");return!!n&&"id"in e&&(n===e.id||!!e.querySelector(`#${CSS.escape(n)}`))}var Gi=nn(),Yi=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],Ui=Symbol("safariFocusAncestor");function Zi(e,t){e&&(e[Ui]=t)}function Xi(e){return!("input"!==e.tagName.toLowerCase()||!e.type||"radio"!==e.type&&"checkbox"!==e.type)}function Qi(e,t,n,i,r){return e?t?n&&!i?-1:void 0:n?r:r||0:r}function Ji(e,t){return pn(n=>{null==e||e(n),n.defaultPrevented||t&&(n.stopPropagation(),n.preventDefault())})}var er=!1,tr=!0;function nr(e){const t=e.target;t&&"hasAttribute"in t&&(t.hasAttribute("data-focus-visible")||(tr=!1))}function ir(e){e.metaKey||e.ctrlKey||e.altKey||(tr=!0)}var rr=Fn(function(e){var t=e,{focusable:n=!0,accessibleWhenDisabled:i,autoFocus:r,onFocusVisible:a}=t,s=xt(t,["focusable","accessibleWhenDisabled","autoFocus","onFocusVisible"]);const l=(0,Bt.useRef)(null);(0,Bt.useEffect)(()=>{n&&(er||(cn("mousedown",nr,!0),cn("keydown",ir,!0),er=!0))},[n]),Gi&&(0,Bt.useEffect)(()=>{if(!n)return;const e=l.current;if(!e)return;if(!Xi(e))return;const t=function(e){return"labels"in e?e.labels:null}(e);if(!t)return;const i=()=>queueMicrotask(()=>e.focus());for(const e of t)e.addEventListener("mouseup",i);return()=>{for(const e of t)e.removeEventListener("mouseup",i)}},[n]);const o=n&&Lt(s),u=!!o&&!i,[c,d]=(0,Bt.useState)(!1);(0,Bt.useEffect)(()=>{n&&u&&c&&d(!1)},[n,u,c]),(0,Bt.useEffect)(()=>{if(!n)return;if(!c)return;const e=l.current;if(!e)return;if("undefined"==typeof IntersectionObserver)return;const t=new IntersectionObserver(()=>{Wi(e)||d(!1)});return t.observe(e),()=>t.disconnect()},[n,c]);const f=Ji(s.onKeyPressCapture,o),m=Ji(s.onMouseDownCapture,o),v=Ji(s.onClickCapture,o),p=s.onMouseDown,h=pn(e=>{if(null==p||p(e),e.defaultPrevented)return;if(!n)return;const t=e.currentTarget;if(!Gi)return;if(rn(e))return;if(!Gt(t)&&!Xi(t))return;let i=!1;const r=()=>{i=!0};t.addEventListener("focusin",r,{capture:!0,once:!0});const a=function(e){for(;e&&!Wi(e);)e=e.closest($i);return e||null}(t.parentElement);Zi(a,!0),un(t,"mouseup",()=>{t.removeEventListener("focusin",r,!0),Zi(a,!1),i||function(e){!Ki(e)&&Wi(e)&&e.focus()}(t)})}),g=(e,t)=>{if(t&&(e.currentTarget=t),!n)return;const i=e.currentTarget;i&&qi(i)&&(null==a||a(e),e.defaultPrevented||(i.dataset.focusVisible="true",d(!0)))},b=s.onKeyDownCapture,x=pn(e=>{if(null==b||b(e),e.defaultPrevented)return;if(!n)return;if(c)return;if(e.metaKey)return;if(e.altKey)return;if(e.ctrlKey)return;if(!an(e))return;const t=e.currentTarget;un(t,"focusout",()=>g(e,t))}),w=s.onFocusCapture,y=pn(e=>{if(null==w||w(e),e.defaultPrevented)return;if(!n)return;if(!an(e))return void d(!1);const t=e.currentTarget;tr||function(e){const{tagName:t,readOnly:n,type:i}=e;return"TEXTAREA"===t&&!n||"SELECT"===t&&!n||("INPUT"!==t||n?!!e.isContentEditable||!("combobox"!==e.getAttribute("role")||!e.dataset.name):Yi.includes(i))}(e.target)?un(e.target,"focusout",()=>g(e,t)):d(!1)}),_=s.onBlur,C=pn(e=>{null==_||_(e),n&&on(e)&&(e.currentTarget.removeAttribute("data-focus-visible"),d(!1))}),j=(0,Bt.useContext)(Ri),S=pn(e=>{n&&r&&e&&j&&queueMicrotask(()=>{qi(e)||Wi(e)&&e.focus()})}),k=function(e,t){const n=e=>{if("string"==typeof e)return e},[i,r]=(0,Bt.useState)(()=>n(t));return vn(()=>{const i=e&&"current"in e?e.current:e;r((null==i?void 0:i.tagName.toLowerCase())||n(t))},[e,t]),i}(l),V=n&&function(e){return!e||"button"===e||"summary"===e||"input"===e||"select"===e||"textarea"===e||"a"===e}(k),I=n&&function(e){return!e||"button"===e||"input"===e||"select"===e||"textarea"===e}(k),E=s.style,N=(0,Bt.useMemo)(()=>u?gt({pointerEvents:"none"},E):E,[u,E]);return Dt(s=bt(gt({"data-focus-visible":n&&c||void 0,"data-autofocus":r||void 0,"aria-disabled":o||void 0},s),{ref:hn(l,S,s.ref),style:N,tabIndex:Qi(n,u,V,I,s.tabIndex),disabled:!(!I||!u)||void 0,contentEditable:o?void 0:s.contentEditable,onKeyPressCapture:f,onClickCapture:v,onMouseDownCapture:m,onMouseDown:h,onKeyDownCapture:x,onFocusCapture:y,onBlur:C}))});function ar(e,t,n){return pn(i=>{var r;if(null==t||t(i),i.defaultPrevented)return;if(i.isPropagationStopped())return;if(!an(i))return;if(function(e){return"Shift"===e.key||"Control"===e.key||"Alt"===e.key||"Meta"===e.key}(i))return;if(function(e){const t=e.target;return!(t&&!Ut(t)||1!==e.key.length||e.ctrlKey||e.metaKey)}(i))return;const a=e.getState(),s=null==(r=Bi(e,a.activeId))?void 0:r.element;if(!s)return;const l=i,{view:o}=l,u=xt(l,["view"]);s!==(null==n?void 0:n.current)&&s.focus(),function(e,t,n){const i=new KeyboardEvent(t,n);return e.dispatchEvent(i)}(s,i.type,u)||i.preventDefault(),i.currentTarget.contains(s)&&i.stopPropagation()})}In(function(e){return Nn("div",rr(e))});var sr=Fn(function(e){var t=e,{store:n,composite:i=!0,focusOnMove:r=i,moveOnKeyPress:a=!0}=t,s=xt(t,["store","composite","focusOnMove","moveOnKeyPress"]);const l=Dn();Pt(n=n||l,!1);const u=(0,Bt.useRef)(null),c=(0,Bt.useRef)(null),d=function(e){const[t,n]=(0,Bt.useState)(!1),i=(0,Bt.useCallback)(()=>n(!0),[]),r=e.useState(t=>Bi(e,t.activeId));return(0,Bt.useEffect)(()=>{const e=null==r?void 0:r.element;t&&e&&(n(!1),e.focus({preventScroll:!0}))},[r,t]),i}(n),f=n.useState("moves"),[,m]=function(e){const[t,n]=(0,Bt.useState)(null);return vn(()=>{if(null==t)return;if(!e)return;let n=null;return e(e=>(n=e,t)),()=>{e(n)}},[t,e]),[t,n]}(i?n.setBaseElement:null);(0,Bt.useEffect)(()=>{var e;if(!n)return;if(!f)return;if(!i)return;if(!r)return;const{activeId:t}=n.getState(),a=null==(e=Bi(n,t))?void 0:e.element;var s;a&&("scrollIntoView"in(s=a)?(s.focus({preventScroll:!0}),s.scrollIntoView(Vt({block:"nearest",inline:"nearest"},undefined))):s.focus())},[n,f,i,r]),vn(()=>{if(!n)return;if(!f)return;if(!i)return;const{baseElement:e,activeId:t}=n.getState();if(null!==t)return;if(!e)return;const r=c.current;c.current=null,r&&sn(r,{relatedTarget:e}),qi(e)||e.focus()},[n,f,i]);const v=n.useState("activeId"),p=n.useState("virtualFocus");vn(()=>{var e;if(!n)return;if(!i)return;if(!p)return;const t=c.current;if(c.current=null,!t)return;const r=(null==(e=Bi(n,v))?void 0:e.element)||qt(t);r!==t&&sn(t,{relatedTarget:r})},[n,v,p,i]);const h=ar(n,s.onKeyDownCapture,c),g=ar(n,s.onKeyUpCapture,c),b=s.onFocusCapture,x=pn(e=>{if(null==b||b(e),e.defaultPrevented)return;if(!n)return;const{virtualFocus:t}=n.getState();if(!t)return;const i=e.relatedTarget,r=function(e){const t=e[zi];return delete e[zi],t}(e.currentTarget);an(e)&&r&&(e.stopPropagation(),c.current=i)}),w=s.onFocus,y=pn(e=>{if(null==w||w(e),e.defaultPrevented)return;if(!i)return;if(!n)return;const{relatedTarget:t}=e,{virtualFocus:r}=n.getState();r?an(e)&&!Hi(n,t)&&queueMicrotask(d):an(e)&&n.setActiveId(null)}),_=s.onBlurCapture,C=pn(e=>{var t;if(null==_||_(e),e.defaultPrevented)return;if(!n)return;const{virtualFocus:i,activeId:r}=n.getState();if(!i)return;const a=null==(t=Bi(n,r))?void 0:t.element,s=e.relatedTarget,l=Hi(n,s),o=c.current;c.current=null,an(e)&&l?(s===a?o&&o!==s&&sn(o,e):a?sn(a,e):o&&sn(o,e),e.stopPropagation()):!Hi(n,e.target)&&a&&sn(a,e)}),j=s.onKeyDown,S=xn(a),k=pn(e=>{var t;if(null==j||j(e),e.nativeEvent.isComposing)return;if(e.defaultPrevented)return;if(!n)return;if(!an(e))return;const{orientation:i,renderedItems:r,activeId:a}=n.getState(),s=Bi(n,a);if(null==(t=null==s?void 0:s.element)?void 0:t.isConnected)return;const l="horizontal"!==i,o="vertical"!==i,u=r.some(e=>!!e.rowId);if(("ArrowLeft"===e.key||"ArrowRight"===e.key||"Home"===e.key||"End"===e.key)&&Ut(e.currentTarget))return;const c={ArrowUp:(u||l)&&(()=>{if(u){const e=function(e){return e.find(e=>!e.disabled)}(si(li(function(e){const t=[];for(const n of e){const e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===n.rowId});e?e.push(n):t.push([n])}return t}(r))));return null==e?void 0:e.id}return null==n?void 0:n.last()}),ArrowRight:(u||o)&&n.first,ArrowDown:(u||l)&&n.first,ArrowLeft:(u||o)&&n.last,Home:n.first,End:n.last,PageUp:n.first,PageDown:n.last},d=c[e.key];if(d){const t=d();if(void 0!==t){if(!S(e))return;e.preventDefault(),n.move(t)}}});s=wn(s,e=>(0,o.jsx)(Tn,{value:n,children:e}),[n]);const V=n.useState(e=>{var t;if(n&&i&&e.virtualFocus)return null==(t=Bi(n,e.activeId))?void 0:t.id});s=bt(gt({"aria-activedescendant":V},s),{ref:hn(u,m,s.ref),onKeyDownCapture:h,onKeyUpCapture:g,onFocusCapture:x,onFocus:y,onBlurCapture:C,onKeyDown:k});const I=n.useState(e=>i&&(e.virtualFocus||null===e.activeId));return rr(gt({focusable:I},s))}),lr=(In(function(e){return Nn("div",sr(e))}),Fn(function(e){var t=e,{store:n}=t,i=xt(t,["store"]);const r=ji();return n=n||r,bt(gt({},i),{ref:hn(null==n?void 0:n.setAnchorElement,i.ref)})}));function or(e,t,n){if(!n)return!1;const i=e.find(e=>!e.disabled&&e.value);return(null==i?void 0:i.value)===t}function ur(e,t){return!!t&&null!=e&&(e=At(e),t.length>e.length&&0===t.toLowerCase().indexOf(e.toLowerCase()))}In(function(e){return Nn("div",lr(e))});var cr=Fn(function(e){var t=e,{store:n,focusable:i=!0,autoSelect:r=!1,getAutoSelectId:a,setValueOnChange:s,showMinLength:l=0,showOnChange:o,showOnMouseDown:u,showOnClick:c=u,showOnKeyDown:d,showOnKeyPress:f=d,blurActiveItemOnClick:m,setValueOnClick:v=!0,moveOnKeyPress:p=!0,autoComplete:h="list"}=t,g=xt(t,["store","focusable","autoSelect","getAutoSelectId","setValueOnChange","showMinLength","showOnChange","showOnMouseDown","showOnClick","showOnKeyDown","showOnKeyPress","blurActiveItemOnClick","setValueOnClick","moveOnKeyPress","autoComplete"]);const b=Fi();Pt(n=n||b,!1);const x=(0,Bt.useRef)(null),[w,y]=(0,Bt.useReducer)(()=>[],[]),_=(0,Bt.useRef)(!1),C=(0,Bt.useRef)(!1),j=n.useState(e=>e.virtualFocus&&r),S="inline"===h||"both"===h,[k,V]=(0,Bt.useState)(S);!function(e,t){const n=(0,Bt.useRef)(!1);vn(()=>{n.current?S&&V(!0):n.current=!0},t),vn(()=>()=>{n.current=!1},[])}(0,[S]);const I=n.useState("value"),E=(0,Bt.useRef)();(0,Bt.useEffect)(()=>Un(n,["selectedValue","activeId"],(e,t)=>{E.current=t.selectedValue}),[]);const N=n.useState(e=>{var t;if(S&&k){if(e.activeValue&&Array.isArray(e.selectedValue)){if(e.selectedValue.includes(e.activeValue))return;if(null==(t=E.current)?void 0:t.includes(e.activeValue))return}return e.activeValue}}),F=n.useState("renderedItems"),M=n.useState("open"),A=n.useState("contentElement"),O=(0,Bt.useMemo)(()=>{if(!S)return I;if(!k)return I;if(or(F,N,j)){if(ur(I,N)){const e=(null==N?void 0:N.slice(I.length))||"";return I+e}return I}return N||I},[S,k,F,N,j,I]);(0,Bt.useEffect)(()=>{const e=x.current;if(!e)return;const t=()=>V(!0);return e.addEventListener("combobox-item-move",t),()=>{e.removeEventListener("combobox-item-move",t)}},[]),(0,Bt.useEffect)(()=>{if(!S)return;if(!k)return;if(!N)return;if(!or(F,N,j))return;if(!ur(I,N))return;let e=Nt;return queueMicrotask(()=>{const t=x.current;if(!t)return;const{start:n,end:i}=Xt(t),r=I.length,a=N.length;en(t,r,a),e=()=>{if(!qi(t))return;const{start:e,end:s}=Xt(t);e===r&&s===a&&en(t,n,i)}}),()=>e()},[w,S,k,N,F,j,I]);const P=(0,Bt.useRef)(null),L=pn(a),D=(0,Bt.useRef)(null);(0,Bt.useEffect)(()=>{if(!M)return;if(!A)return;const e=Jt(A);if(!e)return;P.current=e;const t=()=>{_.current=!1},i=()=>{if(!n)return;if(!_.current)return;const{activeId:e}=n.getState();null!==e&&e!==D.current&&(_.current=!1)},r={passive:!0,capture:!0};return e.addEventListener("wheel",t,r),e.addEventListener("touchmove",t,r),e.addEventListener("scroll",i,r),()=>{e.removeEventListener("wheel",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("scroll",i,!0)}},[M,A,n]),vn(()=>{I&&(C.current||(_.current=!0))},[I]),vn(()=>{"always"!==j&&M||(_.current=M)},[j,M]);const T=n.useState("resetValueOnSelect");bn(()=>{var e,t;const i=_.current;if(!n)return;if(!M)return;if(!i&&!T)return;const{baseElement:r,contentElement:a,activeId:s}=n.getState();if(!r||qi(r)){if(null==a?void 0:a.hasAttribute("data-placing")){const e=new MutationObserver(y);return e.observe(a,{attributeFilter:["data-placing"]}),()=>e.disconnect()}if(j&&i){const t=L(F),i=void 0!==t?t:null!=(e=function(e){const t=e.find(e=>{var t;return!e.disabled&&"tab"!==(null==(t=e.element)?void 0:t.getAttribute("role"))});return null==t?void 0:t.id}(F))?e:n.first();D.current=i,n.move(null!=i?i:null)}else{const e=null==(t=n.item(s||n.first()))?void 0:t.element;e&&"scrollIntoView"in e&&e.scrollIntoView({block:"nearest",inline:"nearest"})}}},[n,M,w,I,j,T,L,F]),(0,Bt.useEffect)(()=>{if(!S)return;const e=x.current;if(!e)return;const t=[e,A].filter(e=>!!e),i=e=>{t.every(t=>on(e,t))&&(null==n||n.setValue(O))};for(const e of t)e.addEventListener("focusout",i);return()=>{for(const e of t)e.removeEventListener("focusout",i)}},[S,A,n,O]);const B=e=>e.currentTarget.value.length>=l,z=g.onChange,H=xn(null!=o?o:B),R=xn(null!=s?s:!n.tag),$=pn(e=>{if(null==z||z(e),e.defaultPrevented)return;if(!n)return;const t=e.currentTarget,{value:i,selectionStart:r,selectionEnd:a}=t,s=e.nativeEvent;if(_.current=!0,function(e){return"input"===e.type}(s)&&(s.isComposing&&(_.current=!1,C.current=!0),S)){const e="insertText"===s.inputType||"insertCompositionText"===s.inputType,t=r===i.length;V(e&&t)}if(R(e)){const e=i===n.getState().value;n.setValue(i),queueMicrotask(()=>{en(t,r,a)}),S&&j&&e&&y()}H(e)&&n.show(),j&&_.current||n.setActiveId(null)}),W=g.onCompositionEnd,q=pn(e=>{_.current=!0,C.current=!1,null==W||W(e),e.defaultPrevented||j&&y()}),K=g.onMouseDown,G=xn(null!=m?m:()=>!!(null==n?void 0:n.getState().includesBaseElement)),Y=xn(v),U=xn(null!=c?c:B),Z=pn(e=>{null==K||K(e),e.defaultPrevented||e.button||e.ctrlKey||n&&(G(e)&&n.setActiveId(null),Y(e)&&n.setValue(O),U(e)&&un(e.currentTarget,"mouseup",n.show))}),X=g.onKeyDown,Q=xn(null!=f?f:B),J=pn(e=>{if(null==X||X(e),e.repeat||(_.current=!1),e.defaultPrevented)return;if(e.ctrlKey)return;if(e.altKey)return;if(e.shiftKey)return;if(e.metaKey)return;if(!n)return;const{open:t}=n.getState();t||"ArrowUp"!==e.key&&"ArrowDown"!==e.key||Q(e)&&(e.preventDefault(),n.show())}),ee=g.onBlur,te=pn(e=>{_.current=!1,null==ee||ee(e),e.defaultPrevented}),ne=gn(g.id),ie=function(e){return"inline"===e||"list"===e||"both"===e||"none"===e}(h)?h:void 0,re=n.useState(e=>null===e.activeId);return g=bt(gt({id:ne,role:"combobox","aria-autocomplete":ie,"aria-haspopup":Qt(A,"listbox"),"aria-expanded":M,"aria-controls":null==A?void 0:A.id,"data-active-item":re||void 0,value:O},g),{ref:hn(x,g.ref),onChange:$,onCompositionEnd:q,onMouseDown:Z,onKeyDown:J,onBlur:te}),g=sr(bt(gt({store:n,focusable:i},g),{moveOnKeyPress:e=>!function(e,...t){const n="function"==typeof e?e(...t):e;return null!=n&&!n}(p,e)&&(S&&V(!0),!0)})),g=lr(gt({store:n},g)),gt({autoComplete:"off"},g)}),dr=In(function(e){return Nn("input",cr(e))}),fr=n(795);function mr(e,t){const n=setTimeout(t,e);return()=>clearTimeout(n)}function vr(...e){return e.join(", ").split(", ").reduce((e,t)=>{const n=t.endsWith("ms")?1:1e3,i=Number.parseFloat(t||"0s")*n;return i>e?i:e},0)}function pr(e,t,n){return!(n||!1===t||e&&!t)}var hr=Fn(function(e){var t=e,{store:n,alwaysVisible:i}=t,r=xt(t,["store","alwaysVisible"]);const a=xi();Pt(n=n||a,!1);const s=(0,Bt.useRef)(null),l=gn(r.id),[u,c]=(0,Bt.useState)(null),d=n.useState("open"),f=n.useState("mounted"),m=n.useState("animated"),v=n.useState("contentElement"),p=ti(n.disclosure,"contentElement");vn(()=>{s.current&&(null==n||n.setContentElement(s.current))},[n]),vn(()=>{let e;return null==n||n.setState("animated",t=>(e=t,!0)),()=>{void 0!==e&&(null==n||n.setState("animated",e))}},[n]),vn(()=>{if(m){if(null==v?void 0:v.isConnected)return function(e){let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)}(()=>{c(d?"enter":f?"leave":null)});c(null)}},[m,v,d,f]),vn(()=>{if(!n)return;if(!m)return;if(!u)return;if(!v)return;const e=()=>null==n?void 0:n.setState("animating",!1),t=()=>(0,fr.flushSync)(e);if("leave"===u&&d)return;if("enter"===u&&!d)return;if("number"==typeof m)return mr(m,t);const{transitionDuration:i,animationDuration:r,transitionDelay:a,animationDelay:s}=getComputedStyle(v),{transitionDuration:l="0",animationDuration:o="0",transitionDelay:c="0",animationDelay:f="0"}=p?getComputedStyle(p):{},h=vr(a,s,c,f)+vr(i,r,l,o);return h?mr(Math.max(h-1e3/60,0),t):("enter"===u&&n.setState("animated",!1),void e())},[n,m,v,p,d,u]),r=wn(r,e=>(0,o.jsx)(_i,{value:n,children:e}),[n]);const h=pr(f,r.hidden,i),g=r.style,b=(0,Bt.useMemo)(()=>h?bt(gt({},g),{display:"none"}):g,[h,g]);return Dt(r=bt(gt({id:l,"data-open":d||void 0,"data-enter":"enter"===u||void 0,"data-leave":"leave"===u||void 0,hidden:h},r),{ref:hn(l?n.setContentElement:null,s,r.ref),style:b}))}),gr=In(function(e){return Nn("div",hr(e))}),br=(In(function(e){var t=e,{unmountOnHide:n}=t,i=xt(t,["unmountOnHide"]);const r=xi();return!1===ti(i.store||r,e=>!n||(null==e?void 0:e.mounted))?null:(0,o.jsx)(gr,gt({},i))}),Fn(function(e){var t=e,{store:n,alwaysVisible:i}=t,r=xt(t,["store","alwaysVisible"]);const a=Ni(!0),s=Ei(),l=!!(n=n||s)&&n===a;Pt(n,!1);const u=(0,Bt.useRef)(null),c=gn(r.id),d=n.useState("mounted"),f=pr(d,r.hidden,i),m=f?bt(gt({},r.style),{display:"none"}):r.style,v=n.useState(e=>Array.isArray(e.selectedValue)),p=function(e,t,n){const i=function(e){const[t]=(0,Bt.useState)(e);return t}(n),[r,a]=(0,Bt.useState)(i);return(0,Bt.useEffect)(()=>{const n=e&&"current"in e?e.current:e;if(!n)return;const r=()=>{const e=n.getAttribute(t);a(null==e?i:e)},s=new MutationObserver(r);return s.observe(n,{attributeFilter:[t]}),r(),()=>s.disconnect()},[e,t,i]),r}(u,"role",r.role),h=("listbox"===p||"tree"===p||"grid"===p)&&v||void 0,[g,b]=(0,Bt.useState)(!1),x=n.useState("contentElement");vn(()=>{if(!d)return;const e=u.current;if(!e)return;if(x!==e)return;const t=()=>{b(!!e.querySelector("[role='listbox']"))},n=new MutationObserver(t);return n.observe(e,{subtree:!0,childList:!0,attributeFilter:["role"]}),t(),()=>n.disconnect()},[d,x]),g||(r=gt({role:"listbox","aria-multiselectable":h},r)),r=wn(r,e=>(0,o.jsx)(Ai,{value:n,children:(0,o.jsx)(Vi.Provider,{value:p,children:e})}),[n,p]);const w=!c||a&&l?null:n.setContentElement;return Dt(r=bt(gt({id:c,hidden:f},r),{ref:hn(w,u,r.ref),style:m}))})),xr=In(function(e){return Nn("div",br(e))});function wr(e){const t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}var yr=Symbol("composite-hover"),_r=Fn(function(e){var t=e,{store:n,focusOnHover:i=!0,blurOnHoverEnd:r=!!i}=t,a=xt(t,["store","focusOnHover","blurOnHoverEnd"]);const s=Ln();Pt(n=n||s,!1);const l=((0,Bt.useEffect)(()=>{yn||(cn("mousemove",kn,!0),cn("mousedown",Vn,!0),cn("mouseup",Vn,!0),cn("keydown",Vn,!0),cn("scroll",Vn,!0),yn=!0)},[]),pn(()=>Cn)),o=a.onMouseMove,u=xn(i),c=pn(e=>{if(null==o||o(e),!e.defaultPrevented&&l()&&u(e)){if(!Ki(e.currentTarget)){const e=null==n?void 0:n.getState().baseElement;e&&!qi(e)&&e.focus()}null==n||n.setActiveId(e.currentTarget.id)}}),d=a.onMouseLeave,f=xn(r),m=pn(e=>{var t;null==d||d(e),e.defaultPrevented||l()&&(function(e){const t=wr(e);return!!t&&Kt(e.currentTarget,t)}(e)||function(e){let t=wr(e);if(!t)return!1;do{if(Ft(t,yr)&&t[yr])return!0;t=t.parentElement}while(t);return!1}(e)||u(e)&&f(e)&&(null==n||n.setActiveId(null),null==(t=null==n?void 0:n.getState().baseElement)||t.focus()))}),v=(0,Bt.useCallback)(e=>{e&&(e[yr]=!0)},[]);return Dt(a=bt(gt({},a),{ref:hn(v,a.ref),onMouseMove:c,onMouseLeave:m}))}),Cr=(En(In(function(e){return Nn("div",_r(e))})),Fn(function(e){var t=e,{store:n,shouldRegisterItem:i=!0,getItem:r=Ot,element:a}=t,s=xt(t,["store","shouldRegisterItem","getItem","element"]);const l=On();n=n||l;const o=gn(s.id),u=(0,Bt.useRef)(a);return(0,Bt.useEffect)(()=>{const e=u.current;if(!o)return;if(!e)return;if(!i)return;const t=r({id:o,element:e});return null==n?void 0:n.renderItem(t)},[o,i,r,n]),Dt(s=bt(gt({},s),{ref:hn(u,s.ref)}))}));function jr(e){if(!e.isTrusted)return!1;const t=e.currentTarget;return"Enter"===e.key?Gt(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&(Gt(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}In(function(e){return Nn("div",Cr(e))});var Sr=Symbol("command"),kr=Fn(function(e){var t=e,{clickOnEnter:n=!0,clickOnSpace:i=!0}=t,r=xt(t,["clickOnEnter","clickOnSpace"]);const a=(0,Bt.useRef)(null),[s,l]=(0,Bt.useState)(!1);(0,Bt.useEffect)(()=>{a.current&&l(Gt(a.current))},[]);const[o,u]=(0,Bt.useState)(!1),c=(0,Bt.useRef)(!1),d=Lt(r),[f,m]=function(e,t,n){const i=e.onLoadedMetadataCapture,r=(0,Bt.useMemo)(()=>Object.assign(()=>{},bt(gt({},i),{[t]:n})),[i,t,n]);return[null==i?void 0:i[t],{onLoadedMetadataCapture:r}]}(r,Sr,!0),v=r.onKeyDown,p=pn(e=>{null==v||v(e);const t=e.currentTarget;if(e.defaultPrevented)return;if(f)return;if(d)return;if(!an(e))return;if(Ut(t))return;if(t.isContentEditable)return;const r=n&&"Enter"===e.key,a=i&&" "===e.key,s="Enter"===e.key&&!n,l=" "===e.key&&!i;if(s||l)e.preventDefault();else if(r||a){const n=jr(e);if(r){if(!n){e.preventDefault();const n=e,{view:i}=n,r=xt(n,["view"]),a=()=>ln(t,r);$t&&/firefox\//i.test(navigator.userAgent)?un(t,"keyup",a):queueMicrotask(a)}}else a&&(c.current=!0,n||(e.preventDefault(),u(!0)))}}),h=r.onKeyUp,g=pn(e=>{if(null==h||h(e),e.defaultPrevented)return;if(f)return;if(d)return;if(e.metaKey)return;const t=i&&" "===e.key;if(c.current&&t&&(c.current=!1,!jr(e))){e.preventDefault(),u(!1);const t=e.currentTarget,n=e,{view:i}=n,r=xt(n,["view"]);queueMicrotask(()=>ln(t,r))}});return r=bt(gt(gt({"data-active":o||void 0,type:s?"button":void 0},m),r),{ref:hn(a,r.ref),onKeyDown:p,onKeyUp:g}),rr(r)});function Vr(e,t=!1){const{top:n}=e.getBoundingClientRect();return t?n+e.clientHeight:n}function Ir(e,t,n,i=!1){var r;if(!t)return;if(!n)return;const{renderedItems:a}=t.getState(),s=Jt(e);if(!s)return;const l=function(e,t=!1){const n=e.clientHeight,{top:i}=e.getBoundingClientRect(),r=1.5*Math.max(.875*n,n-40),a=t?n-r+i:r+i;return"HTML"===e.tagName?a+e.scrollTop:a}(s,i);let o,u;for(let e=0;e=0){void 0!==u&&ui||(e&&(null==p?void 0:p.baseElement)&&p.baseElement===e.baseElement?p.id:void 0),baseElement:e=>(null==e?void 0:e.baseElement)||void 0,isActiveItem:e=>!!e&&e.activeId===m,ariaSetSize:e=>null!=u?u:e&&(null==p?void 0:p.ariaSetSize)&&p.baseElement===e.baseElement?p.ariaSetSize:void 0,ariaPosInSet(e){if(null!=c)return c;if(!e)return;if(!(null==p?void 0:p.ariaPosInSet))return;if(p.baseElement!==e.baseElement)return;const t=e.renderedItems.filter(e=>e.rowId===g);return p.ariaPosInSet+t.findIndex(e=>e.id===m)},isTabbable(e){if(!(null==e?void 0:e.renderedItems.length))return!0;if(e.virtualFocus)return!1;if(s)return!0;if(null===e.activeId)return!1;const t=null==n?void 0:n.item(e.activeId);return!!(null==t?void 0:t.disabled)||!(null==t?void 0:t.element)||e.activeId===m}}),C=(0,Bt.useCallback)(e=>{var t;const n=bt(gt({},e),{id:m||e.id,rowId:g,disabled:!!h,children:null==(t=e.element)?void 0:t.textContent});return l?l(n):n},[m,g,h,l]),j=d.onFocus,S=(0,Bt.useRef)(!1),k=pn(e=>{if(null==j||j(e),e.defaultPrevented)return;if(rn(e))return;if(!m)return;if(!n)return;if(function(e,t){return!an(e)&&Hi(t,e.target)}(e,n))return;const{virtualFocus:t,baseElement:i}=n.getState();var r;(n.setActiveId(m),Zt(e.currentTarget)&&function(e,t=!1){if(Ut(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){const n=Wt(e).getSelection();null==n||n.selectAllChildren(e),t&&(null==n||n.collapseToEnd())}}(e.currentTarget),t)&&(an(e)&&(Zt(r=e.currentTarget)||"INPUT"===r.tagName&&!Gt(r)||(null==i?void 0:i.isConnected)&&(nn()&&e.currentTarget.hasAttribute("data-autofocus")&&e.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),S.current=!0,e.relatedTarget===i||Hi(n,e.relatedTarget)?function(e){e[zi]=!0,e.focus({preventScroll:!0})}(i):i.focus())))}),V=d.onBlurCapture,I=pn(e=>{if(null==V||V(e),e.defaultPrevented)return;const t=null==n?void 0:n.getState();(null==t?void 0:t.virtualFocus)&&S.current&&(S.current=!1,e.preventDefault(),e.stopPropagation())}),E=d.onKeyDown,N=xn(r),F=xn(a),M=pn(e=>{if(null==E||E(e),e.defaultPrevented)return;if(!an(e))return;if(!n)return;const{currentTarget:t}=e,i=n.getState(),r=n.item(m),a=!!(null==r?void 0:r.rowId),s="horizontal"!==i.orientation,l="vertical"!==i.orientation,o=()=>!(!a&&!l&&i.baseElement&&Ut(i.baseElement)),u={ArrowUp:(a||s)&&n.up,ArrowRight:(a||l)&&n.next,ArrowDown:(a||s)&&n.down,ArrowLeft:(a||l)&&n.previous,Home:()=>{if(o())return!a||e.ctrlKey?null==n?void 0:n.first():null==n?void 0:n.previous(-1)},End:()=>{if(o())return!a||e.ctrlKey?null==n?void 0:n.last():null==n?void 0:n.next(-1)},PageUp:()=>Ir(t,n,null==n?void 0:n.up,!0),PageDown:()=>Ir(t,n,null==n?void 0:n.down)}[e.key];if(u){if(Zt(t)){const n=Xt(t),i=l&&"ArrowLeft"===e.key,r=l&&"ArrowRight"===e.key,a=s&&"ArrowUp"===e.key,o=s&&"ArrowDown"===e.key;if(r||o){const{length:e}=function(e){if(Ut(e))return e.value;if(e.isContentEditable){const t=Wt(e).createRange();return t.selectNodeContents(e),t.toString()}return""}(t);if(n.end!==e)return}else if((i||a)&&0!==n.start)return}const i=u();if(N(e)||void 0!==i){if(!F(e))return;e.preventDefault(),n.move(i)}}}),A=(0,Bt.useMemo)(()=>({id:m,baseElement:b}),[m,b]);return d=wn(d,e=>(0,o.jsx)(zn.Provider,{value:A,children:e}),[A]),d=bt(gt({id:m,"data-active-item":x||void 0},d),{ref:hn(v,d.ref),tabIndex:_?d.tabIndex:-1,onFocus:k,onBlurCapture:I,onKeyDown:M}),d=kr(d),d=Cr(bt(gt({store:n},d),{getItem:C,shouldRegisterItem:!!m&&d.shouldRegisterItem})),Dt(bt(gt({},d),{"aria-setsize":w,"aria-posinset":y}))});function Nr(e){var t;return null!=(t={menu:"menuitem",listbox:"option",tree:"treeitem"}[e])?t:"option"}En(In(function(e){return Nn("button",Er(e))}));var Fr=Fn(function(e){var t,n=e,{store:i,value:r,hideOnClick:a,setValueOnClick:s,selectValueOnClick:l=!0,resetValueOnSelect:u,focusOnHover:c=!1,moveOnKeyPress:d=!0,getItem:f}=n,m=xt(n,["store","value","hideOnClick","setValueOnClick","selectValueOnClick","resetValueOnSelect","focusOnHover","moveOnKeyPress","getItem"]);const v=Ni();Pt(i=i||v,!1);const{resetValueOnSelectState:p,multiSelectable:h,selected:g}=ni(i,{resetValueOnSelectState:"resetValueOnSelect",multiSelectable:e=>Array.isArray(e.selectedValue),selected:e=>function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)}(e.selectedValue,r)}),b=(0,Bt.useCallback)(e=>{const t=bt(gt({},e),{value:r});return f?f(t):t},[r,f]);s=null!=s?s:!h,a=null!=a?a:null!=r&&!h;const x=m.onClick,w=xn(s),y=xn(l),_=xn(null!=(t=null!=u?u:p)?t:h),C=xn(a),j=pn(e=>{null==x||x(e),e.defaultPrevented||function(e){const t=e.currentTarget;if(!t)return!1;const n=t.tagName.toLowerCase();return!!e.altKey&&("a"===n||"button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type)}(e)||function(e){const t=e.currentTarget;if(!t)return!1;const n=tn();if(n&&!e.metaKey)return!1;if(!n&&!e.ctrlKey)return!1;const i=t.tagName.toLowerCase();return"a"===i||"button"===i&&"submit"===t.type||"input"===i&&"submit"===t.type}(e)||(null!=r&&(y(e)&&(_(e)&&(null==i||i.resetValue()),null==i||i.setSelectedValue(e=>Array.isArray(e)?e.includes(r)?e.filter(e=>e!==r):[...e,r]:r)),w(e)&&(null==i||i.setValue(r))),C(e)&&(null==i||i.hide()))}),S=m.onKeyDown,k=pn(e=>{if(null==S||S(e),e.defaultPrevented)return;const t=null==i?void 0:i.getState().baseElement;t&&(qi(t)||(1===e.key.length||"Backspace"===e.key||"Delete"===e.key)&&(queueMicrotask(()=>t.focus()),Ut(t)&&(null==i||i.setValue(t.value))))});h&&null!=g&&(m=gt({"aria-selected":g},m)),m=wn(m,e=>(0,o.jsx)(Oi.Provider,{value:r,children:(0,o.jsx)(Pi.Provider,{value:null!=g&&g,children:e})}),[r,g]);const V=(0,Bt.useContext)(Vi);m=bt(gt({role:Nr(V),children:r},m),{onClick:j,onKeyDown:k});const I=xn(d);return m=Er(bt(gt({store:i},m),{getItem:b,moveOnKeyPress:e=>{if(!I(e))return!1;const t=new Event("combobox-item-move"),n=null==i?void 0:i.getState().baseElement;return null==n||n.dispatchEvent(t),!0}})),_r(gt({store:i,focusOnHover:c},m))}),Mr=En(In(function(e){return Nn("div",Fr(e))}));function Ar(e){return At(e).toLowerCase()}var Or=Fn(function(e){var t=e,{store:n,value:i,userValue:r}=t,a=xt(t,["store","value","userValue"]);const s=Ni();n=n||s;const l=(0,Bt.useContext)(Oi),u=null!=i?i:l,c=ti(n,e=>null!=r?r:null==e?void 0:e.value),d=(0,Bt.useMemo)(()=>{if(u)return c?function(e,t){if(!e)return e;if(!t)return e;const n=(i=t,Array.isArray(i)?i:void 0!==i?[i]:[]).filter(Boolean).map(Ar);var i;const r=[],a=(e,t=!1)=>(0,o.jsx)("span",{"data-autocomplete-value":t?"":void 0,"data-user-value":t?void 0:"",children:e},r.length),s=function(e){return e.sort(([e],[t])=>e-t)}(function(e){return e.filter(([e,t],n,i)=>!i.some(([i,r],a)=>a!==n&&i<=e&&i+r>=e+t))}(function(e,t){const n=[];for(const i of t){let t=0;const r=i.length;for(;-1!==e.indexOf(i,t);){const a=e.indexOf(i,t);-1!==a&&n.push([a,r]),t=a+1}}return n}(Ar(e),new Set(n))));if(!s.length)return r.push(a(e,!0)),r;const[l]=s[0],u=[e.slice(0,l),...s.flatMap(([t,n],i)=>{var r;const a=e.slice(t,t+n),l=null==(r=s[i+1])?void 0:r[0];return[a,e.slice(t+n,l)]})];return u.forEach((e,t)=>{e&&r.push(a(e,t%2==0))}),r}(u,c):u},[u,c]);return Dt(a=gt({children:d},a))}),Pr=In(function(e){return Nn("span",Or(e))}),Lr=n(731),Dr=n.n(Lr),Tr=n(307),Br=[],zr=(e,t)=>e.singleSelection?t?.value:Array.isArray(t?.value)?t.value:!Array.isArray(t?.value)&&t?.value?[t.value]:Br,Hr=[];function Rr({elements:e,getElements:t}){const n=Array.isArray(e)&&e.length>0?e:Hr,[i,a]=(0,r.useState)(n),[s,l]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{if(!t)return void a(n);let e=!1;return l(!0),t().then(t=>{if(!e){const e=Array.isArray(t)&&t.length>0?t:n;a(e)}}).catch(()=>{e||a(n)}).finally(()=>{e||l(!1)}),()=>{e=!0}},[t,n]),{elements:i,isLoading:s}}function $r(e=""){return Dr()(e.trim().toLowerCase())}var Wr=(e,t,n)=>e.singleSelection?n:Array.isArray(t?.value)?t.value.includes(n)?t.value.filter(e=>e!==n):[...t.value,n]:[n];function qr(e,t){return`${e}-${t}`}var Kr=({selected:e})=>(0,o.jsx)("span",{className:(0,U.A)("dataviews-filters__search-widget-listitem-multi-selection",{"is-selected":e}),children:e&&(0,o.jsx)(i.Icon,{icon:Oe})}),Gr=({selected:e})=>(0,o.jsx)("span",{className:(0,U.A)("dataviews-filters__search-widget-listitem-single-selection",{"is-selected":e})});function Yr({view:e,filter:t,onChangeView:n}){const l=(0,a.useInstanceId)(Yr,"dataviews-filter-list-box"),[u,c]=(0,r.useState)(1===t.operators?.length?void 0:null),d=e.filters?.find(e=>e.field===t.field),f=zr(t,d);return(0,o.jsx)(i.Composite,{virtualFocus:!0,focusLoop:!0,activeId:u,setActiveId:c,role:"listbox",className:"dataviews-filters__search-widget-listbox","aria-label":(0,s.sprintf)(
+/* translators: List of items for a filter. 1: Filter name. e.g.: "List of: Author". */
+/* translators: List of items for a filter. 1: Filter name. e.g.: "List of: Author". */
+(0,s.__)("List of: %1$s"),t.name),onFocusVisible:()=>{!u&&t.elements.length&&c(qr(l,t.elements[0].value))},render:(0,o.jsx)(i.Composite.Typeahead,{}),children:t.elements.map(r=>(0,o.jsxs)(i.Composite.Hover,{render:(0,o.jsx)(i.Composite.Item,{id:qr(l,r.value),render:(0,o.jsx)("div",{"aria-label":r.label,role:"option",className:"dataviews-filters__search-widget-listitem"}),onClick:()=>{const i=d?[...(e.filters??[]).map(e=>e.field===t.field?{...e,operator:d.operator||t.operators[0],value:Wr(t,d,r.value)}:e)]:[...e.filters??[],{field:t.field,operator:t.operators[0],value:Wr(t,d,r.value)}];n({...e,page:1,filters:i})}}),children:[t.singleSelection&&(0,o.jsx)(Gr,{selected:f===r.value}),!t.singleSelection&&(0,o.jsx)(Kr,{selected:f.includes(r.value)}),(0,o.jsx)("span",{children:r.label})]},r.value))})}function Ur({view:e,filter:t,onChangeView:n}){const[a,l]=(0,r.useState)(""),u=(0,r.useDeferredValue)(a),c=e.filters?.find(e=>e.field===t.field),d=zr(t,c),f=(0,r.useMemo)(()=>{const e=$r(u);return t.elements.filter(t=>$r(t.label).includes(e))},[t.elements,u]);return(0,o.jsxs)(Li,{selectedValue:d,setSelectedValue:i=>{const r=c?[...(e.filters??[]).map(e=>e.field===t.field?{...e,operator:c.operator||t.operators[0],value:i}:e)]:[...e.filters??[],{field:t.field,operator:t.operators[0],value:i}];n({...e,page:1,filters:r})},setValue:l,children:[(0,o.jsxs)("div",{className:"dataviews-filters__search-widget-filter-combobox__wrapper",children:[(0,o.jsx)(Ti,{render:(0,o.jsx)(i.VisuallyHidden,{children:(0,s.__)("Search items")}),children:(0,s.__)("Search items")}),(0,o.jsx)(dr,{autoSelect:"always",placeholder:(0,s.__)("Search"),className:"dataviews-filters__search-widget-filter-combobox__input"}),(0,o.jsx)("div",{className:"dataviews-filters__search-widget-filter-combobox__icon",children:(0,o.jsx)(i.Icon,{icon:Tr.A})})]}),(0,o.jsxs)(xr,{className:"dataviews-filters__search-widget-filter-combobox-list",alwaysVisible:!0,children:[f.map(e=>(0,o.jsxs)(Mr,{resetValueOnSelect:!1,value:e.value,className:"dataviews-filters__search-widget-listitem",hideOnClick:!1,setValueOnClick:!1,focusOnHover:!0,children:[t.singleSelection&&(0,o.jsx)(Gr,{selected:d===e.value}),!t.singleSelection&&(0,o.jsx)(Kr,{selected:d.includes(e.value)}),(0,o.jsxs)("span",{children:[(0,o.jsx)(Pr,{className:"dataviews-filters__search-widget-filter-combobox-item-value",value:e.label}),!!e.description&&(0,o.jsx)("span",{className:"dataviews-filters__search-widget-listitem-description",children:e.description})]})]},e.value)),!f.length&&(0,o.jsx)("p",{children:(0,s.__)("No results found")})]})]})}function Zr(e){const{elements:t,isLoading:n}=Rr({elements:e.filter.elements,getElements:e.filter.getElements});if(n)return(0,o.jsx)("div",{className:"dataviews-filters__search-widget-no-elements",children:(0,o.jsx)(i.Spinner,{})});if(0===t.length)return(0,o.jsx)("div",{className:"dataviews-filters__search-widget-no-elements",children:(0,s.__)("No elements found")});const r=t.length>10?Ur:Yr;return(0,o.jsx)(r,{...e,filter:{...e.filter,elements:t}})}var Xr=n(252),Qr=n.n(Xr);function Jr({filter:e,view:t,onChangeView:n,fields:s}){const l=t.filters?.find(t=>t.field===e.field),u=zr(e,l),c=(0,r.useMemo)(()=>{const t=s.find(t=>t.id===e.field);return t?{...t,isValid:{required:!1,custom:()=>null},getValue:({item:e})=>e[t.id],setValue:({value:e})=>({[t.id]:e})}:t},[s,e.field]),d=(0,r.useMemo)(()=>(t.filters??[]).reduce((e,t)=>(e[t.field]=t.value,e),{}),[t.filters]),f=(0,a.useEvent)(i=>{if(!c||!l)return;const r=c.getValue({item:i});Qr()(r,u)||n({...t,filters:(t.filters??[]).map(t=>t.field===e.field?{...t,operator:l.operator||e.operators[0],value:""===r?void 0:r}:t)})});return c&&c.Edit&&l?(0,o.jsx)(i.Flex,{className:"dataviews-filters__user-input-widget",gap:2.5,direction:"column",children:(0,o.jsx)(c.Edit,{hideLabelFromVision:!0,data:d,field:c,operator:l.operator,onChange:f})}):null}Math.pow(10,8);const ea=6048e5,ta=Symbol.for("constructDateFrom");function na(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&ta in e?e[ta](t):e instanceof Date?new e.constructor(t):new Date(t)}function ia(e,t){return na(t||e,e)}function ra(e){return!(!((t=e)instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t))&&"number"!=typeof e||isNaN(+ia(e)));var t}var aa=n(443);function sa(e){if(!e)return null;const t=(0,aa.getDate)(e);return t&&ra(t)?t:null}var la="Enter",oa=" ",ua=({activeElements:e,filterInView:t,filter:n})=>{if(void 0===e||0===e.length)return n.name;const i={Name:(0,o.jsx)("span",{className:"dataviews-filters__summary-filter-text-name"}),Value:(0,o.jsx)("span",{className:"dataviews-filters__summary-filter-text-value"})};if(t?.operator===m)return(0,r.createInterpolateElement)((0,s.sprintf)(
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is any: Admin, Editor". */
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is any: Admin, Editor". */
+(0,s.__)("%1$s is any: %2$s"),n.name,e.map(e=>e.label).join(", ")),i);if(t?.operator===v)return(0,r.createInterpolateElement)((0,s.sprintf)(
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is none: Admin, Editor". */
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is none: Admin, Editor". */
+(0,s.__)("%1$s is none: %2$s"),n.name,e.map(e=>e.label).join(", ")),i);if(t?.operator===p)return(0,r.createInterpolateElement)((0,s.sprintf)(
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is all: Admin, Editor". */
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is all: Admin, Editor". */
+(0,s.__)("%1$s is all: %2$s"),n.name,e.map(e=>e.label).join(", ")),i);if(t?.operator===h)return(0,r.createInterpolateElement)((0,s.sprintf)(
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is not all: Admin, Editor". */
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is not all: Admin, Editor". */
+(0,s.__)("%1$s is not all: %2$s"),n.name,e.map(e=>e.label).join(", ")),i);if(t?.operator===d)return(0,r.createInterpolateElement)((0,s.sprintf)(
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is: Admin". */
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is: Admin". */
+(0,s.__)("%1$s is: %2$s"),n.name,e[0].label),i);if(t?.operator===f)return(0,r.createInterpolateElement)((0,s.sprintf)(
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is not: Admin". */
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is not: Admin". */
+(0,s.__)("%1$s is not: %2$s"),n.name,e[0].label),i);if(t?.operator===g)return(0,r.createInterpolateElement)((0,s.sprintf)(
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is less than: 10". */
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is less than: 10". */
+(0,s.__)("%1$s is less than: %2$s"),n.name,e[0].label),i);if(t?.operator===b)return(0,r.createInterpolateElement)((0,s.sprintf)(
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is greater than: 10". */
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is greater than: 10". */
+(0,s.__)("%1$s is greater than: %2$s"),n.name,e[0].label),i);if(t?.operator===x)return(0,r.createInterpolateElement)((0,s.sprintf)(
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is less than or equal to: 10". */
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is less than or equal to: 10". */
+(0,s.__)("%1$s is less than or equal to: %2$s"),n.name,e[0].label),i);if(t?.operator===w)return(0,r.createInterpolateElement)((0,s.sprintf)(
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is greater than or equal to: 10". */
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is greater than or equal to: 10". */
+(0,s.__)("%1$s is greater than or equal to: %2$s"),n.name,e[0].label),i);if(t?.operator===S)return(0,r.createInterpolateElement)((0,s.sprintf)(
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Title contains: Mars". */
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Title contains: Mars". */
+(0,s.__)("%1$s contains: %2$s"),n.name,e[0].label),i);if(t?.operator===k)return(0,r.createInterpolateElement)((0,s.sprintf)(
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Description doesn't contain: photo". */
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Description doesn't contain: photo". */
+(0,s.__)("%1$s doesn't contain: %2$s"),n.name,e[0].label),i);if(t?.operator===V)return(0,r.createInterpolateElement)((0,s.sprintf)(
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Title starts with: Mar". */
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Title starts with: Mar". */
+(0,s.__)("%1$s starts with: %2$s"),n.name,e[0].label),i);if(t?.operator===y)return(0,r.createInterpolateElement)((0,s.sprintf)(
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is before: 2024-01-01". */
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is before: 2024-01-01". */
+(0,s.__)("%1$s is before: %2$s"),n.name,e[0].label),i);if(t?.operator===_)return(0,r.createInterpolateElement)((0,s.sprintf)(
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is after: 2024-01-01". */
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is after: 2024-01-01". */
+(0,s.__)("%1$s is after: %2$s"),n.name,e[0].label),i);if(t?.operator===C)return(0,r.createInterpolateElement)((0,s.sprintf)(
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is on or before: 2024-01-01". */
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is on or before: 2024-01-01". */
+(0,s.__)("%1$s is on or before: %2$s"),n.name,e[0].label),i);if(t?.operator===j)return(0,r.createInterpolateElement)((0,s.sprintf)(
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is on or after: 2024-01-01". */
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is on or after: 2024-01-01". */
+(0,s.__)("%1$s is on or after: %2$s"),n.name,e[0].label),i);if(t?.operator===I){const{label:t}=e[0];return(0,r.createInterpolateElement)((0,s.sprintf)(
+/* translators: 1: Filter name. 2: Min value. 3: Max value. e.g.: "Item count between (inc): 10 and 180". */
+/* translators: 1: Filter name. 2: Min value. 3: Max value. e.g.: "Item count between (inc): 10 and 180". */
+(0,s.__)("%1$s between (inc): %2$s and %3$s"),n.name,t[0],t[1]),i)}return t?.operator===E?(0,r.createInterpolateElement)((0,s.sprintf)(
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is: 2024-01-01". */
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is: 2024-01-01". */
+(0,s.__)("%1$s is: %2$s"),n.name,e[0].label),i):t?.operator===N?(0,r.createInterpolateElement)((0,s.sprintf)(
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is not: 2024-01-01". */
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is not: 2024-01-01". */
+(0,s.__)("%1$s is not: %2$s"),n.name,e[0].label),i):t?.operator===F?(0,r.createInterpolateElement)((0,s.sprintf)(
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is in the past: 1 days". */
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is in the past: 1 days". */
+(0,s.__)("%1$s is in the past: %2$s"),n.name,`${e[0].value.value} ${e[0].value.unit}`),i):t?.operator===M?(0,r.createInterpolateElement)((0,s.sprintf)(
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is over: 1 days ago". */
+/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is over: 1 days ago". */
+(0,s.__)("%1$s is over: %2$s ago"),n.name,`${e[0].value.value} ${e[0].value.unit}`),i):(0,s.sprintf)(
+/* translators: 1: Filter name e.g.: "Unknown status for Author". */
+/* translators: 1: Filter name e.g.: "Unknown status for Author". */
+(0,s.__)("Unknown status for %1$s"),n.name)};function ca({filter:e,view:t,onChangeView:n}){const r=e.operators?.map(e=>({value:e,label:P[e]?.label})),a=t.filters?.find(t=>t.field===e.field),l=a?.operator||e.operators[0];return r.length>1&&(0,o.jsxs)(i.__experimentalHStack,{spacing:2,justify:"flex-start",className:"dataviews-filters__summary-operators-container",children:[(0,o.jsx)(i.FlexItem,{className:"dataviews-filters__summary-operators-filter-name",children:e.name}),(0,o.jsx)(i.SelectControl,{className:"dataviews-filters__summary-operators-filter-select",label:(0,s.__)("Conditions"),value:l,options:r,onChange:i=>{const r=i,s=a?.operator,l=a?[...(t.filters??[]).map(t=>{if(t.field===e.field){const e=[I,F,M],n=s&&(e.includes(s)||e.includes(r));return{...t,value:n?void 0:t.value,operator:r}}return t})]:[...t.filters??[],{field:e.field,operator:r,value:void 0}];n({...t,page:1,filters:l})},size:"small",variant:"minimal",__nextHasNoMarginBottom:!0,hideLabelFromVision:!0})]})}function da({addFilterRef:e,openedFilter:t,fields:n,...a}){const l=(0,r.useRef)(null),{filter:u,view:c,onChangeView:d}=a,f=c.filters?.find(e=>e.field===u.field);let m=[];const{elements:v}=Rr({elements:u.elements,getElements:u.getElements});if(v.length>0)m=v.filter(e=>u.singleSelection?e.value===f?.value:f?.value?.includes(e.value));else if(void 0!==f?.value){const e=n.find(e=>e.id===u.field);let t=f.value;if("datetime"===e?.type&&"string"==typeof t)try{const e=sa(t);null!==e&&(t=e.toLocaleString())}catch(e){t=f.value}m=[{value:f.value,label:t}]}const p=u.isPrimary,h=f?.isLocked,g=!h&&void 0!==f?.value,b=!h&&(!p||g);return(0,o.jsx)(i.Dropdown,{defaultOpen:t===u.field,contentClassName:"dataviews-filters__summary-popover",popoverProps:{placement:"bottom-start",role:"dialog"},onClose:()=>{l.current?.focus()},renderToggle:({isOpen:t,onToggle:n})=>(0,o.jsxs)("div",{className:"dataviews-filters__summary-chip-container",children:[(0,o.jsx)(i.Tooltip,{text:(0,s.sprintf)(
+/* translators: 1: Filter name. */
+/* translators: 1: Filter name. */
+(0,s.__)("Filter by: %1$s"),u.name.toLowerCase()),placement:"top",children:(0,o.jsx)("div",{className:(0,U.A)("dataviews-filters__summary-chip",{"has-reset":b,"has-values":g,"is-not-clickable":h}),role:"button",tabIndex:h?-1:0,onClick:()=>{h||n()},onKeyDown:e=>{!h&&[la,oa].includes(e.key)&&(n(),e.preventDefault())},"aria-disabled":h,"aria-pressed":t,"aria-expanded":t,ref:l,children:(0,o.jsx)(ua,{activeElements:m,filterInView:f,filter:u})})}),b&&(0,o.jsx)(i.Tooltip,{text:p?(0,s.__)("Reset"):(0,s.__)("Remove"),placement:"top",children:(0,o.jsx)("button",{className:(0,U.A)("dataviews-filters__summary-chip-remove",{"has-values":g}),onClick:()=>{d({...c,page:1,filters:c.filters?.filter(e=>e.field!==u.field)}),p?l.current?.focus():e.current?.focus()},children:(0,o.jsx)(i.Icon,{icon:fe})})})]}),renderContent:()=>(0,o.jsxs)(i.__experimentalVStack,{spacing:0,justify:"flex-start",children:[(0,o.jsx)(ca,{...a}),a.filter.hasElements?(0,o.jsx)(Zr,{...a,filter:{...a.filter,elements:v}}):(0,o.jsx)(Jr,{...a,fields:n})]})})}function fa({filters:e,view:t,onChangeView:n}){const r=!t.search&&!t.filters?.some(t=>{return!(t.isLocked||void 0===t.value&&(n=t.field,e.some(e=>e.field===n&&e.isPrimary)));var n});return(0,o.jsx)(i.Button,{disabled:r,accessibleWhenDisabled:!0,size:"compact",variant:"tertiary",className:"dataviews-filters__reset-button",onClick:()=>{n({...t,page:1,search:"",filters:t.filters?.filter(e=>!!e.isLocked)||[]})},children:(0,s.__)("Reset")})}var ma=function(e,t){return(0,r.useMemo)(()=>{const n=[];return e.forEach(e=>{if(!1===e.filterBy||!e.hasElements&&!e.Edit)return;const i=e.filterBy.operators,r=!!e.filterBy?.isPrimary,a=t.filters?.some(t=>t.field===e.id&&!!t.isLocked)??!1;n.push({field:e.id,name:e.label,elements:e.elements,getElements:e.getElements,hasElements:e.hasElements,singleSelection:i.some(e=>O.includes(e)),operators:i,isVisible:a||r||!!t.filters?.some(t=>t.field===e.id&&A.includes(t.operator)),isPrimary:r,isLocked:a})}),n.sort((e,t)=>e.isLocked&&!t.isLocked?-1:!e.isLocked&&t.isLocked?1:e.isPrimary&&!t.isPrimary?-1:!e.isPrimary&&t.isPrimary?1:e.name.localeCompare(t.name)),n},[e,t])},va=(0,r.memo)(function({className:e}){const{fields:t,view:n,onChangeView:a,openedFilter:s,setOpenedFilter:l}=(0,r.useContext)(W),u=(0,r.useRef)(null),c=ma(t,n),d=(0,o.jsx)(lt,{filters:c,view:n,onChangeView:a,ref:u,setOpenedFilter:l},"add-filter"),f=c.filter(e=>e.isVisible);if(0===f.length)return null;const m=[...f.map(e=>(0,o.jsx)(da,{filter:e,view:n,fields:t,onChangeView:a,addFilterRef:u,openedFilter:s},e.field)),d];return m.push((0,o.jsx)(fa,{filters:c,view:n,onChangeView:a},"reset-filters")),(0,o.jsx)(i.__experimentalHStack,{justify:"flex-start",style:{width:"fit-content"},wrap:!0,className:e,children:m})}),pa=function(e){const{isShowingFilter:t}=(0,r.useContext)(W);return t?(0,o.jsx)(va,{...e}):null};function ha({className:e}){const{actions:t=[],data:n,fields:i,getItemId:a,getItemLevel:l,isLoading:u,view:c,onChangeView:d,selection:f,onChangeSelection:m,setOpenedFilter:v,onClickItem:p,isItemClickable:h,renderItemLink:g,defaultLayouts:b,empty:x=(0,o.jsx)("p",{children:(0,s.__)("No results")})}=(0,r.useContext)(W),w=rt.find(e=>e.type===c.type&&b[e.type])?.component;return(0,o.jsx)(w,{className:e,actions:t,data:n,fields:i,getItemId:a,getItemLevel:l,isLoading:u,onChangeView:d,onChangeSelection:m,selection:f,setOpenedFilter:v,onClickItem:p,renderItemLink:g,isItemClickable:h,view:c,empty:x})}var ga=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"})}),ba=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.Path,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"})});function xa(){const{view:e,onChangeView:t,paginationInfo:{totalItems:n=0,totalPages:a}}=(0,r.useContext)(W);if(!n||!a||e.infiniteScrollEnabled)return null;const l=e.page??1,u=Array.from(Array(a)).map((e,t)=>{const n=t+1;return{value:n.toString(),label:n.toString(),"aria-label":l===n?(0,s.sprintf)(
+// translators: 1: current page number. 2: total number of pages.
+// translators: 1: current page number. 2: total number of pages.
+(0,s.__)("Page %1$d of %2$d"),l,a):n.toString()}});return!!n&&1!==a&&(0,o.jsxs)(i.__experimentalHStack,{expanded:!1,className:"dataviews-pagination",justify:"end",spacing:6,children:[(0,o.jsx)(i.__experimentalHStack,{justify:"flex-start",expanded:!1,spacing:1,className:"dataviews-pagination__page-select",children:(0,r.createInterpolateElement)((0,s.sprintf)(
+// translators: 1: Current page number, 2: Total number of pages.
+// translators: 1: Current page number, 2: Total number of pages.
+(0,s._x)("Page
%1$sof %2$d
","paging"),"",a),{div:(0,o.jsx)("div",{"aria-hidden":!0}),CurrentPage:(0,o.jsx)(i.SelectControl,{"aria-label":(0,s.__)("Current page"),value:l.toString(),options:u,onChange:n=>{t({...e,page:+n})},size:"small",__nextHasNoMarginBottom:!0,variant:"minimal"})})}),(0,o.jsxs)(i.__experimentalHStack,{expanded:!1,spacing:1,children:[(0,o.jsx)(i.Button,{onClick:()=>t({...e,page:l-1}),disabled:1===l,accessibleWhenDisabled:!0,label:(0,s.__)("Previous page"),icon:(0,s.isRTL)()?ga:ba,showTooltip:!0,size:"compact",tooltipPosition:"top"}),(0,o.jsx)(i.Button,{onClick:()=>t({...e,page:l+1}),disabled:l>=a,accessibleWhenDisabled:!0,label:(0,s.__)("Next page"),icon:(0,s.isRTL)()?ba:ga,showTooltip:!0,size:"compact",tooltipPosition:"top"})]})]})}var wa=(0,r.memo)(xa),ya=[];function _a(){const{view:e,paginationInfo:{totalItems:t=0,totalPages:n},data:a,actions:s=ya}=(0,r.useContext)(W),l=pe(s,a)&&[H,R].includes(e.type);return!t||!n||n<=1&&!l?null:!!t&&(0,o.jsxs)(i.__experimentalHStack,{expanded:!1,justify:"end",className:"dataviews-footer",children:[l&&(0,o.jsx)(_e,{}),(0,o.jsx)(wa,{})]})}var Ca=(0,r.memo)(function({label:e}){const{view:t,onChangeView:n}=(0,r.useContext)(W),[l,u,c]=(0,a.useDebouncedInput)(t.search);(0,r.useEffect)(()=>{u(t.search??"")},[t.search,u]);const d=(0,r.useRef)(n),f=(0,r.useRef)(t);(0,r.useEffect)(()=>{d.current=n,f.current=t},[n,t]),(0,r.useEffect)(()=>{c!==f.current?.search&&d.current({...f.current,page:1,search:c})},[c]);const m=e||(0,s.__)("Search");return(0,o.jsx)(i.SearchControl,{className:"dataviews-search",__nextHasNoMarginBottom:!0,onChange:u,value:l,label:m,placeholder:m,size:"compact"})}),ja=Ca,Sa=n(684),ka=n(979),Va=n.n(ka);function Ia(){const e=(0,r.useContext)(W),{view:t,onChangeView:n}=e,a=t.infiniteScrollEnabled??!1;return e.hasInfiniteScrollHandler?(0,o.jsx)(i.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,s.__)("Enable infinite scroll"),help:(0,s.__)("Automatically load more content as you scroll, instead of showing pagination links."),checked:a,onChange:e=>{n({...t,infiniteScrollEnabled:e})}}):null}var{Menu:Ea}=ne(i.privateApis),Na={className:"dataviews-config__popover",placement:"bottom-end",offset:9};function Fa(){const{view:e,onChangeView:t,defaultLayouts:n}=(0,r.useContext)(W),a=Object.keys(n);if(a.length<=1)return null;const l=rt.find(t=>e.type===t.type);return(0,o.jsxs)(Ea,{children:[(0,o.jsx)(Ea.TriggerButton,{render:(0,o.jsx)(i.Button,{size:"compact",icon:l?.icon,label:(0,s.__)("Layout")})}),(0,o.jsx)(Ea.Popover,{children:a.map(i=>{const r=rt.find(e=>e.type===i);return r?(0,o.jsx)(Ea.RadioItem,{value:i,name:"view-actions-available-view",checked:i===e.type,hideOnClick:!0,onChange:i=>{switch(i.target.value){case"list":case"grid":case"table":case"pickerGrid":case"pickerTable":const r={...e};return"layout"in r&&delete r.layout,t({...r,type:i.target.value,...n[i.target.value]})}Va()("Invalid dataview")},children:(0,o.jsx)(Ea.ItemLabel,{children:r.label})},i):null})})]})}function Ma(){const{view:e,fields:t,onChangeView:n}=(0,r.useContext)(W),a=(0,r.useMemo)(()=>t.filter(e=>!1!==e.enableSorting).map(e=>({label:e.label,value:e.id})),[t]);return(0,o.jsx)(i.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,s.__)("Sort by"),value:e.sort?.field,options:a,onChange:t=>{n({...e,sort:{direction:e?.sort?.direction||"desc",field:t},showLevels:!1})}})}function Aa(){const{view:e,fields:t,onChangeView:n}=(0,r.useContext)(W);if(0===t.filter(e=>!1!==e.enableSorting).length)return null;let a=e.sort?.direction;return!a&&e.sort?.field&&(a="desc"),(0,o.jsx)(i.__experimentalToggleGroupControl,{className:"dataviews-view-config__sort-direction",__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,isBlock:!0,label:(0,s.__)("Order"),value:a,onChange:i=>{"asc"!==i&&"desc"!==i?Va()("Invalid direction"):n({...e,sort:{direction:i,field:e.sort?.field||t.find(e=>!1!==e.enableSorting)?.id||""},showLevels:!1})},children:L.map(e=>(0,o.jsx)(i.__experimentalToggleGroupControlOptionIcon,{value:e,icon:z[e],label:B[e]},e))})}function Oa(){const{view:e,config:t,onChangeView:n}=(0,r.useContext)(W),{infiniteScrollEnabled:a}=e;return!t||!t.perPageSizes||t.perPageSizes.length<2||t.perPageSizes.length>6||a?null:(0,o.jsx)(i.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,isBlock:!0,label:(0,s.__)("Items per page"),value:e.perPage||10,disabled:!e?.sort?.field,onChange:t=>{const i="number"==typeof t||void 0===t?t:parseInt(t,10);n({...e,perPage:i,page:1})},children:t.perPageSizes.map(e=>(0,o.jsx)(i.__experimentalToggleGroupControlOption,{value:e,label:e.toString()},e))})}function Pa({title:e,description:t,children:n}){return(0,o.jsxs)(i.__experimentalGrid,{columns:12,className:"dataviews-settings-section",gap:4,children:[(0,o.jsxs)("div",{className:"dataviews-settings-section__sidebar",children:[(0,o.jsx)(i.__experimentalHeading,{level:2,className:"dataviews-settings-section__title",children:e}),t&&(0,o.jsx)(i.__experimentalText,{variant:"muted",className:"dataviews-settings-section__description",children:t})]}),(0,o.jsx)(i.__experimentalGrid,{columns:8,gap:4,className:"dataviews-settings-section__content",children:n})]})}function La(){const{view:e}=(0,r.useContext)(W),t=(0,a.useInstanceId)(Da,"dataviews-view-config-dropdown"),n=rt.find(t=>t.type===e.type);return(0,o.jsx)(i.Dropdown,{expandOnMobile:!0,popoverProps:{...Na,id:t},renderToggle:({onToggle:e,isOpen:n})=>(0,o.jsx)(i.Button,{size:"compact",icon:Sa.A,label:(0,s._x)("View options","View is used as a noun"),onClick:e,"aria-expanded":n?"true":"false","aria-controls":t}),renderContent:()=>(0,o.jsx)(i.__experimentalDropdownContentWrapper,{paddingSize:"medium",className:"dataviews-config__popover-content-wrapper",children:(0,o.jsx)(i.__experimentalVStack,{className:"dataviews-view-config",spacing:6,children:(0,o.jsxs)(Pa,{title:(0,s.__)("Appearance"),children:[(0,o.jsxs)(i.__experimentalHStack,{expanded:!0,className:"is-divided-in-two",children:[(0,o.jsx)(Ma,{}),(0,o.jsx)(Aa,{})]}),!!n?.viewConfigOptions&&(0,o.jsx)(n.viewConfigOptions,{}),(0,o.jsx)(Ia,{}),(0,o.jsx)(Oa,{}),(0,o.jsx)(De,{})]})})})})}function Da(){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Fa,{}),(0,o.jsx)(La,{})]})}var Ta=(0,r.memo)(Da);function Ba({item:e,field:t}){const{elements:n,isLoading:i}=Rr({elements:t.elements,getElements:t.getElements}),r=t.getValue({item:e});return i||0===n.length?r:n?.find(e=>e.value===r)?.label||t.getValue({item:e})}var za=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ha={sort:function(e,t,n){return"asc"===n?e.localeCompare(t):t.localeCompare(e)},isValid:{elements:!0,custom:(e,t)=>{const n=t.getValue({item:e});return[void 0,"",null].includes(n)||za.test(n)?null:(0,s.__)("Value must be a valid email address.")}},Edit:"email",render:({item:e,field:t})=>t.hasElements?(0,o.jsx)(Ba,{item:e,field:t}):t.getValue({item:e}),enableSorting:!0,filterBy:{defaultOperators:[m,v],validOperators:[d,f,S,k,V,m,v,p,h]}},Ra={sort:function(e,t,n){return"asc"===n?e-t:t-e},isValid:{elements:!0,custom:(e,t)=>{const n=t.getValue({item:e});return[void 0,"",null].includes(n)||Number.isInteger(n)?null:(0,s.__)("Value must be an integer.")}},Edit:"integer",render:({item:e,field:t})=>t.hasElements?(0,o.jsx)(Ba,{item:e,field:t}):t.getValue({item:e}),enableSorting:!0,filterBy:{defaultOperators:[d,f,g,b,x,w,I],validOperators:[d,f,g,b,x,w,I,m,v,p,h]}},$a={sort:function(e,t,n){return"asc"===n?e-t:t-e},isValid:{elements:!0,custom:(e,t)=>{const n=t.getValue({item:e});return function(e){return""===e||null==e}(n)||Number.isFinite(n)?null:(0,s.__)("Value must be a number.")}},Edit:"number",render:({item:e,field:t})=>{t.hasElements;const n=t.getValue({item:e});return[null,void 0].includes(n)?null:Number(n).toFixed(2)},enableSorting:!0,filterBy:{defaultOperators:[d,f,g,b,x,w,I],validOperators:[d,f,g,b,x,w,I,m,v,p,h]}},Wa={sort:function(e,t,n){return"asc"===n?e.localeCompare(t):t.localeCompare(e)},isValid:{elements:!0,custom:()=>null},Edit:"text",render:({item:e,field:t})=>t.hasElements?(0,o.jsx)(Ba,{item:e,field:t}):t.getValue({item:e}),enableSorting:!0,filterBy:{defaultOperators:[m,v],validOperators:[d,f,S,k,V,m,v,p,h]}},qa={sort:function(e,t,n){const i=new Date(e).getTime(),r=new Date(t).getTime();return"asc"===n?i-r:r-i},isValid:{elements:!0,custom:()=>null},Edit:"datetime",render:({item:e,field:t})=>{if(t.elements)return(0,o.jsx)(Ba,{item:e,field:t});const n=t.getValue({item:e});if(["",void 0,null].includes(n))return null;try{const e=sa(n);return e?.toLocaleString()}catch(e){return null}},enableSorting:!0,filterBy:{defaultOperators:[E,N,y,_,C,j,F,M],validOperators:[E,N,y,_,C,j,F,M]}},Ka={sort:function(e,t,n){const i=new Date(e).getTime(),r=new Date(t).getTime();return"asc"===n?i-r:r-i},Edit:"date",isValid:{elements:!0,custom:()=>null},render:({item:e,field:t})=>{if(t.hasElements)return(0,o.jsx)(Ba,{item:e,field:t});const n=t.getValue({item:e});return n?(i=n,(0,aa.dateI18n)((0,aa.getSettings)().formats.date,(0,aa.getDate)(i))):"";var i},enableSorting:!0,filterBy:{defaultOperators:[E,N,y,_,C,j,F,M,I],validOperators:[E,N,y,_,C,j,F,M,I]}},Ga={sort:function(e,t,n){const i=Boolean(e);return i===Boolean(t)?0:"asc"===n?i?1:-1:i?-1:1},isValid:{elements:!0,custom:(e,t)=>{const n=t.getValue({item:e});return[void 0,"",null].includes(n)||[!0,!1].includes(n)?null:(0,s.__)("Value must be true, false, or undefined")}},Edit:"checkbox",render:({item:e,field:t})=>t.hasElements?(0,o.jsx)(Ba,{item:e,field:t}):!0===t.getValue({item:e})?(0,s.__)("True"):!1===t.getValue({item:e})?(0,s.__)("False"):null,enableSorting:!0,filterBy:{defaultOperators:[d,f],validOperators:[d,f]}},Ya={sort:function(){return 0},isValid:{elements:!0,custom:()=>null},Edit:null,render:()=>null,enableSorting:!1,filterBy:!1},Ua={sort:function(e,t,n){const i=Array.isArray(e)?e:[],r=Array.isArray(t)?t:[];if(i.length!==r.length)return"asc"===n?i.length-r.length:r.length-i.length;const a=i.join(","),s=r.join(",");return"asc"===n?a.localeCompare(s):s.localeCompare(a)},isValid:{elements:!0,custom:(e,t)=>{const n=t.getValue({item:e});return[void 0,"",null].includes(n)||Array.isArray(n)?n.every(e=>"string"==typeof e)?null:(0,s.__)("Every value must be a string."):(0,s.__)("Value must be an array.")}},Edit:"array",render:function({item:e,field:t}){return(t.getValue({item:e})||[]).join(", ")},enableSorting:!0,filterBy:{defaultOperators:[m,v],validOperators:[m,v,p,h]}},Za=Ua,Xa={sort:function(e,t,n){return 0},isValid:{elements:!0,custom:()=>null},Edit:"password",render:({item:e,field:t})=>t.hasElements?(0,o.jsx)(Ba,{item:e,field:t}):"••••••••",enableSorting:!1,filterBy:!1},Qa={sort:function(e,t,n){return"asc"===n?e.localeCompare(t):t.localeCompare(e)},isValid:{elements:!0,custom:()=>null},Edit:"telephone",render:({item:e,field:t})=>t.hasElements?(0,o.jsx)(Ba,{item:e,field:t}):t.getValue({item:e}),enableSorting:!0,filterBy:{defaultOperators:[m,v],validOperators:[d,f,S,k,V,m,v,p,h]}},Ja={grad:.9,turn:360,rad:360/(2*Math.PI)},es=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},ts=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},ns=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},is=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},rs=function(e){return{r:ns(e.r,0,255),g:ns(e.g,0,255),b:ns(e.b,0,255),a:ns(e.a)}},as=function(e){return{r:ts(e.r),g:ts(e.g),b:ts(e.b),a:ts(e.a,3)}},ss=/^#([0-9a-f]{3,8})$/i,ls=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},os=function(e){var t=e.r,n=e.g,i=e.b,r=e.a,a=Math.max(t,n,i),s=a-Math.min(t,n,i),l=s?a===t?(n-i)/s:a===n?2+(i-t)/s:4+(t-n)/s:0;return{h:60*(l<0?l+6:l),s:a?s/a*100:0,v:a/255*100,a:r}},us=function(e){var t=e.h,n=e.s,i=e.v,r=e.a;t=t/360*6,n/=100,i/=100;var a=Math.floor(t),s=i*(1-n),l=i*(1-(t-a)*n),o=i*(1-(1-t+a)*n),u=a%6;return{r:255*[i,l,s,s,o,i][u],g:255*[o,i,i,l,s,s][u],b:255*[s,s,o,i,i,l][u],a:r}},cs=function(e){return{h:is(e.h),s:ns(e.s,0,100),l:ns(e.l,0,100),a:ns(e.a)}},ds=function(e){return{h:ts(e.h),s:ts(e.s),l:ts(e.l),a:ts(e.a,3)}},fs=function(e){return us((n=(t=e).s,{h:t.h,s:(n*=((i=t.l)<50?i:100-i)/100)>0?2*n/(i+n)*100:0,v:i+n,a:t.a}));var t,n,i},ms=function(e){return{h:(t=os(e)).h,s:(r=(200-(n=t.s))*(i=t.v)/100)>0&&r<200?n*i/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,i,r},vs=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ps=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,hs=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gs=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,bs={string:[[function(e){var t=ss.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?ts(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?ts(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=hs.exec(e)||gs.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:rs({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(e){var t=vs.exec(e)||ps.exec(e);if(!t)return null;var n,i,r=cs({h:(n=t[1],i=t[2],void 0===i&&(i="deg"),Number(n)*(Ja[i]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return fs(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,i=e.b,r=e.a,a=void 0===r?1:r;return es(t)&&es(n)&&es(i)?rs({r:Number(t),g:Number(n),b:Number(i),a:Number(a)}):null},"rgb"],[function(e){var t=e.h,n=e.s,i=e.l,r=e.a,a=void 0===r?1:r;if(!es(t)||!es(n)||!es(i))return null;var s=cs({h:Number(t),s:Number(n),l:Number(i),a:Number(a)});return fs(s)},"hsl"],[function(e){var t=e.h,n=e.s,i=e.v,r=e.a,a=void 0===r?1:r;if(!es(t)||!es(n)||!es(i))return null;var s=function(e){return{h:is(e.h),s:ns(e.s,0,100),v:ns(e.v,0,100),a:ns(e.a)}}({h:Number(t),s:Number(n),v:Number(i),a:Number(a)});return us(s)},"hsv"]]},xs=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=(e=as(this.rgba)).r,n=e.g,i=e.b,a=(r=e.a)<1?ls(ts(255*r)):"","#"+ls(t)+ls(n)+ls(i)+a;var e,t,n,i,r,a},e.prototype.toRgb=function(){return as(this.rgba)},e.prototype.toRgbString=function(){return t=(e=as(this.rgba)).r,n=e.g,i=e.b,(r=e.a)<1?"rgba("+t+", "+n+", "+i+", "+r+")":"rgb("+t+", "+n+", "+i+")";var e,t,n,i,r},e.prototype.toHsl=function(){return ds(ms(this.rgba))},e.prototype.toHslString=function(){return t=(e=ds(ms(this.rgba))).h,n=e.s,i=e.l,(r=e.a)<1?"hsla("+t+", "+n+"%, "+i+"%, "+r+")":"hsl("+t+", "+n+"%, "+i+"%)";var e,t,n,i,r},e.prototype.toHsv=function(){return e=os(this.rgba),{h:ts(e.h),s:ts(e.s),v:ts(e.v),a:ts(e.a,3)};var e},e.prototype.invert=function(){return js({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),js(ws(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),js(ws(this.rgba,-e))},e.prototype.grayscale=function(){return js(ws(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),js(_s(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),js(_s(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?js({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):ts(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=ms(this.rgba);return"number"==typeof e?js({h:e,s:t.s,l:t.l,a:t.a}):ts(t.h)},e.prototype.isEqual=function(e){return this.toHex()===js(e).toHex()},e}(),js=function(e){return e instanceof Cs?e:new Cs(e)},Ss={sort:function(e,t,n){const i=js(e),r=js(t);if(!i.isValid()&&!r.isValid())return 0;if(!i.isValid())return"asc"===n?1:-1;if(!r.isValid())return"asc"===n?-1:1;const a=i.toHsl(),s=r.toHsl();return a.h!==s.h?"asc"===n?a.h-s.h:s.h-a.h:a.s!==s.s?"asc"===n?a.s-s.s:s.s-a.s:"asc"===n?a.l-s.l:s.l-a.l},isValid:{elements:!0,custom:(e,t)=>{const n=t.getValue({item:e});return[void 0,"",null].includes(n)||js(n).isValid()?null:(0,s.__)("Value must be a valid color.")}},Edit:"color",render:({item:e,field:t})=>{if(t.hasElements)return(0,o.jsx)(Ba,{item:e,field:t});const n=t.getValue({item:e});return n&&js(n).isValid()?(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,o.jsx)("div",{style:{width:"16px",height:"16px",borderRadius:"50%",backgroundColor:n,border:"1px solid #ddd",flexShrink:0}}),(0,o.jsx)("span",{children:n})]}):n},enableSorting:!0,filterBy:{defaultOperators:[m,v],validOperators:[d,f]}},ks={sort:function(e,t,n){return"asc"===n?e.localeCompare(t):t.localeCompare(e)},isValid:{elements:!0,custom:()=>null},Edit:"url",render:({item:e,field:t})=>t.hasElements?(0,o.jsx)(Ba,{item:e,field:t}):t.getValue({item:e}),enableSorting:!0,filterBy:{defaultOperators:[m,v],validOperators:[d,f,S,k,V,m,v,p,h]}};function Vs(e,t){let n;return e?.required&&t?.required?n=t?.required?.message?t.required:void 0:e?.elements&&t?.elements?n=t.elements:t?.custom&&(n=t.custom),n}var{ValidatedCheckboxControl:Is}=ne(i.privateApis);const Es={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function Ns(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Fs={date:Ns({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Ns({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Ns({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Ms={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function As(e){return(t,n)=>{let i;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{const t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}return i[e.argumentCallback?e.argumentCallback(t):t]}}function Os(e){return(t,n={})=>{const i=n.width,r=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],a=t.match(r);if(!a)return null;const s=a[0],l=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],o=Array.isArray(l)?function(e,t){for(let n=0;ne.test(s)):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}(l,e=>e.test(s));let u;return u=e.valueCallback?e.valueCallback(o):o,u=n.valueCallback?n.valueCallback(u):u,{value:u,rest:t.slice(s.length)}}}var Ps;const Ls={code:"en-US",formatDistance:(e,t,n)=>{let i;const r=Es[e];return i="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i},formatLong:Fs,formatRelative:(e,t,n,i)=>Ms[e],localize:{ordinalNumber:(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:As({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:As({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:As({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:As({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:As({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(Ps={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(Ps.matchPattern);if(!n)return null;const i=n[0],r=e.match(Ps.parsePattern);if(!r)return null;let a=Ps.valueCallback?Ps.valueCallback(r[0]):r[0];return a=t.valueCallback?t.valueCallback(a):a,{value:a,rest:e.slice(i.length)}}),era:Os({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Os({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:Os({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Os({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Os({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};let Ds={};function Ts(){return Ds}function Bs(e){const t=ia(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function zs(e,t){const n=ia(e,t?.in);return n.setHours(0,0,0,0),n}function Hs(e,t){const n=ia(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Rs(e,t){const n=ia(e,t?.in);return function(e,t,n){const[i,r]=function(e,...t){const n=na.bind(null,e||t.find(e=>"object"==typeof e));return t.map(n)}(n?.in,e,t),a=zs(i),s=zs(r),l=+a-Bs(a),o=+s-Bs(s);return Math.round((l-o)/864e5)}(n,Hs(n))+1}function $s(e,t){const n=Ts(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=ia(e,t?.in),a=r.getDay(),s=(a=a.getTime()?i+1:n.getTime()>=l.getTime()?i:i-1}function Ks(e,t){const n=ia(e,t?.in),i=+Ws(n)-+function(e,t){const n=qs(e,t),i=na(t?.in||e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Ws(i)}(n);return Math.round(i/ea)+1}function Gs(e,t){const n=ia(e,t?.in),i=n.getFullYear(),r=Ts(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=na(t?.in||e,0);s.setFullYear(i+1,0,a),s.setHours(0,0,0,0);const l=$s(s,t),o=na(t?.in||e,0);o.setFullYear(i,0,a),o.setHours(0,0,0,0);const u=$s(o,t);return+n>=+l?i+1:+n>=+u?i:i-1}function Ys(e,t){const n=ia(e,t?.in),i=+$s(n,t)-+function(e,t){const n=Ts(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=Gs(e,t),a=na(t?.in||e,0);return a.setFullYear(r,0,i),a.setHours(0,0,0,0),$s(a,t)}(n,t);return Math.round(i/ea)+1}function Us(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const Zs={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return Us("yy"===t?i%100:i,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):Us(n+1,2)},d:(e,t)=>Us(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>Us(e.getHours()%12||12,t.length),H:(e,t)=>Us(e.getHours(),t.length),m:(e,t)=>Us(e.getMinutes(),t.length),s:(e,t)=>Us(e.getSeconds(),t.length),S(e,t){const n=t.length,i=e.getMilliseconds();return Us(Math.trunc(i*Math.pow(10,n-3)),t.length)}},Xs={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),i=t>0?t:1-t;return n.ordinalNumber(i,{unit:"year"})}return Zs.y(e,t)},Y:function(e,t,n,i){const r=Gs(e,i),a=r>0?r:1-r;return"YY"===t?Us(a%100,2):"Yo"===t?n.ordinalNumber(a,{unit:"year"}):Us(a,t.length)},R:function(e,t){return Us(qs(e),t.length)},u:function(e,t){return Us(e.getFullYear(),t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Us(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Us(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return Zs.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return Us(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const r=Ys(e,i);return"wo"===t?n.ordinalNumber(r,{unit:"week"}):Us(r,t.length)},I:function(e,t,n){const i=Ks(e);return"Io"===t?n.ordinalNumber(i,{unit:"week"}):Us(i,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):Zs.d(e,t)},D:function(e,t,n){const i=Rs(e);return"Do"===t?n.ordinalNumber(i,{unit:"dayOfYear"}):Us(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const r=e.getDay(),a=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return Us(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const r=e.getDay(),a=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return Us(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),r=0===i?7:i;switch(t){case"i":return String(r);case"ii":return Us(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let r;switch(r=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let r;switch(r=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return Zs.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):Zs.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return"Ko"===t?n.ordinalNumber(i,{unit:"hour"}):Us(i,t.length)},k:function(e,t,n){let i=e.getHours();return 0===i&&(i=24),"ko"===t?n.ordinalNumber(i,{unit:"hour"}):Us(i,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Zs.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Zs.s(e,t)},S:function(e,t){return Zs.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return Js(i);case"XXXX":case"XX":return el(i);default:return el(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return Js(i);case"xxxx":case"xx":return el(i);default:return el(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Qs(i,":");default:return"GMT"+el(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Qs(i,":");default:return"GMT"+el(i,":")}},t:function(e,t,n){return Us(Math.trunc(+e/1e3),t.length)},T:function(e,t,n){return Us(+e,t.length)}};function Qs(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.trunc(i/60),a=i%60;return 0===a?n+String(r):n+String(r)+t+Us(a,2)}function Js(e,t){return e%60==0?(e>0?"-":"+")+Us(Math.abs(e)/60,2):el(e,t)}function el(e,t=""){const n=e>0?"-":"+",i=Math.abs(e);return n+Us(Math.trunc(i/60),2)+t+Us(i%60,2)}const tl=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},nl=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},il={p:nl,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return tl(e,t);let a;switch(i){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;default:a=t.dateTime({width:"full"})}return a.replace("{{date}}",tl(i,t)).replace("{{time}}",nl(r,t))}},rl=/^D+$/,al=/^Y+$/,sl=["D","DD","YY","YYYY"],ll=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ol=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ul=/^'([^]*?)'?$/,cl=/''/g,dl=/[a-zA-Z]/;function fl(e,t,n){const i=Ts(),r=n?.locale??i.locale??Ls,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=ia(e,n?.in);if(!ra(l))throw new RangeError("Invalid time value");let o=t.match(ol).map(e=>{const t=e[0];return"p"===t||"P"===t?(0,il[t])(e,r.formatLong):e}).join("").match(ll).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:ml(e)};if(Xs[t])return{isToken:!0,value:e};if(t.match(dl))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});r.localize.preprocessor&&(o=r.localize.preprocessor(l,o));const u={firstWeekContainsDate:a,weekStartsOn:s,locale:r};return o.map(i=>{if(!i.isToken)return i.value;const a=i.value;return(!n?.useAdditionalWeekYearTokens&&function(e){return al.test(e)}(a)||!n?.useAdditionalDayOfYearTokens&&function(e){return rl.test(e)}(a))&&function(e,t,n){const i=function(e,t,n){const i="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(i),sl.includes(e))throw new RangeError(i)}(a,t,String(e)),(0,Xs[a[0]])(l,a,r.localize,u)}).join("")}function ml(e){const t=e.match(ul);return t?t[1].replace(cl,"'"):e}var vl={[F]:[{value:"days",label:(0,s.__)("Days")},{value:"weeks",label:(0,s.__)("Weeks")},{value:"months",label:(0,s.__)("Months")},{value:"years",label:(0,s.__)("Years")}],[M]:[{value:"days",label:(0,s.__)("Days ago")},{value:"weeks",label:(0,s.__)("Weeks ago")},{value:"months",label:(0,s.__)("Months ago")},{value:"years",label:(0,s.__)("Years ago")}]};function pl({className:e,data:t,field:n,onChange:a,hideLabelFromVision:l,operator:u}){const c=vl[u===F?"inThePast":"over"],{id:d,label:f,getValue:m,setValue:v}=n,p=m({item:t}),{value:h="",unit:g=c[0].value}=p&&"object"==typeof p?p:{},b=(0,r.useCallback)(e=>a(v({item:t,value:{value:Number(e),unit:g}})),[a,v,t,g]),x=(0,r.useCallback)(e=>a(v({item:t,value:{value:h,unit:e}})),[a,v,t,h]);return(0,o.jsx)(i.BaseControl,{id:d,__nextHasNoMarginBottom:!0,className:(0,U.A)(e,"dataviews-controls__relative-date"),label:f,hideLabelFromVision:l,children:(0,o.jsxs)(i.__experimentalHStack,{spacing:2.5,children:[(0,o.jsx)(i.__experimentalNumberControl,{__next40pxDefaultSize:!0,className:"dataviews-controls__relative-date-number",spinControls:"none",min:1,step:1,value:h,onChange:b}),(0,o.jsx)(i.SelectControl,{className:"dataviews-controls__relative-date-unit",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,s.__)("Unit"),value:g,options:c,onChange:x,hideLabelFromVision:!0})]})})}var{DateCalendar:hl,ValidatedInputControl:gl}=ne(i.privateApis);function bl({data:e,field:t,onChange:n,hideLabelFromVision:a,validity:l}){const{id:u,label:c,description:d,setValue:f,getValue:m,isValid:v}=t,p=m({item:e}),h="string"==typeof p?p:void 0,[g,b]=(0,r.useState)(()=>sa(h)||new Date),x=(0,r.useRef)(null),w=(0,r.useRef)(),y=(0,r.useRef)(null),_=(0,r.useCallback)(t=>n(f({item:e,value:t})),[e,n,f]);(0,r.useEffect)(()=>()=>{w.current&&clearTimeout(w.current)},[]);const C=(0,r.useCallback)(e=>{let t;if(e){let n=e;if(h){const t=sa(h);t&&(n=new Date(e),n.setHours(t.getHours()),n.setMinutes(t.getMinutes()))}t=n.toISOString(),_(t),w.current&&clearTimeout(w.current)}else _(void 0);y.current=x.current&&x.current.ownerDocument.activeElement,w.current=setTimeout(()=>{x.current&&(x.current.focus(),x.current.blur(),_(t),y.current&&y.current instanceof HTMLElement&&y.current.focus())},0)},[_,h]),j=(0,r.useCallback)(e=>{if(e){const t=new Date(e);_(t.toISOString());const n=sa(t.toISOString());n&&b(n)}else _(void 0)},[_]),{timezone:{string:S},l10n:{startOfWeek:k}}=(0,aa.getSettings)(),V=v?.required&&!a?`${c} (${(0,s.__)("Required")})`:c;return(0,o.jsx)(i.BaseControl,{__nextHasNoMarginBottom:!0,id:u,label:V,help:d,hideLabelFromVision:a,children:(0,o.jsxs)(i.__experimentalVStack,{spacing:4,children:[(0,o.jsx)(hl,{style:{width:"100%"},selected:h&&sa(h)||void 0,onSelect:C,month:g,onMonthChange:b,timeZone:S||void 0,weekStartsOn:k}),(0,o.jsx)(gl,{ref:x,__next40pxDefaultSize:!0,required:!!v?.required,customValidity:Vs(v,l),type:"datetime-local",label:(0,s.__)("Date time"),hideLabelFromVision:!0,value:h?(I=sa(h)||void 0,I?"string"==typeof I?I:fl(I,"yyyy-MM-dd'T'HH:mm"):""):"",onChange:j})]})});var I}function xl(e,t,n){return function(e,t,n){const i=ia(e,n?.in);return isNaN(t)?na(n?.in||e,NaN):t?(i.setDate(i.getDate()+t),i):i}(e,-t,n)}function wl(e,t,n){const i=ia(e,n?.in);if(isNaN(t))return na(n?.in||e,NaN);if(!t)return i;const r=i.getDate(),a=na(n?.in||e,i.getTime());return a.setMonth(i.getMonth()+t+1,0),r>=a.getDate()?a:(i.setFullYear(a.getFullYear(),a.getMonth(),r),i)}function yl(e,t){const n=ia(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function _l(e,t,n){return function(e,t,n){return wl(e,12*t,n)}(e,-t,n)}var Cl=(0,o.jsx)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(l.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z"})}),{DateCalendar:jl,DateRangeCalendar:Sl}=ne(i.privateApis),kl=[{id:"today",label:(0,s.__)("Today"),getValue:()=>(0,aa.getDate)(null)},{id:"yesterday",label:(0,s.__)("Yesterday"),getValue:()=>xl((0,aa.getDate)(null),1)},{id:"past-week",label:(0,s.__)("Past week"),getValue:()=>xl((0,aa.getDate)(null),7)},{id:"past-month",label:(0,s.__)("Past month"),getValue:()=>{return wl((0,aa.getDate)(null),-1,e);var e}}],Vl=[{id:"last-7-days",label:(0,s.__)("Last 7 days"),getValue:()=>{const e=(0,aa.getDate)(null);return[xl(e,7),e]}},{id:"last-30-days",label:(0,s.__)("Last 30 days"),getValue:()=>{const e=(0,aa.getDate)(null);return[xl(e,30),e]}},{id:"month-to-date",label:(0,s.__)("Month to date"),getValue:()=>{const e=(0,aa.getDate)(null);return[yl(e),e]}},{id:"last-year",label:(0,s.__)("Last year"),getValue:()=>{const e=(0,aa.getDate)(null);return[_l(e,1),e]}},{id:"year-to-date",label:(0,s.__)("Year to date"),getValue:()=>{const e=(0,aa.getDate)(null);return[Hs(e),e]}}],Il=e=>{if(!e)return null;const t=(0,aa.getDate)(e);return t&&ra(t)?t:null},El=e=>e?"string"==typeof e?e:fl(e,"yyyy-MM-dd"):"";function Nl({field:e,validity:t,inputRefs:n,isTouched:a,setIsTouched:s,children:l}){const{isValid:u}=e,[c,d]=(0,r.useState)(void 0),f=(0,r.useCallback)(()=>{const e=Array.isArray(n)?n:[n];for(const t of e){const e=t.current;if(e&&!e.validity.valid)return void d({type:"invalid",message:e.validationMessage})}d(void 0)},[n]);return(0,r.useEffect)(()=>{if(a){const e=setTimeout(()=>{t?d(Vs(u,t)):f()},0);return()=>clearTimeout(e)}},[a,u,t,f]),(0,o.jsxs)("div",{onBlur:e=>{a||e.relatedTarget&&e.currentTarget.contains(e.relatedTarget)||s(!0)},children:[l,(0,o.jsx)("div",{"aria-live":"polite",children:c&&(0,o.jsxs)("p",{className:(0,U.A)("components-validated-control__indicator","invalid"===c.type?"is-invalid":void 0,"valid"===c.type?"is-valid":void 0),children:[(0,o.jsx)(i.Icon,{className:"components-validated-control__indicator-icon",icon:Cl,size:16,fill:"currentColor"}),c.message]})})]})}function Fl({data:e,field:t,onChange:n,hideLabelFromVision:a,validity:l}){const{id:u,label:c,setValue:d,getValue:f,isValid:m}=t,[v,p]=(0,r.useState)(null),h=f({item:e}),g="string"==typeof h?h:void 0,[b,x]=(0,r.useState)(()=>Il(g)||new Date),[w,y]=(0,r.useState)(!1),_=(0,r.useRef)(null),C=(0,r.useCallback)(t=>n(d({item:e,value:t})),[e,n,d]),j=(0,r.useCallback)(e=>{const t=e?fl(e,"yyyy-MM-dd"):void 0;C(t),p(null),y(!0)},[C]),S=(0,r.useCallback)(e=>{const t=e.getValue(),n=El(t);x(t),C(n),p(e.id),y(!0)},[C]),k=(0,r.useCallback)(e=>{if(C(e),e){const t=Il(e);t&&x(t)}p(null),y(!0)},[C]),{timezone:{string:V},l10n:{startOfWeek:I}}=(0,aa.getSettings)(),E=m?.required?`${c} (${(0,s.__)("Required")})`:c;return(0,o.jsx)(Nl,{field:t,validity:l,inputRefs:_,isTouched:w,setIsTouched:y,children:(0,o.jsx)(i.BaseControl,{__nextHasNoMarginBottom:!0,id:u,className:"dataviews-controls__date",label:E,hideLabelFromVision:a,children:(0,o.jsxs)(i.__experimentalVStack,{spacing:4,children:[(0,o.jsxs)(i.__experimentalHStack,{spacing:2,wrap:!0,justify:"flex-start",children:[kl.map(e=>{const t=v===e.id;return(0,o.jsx)(i.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:t,size:"small",onClick:()=>S(e),children:e.label},e.id)}),(0,o.jsx)(i.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:!v,size:"small",disabled:!!v,accessibleWhenDisabled:!1,children:(0,s.__)("Custom")})]}),(0,o.jsx)(i.__experimentalInputControl,{__next40pxDefaultSize:!0,ref:_,type:"date",label:(0,s.__)("Date"),hideLabelFromVision:!0,value:g,onChange:k,required:!!t.isValid?.required}),(0,o.jsx)(jl,{style:{width:"100%"},selected:g&&Il(g)||void 0,onSelect:j,month:b,onMonthChange:x,timeZone:V||void 0,weekStartsOn:I})]})})})}function Ml({data:e,field:t,onChange:n,hideLabelFromVision:a,validity:l}){const{id:u,label:c,getValue:d,setValue:f}=t;let m;const v=d({item:e});Array.isArray(v)&&2===v.length&&v.every(e=>"string"==typeof e)&&(m=v);const p=(0,r.useCallback)(t=>{n(f({item:e,value:t}))},[e,n,f]),[h,g]=(0,r.useState)(null),b=(0,r.useMemo)(()=>{if(!m)return{from:void 0,to:void 0};const[e,t]=m;return{from:Il(e)||void 0,to:Il(t)||void 0}},[m]),[x,w]=(0,r.useState)(()=>b.from||new Date),[y,_]=(0,r.useState)(!1),C=(0,r.useRef)(null),j=(0,r.useRef)(null),S=(0,r.useCallback)((e,t)=>{e&&t?p([El(e),El(t)]):e||t||p(void 0)},[p]),k=(0,r.useCallback)(e=>{S(e?.from,e?.to),g(null),_(!0)},[S]),V=(0,r.useCallback)(e=>{const[t,n]=e.getValue();w(t),S(t,n),g(e.id),_(!0)},[S]),I=(0,r.useCallback)((e,t)=>{const[n,i]=m||[void 0,void 0];if(S("from"===e?t:n,"to"===e?t:i),t){const e=Il(t);e&&w(e)}g(null),_(!0)},[m,S]),{timezone:E,l10n:N}=(0,aa.getSettings)(),F=t.isValid?.required?`${c} (${(0,s.__)("Required")})`:c;return(0,o.jsx)(Nl,{field:t,validity:l,inputRefs:[C,j],isTouched:y,setIsTouched:_,children:(0,o.jsx)(i.BaseControl,{__nextHasNoMarginBottom:!0,id:u,className:"dataviews-controls__date",label:F,hideLabelFromVision:a,children:(0,o.jsxs)(i.__experimentalVStack,{spacing:4,children:[(0,o.jsxs)(i.__experimentalHStack,{spacing:2,wrap:!0,justify:"flex-start",children:[Vl.map(e=>{const t=h===e.id;return(0,o.jsx)(i.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:t,size:"small",onClick:()=>V(e),children:e.label},e.id)}),(0,o.jsx)(i.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:!h,size:"small",accessibleWhenDisabled:!1,disabled:!!h,children:(0,s.__)("Custom")})]}),(0,o.jsxs)(i.__experimentalHStack,{spacing:2,children:[(0,o.jsx)(i.__experimentalInputControl,{__next40pxDefaultSize:!0,ref:C,type:"date",label:(0,s.__)("From"),hideLabelFromVision:!0,value:m?.[0],onChange:e=>I("from",e),required:!!t.isValid?.required}),(0,o.jsx)(i.__experimentalInputControl,{__next40pxDefaultSize:!0,ref:j,type:"date",label:(0,s.__)("To"),hideLabelFromVision:!0,value:m?.[1],onChange:e=>I("to",e),required:!!t.isValid?.required})]}),(0,o.jsx)(Sl,{style:{width:"100%"},selected:b,onSelect:k,month:x,onMonthChange:w,timeZone:E.string||void 0,weekStartsOn:N.startOfWeek})]})})})}var Al=(0,o.jsx)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(l.Path,{d:"M12.5939 21C14.1472 21 16.1269 20.5701 17.0711 20.1975L16.6447 18.879C16.0964 19.051 14.3299 19.6242 12.6548 19.6242C7.4467 19.6242 4.67513 16.8726 4.67513 12C4.67513 7.21338 7.50762 4.34713 12.2893 4.34713C17.132 4.34713 19.4162 7.55732 19.4162 10.7675C19.4162 14.035 19.0508 15.4968 17.4975 15.4968C16.5838 15.4968 16.0964 14.7803 16.0964 13.9777V7.5H14.4822V8.30255H14.3909C14.1777 7.67198 12.9898 7.12739 11.467 7.2707C9.18274 7.5 7.4467 9.27707 7.4467 11.8567C7.4467 14.5796 8.81726 16.672 11.467 16.758C13.203 16.8153 14.1168 16.0127 14.4822 15.1815H14.5736C14.7563 16.414 16.401 16.8439 17.467 16.8439C20.6954 16.8439 21 13.5764 21 10.7962C21 6.86943 18.0761 3 12.3807 3C6.50254 3 3 6.3535 3 11.9427C3 17.7325 6.38071 21 12.5939 21ZM11.7107 15.2962C9.73096 15.2962 9.03046 13.6051 9.03046 11.7707C9.03046 10.1083 10.0355 8.67516 11.7716 8.67516C13.599 8.67516 14.5736 9.36306 14.5736 11.7707C14.5736 14.1497 13.7513 15.2962 11.7107 15.2962Z"})}),{ValidatedInputControl:Ol}=ne(i.privateApis);function Pl({data:e,field:t,onChange:n,hideLabelFromVision:i,type:a,prefix:s,suffix:l,validity:u}){const{label:c,placeholder:d,description:f,getValue:m,setValue:v,isValid:p}=t,h=m({item:e}),g=(0,r.useCallback)(t=>n(v({item:e,value:t})),[e,v,n]);return(0,o.jsx)(Ol,{required:!!p?.required,customValidity:Vs(p,u),label:c,placeholder:d,value:h??"",help:f,onChange:g,hideLabelFromVision:i,type:a,prefix:s,suffix:l,__next40pxDefaultSize:!0})}var Ll=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.Path,{d:"M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z"})}),Dl=(0,o.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(l.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"})}),{ValidatedNumberControl:Tl}=ne(i.privateApis);function Bl(e){if(""===e||void 0===e)return"";const t=Number(e);return Number.isFinite(t)?t:""}function zl({value:e,onChange:t,hideLabelFromVision:n,step:a}){const[l="",u=""]=e,c=(0,r.useCallback)(e=>t([Bl(e),u]),[t,u]),d=(0,r.useCallback)(e=>t([l,Bl(e)]),[t,l]);return(0,o.jsx)(i.BaseControl,{__nextHasNoMarginBottom:!0,help:(0,s.__)("The max. value must be greater than the min. value."),children:(0,o.jsxs)(i.Flex,{direction:"row",gap:4,children:[(0,o.jsx)(i.__experimentalNumberControl,{label:(0,s.__)("Min."),value:l,max:u?Number(u)-a:void 0,onChange:c,__next40pxDefaultSize:!0,hideLabelFromVision:n,step:a}),(0,o.jsx)(i.__experimentalNumberControl,{label:(0,s.__)("Max."),value:u,min:l?Number(l)+a:void 0,onChange:d,__next40pxDefaultSize:!0,hideLabelFromVision:n,step:a})]})})}function Hl({data:e,field:t,onChange:n,hideLabelFromVision:i,operator:a,decimals:s,validity:l}){const u=Math.pow(10,-1*Math.abs(s)),{label:c,description:d,getValue:f,setValue:m,isValid:v}=t,p=f({item:e})??"",h=(0,r.useCallback)(t=>{n(m({item:e,value:["",void 0].includes(t)?void 0:Number(t)}))},[e,n,m]),g=(0,r.useCallback)(t=>{n(m({item:e,value:t}))},[e,n,m]);if(a===I){let e=["",""];return Array.isArray(p)&&2===p.length&&p.every(e=>"number"==typeof e||""===e)&&(e=p),(0,o.jsx)(zl,{value:e,onChange:g,hideLabelFromVision:i,step:u})}return(0,o.jsx)(Tl,{required:!!v?.required,customValidity:Vs(v,l),label:c,help:d,value:p,onChange:h,__next40pxDefaultSize:!0,hideLabelFromVision:i,step:u})}var{ValidatedRadioControl:Rl}=ne(i.privateApis),{ValidatedSelectControl:$l}=ne(i.privateApis),{ValidatedToggleControl:Wl}=ne(i.privateApis),{ValidatedTextareaControl:ql}=ne(i.privateApis),{ValidatedToggleGroupControl:Kl}=ne(i.privateApis),{ValidatedFormTokenField:Gl}=ne(i.privateApis),{ValidatedInputControl:Yl,Picker:Ul}=ne(i.privateApis),Zl=({color:e,onColorChange:t})=>{const n=e&&js(e).isValid()?e:"#ffffff";return(0,o.jsx)(i.Dropdown,{renderToggle:({onToggle:e,isOpen:t})=>(0,o.jsx)(i.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,o.jsx)("button",{type:"button",onClick:e,style:{width:"24px",height:"24px",borderRadius:"50%",backgroundColor:n,border:"1px solid #ddd",cursor:"pointer",outline:t?"2px solid #007cba":"none",outlineOffset:"2px",display:"flex",alignItems:"center",justifyContent:"center",padding:0,margin:0},"aria-label":"Open color picker"})}),renderContent:()=>(0,o.jsx)("div",{style:{padding:"16px"},children:(0,o.jsx)(Ul,{color:js(n),onChange:t,enableAlpha:!0})})})},Xl=(0,o.jsx)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(l.Path,{d:"M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z"})});function Ql(e){return Array.isArray(e.elements)&&e.elements.length>0||"function"==typeof e.getElements}var Jl={array:function({data:e,field:t,onChange:n,hideLabelFromVision:a,validity:s}){const{label:l,placeholder:u,getValue:c,setValue:d,isValid:f}=t,m=c({item:e}),{elements:v,isLoading:p}=Rr({elements:t.elements,getElements:t.getElements}),h=(0,r.useMemo)(()=>Array.isArray(m)?m.map(e=>{const t=v?.find(t=>t.value===e);return t||{value:e,label:e}}):[],[m,v]),g=(0,r.useCallback)(t=>{const i=t.map(e=>"object"==typeof e&&"value"in e?e.value:e);n(d({item:e,value:i}))},[n,d,e]);return p?(0,o.jsx)(i.Spinner,{}):(0,o.jsx)(Gl,{required:!!f?.required,customValidity:Vs(f,s),label:a?void 0:l,value:h,onChange:g,placeholder:u,suggestions:v?.map(e=>e.value),__experimentalValidateInput:e=>!t.isValid?.elements||!v||v.some(t=>t.value===e||t.label===e),__experimentalExpandOnFocus:v&&v.length>0,__experimentalShowHowTo:!t.isValid?.elements,displayTransform:e=>{if("object"==typeof e&&"label"in e)return e.label;if("string"==typeof e&&v){const t=v.find(t=>t.value===e);return t?.label||e}return e},__experimentalRenderItem:({item:e})=>{if("string"==typeof e&&v){const t=v.find(t=>t.value===e);return(0,o.jsx)("span",{children:t?.label||e})}return(0,o.jsx)("span",{children:e})}})},checkbox:function({field:e,onChange:t,data:n,hideLabelFromVision:i,validity:a}){const{getValue:s,setValue:l,label:u,description:c,isValid:d}=e,f=(0,r.useCallback)(()=>{t(l({item:n,value:!s({item:n})}))},[n,s,t,l]);return(0,o.jsx)(Is,{required:!!e.isValid?.required,customValidity:Vs(d,a),hidden:i,label:u,help:c,checked:s({item:n}),onChange:f})},color:function({data:e,field:t,onChange:n,hideLabelFromVision:i,validity:a}){const{label:s,placeholder:l,description:u,setValue:c,isValid:d}=t,f=t.getValue({item:e})||"",m=(0,r.useCallback)(t=>{n(c({item:e,value:t.toHex()}))},[e,n,c]),v=(0,r.useCallback)(t=>{n(c({item:e,value:t||""}))},[e,n,c]);return(0,o.jsx)(Yl,{required:!!t.isValid?.required,customValidity:Vs(d,a),label:s,placeholder:l,value:f,help:u,onChange:v,hideLabelFromVision:i,type:"text",prefix:(0,o.jsx)(Zl,{color:f,onColorChange:m})})},datetime:function({data:e,field:t,onChange:n,hideLabelFromVision:i,operator:r,validity:a}){return r===F||r===M?(0,o.jsx)(pl,{className:"dataviews-controls__datetime",data:e,field:t,onChange:n,hideLabelFromVision:i,operator:r}):(0,o.jsx)(bl,{data:e,field:t,onChange:n,hideLabelFromVision:i,validity:a})},date:function({data:e,field:t,onChange:n,hideLabelFromVision:i,operator:r,validity:a}){return r===F||r===M?(0,o.jsx)(pl,{className:"dataviews-controls__date",data:e,field:t,onChange:n,hideLabelFromVision:i,operator:r}):r===I?(0,o.jsx)(Ml,{data:e,field:t,onChange:n,hideLabelFromVision:i,validity:a}):(0,o.jsx)(Fl,{data:e,field:t,onChange:n,hideLabelFromVision:i,validity:a})},email:function({data:e,field:t,onChange:n,hideLabelFromVision:r,validity:a}){return(0,o.jsx)(Pl,{data:e,field:t,onChange:n,hideLabelFromVision:r,validity:a,type:"email",prefix:(0,o.jsx)(i.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,o.jsx)(i.Icon,{icon:Al})})})},telephone:function({data:e,field:t,onChange:n,hideLabelFromVision:r,validity:a}){return(0,o.jsx)(Pl,{data:e,field:t,onChange:n,hideLabelFromVision:r,validity:a,type:"tel",prefix:(0,o.jsx)(i.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,o.jsx)(i.Icon,{icon:Ll})})})},url:function({data:e,field:t,onChange:n,hideLabelFromVision:r,validity:a}){return(0,o.jsx)(Pl,{data:e,field:t,onChange:n,hideLabelFromVision:r,validity:a,type:"url",prefix:(0,o.jsx)(i.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,o.jsx)(i.Icon,{icon:Dl})})})},integer:function(e){return(0,o.jsx)(Hl,{...e,decimals:0})},number:function(e){return(0,o.jsx)(Hl,{...e,decimals:2})},password:function({data:e,field:t,onChange:n,hideLabelFromVision:a,validity:l}){const[u,c]=(0,r.useState)(!1),d=(0,r.useCallback)(()=>{c(e=>!e)},[]);return(0,o.jsx)(Pl,{data:e,field:t,onChange:n,hideLabelFromVision:a,validity:l,type:u?"text":"password",suffix:(0,o.jsx)(i.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,o.jsx)(i.Button,{icon:u?ke:Xl,onClick:d,size:"small",label:u?(0,s.__)("Hide password"):(0,s.__)("Show password")})})})},radio:function({data:e,field:t,onChange:n,hideLabelFromVision:a,validity:s}){const{label:l,description:u,getValue:c,setValue:d,isValid:f}=t,{elements:m,isLoading:v}=Rr({elements:t.elements,getElements:t.getElements}),p=c({item:e}),h=(0,r.useCallback)(t=>n(d({item:e,value:t})),[e,n,d]);return v?(0,o.jsx)(i.Spinner,{}):(0,o.jsx)(Rl,{required:!!t.isValid?.required,customValidity:Vs(f,s),label:l,help:u,onChange:h,options:m,selected:p,hideLabelFromVision:a})},select:function({data:e,field:t,onChange:n,hideLabelFromVision:a,validity:s}){const{type:l,label:u,description:c,getValue:d,setValue:f,isValid:m}=t,v="array"===l,p=d({item:e})??(v?[]:""),h=(0,r.useCallback)(t=>n(f({item:e,value:t})),[e,n,f]),{elements:g,isLoading:b}=Rr({elements:t.elements,getElements:t.getElements});return b?(0,o.jsx)(i.Spinner,{}):(0,o.jsx)($l,{required:!!t.isValid?.required,customValidity:Vs(m,s),label:u,value:p,help:c,options:g,onChange:h,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:a,multiple:v})},text:function({data:e,field:t,onChange:n,hideLabelFromVision:i,config:a,validity:s}){const{prefix:l,suffix:u}=a||{};return(0,o.jsx)(Pl,{data:e,field:t,onChange:n,hideLabelFromVision:i,validity:s,prefix:l?(0,r.createElement)(l):void 0,suffix:u?(0,r.createElement)(u):void 0})},toggle:function({field:e,onChange:t,data:n,hideLabelFromVision:i,validity:a}){const{label:s,description:l,getValue:u,setValue:c,isValid:d}=e,f=(0,r.useCallback)(()=>{t(c({item:n,value:!u({item:n})}))},[t,c,n,u]);return(0,o.jsx)(Wl,{required:!!d.required,customValidity:Vs(d,a),hidden:i,__nextHasNoMarginBottom:!0,label:s,help:l,checked:u({item:n}),onChange:f})},textarea:function({data:e,field:t,onChange:n,hideLabelFromVision:i,config:a,validity:s}){const{rows:l=4}=a||{},{label:u,placeholder:c,description:d,setValue:f,isValid:m}=t,v=t.getValue({item:e}),p=(0,r.useCallback)(t=>n(f({item:e,value:t})),[e,n,f]);return(0,o.jsx)(ql,{required:!!m?.required,customValidity:Vs(m,s),label:u,placeholder:c,value:v??"",help:d,onChange:p,rows:l,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:i})},toggleGroup:function({data:e,field:t,onChange:n,hideLabelFromVision:a,validity:s}){const{getValue:l,setValue:u,isValid:c}=t,d=l({item:e}),f=(0,r.useCallback)(t=>n(u({item:e,value:t})),[e,n,u]),{elements:m,isLoading:v}=Rr({elements:t.elements,getElements:t.getElements});if(v)return(0,o.jsx)(i.Spinner,{});if(0===m.length)return null;const p=m.find(e=>e.value===d);return(0,o.jsx)(Kl,{required:!!t.isValid?.required,customValidity:Vs(c,s),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,isBlock:!0,label:t.label,help:p?.description||t.description,onChange:f,value:d,hideLabelFromVision:a,children:m.map(e=>(0,o.jsx)(i.__experimentalToggleGroupControlOption,{label:e.label,value:e.value},e.value))})}};function eo(e){return e&&"object"==typeof e&&"string"==typeof e.control}function to(e){const{control:t,...n}=e,i=no(t);return function(e){return(0,o.jsx)(i,{...e,config:n})}}function no(e){if(Object.keys(Jl).includes(e))return Jl[e];throw"Control "+e+" not found"}var io=e=>e.id,ro=()=>!0,ao=[],so=rt.filter(e=>!e.isPicker);function lo({header:e,search:t=!0,searchLabel:n}){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(i.__experimentalHStack,{alignment:"top",justify:"space-between",className:"dataviews__view-actions",spacing:1,children:[(0,o.jsxs)(i.__experimentalHStack,{justify:"start",expanded:!1,className:"dataviews__search",children:[t&&(0,o.jsx)(ja,{label:n}),(0,o.jsx)(ut,{})]}),(0,o.jsxs)(i.__experimentalHStack,{spacing:1,expanded:!1,style:{flexShrink:0},children:[(0,o.jsx)(Ta,{}),e]})]}),(0,o.jsx)(pa,{className:"dataviews-filters__container"}),(0,o.jsx)(ha,{}),(0,o.jsx)(_a,{})]})}var oo=function({view:e,onChangeView:t,fields:n,search:i=!0,searchLabel:s,actions:l=ao,data:u,getItemId:c=io,getItemLevel:m,isLoading:v=!1,paginationInfo:p,defaultLayouts:h,selection:g,onChangeSelection:b,onClickItem:x,renderItemLink:w,isItemClickable:y=ro,header:_,children:C,config:j={perPageSizes:[10,20,50,100]},empty:S}){const{infiniteScrollHandler:k}=p,V=(0,r.useRef)(null),[E,N]=(0,r.useState)(0),F=(0,a.useResizeObserver)(e=>{N(e[0].borderBoxSize[0].inlineSize)},{box:"border-box"}),[M,P]=(0,r.useState)([]),L=void 0===g||void 0===b,D=L?M:g,[T,B]=(0,r.useState)(null),z=(0,r.useMemo)(()=>function(e){return e.map(e=>{const t="email"===(n=e.type)?Ha:"integer"===n?Ra:"number"===n?$a:"text"===n?Wa:"datetime"===n?qa:"date"===n?Ka:"boolean"===n?Ga:"media"===n?Ya:"array"===n?Za:"password"===n?Xa:"telephone"===n?Qa:"color"===n?Ss:"url"===n?ks:{sort:(e,t,n)=>"number"==typeof e&&"number"==typeof t?"asc"===n?e-t:t-e:"asc"===n?e.localeCompare(t):t.localeCompare(e),isValid:{elements:!0,custom:()=>null},Edit:null,render:({item:e,field:t})=>t.hasElements?(0,o.jsx)(Ba,{item:e,field:t}):t.getValue({item:e}),enableSorting:!0,filterBy:{defaultOperators:[d,f],validOperators:A}};var n;const i=e.getValue||(r=e.id,({item:e})=>{const t=r.split(".");let n=e;for(const e of t)n=n.hasOwnProperty(e)?n[e]:void 0;return n});var r;const a=e.setValue||(e=>({value:t})=>{const n=e.split("."),i={};let r=i;for(const e of n.slice(0,-1))r[e]={},r=r[e];return r[n.at(-1)]=t,i})(e.id),s=e.sort??function(e,n,r){return t.sort(i({item:e}),i({item:n}),r)},l={...t.isValid,...e.isValid},u=function(e,t){return"function"==typeof e.Edit?e.Edit:"string"==typeof e.Edit?no(e.Edit):eo(e.Edit)?to(e.Edit):Ql(e)&&"array"!==e.type?no("select"):"string"==typeof t.Edit?no(t.Edit):eo(t.Edit)?to(t.Edit):t.Edit}(e,t),c=e.render??function({item:e,field:n}){return t.render({item:e,field:n})},m=function(e,t){if(!1===e.filterBy)return!1;if("object"==typeof e.filterBy){let n=e.filterBy.operators;n&&Array.isArray(n)||(n=t.filterBy?t.filterBy.defaultOperators:[]);let i=A;return"object"==typeof t.filterBy&&(i=t.filterBy.validOperators),n=n.filter(e=>i.includes(e)),Ql(e)&&n.includes(I)&&(n=n.filter(e=>e!==I)),n.some(e=>O.includes(e))&&(n=n.filter(e=>[...O,I].includes(e))),0!==n.length&&{isPrimary:!!e.filterBy.isPrimary,operators:n}}if(!1===t.filterBy)return!1;let n=t.filterBy.defaultOperators;return Ql(e)&&n.includes(I)&&(n=n.filter(e=>e!==I)),{operators:n}}(e,t);return{...e,label:e.label||e.id,header:e.header||e.label||e.id,getValue:i,setValue:a,render:c,sort:s,isValid:l,Edit:u,hasElements:Ql(e),enableHiding:e.enableHiding??!0,enableSorting:e.enableSorting??t.enableSorting??!0,filterBy:m,readOnly:e.readOnly??t.readOnly??!1}})}(n),[n]),H=(0,r.useMemo)(()=>D.filter(e=>u.some(t=>c(t)===e)),[D,u,c]),R=ma(z,e),$=(0,r.useMemo)(()=>(R||[]).some(e=>e.isPrimary||e.isLocked),[R]),[q,K]=(0,r.useState)($);(0,r.useEffect)(()=>{$&&!q&&K(!0)},[$,q]),(0,r.useEffect)(()=>{if(!e.infiniteScrollEnabled||!V.current)return;const t=(0,a.throttle)(e=>{const t=e.target,n=t.scrollTop,i=t.scrollHeight;n+t.clientHeight>=i-100&&k?.()},100),n=V.current;return n.addEventListener("scroll",t),()=>{n.removeEventListener("scroll",t),t.cancel()}},[k,e.infiniteScrollEnabled]);const G=(0,r.useMemo)(()=>Object.fromEntries(Object.entries(h).filter(([e])=>so.some(t=>t.type===e))),[h]);return G[e.type]?(0,o.jsx)(W.Provider,{value:{view:e,onChangeView:t,fields:z,actions:l,data:u,isLoading:v,paginationInfo:p,selection:H,onChangeSelection:function(e){const t="function"==typeof e?e(D):e;L&&P(t),b&&b(t)},openedFilter:T,setOpenedFilter:B,getItemId:c,getItemLevel:m,isItemClickable:y,onClickItem:x,renderItemLink:w,containerWidth:E,containerRef:V,resizeObserverRef:F,defaultLayouts:G,filters:R,isShowingFilter:q,setIsShowingFilter:K,config:j,empty:S,hasInfiniteScrollHandler:!!k},children:(0,o.jsx)("div",{className:"dataviews-wrapper",ref:V,children:C??(0,o.jsx)(lo,{header:_,search:i,searchLabel:s})})}):null};oo.BulkActionToolbar=_e,oo.Filters=va,oo.FiltersToggled=pa,oo.FiltersToggle=ut,oo.Layout=ha,oo.LayoutSwitcher=Fa,oo.Pagination=xa,oo.Search=ja,oo.ViewConfig=La,oo.Footer=_a;var uo=oo},493:(e,t,n)=>{"use strict";var i=n(609),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=i.useState,s=i.useEffect,l=i.useLayoutEffect,o=i.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),i=a({inst:{value:n,getSnapshot:t}}),r=i[0].inst,c=i[1];return l(function(){r.value=n,r.getSnapshot=t,u(r)&&c({inst:r})},[e,n,t]),s(function(){return u(r)&&c({inst:r}),e(function(){u(r)&&c({inst:r})})},[e]),o(n),n};t.useSyncExternalStore=void 0!==i.useSyncExternalStore?i.useSyncExternalStore:c},510:(e,t,n)=>{"use strict";n.d(t,{l:()=>u});var i=Object.prototype.hasOwnProperty;function r(e,t,n){for(n of e.keys())if(a(n,t))return n}function a(e,t){var n,s,l;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((s=e.length)===t.length)for(;s--&&a(e[s],t[s]););return-1===s}if(n===Set){if(e.size!==t.size)return!1;for(s of e){if((l=s)&&"object"==typeof l&&!(l=r(t,l)))return!1;if(!t.has(l))return!1}return!0}if(n===Map){if(e.size!==t.size)return!1;for(s of e){if((l=s[0])&&"object"==typeof l&&!(l=r(t,l)))return!1;if(!a(s[1],t.get(l)))return!1}return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((s=e.byteLength)===t.byteLength)for(;s--&&e.getInt8(s)===t.getInt8(s););return-1===s}if(ArrayBuffer.isView(e)){if((s=e.byteLength)===t.byteLength)for(;s--&&e[s]===t[s];);return-1===s}if(!n||"object"==typeof e){for(n in s=0,e){if(i.call(e,n)&&++s&&!i.call(t,n))return!1;if(!(n in t)||!a(e[n],t[n]))return!1}return Object.keys(t).length===s}}return e!=e&&t!=t}var s=n(87),l=n(143),o=n(233);function u(e){const{kind:t,name:n,slug:i,defaultView:r,queryParams:u,onChangeQueryParams:c}=e,d=function(e,t,n){return`dataviews-${e}-${t}-${n}`}(t,n,i),f=(0,l.useSelect)(e=>e(o.store).get("core/views",d),[d]),{set:m}=(0,l.useDispatch)(o.store),v=f??r,p=Number(u?.page??v.page??1),h=u?.search??v.search??"";return{view:(0,s.useMemo)(()=>({...v,page:p,search:h}),[v,p,h]),isModified:!!f,updateView:(0,s.useCallback)(e=>{const t={page:e?.page,search:e?.search},n=function(e){const t={...e};for(const e of["page","search"])delete t[e];return t}(e);c&&!a(t,{page:p,search:h})&&c(t),a(v,n)||(a(n,r)?m("core/views",d,void 0):m("core/views",d,n))},[c,p,h,v,r,m,d]),resetToDefault:(0,s.useCallback)(()=>{m("core/views",d,void 0)},[d,m])}}},644:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(573),r=n(790),a=(0,r.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,r.jsx)(i.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"})})},655:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(573),r=n(790),a=(0,r.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(i.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})})},684:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(573),r=n(790),a=(0,r.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(i.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"})})},707:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(573),r=n(790),a=(0,r.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(i.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})})},731:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},n=Object.keys(t).join("|"),i=new RegExp(n,"g"),r=new RegExp(n,"");function a(e){return t[e]}var s=function(e){return e.replace(i,a)};e.exports=s,e.exports.has=function(e){return!!e.match(r)},e.exports.remove=s},888:(e,t,n)=>{"use strict";e.exports=n(493)},988:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(573),r=n(790),a=(0,r.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(i.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})})}}]);
\ No newline at end of file