1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9516],{64011:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/app/team",function(){return s(86004)}])},34503:function(e,t,s){"use strict";s.d(t,{Z:function(){return u}});var n=s(85893),r=s(67294),a=s(93579),i=s(39057),l=s(75837),d=s(11332),o=s(25652),c=s(85693);function u(e){var t=e.title,s=e.type,u=e.children,m=e.onClose,x=void 0===m?a.Z:m,h=(0,r.useState)(!0),f=h[0],g=h[1],p=(0,r.useRef)(null),b=null;return(b="error"===s?(0,n.jsx)(i.Z,{className:"h-5 w-5 text-red-400","aria-hidden":"true"}):"warning"===s?(0,n.jsx)(l.Z,{className:"h-5 w-5 text-yellow-400","aria-hidden":"true"}):"success"===s?(0,n.jsx)(d.Z,{className:"h-5 w-5 text-green-400","aria-hidden":"true"}):(0,n.jsx)(c.Z,{className:"h-5 w-5 text-blue-400","aria-hidden":"true"}),(0,r.useEffect)(function(){return g(!0),function(){p.current&&"error"===s&&p.current.scrollIntoView({behavior:"smooth"})}},[t,u,s]),f&&t)?(0,n.jsx)("div",{className:"my-4 rounded-md p-4 "+("error"===s?"bg-red-50":"warning"===s?"bg-yellow-50":"success"===s?"bg-green-50":"bg-blue-50"),ref:p,children:(0,n.jsxs)("div",{className:"flex",children:[(0,n.jsx)("div",{className:"flex-shrink-0",children:b}),(0,n.jsxs)("div",{className:"ml-3",children:[(0,n.jsx)("h3",{className:"text-md font-semibold "+("error"===s?"text-red-800":"warning"===s?"text-yellow-800":"success"===s?"text-green-800":"text-blue-800"),children:t}),u&&(0,n.jsx)("div",{className:"mt-2 text-sm overflow-hidden "+("error"===s?"text-red-700":"warning"===s?"text-yellow-700":"success"===s?"text-green-700":"text-blue-700"),children:u})]}),(0,n.jsx)("div",{className:"ml-auto pl-3",children:(0,n.jsx)("div",{className:"-mx-1.5 -my-1.5",children:(0,n.jsxs)("button",{type:"button",onClick:function(){g(!1),x()},className:"inline-flex rounded-md p-1.5 focus:outline-none focus:ring-2 focus:ring-offset-2"+("error"===s?"bg-red-50 text-red-500 hover:bg-red-100 focus:ring-red-600 focus:ring-offset-red-50":"warning"===s?"bg-yellow-50 text-yellow-500 hover:bg-yellow-100 focus:ring-yellow-600 focus:ring-offset-yellow-50":"success"===s?"bg-green-50 text-green-500 hover:bg-green-100 focus:ring-green-600 focus:ring-offset-green-50":"bg-blue-50 text-blue-500 hover:bg-blue-100 focus:ring-blue-600 focus:ring-offset-blue-50"),children:[(0,n.jsx)("span",{className:"sr-only",children:"Dismiss"}),(0,n.jsx)(o.Z,{className:"h-5 w-5","aria-hidden":"true"})]})})})]})}):null}},56560:function(e,t,s){"use strict";s.d(t,{Z:function(){return o}});var n=s(85893),r=s(67294),a=s(34503),i=s(41664),l=s.n(i),d=s(57292);function o(e){var t=e.team,s=e.isConceptsPage,i=(0,r.useState)(null),o=i[0],c=i[1];return(0,r.useEffect)(function(){(null==t?void 0:t.modelCredits)!==0||s?(null==t?void 0:t.modelCount)&&(null==t?void 0:t.conceptCredits)===0&&c("You have no remaining concept credits. Please upgrade your plan to generate concepts for your models."):c("You have no remaining model credits. Please upgrade your plan to train models.")},[t]),(0,n.jsx)(a.Z,{title:o,type:"warning",children:(0,n.jsxs)(l(),{href:"/app/account",children:["Manage plan ",(0,n.jsx)(d.Z,{className:"inline ml-2 h-4 w-4","aria-hidden":"true"})]})})}},86004:function(e,t,s){"use strict";s.r(t),s.d(t,{__N_SSP:function(){return N}});var n=s(47568),r=s(70655),a=s(85893);s(41664);var i=s(25675),l=s.n(i),d=s(76878),o=s(78680),c=s(65350),u=s(79470),m=s(34503);s(56560);var x=s(67294),h=s(35079),f=s(11355),g=s(46032),p=s(13840),b=s(11163),j=s.n(b),y=s(8364);function v(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return t.filter(Boolean).join(" ")}function w(e){var t=e.team,s=e.userId,n=e.userTeams,r=e.changeTeam,i=(0,x.useState)(t),l=i[0],d=i[1];return(0,x.useEffect)(function(){l.id!==t.id&&r(l.id)},[l]),(0,x.useEffect)(function(){d(t)},[t]),(0,a.jsx)("div",{className:"grow",children:(0,a.jsx)(h.R,{value:l,onChange:d,children:function(e){var t=e.open;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.R.Label,{className:"block text-sm font-medium text-gray-700",children:"Current Team"}),(0,a.jsx)("div",{className:"mt-2 max-w-xl text-xs text-gray-500",children:(0,a.jsx)("p",{children:"Switch between different team dashboards that you have access to."})}),(0,a.jsxs)("div",{className:"mt-1",children:[(0,a.jsxs)(h.R.Button,{className:"relative w-full cursor-default rounded-md border border-gray-300 bg-white py-2 pl-3 pr-10 text-left shadow-sm focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500 sm:text-sm",children:[(0,a.jsxs)("span",{className:"inline-flex w-full justify-between truncate",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"truncate",children:null==l?void 0:l.name}),(0,a.jsx)("span",{className:"ml-4 truncate font-semibold capitalize text-gray-800",children:null==l?void 0:l.roles[s]})]}),(0,a.jsxs)("div",{className:"hidden sm:block",children:[(0,a.jsxs)("span",{className:"truncate text-gray-500",children:[(null==l?void 0:l.modelCount)||"No"," Models"]}),(0,a.jsxs)("span",{className:"ml-4 truncate text-gray-500",children:[(null==l?void 0:l.conceptCount)||"No"," Concepts"]})]})]}),(0,a.jsx)("span",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2",children:(0,a.jsx)(g.Z,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),(0,a.jsx)(f.u,{show:t,as:x.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,a.jsx)(h.R.Options,{className:"absolute z-10 mt-1 max-h-60 w-5/6 sm:w-3/5 overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",children:n.map(function(e){return(0,a.jsx)(h.R.Option,{className:function(e){return v(e.active?"bg-indigo-600 text-white":"text-gray-900","relative cursor-default select-none py-2 pl-10 pr-3")},value:e,children:function(t){var n=t.selected,r=t.active;return(0,a.jsxs)(a.Fragment,{children:[n?(0,a.jsx)("span",{className:v(r?"text-white":"text-indigo-600","absolute inset-y-0 left-0 flex items-center pl-4"),children:(0,a.jsx)(p.Z,{className:"h-5 w-5","aria-hidden":"true"})}):null,(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:v(n?"font-semibold":"font-normal","truncate"),children:e.name}),(0,a.jsx)("span",{className:v(r?"text-indigo-200":"text-gray-800","ml-4 truncate font-semibold capitalize"),children:e.roles[s]})]}),(0,a.jsxs)("div",{className:"hidden sm:block",children:[(0,a.jsxs)("span",{className:v(r?"text-indigo-200":"text-gray-500","truncate"),children:[e.modelCount||"No"," Models"]}),(0,a.jsxs)("span",{className:v(r?"text-indigo-200":"text-gray-500","ml-4 truncate capitalize"),children:[e.conceptCount||"No"," Concepts"]})]})]})]})}},e.id)})})})]})]})}})})}var N=!0;t.default=function(e){var t=e.team,s=e.userId,i=e.teamUsers,h=e.userTeams,f=(0,x.useState)(null),g=f[0],p=f[1],b=(0,x.useState)(t),v=b[0],N=b[1],C=(0,x.useState)(h),k=C[0],_=C[1],T=(0,x.useState)(null),Z=T[0],S=T[1],E=(0,x.useState)(v.name),z=E[0],P=E[1],R=(0,x.useState)(0),F=R[0],A=R[1],I=(0,x.useState)(0),M=I[0],O=I[1],U=(0,x.useState)(!1),D=U[0],B=U[1];function H(e){return J.apply(this,arguments)}function J(){return(J=(0,n.Z)(function(e){var t,n,a;return(0,r.__generator)(this,function(t){switch(t.label){case 0:if(p(""),e===v.id||!e)return p("Please enter a different valid team"),[2];return[4,fetch("/api/"+["users",s].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentTeam:e})})];case 1:if(!(n=t.sent()).ok)return[3,3];return[4,n.json()];case 2:return t.sent(),j().reload(),[3,6];case 3:return t.trys.push([3,5,,6]),[4,n.json()];case 4:return p(t.sent().message||"Something went wrong, please try again."),[3,6];case 5:return t.sent(),p(n.statusText+", please try again."),[3,6];case 6:return[2]}})})).apply(this,arguments)}function L(){return V.apply(this,arguments)}function V(){return(V=(0,n.Z)(function(){var e,t,s,n,a;return(0,r.__generator)(this,function(e){switch(e.label){case 0:return p(""),B(!0),[4,fetch("/api/"+["teams",v.id].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:z,modelCredits:F,conceptCredits:M})})];case 1:if(!(s=e.sent()).ok)return[3,3];return[4,s.json()];case 2:return N(n=e.sent()),A(0),O(0),P(n.name),_(function(e){return e[e.findIndex(function(e){return e.id===n.id})]=n,e}),B(!1),[3,7];case 3:return e.trys.push([3,5,,6]),[4,s.json()];case 4:return p(e.sent().message||"Something went wrong, please try again."),[3,6];case 5:return e.sent(),p(s.statusText+", please try again."),[3,6];case 6:B(!1),e.label=7;case 7:return[2]}})})).apply(this,arguments)}return(0,a.jsxs)(u.Z,{page:"Dashboard",crumbs:[{title:"Team",href:"/app/team"}],children:[(0,a.jsx)(m.Z,{title:g,type:"error"}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between rounded-lg bg-white p-4 py-6 shadow gap-4",children:[(0,a.jsx)(w,{team:v,userId:s,userTeams:k,changeTeam:H}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"team_name",className:"block text-sm font-medium text-gray-700",children:"Rename Team"}),(0,a.jsx)("div",{className:"mt-2 max-w-xl text-xs text-gray-500",children:(0,a.jsxs)("p",{children:["Enter a new team name for ",v.name,"."]})}),(0,a.jsxs)("div",{className:"mt-1 flex rounded-md shadow-sm",children:[(0,a.jsx)("div",{className:"relative flex flex-grow items-stretch focus-within:z-10",children:(0,a.jsx)("input",{type:"text",id:"team_name",value:z,onChange:function(e){return P(e.target.value)},className:"block w-full rounded-none rounded-l-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm",placeholder:"Team Name"})}),(0,a.jsx)("button",{type:"button",onClick:L,disabled:z===v.name||D,className:"relative -ml-px inline-flex items-center space-x-2 rounded-r-md border border-gray-300 bg-gray-50 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500 disabled:opacity-25",children:"Update"})]})]})]}),(0,y.j5)(s)&&(0,a.jsxs)("div",{className:"mt-6 flex flex-wrap items-center justify-between rounded-lg bg-white p-4 shadow gap-4",children:[(0,a.jsx)("div",{className:"w-full",children:(0,a.jsx)("h3",{className:"text-lg font-medium leading-6 text-gray-900 m-0",children:"Super Admin Tools"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"team_id",className:"block text-sm font-medium text-gray-700",children:"Open Team"}),(0,a.jsx)("div",{className:"mt-2 max-w-xl text-xs text-gray-500",children:(0,a.jsx)("p",{children:"Enter customer email or Team ID to switch to their team."})}),(0,a.jsxs)("div",{className:"mt-1 flex rounded-md shadow-sm",children:[(0,a.jsx)("div",{className:"relative flex flex-grow items-stretch focus-within:z-10",children:(0,a.jsx)("input",{type:"text",id:"team_id",value:Z,onChange:function(e){return S(e.target.value)},className:"block w-full rounded-none rounded-l-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm",placeholder:"Email/Team ID"})}),(0,a.jsx)("button",{type:"button",onClick:function(){H(Z)},className:"relative -ml-px inline-flex items-center space-x-2 rounded-r-md border border-gray-300 bg-gray-50 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500",children:"Go"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"model_credits",className:"block text-sm font-medium text-gray-700",children:"Adjust Model Credits"}),(0,a.jsx)("div",{className:"mt-2 max-w-xl text-xs text-gray-500",children:(0,a.jsx)("p",{children:"Manually adjust team's credit balance."})}),(0,a.jsxs)("div",{className:"mt-1 flex rounded-md shadow-sm",children:[(0,a.jsxs)("div",{className:"relative flex flex-grow items-stretch focus-within:z-10",children:[(0,a.jsxs)("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3 text-gray-400",children:[v.modelCredits," ",(0,a.jsx)(d.Z,{className:"h-5 w-5","aria-hidden":"true"})]}),(0,a.jsx)("input",{type:"number",id:"model_credits",value:F,onChange:function(e){return A(e.target.value)},className:"block w-full rounded-none rounded-l-md border-gray-300 pl-16 focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm",placeholder:"How many?"})]}),(0,a.jsx)("button",{type:"button",onClick:L,disabled:0==F||D,className:"relative -ml-px inline-flex items-center space-x-2 rounded-r-md border border-gray-300 bg-gray-50 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500 disabled:opacity-25",children:"Adjust"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"concept_credits",className:"block text-sm font-medium text-gray-700",children:"Adjust Concept Credits"}),(0,a.jsx)("div",{className:"mt-2 max-w-xl text-xs text-gray-500",children:(0,a.jsx)("p",{children:"Manually adjust team's credit balance."})}),(0,a.jsxs)("div",{className:"mt-1 flex rounded-md shadow-sm",children:[(0,a.jsxs)("div",{className:"relative flex flex-grow items-stretch focus-within:z-10",children:[(0,a.jsxs)("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3 text-gray-400",children:[v.conceptCredits," ",(0,a.jsx)(d.Z,{className:"h-5 w-5","aria-hidden":"true"})]}
1),(0,a.jsx)("input",{type:"number",id:"concept_credits",value:M,onChange:function(e){return O(e.target.value)},className:"block w-full rounded-none rounded-l-md border-gray-300 pl-16 focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm",placeholder:"How many?"})]}),(0,a.jsx)("button",{type:"button",onClick:L,disabled:0===M||D,className:"relative -ml-px inline-flex items-center space-x-2 rounded-r-md border border-gray-300 bg-gray-50 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500 disabled:opacity-25",children:"Adjust"})]})]})]}),(0,a.jsxs)("div",{className:"mt-6 overflow-hidden bg-white shadow sm:rounded-md",children:[(0,a.jsx)("div",{className:"border-b border-gray-200 bg-white px-4 py-5 sm:px-6",children:(0,a.jsxs)("div",{className:"-ml-4 -mt-4 flex flex-wrap items-center justify-between sm:flex-nowrap",children:[(0,a.jsxs)("div",{className:"ml-4 mt-4",children:[(0,a.jsxs)("h3",{className:"text-lg font-medium leading-6 text-gray-900",children:[v.name,": Members"]}),(0,a.jsx)("p",{className:"mt-1 mb-0 text-sm text-gray-500",children:"View and manage the members of this team. (coming soon)"})]}),(0,a.jsx)("div",{className:"ml-4 mt-4 flex-shrink-0",children:(0,a.jsxs)("button",{type:"button",disabled:!0,className:"relative inline-flex items-center rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-25",children:[(0,a.jsx)(o.Z,{className:"mr-2 h-5 w-5","aria-hidden":"true"}),"Add member"]})})]})}),(0,a.jsx)("ul",{role:"list",className:"divide-y divide-gray-200",children:i.map(function(e){return(0,a.jsx)("li",{children:(0,a.jsx)("div",{className:"flex items-center px-4 py-4 sm:px-6",children:(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-center",children:[(0,a.jsx)("div",{className:"flex-shrink-0",children:(0,a.jsx)(l(),{className:"h-12 w-12 rounded-full",src:e.photoURL,width:48,height:48,alt:"User avatar"})}),(0,a.jsxs)("div",{className:"flex w-full min-w-0 items-center justify-between px-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"mb-1 truncate text-sm font-medium text-indigo-600",children:e.displayName}),(0,a.jsxs)("p",{className:"m-0 flex items-center text-sm text-gray-500",children:[(0,a.jsx)(c.Z,{className:"mr-1.5 h-5 w-5 flex-shrink-0 text-gray-400","aria-hidden":"true"}),(0,a.jsx)("span",{className:"truncate",children:e.email})]})]}),(0,a.jsxs)("div",{className:"items-center text-right",children:[(0,a.jsx)("p",{className:"mb-1 truncate text-sm text-gray-400",children:"Role"}),(0,a.jsx)("p",{className:"text-md m-0 font-medium capitalize text-gray-900",children:e.role})]})]})]})})},e.uid)})})]})]})}}},function(e){e.O(0,[1664,5860,9312,9470,9774,2888,179],function(){return e(e.s=64011)}),_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.