import{_ as v,o as r,c as _,F as b,a,t as w,d,i as u,b as y,V as O,v as f,P as C,az as g,D as x,T as E,s as U,u as M,C as A,n as V,r as P,w as z,a9 as R,aj as T,f as D,p as $,m as H}from"./entry.DPwc-EV0.js";import{u as L,_ as N}from"./AdminButtonElement-Ob1JkOmC.mjs";import B from"./SingleSelect-fp73Qt2r.mjs";import{V as W}from"./vue-select-DlY5_TFh.mjs";import"./WebSearchFilterCount-BWqaAvrN.mjs";import"./FieldBase_String-DIrYardi.mjs";import"./FieldBase-BNePpS9o.mjs";const G={props:{permissions:{type:Array},link:{type:String},linkLabel:{type:String},addLink:{type:String},target:{type:String},selectOptions:{type:Array}},emits:["change-option"],data(){return{adminStyles:L()}},methods:{changeOption(e,n){this.$emit("change-option",n)}}},q=["href","target"],F=["href","target"];function j(e,n,s,p,m,o){const t=N,l=B;return!s.permissions||e.$cmsUser.userHasPermission(s.permissions)?(r(),_("li",{key:0,class:f([{active:s.link===(e._.provides[C]||e.$route).path||s.addLink===(e._.provides[C]||e.$route).path},"ebm-admin-toolbar-manage-link"])},[s.linkLabel?(r(),_(b,{key:0},[a("a",{class:"list-link",href:s.link,target:s.target},w(s.linkLabel),9,q),s.addLink?(r(),_("a",{key:0,href:s.addLink,class:"button-link",target:s.target},[d(t,{label:"Add",size:"small",color:m.adminStyles.primaryColor},null,8,["color"])],8,F)):u("",!0),s.selectOptions?(r(),y(l,{key:1,options:s.selectOptions,name:s.linkLabel,class:"select",onChangeValue:o.changeOption},null,8,["options","name","onChangeValue"])):u("",!0)],64)):O(e.$slots,"default",{key:1},void 0,!0)],2)):u("",!0)}const K=v(G,[["render",j],["__scopeId","data-v-6e656ecb"]]),h="graphql.aspire-ebm.com",I={LOCAL:"http://localhost:4000",DEV:`https://dev.${h}`,GEMENON:`https://gemenon.${h}`,AERILON:`https://aerilon.${h}`,PICON:`https://picon.${h}`,SCORPIA:`https://scorpia.${h}`},J={components:{VueSelect:W},async setup(){const{listTenants:e}=E();return{tenantList:await e(!0)}},data(){return{filters:{local:!0,dev:!0,prod:!0},selected:null,disabled:!1}},computed:{localOptions(){return this.tenantList.map(({tenantKey:e,abbreviation:n,domain:s,name:p})=>({label:`LOCAL: ${p} (${n})`,tenantKey:e,httpEndpoint:I.LOCAL}))},devOptions(){return this.tenantList.map(({tenantKey:e,abbreviation:n,domain:s,name:p})=>({label:`DEV: ${p} (${n})`,tenantKey:e,httpEndpoint:I.DEV}))},prodOptions(){return this.tenantList.map(({tenantKey:e,domain:n,abbreviation:s,prodEndpoint:p,name:m})=>({label:`PROD: ${m} (${s})`,tenantKey:e,httpEndpoint:p}))},options(){return[...this.localOptions,...this.devOptions,...this.prodOptions]}},watch:{selected(e,n){n&&e!==n&&(this.disabled=!0,g("apollo-endpoint",{path:"/"}).value=e.httpEndpoint,g("tenant-key",{path:"/"}).value=e.tenantKey,location.reload())}},mounted(){const e=g("apollo-endpoint").value??"https://dev.graphql.aspire-ebm.com",n=g("tenant-key").value??"ebm_electronicdesign",s=this.options.find(({httpEndpoint:p,tenantKey:m})=>p===e&&m===n);this.selected=s}},Q={class:"graph-selector"};function X(e,n,s,p,m,o){const t=x("VueSelect");return r(),_("div",Q,[d(t,{modelValue:m.selected,"onUpdate:modelValue":n[0]||(n[0]=l=>m.selected=l),clearable:!1,class:"select",options:o.options,style:{flex:"1 1 0"},disabled:m.disabled},null,8,["modelValue","options","disabled"])])}const Y=v(J,[["render",X],["__scopeId","data-v-244973ce"]]),Z=()=>{var m;const{$ss:e,$cmsUser:n}=M(),s=[{label:"Content",icon:"mdi:database-outline",link:"/admin/content",permissions:["manage_content"],children:[{label:"Create New",permissions:["manage_content"],options:U().contentTypes("editKey"),changeValue:(o,t)=>{window.open(`/admin/create-content/${t}`)}},{label:"Manage Content",link:"/admin/content",permissions:["manage_content"]},{label:"Manage Taxonomy",link:"/admin/taxonomy",permissions:["manage_taxonomy"]},{label:"Manage Company Updates",link:"/admin/company-updates",condition:(m=e==null?void 0:e.companyUpdate)==null?void 0:m.enabled},{label:"Cross Site Research",link:"/admin/content-research",permissions:["manage_content"]},{label:"Bulk Promotion Update",link:"/admin/bulk-update-content",permissions:["bulk_update_content"]},{label:"Content Syndication History",link:"/admin/content-syndication",permissions:["manage_content"]}]},{label:"Media",icon:"iconoir:media-image-list",permissions:["manage_assets"],children:[{label:"Digital Media Library",link:"/admin/digital-media-library",permissions:["manage_assets"]}]},{label:"Newsletters",icon:"mdi:email-outline",permissions:["manage_newsletter_templates","manage_newsletter_templates_basic","manage_newsletter_campaigns","manage_newsletter_ads","manage_newsletter_settings"],children:[{label:"Templates",link:"/admin/newsletter-templates",permissions:["manage_newsletter_templates","manage_newsletter_templates_basic"],addLink:n.userHasPermission(["manage_newsletter_templates"])?"/admin/create-newsletter-template":""},{label:"Campaigns",link:"/admin/newsletter-campaigns",permissions:["manage_newsletter_campaigns"],addLink:"/admin/create-newsletter-campaign"},{label:"Ads",link:"/admin/newsletter-ads",permissions:["manage_newsletter_ads"],addLink:"/admin/create-newsletter-ad"},{label:"Campaign Content",link:"/admin/newsletter-content",permissions:["manage_newsletter_campaigns"]},{label:"Settings",link:"/admin/newsletter-settings",permissions:["manage_newsletter_settings"]}]},{label:"Magazines",icon:"bi:book",permissions:["manage_magazine_publications","manage_magazine_issues","manage_magazine_sections"],children:[{label:"Publications",link:"/admin/magazine-publications",permissions:["manage_magazine_publications"],addLink:"/admin/magazine-publications?action=add"},{label:"Issues",link:"/admin/magazine-issues",permissions:["manage_magazine_issues"],addLink:"/admin/magazine-issues?action=add"},{label:"Sections",link:"/admin/magazine-sections",permissions:["manage_magazine_sections"],addLink:"/admin/magazine-sections?action=add"}]},{label:"Contracts",icon:"la:file-contract",permissions:["manage_contracts"],children:[{label:"Manage Contracts",link:"/admin/contracts",addLink:"/admin/create-contract"},{label:"Manage People",link:"/admin/persons",addLink:"/admin/persons?create"},{label:"Settings",link:"/admin/contracts/settings"}]},{label:"Site Memberships",icon:"akar-icons:people-group",permissions:["manage_memberships"],children:[{label:"Site Users",link:"/admin/site-users",addLink:"/admin/site-users",permissions:["manage_site_users"]},{label:"Memberships",link:"/admin/memberships",permissions:["manage_memberships"],addLink:"/admin/create-membership"},{label:"IP Gating Settings",link:"/admin/ip-gating-settings",permissions:["manage_ip_gating"],addLink:"/admin/create-ip-gating",condition:e.memberships.allowIpGating},{label:"Settings",link:"/admin/membership-settings",permissions:["manage_memberships"]}]},{label:"Reports/Exports",icon:"ph:files-bold",permissions:["manage_content","manage_print_export"],children:[{label:"Print Exports",link:"/admin/print-exports",permissions:["manage_print_export"]},{label:"Company Export (CSV)",link:"/admin/company-export",permissions:["manage_content"]},{label:"RMI Report",link:"/admin/rmi-report",permissions:["manage_content"]},{label:"Taxonomy Export (CSV)",link:"/admin/taxonomy-export",permissions:["manage_content"]},{label:"Indesign Scripts",link:"/scripts/indesign.zip",permissions:["manage_content"]}]},{label:"Settings",icon:"mdi:cog-outline",permissions:["view_site_settings","manage_site_settings","view_site_layouts","manage_site_layouts","manage_menus","manage_redirects","view_site_sections","manage_site_sections","manage_memberships"],children:[{label:"Ad Unit Patterns",link:"/admin/ad-unit-patterns",permissions:["view_ad_unit_patterns","manage_ad_unit_patterns"],addLink:n.userHasPermission(["manage_ad_unit_patterns"])?"/admin/create-ad-unit-pattern":""},{label:"Layouts",link:"/admin/layouts",permissions:["view_site_layouts","manage_site_layouts"],addLink:n.userHasPermission(["manage_site_layouts"])?"/admin/create-web-layout":""},{label:"Menus",link:"/admin/menus",permissions:["manage_menus"]},{label:"MEIG Settings",link:"/admin/meig-settings",permissions:["manage_site_settings"]},{label:"Redirects",link:"/admin/redirects",permissions:["manage_redirects"],addLink:"/admin/create-redirect"},{label:"Sections",link:"/admin/website-sections",permissions:["view_site_sections","manage_site_sections"],addLink:n.userHasPermission(["manage_site_sections"])?"/admin/create-website-section":""},{label:"Site Settings",link:"/admin/edit-site-settings",permissions:["view_site_settings","manage_site_settings"]}]},{label:"Cross Site",icon:"dashicons:admin-site-alt3",class:"cross-site",iconColor:L().primaryColor,permissions:["manage_content"],children:[{label:"Content Research",link:"/admin/content-research",permissions:["manage_content"]},{label:"Editorial Tracking Report",link:"/admin/editorial-tracking-report",permissions:["run_editorial_tracking_report"]},{label:"Content Detail Report",link:"/admin/content-detail-report",permissions:["run_content_detail_report"]},{label:"Content Length Report",link:"/admin/content-length-report",permissions:["run_content_length_report"]},{label:"Content Velocity Report",link:"/admin/content-velocity-report",permissions:["run_content_velocity_report"]},{label:"CMS Users",link:"/admin/cms-users",permissions:["manage_users"],addLink:"/admin/create-cms-user"},{label:"System Alerts",link:"/admin/system-alerts",permissions:["manage_system_alerts"],addLink:"/admin/system-alerts?new"}]}],p=[];for(let o=0;o {n.payload.status===1&&(this.hasPublishedTemplates=!0)}),this.cmsUserIsLoggedIn=!0}},methods:{createContent(e){e&&window.open(`/admin/create-content/${e}`)},manageUrl(e){return`/content?types=%5B%22${e}%22%5D`},upperFirst(e){return e.slice(0,1).toUpperCase()+e.slice(1,e.length)},async logout(){await this.$cmsUser.logout()}}},S=e=>($("data-v-722012c6"),e=e(),H(),e),se={class:"ebm-nav admin-toolbar"},ie={class:"parent-links"},te={class:"parent-link parent-link--home"},ae={href:"/"},oe={class:"child-links"},le={class:"heading"},re={class:"links"},me={key:0,class:"parent-link dev"},ce={class:"child-links"},de=S(()=>a("div",{class:"heading"},"Server Selection",-1)),pe={class:"links"},_e={class:"ebm-admin-toolbar-manage-link"},ue={class:"graph-selector"},ge={class:"parent-links bottom"},ke={key:0,class:"parent-link dev"},he={class:"child-links"},be=S(()=>a("div",{class:"heading"},"Dev Tools",-1)),ye={class:"links"},we={key:1,class:"parent-link parent-link--user user"},fe={class:"child-links"},ve=S(()=>a("div",{class:"heading"},"My Account",-1)),Le={class:"links"};function Se(e,n,s,p,m,o){const t=D,l=K,k=Y;return r(),_("nav",se,[a("ul",ie,[a("li",te,[a("a",ae,[a("img",{src:ee,class:"logo",style:V({width:o.iconWidth+"px"})},null,4)])]),(r(!0),_(b,null,P(m.menuLinks,i=>(r(),_(b,{key:i.label},[e.$cmsUser.userHasPermission(i.permissions)?(r(),_("li",{key:0,class:f(["parent-link",i.class])},[(r(),y(T(i!=null&&i.link?"a":"div"),R({ref_for:!0},i.link?{href:i.link}:null),{default:z(()=>[d(t,{class:"parent-links-icon",width:o.iconWidth,"icon-color":i.iconColor??"white",icon:i.icon},null,8,["width","icon-color","icon"])]),_:2},1040)),a("ul",oe,[a("div",le,w(i.label),1),a("div",re,[(r(!0),_(b,null,P(i.children,c=>(r(),_(b,{key:c.label},[c.link?(r(),y(l,{key:0,permissions:c.permissions,"link-label":c.label,link:c.link,"add-link":c==null?void 0:c.addLink},null,8,["permissions","link-label","link","add-link"])):c.options?(r(),y(l,{key:1,"link-label":c.label,"select-options":c.options,onChangeOption:o.createContent},null,8,["link-label","select-options","onChangeOption"])):u("",!0)],64))),128))])])],2)):u("",!0)],64))),128)),e.$config.public.DEV_TOOLS?(r(),_("li",me,[a("div",{class:f(["endpointBadge",o.server])},w(o.server),3),d(t,{class:"parent-links-icon",width:o.iconWidth,icon:"solar:server-outline","icon-color":o.server=="Dev"||o.server=="Loc"?"#68ea61":"#fb5c5c"},null,8,["width","icon-color"]),a("ul",ce,[de,a("div",pe,[a("li",_e,[a("span",ue,[d(k)])])])])])):u("",!0)]),a("ul",ge,[e.$cmsUser.userHasPermission(["manage_modules"])?(r(),_("li",ke,[d(t,{class:"parent-links-icon",width:o.iconWidth,icon:"material-symbols:code-blocks-outline"},null,8,["width"]),a("ul",he,[be,a("div",ye,[d(l,{permissions:["view_history"],"link-label":"History",link:"/admin/history"}),d(l,{permissions:["manage_modules"],"link-label":"Modules",link:"/admin/edit-enabled-modules"}),d(l,{permissions:["manage_modules"],"link-label":"Page Speed Report",link:"/admin/page-speed-report"}),d(l,{permissions:["manage_modules"],"link-label":"Debug Form API",link:"/admin/test-form-api"}),d(l,{"link-label":"Utilities",link:"/admin/system"})])])])):u("",!0),m.cmsUserIsLoggedIn?(r(),_("li",we,[d(t,{class:"parent-links-icon",width:o.iconWidth,icon:"mdi:account-circle-outline"},null,8,["width"]),a("ul",fe,[ve,a("div",Le,[d(l,{"link-label":"User Profile",link:"/admin/user"}),a("div",{onClick:n[0]||(n[0]=(...i)=>o.logout&&o.logout(...i))},[d(l,{"link-label":"Logout"})])])])])):u("",!0)])])}const Me=v(ne,[["render",Se],["__scopeId","data-v-722012c6"]]);export{Me as default};