diff --git a/jhub_apps/static/js/index.js b/jhub_apps/static/js/index.js index 4d8dd457..d37b94c8 100644 --- a/jhub_apps/static/js/index.js +++ b/jhub_apps/static/js/index.js @@ -164,4 +164,4 @@ Error generating stack: `+s.message+` Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",i=0;i{const r=tI("button-group",t);return d.jsx("ul",{id:e,className:r,children:b.Children.map(n,(o,s)=>d.jsx("li",{className:"button-group-item",children:o},s))})};var hm={},nI=Ut;Object.defineProperty(hm,"__esModule",{value:!0});var u9=hm.default=void 0,rI=nI(Qt()),oI=d;u9=hm.default=(0,rI.default)((0,oI.jsx)("path",{d:"M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1"}),"HomeRounded");var Am={},sI=Ut;Object.defineProperty(Am,"__esModule",{value:!0});var hl=Am.default=void 0,iI=sI(Qt()),aI=d;hl=Am.default=(0,iI.default)((0,aI.jsx)("path",{d:"M8.12 9.29 12 13.17l3.88-3.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-4.59 4.59c-.39.39-1.02.39-1.41 0L6.7 10.7a.9959.9959 0 0 1 0-1.41c.39-.38 1.03-.39 1.42 0"}),"KeyboardArrowDownRounded");var Pm={},lI=Ut;Object.defineProperty(Pm,"__esModule",{value:!0});var Al=Pm.default=void 0,cI=lI(Qt()),fI=d;Al=Pm.default=(0,cI.default)((0,fI.jsx)("path",{d:"M8.12 14.71 12 10.83l3.88 3.88c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L12.7 8.71a.9959.9959 0 0 0-1.41 0L6.7 13.3c-.39.39-.39 1.02 0 1.41.39.38 1.03.39 1.42 0"}),"KeyboardArrowUpRounded");var mm={},uI=Ut;Object.defineProperty(mm,"__esModule",{value:!0});var d9=mm.default=void 0,dI=uI(Qt()),vI=d;d9=mm.default=(0,dI.default)((0,vI.jsx)("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu");const Wb=re(Za)(({theme:e})=>({fontWeight:700,paddingLeft:e.spacing(4),paddingTop:e.spacing(1),paddingBottom:e.spacing(1)})),pp=re(p2)(({theme:e})=>({paddingLeft:e.spacing(4)})),pI=({...e})=>{const t=Wo(),[n,r]=he.useState(null),o=!!n,s=YT(t.breakpoints.down("sm")),{window:i}=e,[a,l]=b.useState(!s),[c]=_e(pa),[,f]=_e(ks),[u,v]=b.useState([]),[y,p]=b.useState([]),[A,x]=b.useState([]),{isLoading:P,error:h,data:m}=Qn({queryKey:["app-state"],queryFn:()=>Rt.get("/server/").then(E=>E.data).then(E=>E),enabled:!!c}),{isLoading:g,error:H,data:j}=Qn({queryKey:["service-data"],queryFn:()=>Rt.get("/services/").then(E=>E.data).then(E=>E),enabled:!!c}),z=()=>{l(E=>!E)};b.useEffect(()=>{!P&&m&&c&&p(()=>G0(m,c.name))},[P,m,c]),b.useEffect(()=>{!g&&j&&c&&(v(()=>Y0(j,c.name).filter(E=>!zP.includes(E.name))),x(()=>q0(j,c.name)))},[g,j,c]),b.useEffect(()=>{f(H?H.message:h?h.message:void 0)},[H,h,f]),b.useEffect(()=>{l(!s)},[s]);const O=d.jsxs(Wt,{children:[d.jsx(Is,{disablePadding:!0,sx:{mt:10,mb:2},children:d.jsxs(p2,{sx:{pl:3},onClick:()=>ur(`${Gn}`),children:[d.jsx(Zv,{children:d.jsx(u9,{})}),d.jsx(Za,{primary:"Home"})]})}),d.jsx(Vl,{}),d.jsxs(d.Fragment,{children:[d.jsxs(mh,{children:[d.jsx(Is,{disablePadding:!0,children:d.jsx(Wb,{primary:"Pinned",disableTypography:!0})}),y.map((E,S)=>d.jsx(Is,{disablePadding:!0,children:d.jsxs(pp,{onClick:()=>ur(E.url),children:[d.jsx(Za,{primary:E.name}),d.jsx(Zv,{sx:{minWidth:"32px"},children:d.jsx(yu,{fontSize:"small"})})]})},S)),A.map((E,S)=>d.jsx(Is,{disablePadding:!0,children:d.jsxs(pp,{onClick:()=>ur(E.url),children:[d.jsx(Za,{primary:E.name}),d.jsx(Zv,{sx:{minWidth:"32px"},children:d.jsx(yu,{fontSize:"small"})})]})},S))]}),d.jsx(Vl,{})]}),d.jsxs(mh,{children:[d.jsx(Is,{disablePadding:!0,children:d.jsx(Wb,{primary:"Services",disableTypography:!0,sx:{pt:2}})}),u.map((E,S)=>d.jsx(Is,{disablePadding:!0,children:d.jsx(pp,{onClick:()=>ur(E.url),children:d.jsx(Za,{primary:E.name})})},S))]})]});return d.jsxs(Wt,{sx:{flexGrow:1},children:[d.jsx(Yj,{position:"fixed",sx:{zIndex:E=>E.zIndex.drawer+1,backgroundColor:E=>E.palette.common.black},children:d.jsxs(xE,{children:[d.jsx(Kw,{color:"inherit","aria-label":"open drawer",edge:"start",onClick:z,sx:{mr:2,display:{sm:"none"}},children:d.jsx(d9,{})}),d.jsx(Wt,{component:"div",sx:{flexGrow:1,display:{xs:"none",sm:"block"}},children:d.jsx("a",{href:Gn,children:d.jsx("img",{src:MJ(),alt:"logo",height:"28"})})}),d.jsxs(Wt,{sx:{display:{xs:"none",sm:"block"}},children:[d.jsxs(pt,{id:"profile-menu-btn","aria-controls":o?"profile-menu-list":void 0,"aria-haspopup":"true","aria-expanded":o?"true":void 0,onClick:E=>r(E.currentTarget),endIcon:o?d.jsx(Al,{}):d.jsx(hl,{}),sx:{color:t.palette.common.white,fontWeight:700},children:[c==null?void 0:c.name," ",c!=null&&c.admin?"(admin)":""]}),d.jsxs(bi,{id:"profile-menu-list",anchorEl:n,open:o,onClose:()=>r(null),MenuListProps:{"aria-labelledby":"profile-menu-btn"},sx:{marginTop:"20px"},children:[d.jsx(gi,{onClick:()=>ur(`${Gn}/token`),sx:{width:"180px"},children:"Tokens"}),(c==null?void 0:c.admin)&&d.jsx(gi,{onClick:()=>ur(`${Gn}/admin`),children:"Admin"}),d.jsx(gi,{onClick:()=>ur(`${Gn}/logout`),children:"Logout"})]})]})]})}),d.jsx("nav",{children:d.jsx(WC,{container:i!==void 0?()=>i().document.body:void 0,variant:"persistent",open:a,onClose:z,ModalProps:{keepMounted:!0},sx:{"& .MuiDrawer-paper":{boxSizing:"border-box",width:240}},children:O})})]})},hI=({severity:e="error",message:t,onClose:n})=>d.jsx("div",{className:"alert-wrapper",children:t?d.jsx(Ej,{id:"alert-notification",severity:e,onClose:n,children:t}):d.jsx(d.Fragment,{})});var ym={},AI=Ut;Object.defineProperty(ym,"__esModule",{value:!0});var v9=ym.default=void 0,PI=AI(Qt()),mI=d;v9=ym.default=(0,PI.default)((0,mI.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-1 16H6c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h12c.55 0 1 .45 1 1v12c0 .55-.45 1-1 1m-4.44-6.19-2.35 3.02-1.56-1.88c-.2-.25-.58-.24-.78.01l-1.74 2.23c-.26.33-.02.81.39.81h8.98c.41 0 .65-.47.4-.8l-2.55-3.39c-.19-.26-.59-.26-.79 0"}),"CropOriginalRounded");var bm={},yI=Ut;Object.defineProperty(bm,"__esModule",{value:!0});var p9=bm.default=void 0,bI=yI(Qt()),gI=d;p9=bm.default=(0,bI.default)((0,gI.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2zM18 4h-2.5l-.71-.71c-.18-.18-.44-.29-.7-.29H9.91c-.26 0-.52.11-.7.29L8.5 4H6c-.55 0-1 .45-1 1s.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1"}),"DeleteRounded");var gm={},xI=Ut;Object.defineProperty(gm,"__esModule",{value:!0});var h9=gm.default=void 0,wI=xI(Qt()),HI=d;h9=gm.default=(0,wI.default)((0,HI.jsx)("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5zM8 15.01l1.41 1.41L11 14.84V19h2v-4.16l1.59 1.59L16 15.01 12.01 11z"}),"UploadFile");var xm={},zI=Ut;Object.defineProperty(xm,"__esModule",{value:!0});var A9=xm.default=void 0,jI=zI(Qt()),OI=d;A9=xm.default=(0,jI.default)((0,OI.jsx)("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility");const DI=({id:e,name:t,currentImage:n,setCurrentImage:r,currentFile:o,setCurrentFile:s,...i})=>{const[a,l]=b.useState(!1),[c,f]=b.useState(!1),u=b.useRef(null),v=g=>{g.preventDefault(),l(!0)},y=g=>{g.preventDefault(),l(!0)},p=g=>{g.preventDefault(),l(!1)},A=g=>{g.preventDefault(),l(!1);const H=g.dataTransfer.files[0];s(H)},x=g=>{if(!g.target.files)return;const H=g.target.files[0];s(H)},P=g=>{g.preventDefault(),f(!0)},h=g=>{g.preventDefault();const H=u.current;H&&H.click()},m=g=>{g.preventDefault();const H=u.current;H&&(H.value="",s(void 0),r(void 0))};return b.useEffect(()=>{const g=u.current;if(g&&g.files&&g.files.length>0){const H=g.files[0];s(H)}},[u,s]),d.jsxs("div",{id:`thumbnail-${e}`,className:"thumbnail",children:[d.jsxs("div",{id:`thumbnail-body-${e}`,className:`thumbnail-body ${a?"dragging":""} ${o||n?"selected":""}`,onDragOver:v,onDragEnter:y,onDragLeave:p,onDrop:A,children:[o||n?d.jsx("div",{className:"thumbnail-img-container",children:d.jsx("img",{src:o?URL.createObjectURL(o):n,alt:"App thumnail",className:"thumbnail-img"})}):d.jsx("div",{className:"thumbnail-icon-container",tabIndex:0,onClick:h,children:d.jsx(v9,{className:"thumbnail-icon"})}),d.jsx("input",{ref:u,id:e,name:t,type:"file",accept:"image/*",onChange:x,style:{display:"none"},...i})]}),d.jsxs("div",{className:"thumbnail-actions",children:[d.jsx(pt,{id:"view-thumbnail-btn",variant:"contained",color:"secondary",size:"small",startIcon:d.jsx(A9,{}),onClick:P,disabled:!o&&!n,children:"View Thumbnail"}),d.jsx(pt,{id:"upload-thumbnail-btn",variant:"contained",color:"secondary",size:"small",startIcon:d.jsx(h9,{}),onClick:h,children:"Upload Thumbnail"}),d.jsx(pt,{id:"remove-thumbnail-btn",variant:"contained",color:"secondary",size:"small",startIcon:d.jsx(p9,{}),onClick:m,disabled:!o&&!n,children:"Remove Thumbnail"})]}),d.jsx(xf,{onClose:()=>f(!1),open:c,children:d.jsx("img",{src:o?URL.createObjectURL(o):n,alt:"App thumnail"})})]})};var wm={},CI=Ut;Object.defineProperty(wm,"__esModule",{value:!0});var fv=wm.default=void 0,TI=CI(Qt()),SI=d;fv=wm.default=(0,TI.default)((0,SI.jsx)("path",{d:"M19 11H7.83l4.88-4.88c.39-.39.39-1.03 0-1.42a.9959.9959 0 0 0-1.41 0l-6.59 6.59c-.39.39-.39 1.02 0 1.41l6.59 6.59c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L7.83 13H19c.55 0 1-.45 1-1s-.45-1-1-1"}),"ArrowBackRounded");const jt=re("div")(({theme:e})=>({padding:e.spacing(0)})),EI=()=>d.jsx(Wt,{className:"container",children:d.jsxs(vc,{children:[d.jsx(jt,{children:d.jsx("div",{className:"form-breadcrumb",children:d.jsx(pt,{id:"back-btn",type:"button",variant:"text",color:"primary",startIcon:d.jsx(fv,{}),onClick:()=>ur(Gn),children:"Back"})})}),d.jsxs(jt,{children:[d.jsx("h1",{className:"form-heading",children:"Create a new app"}),d.jsxs("p",{className:"form-paragraph",children:["Begin your project by entering the details below. For more information about creating an app,"," ",d.jsx("a",{href:"https://jhub-apps.nebari.dev/docs/reference/create-app-form",target:"_blank",rel:"noopener noreferrer",className:"form-paragraph-link",children:"visit our docs"}),"."]})]}),d.jsx(jt,{children:d.jsx(c9,{})})]})}),RI=()=>{const[e]=q2(),t=e.get("id");return d.jsx(Wt,{className:"container",children:d.jsxs(vc,{children:[d.jsx(jt,{children:d.jsx("div",{className:"form-breadcrumb",children:d.jsx(pt,{id:"back-btn",type:"button",variant:"text",color:"primary",startIcon:d.jsx(fv,{}),onClick:()=>ur(Gn),children:"Back"})})}),d.jsxs(jt,{children:[d.jsx("h1",{className:"form-heading",children:"Edit app"}),d.jsxs("p",{className:"form-paragraph",children:["Edit your app details here. For more information on editing your app,"," ",d.jsx("a",{href:"https://jhub-apps.nebari.dev/docs/reference/create-app-form",target:"_blank",rel:"noopener noreferrer",className:"form-paragraph-link",children:"visit our docs"}),"."]})]}),d.jsx(jt,{children:d.jsx(d.Fragment,{children:t?d.jsx(c9,{id:t}):d.jsx(d.Fragment,{children:"No app found."})})})]})})};var Hm={},kI=Ut;Object.defineProperty(Hm,"__esModule",{value:!0});var P9=Hm.default=void 0,MI=kI(Qt()),LI=d;P9=Hm.default=(0,MI.default)((0,LI.jsx)("path",{d:"M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1"}),"AddRounded");var zm={},XI=Ut;Object.defineProperty(zm,"__esModule",{value:!0});var m9=zm.default=void 0,NI=XI(Qt()),VI=d;m9=zm.default=(0,NI.default)((0,VI.jsx)("path",{d:"M4.25 5.61C6.57 8.59 10 13 10 13v5c0 1.1.9 2 2 2s2-.9 2-2v-5s3.43-4.41 5.75-7.39c.51-.66.04-1.61-.8-1.61H5.04c-.83 0-1.3.95-.79 1.61"}),"FilterAltRounded");var jm={},BI=Ut;Object.defineProperty(jm,"__esModule",{value:!0});var y9=jm.default=void 0,WI=BI(Qt()),JI=d;y9=jm.default=(0,WI.default)((0,JI.jsx)("path",{d:"M4 18h4c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1M3 7c0 .55.45 1 1 1h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1m1 6h10c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1"}),"SortRounded");const Jb=re(pt)(({theme:e})=>({color:e.palette.common.black,borderColor:e.palette.common.black,"&:hover":{color:e.palette.common.black,borderColor:e.palette.common.black},marginRight:"16px"})),II=({data:e,currentUser:t,setApps:n})=>{const[r]=_e(B0),[o,s]=he.useState(null),[i,a]=he.useState(null),[l,c]=he.useState(null),f=!!o,u=!!i,v=!!l,[y,p]=_e(W0),[A,x]=_e(J0),[P,h]=_e(I0),[m]=b.useState(!1),{data:g,isLoading:H}=Qn({queryKey:["app-frameworks"],queryFn:()=>Rt.get("/frameworks/").then(X=>X.data)}),j=X=>{const V=X.target.value;y.includes(V)?p(I=>I.filter(Y=>Y!==V)):p(I=>[...I,V])},z=X=>{x(X)},O=X=>{h(X),n($h(e,t,r,A,y,X)),c(null)},E=()=>{s(null),n($h(e,t,r,A,y,P))},S=()=>{p([]),x("Any")};return d.jsxs(Lr,{container:!0,spacing:2,paddingBottom:"32px",children:[d.jsx(Lr,{item:!0,xs:12,md:4,children:d.jsxs(jt,{children:[d.jsx(Jb,{id:"filters-btn",variant:"outlined",color:"secondary",onClick:X=>s(X.currentTarget),startIcon:d.jsx(m9,{}),endIcon:f?d.jsx(Al,{}):d.jsx(hl,{}),disabled:H||!1,children:"Filters"}),d.jsx(bi,{id:"filters-list",anchorEl:o,open:f,onClose:()=>s(null),MenuListProps:{"aria-labelledby":"filters-btn"},children:d.jsxs(Wt,{component:"form",name:"filters-form",sx:{width:"450px",px:"16px",py:"8px"},children:[d.jsx(wf,{id:"frameworks-label",sx:{py:"16px",fontSize:"14px",fontWeight:600},children:"Frameworks"}),d.jsx(Wt,{children:g==null?void 0:g.map(X=>d.jsx(cl,{control:d.jsx(JD,{value:X.display_name}),label:X.display_name,sx:{width:"120px"},onClick:j,checked:y.includes(X.display_name)},X.name))}),d.jsx(Vl,{sx:{mt:"24px",mb:"16px"}}),d.jsx(wf,{id:"ownership-label",sx:{pb:"16px",fontSize:"14px",fontWeight:600},children:"Ownership"}),d.jsx(Wt,{sx:{pb:"24px"},children:d.jsx(bh,{"aria-labelledby":"ownership-label",defaultValue:"any",name:"ownership-group",row:!0,children:TE.map(X=>d.jsx(cl,{control:d.jsx(yh,{value:X}),label:X,onClick:()=>z(X),checked:A===X},X))})}),d.jsxs(Sf,{children:[d.jsx(pt,{id:"clear-filters-btn",variant:"text",color:"secondary",size:"small",onClick:S,children:"Clear"}),d.jsx(pt,{id:"apply-filters-btn",variant:"contained",size:"small",onClick:E,children:"Apply"})]})]})}),d.jsx(Jb,{id:"bulk-actions-btn",variant:"outlined",color:"secondary",onClick:X=>a(X.currentTarget),endIcon:u?d.jsx(Al,{}):d.jsx(hl,{}),disabled:!m,children:"Bulk Actions"}),d.jsx(bi,{id:"bulk-actions-list",anchorEl:i,open:u,onClose:()=>a(null),MenuListProps:{"aria-labelledby":"bulk-actions-btn"},children:d.jsx(Wt,{component:"form",name:"bulk-actions-form",sx:{px:"16px",py:"8px"}})})]})}),d.jsx(Lr,{container:!0,item:!0,xs:8,md:8,direction:"row",sx:{display:"flex",justifyContent:"flex-end",flexWrap:"nowrap"},children:d.jsx(jt,{children:d.jsxs(Wt,{sx:{display:"flex",flexDirection:"row"},children:[d.jsx(y9,{sx:{pr:"8px"}}),d.jsx(wf,{id:"sort-by-label",sx:{fontSize:"14px",fontWeight:500,pr:"8px",color:"common.black"},children:"Sort by:"}),d.jsx(pt,{id:"sort-by-btn",variant:"text",color:"secondary",onClick:X=>c(X.currentTarget),sx:{position:"relative",bottom:"8px",fontWeight:600,width:"180px",color:"common.black"},endIcon:v?d.jsx(Al,{}):d.jsx(hl,{}),children:P}),d.jsx(bi,{id:"sort-by-list",anchorEl:l,open:v,onClose:()=>c(null),MenuListProps:{"aria-labelledby":"sort-by-btn"},children:d.jsx(Wt,{component:"form",name:"sort-by-form",sx:{px:"16px"},children:d.jsx(bh,{defaultValue:"any",name:"sort-by-group","aria-describedby":"sort-by-label",children:SE.map(X=>d.jsx(cl,{control:d.jsx(yh,{value:X}),label:X,onClick:()=>O(X),checked:P===X},X))})})})]})})})]})},FI=({apps:e})=>d.jsx(d.Fragment,{children:e.map(t=>d.jsx(_h,{id:t.id,title:t.name,description:t.description,thumbnail:t.thumbnail,framework:t.framework,url:t.url,ready:t.ready,serverStatus:t.status,username:t.username,isPublic:t.public,isShared:t.shared},`app-${t.id}`))}),YI=()=>{const[e]=_e(pa),[,t]=_e(ks),[,n]=_e(B0),[r]=_e(W0),[o]=_e(J0),[s]=_e(I0),[i,a]=b.useState([]),{isLoading:l,error:c,data:f}=Qn({queryKey:["app-state"],queryFn:()=>Rt.get("/server/").then(v=>v.data).then(v=>v),enabled:!!e}),u=v=>{const y=v.target;n(y.value),f&&e&&a($h(f,e,y.value,o,r,s))};return b.useEffect(()=>{if(!l&&f){const v=Z0(f,"all",(e==null?void 0:e.name)??"").map(y=>({...y,status:lm(y)})).sort((y,p)=>y.last_activity>p.last_activity?-1:1);a(v)}},[l,f,e]),b.useEffect(()=>{t(c?c.message:void 0)},[c,t]),d.jsx(Wt,{children:d.jsxs(vc,{children:[d.jsx(jt,{children:d.jsxs(Lr,{container:!0,spacing:2,children:[d.jsx(Lr,{item:!0,xs:12,md:4,children:d.jsx(jt,{children:d.jsx("h2",{children:"Apps"})})}),d.jsxs(Lr,{container:!0,item:!0,xs:8,md:8,direction:"row",sx:{display:"flex",justifyContent:"flex-end",flexWrap:"nowrap"},children:[d.jsx(jt,{children:d.jsx(Qs,{id:"search",size:"small",placeholder:"Search...","aria-label":"Search for an app",onChange:u,sx:{width:{sm:"200px",md:"300px",lg:"600px"},pr:"16px"}})}),d.jsx(jt,{children:d.jsx(pt,{id:"create-app",variant:"contained",color:"primary",startIcon:d.jsx(P9,{}),onClick:()=>{window.location.href=`${HP}/create-app`},children:"Create App"})})]})]})}),d.jsx(jt,{sx:{pt:"16px",pb:"24px"},children:d.jsx(Vl,{})}),d.jsx(jt,{children:f&&e?d.jsx(II,{data:f,currentUser:e,setApps:a}):d.jsx(d.Fragment,{})}),d.jsx(jt,{children:d.jsx(Wt,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"16px",justifyContent:"flex-start",paddingBottom:"48px"},children:l?d.jsx("div",{className:"font-bold",children:"Loading..."}):i.length>0?d.jsx(FI,{apps:i}):d.jsx("div",{children:"No apps available"})})})]})})},qI=({services:e,apps:t})=>d.jsxs(d.Fragment,{children:[t.map(n=>d.jsx(_h,{id:n.id,title:n.name,description:n.description,thumbnail:n.thumbnail,framework:n.framework,url:n.url,ready:n.ready,serverStatus:n.status,username:n.username,isAppCard:!1},n.id)),e.map(n=>d.jsx(_h,{id:n.id,title:n.name,description:n.description,thumbnail:n.thumbnail,framework:n.framework,url:n.url,serverStatus:n.status,username:n.username,isAppCard:!1},n.id))]}),ZI=()=>{const[e]=_e(pa),[,t]=_e(ks),[n,r]=b.useState([]),[o,s]=b.useState([]),{isLoading:i,error:a,data:l}=Qn({queryKey:["service-data"],queryFn:()=>Rt.get("/services/").then(v=>v.data).then(v=>v),enabled:!!e}),{isLoading:c,error:f,data:u}=Qn({queryKey:["app-state"],queryFn:()=>Rt.get("/server/").then(v=>v.data).then(v=>v),enabled:!!e});return b.useEffect(()=>{!i&&l&&e&&r(()=>q0(l,e.name))},[i,l,e]),b.useEffect(()=>{!c&&u&&e&&s(()=>G0(u,e.name))},[c,u,e]),b.useEffect(()=>{t(a?a.message:f?f.message:void 0)},[a,f,t]),d.jsx(Wt,{children:d.jsxs(vc,{children:[d.jsx(jt,{children:d.jsx(Lr,{container:!0,spacing:2,children:d.jsx(Lr,{item:!0,xs:12,md:4,children:d.jsx(jt,{children:d.jsx("h2",{children:"Services"})})})})}),d.jsx(jt,{sx:{pt:"16px",pb:"24px"},children:d.jsx(Vl,{})}),d.jsx(jt,{children:d.jsx(Wt,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"16px",justifyContent:"flex-start",paddingBottom:"48px"},children:i||c?d.jsx("div",{className:"font-bold",children:"Loading..."}):n.length>0||o.length>0?d.jsx(qI,{services:n,apps:o}):d.jsx("div",{children:"No services available"})})})]})})},Ib=()=>d.jsxs(Wt,{sx:{flexGrow:1},className:"container",children:[d.jsx(Lr,{container:!0,spacing:2,paddingBottom:"32px",children:d.jsx(Lr,{item:!0,xs:12,md:2,children:d.jsx(jt,{children:d.jsx("h1",{children:"Home"})})})}),d.jsx(ZI,{}),d.jsx(YI,{})]}),GI=()=>{const[e]=q2(),t=RP(),n=Md(),[r,o]=b.useState(!1),[s]=_e(pa),[i,a]=_e(X0),[l]=_e(V0),[c]=_e(N0),[,f]=_e(ks),[u,v]=he.useState((i==null?void 0:i.profile)||""),y=e.get("id"),{data:p,isLoading:A,error:x}=Qn({queryKey:["server-types"],queryFn:()=>Rt.get("/spawner-profiles/").then(z=>z.data).then(z=>z),enabled:!!s}),P=z=>{v(z),i&&a({...i,profile:z})},h=z=>{z.preventDefault();const O={servername:(i==null?void 0:i.display_name)||"",user_options:{jhub_app:!0,name:(i==null?void 0:i.display_name)||"",display_name:(i==null?void 0:i.display_name)||"",description:(i==null?void 0:i.description)||"",framework:(i==null?void 0:i.framework)||"",thumbnail:(i==null?void 0:i.thumbnail)||"",filepath:(i==null?void 0:i.filepath)||"",conda_env:(i==null?void 0:i.conda_env)||"",env:(i==null?void 0:i.env)||"",custom_command:(i==null?void 0:i.custom_command)||"",profile:(i==null?void 0:i.profile)||"",public:(i==null?void 0:i.is_public)||!1}};o(!0),y?j(O,{onSuccess:async()=>{n.invalidateQueries({queryKey:["app-state"]})},onError:async E=>{o(!1),f(E.message)}}):H(O,{onSuccess:async E=>{const S=s==null?void 0:s.name;if(S&&(E==null?void 0:E.length)>1){const X=E[1];window.location.assign(`/hub/spawn-pending/${S}/${X}`)}},onError:async E=>{o(!1),f(E.message)}})},m=async({servername:z,user_options:O})=>{const E={accept:"application/json","Content-Type":"multipart/form-data"},S=new FormData;return S.append("data",JSON.stringify({servername:z,user_options:O})),l&&S.append("thumbnail",l),(await Rt.post("/server",S,{headers:E})).data},g=async({servername:z,user_options:O})=>{const E={accept:"application/json","Content-Type":"multipart/form-data"},S=new FormData;return S.append("data",JSON.stringify({servername:z,user_options:O})),l?S.append("thumbnail",l):c&&S.append("thumbnail_data_url",c),(await Rt.put(`/server/${z}`,S,{headers:E})).data},{mutate:H}=Ki({mutationFn:m,retry:1}),{mutate:j}=Ki({mutationFn:g,retry:1});return d.jsxs("div",{className:"container",children:[d.jsx("div",{className:"form-breadcrumb",children:d.jsx(pt,{id:"back-btn",type:"button",variant:"text",color:"primary",startIcon:d.jsx(fv,{}),onClick:()=>t(y?`/edit-app?id=${y}`:"/create-app"),children:"Back"})}),d.jsxs("div",{className:"row",children:[d.jsx("h1",{className:"form-heading",children:"Server Type"}),d.jsxs("p",{className:"form-paragraph",children:["Please select the appropriate server for your app. For more information on server types,"," ",d.jsx("span",{children:d.jsx("a",{href:"https://www.nebari.dev/docs/welcome",target:"_blank",rel:"noopener noreferrer",className:"form-paragraph-link",children:"visit our docs"})}),"."]})]}),x?d.jsxs("div",{children:["An error occurred: ",x.message]}):A?d.jsx("div",{className:"font-bold center",children:"Loading..."}):p&&p.length>0?d.jsxs("form",{className:"form",onSubmit:h,children:[d.jsx("div",{className:"form-section",children:d.jsx(bh,{children:p==null?void 0:p.map((z,O)=>d.jsx(n2,{className:"server-type-card",onClick:()=>P(z.slug),tabIndex:0,children:d.jsxs(hh,{children:[d.jsx(cl,{value:z.slug,id:z.slug,control:d.jsx(yh,{checked:u?u===z.slug:O===0}),label:z.display_name},z.slug),d.jsx("p",{children:z.description})]})},`server-type-card-${z.slug}`))})}),d.jsx("hr",{}),d.jsxs("div",{className:"button-section",children:[d.jsx("div",{className:"prev",children:d.jsx(pt,{id:"cancel-btn",type:"button",variant:"text",color:"secondary",onClick:()=>ur(Gn),children:"Cancel"})}),d.jsx("div",{className:"next",children:d.jsx(pt,{id:"submit-btn",type:"submit",variant:"contained",color:"primary",disabled:r,children:y?d.jsx(d.Fragment,{children:"Save"}):d.jsx(d.Fragment,{children:"Create App"})})})]})]}):d.jsx("div",{children:"No servers available"})]})},UI=()=>{const[,e]=_e(DJ),[,t]=_e(pa),[n,r]=_e(ks),{error:o,data:s}=Qn({queryKey:["user-state"],queryFn:()=>Rt.get("/user").then(i=>i.data).then(i=>i)});return b.useEffect(()=>{o&&r(o.message)},[o,r]),b.useEffect(()=>{e(RJ())},[e]),b.useEffect(()=>{s&&t({...s})},[s,t]),d.jsxs("div",{children:[d.jsx(pI,{}),d.jsxs(Wt,{component:"main",sx:{flexGrow:1,pt:9,pl:{xs:1,sm:33},pr:1},children:[n?d.jsx(hI,{message:n,onClose:()=>r(void 0)}):d.jsx(d.Fragment,{}),d.jsxs(ek,{children:[d.jsx(Ks,{path:"/home",element:d.jsx(Ib,{})}),d.jsx(Ks,{path:"/create-app",element:d.jsx(EI,{})}),d.jsx(Ks,{path:"/edit-app",element:d.jsx(RI,{})}),d.jsx(Ks,{path:"/server-types",element:d.jsx(GI,{})}),d.jsx(Ks,{path:"/",element:d.jsx(Ib,{})})]})]})]})},QI={50:"#2491FF",100:"#2491FF",200:"#2491FF",300:"#2491FF",400:"#2491FF",500:"#005EA2",600:"#1A4480",700:"#1A4480",800:"#1A4480",900:"#162E51"},Nt={50:"#F7F8F8",100:"#E1E3E4",200:"#C3C7CB",300:"#A6ACB2",400:"#90969C",500:"#5B5F63",600:"#44474A",700:"#3C3C3B",800:"#242628",900:"#1A1C1D"},rf="#BA18DA",Fb="#BA18DA10",Yb="#9B00CE",qs="#18817A",KI="#18817A10",_I="#12635E",$I="#D72D47",eF="#F66A0A",gr="#FFFFFF",qb="#000000",of=nd({typography:{fontFamily:'"Inter", sans-serif'},components:{MuiButtonBase:{defaultProps:{disableRipple:!0,style:{textTransform:"none",textWrap:"nowrap"}}},MuiFormControl:{defaultProps:{fullWidth:!0,sx:{marginBottom:"12px"}}},MuiTextField:{defaultProps:{autoComplete:"off",fullWidth:!0,sx:{marginBottom:"0"}}},MuiSelect:{defaultProps:{fullWidth:!0}}}}),tF=nd(of,{palette:{primary:of.palette.augmentColor({color:{light:Fb,main:rf,dark:Yb,contrastText:gr},name:"primary"}),secondary:of.palette.augmentColor({color:{light:KI,main:qs,dark:_I,contrastText:gr},name:"secondary"}),gray:of.palette.augmentColor({color:{light:Nt[300],main:Nt[500],dark:Nt[700],contrastText:qb,50:Nt[50],100:Nt[100],200:Nt[200],300:Nt[300],400:Nt[400],500:Nt[500],600:Nt[600],700:Nt[700],800:Nt[800],900:Nt[900]},name:"gray"}),warning:{main:eF,contrastText:gr},error:{main:$I,contrastText:gr},info:{main:QI,contrastText:gr},success:{main:qs[500],contrastText:gr},common:{black:qb,white:gr}},components:{MuiButton:{variants:[{props:{variant:"contained",color:"primary"},style:{minWidth:"120px",backgroundColor:`${rf}`,border:`1px solid ${rf}`,fontWeight:700,"&:hover":{backgroundColor:`${Yb}`},"&:disabled":{borderColor:"transparent"}}},{props:{variant:"contained",color:"secondary"},style:{minWidth:"120px",backgroundColor:Nt[100],border:`1px solid ${Nt[100]}`,color:Nt[700],fontWeight:700,"&:hover":{backgroundColor:gr,filter:"brightness(0.96)"},"&:disabled":{borderColor:"transparent"}}},{props:{variant:"outlined",color:"secondary"},style:{minWidth:"120px",backgroundColor:gr,border:`2px solid ${qs}`,color:`${qs}`,fontWeight:700,textTransform:"none","&:hover":{backgroundColor:gr,borderWidth:2,border:`2px solid ${qs}`,color:`${qs}`}}},{props:{variant:"text",color:"primary"},style:{color:`${rf}`,"&:focus":{backgroundColor:`${Fb}`}}},{props:{variant:"text",color:"secondary"},style:{minWidth:"100px",color:Nt[500],"&:focus":{backgroundColor:`${Nt[100]}`}}}]}}}),nF=new URL(window.location.href),rF=new ZE;kh.createRoot(document.getElementById("root")).render(d.jsx(he.StrictMode,{children:d.jsx(ok,{basename:nF.pathname.indexOf("hub")===-1?HP:Gn,children:d.jsx(UB,{children:d.jsxs(x4,{theme:tF,children:[d.jsx(qD,{}),d.jsx(_E,{client:rF,children:d.jsx(UI,{})})]})})})})); +*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",i=0;i{const r=tI("button-group",t);return d.jsx("ul",{id:e,className:r,children:b.Children.map(n,(o,s)=>d.jsx("li",{className:"button-group-item",children:o},s))})};var hm={},nI=Ut;Object.defineProperty(hm,"__esModule",{value:!0});var u9=hm.default=void 0,rI=nI(Qt()),oI=d;u9=hm.default=(0,rI.default)((0,oI.jsx)("path",{d:"M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1"}),"HomeRounded");var Am={},sI=Ut;Object.defineProperty(Am,"__esModule",{value:!0});var hl=Am.default=void 0,iI=sI(Qt()),aI=d;hl=Am.default=(0,iI.default)((0,aI.jsx)("path",{d:"M8.12 9.29 12 13.17l3.88-3.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-4.59 4.59c-.39.39-1.02.39-1.41 0L6.7 10.7a.9959.9959 0 0 1 0-1.41c.39-.38 1.03-.39 1.42 0"}),"KeyboardArrowDownRounded");var Pm={},lI=Ut;Object.defineProperty(Pm,"__esModule",{value:!0});var Al=Pm.default=void 0,cI=lI(Qt()),fI=d;Al=Pm.default=(0,cI.default)((0,fI.jsx)("path",{d:"M8.12 14.71 12 10.83l3.88 3.88c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L12.7 8.71a.9959.9959 0 0 0-1.41 0L6.7 13.3c-.39.39-.39 1.02 0 1.41.39.38 1.03.39 1.42 0"}),"KeyboardArrowUpRounded");var mm={},uI=Ut;Object.defineProperty(mm,"__esModule",{value:!0});var d9=mm.default=void 0,dI=uI(Qt()),vI=d;d9=mm.default=(0,dI.default)((0,vI.jsx)("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu");const Wb=re(Za)(({theme:e})=>({fontWeight:700,paddingLeft:e.spacing(4),paddingTop:e.spacing(1),paddingBottom:e.spacing(1)})),pp=re(p2)(({theme:e})=>({paddingLeft:e.spacing(4)})),pI=({...e})=>{const t=Wo(),[n,r]=he.useState(null),o=!!n,s=YT(t.breakpoints.down("sm")),{window:i}=e,[a,l]=b.useState(!s),[c]=_e(pa),[,f]=_e(ks),[u,v]=b.useState([]),[y,p]=b.useState([]),[A,x]=b.useState([]),{isLoading:P,error:h,data:m}=Qn({queryKey:["app-state"],queryFn:()=>Rt.get("/server/").then(E=>E.data).then(E=>E),enabled:!!c}),{isLoading:g,error:H,data:j}=Qn({queryKey:["service-data"],queryFn:()=>Rt.get("/services/").then(E=>E.data).then(E=>E),enabled:!!c}),z=()=>{l(E=>!E)};b.useEffect(()=>{!P&&m&&c&&p(()=>G0(m,c.name))},[P,m,c]),b.useEffect(()=>{!g&&j&&c&&(v(()=>Y0(j,c.name).filter(E=>!zP.includes(E.name))),x(()=>q0(j,c.name)))},[g,j,c]),b.useEffect(()=>{f(H?H.message:h?h.message:void 0)},[H,h,f]),b.useEffect(()=>{l(!s)},[s]);const O=d.jsxs(Wt,{children:[d.jsx(Is,{disablePadding:!0,sx:{mt:10,mb:2},children:d.jsxs(p2,{sx:{pl:3},onClick:()=>ur(`${Gn}`),children:[d.jsx(Zv,{children:d.jsx(u9,{})}),d.jsx(Za,{primary:"Home"})]})}),d.jsx(Vl,{}),d.jsxs(d.Fragment,{children:[d.jsxs(mh,{children:[d.jsx(Is,{disablePadding:!0,children:d.jsx(Wb,{primary:"Pinned",disableTypography:!0})}),y.map((E,S)=>d.jsx(Is,{disablePadding:!0,children:d.jsxs(pp,{onClick:()=>ur(E.url),children:[d.jsx(Za,{primary:E.name}),d.jsx(Zv,{sx:{minWidth:"32px"},children:d.jsx(yu,{fontSize:"small"})})]})},S)),A.map((E,S)=>d.jsx(Is,{disablePadding:!0,children:d.jsxs(pp,{onClick:()=>ur(E.url),children:[d.jsx(Za,{primary:E.name}),d.jsx(Zv,{sx:{minWidth:"32px"},children:d.jsx(yu,{fontSize:"small"})})]})},S))]}),d.jsx(Vl,{})]}),d.jsxs(mh,{children:[d.jsx(Is,{disablePadding:!0,children:d.jsx(Wb,{primary:"Services",disableTypography:!0,sx:{pt:2}})}),u.map((E,S)=>d.jsx(Is,{disablePadding:!0,children:d.jsx(pp,{onClick:()=>ur(E.url),children:d.jsx(Za,{primary:E.name})})},S))]})]});return d.jsxs(Wt,{sx:{flexGrow:1},children:[d.jsx(Yj,{position:"fixed",sx:{zIndex:E=>E.zIndex.drawer+1,backgroundColor:E=>E.palette.common.black},children:d.jsxs(xE,{children:[d.jsx(Kw,{color:"inherit","aria-label":"open drawer",edge:"start",onClick:z,sx:{mr:2,display:{sm:"none"}},children:d.jsx(d9,{})}),d.jsx(Wt,{component:"div",sx:{flexGrow:1,display:{xs:"none",sm:"block"}},children:d.jsx("a",{href:Gn,children:d.jsx("img",{src:MJ(),alt:"logo",height:"28"})})}),d.jsxs(Wt,{sx:{display:{xs:"none",sm:"block"}},children:[d.jsxs(pt,{id:"profile-menu-btn","aria-controls":o?"profile-menu-list":void 0,"aria-haspopup":"true","aria-expanded":o?"true":void 0,onClick:E=>r(E.currentTarget),endIcon:o?d.jsx(Al,{}):d.jsx(hl,{}),sx:{color:t.palette.common.white,fontWeight:700},children:[c==null?void 0:c.name," ",c!=null&&c.admin?"(admin)":""]}),d.jsxs(bi,{id:"profile-menu-list",anchorEl:n,open:o,onClose:()=>r(null),MenuListProps:{"aria-labelledby":"profile-menu-btn"},sx:{marginTop:"20px"},children:[d.jsx(gi,{onClick:()=>ur(`${Gn}/token`),sx:{width:"180px"},children:"Tokens"}),(c==null?void 0:c.admin)&&d.jsx(gi,{onClick:()=>ur(`${Gn}/admin`),children:"Admin"}),d.jsx(gi,{onClick:()=>ur(`${Gn}/logout`),children:"Logout"})]})]})]})}),d.jsx("nav",{children:d.jsx(WC,{container:i!==void 0?()=>i().document.body:void 0,variant:"persistent",open:a,onClose:z,ModalProps:{keepMounted:!0},sx:{"& .MuiDrawer-paper":{boxSizing:"border-box",width:240}},children:O})})]})},hI=({severity:e="error",message:t,onClose:n})=>d.jsx("div",{className:"alert-wrapper",children:t?d.jsx(Ej,{id:"alert-notification",severity:e,onClose:n,children:t}):d.jsx(d.Fragment,{})});var ym={},AI=Ut;Object.defineProperty(ym,"__esModule",{value:!0});var v9=ym.default=void 0,PI=AI(Qt()),mI=d;v9=ym.default=(0,PI.default)((0,mI.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-1 16H6c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h12c.55 0 1 .45 1 1v12c0 .55-.45 1-1 1m-4.44-6.19-2.35 3.02-1.56-1.88c-.2-.25-.58-.24-.78.01l-1.74 2.23c-.26.33-.02.81.39.81h8.98c.41 0 .65-.47.4-.8l-2.55-3.39c-.19-.26-.59-.26-.79 0"}),"CropOriginalRounded");var bm={},yI=Ut;Object.defineProperty(bm,"__esModule",{value:!0});var p9=bm.default=void 0,bI=yI(Qt()),gI=d;p9=bm.default=(0,bI.default)((0,gI.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2zM18 4h-2.5l-.71-.71c-.18-.18-.44-.29-.7-.29H9.91c-.26 0-.52.11-.7.29L8.5 4H6c-.55 0-1 .45-1 1s.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1"}),"DeleteRounded");var gm={},xI=Ut;Object.defineProperty(gm,"__esModule",{value:!0});var h9=gm.default=void 0,wI=xI(Qt()),HI=d;h9=gm.default=(0,wI.default)((0,HI.jsx)("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5zM8 15.01l1.41 1.41L11 14.84V19h2v-4.16l1.59 1.59L16 15.01 12.01 11z"}),"UploadFile");var xm={},zI=Ut;Object.defineProperty(xm,"__esModule",{value:!0});var A9=xm.default=void 0,jI=zI(Qt()),OI=d;A9=xm.default=(0,jI.default)((0,OI.jsx)("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility");const DI=({id:e,name:t,currentImage:n,setCurrentImage:r,currentFile:o,setCurrentFile:s,...i})=>{const[a,l]=b.useState(!1),[c,f]=b.useState(!1),u=b.useRef(null),v=g=>{g.preventDefault(),l(!0)},y=g=>{g.preventDefault(),l(!0)},p=g=>{g.preventDefault(),l(!1)},A=g=>{g.preventDefault(),l(!1);const H=g.dataTransfer.files[0];s(H)},x=g=>{if(!g.target.files)return;const H=g.target.files[0];s(H)},P=g=>{g.preventDefault(),f(!0)},h=g=>{g.preventDefault();const H=u.current;H&&H.click()},m=g=>{g.preventDefault();const H=u.current;H&&(H.value="",s(void 0),r(void 0))};return b.useEffect(()=>{const g=u.current;if(g&&g.files&&g.files.length>0){const H=g.files[0];s(H)}},[u,s]),d.jsxs("div",{id:`thumbnail-${e}`,className:"thumbnail",children:[d.jsxs("div",{id:`thumbnail-body-${e}`,className:`thumbnail-body ${a?"dragging":""} ${o||n?"selected":""}`,onDragOver:v,onDragEnter:y,onDragLeave:p,onDrop:A,children:[o||n?d.jsx("div",{className:"thumbnail-img-container",children:d.jsx("img",{src:o?URL.createObjectURL(o):n,alt:"App thumnail",className:"thumbnail-img"})}):d.jsx("div",{className:"thumbnail-icon-container",tabIndex:0,onClick:h,children:d.jsx(v9,{className:"thumbnail-icon"})}),d.jsx("input",{ref:u,id:e,name:t,type:"file",accept:"image/*",onChange:x,style:{display:"none"},...i})]}),d.jsxs("div",{className:"thumbnail-actions",children:[d.jsx(pt,{id:"view-thumbnail-btn",variant:"contained",color:"secondary",size:"small",startIcon:d.jsx(A9,{}),onClick:P,disabled:!o&&!n,children:"View Thumbnail"}),d.jsx(pt,{id:"upload-thumbnail-btn",variant:"contained",color:"secondary",size:"small",startIcon:d.jsx(h9,{}),onClick:h,children:"Upload Thumbnail"}),d.jsx(pt,{id:"remove-thumbnail-btn",variant:"contained",color:"secondary",size:"small",startIcon:d.jsx(p9,{}),onClick:m,disabled:!o&&!n,children:"Remove Thumbnail"})]}),d.jsx(xf,{onClose:()=>f(!1),open:c,children:d.jsx("img",{src:o?URL.createObjectURL(o):n,alt:"App thumnail"})})]})};var wm={},CI=Ut;Object.defineProperty(wm,"__esModule",{value:!0});var fv=wm.default=void 0,TI=CI(Qt()),SI=d;fv=wm.default=(0,TI.default)((0,SI.jsx)("path",{d:"M19 11H7.83l4.88-4.88c.39-.39.39-1.03 0-1.42a.9959.9959 0 0 0-1.41 0l-6.59 6.59c-.39.39-.39 1.02 0 1.41l6.59 6.59c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L7.83 13H19c.55 0 1-.45 1-1s-.45-1-1-1"}),"ArrowBackRounded");const jt=re("div")(({theme:e})=>({padding:e.spacing(0)})),EI=()=>d.jsx(Wt,{className:"container",children:d.jsxs(vc,{children:[d.jsx(jt,{children:d.jsx("div",{className:"form-breadcrumb",children:d.jsx(pt,{id:"back-btn",type:"button",variant:"text",color:"primary",startIcon:d.jsx(fv,{}),onClick:()=>ur(Gn),children:"Back"})})}),d.jsxs(jt,{children:[d.jsx("h1",{className:"form-heading",children:"Create a new app"}),d.jsxs("p",{className:"form-paragraph",children:["Begin your project by entering the details below. For more information about creating an app,"," ",d.jsx("a",{href:"https://jhub-apps.nebari.dev/docs/reference/create-app-form",target:"_blank",rel:"noopener noreferrer",className:"form-paragraph-link",children:"visit our docs"}),"."]})]}),d.jsx(jt,{children:d.jsx(c9,{})})]})}),RI=()=>{const[e]=q2(),t=e.get("id");return d.jsx(Wt,{className:"container",children:d.jsxs(vc,{children:[d.jsx(jt,{children:d.jsx("div",{className:"form-breadcrumb",children:d.jsx(pt,{id:"back-btn",type:"button",variant:"text",color:"primary",startIcon:d.jsx(fv,{}),onClick:()=>ur(Gn),children:"Back"})})}),d.jsxs(jt,{children:[d.jsx("h1",{className:"form-heading",children:"Edit app"}),d.jsxs("p",{className:"form-paragraph",children:["Edit your app details here. For more information on editing your app,"," ",d.jsx("a",{href:"https://jhub-apps.nebari.dev/docs/reference/create-app-form",target:"_blank",rel:"noopener noreferrer",className:"form-paragraph-link",children:"visit our docs"}),"."]})]}),d.jsx(jt,{children:d.jsx(d.Fragment,{children:t?d.jsx(c9,{id:t}):d.jsx(d.Fragment,{children:"No app found."})})})]})})};var Hm={},kI=Ut;Object.defineProperty(Hm,"__esModule",{value:!0});var P9=Hm.default=void 0,MI=kI(Qt()),LI=d;P9=Hm.default=(0,MI.default)((0,LI.jsx)("path",{d:"M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1"}),"AddRounded");var zm={},XI=Ut;Object.defineProperty(zm,"__esModule",{value:!0});var m9=zm.default=void 0,NI=XI(Qt()),VI=d;m9=zm.default=(0,NI.default)((0,VI.jsx)("path",{d:"M4.25 5.61C6.57 8.59 10 13 10 13v5c0 1.1.9 2 2 2s2-.9 2-2v-5s3.43-4.41 5.75-7.39c.51-.66.04-1.61-.8-1.61H5.04c-.83 0-1.3.95-.79 1.61"}),"FilterAltRounded");var jm={},BI=Ut;Object.defineProperty(jm,"__esModule",{value:!0});var y9=jm.default=void 0,WI=BI(Qt()),JI=d;y9=jm.default=(0,WI.default)((0,JI.jsx)("path",{d:"M4 18h4c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1M3 7c0 .55.45 1 1 1h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1m1 6h10c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1"}),"SortRounded");const Jb=re(pt)(({theme:e})=>({color:e.palette.common.black,borderColor:e.palette.common.black,"&:hover":{color:e.palette.common.black,borderColor:e.palette.common.black},marginRight:"16px"})),II=({data:e,currentUser:t,setApps:n})=>{const[r]=_e(B0),[o,s]=he.useState(null),[i,a]=he.useState(null),[l,c]=he.useState(null),f=!!o,u=!!i,v=!!l,[y,p]=_e(W0),[A,x]=_e(J0),[P,h]=_e(I0),[m]=b.useState(!1),{data:g,isLoading:H}=Qn({queryKey:["app-frameworks"],queryFn:()=>Rt.get("/frameworks/").then(X=>X.data)}),j=X=>{const V=X.target.value;y.includes(V)?p(I=>I.filter(Y=>Y!==V)):p(I=>[...I,V])},z=X=>{x(X)},O=X=>{h(X),n($h(e,t,r,A,y,X)),c(null)},E=()=>{s(null),n($h(e,t,r,A,y,P))},S=()=>{p([]),x("Any")};return d.jsxs(Lr,{container:!0,spacing:2,paddingBottom:"32px",children:[d.jsx(Lr,{item:!0,xs:12,md:4,children:d.jsxs(jt,{children:[d.jsx(Jb,{id:"filters-btn",variant:"outlined",color:"secondary",onClick:X=>s(X.currentTarget),startIcon:d.jsx(m9,{}),endIcon:f?d.jsx(Al,{}):d.jsx(hl,{}),disabled:H||!1,children:"Filters"}),d.jsx(bi,{id:"filters-list",anchorEl:o,open:f,onClose:()=>s(null),MenuListProps:{"aria-labelledby":"filters-btn"},children:d.jsxs(Wt,{component:"form",name:"filters-form",sx:{width:"450px",px:"16px",py:"8px"},children:[d.jsx(wf,{id:"frameworks-label",sx:{py:"16px",fontSize:"14px",fontWeight:600},children:"Frameworks"}),d.jsx(Wt,{children:g==null?void 0:g.map(X=>d.jsx(cl,{control:d.jsx(JD,{value:X.display_name}),label:X.display_name,sx:{width:"120px"},onClick:j,checked:y.includes(X.display_name)},X.name))}),d.jsx(Vl,{sx:{mt:"24px",mb:"16px"}}),d.jsx(wf,{id:"ownership-label",sx:{pb:"16px",fontSize:"14px",fontWeight:600},children:"Ownership"}),d.jsx(Wt,{sx:{pb:"24px"},children:d.jsx(bh,{"aria-labelledby":"ownership-label",defaultValue:"any",name:"ownership-group",row:!0,children:TE.map(X=>d.jsx(cl,{control:d.jsx(yh,{value:X}),label:X,onClick:()=>z(X),checked:A===X},X))})}),d.jsxs(Sf,{children:[d.jsx(pt,{id:"clear-filters-btn",variant:"text",color:"secondary",size:"small",onClick:S,children:"Clear"}),d.jsx(pt,{id:"apply-filters-btn",variant:"contained",size:"small",onClick:E,children:"Apply"})]})]})}),d.jsx(Jb,{id:"bulk-actions-btn",variant:"outlined",color:"secondary",onClick:X=>a(X.currentTarget),endIcon:u?d.jsx(Al,{}):d.jsx(hl,{}),disabled:!m,children:"Bulk Actions"}),d.jsx(bi,{id:"bulk-actions-list",anchorEl:i,open:u,onClose:()=>a(null),MenuListProps:{"aria-labelledby":"bulk-actions-btn"},children:d.jsx(Wt,{component:"form",name:"bulk-actions-form",sx:{px:"16px",py:"8px"}})})]})}),d.jsx(Lr,{container:!0,item:!0,xs:8,md:8,direction:"row",sx:{display:"flex",justifyContent:"flex-end",flexWrap:"nowrap"},children:d.jsx(jt,{children:d.jsxs(Wt,{sx:{display:"flex",flexDirection:"row"},children:[d.jsx(y9,{sx:{pr:"8px"}}),d.jsx(wf,{id:"sort-by-label",sx:{fontSize:"14px",fontWeight:500,pr:"8px",color:"common.black"},children:"Sort by:"}),d.jsx(pt,{id:"sort-by-btn",variant:"text",color:"secondary",onClick:X=>c(X.currentTarget),sx:{position:"relative",bottom:"8px",fontWeight:600,width:"180px",color:"common.black"},endIcon:v?d.jsx(Al,{}):d.jsx(hl,{}),children:P}),d.jsx(bi,{id:"sort-by-list",anchorEl:l,open:v,onClose:()=>c(null),MenuListProps:{"aria-labelledby":"sort-by-btn"},children:d.jsx(Wt,{component:"form",name:"sort-by-form",sx:{px:"16px"},children:d.jsx(bh,{defaultValue:"any",name:"sort-by-group","aria-describedby":"sort-by-label",children:SE.map(X=>d.jsx(cl,{control:d.jsx(yh,{value:X}),label:X,onClick:()=>O(X),checked:P===X},X))})})})]})})})]})},FI=({apps:e})=>d.jsx(d.Fragment,{children:e.map(t=>d.jsx(_h,{id:t.id,title:t.name,description:t.description,thumbnail:t.thumbnail,framework:t.framework,url:t.url,ready:t.ready,serverStatus:t.status,username:t.username,isPublic:t.public,isShared:t.shared},`app-${t.id}`))}),YI=()=>{const[e]=_e(pa),[,t]=_e(ks),[,n]=_e(B0),[r]=_e(W0),[o]=_e(J0),[s]=_e(I0),[i,a]=b.useState([]),{isLoading:l,error:c,data:f}=Qn({queryKey:["app-state"],queryFn:()=>Rt.get("/server/").then(v=>v.data).then(v=>v),enabled:!!e}),u=v=>{const y=v.target;n(y.value),f&&e&&a($h(f,e,y.value,o,r,s))};return b.useEffect(()=>{if(!l&&f){const v=Z0(f,"all",(e==null?void 0:e.name)??"").map(y=>({...y,status:lm(y)})).sort((y,p)=>y.last_activity>p.last_activity?-1:1);a(v)}},[l,f,e]),b.useEffect(()=>{t(c?c.message:void 0)},[c,t]),d.jsx(Wt,{children:d.jsxs(vc,{children:[d.jsx(jt,{children:d.jsxs(Lr,{container:!0,spacing:2,children:[d.jsx(Lr,{item:!0,xs:12,md:4,children:d.jsx(jt,{children:d.jsx("h2",{children:"Apps"})})}),d.jsxs(Lr,{container:!0,item:!0,xs:8,md:8,direction:"row",sx:{display:"flex",justifyContent:"flex-end",flexWrap:"nowrap"},children:[d.jsx(jt,{children:d.jsx(Qs,{id:"search",size:"small",placeholder:"Search...","aria-label":"Search for an app",onChange:u,sx:{width:{sm:"200px",md:"300px",lg:"600px"},pr:"16px"}})}),d.jsx(jt,{children:d.jsx(pt,{id:"create-app",variant:"contained",color:"primary",startIcon:d.jsx(P9,{}),onClick:()=>{window.location.href=`${HP}/create-app`},children:"Create App"})})]})]})}),d.jsx(jt,{sx:{pt:"16px",pb:"24px"},children:d.jsx(Vl,{})}),d.jsx(jt,{children:f&&e?d.jsx(II,{data:f,currentUser:e,setApps:a}):d.jsx(d.Fragment,{})}),d.jsx(jt,{children:d.jsx(Wt,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"16px",justifyContent:"flex-start",paddingBottom:"48px"},children:l?d.jsx("div",{className:"font-bold",children:"Loading..."}):i.length>0?d.jsx(FI,{apps:i}):d.jsx("div",{children:"No apps available"})})})]})})},qI=({services:e,apps:t})=>d.jsxs(d.Fragment,{children:[t.map(n=>d.jsx(_h,{id:n.id,title:n.name,description:n.description,thumbnail:n.thumbnail,framework:n.framework,url:n.url,ready:n.ready,serverStatus:n.status,username:n.username,isAppCard:!1},n.id)),e.map(n=>d.jsx(_h,{id:n.id,title:n.name,description:n.description,thumbnail:n.thumbnail,framework:n.framework,url:n.url,serverStatus:n.status,username:n.username,isAppCard:!1},n.id))]}),ZI=()=>{const[e]=_e(pa),[,t]=_e(ks),[n,r]=b.useState([]),[o,s]=b.useState([]),{isLoading:i,error:a,data:l}=Qn({queryKey:["service-data"],queryFn:()=>Rt.get("/services/").then(v=>v.data).then(v=>v),enabled:!!e}),{isLoading:c,error:f,data:u}=Qn({queryKey:["app-state"],queryFn:()=>Rt.get("/server/").then(v=>v.data).then(v=>v),enabled:!!e});return b.useEffect(()=>{!i&&l&&e&&r(()=>q0(l,e.name))},[i,l,e]),b.useEffect(()=>{!c&&u&&e&&s(()=>G0(u,e.name))},[c,u,e]),b.useEffect(()=>{t(a?a.message:f?f.message:void 0)},[a,f,t]),d.jsx(Wt,{children:d.jsxs(vc,{children:[d.jsx(jt,{children:d.jsx(Lr,{container:!0,spacing:2,children:d.jsx(Lr,{item:!0,xs:12,md:4,children:d.jsx(jt,{children:d.jsx("h2",{children:"Services"})})})})}),d.jsx(jt,{sx:{pt:"16px",pb:"24px"},children:d.jsx(Vl,{})}),d.jsx(jt,{children:d.jsx(Wt,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"16px",justifyContent:"flex-start",paddingBottom:"48px"},children:i||c?d.jsx("div",{className:"font-bold",children:"Loading..."}):n.length>0||o.length>0?d.jsx(qI,{services:n,apps:o}):d.jsx("div",{children:"No services available"})})})]})})},Ib=()=>d.jsxs(Wt,{sx:{flexGrow:1},className:"container",children:[d.jsx(Lr,{container:!0,spacing:2,paddingBottom:"32px",children:d.jsx(Lr,{item:!0,xs:12,md:2,children:d.jsx(jt,{children:d.jsx("h1",{children:"Home"})})})}),d.jsx(ZI,{}),d.jsx(YI,{})]}),GI=()=>{const[e]=q2(),t=RP(),n=Md(),[r,o]=b.useState(!1),[s]=_e(pa),[i,a]=_e(X0),[l]=_e(V0),[c]=_e(N0),[,f]=_e(ks),[u,v]=he.useState((i==null?void 0:i.profile)||""),y=e.get("id"),{data:p,isLoading:A,error:x}=Qn({queryKey:["server-types"],queryFn:()=>Rt.get("/spawner-profiles/").then(z=>z.data).then(z=>z),enabled:!!s}),P=z=>{v(z),i&&a({...i,profile:z})},h=z=>{z.preventDefault();const O={servername:(i==null?void 0:i.display_name)||"",user_options:{jhub_app:!0,name:(i==null?void 0:i.display_name)||"",display_name:(i==null?void 0:i.display_name)||"",description:(i==null?void 0:i.description)||"",framework:(i==null?void 0:i.framework)||"",thumbnail:(i==null?void 0:i.thumbnail)||"",filepath:(i==null?void 0:i.filepath)||"",conda_env:(i==null?void 0:i.conda_env)||"",env:i!=null&&i.env?JSON.parse(i.env):null,custom_command:(i==null?void 0:i.custom_command)||"",profile:(i==null?void 0:i.profile)||"",public:(i==null?void 0:i.is_public)||!1}};o(!0),y?j(O,{onSuccess:async()=>{n.invalidateQueries({queryKey:["app-state"]})},onError:async E=>{o(!1),f(E.message)}}):H(O,{onSuccess:async E=>{const S=s==null?void 0:s.name;if(S&&(E==null?void 0:E.length)>1){const X=E[1];window.location.assign(`/hub/spawn-pending/${S}/${X}`)}},onError:async E=>{o(!1),f(E.message)}})},m=async({servername:z,user_options:O})=>{const E={accept:"application/json","Content-Type":"multipart/form-data"},S=new FormData;return S.append("data",JSON.stringify({servername:z,user_options:O})),l&&S.append("thumbnail",l),(await Rt.post("/server",S,{headers:E})).data},g=async({servername:z,user_options:O})=>{const E={accept:"application/json","Content-Type":"multipart/form-data"},S=new FormData;return S.append("data",JSON.stringify({servername:z,user_options:O})),l?S.append("thumbnail",l):c&&S.append("thumbnail_data_url",c),(await Rt.put(`/server/${z}`,S,{headers:E})).data},{mutate:H}=Ki({mutationFn:m,retry:1}),{mutate:j}=Ki({mutationFn:g,retry:1});return d.jsxs("div",{className:"container",children:[d.jsx("div",{className:"form-breadcrumb",children:d.jsx(pt,{id:"back-btn",type:"button",variant:"text",color:"primary",startIcon:d.jsx(fv,{}),onClick:()=>t(y?`/edit-app?id=${y}`:"/create-app"),children:"Back"})}),d.jsxs("div",{className:"row",children:[d.jsx("h1",{className:"form-heading",children:"Server Type"}),d.jsxs("p",{className:"form-paragraph",children:["Please select the appropriate server for your app. For more information on server types,"," ",d.jsx("span",{children:d.jsx("a",{href:"https://www.nebari.dev/docs/welcome",target:"_blank",rel:"noopener noreferrer",className:"form-paragraph-link",children:"visit our docs"})}),"."]})]}),x?d.jsxs("div",{children:["An error occurred: ",x.message]}):A?d.jsx("div",{className:"font-bold center",children:"Loading..."}):p&&p.length>0?d.jsxs("form",{className:"form",onSubmit:h,children:[d.jsx("div",{className:"form-section",children:d.jsx(bh,{children:p==null?void 0:p.map((z,O)=>d.jsx(n2,{className:"server-type-card",onClick:()=>P(z.slug),tabIndex:0,children:d.jsxs(hh,{children:[d.jsx(cl,{value:z.slug,id:z.slug,control:d.jsx(yh,{checked:u?u===z.slug:O===0}),label:z.display_name},z.slug),d.jsx("p",{children:z.description})]})},`server-type-card-${z.slug}`))})}),d.jsx("hr",{}),d.jsxs("div",{className:"button-section",children:[d.jsx("div",{className:"prev",children:d.jsx(pt,{id:"cancel-btn",type:"button",variant:"text",color:"secondary",onClick:()=>ur(Gn),children:"Cancel"})}),d.jsx("div",{className:"next",children:d.jsx(pt,{id:"submit-btn",type:"submit",variant:"contained",color:"primary",disabled:r,children:y?d.jsx(d.Fragment,{children:"Save"}):d.jsx(d.Fragment,{children:"Create App"})})})]})]}):d.jsx("div",{children:"No servers available"})]})},UI=()=>{const[,e]=_e(DJ),[,t]=_e(pa),[n,r]=_e(ks),{error:o,data:s}=Qn({queryKey:["user-state"],queryFn:()=>Rt.get("/user").then(i=>i.data).then(i=>i)});return b.useEffect(()=>{o&&r(o.message)},[o,r]),b.useEffect(()=>{e(RJ())},[e]),b.useEffect(()=>{s&&t({...s})},[s,t]),d.jsxs("div",{children:[d.jsx(pI,{}),d.jsxs(Wt,{component:"main",sx:{flexGrow:1,pt:9,pl:{xs:1,sm:33},pr:1},children:[n?d.jsx(hI,{message:n,onClose:()=>r(void 0)}):d.jsx(d.Fragment,{}),d.jsxs(ek,{children:[d.jsx(Ks,{path:"/home",element:d.jsx(Ib,{})}),d.jsx(Ks,{path:"/create-app",element:d.jsx(EI,{})}),d.jsx(Ks,{path:"/edit-app",element:d.jsx(RI,{})}),d.jsx(Ks,{path:"/server-types",element:d.jsx(GI,{})}),d.jsx(Ks,{path:"/",element:d.jsx(Ib,{})})]})]})]})},QI={50:"#2491FF",100:"#2491FF",200:"#2491FF",300:"#2491FF",400:"#2491FF",500:"#005EA2",600:"#1A4480",700:"#1A4480",800:"#1A4480",900:"#162E51"},Nt={50:"#F7F8F8",100:"#E1E3E4",200:"#C3C7CB",300:"#A6ACB2",400:"#90969C",500:"#5B5F63",600:"#44474A",700:"#3C3C3B",800:"#242628",900:"#1A1C1D"},rf="#BA18DA",Fb="#BA18DA10",Yb="#9B00CE",qs="#18817A",KI="#18817A10",_I="#12635E",$I="#D72D47",eF="#F66A0A",gr="#FFFFFF",qb="#000000",of=nd({typography:{fontFamily:'"Inter", sans-serif'},components:{MuiButtonBase:{defaultProps:{disableRipple:!0,style:{textTransform:"none",textWrap:"nowrap"}}},MuiFormControl:{defaultProps:{fullWidth:!0,sx:{marginBottom:"12px"}}},MuiTextField:{defaultProps:{autoComplete:"off",fullWidth:!0,sx:{marginBottom:"0"}}},MuiSelect:{defaultProps:{fullWidth:!0}}}}),tF=nd(of,{palette:{primary:of.palette.augmentColor({color:{light:Fb,main:rf,dark:Yb,contrastText:gr},name:"primary"}),secondary:of.palette.augmentColor({color:{light:KI,main:qs,dark:_I,contrastText:gr},name:"secondary"}),gray:of.palette.augmentColor({color:{light:Nt[300],main:Nt[500],dark:Nt[700],contrastText:qb,50:Nt[50],100:Nt[100],200:Nt[200],300:Nt[300],400:Nt[400],500:Nt[500],600:Nt[600],700:Nt[700],800:Nt[800],900:Nt[900]},name:"gray"}),warning:{main:eF,contrastText:gr},error:{main:$I,contrastText:gr},info:{main:QI,contrastText:gr},success:{main:qs[500],contrastText:gr},common:{black:qb,white:gr}},components:{MuiButton:{variants:[{props:{variant:"contained",color:"primary"},style:{minWidth:"120px",backgroundColor:`${rf}`,border:`1px solid ${rf}`,fontWeight:700,"&:hover":{backgroundColor:`${Yb}`},"&:disabled":{borderColor:"transparent"}}},{props:{variant:"contained",color:"secondary"},style:{minWidth:"120px",backgroundColor:Nt[100],border:`1px solid ${Nt[100]}`,color:Nt[700],fontWeight:700,"&:hover":{backgroundColor:gr,filter:"brightness(0.96)"},"&:disabled":{borderColor:"transparent"}}},{props:{variant:"outlined",color:"secondary"},style:{minWidth:"120px",backgroundColor:gr,border:`2px solid ${qs}`,color:`${qs}`,fontWeight:700,textTransform:"none","&:hover":{backgroundColor:gr,borderWidth:2,border:`2px solid ${qs}`,color:`${qs}`}}},{props:{variant:"text",color:"primary"},style:{color:`${rf}`,"&:focus":{backgroundColor:`${Fb}`}}},{props:{variant:"text",color:"secondary"},style:{minWidth:"100px",color:Nt[500],"&:focus":{backgroundColor:`${Nt[100]}`}}}]}}}),nF=new URL(window.location.href),rF=new ZE;kh.createRoot(document.getElementById("root")).render(d.jsx(he.StrictMode,{children:d.jsx(ok,{basename:nF.pathname.indexOf("hub")===-1?HP:Gn,children:d.jsx(UB,{children:d.jsxs(x4,{theme:tF,children:[d.jsx(qD,{}),d.jsx(_E,{client:rF,children:d.jsx(UI,{})})]})})})})); diff --git a/ui/src/pages/server-types/server-types.tsx b/ui/src/pages/server-types/server-types.tsx index 7aa8b9e9..c78688d0 100644 --- a/ui/src/pages/server-types/server-types.tsx +++ b/ui/src/pages/server-types/server-types.tsx @@ -73,7 +73,6 @@ export const ServerTypes = (): React.ReactElement => { }); } }; - const handleSubmit = (event: React.FormEvent) => { event.preventDefault(); const payload = { @@ -87,7 +86,7 @@ export const ServerTypes = (): React.ReactElement => { thumbnail: currentFormInput?.thumbnail || '', filepath: currentFormInput?.filepath || '', conda_env: currentFormInput?.conda_env || '', - env: currentFormInput?.env || '', + env: currentFormInput?.env ? JSON.parse(currentFormInput.env) : null, custom_command: currentFormInput?.custom_command || '', profile: currentFormInput?.profile || '', public: currentFormInput?.is_public || false,