1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6309],{11958:(e,t,l)=>{let a=l(1885);a=a.default||a;let s={threshold:.4,ignoreLocation:!0};class r{constructor(e,t,l={}){let r={...s,...l};this.searcher=new a(e,{...r,keys:t}),this.unfilteredResults=e.map((e,t)=>({item:e,score:1,refIndex:t}))}setCollection(e){this.searcher.setCollection(e),this.unfilteredResults=e.map((e,t)=>({item:e,score:1,refIndex:t}))}search(e,t){return e?this.searcher.search(e,t):this.unfilteredResults}}e.exports={Searcher:r,DEFAULT_OPTIONS:s,SITEWIDE_SEARCH_OPTIONS:{threshold:.2,ignoreLocation:!0,includeMatches:!0,includeScore:!0}}},26889:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>y});var a=l(6029),s=l(55729),r=l(71422),n=l(81278);let i=s.forwardRef(function({title:e,titleId:t,...l},a){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},l),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))});var o=l(22587),c=l(56923),d=l(31240),u=l(13771),x=l(11958),h=l(51369),m=l(25961);let f={USER:"user",COACH:"coach"},b=[{key:f.USER,label:"Search by Email"},{key:f.COACH,label:"Search by Coach"}],p=e=>{let{handleAdd:t,text:l,...r}=e,[n,o]=(0,s.useState)(!1),c=(0,h.cx)("bg-indigo-600","text-white","rounded-full","p-4","shadow-md","cursor-pointer","transition-all","duration-300","flex");return(0,a.jsx)("div",{className:r.className,children:(0,a.jsx)("button",{type:"button",className:c,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onClick:t,children:(0,a.jsxs)("div",{className:"flex items-center justify-center",children:[(0,a.jsx)(i,{className:"h-4 w-4 mr-1"}),(0,a.jsx)("span",{className:"text-sm whitespace-nowrap",children:l})]})})})};var j=l(72373),g=l(95647);let v=(0,j.s5)(()=>{let e=(0,n.useRouter)(),[t,l]=(0,s.useState)(f.USER),[i,h]=(0,s.use
1State)(null),[j,g]=(0,s.useState)([]);(0,s.useEffect)(()=>{(async()=>{let e=await (0,m.lLp)(),t=new x.Searcher(e,["Name","slug","Email"]);h(t),g(t.search())})()},[]);let v=async t=>{e.push("/admin/users/".concat(t.email))};return(0,a.jsxs)("div",{className:"relative flex-1",children:[(0,a.jsxs)("div",{className:"mt-10 mx-auto flex flex-col max-w-md w-full",children:[(0,a.jsx)("div",{className:"flex justify-center mb-4",children:(0,a.jsx)(c.t,{tabs:b,active:t,onClick:l})}),t===f.USER&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{className:"text-lg font-bold mb-2",children:"Search for a user"}),(0,a.jsx)(r.l1,{initialValues:{email:""},onSubmit:v,children:(0,a.jsxs)(r.lV,{className:"flex flex-col",children:[(0,a.jsx)(d.ks,{autoFocus:!0,name:"email",type:"email",placeholder:"[email protected]"}),(0,a.jsx)(u.Ay,{type:"submit",size:u.lO.LARGE,children:"Search"})]})})]}),t===f.COACH&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{className:"text-lg font-bold mb-2",children:"Search for a coach"}),(0,a.jsx)(d.rG,{name:"coach",type:"text",placeholder:"Search by coach name or slug",onChange:e=>{g(i.search(e.target.value))}}),(0,a.jsxs)("div",{className:"mt-6 max-h-80 overflow-y-scroll",children:[(0,a.jsx)("ul",{className:"divide-y divide-gray-100",children:j.map(t=>{var l,s,r,n,i;return(0,a.jsx)("li",{children:(0,a.jsx)("button",{type:"button",onClick:()=>{var l,a;return a=null==(l=t.item)?void 0:l.Email,void e.push("/admin/users/".concat(a))},className:"w-full",children:(0,a.jsxs)("div",{className:"w-full flex justify-between gap-x-6 py-5",children:[(0,a.jsxs)("div",{className:"flex gap-x-4",children:[(0,a.jsx)("img",{className:"h-12 w-12 flex-none rounded-full bg-gray-50",src:null==(r=t.item)||null==(s=r.Photo)||null==(l=s[0])?void 0:l.url,alt:""}),(0,a.jsxs)("div",{className:"min-w-0 flex-auto",children:[(0,a.jsx)("p",{className:"text-sm font-semibold leading-6 text-gray-900 text-left",children:t.item["Full Name"]}),(0,a.jsx)("p",{className:"mt-1 truncate text-xs leading-5 text-gray-500",children:null==(n=t.item)?void 0:n.Email})]})]}),(0,a.jsx)("div",{children:(0,a.jsx)(o.A,{className:"h-5 w-5 flex-none text-gray-400","aria-hidden":"true"})})]})})},null==(i=t.item)?void 0:i.Email)})}),0===j.length&&(0,a.jsx)("div",{className:"text-base text-gray-600 font-medium text-center",children:"No coaches found..."})]})]})]}),(0,a.jsx)(p,{className:"absolute bottom-8 left-8",text:"Add user",handleAdd:()=>{e.push("/admin/add")}}),(0,a.jsx)(p,{className:"absolute bottom-8 left-40",text:"Onboard org",handleAdd:()=>{e.push("/organization")}})]})});v.getLayout=e=>(0,a.jsx)(g.A,{hideFooter:!0,className:"flex flex-col",children:e});let y=v},54234:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin",function(){return l(26889)}])},56923:(e,t,l)=>{"use strict";l.d(t,{o:()=>n,t:()=>i});var a=l(6029);l(55729);var s=l(51369);let r=e=>{let{count:t,active:l}=e;return(0,a.jsx)("span",{className:(0,s.cx)("hidden border border-gray-300 ml-1.5 py-0.5 px-1 rounded-md text-xs font-medium md:inline-block",l?"bg-transparent text-indigo-600":"bg-gray-100 text-gray-600"),children:t})},n=e=>{let{active:t,onClick:l,count:n,children:i,disabled:o,id:c,controls:d,href:u}=e,x=(0,s.cx)("border-b-2 py-3 transition-colors",t?"border-indigo":"border-transparent"),h=(0,a.jsxs)("div",{className:(0,s.cx)(t?"bg-indigo-50 text-indigo-700":"bg-gray-50 text-gray-500 hover:text-gray-700 hover:bg-gray-100","whitespace-nowrap py-1.5 px-3 rounded-lg font-medium text-sm"),children:[i,"number"==typeof n&&(0,a.jsx)(r,{count:n,active:t})]});return u?(0,a.jsx)("a",{href:u,onClick:e=>{e.preventDefault(),l&&l()},id:c,role:"tab","aria-selected":t,"aria-controls":d,className:x,children:h}):(0,a.jsx)("button",{type:"button",onClick:l,disabled:o,id:c,role:"tab","aria-selected":t,"aria-controls":d,className:x,children:h})},i=e=>{let{tabs:t,active:l,onClick:r,className:i,label:o="Tabs",useAnchor:c,noBorder:d}=e;return(0,a.jsx)("div",{className:(0,s.cx)(!d&&"border-b border-gray-200",i),children:(0,a.jsx)("div",{className:"-mb-px -mx-4 px-4 flex space-x-3 overflow-x-auto scrollbar-hidden",role:"tablist","aria-label":o,children:t.map(e=>(0,a.jsx)(n,{onClick:()=>r(e.key),active:l===e.key,count:e.count,id:"tab-".concat(e.key),controls:"tabpanel-".concat(e.key),href:c?e.path:void 0,children:e.label},e.key))})})}},72373:(e,t,l)=>{"use strict";l.d(t,{ZA:()=>o,rd:()=>i,s5:()=>c});var a=l(6029),s=l(55729),r=l(81278),n=l(57521);let i=e=>{let t=(0,r.useRouter)();return(0,s.useEffect)(()=>{t.replace(e.to)},[]),null},o=e=>t=>{let{currentUser:l,loading:s}=(0,n.Us)(),o=(0,r.useRouter)();return s?null:l?(0,a.jsx)(e,{...t}):(0,a.jsx)(i,{to:"/login?returnPath=".concat(o.asPath)})},c=e=>t=>{let{currentUser:l,loading:s}=(0,n.Us)();return s?null:(null==l?void 0:l.role)!=="admin"?(0,a.jsx)(i,{to:"/not-found"}):(0,a.jsx)(e,{...t})}}},e=>{e.O(0,[5789,1479,525,2342,6184,2953,1885,1240,6593,636,8792],()=>e(e.s=54234)),_N_E=e.O()}]); 2//# sourceMappingURL=admin-923cb43682f3e761.js.map
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.