import{_ as O,o as l,c,F as h,a as o,t as L,d as _,l as b,b as v,a0 as T,y as C,P as $,ar as y,G as H,T as N,u as F,J as B,z as G,x as S,q as W,p as D,f as R,as as q,D as K,s as A,ah as X,ai as j}from"./CmnEfQIC.js";import{u as U,_ as J}from"./AdminButtonElement-BgARiw82.mjs";import Q from"./AdminFormSelect-CJPfN7ok.mjs";import{V as Y}from"./vue-select-X0cl5iEg.mjs";import{_ as Z}from"./WebSearchField-CImNmY9x.mjs";import{_ as ee}from"./Modal-CZRoBy2z.mjs";import"./WebSearchFilterCount-BAo3tYv2.mjs";import"./FieldBase_String-DIrYardi.mjs";import"./FieldBase-BNePpS9o.mjs";const ne={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:U()}},methods:{changeOption(e,n){this.$emit("change-option",n)}}},se=["href","target"],te=["href","target"];function ie(e,n,s,u,p,t){const a=J,r=Q;return!s.permissions||e.$cmsUser.userHasPermission(s.permissions)?(l(),c("li",{key:0,class:C([{active:s.link===(e._.provides[$]||e.$route).path||s.addLink===(e._.provides[$]||e.$route).path},"ebm-admin-toolbar-manage-link"])},[s.linkLabel?(l(),c(h,{key:0},[o("a",{class:"list-link",href:s.link,target:s.target},L(s.linkLabel),9,se),s.addLink?(l(),c("a",{key:0,href:s.addLink,class:"button-link",target:s.target},[_(a,{label:"Add",size:"small",color:p.adminStyles.primaryColor},null,8,["color"])],8,te)):b("",!0),s.selectOptions?(l(),v(r,{key:1,options:s.selectOptions,name:s.linkLabel,class:"select",onChangeValue:t.changeOption},null,8,["options","name","onChangeValue"])):b("",!0)],64)):T(e.$slots,"default",{key:1},void 0,!0)],2)):b("",!0)}const V=O(ne,[["render",ie],["__scopeId","data-v-97af2448"]]),w="graphql.aspire-ebm.com",M={LOCAL:"http://localhost:4000",DEV:`https://dev.${w}`,REDESIGN:`https://redesign.${w}`,GEMENON:`https://gemenon.${w}`,AERILON:`https://aerilon.${w}`,PICON:`https://picon.${w}`,SCORPIA:`https://scorpia.${w}`},ae={components:{VueSelect:Y},async setup(){const{listTenants:e}=N();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,name:s})=>({label:`LOCAL: ${s} (${n})`,tenantKey:e,httpEndpoint:M.LOCAL}))},devOptions(){return this.tenantList.map(({tenantKey:e,abbreviation:n,name:s})=>({label:`DEV: ${s} (${n})`,tenantKey:e,httpEndpoint:M.DEV}))},redesignOptions(){return this.tenantList.map(({tenantKey:e,abbreviation:n,name:s})=>({label:`UIUX: ${s} (${n})`,tenantKey:e,httpEndpoint:M.REDESIGN}))},prodOptions(){return this.tenantList.map(({tenantKey:e,abbreviation:n,prodEndpoint:s,name:u})=>({label:`PROD: ${u} (${n})`,tenantKey:e,httpEndpoint:s}))},options(){return[...this.localOptions,...this.devOptions,...this.redesignOptions,...this.prodOptions]}},watch:{selected(e,n){n&&e!==n&&(this.disabled=!0,y("apollo-endpoint",{path:"/"}).value=e.httpEndpoint,y("tenant-key",{path:"/"}).value=e.tenantKey,location.reload())}},mounted(){const e=y("apollo-endpoint").value??"https://dev.graphql.aspire-ebm.com",n=y("tenant-key").value??"ebm_electronicdesign",s=this.options.find(({httpEndpoint:u,tenantKey:p})=>u===e&&p===n);this.selected=s}},oe={class:"graph-selector"};function le(e,n,s,u,p,t){const a=H("VueSelect");return l(),c("div",oe,[_(a,{modelValue:p.selected,"onUpdate:modelValue":n[0]||(n[0]=r=>p.selected=r),clearable:!1,class:"select",options:t.options,style:{flex:"1 1 0"},disabled:p.disabled},null,8,["modelValue","options","disabled"])])}const re=O(ae,[["render",le],["__scopeId","data-v-c8471145"]]),z=()=>{var p;const{$ss:e,$cmsUser:n}=F(),s=[{label:"Content",icon:"mdi:database-outline",link:"/admin/content",permissions:["manage_content"],children:[{label:"Create New",permissions:["manage_content"],options:B().contentTypes("editKey").filter(t=>t.value!=="apparatus"&&t.value!=="in-quarters"||e.tenant==="cygnus_fhc"),changeValue:(t,a)=>{window.open(`/admin/create-content/${a}`)}},{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:(p=e==null?void 0:e.companyUpdate)==null?void 0:p.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"],condition:e.modules.newsletters,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"],condition:e.modules.magazines,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"],condition:e.modules.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:"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:e!=null&&e.useNewDesign?"/admin/site-settings-new":"/admin/edit-site-settings",permissions:["view_site_settings","manage_site_settings"]},{label:"Header Tagline/CTA",link:"/admin/edit-cta-message",permissions:["manage_header_cta"]}]},{label:"Cross Site",icon:"dashicons:admin-site-alt3",class:"cross-site",iconColor:U().primaryColor,permissions:["manage_content"],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:"Ad Unit Settings Report",link:"/admin/ad-unit-settings-report",permissions:["view_ad_unit_patterns","manage_ad_unit_patterns"]},{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"}]}],u=[];for(let t=0;t<s.length;t++){const a=s[t],r=(!(a!=null&&a.permissions)||n.userHasPermission(a.permissions))&&(a.condition===void 0||a.condition)?{...a}:null;if(r){if(r.children=[],a!=null&&a.children)for(let k=0;k<a.children.length;k++){const m=a.children[k],d=(!(m!=null&&m.permissions)||n.userHasPermission(m.permissions))&&((m==null?void 0:m.condition)===void 0||m.condition)?{...m}:null;d&&r.children.push(d)}u.push(r)}}return u},me={async setup(){return G({filter:"",fullMenuOptions:z(),menuOptions:[]})},watch:{filter(){this.filterMenu()}},methods:{updateFilter(e){this.filter=e},filterMenu(){var s,u,p,t,a,r,k,m;const e=[],n=this.filter.toLowerCase();if(n)for(let d=0;d<this.fullMenuOptions.length;d++){const i=this.fullMenuOptions[d],g=(u=(s=i==null?void 0:i.label)==null?void 0:s.toLowerCase())!=null&&u.includes(n)||(t=(p=i==null?void 0:i.description)==null?void 0:p.toLowerCase())!=null&&t.includes(n)?i.children:i.children.filter(f=>{var E,I,P,x;return((I=(E=f==null?void 0:f.label)==null?void 0:E.toLowerCase())==null?void 0:I.includes(n))||((x=(P=f==null?void 0:f.description)==null?void 0:P.toLowerCase())==null?void 0:x.includes(n))});(g.length||(r=(a=i==null?void 0:i.label)==null?void 0:a.toLowerCase())!=null&&r.includes(n)||(m=(k=i==null?void 0:i.description)==null?void 0:k.toLowerCase())!=null&&m.includes(n))&&e.push({...i,children:g})}this.menuOptions=e},createContent(e){e&&window.open(`/admin/create-content/${e}`)}}},de={class:"admin-modal-menu"},ce={class:"filter"},pe={class:"child-links"},_e={class:"heading"},ue={class:"links"};function ge(e,n,s,u,p,t){const a=Z,r=R,k=V;return l(),c("div",de,[o("div",ce,[_(a,{value:e.filter,"from-modal":!0,class:"text-search",onUpdate:n[0]||(n[0]=m=>{t.updateFilter(m)})},null,8,["value"])]),o("div",{class:"menu",style:D({fontFamily:e.$ss.primaryFontFamily})},[(l(!0),c(h,null,S(e.menuOptions,m=>(l(),c(h,{key:m.label},[e.$cmsUser.userHasPermission(m.permissions)?(l(),c("li",{key:0,class:C(["parent-link",m.class])},[o("ul",pe,[o("div",_e,[_(r,{class:"parent-links-icon",width:28,"icon-color":"#444",icon:m.icon},null,8,["icon"]),W(" "+L(m.label),1)]),o("div",ue,[(l(!0),c(h,null,S(m.children,d=>(l(),c(h,{key:d.label},[d.link?(l(),v(k,{key:0,permissions:d.permissions,"link-label":d.label,link:d.link,"add-link":d==null?void 0:d.addLink},null,8,["permissions","link-label","link","add-link"])):d.options?(l(),v(k,{key:1,"link-label":d.label,"select-options":d.options,onChangeOption:t.createContent},null,8,["link-label","select-options","onChangeOption"])):b("",!0)],64))),128))])])],2)):b("",!0)],64))),128))],4)])}const ke=O(me,[["render",ge]]),he=q("/images/ebm_logo_small.png"),be={props:{page:{type:Object}},data(){return{cmsUserIsLoggedIn:!1,hasPublishedTemplates:!1,useSupportedContentTypes:K,useAdminStyles:U,adminSpotlight:!1,menuLinks:z()}},computed:{iconWidth(){return 28},server(){var n,s,u;let e="Prod";return(n=y("apollo-endpoint",{path:"/"}).value)!=null&&n.includes("localhost")?e="Loc":(s=y("apollo-endpoint",{path:"/"}).value)!=null&&s.includes("dev.")?e="Dev":(u=y("apollo-endpoint",{path:"/"}).value)!=null&&u.includes("redesign.")&&(e="UIUX"),e}},async mounted(){if(this.$cmsUser.isLoggedIn()){const e=await this.$gql.queryStream("getNewsletterTemplateStream",{});e.error||e.data.items.forEach(n=>{n.payload.status===1&&(this.hasPublishedTemplates=!0)}),this.cmsUserIsLoggedIn=!0}window.addEventListener("keydown",this.keyDownHandler)},methods:{keyDownHandler(e){(e==null?void 0:e.key)==="k"&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this.adminSpotlight=!0),(e==null?void 0:e.key)==="Escape"&&(e.preventDefault(),this.adminSpotlight=!1)},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()}}},ye={class:"ebm-nav admin-toolbar"},fe={class:"parent-links"},we={class:"parent-link parent-link--home"},ve={href:"/"},Le={class:"child-links"},Ce={class:"heading"},Se={class:"links"},Oe={key:0,class:"parent-link dev"},Me={class:"child-links"},Ue={class:"links"},Ee={class:"ebm-admin-toolbar-manage-link"},Ie={class:"graph-selector"},Pe={class:"parent-links bottom"},xe={key:0,class:"parent-link dev"},$e={class:"child-links"},Ae={class:"links"},De={key:1,class:"parent-link parent-link--user user"},Re={class:"child-links"},Ve={class:"links"};function ze(e,n,s,u,p,t){const a=R,r=V,k=re,m=ke,d=ee;return l(),c(h,null,[o("nav",ye,[o("ul",fe,[o("li",we,[o("a",ve,[o("img",{src:he,class:"logo",style:D({width:t.iconWidth+"px"})},null,4)])]),(l(!0),c(h,null,S(p.menuLinks,i=>(l(),c(h,{key:i.label},[e.$cmsUser.userHasPermission(i.permissions)?(l(),c("li",{key:0,class:C(["parent-link",i.class])},[(l(),v(j(i!=null&&i.link?"a":"div"),X({ref_for:!0},i.link?{href:i.link}:null),{default:A(()=>[_(a,{class:"parent-links-icon",width:t.iconWidth,"icon-color":i.iconColor??"white",icon:i.icon},null,8,["width","icon-color","icon"])]),_:2},1040)),o("ul",Le,[o("div",Ce,L(i.label),1),o("div",Se,[(l(!0),c(h,null,S(i.children,g=>(l(),c(h,{key:g.label},[g.link?(l(),v(r,{key:0,permissions:g.permissions,"link-label":g.label,link:g.link,"add-link":g==null?void 0:g.addLink},null,8,["permissions","link-label","link","add-link"])):g.options?(l(),v(r,{key:1,"link-label":g.label,"select-options":g.options,onChangeOption:t.createContent},null,8,["link-label","select-options","onChangeOption"])):b("",!0)],64))),128))])])],2)):b("",!0)],64))),128)),e.$config.public.DEV_TOOLS?(l(),c("li",Oe,[o("div",{class:C(["endpointBadge",t.server])},L(t.server),3),_(a,{class:"parent-links-icon",width:t.iconWidth,icon:"solar:server-outline","icon-color":t.server=="Dev"||t.server=="Loc"?"#68ea61":t.server==="UIUX"?"orange":"#fb5c5c"},null,8,["width","icon-color"]),o("ul",Me,[n[1]||(n[1]=o("div",{class:"heading"}," Server Selection ",-1)),o("div",Ue,[o("li",Ee,[o("span",Ie,[_(k)])])])])])):b("",!0)]),o("ul",Pe,[e.$cmsUser.userHasPermission(["manage_modules"])?(l(),c("li",xe,[_(a,{class:"parent-links-icon",width:t.iconWidth,icon:"material-symbols:code-blocks-outline"},null,8,["width"]),o("ul",$e,[n[2]||(n[2]=o("div",{class:"heading"}," Dev Tools ",-1)),o("div",Ae,[_(r,{permissions:["view_history"],"link-label":"History",link:"/admin/history"}),_(r,{permissions:["manage_modules"],"link-label":"Modules",link:"/admin/edit-enabled-modules"}),_(r,{permissions:["manage_modules"],"link-label":"Page Speed Report",link:"/admin/page-speed-report"}),_(r,{permissions:["manage_modules"],"link-label":"Debug Form API",link:"/admin/test-form-api"}),_(r,{"link-label":"Utilities",link:"/admin/system"})])])])):b("",!0),p.cmsUserIsLoggedIn?(l(),c("li",De,[_(a,{class:"parent-links-icon",width:t.iconWidth,icon:"mdi:account-circle-outline"},null,8,["width"]),o("ul",Re,[n[3]||(n[3]=o("div",{class:"heading"}," My Account ",-1)),o("div",Ve,[_(r,{"link-label":"User Profile",link:"/admin/user"}),o("div",{onClick:n[0]||(n[0]=(...i)=>t.logout&&t.logout(...i))},[_(r,{"link-label":"Logout"})])])])])):b("",!0)])]),_(d,{show:p.adminSpotlight,padding:"0","max-width":"700px","allow-close":!1,"is-spotlight":!0},{default:A(()=>[_(m)]),_:1},8,["show"])],64)}const Xe=O(be,[["render",ze],["__scopeId","data-v-76269da0"]]);export{Xe as default};