import { PrivateRoute } from "./chunk-XF3H6QJC.js"; import { LAYOUT_DATA, Number, STATES, VerticalDivider } from "./chunk-7XW66K7Y.js"; import { require_lt, require_valid } from "./chunk-WAJBRAZM.js"; import { useOnce } from "./chunk-AF2Z2UHO.js"; import { HTML5Backend } from "./chunk-SYWYLB7I.js"; import { DndProvider } from "./chunk-S3HPKOXW.js"; import { NpsSurvey } from "./chunk-JRLAXHTE.js"; import { useGuidedTour } from "./chunk-PFI4R5WA.js"; import { useConfiguration } from "./chunk-ERK7O2GM.js"; import { require_cloneDeep } from "./chunk-GGK2TLCV.js"; import "./chunk-PW7XKCYO.js"; import "./chunk-RMBEU7DO.js"; import "./chunk-RI2W2UZ6.js"; import "./chunk-XLSIZGJF.js"; import "./chunk-EGNP2T5O.js"; import { AppInfoProvider, useTracking } from "./chunk-GSN7U3BK.js"; import { useInformationQuery } from "./chunk-T3B5F2LV.js"; import "./chunk-YXDCVYVT.js"; import { getDisplayName, hashAdminUserEmail } from "./chunk-PVNXTKO6.js"; import "./chunk-CMLQV3Z2.js"; import "./chunk-PQINNV4N.js"; import "./chunk-VYSYYPOB.js"; import { Page } from "./chunk-5CAWUBTQ.js"; import { useAuth, useStrapiApp } from "./chunk-W2TBR6J3.js"; import { useTypedSelector } from "./chunk-QEGMJR7H.js"; import { require_get } from "./chunk-LCL5TIBZ.js"; import "./chunk-WOQNBAGN.js"; import "./chunk-BHLYCXQ7.js"; import "./chunk-76QM3EFM.js"; import "./chunk-CE4VABH2.js"; import { fn } from "./chunk-5VODLFKF.js"; import "./chunk-N55RVBRV.js"; import { AccessibleIcon, Avatar, Badge, Box, Button, Divider, Flex, FocusTrap, IconButton, LinkButton, Menu, Portal$1, SkipToContent, TooltipImpl, Typography, VisuallyHidden, useCollator, useIntl } from "./chunk-7XB6XSWQ.js"; import { NavLink, Outlet, useLocation, useNavigate } from "./chunk-TUXTO2Z5.js"; import "./chunk-FOD4ENRR.js"; import { ForwardRef$2N, ForwardRef$2t, ForwardRef$45, ForwardRef$4d, ForwardRef$5d, ForwardRef$P } from "./chunk-WRD5KPDH.js"; import { require_jsx_runtime } from "./chunk-NIAJZ5MX.js"; import { dt } from "./chunk-ACIMPXWY.js"; import { require_react } from "./chunk-MADUDGYZ.js"; import { __toESM } from "./chunk-PLDDJCW6.js"; // node_modules/@strapi/admin/dist/admin/admin/src/layouts/AuthenticatedLayout.mjs var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1); var React3 = __toESM(require_react(), 1); // node_modules/@strapi/admin/package.json var package_default = { name: "@strapi/admin", version: "5.13.0", description: "Strapi Admin", repository: { type: "git", url: "git://github.com/strapi/strapi.git" }, license: "SEE LICENSE IN LICENSE", author: { name: "Strapi Solutions SAS", email: "hi@strapi.io", url: "https://strapi.io" }, maintainers: [ { name: "Strapi Solutions SAS", email: "hi@strapi.io", url: "https://strapi.io" } ], exports: { "./strapi-admin": { types: "./dist/admin/src/index.d.ts", source: "./admin/src/index.ts", import: "./dist/admin/index.mjs", require: "./dist/admin/index.js", default: "./dist/admin/index.js" }, "./strapi-admin/ee": { types: "./dist/admin/src/ee.d.ts", source: "./admin/src/ee.ts", import: "./dist/admin/ee.mjs", require: "./dist/admin/ee.js", default: "./dist/admin/ee.js" }, "./strapi-admin/test": { types: "./dist/admin/tests/index.d.ts", source: "./admin/tests/index.ts", import: "./dist/admin/test.mjs", require: "./dist/admin/test.js", default: "./dist/admin/test.js" }, "./_internal": { types: "./dist/_internal/index.d.ts", source: "./_internal/index.ts", import: "./dist/_internal.mjs", require: "./dist/_internal.js", default: "./dist/_internal.js" }, "./strapi-server": { types: "./dist/server/src/index.d.ts", source: "./server/src/index.js", import: "./dist/server/index.mjs", require: "./dist/server/index.js", default: "./dist/server/index.js" }, "./package.json": "./package.json" }, files: [ "dist/" ], scripts: { build: "run -T npm-run-all clean --parallel build:code build:types", "build:code": "run -T rollup -c", "build:types": "run -T run-p build:types:server build:types:admin build:types:internals", "build:types:internals": "run -T tsc -p tsconfig.build.json --emitDeclarationOnly", "build:types:server": "run -T tsc -p server/tsconfig.build.json --emitDeclarationOnly", "build:types:admin": "run -T tsc -p admin/tsconfig.build.json --emitDeclarationOnly", clean: "run -T rimraf ./dist", lint: "run -T eslint .", "test:front": "run -T cross-env IS_EE=true jest --config ./jest.config.front.js", "test:front:watch": "run -T cross-env IS_EE=true jest --config ./jest.config.front.js --watchAll", "test:ts": "run -T tsc -p tsconfig.json", "test:ts:back": "run -T tsc --noEmit -p server/tsconfig.json", "test:ts:front": "run -T tsc -p admin/tsconfig.json && run -T tsc -p ee/admin/tsconfig.json", "test:unit": "run -T jest", "test:unit:watch": "run -T jest --watch", watch: "run -T rollup -c -w" }, dependencies: { "@casl/ability": "6.5.0", "@internationalized/date": "3.5.4", "@radix-ui/react-context": "1.0.1", "@radix-ui/react-toolbar": "1.0.4", "@reduxjs/toolkit": "1.9.7", "@strapi/design-system": "2.0.0-rc.23", "@strapi/icons": "2.0.0-rc.23", "@strapi/permissions": "5.13.0", "@strapi/types": "5.13.0", "@strapi/typescript-utils": "5.13.0", "@strapi/utils": "5.13.0", "@testing-library/dom": "10.1.0", "@testing-library/react": "15.0.7", "@testing-library/user-event": "14.5.2", axios: "1.8.4", bcryptjs: "2.4.3", boxen: "5.1.2", chalk: "^4.1.2", codemirror5: "npm:codemirror@^5.65.11", "cross-env": "^7.0.3", "date-fns": "2.30.0", execa: "5.1.1", "fast-deep-equal": "3.1.3", formik: "2.4.5", "fractional-indexing": "3.2.0", "fs-extra": "11.2.0", "highlight.js": "^10.4.1", immer: "9.0.21", inquirer: "8.2.5", invariant: "^2.2.4", "is-localhost-ip": "2.0.0", jsonwebtoken: "9.0.0", koa: "2.15.4", "koa-compose": "4.1.0", "koa-passport": "6.0.0", "koa-static": "5.0.0", "koa2-ratelimit": "^1.1.3", lodash: "4.17.21", "node-schedule": "2.1.1", ora: "5.4.1", "p-map": "4.0.0", "passport-local": "1.0.0", pluralize: "8.0.0", punycode: "2.3.1", qs: "6.11.1", "react-dnd": "16.0.1", "react-dnd-html5-backend": "16.0.1", "react-intl": "6.6.2", "react-is": "^18.2.0", "react-query": "3.39.3", "react-redux": "8.1.3", "react-select": "5.8.0", "react-window": "1.8.10", rimraf: "5.0.5", "sanitize-html": "2.13.0", scheduler: "0.23.0", semver: "7.5.4", sift: "16.0.1", typescript: "5.4.4", "use-context-selector": "1.4.1", yup: "0.32.9", zod: "^3.22.4" }, devDependencies: { "@strapi/admin-test-utils": "5.13.0", "@strapi/data-transfer": "5.13.0", "@types/codemirror5": "npm:@types/codemirror@^5.60.15", "@types/fs-extra": "11.0.4", "@types/invariant": "2.2.36", "@types/jsonwebtoken": "9.0.3", "@types/koa-passport": "6.0.1", "@types/lodash": "^4.14.191", "@types/markdown-it": "13.0.7", "@types/markdown-it-container": "2.0.9", "@types/markdown-it-emoji": "2.0.4", "@types/markdown-it-footnote": "3.0.3", "@types/passport-local": "1.0.36", "@types/pluralize": "0.0.32", "@types/punycode": "2.1.4", "@types/react-window": "1.8.8", "@types/sanitize-html": "2.13.0", "@vitejs/plugin-react-swc": "3.6.0", "koa-body": "6.0.1", msw: "1.3.0", react: "18.3.1", "react-dom": "18.3.1", "react-router-dom": "6.22.3", "styled-components": "6.1.8", vite: "5.4.17", "vite-plugin-dts": "^4.3.0" }, peerDependencies: { "@strapi/data-transfer": "^5.0.0", react: "^17.0.0 || ^18.0.0", "react-dom": "^17.0.0 || ^18.0.0", "react-router-dom": "^6.0.0", "styled-components": "^6.0.0" }, engines: { node: ">=18.0.0 <=22.x.x", npm: ">=6.0.0" }, nx: { targets: { build: { outputs: [ "{projectRoot}/build" ] } } } }; // node_modules/@strapi/admin/dist/admin/admin/src/layouts/AuthenticatedLayout.mjs var import_lt = __toESM(require_lt(), 1); var import_valid = __toESM(require_valid(), 1); // node_modules/@strapi/admin/dist/admin/admin/src/components/GuidedTour/Modal.mjs var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); var import_react = __toESM(require_react(), 1); var import_get = __toESM(require_get(), 1); var GuidedTourModal = () => { const guidedTour = useGuidedTour("GuidedTourModal", (state) => state); const { currentStep, guidedTourState, setCurrentStep, setStepState, isGuidedTourVisible, setSkipped } = guidedTour; const { formatMessage } = useIntl(); const { trackUsage } = useTracking(); if (!currentStep || !isGuidedTourVisible) { return null; } const stepData = (0, import_get.default)(LAYOUT_DATA, currentStep); const sectionKeys = Object.keys(guidedTourState); const [sectionName, stepName] = currentStep.split("."); const sectionIndex = sectionKeys.indexOf(sectionName); const stepIndex = Object.keys(guidedTourState[sectionName]).indexOf(stepName); const hasSectionAfter = sectionIndex < sectionKeys.length - 1; const hasStepAfter = stepIndex < Object.keys(guidedTourState[sectionName]).length - 1; const handleCtaClick = () => { setStepState(currentStep, true); if (stepData) { trackUsage(stepData.trackingEvent); } setCurrentStep(null); }; const handleSkip = () => { setSkipped(true); setCurrentStep(null); trackUsage("didSkipGuidedtour"); }; return (0, import_jsx_runtime.jsx)(Portal$1, { children: (0, import_jsx_runtime.jsx)(ModalWrapper, { onClick: handleCtaClick, padding: 8, justifyContent: "center", children: (0, import_jsx_runtime.jsx)(FocusTrap, { onEscape: handleCtaClick, children: (0, import_jsx_runtime.jsxs)(Flex, { direction: "column", alignItems: "stretch", background: "neutral0", width: `66rem`, shadow: "popupShadow", hasRadius: true, padding: 4, gap: 8, role: "dialog", "aria-modal": true, onClick: (e) => e.stopPropagation(), children: [ (0, import_jsx_runtime.jsx)(Flex, { justifyContent: "flex-end", children: (0, import_jsx_runtime.jsx)(IconButton, { onClick: handleCtaClick, withTooltip: false, label: formatMessage({ id: "app.utils.close-label", defaultMessage: "Close" }), children: (0, import_jsx_runtime.jsx)(ForwardRef$45, {}) }) }), (0, import_jsx_runtime.jsx)(Box, { paddingLeft: 7, paddingRight: 7, paddingBottom: !hasStepAfter && !hasSectionAfter ? 8 : 0, children: (0, import_jsx_runtime.jsx)(GuidedTourStepper, { title: stepData && "title" in stepData ? stepData.title : void 0, cta: stepData && "cta" in stepData ? stepData.cta : void 0, onCtaClick: handleCtaClick, sectionIndex, stepIndex, hasSectionAfter, children: stepData && "content" in stepData && (0, import_jsx_runtime.jsx)(GuidedTourContent, { ...stepData.content }) }) }), !(!hasStepAfter && !hasSectionAfter) && (0, import_jsx_runtime.jsx)(Flex, { justifyContent: "flex-end", children: (0, import_jsx_runtime.jsx)(Button, { variant: "tertiary", onClick: handleSkip, children: formatMessage({ id: "app.components.GuidedTour.skip", defaultMessage: "Skip the tour" }) }) }) ] }) }) }) }); }; var ModalWrapper = dt(Flex)` position: fixed; z-index: 4; inset: 0; /* this is theme.colors.neutral800 with opacity */ background: ${({ theme }) => `${theme.colors.neutral800}1F`}; `; var GuidedTourStepper = ({ title, children, cta, onCtaClick, sectionIndex, stepIndex, hasSectionAfter }) => { const { formatMessage } = useIntl(); const hasSectionBefore = sectionIndex > 0; const hasStepsBefore = stepIndex > 0; const nextSectionIndex = sectionIndex + 1; return (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [ (0, import_jsx_runtime.jsxs)(Flex, { alignItems: "stretch", children: [ (0, import_jsx_runtime.jsx)(Flex, { marginRight: 8, justifyContent: "center", minWidth: `3rem`, children: hasSectionBefore && (0, import_jsx_runtime.jsx)(VerticalDivider, { state: STATES.IS_DONE, minHeight: `2.4rem` }) }), (0, import_jsx_runtime.jsx)(Typography, { variant: "sigma", textColor: "primary600", children: formatMessage({ id: "app.components.GuidedTour.title", defaultMessage: "3 steps to get started" }) }) ] }), (0, import_jsx_runtime.jsxs)(Flex, { children: [ (0, import_jsx_runtime.jsx)(Flex, { marginRight: 8, minWidth: `3rem`, children: (0, import_jsx_runtime.jsx)(Number, { state: hasStepsBefore ? STATES.IS_DONE : STATES.IS_ACTIVE, paddingTop: 3, paddingBottom: 3, children: sectionIndex + 1 }) }), title && (0, import_jsx_runtime.jsx)(Typography, { variant: "alpha", fontWeight: "bold", textColor: "neutral800", tag: "h3", id: "title", children: formatMessage(title) }) ] }), (0, import_jsx_runtime.jsxs)(Flex, { alignItems: "stretch", children: [ (0, import_jsx_runtime.jsx)(Flex, { marginRight: 8, direction: "column", justifyContent: "center", minWidth: `3rem`, children: hasSectionAfter && (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [ (0, import_jsx_runtime.jsx)(VerticalDivider, { state: STATES.IS_DONE }), hasStepsBefore && (0, import_jsx_runtime.jsx)(Number, { state: STATES.IS_ACTIVE, paddingTop: 3, children: nextSectionIndex + 1 }) ] }) }), (0, import_jsx_runtime.jsxs)(Box, { children: [ children, cta && (cta.target ? (0, import_jsx_runtime.jsx)(LinkButton, { tag: NavLink, endIcon: (0, import_jsx_runtime.jsx)(ForwardRef$5d, {}), onClick: onCtaClick, to: cta.target, children: formatMessage(cta.title) }) : (0, import_jsx_runtime.jsx)(Button, { endIcon: (0, import_jsx_runtime.jsx)(ForwardRef$5d, {}), onClick: onCtaClick, children: formatMessage(cta.title) })) ] }) ] }), hasStepsBefore && hasSectionAfter && (0, import_jsx_runtime.jsx)(Box, { paddingTop: 3, children: (0, import_jsx_runtime.jsx)(Flex, { marginRight: 8, justifyContent: "center", width: `3rem`, children: (0, import_jsx_runtime.jsx)(VerticalDivider, { state: STATES.IS_DONE, minHeight: `2.4rem` }) }) }) ] }); }; var GuidedTourContent = ({ id, defaultMessage }) => { const { formatMessage } = useIntl(); return (0, import_jsx_runtime.jsx)(Flex, { direction: "column", alignItems: "stretch", gap: 4, paddingBottom: 6, children: formatMessage({ id, defaultMessage }, { documentationLink: DocumentationLink, b: Bold, p: Paragraph, light: Light, ul: List, li: ListItem }) }); }; var DocumentationLink = (children) => (0, import_jsx_runtime.jsx)(Typography, { tag: "a", textColor: "primary600", target: "_blank", rel: "noopener noreferrer", href: "https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/rest-api.html#api-parameters", children }); var Bold = (children) => (0, import_jsx_runtime.jsx)(Typography, { fontWeight: "semiBold", children }); var Paragraph = (children) => (0, import_jsx_runtime.jsx)(Typography, { children }); var Light = (children) => (0, import_jsx_runtime.jsx)(Typography, { textColor: "neutral600", children }); var List = (children) => (0, import_jsx_runtime.jsx)(Box, { paddingLeft: 6, children: (0, import_jsx_runtime.jsx)("ul", { children }) }); var LiStyled = dt.li` list-style: disc; &::marker { color: ${({ theme }) => theme.colors.neutral800}; } `; var ListItem = (children) => (0, import_jsx_runtime.jsx)(LiStyled, { children }); // node_modules/@strapi/admin/dist/admin/admin/src/components/LeftMenu.mjs var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); var import_react4 = __toESM(require_react(), 1); // node_modules/@strapi/admin/dist/admin/admin/src/components/MainNav/MainNav.mjs var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); var MainNavWrapper = dt(Flex)` border-right: 1px solid ${({ theme }) => theme.colors.neutral150}; `; var MainNav = (props) => (0, import_jsx_runtime2.jsx)(MainNavWrapper, { alignItems: "normal", tag: "nav", background: "neutral0", direction: "column", height: "100vh", position: "sticky", top: 0, zIndex: 2, width: 10, ...props }); // node_modules/@strapi/admin/dist/admin/admin/src/components/MainNav/NavBrand.mjs var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); var BrandIconWrapper = dt(Flex)` svg, img { border-radius: ${({ theme }) => theme.borderRadius}; object-fit: contain; height: 2.4rem; width: 2.4rem; } `; var NavBrand = () => { var _a; const { formatMessage } = useIntl(); const { logos: { menu } } = useConfiguration("LeftMenu"); return (0, import_jsx_runtime3.jsx)(Box, { padding: 3, children: (0, import_jsx_runtime3.jsxs)(BrandIconWrapper, { direction: "column", justifyContent: "center", width: "3.2rem", height: "3.2rem", children: [ (0, import_jsx_runtime3.jsx)("img", { src: ((_a = menu.custom) == null ? void 0 : _a.url) || menu.default, alt: formatMessage({ id: "app.components.LeftMenu.logo.alt", defaultMessage: "Application logo" }), width: "100%", height: "100%" }), (0, import_jsx_runtime3.jsxs)(VisuallyHidden, { children: [ (0, import_jsx_runtime3.jsx)("span", { children: formatMessage({ id: "app.components.LeftMenu.navbrand.title", defaultMessage: "Strapi Dashboard" }) }), (0, import_jsx_runtime3.jsx)("span", { children: formatMessage({ id: "app.components.LeftMenu.navbrand.workplace", defaultMessage: "Workplace" }) }) ] }) ] }) }); }; // node_modules/@strapi/admin/dist/admin/admin/src/components/MainNav/NavLink.mjs var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); var import_react2 = __toESM(require_react(), 1); var MainNavLinkWrapper = dt(NavLink)` text-decoration: none; display: flex; border-radius: ${({ theme }) => theme.borderRadius}; background: ${({ theme }) => theme.colors.neutral0}; color: ${({ theme }) => theme.colors.neutral500}; position: relative; width: fit-content; padding-block: 0.6rem; padding-inline: 0.6rem; &:hover { svg path { fill: ${({ theme }) => theme.colors.neutral600}; } background: ${({ theme }) => theme.colors.neutral100}; } &.active { svg path { fill: ${({ theme }) => theme.colors.primary600}; } background: ${({ theme }) => theme.colors.primary100}; } `; var LinkImpl = ({ children, ...props }) => { return (0, import_jsx_runtime4.jsx)(MainNavLinkWrapper, { ...props, children }); }; var TooltipImpl2 = ({ children, label, position = "right" }) => { return (0, import_jsx_runtime4.jsx)(TooltipImpl, { side: position, label, delayDuration: 0, children: (0, import_jsx_runtime4.jsx)("span", { children }) }); }; var IconImpl = ({ label, children }) => { if (!children) { return null; } return (0, import_jsx_runtime4.jsx)(AccessibleIcon, { label, children }); }; var CustomBadge = dt(Badge)` /* override default badge styles to change the border radius of the Base element in the Design System */ border-radius: ${({ theme }) => theme.spaces[10]}; height: 2rem; `; var BadgeImpl = ({ children, label, ...props }) => { if (!children) { return null; } return (0, import_jsx_runtime4.jsx)(CustomBadge, { position: "absolute", top: "-0.8rem", left: "1.7rem", "aria-label": label, active: false, ...props, children }); }; var NavLink2 = { Link: LinkImpl, Tooltip: TooltipImpl2, Icon: IconImpl, Badge: BadgeImpl }; // node_modules/@strapi/admin/dist/admin/admin/src/components/MainNav/NavUser.mjs var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); var import_react3 = __toESM(require_react(), 1); var MenuTrigger = dt(Menu.Trigger)` height: ${({ theme }) => theme.spaces[7]}; width: ${({ theme }) => theme.spaces[7]}; border: none; border-radius: 50%; padding: 0; overflow: hidden; `; var MenuContent = dt(Menu.Content)` max-height: fit-content; width: 200px; `; var UserInfo = dt(Flex)` && { padding: ${({ theme }) => theme.spaces[3]}; } align-items: flex-start; `; var BadgeWrapper = dt(Flex)` display: flex; flex-wrap: wrap; gap: ${({ theme }) => theme.spaces[1]}; width: 100%; `; var StyledTypography = dt(Typography)` margin-bottom: ${({ theme }) => theme.spaces[3]}; `; var MenuItem = dt(Menu.Item)` & > span { width: 100%; display: flex; align-items: center; gap: ${({ theme }) => theme.spaces[3]}; } `; var MenuItemDanger = dt(MenuItem)` &:hover { background: ${({ theme }) => theme.colors.danger100}; } `; var NavUser = ({ children, initials, ...props }) => { var _a; const { formatMessage } = useIntl(); const navigate = useNavigate(); const user = useAuth("User", (state) => state.user); const logout = useAuth("Logout", (state) => state.logout); const handleProfile = () => { navigate("/me"); }; const handleLogout = () => { logout(); navigate("/auth/login"); }; return (0, import_jsx_runtime5.jsx)(Flex, { justifyContent: "center", padding: 3, borderStyle: "solid", borderWidth: "1px 0 0 0", borderColor: "neutral150", ...props, children: (0, import_jsx_runtime5.jsxs)(Menu.Root, { children: [ (0, import_jsx_runtime5.jsxs)(MenuTrigger, { endIcon: null, fullWidth: true, justifyContent: "center", children: [ (0, import_jsx_runtime5.jsx)(Avatar.Item, { delayMs: 0, fallback: initials }), (0, import_jsx_runtime5.jsx)(VisuallyHidden, { tag: "span", children }) ] }), (0, import_jsx_runtime5.jsxs)(MenuContent, { popoverPlacement: "top-start", zIndex: 3, children: [ (0, import_jsx_runtime5.jsxs)(UserInfo, { direction: "column", gap: 0, alignItems: "flex-start", children: [ (0, import_jsx_runtime5.jsx)(Typography, { variant: "omega", fontWeight: "bold", textTransform: "none", children }), (0, import_jsx_runtime5.jsx)(StyledTypography, { variant: "pi", textColor: "neutral600", children: user == null ? void 0 : user.email }), (0, import_jsx_runtime5.jsx)(BadgeWrapper, { children: (_a = user == null ? void 0 : user.roles) == null ? void 0 : _a.map((role) => (0, import_jsx_runtime5.jsx)(Badge, { children: role.name }, role.id)) }) ] }), (0, import_jsx_runtime5.jsx)(Menu.Separator, {}), (0, import_jsx_runtime5.jsx)(MenuItem, { onSelect: handleProfile, children: formatMessage({ id: "global.profile", defaultMessage: "Profile settings" }) }), (0, import_jsx_runtime5.jsx)(MenuItemDanger, { onSelect: handleLogout, color: "danger600", children: formatMessage({ id: "app.components.LeftMenu.logout", defaultMessage: "Log out" }) }) ] }) ] }) }); }; // node_modules/@strapi/admin/dist/admin/admin/src/components/LeftMenu.mjs var sortLinks = (links) => { return links.sort((a, b) => { const positionA = a.position ?? 6; const positionB = b.position ?? 6; if (positionA < positionB) { return -1; } else { return 1; } }); }; var NavLinkBadgeCounter = dt(NavLink2.Badge)` span { color: ${({ theme }) => theme.colors.neutral0}; } `; var NavLinkBadgeLock = dt(NavLink2.Badge)` background-color: transparent; `; var NavListWrapper = dt(Flex)` overflow-y: auto; `; var LeftMenu = ({ generalSectionLinks, pluginsSectionLinks }) => { const user = useAuth("AuthenticatedApp", (state) => state.user); const { trackUsage } = useTracking(); const { pathname } = useLocation(); const userDisplayName = getDisplayName(user); const { formatMessage, locale } = useIntl(); const formatter = useCollator(locale, { sensitivity: "base" }); const initials = userDisplayName.split(" ").map((name) => name.substring(0, 1)).join("").substring(0, 2); const handleClickOnLink = (destination) => { trackUsage("willNavigate", { from: pathname, to: destination }); }; const listLinksAlphabeticallySorted = [ ...pluginsSectionLinks, ...generalSectionLinks ].sort((a, b) => formatter.compare(formatMessage(a.intlLabel), formatMessage(b.intlLabel))); const listLinks = sortLinks(listLinksAlphabeticallySorted); return (0, import_jsx_runtime6.jsxs)(MainNav, { children: [ (0, import_jsx_runtime6.jsx)(NavBrand, {}), (0, import_jsx_runtime6.jsx)(Divider, {}), (0, import_jsx_runtime6.jsx)(NavListWrapper, { tag: "ul", gap: 3, direction: "column", flex: 1, paddingTop: 3, paddingBottom: 3, children: listLinks.length > 0 ? listLinks.map((link) => { const LinkIcon = link.icon; const badgeContentLock = (link == null ? void 0 : link.licenseOnly) ? (0, import_jsx_runtime6.jsx)(ForwardRef$2t, { fill: "warning500" }) : void 0; const badgeContentNumeric = link.notificationsCount && link.notificationsCount > 0 ? link.notificationsCount.toString() : void 0; const labelValue = formatMessage(link.intlLabel); return (0, import_jsx_runtime6.jsx)(Flex, { tag: "li", children: (0, import_jsx_runtime6.jsx)(NavLink2.Tooltip, { label: labelValue, children: (0, import_jsx_runtime6.jsxs)(NavLink2.Link, { to: link.to, onClick: () => handleClickOnLink(link.to), "aria-label": labelValue, children: [ (0, import_jsx_runtime6.jsx)(NavLink2.Icon, { label: labelValue, children: (0, import_jsx_runtime6.jsx)(LinkIcon, { width: "20", height: "20", fill: "neutral500" }) }), badgeContentLock ? (0, import_jsx_runtime6.jsx)(NavLinkBadgeLock, { label: "locked", textColor: "neutral500", paddingLeft: 0, paddingRight: 0, children: badgeContentLock }) : badgeContentNumeric ? (0, import_jsx_runtime6.jsx)(NavLinkBadgeCounter, { label: badgeContentNumeric, backgroundColor: "primary600", width: "2.3rem", color: "neutral0", children: badgeContentNumeric }) : null ] }) }) }, link.to); }) : null }), (0, import_jsx_runtime6.jsx)(NavUser, { initials, children: userDisplayName }) ] }); }; // node_modules/@strapi/admin/dist/admin/admin/src/components/PluginsInitializer.mjs var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1); var React = __toESM(require_react(), 1); var PluginsInitializer = ({ children }) => { const appPlugins = useStrapiApp("PluginsInitializer", (state) => state.plugins); const [{ plugins }, dispatch] = React.useReducer(reducer, initialState, () => init(appPlugins)); const setPlugin = React.useRef((pluginId) => { dispatch({ type: "SET_PLUGIN_READY", pluginId }); }); const hasApluginNotReady = Object.keys(plugins).some((plugin) => plugins[plugin].isReady === false); if (hasApluginNotReady) { const initializers = Object.keys(plugins).reduce((acc, current) => { const InitializerComponent = plugins[current].initializer; if (InitializerComponent) { const key = plugins[current].pluginId; acc.push((0, import_jsx_runtime7.jsx)(InitializerComponent, { setPlugin: setPlugin.current }, key)); } return acc; }, []); return (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [ initializers, (0, import_jsx_runtime7.jsx)(Page.Loading, {}) ] }); } return children; }; var initialState = { plugins: {} }; var reducer = (state = initialState, action) => fn(state, (draftState) => { switch (action.type) { case "SET_PLUGIN_READY": { draftState.plugins[action.pluginId].isReady = true; break; } default: return draftState; } }); var init = (plugins) => { return { plugins }; }; // node_modules/@strapi/admin/dist/admin/admin/src/hooks/useMenu.mjs var React2 = __toESM(require_react(), 1); var import_cloneDeep = __toESM(require_cloneDeep(), 1); var useMenu = (shouldUpdateStrapi) => { var _a; const checkUserHasPermissions = useAuth("useMenu", (state) => state.checkUserHasPermissions); const menu = useStrapiApp("useMenu", (state) => state.menu); const permissions = useTypedSelector((state) => state.admin_app.permissions); const [menuWithUserPermissions, setMenuWithUserPermissions] = React2.useState({ generalSectionLinks: [ { icon: ForwardRef$2N, intlLabel: { id: "global.home", defaultMessage: "Home" }, to: "/", permissions: [], position: 0 }, { icon: ForwardRef$P, intlLabel: { id: "global.marketplace", defaultMessage: "Marketplace" }, to: "/marketplace", permissions: ((_a = permissions.marketplace) == null ? void 0 : _a.main) ?? [], position: 7 }, { icon: ForwardRef$4d, intlLabel: { id: "global.settings", defaultMessage: "Settings" }, to: "/settings", // Permissions of this link are retrieved in the init phase // using the settings menu permissions: [], notificationsCount: 0, position: 9 } ], pluginsSectionLinks: [], isLoading: true }); const generalSectionLinksRef = React2.useRef(menuWithUserPermissions.generalSectionLinks); React2.useEffect(() => { async function applyMenuPermissions() { const authorizedPluginSectionLinks = await getPluginSectionLinks(menu, checkUserHasPermissions); const authorizedGeneralSectionLinks = await getGeneralLinks(generalSectionLinksRef.current, shouldUpdateStrapi, checkUserHasPermissions); setMenuWithUserPermissions((state) => ({ ...state, generalSectionLinks: authorizedGeneralSectionLinks, pluginsSectionLinks: authorizedPluginSectionLinks, isLoading: false })); } applyMenuPermissions(); }, [ setMenuWithUserPermissions, generalSectionLinksRef, menu, permissions, shouldUpdateStrapi, checkUserHasPermissions ]); return menuWithUserPermissions; }; var getGeneralLinks = async (generalSectionRawLinks, shouldUpdateStrapi = false, checkUserHasPermissions) => { const generalSectionLinksPermissions = await Promise.all(generalSectionRawLinks.map(({ permissions }) => checkUserHasPermissions(permissions))); const authorizedGeneralSectionLinks = generalSectionRawLinks.filter((_, index) => generalSectionLinksPermissions[index].length > 0); const settingsLinkIndex = authorizedGeneralSectionLinks.findIndex((obj) => obj.to === "/settings"); if (settingsLinkIndex === -1) { return []; } const authorizedGeneralLinksClone = (0, import_cloneDeep.default)(authorizedGeneralSectionLinks); authorizedGeneralLinksClone[settingsLinkIndex].notificationsCount = shouldUpdateStrapi ? 1 : 0; return authorizedGeneralLinksClone; }; var getPluginSectionLinks = async (pluginsSectionRawLinks, checkUserHasPermissions) => { const pluginSectionLinksPermissions = await Promise.all(pluginsSectionRawLinks.map(({ permissions }) => checkUserHasPermissions(permissions))); const authorizedPluginSectionLinks = pluginsSectionRawLinks.filter((_, index) => pluginSectionLinksPermissions[index].length > 0); return authorizedPluginSectionLinks; }; // node_modules/@strapi/admin/dist/admin/admin/src/layouts/AuthenticatedLayout.mjs var { version: strapiVersion } = package_default; var AdminLayout = () => { const setGuidedTourVisibility = useGuidedTour("AdminLayout", (state) => state.setGuidedTourVisibility); const { formatMessage } = useIntl(); const userInfo = useAuth("AuthenticatedApp", (state) => state.user); const [userId, setUserId] = React3.useState(); const { showReleaseNotification } = useConfiguration("AuthenticatedApp"); const { data: appInfo, isLoading: isLoadingAppInfo } = useInformationQuery(); const [tagName, setTagName] = React3.useState(strapiVersion); React3.useEffect(() => { if (showReleaseNotification) { fetch("https://api.github.com/repos/strapi/strapi/releases/latest").then(async (res) => { if (!res.ok) { return; } const response = await res.json(); if (!response.tag_name) { throw new Error(); } setTagName(response.tag_name); }).catch(() => { }); } }, [ showReleaseNotification ]); const userRoles = useAuth("AuthenticatedApp", (state) => { var _a; return (_a = state.user) == null ? void 0 : _a.roles; }); React3.useEffect(() => { if (userRoles) { const isUserSuperAdmin = userRoles.find(({ code }) => code === "strapi-super-admin"); if (isUserSuperAdmin && (appInfo == null ? void 0 : appInfo.autoReload)) { setGuidedTourVisibility(true); } } }, [ userRoles, appInfo == null ? void 0 : appInfo.autoReload, setGuidedTourVisibility ]); React3.useEffect(() => { hashAdminUserEmail(userInfo).then((id) => { if (id) { setUserId(id); } }); }, [ userInfo ]); const { trackUsage } = useTracking(); const { isLoading: isLoadingMenu, generalSectionLinks, pluginsSectionLinks } = useMenu(checkLatestStrapiVersion(strapiVersion, tagName)); useOnce(() => { trackUsage("didAccessAuthenticatedAdministration"); }); if (isLoadingMenu || isLoadingAppInfo) { return (0, import_jsx_runtime8.jsx)(Page.Loading, {}); } return (0, import_jsx_runtime8.jsxs)(AppInfoProvider, { ...appInfo, userId, latestStrapiReleaseTag: tagName, shouldUpdateStrapi: checkLatestStrapiVersion(strapiVersion, tagName), children: [ (0, import_jsx_runtime8.jsx)(NpsSurvey, {}), (0, import_jsx_runtime8.jsx)(PluginsInitializer, { children: (0, import_jsx_runtime8.jsx)(DndProvider, { backend: HTML5Backend, children: (0, import_jsx_runtime8.jsxs)(Box, { background: "neutral100", children: [ (0, import_jsx_runtime8.jsx)(SkipToContent, { children: formatMessage({ id: "skipToContent", defaultMessage: "Skip to content" }) }), (0, import_jsx_runtime8.jsxs)(Flex, { alignItems: "flex-start", children: [ (0, import_jsx_runtime8.jsx)(LeftMenu, { generalSectionLinks, pluginsSectionLinks }), (0, import_jsx_runtime8.jsxs)(Box, { flex: 1, children: [ (0, import_jsx_runtime8.jsx)(Outlet, {}), (0, import_jsx_runtime8.jsx)(GuidedTourModal, {}) ] }) ] }) ] }) }) }) ] }); }; var PrivateAdminLayout = () => { return (0, import_jsx_runtime8.jsx)(PrivateRoute, { children: (0, import_jsx_runtime8.jsx)(AdminLayout, {}) }); }; var checkLatestStrapiVersion = (currentPackageVersion, latestPublishedVersion = "") => { if (!(0, import_valid.default)(currentPackageVersion) || !(0, import_valid.default)(latestPublishedVersion)) { return false; } return (0, import_lt.default)(currentPackageVersion, latestPublishedVersion); }; export { AdminLayout, PrivateAdminLayout }; //# sourceMappingURL=AuthenticatedLayout-ABFJXKPE.js.map