1var J=Object.defineProperty;var T=(l,e,t)=>e in l?J(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t;var a=(l,e,t)=>T(l,typeof e!="symbol"?e+"":e,t);import{a as n,e as o,o as r,U as L,x as U,_ as V,d as D,r as x,u as F,c as P,i as K,j as q,D as E,g as i,k as H,b as d,w as g,F as h,t as u,h as _,l as k,n as G,v as b,s as R}from"./index-DbpIxVVg.js";import{Z as j}from"./Zone-B11tA2dI.js";import{G as Q}from"./GroupedMap-BnpgQXxl.js";import{A as W}from"./ActivityIndicator-CHNVpzvm.js";import{_ as X}from"./ErrorView.vue_vue_type_script_setup_true_lang-rTuR_K5N.js";import{P as Y}from"./PageContent-CaO1rUex.js";import{P as ee}from"./PageHeader-D-doL8ee.js";import{_ as te}from"./UserLink.vue_vue_type_script_setup_true_lang-BvoOS9JY.js";import{_ as se}from"./RelativeTime.vue_vue_type_script_setup_true_lang-BRXoPN3V.js";import{r as oe}from"./UserCircleIcon-CrIC4GtU.js";import"./Stop-8NKSpgr4.js";import"./ErrorContent.vue_vue_type_script_setup_true_lang--XFDxIpt.js";import"./RoundedBadge-zDfp8xRL.js";import"./ArrowTopRightOnSquareIcon-Bwi8lzNJ.js";import"./ChevronRightIcon-CKGSa4-R.js";import"./disclosure-DbKVSJYz.js";import"./keyboard-C910qfwt.js";import"./entity-Dyy2H1qK.js";function N(l,e){return r(),n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{d:"M10 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM3.465 14.493a1.23 1.23 0 0 0 .41 1.412A9.957 9.957 0 0 0 10 18c2.31 0 4.438-.784 6.131-2.1.43-.333.604-.903.408-1.41a7.002 7.002 0 0 0-13.074.003Z"})])}class w{constructor(){a(this,"id");a(this,"groupKey");a(this,"groupName");a(this,"groupArea");a(this,"zoneKeys");a(this,"supervisorIds");a(this,"directorId")}static fromJSON(e){return Object.assign(new w,e)}}class y{constructor(){a(this,"zoneGroups");a(this,"zones");a(this,"directors");a(this,"supervisors")}static fromJSON(e){const t=new y;return t.zoneGroups=e.zoneGroups.map(s=>w.fromJSON(s)),t.zones=e.zones.map(s=>({zone:j.fromJSON(s.zone),zoneGroupId:s.zoneGroupId,activeCheckInCount:s.activeCheckInCount,crewCheckInCount:s.crewCheckInCount})),t.directors=e.directors.map(s=>L.fromJSON(s)),t.supervisors=e.supervisors.map(s=>L.fromJSON(s)),t}getAreas(){const e=Q.byKey(this.zoneGroups,"groupArea");return Array.from(e.entries()).map(t=>({name:t[0]||"Other",groups:t[1].sort((s,v)=>s.groupName.localeCompare(v.groupName)),director:this.directors.find(s=>t[1][0].directorId===s.id),order:t[0]?0:1})).sort((t,s)=>t.order!==s.order?t.order-s.order:t.name.localeCompare(s.name))}getZonesForGroup(e){return this.zones.filter(t=>t.zoneGroupId===e.id).sort((t,s)=>t.zone.name.localeCompare(s.zone.name))}getActiveCheckInCount(){return this.zones.map(e=>e.activeCheckInCount||0).reduce((e,t)=>e+t,0)}getCrewCheckInCount(){return this.zones.map(e=>e.crewCheckInCount||0).reduce((e,t)=>e+t,0)}}class re{constructor(e=U().apiClient){a(this,"client");this.client=e}async findAll(e){const t=await this.client.get(`/v1/zone/groups/${e.urlComponent}`);return y.fromJSON(t.data)}}const ne={},ae={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 30 30"};function ie(l,e){return r(),n("svg",ae,e[0]||(e[0]=[o("path",{fill:"currentColor",d:"M 15 4 C 7 4 5 6.343 5 8 L 5 21 C 5 22.942207 6.3848791 24.557162 8.2207031 24.919922 L 6.6816406 28 L 9 28 L 10.5 25 L 19.5 25 L 21 28 L 23.318359 28 L 21.779297 24.919922 C 23.615121 24.557162 25 22.942207 25 21 L 25 8 C 25 6.343 23 4 15 4 z M 8 8 L 13 8 C 13.552 8 14 8.448 14 9 L 14 13 C 14 13.552 13.552 14 13 14 L 8 14 C 7.448 14 7 13.552 7 13 L 7 9 C 7 8.448 7.448 8 8 8 z M 17 8 L 22 8 C 22.552 8 23 8.448 23 9 L 23 13 C 23 13.552 22.552 14 22 14 L 17 14 C 16.448 14 16 13.552 16 13 L 16 9 C 16 8.448 16.448 8 17 8 z M 9.5 19 C 10.328 19 11 19.672 11 20.5 C 11 21.328 10.328 22 9.5 22 C 8.672 22 8 21.328 8 20.5 C 8 19.672 8.672 19 9.5 19 z M 20.5 19 C 21.328 19 22 19.672 22 20.5 C 22 21.328 21.328 22 20.5 22 C 19.672 22 19 21.328 19 20.5 C 19 19.672 19.672 19 20.5 19 z"},null,-1)]))}const A=V(ne,[["render",ie]]),ce={class:"flex items-center"},le={key:0,class:"text-right -my-2 space-y-1"},de={class:"space-x-3 flex text-sm justify-end"},ue={key:0,class:"flex items-center space-x-2 bg-green-600 text-white dark:bg-black rounded-md pl-2 pr-3 py-1",title:"Crew checked in"},pe={key:1,class:"flex items-center space-x-2 bg-green-600 text-white dark:bg-black rounded-md pl-2 pr-3 py-1",title:"Staff checked in"},me={key:2,class:"text-slate-500"},Ce={class:"space-y-6"},ve={class:"flex space-x-3 mb-3 items-center px-4 md:px-0"},fe={class:"font-semibold text-slate-600-d flex-1"},xe={key:0},ge={class:G(["grid gap-px md:grid-cols-2 md:gap-4 xl:gap-6","lg:grid-cols-3","xl:grid-cols-4"])},he={class:"text-base font-semibold mb-2"},_e={class:"station-list text-sm space-y-1"},ke={key:0,class:"flex items-center space-x-1 rounded-md text-white pl-1 pr-2 bg-green-600"},we={key:0,class:"text-sm text-slate-500-d px-4 md:px-0"},ye={key:1,class:"flex mb-6 space-x-4 items-center"},ze={key:2},Ke=D({__name:"ZoneListView",setup(l){const e=x(),t=x(),s=x(!1),v=x();let z;const S=F(),M=new re,O=P(()=>{var f;return(f=e.value)==null?void 0:f.getAreas()});K(async()=>{await Z()}),q(()=>$());async function Z(){await I(),z=setInterval(()=>I(),60*1e3)}function $(){clearInterval(z)}async function I(){try{e.value=await M.findAll(S.geoRegion),s.value=!0,v.value=E.local()}catch(f){t.value=f}finally{s.value=!1}}return(f,c)=>{const B=R("router-link");return r(),n(h,null,[i(ee,null,{default:g(()=>[o("div",ce,[c[3]||(c[3]=o("h3",{class:"flex-1 text-xl md:text-3xl font-semibold tracking-tight text-gray-900 dark:text-gray-100"},"Zones",-1)),e.value?(r(),n("div",le,[c[2]||(c[2]=o("div",{class:"uppercase text-xs text-slate-500"},"Total checked in",-1)),o("div",de,[e.value.getCrewCheckInCount()?(r(),n("div",ue,[c[0]||(c[0]=o("span",{class:"opacity-70"},"Crew",-1)),i(A,{class:"w-4 h-4"}),o("span",null,u(e.value.getCrewCheckInCount()),1)])):d("",!0),e.value.getActiveCheckInCount()?(r(),n("div",pe,[c[1]||(c[1]=o("span",{class:"opacity-70"},"Station",-1)),i(_(N),{class:"w-4 h-4"}),o("span",null,u(e.value.getActiveCheckInCount()),1)])):e.value.getCrewCheckInCount()?d("",!0):(r(),n("div",me,"None"))])])):d("",!0)])]),_:1}),e.value?(r(),H(Y,{key:0},{default:g(()=>[o("div",Ce,[(r(!0),n(h,null,k(O.value,m=>(r(),n("div",{key:m.name},[o("div",ve,[o("div",fe,u(m.name),1),m.director?(r(),n("div",xe,[i(te,{user:m.director,class:"flex space-x-2 items-center text-sm text-slate-500 hover:text-orange-600-d"},{default:g(()=>{var C;return[i(_(oe),{class:"w-4 h-4"}),o("span",null,u((C=m.director)==null?void 0:C.displayName),1)]}),_:2},1032,["user"])])):d("",!0)]),o("div",ge,[(r(!0),n(h,null,k(m.groups,C=>(r(),n("div",{key:C.id,class:"bg-white dark:bg-slate-900 sm:rounded md:rounded-md shadow p-4 lg:px-6"},[o("div",he,u(C.groupName),1),o("div",_e,[(r(!0),n(h,null,k(e.value.getZonesForGroup(C),p=>(r(),n("div",{key:p.zone.id,class:"flex space-x-3"},[i(B,{to:`/zone/${p.zone.id}`,class:"block flex-1 text-slate-700-d font-medium hover:text-orange-600-d"},{default:g(()=>[b(u(p.zone.name),1)]),_:2},1032,["to"]),p.crewCheckInCount>0?(r(),n("div",ke,[i(A,{class:"w-4 h-4"}),o("span",null,u(p.crewCheckInCount),1)])):d("",!0),o("div",{class:G(["flex items-center space-x-1 rounded-md text-white pl-1 pr-2",p.activeCheckInCount>0?"bg-green-600":"bg-slate-300-d"])},[i(_(N),{class:"w-4 h-4"}),o("span",null,u(p.activeCheckInCount),1)],2)]))),128))])]))),128))])]))),128)),v.value?(r(),n("div",we,[c[4]||(c[4]=b(" Last updated ",-1)),i(se,{"date-time":v.value,"show-seconds":!0,"auto-updating":!0,"update-frequency":5e3}
1,null,8,["date-time"])])):d("",!0)])]),_:1})):d("",!0),s.value?(r(),n("div",ye,[i(W)])):t.value?(r(),n("div",ze,[i(X,{error:t.value},null,8,["error"])])):d("",!0)],64)}}});export{Ke 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.