import{v as G,L as Q,u as M,x as O,c as s,s as R,a3 as w,a as P,o as z,W as b,b as B,e as m,w as i,h as a,l as I,t as h,g as u,H as y,z as V,i as j,j as D,f as o,A as H,q as F,ae as J,O as K,G as U}from"./index-OSKNspXo.js";import{H as X}from"./headerDetailComponent-D46cilGF.js";import{u as E}from"./astusStore-pVYUJkp6.js";import{_ as Y}from"./deenovaAvatarStoreComponent-CW76RUun.js";import"./QBtnDropdown-BxYnQIyn.js";import"./QBtnGroup-w8hcVKN7.js";/* empty css                                                                              */const Z={style:{"text-overflow":"ellipsis",overflow:"hidden","white-space":"nowrap","max-width":"60vw"}},ee={class:"q-pl-xs",style:{"font-size":"small","font-style":"italic"}},te={class:"row justify-end",style:{width:"40%"}},se={class:"q-pr-sm",style:{width:"50%"}},ae={key:0,class:"text-button"},ie={class:"q-pl-sm",style:{width:"50%"}},le={key:0,class:"text-button"},oe={__name:"titleComponent",setup(T){const k=E();Q();const{t:r}=M(),A=O(),n=Q(),l=s(()=>A.screen.width<900),{title:c,pk:d,subtitle:x}=R(k);s(()=>n.state.global.rights);const g=s(()=>n.state.global.rights.find(e=>(e.edit===1||e.visu===1)&&e.resource===w.astus_replenishment)),f=s(()=>n.state.global.rights.find(e=>(e.edit===1||e.visu===1)&&e.resource===w.astus_details)),$=s(()=>n.state.global.rights.find(e=>(e.edit===1||e.visu===1)&&e.resource===w.astus_wards_config)),C=s(()=>n.state.global.rights.find(e=>(e.edit===1||e.visu===1)&&e.resource===w.astus_consumption)),t=P([]);z(()=>{g.value&&t.value.push({title:r("menu.astus.replenishment.title"),icon:"input",click:async()=>{await S()}}),f.value&&t.value.push({title:r("astus.dashboard.detail.title"),icon:"description",click:async()=>{await L()}}),$.value&&t.value.push({title:r("menu.astus.parameter.title"),icon:"settings",click:async()=>{await N()}}),C.value&&t.value.push({title:r("menu.astus.consumption.title"),icon:"hide_source",click:async()=>{await W()}})});async function N(){await b.push({path:`/astus/${d.value}/param`})}async function S(){await b.push({path:`/astus/${d.value}/repl`})}async function L(){await b.push({path:`/astus/${d.value}/location`})}async function W(){await b.push({path:`/astus/${d.value}/consumption`})}const v=s(()=>{let e,_=t.value.findIndex(q=>q.title===c.value);return _+1<t.value.length?e=t.value[_+1]:e=t.value[0],e}),p=s(()=>{let e,_=t.value.findIndex(q=>q.title===c.value);return _-1>=0?e=t.value[_-1]:e=t.value[t.value.length-1],e});return(e,_)=>(m(),B(F,{class:"q-pr-md row justify-between"},{default:i(()=>[a("h6",null,[a("div",Z,[I(h(u(c)),1),a("label",ee,h(u(x)),1)])]),a("div",te,[a("div",se,[p.value&&p.value.title!==u(c)?(m(),B(V,{key:0,color:"primary",icon:"chevron_left",align:l.value?"center":"between",dense:"",class:"w-100","icon-right":l.value?void 0:p.value.icon,onClick:j(p.value.click,["stop"])},{default:i(()=>[l.value?y("",!0):(m(),D("div",ae,h(p.value.title),1)),o(H,null,{default:i(()=>[I(h(p.value.title),1)]),_:1})]),_:1},8,["align","icon-right","onClick"])):y("",!0)]),a("div",ie,[v.value&&v.value.title!==u(c)?(m(),B(V,{key:0,color:"primary",onClick:j(v.value.click,["stop"]),dense:"",class:"w-100",align:l.value?"center":"between",icon:l.value?void 0:v.value.icon,"icon-right":"chevron_right"},{default:i(()=>[l.value?y("",!0):(m(),D("div",le,h(v.value.title),1)),o(H,null,{default:i(()=>[I(h(v.value.title),1)]),_:1})]),_:1},8,["onClick","align","icon"])):y("",!0)])])]),_:1}))}},ne=G(oe,[["__scopeId","data-v-0997a2e6"]]),ce={class:"main-content",id:"panel"},ue={class:"container-fluid deenova_container margin-mobile"},re={class:"deenova_container margin-mobile"},de={class:"h-100",style:{"overflow-y":"hidden",display:"flex","flex-direction":"column"}},ve={class:"row",style:{flex:"1 1 auto"}},we={__name:"astusComponent",props:{id:{String}},setup(T){const k=E(),r=Q(),{t:A}=M(),{title:n,subActions:l,actions:c,pk:d,subtitle:x}=R(k),g=T;z(()=>{d.value=g.id});const f=s(()=>r.state.global.stores.find(t=>t.pk===parseInt(g.id))),$=s(()=>`${f.value.libelle} - ${n.value}`);async function C(){await b.push({name:"AstusDashboardComponent"})}return(t,N)=>{const S=J("router-view");return m(),D("div",ce,[a("div",ue,[a("div",re,[o(U,{class:"h-100"},{default:i(()=>[o(K,{class:"h-100",style:{padding:"unset !important"}},{default:i(()=>[a("div",de,[o(X,{close:C,hideEditButton:"","display-label":"",actions:u(c),displayLabel:"","sub-actions":u(l),label:$.value,"sub-label":u(x)},{avatar:i(()=>[o(Y,{"url-avatar":f.value.avatar,equipement:f.value},null,8,["url-avatar","equipement"])]),title:i(()=>[o(ne)]),_:1},8,["actions","sub-actions","label","sub-label"]),a("div",ve,[o(S)])])]),_:1})]),_:1})])])])}}};export{we as default};
//# sourceMappingURL=astusComponent-BzNV6UTQ.js.map
