1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3129],{99825:function(e,l,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/myclub/staff",function(){return t(17799)}])},93293:function(e,l){"use strict";l.Z={src:"/_next/static/media/plusIcon.e1afe410.svg",height:16,width:16,blurWidth:0,blurHeight:0}},2247:function(e,l,t){"use strict";t.d(l,{U:function(){return s},Y:function(){return useGetMembers}});var a,s,n=t(23405),i=t(50951),d=t(17252);function useGetMembers(e,l,t,a,s,r,o,c){let u=["club_members",e,t,l,a,s,c,r,o],_=(0,n.N)(u,async n=>{let{pageParam:u}=n,_={per_page:20,page:u||1,role:l};t&&(_.keyword=t),a?"checkin"===a[0]?_.is_checked=a[1]:(_.sort=a[0],_.order=a[1]):_.is_checked="asc",null!=s&&(_.status=s),null!=c&&(_.user_id=c),r&&(_.date_from=r),o&&(_.date_to=o);let m=d.Z.stringify(_),{data:g}=await i.x1.get("/api/clubs/".concat(e,"/users?").concat(m));return g},{enabled:!!e,keepPreviousData:!0,getNextPageParam:e=>{if(e.current_page<e.last_page)return e.current_page+1}});return _}(a=s||(s={})).owner="owner",a.admin="admin",a.trainer="trainer",a.member="member",a.judge="judge"},29458:function(e,l,t){"use strict";t.d(l,{s:function(){return s}});var a=t(26660);let s=(0,a.Ue)(e=>({back:void 0,setBack:l=>e(()=>({back:l}))}))},17799:function(e,l,t){"use strict";t.r(l),t.d(l,{default:function(){return Staff}});var a=t(11527),s=t(50959),n=t(76195),i=t(97031),d=t.n(i),r=t(59342),o=t(29256),c=t(5482),u=t(55383),_=t(69730),m=t(5277),g=t(23865),y=t(2247),b=t(93293),h=t(43704),f=t.n(h),p=t(27360),S=t(39164),x=t(9710),k=t(93828),j=t(65985),R=t(74995),v=t(48691),M=t(85335),B=t(20310),w=t(92179),N=t(62585);let C=[{value:"admin",label:"Admins"},{value:"member",label:"Members"},{value:"trainer",label:"Trainers"}];var RoleFilter_tsx_RoleFilter=e=>{let{value:l,setValue:t,wrapperStyle:s}=e;return(0,a.jsx)(N.Z,{sx:s,children:(0,a.jsx)(w.Z,{placeholder:"Select Filter",theme:"dark",size:"small",options:C,value:l,onChange:e=>t(e.target.value)})})},Z=t(38910);function ClubStaffTabPanel(){let{t:e}
1=(0,Z.$G)(),[l,t]=(0,s.useState)(),[i,h]=(0,s.useState)(),[w,N]=(0,s.useState)(!1),[C,H]=(0,s.useState)(!1),[X,L]=(0,s.useState)(787),[F,P]=(0,s.useState)(""),T=(0,u.N)(F,300),E=(0,s.useRef)(null),I=(0,r.HP)(e=>e).data,[O,Y]=(0,s.useState)("all"),A=(0,M.useSearchParams)(),G=A.get("club_id"),{data:U,hasNextPage:W,fetchNextPage:V,isFetching:D}=(0,y.Y)(Number(G),y.U[O],T,l),J=(0,s.useMemo)(()=>U&&U.pages.flatMap(e=>e.data)||[],[U]),Q=(0,m.k)(Number(G)),z=(0,k.k)();(0,s.useEffect)(()=>{i&&h(J.find(e=>e.id===i.id))},[U]);let[q,$]=(0,s.useState)([]);(0,s.useEffect)(()=>{$([])},[J]);let K=(0,s.useCallback)(async()=>{await Promise.all(q.map(async e=>{await z.mutateAsync({club_id:Number(G),member_id:e})})),H(!1)},[q,I,z]);(0,s.useEffect)(()=>{E.current&&L(window.innerHeight-E.current.getBoundingClientRect().top-78)},[E]);let ee=(0,s.useMemo)(()=>[{id:"name",content:e("myclub.pages.staff.table.name"),sticky:!0,columnStyles:{minWidth:180},active:(null==l?void 0:l[0])==="status",onClick:()=>sortTable("status")}],[e,l]),sortTable=(e,a)=>{let[s,n]=l||[];return a?t([e,a]):e===s&&"name"===e?t("desc"===n?void 0:[e,"desc"]):void t("checkin"===e?[e,1]:[e,"asc"])},el=(0,s.useMemo)(()=>J.map(e=>{let l=[{column:"name",content:e.user.name}];return{id:e.id.toString(),columns:l,onClick:()=>h(e)}}),[U])||[];return(0,a.jsxs)("div",{className:d().tab,children:[(0,a.jsx)(j.Z,{title:e("myclub.pages.staff.title"),loading:D,actions:(0,a.jsxs)(a.Fragment,{children:[!!q.length&&(0,a.jsx)(R.Z,{onClick:()=>H(!0),theme:"dark",variant:"outlined",children:e("myclub.pages.staff.actions.deleteSelected",{count:q.length})}),(0,a.jsx)(RoleFilter_tsx_RoleFilter,{value:O,setValue:Y,wrapperStyle:{width:"120px"}}),(0,a.jsx)(v.Z,{value:F,onChange:e=>{P(e.target.value)},placeholder:e("myclub.pages.staff.actions.searchUser"),icon:(0,a.jsx)(_._Ve,{}),type:"search",size:"small"}),(0,a.jsx)(R.Z,{theme:"dark",onClick:()=>N(!0),children:e("myclub.pages.staff.actions.add")})]})}),(0,a.jsx)("section",{ref:E,children:el&&(0,a.jsx)(n.Z,{idColumn:!0,className:d().table,head:ee,body:el,check:{values:q,onCheck:e=>$(e)},fetching:D,skeleton:{rows:10,height:18}})}),(0,a.jsxs)("button",{className:d().addNew,onClick:()=>N(!0),children:[(0,a.jsx)(f(),{src:b.Z,alt:"Add member icon"}),(0,a.jsx)("span",{children:e("myclub.pages.staff.actions.add")})]}),(0,a.jsx)(o.n,{isOpen:!!i,setIsOpen:()=>h(void 0),title:e("myclub.pages.staff.memberDetails"),children:i&&(0,a.jsx)(c.Z,{coverOffsert:!0,editable:["contact","location","shirt"],member:i})},"member-details"),(0,a.jsx)(o.n,{showBtn:!0,loading:Q.isLoading,formId:"new-member",isOpen:!!w,setIsOpen:N,title:e("myclub.pages.staff.addNewMember"),children:(0,a.jsx)("div",{style:{display:"flex",width:"100%"},children:(0,a.jsx)(g.Z,{onFinish:()=>N(!1)})})},"new-member"),(0,a.jsxs)(p.Z,{isOpen:C,onClose:H,title:e("myclub.pages.staff.deleteModal.title"),children:[(0,a.jsx)(S.x,{fontPack:"bodySmallRegular",color:"var(--color-neutral800)",style:{textAlign:"center"},children:e("myclub.pages.staff.deleteModal.description")}),(0,a.jsx)(x.F,{margin:"12px"}),(0,a.jsxs)(x.F,{gap:"8px",children:[(0,a.jsx)(R.Z,{theme:"light",loading:z.isLoading,onClick:K,children:e("myclub.common.delete")}),(0,a.jsx)(R.Z,{onClick:()=>H(!1),theme:"light",variant:"outlined",children:e("myclub.common.cancel")})]})]}),!D&&(0,a.jsx)(B.Z,{onIntersepting:()=>{W&&V()}})]})}var H=t(172);function Staff(){return(0,a.jsx)(ClubStaffTabPanel,{})}Staff.getLayout=e=>(0,a.jsx)(H.Z,{children:e})},97031:function(e){e.exports={displaySmallRegular:"style_displaySmallRegular__vLWCE",displaySmallBold:"style_displaySmallBold__uFdqQ",displayXSmallBold:"style_displayXSmallBold__Ej9M_",displayXSmallRegular:"style_displayXSmallRegular__ZYkc_",displayMediumRegular:"style_displayMediumRegular__YSfIJ",bodyLargeRegular:"style_bodyLargeRegular__ErJn8",bodyLargeBold:"style_bodyLargeBold__YG_Pi",bodyMediumRegular:"style_bodyMediumRegular__Yc7s_",bodyMediumBold:"style_bodyMediumBold__nQTl2",bodySmallRegular:"style_bodySmallRegular__ZSsA3",bodySmallBold:"style_bodySmallBold__Hj_Vw",bodyXSmallBold:"style_bodyXSmallBold__eFJLd",bodyXSmallRegular:"style_bodyXSmallRegular__HYo_k",actionLargeBold:"style_actionLargeBold__BRdaN",actionLargeMedium:"style_actionLargeMedium__83aju",actionMediumMedium:"style_actionMediumMedium__fjFsg",actionMediumBold:"style_actionMediumBold__nneIm",actionMediumRegular:"style_actionMediumRegular__yLuha",actionSmallRegular:"style_actionSmallRegular__9htFU",headerH1:"style_headerH1__mPGhp",headerRegular:"style_headerRegular__i8Tdf",actionXSmallRegular:"style_actionXSmallRegular__5t8c8",actionSmallMedium:"style_actionSmallMedium__1bYWG",headingH1Bold:"style_headingH1Bold__u3ZsR",headingH1Regular:"style_headingH1Regular__bWWDN",headingH2Bold:"style_headingH2Bold__cTkX_",headingH3Bold:"style_headingH3Bold__vjN3C",headingH3Regular:"style_headingH3Regular__9gjNX",captionRegular:"style_captionRegular__lyuiF",table:"style_table__TTaVr",tabList:"style_tabList__iOm1k",addNew:"style_addNew__QnX8o",checked:"style_checked___PXX1",checkInBox:"style_checkInBox__d9A2N",content__actions:"style_content__actions__0USuy"}}},function(e){e.O(0,[8217,9714,9282,7713,8447,3871,5482,3640,6071,9774,2888,179],function(){return e(e.s=99825)}),_N_E=e.O()}]);
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.