1import{d as D,x as be,_ as E,o as s,c as l,y as ke,s as O,W as V,P as oe,T as we,I as K,z as ye,F as $e,C as xe,B as J,D as Se,E as U,G as Y,S as ne,u as F,q as G,i as $,J as P,r as g,K as y,w as S,a as k,b as t,L as j,M as W,O as T,m as b,t as w,H as Ae,j as B,Q as Me,v as Z,R as Ce,U as X,V as q,X as ee,Y as Te,e as ie,A as ae,p as re,f as le,Z as De,k as z,$ as N,a0 as Re,a1 as Le,a2 as Ie,a3 as Ne}from"./index-0dd53362.js";import{g as Q,a as ce,b as We,u as Ee,c as Oe}from"./helpers-12e6c486.js";import{u as Be}from"./useEmitt-719d2b5e.js";import{G as Pe,A as te}from"./constants-03110f38.js";import{u as de}from"./useMeta-39490b5c.js";import{t as He}from"./throttle-671d28a5.js";import{H as ue}from"./HUserAvatar-cc495394.js";import{v as Fe}from"./v-click-outside.umd-2f65402a.js";import{H as pe}from"./HAlert-c7d61259.js";import{u as me}from"./useBreakPoints-7901cb6f.js";import{u as se}from"./UseGlobalLoader-016c8849.js";import{u as je,F as Ve}from"./FileControlModalGroup-ff0f21f8.js";import{f as ze}from"./index-0c6eace6.js";import"./isObject-271c9f1d.js";import"./index-a1bcdea1.js";import"./FileTypeIcon-63c6f10c.js";import"./ConfirmModal-14e0d682.js";import"./index-e2174bca.js";import"./index-defd00e0.js";import"./index-ea76b77d.js";const Ue=D({name:"Icon",props:{name:String,width:{type:String}},setup(e){return{iconName:e.name,iconWidth:e.width,loadIcon:be}}}),Ge=["src","alt"];function qe(e,n,a,r,p,h){return s(),l("img",{src:e.loadIcon(e.iconName||""),alt:e.iconName,style:ke({width:e.iconWidth})},null,12,Ge)}const Ke=E(Ue,[["render",qe]]),I=O(),fe=[{name:"Time entry",title:"sidebar.timeEntry",link:V.WorkerDashboard,hide:I==null?void 0:I.workerIsInactive,icon:"clock"},{name:"Managers",title:"sidebar.managers",link:V.WorkerManagers,hide:I==null?void 0:I.workerIsInactive,icon:"user-large"},{name:"Settings",title:"sidebar.settings",link:V.WorkerSettings,hide:I==null?void 0:I.workerIsInactive,icon:"gear"}],he=[{name:"Dashboard",title:"sidebar.dashboard",link:oe.Dashboard,icon:"house-blank"},{name:"Timesheets",title:"sidebar.timesheets",link:we.Timesheet,icon:"clock"},{name:"Invoices",title:"sidebar.invoices",link:K.Invoices,icon:"file"},{name:"Workers",title:"sidebar.workers",link:ye.IndexWorker,icon:"user-large",actionText:"Register workers",completeStep:{type:"register_worker",active:!1}},{name:"Files",title:"sidebar.files",link:$e.Files,icon:"folder"},{name:"Clients",title:"sidebar.clients",link:xe.Clients,icon:"briefcase-blank",actionText:"Register clients",completeStep:{type:"register_client",active:!1}},{name:"Profitability",title:"sidebar.profitability",link:J.ProfitabilityShow,icon:"arrow-up-right"},{name:"Projects",title:"sidebar.projects",link:Se.Projects,icon:"tasks"},{name:U.Appointments,title:"sidebar.appointments",link:U.Appointments,icon:"calendar"},{name:"Insights",title:"sidebar.insights",link:Y.Insights,icon:"heart-rate"},{name:"Settings",title:"sidebar.settings",link:ne.Settings,icon:"gear",completeStep:{type:"create_settings",active:!1}}],Je=D({name:"AppSidebar",emits:["hideSidebar"],props:{renderSidebar:Boolean},components:{Icon:Ke},setup(e,{emit:n}){const a=F(),r=G(),p=$(0),h=$(!1),i=O(),o=i.isWorkerRole?fe:he,f=$([...o]),d=$(!1),A=()=>{d.value=!1,setTimeout(()=>{n("hideSidebar")},500)},_=u=>{a.name!==u.link&&r.push({name:u.link})},c=async()=>{await i.onboardingSteps(),R()};i.isWorkerRole||c();const R=()=>{const u=i.teamCompletedSteps;u&&f.value.map(v=>{if(v.completeStep)for(const[C,M]of Object.entries(u))v.completeStep.type===C&&(v.completeStep.active=M)})},L=u=>a.matched[1].name===u,m=u=>{let v=!0;return u===Y.Insights&&(v=ce()),u===K.Invoices&&(v=i.allowShowInvoices),u===J.Profitability&&(v=i.allowShowProfitability),u===U.Appointments&&(v=i.allowShowAppointments),v};return P(()=>e.renderSidebar,()=>{setTimeout(()=>{d.value=e.renderSidebar},100)}),P(()=>a.path,()=>{if(!f.value.find(u=>u.link===a.name)){p.value=30;return}f.value.forEach((u,v)=>{u.link===a.name&&(p.value=v)})},{immediate:!0}),P(()=>i.teamCompletedSteps,()=>{R()},{immediate:!0}),{showSidebar:d,getMainRoute:Q,isWorker:i.isWorkerRole,workerNotActive:i.workerIsInactive,menuItems:f,isCollapse:h,pageIndex:p,hideSidebar:A,selectRoute:_,hideItem:m,menuIsActive:L,demo:i.isDemoAccount}}}),Ye={class:"shrink-0 bg-white py-10 px-8 flex items-center justify-start"},Ze={class:"w-7 flex justify-center relative"},Qe={key:1,class:"w-7 flex justify-center relative"}
1,Xe={class:"h-menu-name mt-3 opacity-0"};function et(e,n,a,r,p,h){const i=g("Icon"),o=g("router-link"),f=g("FontAwesomeIcon"),d=g("ElTooltip"),A=g("ElMenuItem"),_=g("ElMenu");return s(),y(_,{"default-active":e.pageIndex.toString(),collapse:!0,class:"h-sidebar sticky left-0 top-0 min-h-full h-screen"},{default:S(()=>[k(o,{to:e.getMainRoute()},{default:S(()=>[t("div",Ye,[k(i,{name:"app-logo",class:"mr-2.5"})])]),_:1},8,["to"]),e.workerNotActive?b("",!0):(s(!0),l(W,{key:0},j(e.menuItems,(c,R)=>(s(),l(W,{key:R.toString()},[e.hideItem(c.name)?(s(),y(A,{key:0,index:R.toString(),style:{padding:"0"},onClick:L=>e.selectRoute(c),class:T([{"hide-menu-item":c.name==="Settings"},{"is-active":e.menuIsActive(c.name)}])},{default:S(()=>[c.completeStep&&!c.completeStep.active&&!e.demo?(s(),y(d,{key:0,placement:"right",content:c==null?void 0:c.actionText},{default:S(()=>[t("div",Ze,[c!=null&&c.icon?(s(),y(f,{key:0,size:"2x",icon:["far",c==null?void 0:c.icon],class:"transition-none"},null,8,["icon"])):b("",!0),c.completeStep?(s(),l("div",{key:1,class:T(["absolute -bottom-1.5 -right-1.5 w-3 h-3 rounded-full",c.completeStep.active?"":"bg-green"])},null,2)):b("",!0)])]),_:2},1032,["content"])):(s(),l("div",Qe,[c!=null&&c.icon?(s(),y(f,{key:0,size:"2x",icon:["far",c==null?void 0:c.icon],class:"transition-none"},null,8,["icon"])):b("",!0)])),t("p",Xe,w(e.$t(c.title)),1)]),_:2},1032,["index","onClick","class"])):b("",!0)],64))),128))]),_:1},8,["default-active"])}const tt=E(Je,[["render",et]]),st=D({name:"AppHeader",components:{HBrandLogo:Ae},props:{isWorker:Boolean},setup(){const e=F(),n=G(),a=Q(),r=B(()=>e.name===oe.Dashboard);return{linkToDashboard:a,isDashboard:r,goBack:()=>{r.value||n.go(-1)}}}});function ot(e,n,a,r,p,h){var f;const i=g("FontAwesomeIcon"),o=g("HBrandLogo");return s(),l("div",{class:T(["h-mobile-header top-0 sticky z-40",{"bg-white sm:bg-transparent":e.isWorker,"bg-grey-low":!e.isWorker}])},[t("div",{class:T(["py-2 px-4 flex items-center justify-between sm:px-6 lg:px-8",{"bg-white sm:bg-transparent":e.isWorker,"bg-grey":!e.isWorker}])},[t("button",{class:T(["-ml-3 h-12 w-12 flex items-center justify-center",e.isDashboard&&"cursor-default"]),onClick:n[0]||(n[0]=(...d)=>e.goBack&&e.goBack(...d))},[e.isDashboard?b("",!0):(s(),y(i,{key:0,icon:["far","chevron-left"],class:"text-grey-low text-2xl"}))],2),k(o,{variant:"grey",url:(f=e.linkToDashboard)==null?void 0:f.name},null,8,["url"]),t("button",{onClick:n[1]||(n[1]=d=>e.$emit("toggleMenu")),type:"button",class:"-mr-3 h-12 w-12 inline-flex items-center justify-center focus:outline-none"},[k(i,{icon:["far","bars"],class:"text-grey-low text-2xl"})])],2)],2)}const nt=E(st,[["render",ot]]),it=(e,n)=>{const a=e[n];return a?typeof a=="function"?a():Promise.resolve(a):new Promise((r,p)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(p.bind(null,new Error("Unknown variable dynamic import: "+n)))})},at=D({name:"AppSlideOver",setup(){const e=Be(),n=$(!1),a=$(!1),r=Me(),p=()=>{n.value=!1},h=()=>{setTimeout(()=>{a.value=!1},500)};return Z(()=>{e.on(Pe.OPEN_SLIDEOVER,({name:i})=>{it(Object.assign({
1"../slideovers/SlideContactSales.vue":()=>Ce(()=>import("./SlideContactSales-a9af44b6.js"),["assets/SlideContactSales-a9af44b6.js","assets/index-0dd53362.js","assets/index-ee9ceb90.css"])
1}),`../slideovers/Slide${i}.vue`).then(o=>{r.value=o.default}),a.value=!0,setTimeout(()=>{n.value=!0},100)})}),{isOpen:n,onClose:p,onHideSlideOver:h,showSlideOver:a,comp:r}}}),rt={key:0,class:"fixed inset-0 overflow-hidden","aria-labelledby":"slide-over-title",role:"dialog","aria-modal":"true"},lt={class:"absolute inset-0 overflow-hidden"},ct={class:"fixed inset-y-0 right-0 pl-10 max-w-full flex"},dt={class:"w-screen max-w-md"},ut={class:"h-full flex flex-col py-6 bg-white shadow-xl overflow-y-auto"},pt={class:"px-4 sm:px-6"},mt={class:"flex"},ft={class:"ml-auto h-7 flex items-end"},ht=t("span",{class:"sr-only"},"Close panel",-1),_t=t("svg",{width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t("path",{d:"M7.5918 6.43512L11.3887 2.6734C11.5996 2.46246 11.5996 2.07574 11.3887 1.86481L10.5098 0.985901C10.2988 0.774963 9.91211 0.774963 9.70117 0.985901L5.93945 4.78278L2.14258 0.985901C1.93164 0.774963 1.54492 0.774963 1.33398 0.985901L0.455078 1.86481C0.244141 2.07574 0.244141 2.46246 0.455078 2.6734L4.25195 6.43512L0.455078 10.232C0.244141 10.4429 0.244141 10.8297 0.455078 11.0406L1.33398 11.9195C1.54492 12.1304 1.93164 12.1304 2.14258 11.9195L5.93945 8.12262L9.70117 11.9195C9.91211 12.1304 10.2988 12.1304 10.5098 11.9195L11.3887 11.0406C11.5996 10.8297 11.5996 10.4429 11.3887 10.232L7.5918 6.43512Z",fill:"#B9B9B9"})],-1),gt=[ht,_t],vt={class:"mt-6 relative flex-1 px-4 sm:px-6"};function bt(e,n,a,r,p,h){return e.showSlideOver?(s(),l("section",rt,[t("div",lt,[k(X,{"enter-active-class":"ease-in-out duration-500","leave-active-class":"ease-in-out duration-500","leave-to-class":"opacity-0","enter-from-class":"opacity-0","leave-from-class":"opacity-100","enter-to-class":"opacity-100"},{default:S(()=>[q(t("div",{class:"absolute inset-0 bg-grey-low bg-opacity-75 transition-opacity","aria-hidden":"true",onClick:n[0]||(n[0]=(...i)=>e.onClose&&e.onClose(...i))},null,512),[[ee,e.isOpen]])]),_:1}),t("div",ct,[k(X,{onLeave:e.onHideSlideOver,"enter-active-class":"transform transition ease-in-out duration-500","leave-active-class":"transform transition ease-in-out duration-500","enter-to-class":"translate-x-0","leave-from-class":"translate-x-0","leave-to-class":"translate-x-full","enter-from-class":"translate-x-full"},{default:S(()=>[q(t("div",dt,[t("div",ut,[t("div",pt,[t("div",mt,[t("div",ft,[t("button",{onClick:n[1]||(n[1]=(...i)=>e.onClose&&e.onClose(...i)),class:"bg-white rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"},gt)])])]),t("div",vt,[(s(),y(Te(e.comp)))])])],512),[[ee,e.isOpen]])]),_:1},8,["onLeave"])])])])):b("",!0)}const kt=E(at,[["render",bt]]),wt=D({name:"AppBreadcrumbs",setup(){const{addBreadcrumb:e,breadcrumbs:n,clearBreadcrumb:a,updateHeading:r}=de(),p=O(),h=F(),i=()=>{h.path.split("/").forEach((A,_)=>{h.matched[_]&&!h.matched[_].meta.nestedRoute&&e({path:h.matched[_].path,name:h.matched[_].name,text:h.matched[_].meta.breadCrumb})})},o=()=>{r(h.meta.routeName)},f=d=>!d.includes(".");return i(),o(),P(h,()=>{a(),i(),o()}),{breadcrumbs:n,getMainRoute:Q,timeEntryLayout:p.isWorkerRole,translated:f}}}),yt={class:"text-grey-low text-xs flex flex-wrap"},$t={key:0,class:"ml-1"},xt={key:1,class:"ml-1"},St={key:2,class:"ml-1"},At={key:1},Mt={key:0,class:"ml-1"},Ct={key:1,class:"ml-1"},Tt={key:2,class:"ml-1"};function Dt(e,n,a,r,p,h){const i=g("router-link");return s(),l("div",yt,[k(i,{to:e.getMainRoute()},{default:S(()=>[ie(w(e.$t("routes.home")),1)]),_:1},8,["to"]),(s(!0),l(W,null,j(e.breadcrumbs,(o,f)=>(s(),l(W,{key:o.text},[o.text&&o.path?(s(),y(i,{key:0,to:{name:o.name}},{default:S(()=>[f!==0?(s(),l("span",$t,"/")):b("",!0),e.translated(o.text)?(s(),l("span",xt,w(o.text),1)):(s(),l("span",St,w(e.$t(o.text)),1))]),_:2},1032,["to"])):o.text?(s(),l("a",At,[f!==0?(s(),l("span",Mt,"/")):b("",!0),e.translated(o.text)?(s(),l("span",Ct,w(o.text),1)):(s(),l("span",Tt,w(e.$t(o.text)),1))])):b("",!0)],64))),128))])}const Rt=E(wt,[["render",Dt]]),Lt=D({name:"AppMenu",props:{menuStatus:Boolean,user:Object},setup(e,{emit:n}
1){const a=G(),r=F(),p=O(),h=p.isWorkerRole?fe:he,i=$([...h]),o=_=>{n("closeMenu"),r.name!==_.link&&a.push({name:_.link})};async function f(){await p.logout(),await a.push({name:ae.Login})}return{menuItems:i,selectRoute:o,logout:f,menuIsActive:_=>p.isWorkerRole?r.meta.routeName===_:r.matched[1].name===_,hideItem:_=>{let c=!0;return _.hasOwnProperty("hide")&&_.hide&&(c=!1),_.name===K.Invoices&&(c=p.allowShowInvoices),_.name===J.Profitability&&(c=p.allowShowProfitability),_.name===Y.Insights&&(c=ce()),_.name===U.Appointments&&(c=p.allowShowAppointments),c}}}}),It="/assets/full-hillseek-logo-8dcbf6bb.svg";const _e=e=>(re("data-v-5613cfed"),e=e(),le(),e),Nt={class:"h-menu bg-primary top-o left-0 right-0 bottom-0 h-full fixed flex z-50 flex-col"},Wt={class:"py-2 px-4 flex items-center justify-between sm:px-6 lg:px-8 md:mb-28"},Et=_e(()=>t("div",{class:"-ml-3 h-12 w-12 flex items-center justify-center opacity-0"},null,-1)),Ot=_e(()=>t("img",{src:It,alt:"logo"},null,-1)),Bt={class:"w-full md:w-3/5 px-9 md:px-0 md:mx-auto flex items-center flex-col"},Pt={class:"flex items-center flex-col w-full"},Ht={class:"w-7 flex justify-center"},Ft={class:"ml-5 md:ml-10 text-base md:text-lg"},jt={class:"w-full border-t border-grey-low border-opacity-40 mt-5 md:mt-10 pt-5 md:pt-10"},Vt={class:"w-full md:mx-auto",style:{"max-width":"194px"}},zt={class:"w-7 flex justify-center"},Ut={class:"ml-5 md:ml-10 text-base md:text-lg"};function Gt(e,n,a,r,p,h){const i=g("FontAwesomeIcon"),o=g("ElMenuItem"),f=g("ElMenu");return s(),l("div",Nt,[t("div",Wt,[Et,Ot,t("button",{onClick:n[0]||(n[0]=d=>e.$emit("closeMenu")),class:"-mr-3 h-12 w-12 flex items-center justify-center text-white"},[k(i,{icon:["far","plus"],class:"transform rotate-45 text-2xl"})])]),t("div",Bt,[t("div",Pt,[k(f,{class:"h-mobile-menu md:max-w-xs w-full mr-auto md:mx-auto"},{default:S(()=>[(s(!0),l(W,null,j(e.menuItems,(d,A)=>(s(),l(W,{key:A},[e.hideItem(d)?(s(),y(o,{key:0,index:A.toString(),style:{"padding-left":"0"},class:T([{"is-active":e.menuIsActive(d.name)}]),onClick:_=>e.selectRoute(d)},{default:S(()=>[t("div",Ht,[d.icon?(s(),y(i,{key:0,icon:["far",d.icon],class:"text-lg md:text-2xl"},null,8,["icon"])):b("",!0)]),t("p",Ft,w(d.name),1)]),_:2},1032,["index","class","onClick"])):b("",!0)],64))),128))]),_:1}),t("div",jt,[t("div",Vt,[t("a",{href:"#",onClick:n[1]||(n[1]=(...d)=>e.logout&&e.logout(...d)),class:"flex items-center text-white py-2"},[t("div",zt,[k(i,{class:"text-lg md:text-2xl",icon:["far","arrow-right-from-bracket"]})]),t("p",Ut,w(e.$t("common.utils.logout")),1)])])])])])])}const qt=E(Lt,[["render",Gt],["__scopeId","data-v-5613cfed"]]),Kt=D({name:"AppDesktopMenu",props:{user:Object},setup(){var f,d;const e=O(),n=G(),a=e.isWorkerRole?V.WorkerSettings:"Settings",r=$(((d=(f=e.user)==null?void 0:f.team_member)==null?void 0:d.id)||1),p=[{name:"Your profile",title:"sidebar.profile",link:"",action:()=>n.push({name:De.Data,params:{id:r.value}}),icon:"user"},{name:"Settings",title:"sidebar.settings",link:"",action:()=>n.push({name:a}),icon:"gear"},{name:"Log out",title:"common.utils.logout",link:"",action:()=>o(),icon:"arrow-right-from-bracket"}],h=[{name:"Settings",title:"sidebar.settings",link:"",action:()=>n.push({name:a}),hide:e==null?void 0:e.workerIsInactive,icon:"gear"},{name:"Log out",title:"common.utils.logout",link:"",action:()=>o(),icon:"arrow-right-from-bracket"}],i=$(e.isWorkerRole?h:p);async function o(){await e.logout(),await n.push({name:ae.Login})}return{menu:i}}}),Jt={class:"absolute bg-primary rounded-lg px-7 py-5 right-0 flex flex-col top-14 w-max items-start z-50"},Yt=t("div",{class:"bg-primary w-2 h-2 transform rotate-45 absolute -top-1 right-4"},null,-1),Zt={class:"text-white font-bold mb-5 w-full"},Qt=["onClick"],Xt={class:"w-7 flex justify-center"};function es(e,n,a,r,p,h){const i=g("FontAwesomeIcon");return s(),l("div",Jt,[Yt,t("div",Zt,w(e.user.first_name)+" "+w(e.user.last_name),1),(s(!0),l(W,null,j(e.menu,(o,f)=>(s(),l(W,{key:f},[o.hasOwnProperty("hide")&&o.hide?b("",!0):(s(),l("div",{key:0,class:"text-white py-2.5 flex items-center",onClick:d=>o.action()},[t("div",Xt,[o.icon?(s(),y(i,{key:0,size:"1x",class:"text-white",icon:["far",o.icon]},null,8,["icon"])):b("",!0)]),t("div",null,w(e.$t(o.title)),1)],8,Qt))],64))),128))])}const ts=E(Kt,[["render",es]]),ss=D({name:"DemoMessage",components:{HAlert:pe},setup(){const e=O(),n=()=>{z.put(`/teams/${e.teamHash}/onboarding-steps-completion/updateByKey`,{options_name:"demo_notification",options_value:!1}).then(r=>{e.setOnboardingSteps(r.data.data)})},a=B(()=>{var r;return e.isDemoAccount&&((r=e.onboardingCompleteSteps)==null?void 0:r.demo_notification)});return{closeAlert:n,showMessage:a}}}),os={class:"flex flex-col sm:py-2"},ns={class:"font-bold text-lg text-primary mb-1"},is={class:"text-primary font-medium text-xs"};function as(e,n,a,r,p,h){const i=g("HAlert");return e.showMessage?(s(),y(i,{key:0,showClose:"",onClose:e.closeAlert},{custom:S(()=>[t("div",os,[t("h3",ns,w(e.$t("onboarding.demo.messageTitle")),1),t("p",is,w(e.$t("onboarding.demo.messageText")),1)])]),_:1},8,["onClose"])):b("",!0)}const rs=E(ss,[["render",as]]),ls={class:"flex flex-col sm:py-2"},cs={class:"font-bold text-lg text-primary mb-1"},ds=["innerHTML"],us=D({__name:"DownloadAppMessage",setup(e){O();const n=B(()=>!1);return(a,r)=>n.value?(s(),y(pe,{key:0},{custom:S(()=>[t("div",ls,[t("h3",cs,w(a.$t("workerEntry.common.appMessageTitle")),1),t("p",{class:"text-primary font-medium text-xs",innerHTML:a.$t("workerEntry.common.appMessageText",{iphone:N(te).IPHONE,android:N(te).ANDROID})},null,8,ds)])]),_:1})):b("",!0)}}),H=$(!0);function ps(){localStorage.setItem("sidebarVisibility",H.value.toString())}const ms=()=>{const e=localStorage.getItem("sidebarVisibility");e&&(H.value=JSON.parse(e))},ge=()=>({showSidebar:H,changeSidebarVisibility:()=>{H.value=!H.value,ps()},getSidebarVisibilityFromStore:ms}),fs=D({__name:"SidebarToggleButton",setup(e){const{changeSidebarVisibility:n,getSidebarVisibilityFromStore:a,showSidebar:r}=ge(),p=B(()=>r.value?"sidebar.hideSidebar":"sidebar.showSidebar");return Z(()=>{a()}),(h,i)=>{const o=g("FontAwesomeIcon"),f=g("ElTooltip");return s(),y(f,{placement:"bottom",content:h.$t(p.value)},{default:S(()=>[t("button",{class:"mr-5 flex items-center",onClick:i[0]||(i[0]=(...d)=>N(n)&&N(n)(...d))},[k(o,{icon:["far","bars"],class:"text-grey-low text-xl"})])]),_:1},8,["content"])}}}),hs={key:0,class:"relative"},_s={key:0,class:"absolute bottom-0 -right-2 bg-green rounded-full h-4 w-4 text-white text-xxs text-center font-medium"},gs={class:"flex justify-between items-start"},vs={key:0,class:"mb-8"},bs={class:"text-white font-bold text-base mb-1"},ks={key:1,class:"text-white font-bold text-base"},ws={key:0,class:"flex flex-col gap-y-9 w-full"},ys=["onClick"],$s={key:0,class:"flex items-center justify-center w-10 h-10 mr-4 shrink-0 rounded-full bg-white/10"},xs={class:"w-full flex flex-col"},Ss={class:"flex items-center"},As=["innerHTML"],Ms={class:"flex flex-shrink-0 flex-grow-1 items-center w-2.5"},Cs={key:0,class:"flex flex-grow-1 flex-shrink-0 rounded-full ml-auto bg-green w-2.5 h-2.5"},Ts={class:"text-xxs text-white font-bold"},Ds={key:1},Rs={class:"text-white font-bold text-base"},Ls=D({__name:"Notifications",setup(e){const{isMobile:n}=me(),{dateLocale:a}
1=Re(),r=O(),p=$(),h=$(0),i=$(0),o=$([]),{displayFileShowModal:f}=je(),d=()=>{se(!0);const m=We(`/teams/${r.teamHash}/notifications`,h.value,i.value,3);z.get(m).then(u=>{h.value=u.data.meta.total,i.value=u.data.meta.current_page,o.value=u.data.data.filter((v,C)=>{if(C<3)return v})}).finally(()=>{se(!1)})},A=(m,u)=>{if(!m)return"";const v=new Date(m);return isNaN(v.getTime())?"":ze(v,new Date,{locale:u})},_=m=>{var u;return(u=m.type)==null?void 0:u.includes("AppointmentReminderNotification")},c=(m,u)=>{if(_(m)){const M=m.data,x=M.time?` â ${M.time}`:"";return`<strong>${M.title}</strong>${x}`}const v=m.data.is_expired?"systemNtf.expiredText":"systemNtf.expireInText",C=m.data.is_expired?m.data.expiration_date:A(m.data.expiration_date,u);return Ee(v,{fileName:m.data.file_name,user:m.data.assigned_user,date:C})},R=m=>{if(_(m)){z.post(`/teams/${r.teamHash}/notifications/${m.id}/mark-as-read`).then(()=>{o.value.forEach(u=>u.id===m.id&&(u.read_at=new Date().toString()))});return}f(m.data.file_id),z.post(`/teams/${r.teamHash}/notifications/${m.id}/mark-as-read`).then(()=>{o.value.forEach(u=>u.id===m.id&&(u.read_at=new Date().toString()))})},L=B(()=>o.value.filter(m=>!m.read_at).length);return d(),(m,u)=>{const v=g("FontAwesomeIcon"),C=g("router-link"),M=g("ElPopover");return N(r).allowShowNotifications?(s(),l("div",hs,[t("button",{class:"relative mx-5",ref_key:"buttonRef",ref:p},[k(v,{icon:["far","bell"],class:"text-grey-low text-2xl"}),L.value?(s(),l("div",_s,w(L.value),1)):b("",!0)],512),k(M,{"virtual-ref":p.value,trigger:"hover","virtual-triggering":"",width:N(n)?280:380},{default:S(()=>[t("div",{class:T(["px-7 pt-4",o.value.length?"pb-8":"pb-4"])},[t("div",gs,[o.value.length?(s(),l("div",vs,[t("h3",bs,w(m.$t("systemNtf.notifications")),1),o.value.length?(s(),y(C,{key:0,to:{name:N(Le).AllNotifications},class:"shrink-0 text-white text-xs"},{default:S(()=>[ie(w(m.$t("systemNtf.seeAll")),1)]),_:1},8,["to"])):b("",!0)])):(s(),l("h3",ks,w(m.$t("systemNtf.allClear")),1)),k(C,{to:{name:N(ne).Notifications},class:"shrink-0"},{default:S(()=>[k(v,{icon:["far","sliders"],class:"text-white text-sm"})]),_:1},8,["to"])]),o.value.length?(s(),l("div",ws,[(s(!0),l(W,null,j(o.value,x=>(s(),l("div",{key:x.id,class:"flex items-center cursor-pointer w-full",onClick:qs=>R(x)},[_(x)?(s(),l("div",$s,[k(v,{icon:["far","calendar-days"],class:"text-white text-lg"})])):(s(),y(ue,{key:1,size:" w-10 h-10 mr-4",class:"cursor-pointer",avatar:x.data.photo,initials:x.data.assigned_user},null,8,["avatar","initials"])),t("div",xs,[t("div",Ss,[t("div",{class:"text-white text-left text-xxs break-normal font-medium mr-5",innerHTML:c(x,N(a))},null,8,As),t("div",Ms,[x.read_at?b("",!0):(s(),l("div",Cs))])]),t("div",Ts,w(_(x)?x.data.date:x.data.expiration_date),1)])],8,ys))),128))])):(s(),l("div",Ds,[t("h3",Rs,w(m.$t("systemNtf.noNotifications")),1)]))],2)]),_:1},8,["virtual-ref","width"]),k(Ve)])):b("",!0)}}}),Is=D({name:"LayoutApp",components:{Notifications:Ls,SidebarToggleButton:fs,FontAwesomeIcon:Ie,DownloadAppMessage:us,DemoMessage:rs,AppDesktopMenu:ts,HUserAvatar:ue,AppMenu:qt,AppBreadcrumbs:Rt,AppSlideOver:kt,AppHeader:nt,AppSidebar:tt},directives:{clickOutside:Fe.directive},setup(){const{heading:e,customLink:n,headingWithTranslation:a}=de(),r=O(),p=$(!1),h=$(!1),i=$(!1),o=$(!1),f=$({height:"100%"}),d=F(),A=$(d.fullPath.includes("settings")),{isDesktop:_}=me(),{showSidebar:c}=ge();P(d,()=>{A.value=d.fullPath.includes("settings")});const R=()=>{i.value=!i.value},L=()=>{o.value=!o.value},m=M=>{let x;return M<1024?x=p.value?220:150:x=p.value?170:100,{height:`calc(100% - ${x}px)`}},u=B(()=>r.user);Z(()=>{f.value=m(window.innerWidth),window.addEventListener("resize",He(()=>{f.value=m(window.innerWidth)},200))});const v=B(()=>{var M;return(M=r.user)==null?void 0:M.photo});P(()=>d.name,()=>{d.name==="App"&&Oe()},{immediate:!0});const C=()=>{o.value=!1};return{heading:e,showNotification:p,isWorker:r.isWorkerRole,sidebarIsRendered:h,containerStyles:f,isSettingsPage:A,menuStatus:i,user:u,optionStatus:o,avatarLogo:v,customLink:n,authStore:r,toggleOptions:L,toggleMenu:R,onClickOutside:C,close,isDesktop:_,headingWithTranslation:a,showSidebar:c}}});const ve=e=>(re("data-v-47485e17"),e=e(),le(),e),Ns={class:"flex bg-grey relative"},Ws=ve(()=>t("div",{id:"app-top"},null,-1)),Es={"aria-labelledby":"primary-heading",class:"min-w-0 flex-1 h-full relative"},Os={class:"flex items-center"},Bs=ve(()=>t("div",{class:"mr-4 h-12"},[t("div",{id:"top-nav-right"})],-1)),Ps={key:0,id:"primary-heading",class:"mb-3 flex items-end"}
1,Hs={key:0,class:"mr-2 font-bold text-2xl"},Fs={key:1,class:"mr-2 font-bold text-2xl"},js=["href"],Vs={key:0,class:"mr-2 font-bold text-2xl"},zs={key:1,class:"mr-2 font-bold text-2xl"},Us={class:"mb-1 text-grey-low hover:text-primary"};function Gs(e,n,a,r,p,h){const i=g("AppSidebar"),o=g("AppMenu"),f=g("AppHeader"),d=g("AppBreadcrumbs"),A=g("Notifications"),_=g("SidebarToggleButton"),c=g("HUserAvatar"),R=g("AppDesktopMenu"),L=g("FontAwesomeIcon"),m=g("DemoMessage"),u=g("DownloadAppMessage"),v=g("router-view"),C=g("AppSlideOver"),M=Ne("click-outside");return s(),l("div",Ns,[e.isDesktop&&e.showSidebar?(s(),y(i,{key:0,"render-sidebar":e.sidebarIsRendered},null,8,["render-sidebar"])):b("",!0),e.menuStatus&&!e.isDesktop?(s(),y(o,{key:1,user:e.user,onCloseMenu:e.toggleMenu},null,8,["user","onCloseMenu"])):b("",!0),t("div",{class:T(["flex-1 min-w-0 flex flex-col",[{"bg-white sm:bg-transparent":e.isWorker},{"min-h-screen":e.isDesktop&&!e.showSidebar}]])},[Ws,e.isDesktop?b("",!0):(s(),y(f,{key:0,"is-worker":e.isWorker,onToggleMenu:e.toggleMenu},null,8,["is-worker","onToggleMenu"])),t("main",{class:T(["flex-1 flex w-full",[e.isSettingsPage?"pt-6 px-0 md:px-6 pb-0":"py-6 md:p-6"]])},[t("section",Es,[t("div",{class:T(["flex items-center px-6 md:p-0 justify-between",{"mb-0 sm:mb-6":e.isWorker,"mb-4":!e.isWorker}])},[k(d,{class:T({"hidden sm:flex":e.isWorker})},null,8,["class"]),t("div",Os,[Bs,k(A),e.isDesktop?(s(),y(_,{key:0})):b("",!0),e.isDesktop?(s(),l("button",{key:1,onClick:n[0]||(n[0]=(...x)=>e.toggleOptions&&e.toggleOptions(...x)),class:"relative"},[t("div",null,[k(c,{size:"w-10 h-10",color:"bg-white text-grey-low",menuCircle:"",avatar:e.avatarLogo,initials:`${e.user.first_name} ${e.user.last_name}`},null,8,["avatar","initials"])]),e.optionStatus?q((s(),y(R,{key:0,user:e.user},null,8,["user"])),[[M,e.onClickOutside]]):b("",!0)])):b("",!0)])],2),t("div",{class:T(["flex justify-between px-6 md:p-0",{"hidden sm:flex":e.isWorker}])},[e.customLink?(s(),l("a",{key:1,id:"primary-heading",class:"mb-3 flex items-end",href:e.customLink},[e.headingWithTranslation?(s(),l("span",Vs,w(e.$t(e.heading)),1)):(s(),l("span",zs,w(e.heading),1)),t("span",Us,[k(L,{icon:["far","up-right-from-square"],class:"ml-2 text-md"})])],8,js)):(s(),l("h1",Ps,[e.headingWithTranslation?(s(),l("span",Hs,w(e.$t(e.heading)),1)):(s(),l("span",Fs,w(e.heading),1))]))],2),k(m),k(u),t("div",null,[k(v)]),k(C)])],2)],2)])}const ho=E(Is,[["render",Gs],["__scopeId","data-v-47485e17"]]);export{ho as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.