import{r as E,i as V,d as R,a7 as U,m as q,o as l,c,H as g,e as S,w as k,a as u,t as $,n as p,b as w,q as n,h as z,am as D,I as P,f as B,u as N,j as F,J,x as H,l as G}from"./app.DYjcs_9P.js";import{u as Q}from"./usePropParseJson.BsMW6Nhg.js";import{B as T}from"./ButtonEl.CMFPQabR.js";import{u as W,M as X}from"./useModalDisableAncestorScroll.B8BUOTUm.js";import{P as Y}from"./PopperTooltip.DpIfHkhC.js";import{u as Z}from"./usePopper.DWuB-QLF.js";import{A as j}from"./AccordionElement.BFuzb7Nn.js";import{_ as A}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./forEachObjIndexed.Ccg_b8Br.js";import"./useSetCustomProperty.6km3TfMt.js";import"./useOutsideClick.CgUh4XFK.js";import"./useAccordionAnimation.DpubLgp8.js";import"./CaretIcon.BpCBoxVT.js";function K(y){const h=E([]),a=E(!1),r=E(-1),M=E(null),{anchorRef:m,floatRef:f,popperInstance:o,popperVisible:i,togglePopper:v}=Z({placement:"bottom",type:"button"}),b=V(()=>y.value.links.reduce((e,s)=>s.links.length===0?[...e,s.title]:e,[])),I=V(()=>{const e={[y.value.title]:{items:[],action:y.value.action}};return y.value.links.forEach(s=>{const C={[s.title]:{items:s.links.map(O=>({...O,id:O.title,textValue:O.title})),action:s.action}};e[y.value.title].items.push(C)}),e}),_=E(null);return{anchorRef:m,floatRef:f,popperVisible:i,togglePopper:v,handleOpenPopper:(e,s=0)=>{_.value&&clearTimeout(_.value),_.value=setTimeout(()=>{var C;e=="enter"?(i.value=!0,i.value&&((C=o.value)==null||C.update())):e=="leave"&&(i.value=!1,a.value=!1,r.value=-1)},s)},updateSubList:(e,s)=>{h.value=e,r.value=s,a.value=!0},subList:h,activeSubMenu:a,hoverIndex:r,mobileAccordion:I,subSectionOpen:M,disabledAccordions:b}}const x=["id"],ee=["href"],te=["href"],ne={key:1},oe=["href"],se=["onMouseover"],le=["href"],ie={key:0},ae=["href"],ue=R({__name:"MenuElItem",props:{item:{},buttonStyle:{default:"button"},mobile:{type:Boolean,default:!1},menuItemOpen:{default:""}},emits:["set-menu-item-open"],setup(y){const h=y;U(()=>{});const{anchorRef:a,floatRef:r,popperVisible:M,handleOpenPopper:m,updateSubList:f,subList:o,activeSubMenu:i,hoverIndex:v,mobileAccordion:b,subSectionOpen:I,disabledAccordions:_}=K(q(h,"item"));return(t,d)=>(l(),c("div",null,[t.mobile?(l(),c(g,{key:0},[t.item.links.length>0?(l(),S(j,{key:0,sections:n(b),"section-open":t.menuItemOpen,"caret-width":"30px","caret-height":"30px",flex:!1,"overflow-type":"auto",class:"outer-accordion","onUpdate:sectionOpen":d[1]||(d[1]=e=>t.$emit("set-menu-item-open",e))},{"header-section":k(({sectionKey:e})=>[u("div",{id:e,class:p(t.$style.expandableItem)},$(e),11,x)]),"expanded-section":k(({item:e})=>[w(j,{sections:e,"caret-width":"30px","caret-height":"30px","section-open":n(I),"disabled-accordions":n(_),class:"inner-accordion","onUpdate:sectionOpen":d[0]||(d[0]=s=>I.value=s)},{"header-section":k(({sectionKey:s,sectionValue:C})=>[u("a",{href:C.action},$(s),9,ee)]),"expanded-section":k(({item:s})=>[u("a",{href:s.action},$(s.title),9,te)]),_:2},1032,["sections","section-open","disabled-accordions"])]),_:1},8,["sections","section-open"])):(l(),c("div",ne,[u("a",{href:t.item.action},[u("div",null,$(t.item.title),1)],8,oe)]))],64)):(l(),c(g,{key:1},[t.item.links.length==0?(l(),S(T,{key:0,anchor:t.item.action,"button-style":t.buttonStyle,class:p(t.$style.link)},{default:k(()=>[z($(t.item.title),1)]),_:1},8,["anchor","button-style","class"])):(l(),c(g,{key:1},[w(T,{ref_key:"anchorRef",ref:a,anchor:"javascript:void(0);","button-style":t.buttonStyle,class:p(t.$style.link),onMouseenter:d[2]||(d[2]=e=>n(m)("enter")),onMouseleave:d[3]||(d[3]=e=>n(m)("leave",100))},{default:k(()=>[u("span",{class:p(t.$style.linkTitle)},$(t.item.title),3),u("i",{class:p(["fa-solid fa-chevron-left",{"fa-rotate-90":n(M),"fa-rotate-270":!n(M)}])},null,2)]),_:1},8,["button-style","class"]),w(Y,{ref_key:"floatRef",ref:r,active:n(M),"active-sub-menu":n(i),onMouseenter:d[4]||(d[4]=e=>n(m)("enter")),onMouseleave:d[5]||(d[5]=e=>n(m)("leave"))},D({default:k(()=>[u("div",{class:p(t.$style.menuContainer)},[(l(!0),c(g,null,P(t.item.links,(e,s)=>(l(),c("div",{key:e.title,class:p(t.$style.menuItem),onMouseover:C=>n(f)(e.links,s)},[u("div",null,[u("a",{href:e.action},$(e.title),9,le)]),n(_).includes(e.title)?B("",!0):(l(),c("div",ie,[u("i",{class:p(["fa-solid fa-chevron-left",{"fa-rotate-180":s!=n(v)}])},null,2)]))],42,se))),128))],2)]),_:2},[n(o).length>0?{name:"sub-menu",fn:k(()=>[u("div",{class:p(t.$style.subMenuContainer)},[(l(!0),c(g,null,P(n(o),e=>(l(),c("div",{key:e.title,class:p(t.$style.menuItem)},[u("a",{href:e.action},$(e.title),9,ae)],2))),128))],2)]),key:"0"}:void 0]),1032,["active","active-sub-menu"])],64))],64))]))}}),re="MenuElItem__menuContainer--afy8x2om",me="MenuElItem__subMenuContainer--afy8x2om",ce="MenuElItem__menuItem--afy8x2om",de="MenuElItem__expandableItem--afy8x2om",pe="MenuElItem__link--afy8x2om",fe="MenuElItem__linkTitle--afy8x2om",ve={menuContainer:re,subMenuContainer:me,menuItem:ce,expandableItem:de,link:pe,linkTitle:fe},be={$style:ve},ye=A(ue,[["__cssModules",be],["__scopeId","data-v-2e0e1072"],["__file","MenuElItem.vue"]]),Me=["id"],Ie=R({__name:"MenuElContent",props:{menuItems:{}},setup(y){const h=y,{width:a}=N(),r=E(""),M=E(null),m=async o=>{var b;if(!o){r.value="";return}const i=h.menuItems.findIndex(I=>I.title==o);r.value=o,await J(()=>!!document.getElementById(`accordion-item-${o}`),{locationUsage:"MenuElContent"});const v={target:"modal",offset:i>0&&((b=M.value)==null?void 0:b[o])||0,useStoredPosition:!0};H(v)};F(()=>{a.value<768&&!M.value&&(M.value=f())});const f=()=>{let o={};const i=document.querySelector("#modal-popup-scroll-container");return h.menuItems.forEach(v=>{const b=document.getElementById(`accordion-item-${v.title}`),I=(b==null?void 0:b.getBoundingClientRect().top)||0,_=(i==null?void 0:i.getBoundingClientRect().top)||0,t=I||0-_||0;o[v.title]=((i==null?void 0:i.scrollTop)||0)+t-50}),o};return(o,i)=>(l(),c("ul",{class:p({[o.$style.list]:n(a)>992,[o.$style.listMobile]:n(a)<=992})},[(l(!0),c(g,null,P(o.menuItems,(v,b)=>(l(),c("li",{id:`accordion-item-${v.title}`,key:v.title,class:p({[o.$style.listItem]:n(a)>992,[o.$style.listItemMobile]:n(a)<=992})},[w(ye,{item:v,"button-style":b!==o.menuItems.length-1?"link":"button",mobile:n(a)<=992,"menu-item-open":r.value,onSetMenuItemOpen:i[0]||(i[0]=I=>m(I))},null,8,["item","button-style","mobile","menu-item-open"])],10,Me))),128))],2))}}),ke="MenuElContent__list--lrd4y1lw",he="MenuElContent__listMobile--lrd4y1lw",_e="MenuElContent__listItem--lrd4y1lw",$e="MenuElContent__listItemMobile--lrd4y1lw",Ee="MenuElContent__link--lrd4y1lw",Ce={list:ke,listMobile:he,listItem:_e,listItemMobile:$e,link:Ee},ge={$style:Ce},L=A(Ie,[["__cssModules",ge],["__file","MenuElContent.vue"]]),Se=R({__name:"MenuEl",props:{menuItems:{}},setup(y){Q(y);const{width:a}=N(),r=E(!1),M=W();return G(a,m=>{m>992&&(r.value=!1)}),(m,f)=>(l(),c("div",null,[u("div",{class:p(m.$style.burgerButton)},[n(a)<=992?(l(),S(T,{key:0,id:"show_menu","button-style":"link",onClick:f[0]||(f[0]=o=>r.value=!0)},{default:k(()=>f[2]||(f[2]=[u("i",{class:"fa-sharp fa-solid fa-bars"},null,-1)])),_:1})):B("",!0),r.value?(l(),S(X,{key:1,ref_key:"modalRef",ref:M,"vertical-padding":"",onCloseModal:f[1]||(f[1]=o=>r.value=!1)},{content:k(()=>[w(L,{"menu-items":m.menuItems},null,8,["menu-items"])]),_:1},512)):B("",!0)],2),n(a)>992?(l(),S(L,{key:0,"menu-items":m.menuItems},null,8,["menu-items"])):B("",!0)]))}}),we="MenuEl__burgerButton--jjpbvbxr",Be={burgerButton:we},Oe={$style:Be},Je=A(Se,[["__cssModules",Oe],["__file","MenuEl.vue"]]);export{Je as default};