import{k,j as i,Q as w,u as v,c as h,M as L,O as j}from"./index-Bsr9DJ3G.js";import{r,O as S}from"./vendor-DJo4KD8w.js";import{b as y,L as E,u as R}from"./routing-DCIgrT7s.js";import{u as p}from"./i18n-BbpF47i1.js";import{F as $}from"./ArrowsRightLeftIcon-BzLgl5o9.js";import{F,a as M}from"./ChevronLeftIcon-BLyRNZuL.js";import{C}from"./CookiePreferences-CPbRK2Nf.js";import{K as O}from"./privacy-CZ8NTWnp.js";import{r as x,L as b}from"./routing-D4iNsc7y.js";import"./XMarkIcon-KMKD47CF.js";function A({title:o,titleId:e,...a},n){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},a),o?r.createElement("title",{id:e},o):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.042A8.967 8.967 0 0 0 6 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 0 1 6 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 0 1 6-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0 0 18 18a8.967 8.967 0 0 0-6 2.292m0-14.25v14.25"}))}const H=r.forwardRef(A);function K({title:o,titleId:e,...a},n){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},a),o?r.createElement("title",{id:e},o):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const N=r.forwardRef(K);function B({title:o,titleId:e,...a},n){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},a),o?r.createElement("title",{id:e},o):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.568 3H5.25A2.25 2.25 0 0 0 3 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 0 0 5.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 0 0 9.568 3Z"}),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6h.008v.008H6V6Z"}))}const D=r.forwardRef(B);function T({href:o,to:e,...a}){return i.jsx(E,{to:o??"",...a})}function P({isCollapsed:o,toggleCollapsed:e,navigationMenu:a}){const{t:n}=p(),t=(s,c)=>n(`Moderation.${s}`,c),{t:d}=p(),l=(s,c)=>d(`Sidebar.${s}`,c),m=y(),u=r.useCallback(()=>{e()},[e]);k({"shell:sidebar-toggle":u});const f=[{name:t("recentResources"),href:"/moderate/recent",icon:N,description:t("recentResourcesDescription")},{name:t("entityTags"),href:"/moderate/entity-tags",icon:D,description:t("entityTagsDescription")},{name:t("tagSchemas"),href:"/moderate/tag-schemas",icon:H,description:t("tagSchemasDescription")},{name:t("linkedData"),href:"/moderate/linked-data",icon:$,description:t("linkedDataDescription")}];return i.jsx(w,{title:t("title"),items:f,currentPath:m,LinkComponent:T,...a&&{dropdownContent:a},isCollapsed:o,icons:{chevronLeft:M,bars:F},collapseSidebarLabel:l("collapseSidebar"),expandSidebarLabel:l("expandSidebar")})}function W(){const{t:o}=p(),e=r.useContext(O),a=v(),n=h(a.activeSession$),t=h(n==null?void 0:n.user$),d=(n==null?void 0:n.kb)??null,l=R();if(!d)return l.push("/know"),null;const m=!!t,u=(t==null?void 0:t.isAdmin)??!1,f=(t==null?void 0:t.isModerator)??!1;return i.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900 flex flex-col",children:[i.jsxs("div",{className:"flex flex-1",children:[i.jsx(L,{Link:b,routes:x,t:s=>o(`Navigation.${s}`),tHome:s=>o(`Home.${s}`),brandingLink:"/",collapsible:!0,storageKey:"moderation-sidebar-collapsed",isAuthenticated:m,isAdmin:u,isModerator:f,children:(s,c,g)=>i.jsx(P,{isCollapsed:s,toggleCollapsed:c,navigationMenu:g})}),i.jsx("main",{className:"flex-1 p-6 flex flex-col",children:i.jsx("div",{className:"max-w-7xl mx-auto flex-1 flex flex-col w-full",children:i.jsx(S,{})})})]}),i.jsx(j,{Link:b,routes:x,t:(s,c)=>o(`Footer.${s}`,c),CookiePreferences:C,...(e==null?void 0:e.openKeyboardHelp)&&{onOpenKeyboardHelp:e.openKeyboardHelp}})]})}function X(){return i.jsx(W,{})}export{X as default};
//# sourceMappingURL=layout-BWesrQWr.js.map
