@minecraft-docker/mcctl-console 2.8.0 → 2.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/.next/standalone/platform/services/mcctl-console/.next/BUILD_ID +1 -1
  2. package/.next/standalone/platform/services/mcctl-console/.next/app-build-manifest.json +74 -72
  3. package/.next/standalone/platform/services/mcctl-console/.next/app-path-routes-manifest.json +1 -1
  4. package/.next/standalone/platform/services/mcctl-console/.next/build-manifest.json +2 -2
  5. package/.next/standalone/platform/services/mcctl-console/.next/prerender-manifest.json +1 -1
  6. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/admin/users/page.js +1 -1
  7. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/admin/users/page_client-reference-manifest.js +1 -1
  8. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/audit-logs/page_client-reference-manifest.js +1 -1
  9. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/backups/page.js +1 -1
  10. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/backups/page_client-reference-manifest.js +1 -1
  11. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/dashboard/page.js +4 -4
  12. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/dashboard/page.js.nft.json +1 -1
  13. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/dashboard/page_client-reference-manifest.js +1 -1
  14. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/players/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/routing/page_client-reference-manifest.js +1 -1
  16. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/console/page.js +1 -1
  17. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/console/page_client-reference-manifest.js +1 -1
  18. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/page.js +1 -54
  19. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/page.js.nft.json +1 -1
  20. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/page_client-reference-manifest.js +1 -1
  21. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/page.js +1 -54
  22. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/page.js.nft.json +1 -1
  23. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/page_client-reference-manifest.js +1 -1
  24. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/settings/page_client-reference-manifest.js +1 -1
  25. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/worlds/page.js +1 -1
  26. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/worlds/page_client-reference-manifest.js +1 -1
  27. package/.next/standalone/platform/services/mcctl-console/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  28. package/.next/standalone/platform/services/mcctl-console/.next/server/app/_not-found.html +1 -1
  29. package/.next/standalone/platform/services/mcctl-console/.next/server/app/_not-found.rsc +1 -1
  30. package/.next/standalone/platform/services/mcctl-console/.next/server/app/audit-logs.html +1 -1
  31. package/.next/standalone/platform/services/mcctl-console/.next/server/app/audit-logs.rsc +2 -2
  32. package/.next/standalone/platform/services/mcctl-console/.next/server/app/backups.html +1 -1
  33. package/.next/standalone/platform/services/mcctl-console/.next/server/app/backups.rsc +3 -3
  34. package/.next/standalone/platform/services/mcctl-console/.next/server/app/dashboard.html +1 -1
  35. package/.next/standalone/platform/services/mcctl-console/.next/server/app/dashboard.rsc +3 -3
  36. package/.next/standalone/platform/services/mcctl-console/.next/server/app/index.html +1 -1
  37. package/.next/standalone/platform/services/mcctl-console/.next/server/app/index.rsc +1 -1
  38. package/.next/standalone/platform/services/mcctl-console/.next/server/app/login/page_client-reference-manifest.js +1 -1
  39. package/.next/standalone/platform/services/mcctl-console/.next/server/app/login.html +1 -1
  40. package/.next/standalone/platform/services/mcctl-console/.next/server/app/login.rsc +2 -2
  41. package/.next/standalone/platform/services/mcctl-console/.next/server/app/page_client-reference-manifest.js +1 -1
  42. package/.next/standalone/platform/services/mcctl-console/.next/server/app/players.html +1 -1
  43. package/.next/standalone/platform/services/mcctl-console/.next/server/app/players.rsc +3 -3
  44. package/.next/standalone/platform/services/mcctl-console/.next/server/app/routing.html +1 -1
  45. package/.next/standalone/platform/services/mcctl-console/.next/server/app/routing.rsc +3 -3
  46. package/.next/standalone/platform/services/mcctl-console/.next/server/app/servers.html +1 -1
  47. package/.next/standalone/platform/services/mcctl-console/.next/server/app/servers.rsc +3 -3
  48. package/.next/standalone/platform/services/mcctl-console/.next/server/app/settings.html +1 -1
  49. package/.next/standalone/platform/services/mcctl-console/.next/server/app/settings.rsc +3 -3
  50. package/.next/standalone/platform/services/mcctl-console/.next/server/app/signup/page_client-reference-manifest.js +1 -1
  51. package/.next/standalone/platform/services/mcctl-console/.next/server/app/signup.html +1 -1
  52. package/.next/standalone/platform/services/mcctl-console/.next/server/app/signup.rsc +2 -2
  53. package/.next/standalone/platform/services/mcctl-console/.next/server/app/worlds.html +1 -1
  54. package/.next/standalone/platform/services/mcctl-console/.next/server/app/worlds.rsc +3 -3
  55. package/.next/standalone/platform/services/mcctl-console/.next/server/app-paths-manifest.json +21 -21
  56. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/1088.js +1 -0
  57. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/5843.js +1 -1
  58. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/7049.js +54 -0
  59. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/8389.js +1 -1
  60. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/8847.js +1 -1
  61. package/.next/standalone/platform/services/mcctl-console/.next/server/middleware-manifest.json +5 -5
  62. package/.next/standalone/platform/services/mcctl-console/.next/server/pages/404.html +1 -1
  63. package/.next/standalone/platform/services/mcctl-console/.next/server/pages/500.html +1 -1
  64. package/.next/standalone/platform/services/mcctl-console/.next/server/server-reference-manifest.json +1 -1
  65. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1047-1957808ef6d146f3.js +1 -0
  66. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/{1658-1c16e5a05aaa11ee.js → 1658-43a798763bcc82ae.js} +1 -1
  67. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/{7727-2552fac729c5514a.js → 2539-6bce0edb99b4e538.js} +1 -1
  68. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/5787-04cc23df05f9da2e.js +1 -0
  69. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6039-38b0b8c06d25892e.js +1 -0
  70. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6646-c5d039d1ad306467.js +1 -0
  71. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/682-6192991ddec396b8.js +1 -0
  72. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/7965-420dbb1f781fdc83.js +1 -0
  73. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/837-f4fbf77c24343b1f.js +1 -0
  74. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/8854-b34262a2493987c4.js +1 -0
  75. package/.next/{static/chunks/9949-92aa4cba630945d3.js → standalone/platform/services/mcctl-console/.next/static/chunks/9949-2daeb31bdedf25c7.js} +1 -1
  76. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/admin/users/page-e8263fc89b5d349a.js +1 -0
  77. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/dashboard/page-3cf14179dcdd7ac6.js +1 -0
  78. package/.next/{static/chunks/app/(main)/layout-22d4db17be3f8c25.js → standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/layout-bf1846a6b0c68959.js} +1 -1
  79. package/.next/{static/chunks/app/(main)/players/page-fef43a34b56c2fcf.js → standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/players/page-c4760429d9828ad3.js} +1 -1
  80. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/[name]/console/{page-1287129ad47a4440.js → page-a0050b5b439d954f.js} +1 -1
  81. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/[name]/page-f82acaf60a615953.js +1 -0
  82. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/page-382a14f87768df2c.js +1 -0
  83. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/worlds/page-a194d5d6a77d7e06.js +1 -0
  84. package/.next/{static/chunks/app/login/page-55283ea041e00fc0.js → standalone/platform/services/mcctl-console/.next/static/chunks/app/login/page-b7ec94d60aae14ce.js} +1 -1
  85. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/signup/{page-d3f96f0e775636fd.js → page-6f03571bb9914130.js} +1 -1
  86. package/.next/static/chunks/1047-1957808ef6d146f3.js +1 -0
  87. package/.next/static/chunks/{1658-1c16e5a05aaa11ee.js → 1658-43a798763bcc82ae.js} +1 -1
  88. package/.next/static/chunks/{7727-2552fac729c5514a.js → 2539-6bce0edb99b4e538.js} +1 -1
  89. package/.next/static/chunks/5787-04cc23df05f9da2e.js +1 -0
  90. package/.next/static/chunks/6039-38b0b8c06d25892e.js +1 -0
  91. package/.next/static/chunks/6646-c5d039d1ad306467.js +1 -0
  92. package/.next/static/chunks/682-6192991ddec396b8.js +1 -0
  93. package/.next/static/chunks/7965-420dbb1f781fdc83.js +1 -0
  94. package/.next/static/chunks/837-f4fbf77c24343b1f.js +1 -0
  95. package/.next/static/chunks/8854-b34262a2493987c4.js +1 -0
  96. package/.next/{standalone/platform/services/mcctl-console/.next/static/chunks/9949-92aa4cba630945d3.js → static/chunks/9949-2daeb31bdedf25c7.js} +1 -1
  97. package/.next/static/chunks/app/(main)/admin/users/page-e8263fc89b5d349a.js +1 -0
  98. package/.next/static/chunks/app/(main)/dashboard/page-3cf14179dcdd7ac6.js +1 -0
  99. package/.next/{standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/layout-22d4db17be3f8c25.js → static/chunks/app/(main)/layout-bf1846a6b0c68959.js} +1 -1
  100. package/.next/{standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/players/page-fef43a34b56c2fcf.js → static/chunks/app/(main)/players/page-c4760429d9828ad3.js} +1 -1
  101. package/.next/static/chunks/app/(main)/servers/[name]/console/{page-1287129ad47a4440.js → page-a0050b5b439d954f.js} +1 -1
  102. package/.next/static/chunks/app/(main)/servers/[name]/page-f82acaf60a615953.js +1 -0
  103. package/.next/static/chunks/app/(main)/servers/page-382a14f87768df2c.js +1 -0
  104. package/.next/static/chunks/app/(main)/worlds/page-a194d5d6a77d7e06.js +1 -0
  105. package/.next/{standalone/platform/services/mcctl-console/.next/static/chunks/app/login/page-55283ea041e00fc0.js → static/chunks/app/login/page-b7ec94d60aae14ce.js} +1 -1
  106. package/.next/static/chunks/app/signup/{page-d3f96f0e775636fd.js → page-6f03571bb9914130.js} +1 -1
  107. package/package.json +2 -2
  108. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/8091.js +0 -1
  109. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1476-a0570078fdf78fae.js +0 -1
  110. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/3333-7e2d13faa47ed67e.js +0 -1
  111. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/4436-bf86b627021ca7ab.js +0 -1
  112. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/5787-bea4ee84b4bf2dea.js +0 -1
  113. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/7965-e1d52a92f5303aca.js +0 -1
  114. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/8468-8346b1d9ff3f7efa.js +0 -1
  115. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/8854-11e2a182afd76dcd.js +0 -1
  116. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/admin/users/page-3cc240ec265dc135.js +0 -1
  117. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/dashboard/page-fba60ccdbc06c136.js +0 -1
  118. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/[name]/page-1becd4dc3adb9b97.js +0 -1
  119. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/page-bebe3d652d7cf3fb.js +0 -1
  120. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/worlds/page-e78b9914366748cf.js +0 -1
  121. package/.next/static/chunks/1476-a0570078fdf78fae.js +0 -1
  122. package/.next/static/chunks/3333-7e2d13faa47ed67e.js +0 -1
  123. package/.next/static/chunks/4436-bf86b627021ca7ab.js +0 -1
  124. package/.next/static/chunks/5787-bea4ee84b4bf2dea.js +0 -1
  125. package/.next/static/chunks/7965-e1d52a92f5303aca.js +0 -1
  126. package/.next/static/chunks/8468-8346b1d9ff3f7efa.js +0 -1
  127. package/.next/static/chunks/8854-11e2a182afd76dcd.js +0 -1
  128. package/.next/static/chunks/app/(main)/admin/users/page-3cc240ec265dc135.js +0 -1
  129. package/.next/static/chunks/app/(main)/dashboard/page-fba60ccdbc06c136.js +0 -1
  130. package/.next/static/chunks/app/(main)/servers/[name]/page-1becd4dc3adb9b97.js +0 -1
  131. package/.next/static/chunks/app/(main)/servers/page-bebe3d652d7cf3fb.js +0 -1
  132. package/.next/static/chunks/app/(main)/worlds/page-e78b9914366748cf.js +0 -1
  133. /package/.next/standalone/platform/services/mcctl-console/.next/static/{89Bssec70Vx75pcmzcDoG → S1X5jEkA1d_pSlIMuZWrE}/_buildManifest.js +0 -0
  134. /package/.next/standalone/platform/services/mcctl-console/.next/static/{89Bssec70Vx75pcmzcDoG → S1X5jEkA1d_pSlIMuZWrE}/_ssgManifest.js +0 -0
  135. /package/.next/static/{89Bssec70Vx75pcmzcDoG → S1X5jEkA1d_pSlIMuZWrE}/_buildManifest.js +0 -0
  136. /package/.next/static/{89Bssec70Vx75pcmzcDoG → S1X5jEkA1d_pSlIMuZWrE}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4095],{16387:function(e,r,t){Promise.resolve().then(t.bind(t,6453))},6453:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return B}});var n=t(94655),i=t(35106),a=t(7281),s=t(74228),l=t(46725),o=t(56275),c=t(62108),d=t(79983),x=t(31317),h=t(62142),m=t(90158),u=t(58347),p=t(49954),f=t(17820),g=t(73424),b=t(61505),j=t(71185),y=t(76176),v=t(27171),Z=t(35847),w=t(29983),C=t(80620),k=t(84974),S=t(34675),P=t(85480),z=t(64779);function I(e){return(0,n.jsxs)(z.Z,{...e,viewBox:"0 0 32 32",children:[(0,n.jsx)("rect",{width:"32",height:"32",fill:"#5DA840"}),(0,n.jsx)("rect",{x:"4",y:"8",width:"8",height:"8",fill:"#000"}),(0,n.jsx)("rect",{x:"20",y:"8",width:"8",height:"8",fill:"#000"}),(0,n.jsx)("rect",{x:"12",y:"16",width:"8",height:"4",fill:"#000"}),(0,n.jsx)("rect",{x:"8",y:"20",width:"16",height:"8",fill:"#000"}),(0,n.jsx)("rect",{x:"8",y:"28",width:"4",height:"4",fill:"#000"}),(0,n.jsx)("rect",{x:"20",y:"28",width:"4",height:"4",fill:"#000"}),(0,n.jsx)("rect",{x:"0",y:"0",width:"4",height:"4",fill:"#4A9030",opacity:"0.5"}),(0,n.jsx)("rect",{x:"8",y:"4",width:"4",height:"4",fill:"#4A9030",opacity:"0.5"}),(0,n.jsx)("rect",{x:"24",y:"0",width:"4",height:"4",fill:"#4A9030",opacity:"0.5"}),(0,n.jsx)("rect",{x:"28",y:"8",width:"4",height:"4",fill:"#4A9030",opacity:"0.5"}),(0,n.jsx)("rect",{x:"0",y:"24",width:"4",height:"4",fill:"#4A9030",opacity:"0.5"})]})}var W=t(8690),A=t(6986);let D=[{label:"Dashboard",href:"/dashboard",icon:(0,n.jsx)(y.Z,{})},{label:"Servers",href:"/servers",icon:(0,n.jsx)(v.Z,{})},{label:"Worlds",href:"/worlds",icon:(0,n.jsx)(k.Z,{})},{label:"Players",href:"/players",icon:(0,n.jsx)(Z.Z,{})},{label:"Audit",href:"/audit-logs",icon:(0,n.jsx)(C.Z,{})},{label:"Backups",href:"/backups",icon:(0,n.jsx)(S.Z,{})},{label:"Routing",href:"/routing",icon:(0,n.jsx)(w.Z,{})}];function T(e){let{mobileOpen:r,onMenuToggle:t}=e,i=(0,s.usePathname)(),{data:y}=(0,A.kP)(),v=e=>"/dashboard"===e?"/dashboard"===i||"/"===i:i.startsWith(e);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.Z,{position:"fixed",elevation:0,sx:{backgroundColor:"background.paper",borderBottom:"1px solid",borderColor:"divider",zIndex:e=>e.zIndex.drawer+1},children:(0,n.jsxs)(c.Z,{sx:{maxWidth:"1400px",width:"100%",mx:"auto",px:{xs:2,sm:3}},children:[(0,n.jsx)(d.Z,{color:"inherit","aria-label":"open menu",edge:"start",onClick:t,sx:{mr:2,display:{md:"none"}},children:(0,n.jsx)(b.Z,{})}),(0,n.jsxs)(l.default,{href:"/",style:{textDecoration:"none",display:"flex",alignItems:"center"},children:[(0,n.jsx)(I,{sx:{fontSize:28,color:"primary.main",mr:1}}),(0,n.jsx)(x.Z,{variant:"h6",component:"span",sx:{fontFamily:'"Minecraft", sans-serif',fontWeight:400,color:"common.white",letterSpacing:"0.05em",fontSize:"1.1rem"},children:"Minecraft Console"})]}),(0,n.jsx)(a.Z,{component:"nav",sx:{display:{xs:"none",md:"flex"},alignItems:"center",gap:1,ml:4,flex:1},children:D.map(e=>{let r=v(e.href);return(0,n.jsx)(l.default,{href:e.href,style:{textDecoration:"none"},onClick:()=>!r&&(0,W.Av)(),children:(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1,borderRadius:2,color:r?"primary.main":"text.secondary",backgroundColor:r?"action.selected":"transparent",transition:"all 0.2s ease","&:hover":{backgroundColor:"action.hover",color:r?"primary.main":"text.primary"}},children:[(0,n.jsx)(a.Z,{component:"span",sx:{display:"flex",alignItems:"center","& svg":{fontSize:20}},children:e.icon}),(0,n.jsx)(x.Z,{variant:"body2",sx:{fontWeight:r?600:400},children:e.label})]})},e.href)})}),(0,n.jsx)(a.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:(0,n.jsx)(P.Ie,{})})]})}),(0,n.jsx)(h.ZP,{variant:"temporary",anchor:"left",open:r,onClose:t,ModalProps:{keepMounted:!0},sx:{display:{xs:"block",md:"none"},"& .MuiDrawer-paper":{boxSizing:"border-box",width:280,backgroundColor:"background.paper"}},children:(0,n.jsxs)(a.Z,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:2,minHeight:64,borderBottom:"1px solid",borderColor:"divider"},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,n.jsx)(I,{sx:{fontSize:24,color:"primary.main",mr:1}}),(0,n.jsx)(x.Z,{variant:"h6",component:"span",sx:{fontFamily:'"Minecraft", sans-serif',fontWeight:400,color:"primary.main",letterSpacing:"0.05em",fontSize:"1rem"},children:"Minecraft Console"})]}),(0,n.jsx)(d.Z,{onClick:t,"aria-label":"close menu",children:(0,n.jsx)(j.Z,{})})]}),(0,n.jsx)(m.Z,{sx:{flex:1,px:1,py:2},children:D.map(e=>{let r=v(e.href);return(0,n.jsx)(u.ZP,{disablePadding:!0,sx:{mb:.5},children:(0,n.jsxs)(p.Z,{component:l.default,href:e.href,onClick:()=>{t(),r||(0,W.Av)()},"aria-current":r?"page":void 0,sx:{borderRadius:2,backgroundColor:r?"action.selected":"transparent","&:hover":{backgroundColor:"action.hover"}},children:[(0,n.jsx)(f.Z,{sx:{color:r?"primary.main":"text.secondary",minWidth:40},children:e.icon}),(0,n.jsx)(g.Z,{primary:e.label,primaryTypographyProps:{fontWeight:r?600:400,color:r?"primary.main":"text.primary"}})]})},e.href)})})]})})]})}var _=t(67337),E=t(41261),q=t(69123),M=t(75845),L=t(43880);function R(e){return(0,n.jsx)(z.Z,{...e,viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M13.983 11.078h2.119a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.119a.185.185 0 00-.185.185v1.888c0 .102.083.185.185.185m-2.954-5.43h2.118a.186.186 0 00.186-.186V3.574a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.186m0 2.716h2.118a.187.187 0 00.186-.186V6.29a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.887c0 .102.082.185.185.186m-2.93 0h2.12a.186.186 0 00.184-.186V6.29a.185.185 0 00-.185-.185H8.1a.185.185 0 00-.185.185v1.887c0 .102.083.185.185.186m-2.964 0h2.119a.186.186 0 00.185-.186V6.29a.185.185 0 00-.185-.185H5.136a.186.186 0 00-.186.185v1.887c0 .102.084.185.186.186m5.893 2.715h2.118a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m-2.93 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.083.185.185.185m-2.964 0h2.119a.185.185 0 00.185-.185V9.006a.185.185 0 00-.184-.186h-2.12a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185m-2.92 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.082.185.185.185M23.763 9.89c-.065-.051-.672-.51-1.954-.51-.338.001-.676.03-1.01.087-.248-1.7-1.653-2.53-1.716-2.566l-.344-.199-.226.327c-.284.438-.49.922-.612 1.43-.23.97-.09 1.882.403 2.661-.595.332-1.55.413-1.744.42H.751a.751.751 0 00-.75.748 11.376 11.376 0 00.692 4.062c.545 1.428 1.355 2.48 2.41 3.124 1.18.723 3.1 1.137 5.275 1.137.983.003 1.963-.086 2.93-.266a12.248 12.248 0 003.823-1.389c.98-.567 1.86-1.288 2.61-2.136 1.252-1.418 1.998-2.997 2.553-4.4h.221c1.372 0 2.215-.549 2.68-1.009.309-.293.55-.65.707-1.046l.098-.288z"})})}let U=[{title:"Resources",links:[{label:"Getting Started",href:"https://minecraft-server-manager.readthedocs.io/en/latest/getting-started/",external:!0},{label:"Configuration",href:"https://minecraft-server-manager.readthedocs.io/en/latest/configuration/",external:!0},{label:"Troubleshooting",href:"https://minecraft-server-manager.readthedocs.io/en/latest/troubleshooting/",external:!0}]},{title:"Documentation",links:[{label:"CLI Commands",href:"https://minecraft-server-manager.readthedocs.io/en/latest/cli/",external:!0},{label:"API Reference",href:"https://minecraft-server-manager.readthedocs.io/en/latest/console/",external:!0},{label:"itzg Reference",href:"https://minecraft-server-manager.readthedocs.io/en/latest/itzg-reference/",external:!0}]},{title:"Community",links:[{label:"GitHub",href:"https://github.com/smallmiro/minecraft-server-manager",external:!0},{label:"Issues",href:"https://github.com/smallmiro/minecraft-server-manager/issues",external:!0}]},{title:"About",links:[{label:"License",href:"https://github.com/smallmiro/minecraft-server-manager/blob/main/LICENSE",external:!0},{label:"Docker Hub",href:"https://hub.docker.com/r/itzg/minecraft-server",external:!0}]}];function H(){let e=new Date().getFullYear();return(0,n.jsx)(a.Z,{component:"footer",sx:{backgroundColor:"background.paper",borderTop:"1px solid",borderColor:"divider",mt:"auto"},children:(0,n.jsxs)(_.Z,{maxWidth:"lg",sx:{py:6},children:[(0,n.jsx)(a.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(4, 1fr)"},gap:4,mb:4},children:U.map(e=>(0,n.jsxs)(a.Z,{children:[(0,n.jsx)(x.Z,{variant:"subtitle2",sx:{fontWeight:600,color:"text.primary",mb:2},children:e.title}),(0,n.jsx)(a.Z,{component:"ul",sx:{listStyle:"none",p:0,m:0},children:e.links.map(e=>(0,n.jsx)(a.Z,{component:"li",sx:{mb:1},children:(0,n.jsx)(E.Z,{href:e.href,target:e.external?"_blank":void 0,rel:e.external?"noopener noreferrer":void 0,underline:"hover",sx:{color:"text.secondary",fontSize:"0.875rem",transition:"color 0.2s ease","&:hover":{color:"primary.main"}},children:e.label})},e.label))})]},e.title))}),(0,n.jsx)(q.Z,{sx:{mb:3}}),(0,n.jsxs)(a.Z,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},gap:2},children:[(0,n.jsxs)(x.Z,{variant:"body2",sx:{color:"text.tertiary"},children:[e," \xa9"," ",(0,n.jsx)(E.Z,{href:"https://github.com/smallmiro/minecraft-server-manager",target:"_blank",rel:"noopener noreferrer",underline:"hover",sx:{color:"primary.main"},children:"Minecraft Server Management Console"})]}),(0,n.jsxs)(a.Z,{sx:{display:"flex",gap:2},children:[(0,n.jsx)(E.Z,{href:"https://github.com/smallmiro/minecraft-server-manager",target:"_blank",rel:"noopener noreferrer","aria-label":"GitHub",sx:{color:"text.secondary",transition:"color 0.2s ease","&:hover":{color:"text.primary"}},children:(0,n.jsx)(M.Z,{fontSize:"small"})}),(0,n.jsx)(E.Z,{href:"https://minecraft-server-manager.readthedocs.io/",target:"_blank",rel:"noopener noreferrer","aria-label":"Documentation",sx:{color:"text.secondary",transition:"color 0.2s ease","&:hover":{color:"text.primary"}},children:(0,n.jsx)(L.Z,{fontSize:"small"})}),(0,n.jsx)(E.Z,{href:"https://hub.docker.com/r/itzg/minecraft-server",target:"_blank",rel:"noopener noreferrer","aria-label":"Docker Hub",sx:{color:"text.secondary",transition:"color 0.2s ease","&:hover":{color:"text.primary"}},children:(0,n.jsx)(R,{fontSize:"small"})})]})]})]})})}function B(e){let{children:r}=e,[t,s]=(0,i.useState)(!1);return(0,n.jsxs)(a.Z,{sx:{display:"flex",flexDirection:"column",minHeight:"100vh",backgroundColor:"background.default"},children:[(0,n.jsx)(T,{mobileOpen:t,onMenuToggle:()=>{s(!t)}}),(0,n.jsx)(a.Z,{component:"main",sx:{flexGrow:1,display:"flex",flexDirection:"column",pt:{xs:"".concat(88,"px"),sm:"".concat(96,"px")},pb:{xs:3,sm:4},px:{xs:2,sm:3,md:4},maxWidth:"1400px",width:"100%",mx:"auto"},children:r}),(0,n.jsx)(H,{})]})}},85480:function(e,r,t){"use strict";t.d(r,{U0:function(){return u},WS:function(){return p},Ie:function(){return I}});var n=t(94655),i=t(35106),a=t(7281),s=t(81071),l=t(97436),o=t(52082),c=t(79983),d=t(30417),x=t(36848),h=t(554),m=t(6986);function u(e){let{onSuccess:r}=e,[t,u]=(0,i.useState)(""),[p,f]=(0,i.useState)(""),[g,b]=(0,i.useState)(!1),[j,y]=(0,i.useState)({}),[v,Z]=(0,i.useState)(null),[w,C]=(0,i.useState)(!1),k=()=>{let e={};return t?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)||(e.email="Invalid email address"):e.email="Email is required",p||(e.password="Password is required"),y(e),0===Object.keys(e).length},S=async e=>{if(e.preventDefault(),Z(null),k()){C(!0);try{let e=await m.cg.email({email:t,password:p});if(e.error){Z(e.error.message||"Invalid credentials"),C(!1);return}r&&r()}catch(e){Z("An unexpected error occurred. Please try again."),C(!1)}}};return(0,n.jsxs)(a.Z,{component:"form",onSubmit:S,sx:{display:"flex",flexDirection:"column",gap:2},children:[v&&(0,n.jsx)(s.Z,{severity:"error",onClose:()=>Z(null),children:v}),(0,n.jsx)(l.Z,{label:"Email",type:"email",value:t,onChange:e=>u(e.target.value),error:!!j.email,helperText:j.email,disabled:w,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Password",type:g?"text":"password",value:p,onChange:e=>f(e.target.value),error:!!j.password,helperText:j.password,disabled:w,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(c.Z,{"aria-label":"toggle password visibility",onClick:()=>{b(!g)},edge:"end",children:g?(0,n.jsx)(x.Z,{}):(0,n.jsx)(h.Z,{})})})}}),(0,n.jsx)(d.Z,{type:"submit",variant:"contained",color:"primary",disabled:w,fullWidth:!0,size:"large",children:w?"Signing in...":"Sign In"})]})}function p(e){let{onSuccess:r}=e,[t,u]=(0,i.useState)(""),[p,f]=(0,i.useState)(""),[g,b]=(0,i.useState)(""),[j,y]=(0,i.useState)(""),[v,Z]=(0,i.useState)(!1),[w,C]=(0,i.useState)(!1),[k,S]=(0,i.useState)({}),[P,z]=(0,i.useState)(null),[I,W]=(0,i.useState)(!1),A=()=>{let e={};return t||(e.name="Name is required"),p?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(p)||(e.email="Invalid email address"):e.email="Email is required",g?g.length<8&&(e.password="Password must be at least 8 characters"):e.password="Password is required",j?g!==j&&(e.confirmPassword="Passwords do not match"):e.confirmPassword="Please confirm your password",S(e),0===Object.keys(e).length},D=async e=>{if(e.preventDefault(),z(null),A()){W(!0);try{let e=await m.y1.email({email:p,password:g,name:t});if(e.error){z(e.error.message||"Registration failed"),W(!1);return}r&&r()}catch(e){z("An unexpected error occurred. Please try again."),W(!1)}}};return(0,n.jsxs)(a.Z,{component:"form",onSubmit:D,sx:{display:"flex",flexDirection:"column",gap:2},children:[P&&(0,n.jsx)(s.Z,{severity:"error",onClose:()=>z(null),children:P}),(0,n.jsx)(l.Z,{label:"Name",type:"text",value:t,onChange:e=>u(e.target.value),error:!!k.name,helperText:k.name,disabled:I,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Email",type:"email",value:p,onChange:e=>f(e.target.value),error:!!k.email,helperText:k.email,disabled:I,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Password",type:v?"text":"password",value:g,onChange:e=>b(e.target.value),error:!!k.password,helperText:k.password,disabled:I,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(c.Z,{"aria-label":"toggle password visibility",onClick:()=>{Z(!v)},edge:"end",children:v?(0,n.jsx)(x.Z,{}):(0,n.jsx)(h.Z,{})})})}}),(0,n.jsx)(l.Z,{label:"Confirm Password",type:w?"text":"password",value:j,onChange:e=>y(e.target.value),error:!!k.confirmPassword,helperText:k.confirmPassword,disabled:I,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(c.Z,{"aria-label":"toggle password visibility",onClick:()=>{C(!w)},edge:"end",children:w?(0,n.jsx)(x.Z,{}):(0,n.jsx)(h.Z,{})})})}}),(0,n.jsx)(d.Z,{type:"submit",variant:"contained",color:"primary",disabled:I,fullWidth:!0,size:"large",children:I?"Creating account...":"Sign Up"})]})}var f=t(74228),g=t(93017),b=t(86702),j=t(88812),y=t(31317),v=t(25333),Z=t(69123),w=t(7178),C=t(17820),k=t(73424),S=t(25169),P=t(41094),z=t(78319);function I(){let e=(0,f.useRouter)(),{data:r,isPending:t}=(0,m.kP)(),[s,l]=(0,i.useState)(null),o=()=>{l(null)},x=async()=>{o(),await (0,m.w7)(),e.push("/login")};if(t)return(0,n.jsx)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)(g.Z,{size:24})});if(!(null==r?void 0:r.user))return(0,n.jsx)(d.Z,{variant:"contained",color:"primary",onClick:()=>{e.push("/login")},children:"Sign In"});let{user:h}=r,u=((e,r)=>{if(e){let r=e.split(" ");return r.length>=2?"".concat(r[0][0]).concat(r[1][0]).toUpperCase():e.substring(0,2).toUpperCase()}return r?r[0].toUpperCase():"?"})(h.name,h.email);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.Z,{onClick:e=>{l(e.currentTarget)},"aria-label":"user menu",children:(0,n.jsx)(b.Z,{sx:{bgcolor:"primary.main"},children:u})}),(0,n.jsxs)(j.Z,{anchorEl:s,open:!!s,onClose:o,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{mt:1},children:[(0,n.jsxs)(a.Z,{sx:{px:2,py:1.5,minWidth:200},children:[(0,n.jsx)(y.Z,{variant:"subtitle1",fontWeight:"600",children:h.name||"User"}),(0,n.jsx)(y.Z,{variant:"body2",color:"text.secondary",children:h.email}),"admin"===h.role&&(0,n.jsx)(v.Z,{label:"Admin",size:"small",color:"primary",sx:{mt:1}})]}),(0,n.jsx)(Z.Z,{}),"admin"===h.role&&(0,n.jsxs)(w.Z,{onClick:()=>{o(),e.push("/admin/users")},children:[(0,n.jsx)(C.Z,{children:(0,n.jsx)(S.Z,{fontSize:"small"})}),(0,n.jsx)(k.Z,{children:"Users"})]}),(0,n.jsxs)(w.Z,{onClick:()=>{o(),e.push("/settings")},children:[(0,n.jsx)(C.Z,{children:(0,n.jsx)(P.Z,{fontSize:"small"})}),(0,n.jsx)(k.Z,{children:"Settings"})]}),(0,n.jsxs)(w.Z,{onClick:x,children:[(0,n.jsx)(C.Z,{children:(0,n.jsx)(z.Z,{fontSize:"small"})}),(0,n.jsx)(k.Z,{children:"Logout"})]})]})]})}},3454:function(e,r,t){"use strict";t.d(r,{LoadingProvider:function(){return o},startLoading:function(){return c},stopLoading:function(){return d}});var n=t(94655),i=t(35106),a=t(74228),s=t(31477),l=t.n(s);function o(e){let{children:r}=e,t=(0,a.usePathname)(),s=(0,a.useSearchParams)();return(0,i.useEffect)(()=>{l().done()},[t,s]),(0,n.jsx)(n.Fragment,{children:r})}function c(){l().start()}function d(){l().done()}l().configure({showSpinner:!1,speed:300,minimum:.1})},8690:function(e,r,t){"use strict";t.d(r,{Av:function(){return n.startLoading}});var n=t(3454)},6986:function(e,r,t){"use strict";t.d(r,{Cp:function(){return h},Nq:function(){return x},cg:function(){return l},kP:function(){return d},w7:function(){return o},y1:function(){return c},zB:function(){return m}});var n=t(77054),i=t(61648),a=t(35016);let s=(0,n.X)({baseURL:a.env.NEXT_PUBLIC_BETTER_AUTH_URL||"",plugins:[(0,i.zB)()]}),{signIn:l,signOut:o,signUp:c,useSession:d,updateUser:x,changePassword:h}=s,m=s.admin}},function(e){e.O(0,[6812,9760,5004,7296,7436,1071,2542,55,7727,8347,9949,4240,212,3669,2757,1744],function(){return e(e.s=16387)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4095],{16387:function(e,r,t){Promise.resolve().then(t.bind(t,6453))},6453:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return B}});var n=t(94655),i=t(35106),a=t(7281),s=t(74228),l=t(46725),o=t(56275),c=t(62108),d=t(79983),x=t(31317),h=t(62142),m=t(90158),u=t(58347),p=t(49954),f=t(17820),g=t(73424),b=t(61505),j=t(71185),y=t(76176),v=t(27171),Z=t(35847),w=t(29983),C=t(80620),k=t(84974),S=t(34675),P=t(85480),z=t(64779);function I(e){return(0,n.jsxs)(z.Z,{...e,viewBox:"0 0 32 32",children:[(0,n.jsx)("rect",{width:"32",height:"32",fill:"#5DA840"}),(0,n.jsx)("rect",{x:"4",y:"8",width:"8",height:"8",fill:"#000"}),(0,n.jsx)("rect",{x:"20",y:"8",width:"8",height:"8",fill:"#000"}),(0,n.jsx)("rect",{x:"12",y:"16",width:"8",height:"4",fill:"#000"}),(0,n.jsx)("rect",{x:"8",y:"20",width:"16",height:"8",fill:"#000"}),(0,n.jsx)("rect",{x:"8",y:"28",width:"4",height:"4",fill:"#000"}),(0,n.jsx)("rect",{x:"20",y:"28",width:"4",height:"4",fill:"#000"}),(0,n.jsx)("rect",{x:"0",y:"0",width:"4",height:"4",fill:"#4A9030",opacity:"0.5"}),(0,n.jsx)("rect",{x:"8",y:"4",width:"4",height:"4",fill:"#4A9030",opacity:"0.5"}),(0,n.jsx)("rect",{x:"24",y:"0",width:"4",height:"4",fill:"#4A9030",opacity:"0.5"}),(0,n.jsx)("rect",{x:"28",y:"8",width:"4",height:"4",fill:"#4A9030",opacity:"0.5"}),(0,n.jsx)("rect",{x:"0",y:"24",width:"4",height:"4",fill:"#4A9030",opacity:"0.5"})]})}var W=t(8690),A=t(6986);let D=[{label:"Dashboard",href:"/dashboard",icon:(0,n.jsx)(y.Z,{})},{label:"Servers",href:"/servers",icon:(0,n.jsx)(v.Z,{})},{label:"Worlds",href:"/worlds",icon:(0,n.jsx)(k.Z,{})},{label:"Players",href:"/players",icon:(0,n.jsx)(Z.Z,{})},{label:"Audit",href:"/audit-logs",icon:(0,n.jsx)(C.Z,{})},{label:"Backups",href:"/backups",icon:(0,n.jsx)(S.Z,{})},{label:"Routing",href:"/routing",icon:(0,n.jsx)(w.Z,{})}];function T(e){let{mobileOpen:r,onMenuToggle:t}=e,i=(0,s.usePathname)(),{data:y}=(0,A.kP)(),v=e=>"/dashboard"===e?"/dashboard"===i||"/"===i:i.startsWith(e);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.Z,{position:"fixed",elevation:0,sx:{backgroundColor:"background.paper",borderBottom:"1px solid",borderColor:"divider",zIndex:e=>e.zIndex.drawer+1},children:(0,n.jsxs)(c.Z,{sx:{maxWidth:"1400px",width:"100%",mx:"auto",px:{xs:2,sm:3}},children:[(0,n.jsx)(d.Z,{color:"inherit","aria-label":"open menu",edge:"start",onClick:t,sx:{mr:2,display:{md:"none"}},children:(0,n.jsx)(b.Z,{})}),(0,n.jsxs)(l.default,{href:"/",style:{textDecoration:"none",display:"flex",alignItems:"center"},children:[(0,n.jsx)(I,{sx:{fontSize:28,color:"primary.main",mr:1}}),(0,n.jsx)(x.Z,{variant:"h6",component:"span",sx:{fontFamily:'"Minecraft", sans-serif',fontWeight:400,color:"common.white",letterSpacing:"0.05em",fontSize:"1.1rem"},children:"Minecraft Console"})]}),(0,n.jsx)(a.Z,{component:"nav",sx:{display:{xs:"none",md:"flex"},alignItems:"center",gap:1,ml:4,flex:1},children:D.map(e=>{let r=v(e.href);return(0,n.jsx)(l.default,{href:e.href,style:{textDecoration:"none"},onClick:()=>!r&&(0,W.Av)(),children:(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1,borderRadius:2,color:r?"primary.main":"text.secondary",backgroundColor:r?"action.selected":"transparent",transition:"all 0.2s ease","&:hover":{backgroundColor:"action.hover",color:r?"primary.main":"text.primary"}},children:[(0,n.jsx)(a.Z,{component:"span",sx:{display:"flex",alignItems:"center","& svg":{fontSize:20}},children:e.icon}),(0,n.jsx)(x.Z,{variant:"body2",sx:{fontWeight:r?600:400},children:e.label})]})},e.href)})}),(0,n.jsx)(a.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:(0,n.jsx)(P.Ie,{})})]})}),(0,n.jsx)(h.ZP,{variant:"temporary",anchor:"left",open:r,onClose:t,ModalProps:{keepMounted:!0},sx:{display:{xs:"block",md:"none"},"& .MuiDrawer-paper":{boxSizing:"border-box",width:280,backgroundColor:"background.paper"}},children:(0,n.jsxs)(a.Z,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:2,minHeight:64,borderBottom:"1px solid",borderColor:"divider"},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,n.jsx)(I,{sx:{fontSize:24,color:"primary.main",mr:1}}),(0,n.jsx)(x.Z,{variant:"h6",component:"span",sx:{fontFamily:'"Minecraft", sans-serif',fontWeight:400,color:"primary.main",letterSpacing:"0.05em",fontSize:"1rem"},children:"Minecraft Console"})]}),(0,n.jsx)(d.Z,{onClick:t,"aria-label":"close menu",children:(0,n.jsx)(j.Z,{})})]}),(0,n.jsx)(m.Z,{sx:{flex:1,px:1,py:2},children:D.map(e=>{let r=v(e.href);return(0,n.jsx)(u.ZP,{disablePadding:!0,sx:{mb:.5},children:(0,n.jsxs)(p.Z,{component:l.default,href:e.href,onClick:()=>{t(),r||(0,W.Av)()},"aria-current":r?"page":void 0,sx:{borderRadius:2,backgroundColor:r?"action.selected":"transparent","&:hover":{backgroundColor:"action.hover"}},children:[(0,n.jsx)(f.Z,{sx:{color:r?"primary.main":"text.secondary",minWidth:40},children:e.icon}),(0,n.jsx)(g.Z,{primary:e.label,primaryTypographyProps:{fontWeight:r?600:400,color:r?"primary.main":"text.primary"}})]})},e.href)})})]})})]})}var _=t(67337),E=t(41261),q=t(69123),M=t(75845),L=t(43880);function R(e){return(0,n.jsx)(z.Z,{...e,viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M13.983 11.078h2.119a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.119a.185.185 0 00-.185.185v1.888c0 .102.083.185.185.185m-2.954-5.43h2.118a.186.186 0 00.186-.186V3.574a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.186m0 2.716h2.118a.187.187 0 00.186-.186V6.29a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.887c0 .102.082.185.185.186m-2.93 0h2.12a.186.186 0 00.184-.186V6.29a.185.185 0 00-.185-.185H8.1a.185.185 0 00-.185.185v1.887c0 .102.083.185.185.186m-2.964 0h2.119a.186.186 0 00.185-.186V6.29a.185.185 0 00-.185-.185H5.136a.186.186 0 00-.186.185v1.887c0 .102.084.185.186.186m5.893 2.715h2.118a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m-2.93 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.083.185.185.185m-2.964 0h2.119a.185.185 0 00.185-.185V9.006a.185.185 0 00-.184-.186h-2.12a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185m-2.92 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.082.185.185.185M23.763 9.89c-.065-.051-.672-.51-1.954-.51-.338.001-.676.03-1.01.087-.248-1.7-1.653-2.53-1.716-2.566l-.344-.199-.226.327c-.284.438-.49.922-.612 1.43-.23.97-.09 1.882.403 2.661-.595.332-1.55.413-1.744.42H.751a.751.751 0 00-.75.748 11.376 11.376 0 00.692 4.062c.545 1.428 1.355 2.48 2.41 3.124 1.18.723 3.1 1.137 5.275 1.137.983.003 1.963-.086 2.93-.266a12.248 12.248 0 003.823-1.389c.98-.567 1.86-1.288 2.61-2.136 1.252-1.418 1.998-2.997 2.553-4.4h.221c1.372 0 2.215-.549 2.68-1.009.309-.293.55-.65.707-1.046l.098-.288z"})})}let U=[{title:"Resources",links:[{label:"Getting Started",href:"https://minecraft-server-manager.readthedocs.io/en/latest/getting-started/",external:!0},{label:"Configuration",href:"https://minecraft-server-manager.readthedocs.io/en/latest/configuration/",external:!0},{label:"Troubleshooting",href:"https://minecraft-server-manager.readthedocs.io/en/latest/troubleshooting/",external:!0}]},{title:"Documentation",links:[{label:"CLI Commands",href:"https://minecraft-server-manager.readthedocs.io/en/latest/cli/",external:!0},{label:"API Reference",href:"https://minecraft-server-manager.readthedocs.io/en/latest/console/",external:!0},{label:"itzg Reference",href:"https://minecraft-server-manager.readthedocs.io/en/latest/itzg-reference/",external:!0}]},{title:"Community",links:[{label:"GitHub",href:"https://github.com/smallmiro/minecraft-server-manager",external:!0},{label:"Issues",href:"https://github.com/smallmiro/minecraft-server-manager/issues",external:!0}]},{title:"About",links:[{label:"License",href:"https://github.com/smallmiro/minecraft-server-manager/blob/main/LICENSE",external:!0},{label:"Docker Hub",href:"https://hub.docker.com/r/itzg/minecraft-server",external:!0}]}];function H(){let e=new Date().getFullYear();return(0,n.jsx)(a.Z,{component:"footer",sx:{backgroundColor:"background.paper",borderTop:"1px solid",borderColor:"divider",mt:"auto"},children:(0,n.jsxs)(_.Z,{maxWidth:"lg",sx:{py:6},children:[(0,n.jsx)(a.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(4, 1fr)"},gap:4,mb:4},children:U.map(e=>(0,n.jsxs)(a.Z,{children:[(0,n.jsx)(x.Z,{variant:"subtitle2",sx:{fontWeight:600,color:"text.primary",mb:2},children:e.title}),(0,n.jsx)(a.Z,{component:"ul",sx:{listStyle:"none",p:0,m:0},children:e.links.map(e=>(0,n.jsx)(a.Z,{component:"li",sx:{mb:1},children:(0,n.jsx)(E.Z,{href:e.href,target:e.external?"_blank":void 0,rel:e.external?"noopener noreferrer":void 0,underline:"hover",sx:{color:"text.secondary",fontSize:"0.875rem",transition:"color 0.2s ease","&:hover":{color:"primary.main"}},children:e.label})},e.label))})]},e.title))}),(0,n.jsx)(q.Z,{sx:{mb:3}}),(0,n.jsxs)(a.Z,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},gap:2},children:[(0,n.jsxs)(x.Z,{variant:"body2",sx:{color:"text.tertiary"},children:[e," \xa9"," ",(0,n.jsx)(E.Z,{href:"https://github.com/smallmiro/minecraft-server-manager",target:"_blank",rel:"noopener noreferrer",underline:"hover",sx:{color:"primary.main"},children:"Minecraft Server Management Console"})]}),(0,n.jsxs)(a.Z,{sx:{display:"flex",gap:2},children:[(0,n.jsx)(E.Z,{href:"https://github.com/smallmiro/minecraft-server-manager",target:"_blank",rel:"noopener noreferrer","aria-label":"GitHub",sx:{color:"text.secondary",transition:"color 0.2s ease","&:hover":{color:"text.primary"}},children:(0,n.jsx)(M.Z,{fontSize:"small"})}),(0,n.jsx)(E.Z,{href:"https://minecraft-server-manager.readthedocs.io/",target:"_blank",rel:"noopener noreferrer","aria-label":"Documentation",sx:{color:"text.secondary",transition:"color 0.2s ease","&:hover":{color:"text.primary"}},children:(0,n.jsx)(L.Z,{fontSize:"small"})}),(0,n.jsx)(E.Z,{href:"https://hub.docker.com/r/itzg/minecraft-server",target:"_blank",rel:"noopener noreferrer","aria-label":"Docker Hub",sx:{color:"text.secondary",transition:"color 0.2s ease","&:hover":{color:"text.primary"}},children:(0,n.jsx)(R,{fontSize:"small"})})]})]})]})})}function B(e){let{children:r}=e,[t,s]=(0,i.useState)(!1);return(0,n.jsxs)(a.Z,{sx:{display:"flex",flexDirection:"column",minHeight:"100vh",backgroundColor:"background.default"},children:[(0,n.jsx)(T,{mobileOpen:t,onMenuToggle:()=>{s(!t)}}),(0,n.jsx)(a.Z,{component:"main",sx:{flexGrow:1,display:"flex",flexDirection:"column",pt:{xs:"".concat(88,"px"),sm:"".concat(96,"px")},pb:{xs:3,sm:4},px:{xs:2,sm:3,md:4},maxWidth:"1400px",width:"100%",mx:"auto"},children:r}),(0,n.jsx)(H,{})]})}},85480:function(e,r,t){"use strict";t.d(r,{U0:function(){return u},WS:function(){return p},Ie:function(){return I}});var n=t(94655),i=t(35106),a=t(7281),s=t(81071),l=t(97436),o=t(52082),c=t(79983),d=t(30417),x=t(36848),h=t(554),m=t(6986);function u(e){let{onSuccess:r}=e,[t,u]=(0,i.useState)(""),[p,f]=(0,i.useState)(""),[g,b]=(0,i.useState)(!1),[j,y]=(0,i.useState)({}),[v,Z]=(0,i.useState)(null),[w,C]=(0,i.useState)(!1),k=()=>{let e={};return t?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)||(e.email="Invalid email address"):e.email="Email is required",p||(e.password="Password is required"),y(e),0===Object.keys(e).length},S=async e=>{if(e.preventDefault(),Z(null),k()){C(!0);try{let e=await m.cg.email({email:t,password:p});if(e.error){Z(e.error.message||"Invalid credentials"),C(!1);return}r&&r()}catch(e){Z("An unexpected error occurred. Please try again."),C(!1)}}};return(0,n.jsxs)(a.Z,{component:"form",onSubmit:S,sx:{display:"flex",flexDirection:"column",gap:2},children:[v&&(0,n.jsx)(s.Z,{severity:"error",onClose:()=>Z(null),children:v}),(0,n.jsx)(l.Z,{label:"Email",type:"email",value:t,onChange:e=>u(e.target.value),error:!!j.email,helperText:j.email,disabled:w,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Password",type:g?"text":"password",value:p,onChange:e=>f(e.target.value),error:!!j.password,helperText:j.password,disabled:w,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(c.Z,{"aria-label":"toggle password visibility",onClick:()=>{b(!g)},edge:"end",children:g?(0,n.jsx)(x.Z,{}):(0,n.jsx)(h.Z,{})})})}}),(0,n.jsx)(d.Z,{type:"submit",variant:"contained",color:"primary",disabled:w,fullWidth:!0,size:"large",children:w?"Signing in...":"Sign In"})]})}function p(e){let{onSuccess:r}=e,[t,u]=(0,i.useState)(""),[p,f]=(0,i.useState)(""),[g,b]=(0,i.useState)(""),[j,y]=(0,i.useState)(""),[v,Z]=(0,i.useState)(!1),[w,C]=(0,i.useState)(!1),[k,S]=(0,i.useState)({}),[P,z]=(0,i.useState)(null),[I,W]=(0,i.useState)(!1),A=()=>{let e={};return t||(e.name="Name is required"),p?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(p)||(e.email="Invalid email address"):e.email="Email is required",g?g.length<8&&(e.password="Password must be at least 8 characters"):e.password="Password is required",j?g!==j&&(e.confirmPassword="Passwords do not match"):e.confirmPassword="Please confirm your password",S(e),0===Object.keys(e).length},D=async e=>{if(e.preventDefault(),z(null),A()){W(!0);try{let e=await m.y1.email({email:p,password:g,name:t});if(e.error){z(e.error.message||"Registration failed"),W(!1);return}r&&r()}catch(e){z("An unexpected error occurred. Please try again."),W(!1)}}};return(0,n.jsxs)(a.Z,{component:"form",onSubmit:D,sx:{display:"flex",flexDirection:"column",gap:2},children:[P&&(0,n.jsx)(s.Z,{severity:"error",onClose:()=>z(null),children:P}),(0,n.jsx)(l.Z,{label:"Name",type:"text",value:t,onChange:e=>u(e.target.value),error:!!k.name,helperText:k.name,disabled:I,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Email",type:"email",value:p,onChange:e=>f(e.target.value),error:!!k.email,helperText:k.email,disabled:I,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Password",type:v?"text":"password",value:g,onChange:e=>b(e.target.value),error:!!k.password,helperText:k.password,disabled:I,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(c.Z,{"aria-label":"toggle password visibility",onClick:()=>{Z(!v)},edge:"end",children:v?(0,n.jsx)(x.Z,{}):(0,n.jsx)(h.Z,{})})})}}),(0,n.jsx)(l.Z,{label:"Confirm Password",type:w?"text":"password",value:j,onChange:e=>y(e.target.value),error:!!k.confirmPassword,helperText:k.confirmPassword,disabled:I,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(c.Z,{"aria-label":"toggle password visibility",onClick:()=>{C(!w)},edge:"end",children:w?(0,n.jsx)(x.Z,{}):(0,n.jsx)(h.Z,{})})})}}),(0,n.jsx)(d.Z,{type:"submit",variant:"contained",color:"primary",disabled:I,fullWidth:!0,size:"large",children:I?"Creating account...":"Sign Up"})]})}var f=t(74228),g=t(93017),b=t(86702),j=t(88812),y=t(31317),v=t(25333),Z=t(69123),w=t(7178),C=t(17820),k=t(73424),S=t(25169),P=t(41094),z=t(78319);function I(){let e=(0,f.useRouter)(),{data:r,isPending:t}=(0,m.kP)(),[s,l]=(0,i.useState)(null),o=()=>{l(null)},x=async()=>{o(),await (0,m.w7)(),e.push("/login")};if(t)return(0,n.jsx)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)(g.Z,{size:24})});if(!(null==r?void 0:r.user))return(0,n.jsx)(d.Z,{variant:"contained",color:"primary",onClick:()=>{e.push("/login")},children:"Sign In"});let{user:h}=r,u=((e,r)=>{if(e){let r=e.split(" ");return r.length>=2?"".concat(r[0][0]).concat(r[1][0]).toUpperCase():e.substring(0,2).toUpperCase()}return r?r[0].toUpperCase():"?"})(h.name,h.email);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.Z,{onClick:e=>{l(e.currentTarget)},"aria-label":"user menu",children:(0,n.jsx)(b.Z,{sx:{bgcolor:"primary.main"},children:u})}),(0,n.jsxs)(j.Z,{anchorEl:s,open:!!s,onClose:o,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{mt:1},children:[(0,n.jsxs)(a.Z,{sx:{px:2,py:1.5,minWidth:200},children:[(0,n.jsx)(y.Z,{variant:"subtitle1",fontWeight:"600",children:h.name||"User"}),(0,n.jsx)(y.Z,{variant:"body2",color:"text.secondary",children:h.email}),"admin"===h.role&&(0,n.jsx)(v.Z,{label:"Admin",size:"small",color:"primary",sx:{mt:1}})]}),(0,n.jsx)(Z.Z,{}),"admin"===h.role&&(0,n.jsxs)(w.Z,{onClick:()=>{o(),e.push("/admin/users")},children:[(0,n.jsx)(C.Z,{children:(0,n.jsx)(S.Z,{fontSize:"small"})}),(0,n.jsx)(k.Z,{children:"Users"})]}),(0,n.jsxs)(w.Z,{onClick:()=>{o(),e.push("/settings")},children:[(0,n.jsx)(C.Z,{children:(0,n.jsx)(P.Z,{fontSize:"small"})}),(0,n.jsx)(k.Z,{children:"Settings"})]}),(0,n.jsxs)(w.Z,{onClick:x,children:[(0,n.jsx)(C.Z,{children:(0,n.jsx)(z.Z,{fontSize:"small"})}),(0,n.jsx)(k.Z,{children:"Logout"})]})]})]})}},3454:function(e,r,t){"use strict";t.d(r,{LoadingProvider:function(){return o},startLoading:function(){return c},stopLoading:function(){return d}});var n=t(94655),i=t(35106),a=t(74228),s=t(31477),l=t.n(s);function o(e){let{children:r}=e,t=(0,a.usePathname)(),s=(0,a.useSearchParams)();return(0,i.useEffect)(()=>{l().done()},[t,s]),(0,n.jsx)(n.Fragment,{children:r})}function c(){l().start()}function d(){l().done()}l().configure({showSpinner:!1,speed:300,minimum:.1})},8690:function(e,r,t){"use strict";t.d(r,{Av:function(){return n.startLoading}});var n=t(3454)},6986:function(e,r,t){"use strict";t.d(r,{Cp:function(){return h},Nq:function(){return x},cg:function(){return l},kP:function(){return d},w7:function(){return o},y1:function(){return c},zB:function(){return m}});var n=t(77054),i=t(61648),a=t(35016);let s=(0,n.X)({baseURL:a.env.NEXT_PUBLIC_BETTER_AUTH_URL||"",plugins:[(0,i.zB)()]}),{signIn:l,signOut:o,signUp:c,useSession:d,updateUser:x,changePassword:h}=s,m=s.admin}},function(e){e.O(0,[6812,9760,5004,7296,7436,1071,2542,55,2539,8347,9949,4240,212,3669,2757,1744],function(){return e(e.s=16387)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[781],{31809:function(e,n,a){Promise.resolve().then(a.bind(a,38538))},38538:function(e,n,a){"use strict";a.r(n),a.d(n,{default:function(){return ep}});var r=a(94655),l=a(35106),t=a(7281),s=a(31317),i=a(84840),o=a(33402),c=a(60097),d=a(29793),h=a(75726),x=a(62328),u=a(7178),p=a(69899),m=a(76492),j=a(35847),y=a(628),Z=a(41565),v=a(90158),b=a(58347),g=a(73424),f=a(69783),C=a(86702),w=a(79983),k=a(30417),S=a(25333),E=a(99770),P=a(62508),F=a(5682),I=a(65087),A=a(76678),O=a(97436),W=a(93017),D=a(81071),L=a(66561),N=a(12795),z=a(96407),B=a(69366),R=a(11597),T=a(81960),U=a(30114);function M(e){let{onPlayerKicked:n}=e,[a,i]=(0,l.useState)(!0),[o,c]=(0,l.useState)(null),[d,h]=(0,l.useState)([]),[x,u]=(0,l.useState)(!1),[p,m]=(0,l.useState)(null),[j,M]=(0,l.useState)(""),[_,K]=(0,l.useState)(!1),q=(0,l.useCallback)(async()=>{i(!0),c(null);try{let e=await fetch("/api/players");if(!e.ok)throw Error("Failed to fetch players");let n=await e.json();h(n.servers)}catch(e){c("Failed to load players"),console.error("Error fetching players:",e)}finally{i(!1)}},[]);(0,l.useEffect)(()=>{q()},[q]);let J=(e,n)=>{m({player:e,server:n}),M(""),u(!0)},G=async()=>{if(p){K(!0);try{if(!(await fetch("/api/players/kick",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({player:p.player.name,server:p.server,reason:j||"Kicked by administrator"})})).ok)throw Error("Failed to kick player");u(!1),m(null),null==n||n(p.player,p.server),await q()}catch(e){console.error("Error kicking player:",e)}finally{K(!1)}}},Y=d.some(e=>e.players.length>0);return(0,r.jsx)(y.Z,{"data-testid":"player-list",children:(0,r.jsxs)(Z.Z,{children:[(0,r.jsxs)(t.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,r.jsx)(s.Z,{variant:"h6",children:"Online Players"}),(0,r.jsx)(w.Z,{onClick:q,disabled:a,"aria-label":"Refresh",children:(0,r.jsx)(B.Z,{})})]}),a&&(0,r.jsx)(t.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,r.jsx)(W.Z,{})}),o&&(0,r.jsx)(D.Z,{severity:"error",sx:{mb:2},children:o}),!a&&!o&&!Y&&(0,r.jsx)(s.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No players online"}),!a&&!o&&Y&&(0,r.jsx)(t.Z,{children:d.map(e=>(0,r.jsxs)(L.Z,{defaultExpanded:e.players.length>0,children:[(0,r.jsx)(N.Z,{expandIcon:(0,r.jsx)(T.Z,{}),children:(0,r.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:2,width:"100%"},children:[(0,r.jsx)(s.Z,{variant:"subtitle1",sx:{fontWeight:500},children:e.name}),(0,r.jsx)(S.Z,{label:"".concat(e.players.length," player").concat(1!==e.players.length?"s":""),size:"small",color:e.players.length>0?"success":"default"})]})}),(0,r.jsx)(z.Z,{children:0===e.players.length?(0,r.jsx)(s.Z,{color:"text.secondary",sx:{fontStyle:"italic"},children:"No players online on this server"}):(0,r.jsx)(v.Z,{dense:!0,children:e.players.map(n=>(0,r.jsxs)(b.ZP,{secondaryAction:(0,r.jsx)(w.Z,{edge:"end","aria-label":"Kick player",onClick:()=>J(n,e.name),color:"error",children:(0,r.jsx)(R.Z,{})}),children:[(0,r.jsx)(f.Z,{children:(0,r.jsx)(C.Z,{src:"https://mc-heads.net/avatar/".concat(n.uuid,"/40"),alt:n.name,children:(0,r.jsx)(U.Z,{})})}),(0,r.jsx)(g.Z,{primary:n.name,secondary:n.uuid.substring(0,8)+"..."})]},n.uuid))})})]},e.name))}),(0,r.jsxs)(E.Z,{open:x,onClose:()=>u(!1),children:[(0,r.jsx)(P.Z,{children:"Kick Player"}),(0,r.jsxs)(F.Z,{children:[(0,r.jsxs)(I.Z,{children:["Are you sure you want to kick ",null==p?void 0:p.player.name," from ",null==p?void 0:p.server,"?"]}),(0,r.jsx)(O.Z,{autoFocus:!0,margin:"dense",label:"Reason (optional)",fullWidth:!0,variant:"outlined",value:j,onChange:e=>M(e.target.value),placeholder:"Kicked by administrator"})]}),(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(k.Z,{onClick:()=>u(!1),disabled:_,children:"Cancel"}),(0,r.jsx)(k.Z,{onClick:G,color:"error",variant:"contained",disabled:_,"aria-label":"Confirm kick",children:_?(0,r.jsx)(W.Z,{size:20}):"Confirm"})]})]})]})})}var _=a(70115),K=a(38393),q=a(52082),J=a(21111),G=a(47606),Y=a(42431),H=a(29114),$=a(92666);function Q(e){var n,a;let{serverName:i}=e,[o,c]=(0,l.useState)(""),[d,h]=(0,l.useState)(null),[x,u]=(0,l.useState)(!1),[p,m]=(0,l.useState)(""),[j,E]=(0,l.useState)(null),[P,F]=(0,l.useState)(""),{data:I,isLoading:A,error:L}=(0,$.ox)(i),{data:N}=(0,$.Yo)(i),z=(0,$.zF)(),B=(0,$.Ll)(),R=(0,$.S0)(),T=null!==(n=null==I?void 0:I.players)&&void 0!==n?n:[],M=null==I?void 0:I.source,Q=null!==(a=null==N?void 0:N.enabled)&&void 0!==a&&a,V=(0,l.useMemo)(()=>{if(!P.trim())return T;let e=P.toLowerCase();return T.filter(n=>n.name.toLowerCase().includes(e))},[T,P]),X=(null==L?void 0:L.message)||(B.error?"Failed to add player to whitelist":null)||(R.error&&!d?"Failed to remove player from whitelist":null)||(z.error?"Failed to update whitelist status":null),ee=()=>{o.trim()&&B.mutate({serverName:i,player:o.trim()},{onSuccess:()=>c("")})},en=e=>{h(e),R.mutate({serverName:i,player:e},{onSettled:()=>h(null)})},ea=async()=>{let e=p.split(/[,\n]/).map(e=>e.trim()).filter(Boolean);if(0===e.length)return;E(null);let n=0;for(let a of e)try{await B.mutateAsync({serverName:i,player:a}),n++}catch(e){}E("Added ".concat(n," of ").concat(e.length," players")),n>0&&m("")},er=B.isPending;return(0,r.jsx)(y.Z,{"data-testid":"whitelist-manager",children:(0,r.jsxs)(Z.Z,{children:[(0,r.jsxs)(_.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{mb:2},children:[(0,r.jsxs)(_.Z,{direction:"row",alignItems:"center",spacing:1,children:[(0,r.jsx)(s.Z,{variant:"h6",children:"Whitelist"}),(0,r.jsx)(S.Z,{label:Q?"ON":"OFF",color:Q?"success":"default",size:"small","data-testid":"whitelist-status-chip"})]}),(0,r.jsx)(K.Z,{checked:Q,onChange:()=>{z.mutate({serverName:i,enabled:!Q})},disabled:z.isPending,inputProps:{"aria-label":"Toggle whitelist"},"data-testid":"whitelist-toggle"})]}),X&&(0,r.jsx)(D.Z,{severity:"error",sx:{mb:2},children:X}),!A&&M&&"rcon"!==M&&(0,r.jsxs)(D.Z,{severity:"info",sx:{mb:2},children:["Server is offline. Showing data from ","config"===M?"config.env":"whitelist.json",". Changes will apply on next server start."]}),(0,r.jsxs)(_.Z,{direction:"row",spacing:1,alignItems:"flex-start",sx:{mb:2},children:[x?(0,r.jsxs)(t.Z,{sx:{flex:1},children:[(0,r.jsx)(O.Z,{size:"small",placeholder:"player1, player2, player3",value:p,onChange:e=>m(e.target.value),disabled:er,fullWidth:!0,multiline:!0,rows:3,"data-testid":"bulk-input"}),j&&(0,r.jsx)(D.Z,{severity:"info",sx:{mt:1},"data-testid":"bulk-result",children:j})]}):(0,r.jsx)(O.Z,{size:"small",placeholder:"Player name",value:o,onChange:e=>c(e.target.value),onKeyDown:e=>{"Enter"===e.key&&ee()},disabled:er,fullWidth:!0}),x?(0,r.jsx)(k.Z,{variant:"contained",onClick:ea,disabled:!p.trim()||er,startIcon:er?(0,r.jsx)(W.Z,{size:16}):(0,r.jsx)(H.Z,{}),"aria-label":"Add players in bulk",children:"Add All"}):(0,r.jsx)(k.Z,{variant:"contained",onClick:ee,disabled:!o.trim()||er,startIcon:er?(0,r.jsx)(W.Z,{size:16}):(0,r.jsx)(G.Z,{}),"aria-label":"Add player to whitelist",children:"Add"}),(0,r.jsx)(k.Z,{variant:x?"contained":"outlined",onClick:()=>{u(!x),E(null)},"aria-label":"Toggle bulk mode","data-testid":"bulk-toggle",sx:{whiteSpace:"nowrap"},children:"Bulk"})]}),T.length>=5&&(0,r.jsx)(O.Z,{size:"small",placeholder:"Search players...",value:P,onChange:e=>F(e.target.value),fullWidth:!0,sx:{mb:2},InputProps:{startAdornment:(0,r.jsx)(q.Z,{position:"start",children:(0,r.jsx)(Y.Z,{})})},"data-testid":"search-input"}),A&&(0,r.jsx)(t.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,r.jsx)(W.Z,{})}),!A&&0===T.length&&(0,r.jsx)(s.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No players whitelisted"}),!A&&T.length>0&&0===V.length&&(0,r.jsx)(s.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},"data-testid":"no-match-message",children:"No matching players"}),!A&&V.length>0&&(0,r.jsx)(v.Z,{dense:!0,children:V.map(e=>(0,r.jsxs)(b.ZP,{secondaryAction:(0,r.jsx)(w.Z,{edge:"end","aria-label":"Remove from whitelist",onClick:()=>en(e.name),disabled:d===e.name,color:"error",children:d===e.name?(0,r.jsx)(W.Z,{size:20}):(0,r.jsx)(J.Z,{})}),children:[(0,r.jsx)(f.Z,{children:(0,r.jsx)(C.Z,{src:e.uuid?"https://mc-heads.net/avatar/".concat(e.uuid,"/40"):void 0,alt:e.name,children:(0,r.jsx)(U.Z,{})})}),(0,r.jsx)(g.Z,{primary:e.name,secondary:e.uuid?e.uuid.substring(0,8)+"...":"UUID not available"})]},e.uuid||e.name))})]})})}var V=a(88812),X=a(37809),ee=a(407),en=a(45813);let ea={1:{color:"info",label:"Moderator",icon:"\uD83D\uDEE1️"},2:{color:"success",label:"Gamemaster",icon:"\uD83C\uDFAE"},3:{color:"warning",label:"Admin",icon:"⚙️"},4:{color:"error",label:"Owner",icon:"\uD83D\uDC51"}};function er(e){let{level:n,showIcon:a=!1,compact:l=!1,size:s="medium",variant:i="filled"}=e,o=ea[n];if(!o)return null;let c=l?n.toString():"Level ".concat(n," - ").concat(o.label),d=a?(0,r.jsx)(t.Z,{component:"span",sx:{mr:.5},children:o.icon}):void 0;return(0,r.jsx)(S.Z,{label:(0,r.jsxs)(r.Fragment,{children:[d,c]}),color:o.color,size:s,variant:i})}var el=a(68038),et=a(34080),es=a(40064),ei=a(39181);let eo=[{value:1,label:"Level 1 - Moderator",description:"Bypass spawn protection",icon:"\uD83D\uDEE1️"},{value:2,label:"Level 2 - Gamemaster",description:"Cheats, command blocks",icon:"\uD83C\uDFAE"},{value:3,label:"Level 3 - Admin",description:"Player management commands",icon:"⚙️"},{value:4,label:"Level 4 - Owner",description:"Full server control",icon:"\uD83D\uDC51"}];function ec(e){let{value:n,onChange:a,label:l,disabled:i=!1}=e;return(0,r.jsxs)(d.Z,{component:"fieldset",fullWidth:!0,disabled:i,children:[l&&(0,r.jsx)(el.Z,{component:"legend",sx:{mb:1},children:l}),(0,r.jsx)(et.Z,{value:n,onChange:e=>{a(parseInt(e.target.value,10))},children:eo.map(e=>(0,r.jsx)(es.Z,{value:e.value,control:(0,r.jsx)(ei.Z,{}),label:(0,r.jsxs)(t.Z,{children:[(0,r.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,r.jsx)(s.Z,{component:"span",children:e.icon}),(0,r.jsx)(s.Z,{component:"span",fontWeight:"medium",children:e.label})]}),(0,r.jsx)(s.Z,{variant:"body2",color:"text.secondary",sx:{ml:4},children:e.description})]}),sx:{alignItems:"flex-start",py:1}},e.value))})]})}function ed(e){let{serverName:n}=e,[a,i]=(0,l.useState)(!0),[o,c]=(0,l.useState)(null),[d,h]=(0,l.useState)([]),[x,p]=(0,l.useState)(),[m,j]=(0,l.useState)(""),[S,I]=(0,l.useState)(!1),[L,N]=(0,l.useState)(null),[z,B]=(0,l.useState)(!1),[R,T]=(0,l.useState)(4),[U,M]=(0,l.useState)(!1),[_,K]=(0,l.useState)(null),[q,Y]=(0,l.useState)(4),[H,$]=(0,l.useState)(!1),[Q,ea]=(0,l.useState)(null),[el,et]=(0,l.useState)(null),es=(0,l.useCallback)(async()=>{i(!0),c(null);try{let e=await fetch("/api/players/op?server=".concat(encodeURIComponent(n)));if(!e.ok)throw Error("Failed to fetch operators");let a=await e.json();h(a.operators),p(a.source)}catch(e){c("Failed to load operators"),console.error("Error fetching operators:",e)}finally{i(!1)}},[n]);(0,l.useEffect)(()=>{es()},[es]);let ei=async()=>{if(m.trim()){I(!0),c(null);try{if(!(await fetch("/api/players/op",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({player:m.trim(),server:n,level:R})})).ok)throw Error("Failed to add operator");j(""),T(4),B(!1),await es()}catch(e){c("Failed to add operator"),console.error("Error adding operator:",e)}finally{I(!1)}}},eo=async e=>{N(e),c(null),ea(null),et(null);try{if(!(await fetch("/api/players/op?player=".concat(encodeURIComponent(e),"&server=").concat(encodeURIComponent(n)),{method:"DELETE"})).ok)throw Error("Failed to remove operator");await es()}catch(e){c("Failed to remove operator"),console.error("Error removing operator:",e)}finally{N(null)}},ed=async()=>{if(_){$(!0),c(null);try{if(!(await fetch("/api/players/op/".concat(encodeURIComponent(_.name),"?server=").concat(encodeURIComponent(n)),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({level:q})})).ok)throw Error("Failed to change operator level");M(!1),K(null),await es()}catch(e){c("Failed to change operator level"),console.error("Error changing operator level:",e)}finally{$(!1)}}},eh=(e,n)=>{ea(e.currentTarget),et(n)},ex=()=>{ea(null),et(null)};return(0,r.jsxs)(y.Z,{"data-testid":"op-manager",children:[(0,r.jsxs)(Z.Z,{children:[(0,r.jsx)(s.Z,{variant:"h6",gutterBottom:!0,children:"Operators"}),o&&(0,r.jsx)(D.Z,{severity:"error",sx:{mb:2},children:o}),!a&&x&&"rcon"!==x&&(0,r.jsxs)(D.Z,{severity:"info",sx:{mb:2},children:["Server is offline. Showing data from ","config"===x?"config.env":"ops.json",". Changes will apply on next server start."]}),(0,r.jsx)(t.Z,{sx:{mb:2},children:(0,r.jsx)(k.Z,{variant:"contained",onClick:()=>B(!0),startIcon:(0,r.jsx)(G.Z,{}),"aria-label":"Add operator",fullWidth:!0,children:"Add Operator"})}),a&&(0,r.jsx)(t.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,r.jsx)(W.Z,{})}),!a&&0===d.length&&(0,r.jsx)(s.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No operators configured"}),!a&&d.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(v.Z,{dense:!0,children:d.map(e=>(0,r.jsxs)(b.ZP,{secondaryAction:(0,r.jsx)(w.Z,{edge:"end","aria-label":"Operator actions",onClick:n=>eh(n,e),disabled:L===e.name,children:L===e.name?(0,r.jsx)(W.Z,{size:20}):(0,r.jsx)(X.Z,{})}),children:[(0,r.jsx)(f.Z,{children:(0,r.jsx)(C.Z,{src:e.uuid?"https://mc-heads.net/avatar/".concat(e.uuid,"/40"):void 0,alt:e.name,sx:{bgcolor:"warning.main"},children:(0,r.jsx)(ee.Z,{})})}),(0,r.jsx)(g.Z,{primary:(0,r.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[(0,r.jsx)(s.Z,{component:"span",children:e.name}),(0,r.jsx)(er,{level:e.level,showIcon:!0,size:"small"})]}),secondary:e.uuid?e.uuid.substring(0,8)+"...":"UUID not available"})]},e.uuid||e.name))}),(0,r.jsxs)(V.Z,{anchorEl:Q,open:!!Q,onClose:ex,children:[(0,r.jsxs)(u.Z,{onClick:()=>{el&&(K(el),Y(el.level),M(!0),ex())},children:[(0,r.jsx)(en.Z,{sx:{mr:1},fontSize:"small"}),"Change Level"]}),(0,r.jsxs)(u.Z,{onClick:()=>el&&eo(el.name),children:[(0,r.jsx)(J.Z,{sx:{mr:1},fontSize:"small",color:"error"}),"Remove OP"]})]})]})]}),(0,r.jsxs)(E.Z,{open:z,onClose:()=>!S&&B(!1),maxWidth:"sm",fullWidth:!0,children:[(0,r.jsx)(P.Z,{children:"Add Operator"}),(0,r.jsxs)(F.Z,{children:[(0,r.jsx)(O.Z,{autoFocus:!0,margin:"dense",label:"Player Name",placeholder:"Enter player name",fullWidth:!0,value:m,onChange:e=>j(e.target.value),disabled:S,sx:{mb:2}}),(0,r.jsx)(ec,{value:R,onChange:T,label:"OP Level",disabled:S})]}),(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(k.Z,{onClick:()=>B(!1),disabled:S,children:"Cancel"}),(0,r.jsx)(k.Z,{variant:"contained",onClick:ei,disabled:!m.trim()||S,startIcon:S?(0,r.jsx)(W.Z,{size:16}):void 0,children:S?"Adding...":"Add OP"})]})]}),(0,r.jsxs)(E.Z,{open:U,onClose:()=>!H&&M(!1),maxWidth:"sm",fullWidth:!0,children:[(0,r.jsxs)(P.Z,{children:["Change OP Level - ",null==_?void 0:_.name]}),(0,r.jsx)(F.Z,{children:_&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:["Current: Level ",_.level," (",_.role,")"]}),(0,r.jsx)(ec,{value:q,onChange:Y,label:"New Level",disabled:H})]})}),(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(k.Z,{onClick:()=>M(!1),disabled:H,children:"Cancel"}),(0,r.jsx)(k.Z,{variant:"contained",onClick:ed,disabled:H||q===(null==_?void 0:_.level),startIcon:H?(0,r.jsx)(W.Z,{size:16}):void 0,children:H?"Saving...":"Save Changes"})]})]})]})}var eh=a(397);function ex(e){let{serverName:n}=e,[a,i]=(0,l.useState)(!0),[o,c]=(0,l.useState)(null),[d,h]=(0,l.useState)([]),[x,u]=(0,l.useState)(),[p,m]=(0,l.useState)(!1),[j,S]=(0,l.useState)({player:"",reason:""}),[I,L]=(0,l.useState)(!1),[N,z]=(0,l.useState)(null),B=(0,l.useCallback)(async()=>{i(!0),c(null);try{let e=await fetch("/api/players/ban?server=".concat(encodeURIComponent(n)));if(!e.ok)throw Error("Failed to fetch bans");let a=await e.json();h(a.players),u(a.source)}catch(e){c("Failed to load ban list"),console.error("Error fetching bans:",e)}finally{i(!1)}},[n]);(0,l.useEffect)(()=>{B()},[B]);let R=()=>{m(!1),S({player:"",reason:""})},T=async()=>{if(j.player.trim()){L(!0),c(null);try{if(!(await fetch("/api/players/ban",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({player:j.player.trim(),reason:j.reason.trim()||"Banned by administrator",server:n})})).ok)throw Error("Failed to ban player");R(),await B()}catch(e){c("Failed to ban player"),console.error("Error banning player:",e)}finally{L(!1)}}},M=async e=>{z(e),c(null);try{if(!(await fetch("/api/players/ban?player=".concat(encodeURIComponent(e),"&server=").concat(encodeURIComponent(n)),{method:"DELETE"})).ok)throw Error("Failed to unban player");await B()}catch(e){c("Failed to unban player"),console.error("Error unbanning player:",e)}finally{z(null)}},K=e=>{try{return new Date(e).toLocaleDateString()}catch(n){return e}};return(0,r.jsx)(y.Z,{"data-testid":"ban-manager",children:(0,r.jsxs)(Z.Z,{children:[(0,r.jsxs)(t.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,r.jsx)(s.Z,{variant:"h6",children:"Ban List"}),(0,r.jsx)(k.Z,{variant:"outlined",color:"error",startIcon:(0,r.jsx)(eh.Z,{}),onClick:()=>{S({player:"",reason:""}),m(!0)},"aria-label":"Ban player",children:"Ban Player"})]}),o&&(0,r.jsx)(D.Z,{severity:"error",sx:{mb:2},children:o}),!a&&x&&"rcon"!==x&&(0,r.jsxs)(D.Z,{severity:"info",sx:{mb:2},children:["Server is offline. Showing data from ","config"===x?"config.env":"banned-players.json",". Changes will apply on next server start."]}),a&&(0,r.jsx)(t.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,r.jsx)(W.Z,{})}),!a&&0===d.length&&(0,r.jsx)(s.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No players banned"}),!a&&d.length>0&&(0,r.jsx)(v.Z,{dense:!0,children:d.map(e=>(0,r.jsxs)(b.ZP,{secondaryAction:(0,r.jsx)(w.Z,{edge:"end","aria-label":"Unban player",onClick:()=>M(e.name),disabled:N===e.name,color:"success",children:N===e.name?(0,r.jsx)(W.Z,{size:20}):(0,r.jsx)(J.Z,{})}),children:[(0,r.jsx)(f.Z,{children:(0,r.jsx)(C.Z,{src:e.uuid?"https://mc-heads.net/avatar/".concat(e.uuid,"/40"):void 0,alt:e.name,sx:{bgcolor:"error.main"},children:(0,r.jsx)(U.Z,{})})}),(0,r.jsx)(g.Z,{primary:e.name,secondary:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.Z,{component:"span",variant:"body2",color:"text.secondary",children:["Reason: ",e.reason||"No reason specified"]}),(0,r.jsx)("br",{}),(0,r.jsxs)(s.Z,{component:"span",variant:"caption",color:"text.secondary",children:["Banned: ",K(e.created)," by ",e.source||"Unknown"]})]})})]},e.uuid||e.name))}),(0,r.jsxs)(E.Z,{open:p,onClose:R,maxWidth:"sm",fullWidth:!0,children:[(0,r.jsx)(P.Z,{children:"Ban Player"}),(0,r.jsx)(F.Z,{children:(0,r.jsxs)(_.Z,{spacing:2,sx:{mt:1},children:[(0,r.jsx)(O.Z,{label:"Player Name",placeholder:"Enter player name",value:j.player,onChange:e=>S({...j,player:e.target.value}),fullWidth:!0,required:!0}),(0,r.jsx)(O.Z,{label:"Reason",placeholder:"Banned by administrator",value:j.reason,onChange:e=>S({...j,reason:e.target.value}),fullWidth:!0,multiline:!0,rows:2})]})}),(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(k.Z,{onClick:R,disabled:I,children:"Cancel"}),(0,r.jsx)(k.Z,{onClick:T,color:"error",variant:"contained",disabled:!j.player.trim()||I,startIcon:I?(0,r.jsx)(W.Z,{size:16}):(0,r.jsx)(eh.Z,{}),children:"Ban"})]})]})]})})}function eu(e){let{children:n,value:a,index:l}=e;return(0,r.jsx)("div",{role:"tabpanel",hidden:a!==l,children:a===l&&(0,r.jsx)(t.Z,{sx:{py:3},children:n})})}function ep(){let[e,n]=(0,l.useState)(0),[a,y]=(0,l.useState)(""),{data:Z,isLoading:v}=(0,$.x$)(),b=null==Z?void 0:Z.servers;return(0,l.useEffect)(()=>{!a&&b&&b.length>0&&y(b[0].name)},[b,a]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,m.Fq)(e.palette.info.main,.1)," 0%, ").concat((0,m.Fq)(e.palette.secondary.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,m.Fq)(e.palette.info.main,.2))},children:(0,r.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,r.jsx)(t.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"info.main",color:"info.contrastText"},children:(0,r.jsx)(j.Z,{sx:{fontSize:32}})}),(0,r.jsxs)(t.Z,{children:[(0,r.jsx)(s.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Player Management"}),(0,r.jsx)(s.Z,{variant:"body1",color:"text.secondary",children:"Manage players, whitelist, operators, and bans across your servers"})]})]})}),(0,r.jsx)(t.Z,{sx:{mb:3},children:(0,r.jsxs)(d.Z,{sx:{minWidth:200},children:[(0,r.jsx)(h.Z,{id:"server-select-label",children:"Server"}),(0,r.jsx)(x.Z,{labelId:"server-select-label",value:a,label:"Server",onChange:e=>y(e.target.value),disabled:v,children:null==b?void 0:b.map(e=>(0,r.jsx)(u.Z,{value:e.name,children:e.name},e.name))})]})}),(0,r.jsx)(t.Z,{sx:{borderBottom:1,borderColor:"divider"},children:(0,r.jsxs)(o.Z,{value:e,onChange:(e,a)=>{n(a)},"aria-label":"Player management tabs",children:[(0,r.jsx)(c.Z,{label:"Online Players"}),(0,r.jsx)(c.Z,{label:"Whitelist",disabled:!a}),(0,r.jsx)(c.Z,{label:"Operators",disabled:!a}),(0,r.jsx)(c.Z,{label:"Ban List",disabled:!a})]})}),(0,r.jsx)(eu,{value:e,index:0,children:(0,r.jsx)(M,{})}),(0,r.jsx)(eu,{value:e,index:1,children:a&&(0,r.jsxs)(i.ZP,{container:!0,spacing:3,children:[(0,r.jsx)(i.ZP,{item:!0,xs:12,md:8,children:(0,r.jsx)(Q,{serverName:a})}),(0,r.jsx)(i.ZP,{item:!0,xs:12,md:4,children:(0,r.jsxs)(t.Z,{sx:{p:2,bgcolor:"background.paper",borderRadius:1},children:[(0,r.jsx)(s.Z,{variant:"subtitle2",color:"text.secondary",gutterBottom:!0,children:"About Whitelist"}),(0,r.jsx)(s.Z,{variant:"body2",color:"text.secondary",children:"The whitelist controls which players can join your server. When enabled, only players on the whitelist can connect. Add players by their Minecraft username."})]})})]})}),(0,r.jsx)(eu,{value:e,index:2,children:a&&(0,r.jsxs)(i.ZP,{container:!0,spacing:3,children:[(0,r.jsx)(i.ZP,{item:!0,xs:12,md:8,children:(0,r.jsx)(ed,{serverName:a})}),(0,r.jsx)(i.ZP,{item:!0,xs:12,md:4,children:(0,r.jsxs)(t.Z,{sx:{p:2,bgcolor:"background.paper",borderRadius:1},children:[(0,r.jsx)(s.Z,{variant:"subtitle2",color:"text.secondary",gutterBottom:!0,children:"About Operators"}),(0,r.jsx)(s.Z,{variant:"body2",color:"text.secondary",children:"Operators (OPs) have elevated permissions on the server. They can use commands like /give, /gamemode, /tp, and more. OP levels range from 1-4, with 4 being the highest."}),(0,r.jsxs)(t.Z,{sx:{mt:2},children:[(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 1: Can bypass spawn protection"}),(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 2: Can use /clear, /gamemode, etc."}),(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 3: Can use /ban, /kick, /op, etc."}),(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 4: Can use /stop, full access"})]})]})})]})}),(0,r.jsx)(eu,{value:e,index:3,children:a&&(0,r.jsxs)(i.ZP,{container:!0,spacing:3,children:[(0,r.jsx)(i.ZP,{item:!0,xs:12,md:8,children:(0,r.jsx)(ex,{serverName:a})}),(0,r.jsx)(i.ZP,{item:!0,xs:12,md:4,children:(0,r.jsxs)(t.Z,{sx:{p:2,bgcolor:"background.paper",borderRadius:1},children:[(0,r.jsx)(s.Z,{variant:"subtitle2",color:"text.secondary",gutterBottom:!0,children:"About Bans"}),(0,r.jsx)(s.Z,{variant:"body2",color:"text.secondary",children:"Banned players cannot connect to your server. You can ban players by username and provide an optional reason. Bans can be removed (pardoned) at any time."})]})})]})})]})}}},function(e){e.O(0,[6812,9760,5004,7296,7436,1071,540,4416,2538,880,7727,8347,1658,5381,4187,4219,392,2666,3669,2757,1744],function(){return e(e.s=31809)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[781],{31809:function(e,n,a){Promise.resolve().then(a.bind(a,38538))},38538:function(e,n,a){"use strict";a.r(n),a.d(n,{default:function(){return ep}});var r=a(94655),l=a(35106),t=a(7281),s=a(31317),i=a(84840),o=a(33402),c=a(60097),d=a(29793),h=a(75726),x=a(62328),u=a(7178),p=a(69899),m=a(76492),j=a(35847),y=a(628),Z=a(41565),v=a(90158),b=a(58347),g=a(73424),f=a(69783),C=a(86702),w=a(79983),k=a(30417),S=a(25333),E=a(99770),P=a(62508),F=a(5682),I=a(65087),A=a(76678),O=a(97436),W=a(93017),D=a(81071),L=a(66561),N=a(12795),z=a(96407),B=a(69366),R=a(11597),T=a(81960),U=a(30114);function M(e){let{onPlayerKicked:n}=e,[a,i]=(0,l.useState)(!0),[o,c]=(0,l.useState)(null),[d,h]=(0,l.useState)([]),[x,u]=(0,l.useState)(!1),[p,m]=(0,l.useState)(null),[j,M]=(0,l.useState)(""),[_,K]=(0,l.useState)(!1),q=(0,l.useCallback)(async()=>{i(!0),c(null);try{let e=await fetch("/api/players");if(!e.ok)throw Error("Failed to fetch players");let n=await e.json();h(n.servers)}catch(e){c("Failed to load players"),console.error("Error fetching players:",e)}finally{i(!1)}},[]);(0,l.useEffect)(()=>{q()},[q]);let J=(e,n)=>{m({player:e,server:n}),M(""),u(!0)},G=async()=>{if(p){K(!0);try{if(!(await fetch("/api/players/kick",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({player:p.player.name,server:p.server,reason:j||"Kicked by administrator"})})).ok)throw Error("Failed to kick player");u(!1),m(null),null==n||n(p.player,p.server),await q()}catch(e){console.error("Error kicking player:",e)}finally{K(!1)}}},Y=d.some(e=>e.players.length>0);return(0,r.jsx)(y.Z,{"data-testid":"player-list",children:(0,r.jsxs)(Z.Z,{children:[(0,r.jsxs)(t.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,r.jsx)(s.Z,{variant:"h6",children:"Online Players"}),(0,r.jsx)(w.Z,{onClick:q,disabled:a,"aria-label":"Refresh",children:(0,r.jsx)(B.Z,{})})]}),a&&(0,r.jsx)(t.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,r.jsx)(W.Z,{})}),o&&(0,r.jsx)(D.Z,{severity:"error",sx:{mb:2},children:o}),!a&&!o&&!Y&&(0,r.jsx)(s.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No players online"}),!a&&!o&&Y&&(0,r.jsx)(t.Z,{children:d.map(e=>(0,r.jsxs)(L.Z,{defaultExpanded:e.players.length>0,children:[(0,r.jsx)(N.Z,{expandIcon:(0,r.jsx)(T.Z,{}),children:(0,r.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:2,width:"100%"},children:[(0,r.jsx)(s.Z,{variant:"subtitle1",sx:{fontWeight:500},children:e.name}),(0,r.jsx)(S.Z,{label:"".concat(e.players.length," player").concat(1!==e.players.length?"s":""),size:"small",color:e.players.length>0?"success":"default"})]})}),(0,r.jsx)(z.Z,{children:0===e.players.length?(0,r.jsx)(s.Z,{color:"text.secondary",sx:{fontStyle:"italic"},children:"No players online on this server"}):(0,r.jsx)(v.Z,{dense:!0,children:e.players.map(n=>(0,r.jsxs)(b.ZP,{secondaryAction:(0,r.jsx)(w.Z,{edge:"end","aria-label":"Kick player",onClick:()=>J(n,e.name),color:"error",children:(0,r.jsx)(R.Z,{})}),children:[(0,r.jsx)(f.Z,{children:(0,r.jsx)(C.Z,{src:"https://mc-heads.net/avatar/".concat(n.uuid,"/40"),alt:n.name,children:(0,r.jsx)(U.Z,{})})}),(0,r.jsx)(g.Z,{primary:n.name,secondary:n.uuid.substring(0,8)+"..."})]},n.uuid))})})]},e.name))}),(0,r.jsxs)(E.Z,{open:x,onClose:()=>u(!1),children:[(0,r.jsx)(P.Z,{children:"Kick Player"}),(0,r.jsxs)(F.Z,{children:[(0,r.jsxs)(I.Z,{children:["Are you sure you want to kick ",null==p?void 0:p.player.name," from ",null==p?void 0:p.server,"?"]}),(0,r.jsx)(O.Z,{autoFocus:!0,margin:"dense",label:"Reason (optional)",fullWidth:!0,variant:"outlined",value:j,onChange:e=>M(e.target.value),placeholder:"Kicked by administrator"})]}),(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(k.Z,{onClick:()=>u(!1),disabled:_,children:"Cancel"}),(0,r.jsx)(k.Z,{onClick:G,color:"error",variant:"contained",disabled:_,"aria-label":"Confirm kick",children:_?(0,r.jsx)(W.Z,{size:20}):"Confirm"})]})]})]})})}var _=a(70115),K=a(38393),q=a(52082),J=a(21111),G=a(47606),Y=a(42431),H=a(29114),$=a(92666);function Q(e){var n,a;let{serverName:i}=e,[o,c]=(0,l.useState)(""),[d,h]=(0,l.useState)(null),[x,u]=(0,l.useState)(!1),[p,m]=(0,l.useState)(""),[j,E]=(0,l.useState)(null),[P,F]=(0,l.useState)(""),{data:I,isLoading:A,error:L}=(0,$.ox)(i),{data:N}=(0,$.Yo)(i),z=(0,$.zF)(),B=(0,$.Ll)(),R=(0,$.S0)(),T=null!==(n=null==I?void 0:I.players)&&void 0!==n?n:[],M=null==I?void 0:I.source,Q=null!==(a=null==N?void 0:N.enabled)&&void 0!==a&&a,V=(0,l.useMemo)(()=>{if(!P.trim())return T;let e=P.toLowerCase();return T.filter(n=>n.name.toLowerCase().includes(e))},[T,P]),X=(null==L?void 0:L.message)||(B.error?"Failed to add player to whitelist":null)||(R.error&&!d?"Failed to remove player from whitelist":null)||(z.error?"Failed to update whitelist status":null),ee=()=>{o.trim()&&B.mutate({serverName:i,player:o.trim()},{onSuccess:()=>c("")})},en=e=>{h(e),R.mutate({serverName:i,player:e},{onSettled:()=>h(null)})},ea=async()=>{let e=p.split(/[,\n]/).map(e=>e.trim()).filter(Boolean);if(0===e.length)return;E(null);let n=0;for(let a of e)try{await B.mutateAsync({serverName:i,player:a}),n++}catch(e){}E("Added ".concat(n," of ").concat(e.length," players")),n>0&&m("")},er=B.isPending;return(0,r.jsx)(y.Z,{"data-testid":"whitelist-manager",children:(0,r.jsxs)(Z.Z,{children:[(0,r.jsxs)(_.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{mb:2},children:[(0,r.jsxs)(_.Z,{direction:"row",alignItems:"center",spacing:1,children:[(0,r.jsx)(s.Z,{variant:"h6",children:"Whitelist"}),(0,r.jsx)(S.Z,{label:Q?"ON":"OFF",color:Q?"success":"default",size:"small","data-testid":"whitelist-status-chip"})]}),(0,r.jsx)(K.Z,{checked:Q,onChange:()=>{z.mutate({serverName:i,enabled:!Q})},disabled:z.isPending,inputProps:{"aria-label":"Toggle whitelist"},"data-testid":"whitelist-toggle"})]}),X&&(0,r.jsx)(D.Z,{severity:"error",sx:{mb:2},children:X}),!A&&M&&"rcon"!==M&&(0,r.jsxs)(D.Z,{severity:"info",sx:{mb:2},children:["Server is offline. Showing data from ","config"===M?"config.env":"whitelist.json",". Changes will apply on next server start."]}),(0,r.jsxs)(_.Z,{direction:"row",spacing:1,alignItems:"flex-start",sx:{mb:2},children:[x?(0,r.jsxs)(t.Z,{sx:{flex:1},children:[(0,r.jsx)(O.Z,{size:"small",placeholder:"player1, player2, player3",value:p,onChange:e=>m(e.target.value),disabled:er,fullWidth:!0,multiline:!0,rows:3,"data-testid":"bulk-input"}),j&&(0,r.jsx)(D.Z,{severity:"info",sx:{mt:1},"data-testid":"bulk-result",children:j})]}):(0,r.jsx)(O.Z,{size:"small",placeholder:"Player name",value:o,onChange:e=>c(e.target.value),onKeyDown:e=>{"Enter"===e.key&&ee()},disabled:er,fullWidth:!0}),x?(0,r.jsx)(k.Z,{variant:"contained",onClick:ea,disabled:!p.trim()||er,startIcon:er?(0,r.jsx)(W.Z,{size:16}):(0,r.jsx)(H.Z,{}),"aria-label":"Add players in bulk",children:"Add All"}):(0,r.jsx)(k.Z,{variant:"contained",onClick:ee,disabled:!o.trim()||er,startIcon:er?(0,r.jsx)(W.Z,{size:16}):(0,r.jsx)(G.Z,{}),"aria-label":"Add player to whitelist",children:"Add"}),(0,r.jsx)(k.Z,{variant:x?"contained":"outlined",onClick:()=>{u(!x),E(null)},"aria-label":"Toggle bulk mode","data-testid":"bulk-toggle",sx:{whiteSpace:"nowrap"},children:"Bulk"})]}),T.length>=5&&(0,r.jsx)(O.Z,{size:"small",placeholder:"Search players...",value:P,onChange:e=>F(e.target.value),fullWidth:!0,sx:{mb:2},InputProps:{startAdornment:(0,r.jsx)(q.Z,{position:"start",children:(0,r.jsx)(Y.Z,{})})},"data-testid":"search-input"}),A&&(0,r.jsx)(t.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,r.jsx)(W.Z,{})}),!A&&0===T.length&&(0,r.jsx)(s.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No players whitelisted"}),!A&&T.length>0&&0===V.length&&(0,r.jsx)(s.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},"data-testid":"no-match-message",children:"No matching players"}),!A&&V.length>0&&(0,r.jsx)(v.Z,{dense:!0,children:V.map(e=>(0,r.jsxs)(b.ZP,{secondaryAction:(0,r.jsx)(w.Z,{edge:"end","aria-label":"Remove from whitelist",onClick:()=>en(e.name),disabled:d===e.name,color:"error",children:d===e.name?(0,r.jsx)(W.Z,{size:20}):(0,r.jsx)(J.Z,{})}),children:[(0,r.jsx)(f.Z,{children:(0,r.jsx)(C.Z,{src:e.uuid?"https://mc-heads.net/avatar/".concat(e.uuid,"/40"):void 0,alt:e.name,children:(0,r.jsx)(U.Z,{})})}),(0,r.jsx)(g.Z,{primary:e.name,secondary:e.uuid?e.uuid.substring(0,8)+"...":"UUID not available"})]},e.uuid||e.name))})]})})}var V=a(88812),X=a(37809),ee=a(407),en=a(45813);let ea={1:{color:"info",label:"Moderator",icon:"\uD83D\uDEE1️"},2:{color:"success",label:"Gamemaster",icon:"\uD83C\uDFAE"},3:{color:"warning",label:"Admin",icon:"⚙️"},4:{color:"error",label:"Owner",icon:"\uD83D\uDC51"}};function er(e){let{level:n,showIcon:a=!1,compact:l=!1,size:s="medium",variant:i="filled"}=e,o=ea[n];if(!o)return null;let c=l?n.toString():"Level ".concat(n," - ").concat(o.label),d=a?(0,r.jsx)(t.Z,{component:"span",sx:{mr:.5},children:o.icon}):void 0;return(0,r.jsx)(S.Z,{label:(0,r.jsxs)(r.Fragment,{children:[d,c]}),color:o.color,size:s,variant:i})}var el=a(68038),et=a(34080),es=a(40064),ei=a(39181);let eo=[{value:1,label:"Level 1 - Moderator",description:"Bypass spawn protection",icon:"\uD83D\uDEE1️"},{value:2,label:"Level 2 - Gamemaster",description:"Cheats, command blocks",icon:"\uD83C\uDFAE"},{value:3,label:"Level 3 - Admin",description:"Player management commands",icon:"⚙️"},{value:4,label:"Level 4 - Owner",description:"Full server control",icon:"\uD83D\uDC51"}];function ec(e){let{value:n,onChange:a,label:l,disabled:i=!1}=e;return(0,r.jsxs)(d.Z,{component:"fieldset",fullWidth:!0,disabled:i,children:[l&&(0,r.jsx)(el.Z,{component:"legend",sx:{mb:1},children:l}),(0,r.jsx)(et.Z,{value:n,onChange:e=>{a(parseInt(e.target.value,10))},children:eo.map(e=>(0,r.jsx)(es.Z,{value:e.value,control:(0,r.jsx)(ei.Z,{}),label:(0,r.jsxs)(t.Z,{children:[(0,r.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,r.jsx)(s.Z,{component:"span",children:e.icon}),(0,r.jsx)(s.Z,{component:"span",fontWeight:"medium",children:e.label})]}),(0,r.jsx)(s.Z,{variant:"body2",color:"text.secondary",sx:{ml:4},children:e.description})]}),sx:{alignItems:"flex-start",py:1}},e.value))})]})}function ed(e){let{serverName:n}=e,[a,i]=(0,l.useState)(!0),[o,c]=(0,l.useState)(null),[d,h]=(0,l.useState)([]),[x,p]=(0,l.useState)(),[m,j]=(0,l.useState)(""),[S,I]=(0,l.useState)(!1),[L,N]=(0,l.useState)(null),[z,B]=(0,l.useState)(!1),[R,T]=(0,l.useState)(4),[U,M]=(0,l.useState)(!1),[_,K]=(0,l.useState)(null),[q,Y]=(0,l.useState)(4),[H,$]=(0,l.useState)(!1),[Q,ea]=(0,l.useState)(null),[el,et]=(0,l.useState)(null),es=(0,l.useCallback)(async()=>{i(!0),c(null);try{let e=await fetch("/api/players/op?server=".concat(encodeURIComponent(n)));if(!e.ok)throw Error("Failed to fetch operators");let a=await e.json();h(a.operators),p(a.source)}catch(e){c("Failed to load operators"),console.error("Error fetching operators:",e)}finally{i(!1)}},[n]);(0,l.useEffect)(()=>{es()},[es]);let ei=async()=>{if(m.trim()){I(!0),c(null);try{if(!(await fetch("/api/players/op",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({player:m.trim(),server:n,level:R})})).ok)throw Error("Failed to add operator");j(""),T(4),B(!1),await es()}catch(e){c("Failed to add operator"),console.error("Error adding operator:",e)}finally{I(!1)}}},eo=async e=>{N(e),c(null),ea(null),et(null);try{if(!(await fetch("/api/players/op?player=".concat(encodeURIComponent(e),"&server=").concat(encodeURIComponent(n)),{method:"DELETE"})).ok)throw Error("Failed to remove operator");await es()}catch(e){c("Failed to remove operator"),console.error("Error removing operator:",e)}finally{N(null)}},ed=async()=>{if(_){$(!0),c(null);try{if(!(await fetch("/api/players/op/".concat(encodeURIComponent(_.name),"?server=").concat(encodeURIComponent(n)),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({level:q})})).ok)throw Error("Failed to change operator level");M(!1),K(null),await es()}catch(e){c("Failed to change operator level"),console.error("Error changing operator level:",e)}finally{$(!1)}}},eh=(e,n)=>{ea(e.currentTarget),et(n)},ex=()=>{ea(null),et(null)};return(0,r.jsxs)(y.Z,{"data-testid":"op-manager",children:[(0,r.jsxs)(Z.Z,{children:[(0,r.jsx)(s.Z,{variant:"h6",gutterBottom:!0,children:"Operators"}),o&&(0,r.jsx)(D.Z,{severity:"error",sx:{mb:2},children:o}),!a&&x&&"rcon"!==x&&(0,r.jsxs)(D.Z,{severity:"info",sx:{mb:2},children:["Server is offline. Showing data from ","config"===x?"config.env":"ops.json",". Changes will apply on next server start."]}),(0,r.jsx)(t.Z,{sx:{mb:2},children:(0,r.jsx)(k.Z,{variant:"contained",onClick:()=>B(!0),startIcon:(0,r.jsx)(G.Z,{}),"aria-label":"Add operator",fullWidth:!0,children:"Add Operator"})}),a&&(0,r.jsx)(t.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,r.jsx)(W.Z,{})}),!a&&0===d.length&&(0,r.jsx)(s.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No operators configured"}),!a&&d.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(v.Z,{dense:!0,children:d.map(e=>(0,r.jsxs)(b.ZP,{secondaryAction:(0,r.jsx)(w.Z,{edge:"end","aria-label":"Operator actions",onClick:n=>eh(n,e),disabled:L===e.name,children:L===e.name?(0,r.jsx)(W.Z,{size:20}):(0,r.jsx)(X.Z,{})}),children:[(0,r.jsx)(f.Z,{children:(0,r.jsx)(C.Z,{src:e.uuid?"https://mc-heads.net/avatar/".concat(e.uuid,"/40"):void 0,alt:e.name,sx:{bgcolor:"warning.main"},children:(0,r.jsx)(ee.Z,{})})}),(0,r.jsx)(g.Z,{primary:(0,r.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[(0,r.jsx)(s.Z,{component:"span",children:e.name}),(0,r.jsx)(er,{level:e.level,showIcon:!0,size:"small"})]}),secondary:e.uuid?e.uuid.substring(0,8)+"...":"UUID not available"})]},e.uuid||e.name))}),(0,r.jsxs)(V.Z,{anchorEl:Q,open:!!Q,onClose:ex,children:[(0,r.jsxs)(u.Z,{onClick:()=>{el&&(K(el),Y(el.level),M(!0),ex())},children:[(0,r.jsx)(en.Z,{sx:{mr:1},fontSize:"small"}),"Change Level"]}),(0,r.jsxs)(u.Z,{onClick:()=>el&&eo(el.name),children:[(0,r.jsx)(J.Z,{sx:{mr:1},fontSize:"small",color:"error"}),"Remove OP"]})]})]})]}),(0,r.jsxs)(E.Z,{open:z,onClose:()=>!S&&B(!1),maxWidth:"sm",fullWidth:!0,children:[(0,r.jsx)(P.Z,{children:"Add Operator"}),(0,r.jsxs)(F.Z,{children:[(0,r.jsx)(O.Z,{autoFocus:!0,margin:"dense",label:"Player Name",placeholder:"Enter player name",fullWidth:!0,value:m,onChange:e=>j(e.target.value),disabled:S,sx:{mb:2}}),(0,r.jsx)(ec,{value:R,onChange:T,label:"OP Level",disabled:S})]}),(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(k.Z,{onClick:()=>B(!1),disabled:S,children:"Cancel"}),(0,r.jsx)(k.Z,{variant:"contained",onClick:ei,disabled:!m.trim()||S,startIcon:S?(0,r.jsx)(W.Z,{size:16}):void 0,children:S?"Adding...":"Add OP"})]})]}),(0,r.jsxs)(E.Z,{open:U,onClose:()=>!H&&M(!1),maxWidth:"sm",fullWidth:!0,children:[(0,r.jsxs)(P.Z,{children:["Change OP Level - ",null==_?void 0:_.name]}),(0,r.jsx)(F.Z,{children:_&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:["Current: Level ",_.level," (",_.role,")"]}),(0,r.jsx)(ec,{value:q,onChange:Y,label:"New Level",disabled:H})]})}),(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(k.Z,{onClick:()=>M(!1),disabled:H,children:"Cancel"}),(0,r.jsx)(k.Z,{variant:"contained",onClick:ed,disabled:H||q===(null==_?void 0:_.level),startIcon:H?(0,r.jsx)(W.Z,{size:16}):void 0,children:H?"Saving...":"Save Changes"})]})]})]})}var eh=a(397);function ex(e){let{serverName:n}=e,[a,i]=(0,l.useState)(!0),[o,c]=(0,l.useState)(null),[d,h]=(0,l.useState)([]),[x,u]=(0,l.useState)(),[p,m]=(0,l.useState)(!1),[j,S]=(0,l.useState)({player:"",reason:""}),[I,L]=(0,l.useState)(!1),[N,z]=(0,l.useState)(null),B=(0,l.useCallback)(async()=>{i(!0),c(null);try{let e=await fetch("/api/players/ban?server=".concat(encodeURIComponent(n)));if(!e.ok)throw Error("Failed to fetch bans");let a=await e.json();h(a.players),u(a.source)}catch(e){c("Failed to load ban list"),console.error("Error fetching bans:",e)}finally{i(!1)}},[n]);(0,l.useEffect)(()=>{B()},[B]);let R=()=>{m(!1),S({player:"",reason:""})},T=async()=>{if(j.player.trim()){L(!0),c(null);try{if(!(await fetch("/api/players/ban",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({player:j.player.trim(),reason:j.reason.trim()||"Banned by administrator",server:n})})).ok)throw Error("Failed to ban player");R(),await B()}catch(e){c("Failed to ban player"),console.error("Error banning player:",e)}finally{L(!1)}}},M=async e=>{z(e),c(null);try{if(!(await fetch("/api/players/ban?player=".concat(encodeURIComponent(e),"&server=").concat(encodeURIComponent(n)),{method:"DELETE"})).ok)throw Error("Failed to unban player");await B()}catch(e){c("Failed to unban player"),console.error("Error unbanning player:",e)}finally{z(null)}},K=e=>{try{return new Date(e).toLocaleDateString()}catch(n){return e}};return(0,r.jsx)(y.Z,{"data-testid":"ban-manager",children:(0,r.jsxs)(Z.Z,{children:[(0,r.jsxs)(t.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,r.jsx)(s.Z,{variant:"h6",children:"Ban List"}),(0,r.jsx)(k.Z,{variant:"outlined",color:"error",startIcon:(0,r.jsx)(eh.Z,{}),onClick:()=>{S({player:"",reason:""}),m(!0)},"aria-label":"Ban player",children:"Ban Player"})]}),o&&(0,r.jsx)(D.Z,{severity:"error",sx:{mb:2},children:o}),!a&&x&&"rcon"!==x&&(0,r.jsxs)(D.Z,{severity:"info",sx:{mb:2},children:["Server is offline. Showing data from ","config"===x?"config.env":"banned-players.json",". Changes will apply on next server start."]}),a&&(0,r.jsx)(t.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,r.jsx)(W.Z,{})}),!a&&0===d.length&&(0,r.jsx)(s.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No players banned"}),!a&&d.length>0&&(0,r.jsx)(v.Z,{dense:!0,children:d.map(e=>(0,r.jsxs)(b.ZP,{secondaryAction:(0,r.jsx)(w.Z,{edge:"end","aria-label":"Unban player",onClick:()=>M(e.name),disabled:N===e.name,color:"success",children:N===e.name?(0,r.jsx)(W.Z,{size:20}):(0,r.jsx)(J.Z,{})}),children:[(0,r.jsx)(f.Z,{children:(0,r.jsx)(C.Z,{src:e.uuid?"https://mc-heads.net/avatar/".concat(e.uuid,"/40"):void 0,alt:e.name,sx:{bgcolor:"error.main"},children:(0,r.jsx)(U.Z,{})})}),(0,r.jsx)(g.Z,{primary:e.name,secondary:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.Z,{component:"span",variant:"body2",color:"text.secondary",children:["Reason: ",e.reason||"No reason specified"]}),(0,r.jsx)("br",{}),(0,r.jsxs)(s.Z,{component:"span",variant:"caption",color:"text.secondary",children:["Banned: ",K(e.created)," by ",e.source||"Unknown"]})]})})]},e.uuid||e.name))}),(0,r.jsxs)(E.Z,{open:p,onClose:R,maxWidth:"sm",fullWidth:!0,children:[(0,r.jsx)(P.Z,{children:"Ban Player"}),(0,r.jsx)(F.Z,{children:(0,r.jsxs)(_.Z,{spacing:2,sx:{mt:1},children:[(0,r.jsx)(O.Z,{label:"Player Name",placeholder:"Enter player name",value:j.player,onChange:e=>S({...j,player:e.target.value}),fullWidth:!0,required:!0}),(0,r.jsx)(O.Z,{label:"Reason",placeholder:"Banned by administrator",value:j.reason,onChange:e=>S({...j,reason:e.target.value}),fullWidth:!0,multiline:!0,rows:2})]})}),(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(k.Z,{onClick:R,disabled:I,children:"Cancel"}),(0,r.jsx)(k.Z,{onClick:T,color:"error",variant:"contained",disabled:!j.player.trim()||I,startIcon:I?(0,r.jsx)(W.Z,{size:16}):(0,r.jsx)(eh.Z,{}),children:"Ban"})]})]})]})})}function eu(e){let{children:n,value:a,index:l}=e;return(0,r.jsx)("div",{role:"tabpanel",hidden:a!==l,children:a===l&&(0,r.jsx)(t.Z,{sx:{py:3},children:n})})}function ep(){let[e,n]=(0,l.useState)(0),[a,y]=(0,l.useState)(""),{data:Z,isLoading:v}=(0,$.x$)(),b=null==Z?void 0:Z.servers;return(0,l.useEffect)(()=>{!a&&b&&b.length>0&&y(b[0].name)},[b,a]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,m.Fq)(e.palette.info.main,.1)," 0%, ").concat((0,m.Fq)(e.palette.secondary.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,m.Fq)(e.palette.info.main,.2))},children:(0,r.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,r.jsx)(t.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"info.main",color:"info.contrastText"},children:(0,r.jsx)(j.Z,{sx:{fontSize:32}})}),(0,r.jsxs)(t.Z,{children:[(0,r.jsx)(s.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Player Management"}),(0,r.jsx)(s.Z,{variant:"body1",color:"text.secondary",children:"Manage players, whitelist, operators, and bans across your servers"})]})]})}),(0,r.jsx)(t.Z,{sx:{mb:3},children:(0,r.jsxs)(d.Z,{sx:{minWidth:200},children:[(0,r.jsx)(h.Z,{id:"server-select-label",children:"Server"}),(0,r.jsx)(x.Z,{labelId:"server-select-label",value:a,label:"Server",onChange:e=>y(e.target.value),disabled:v,children:null==b?void 0:b.map(e=>(0,r.jsx)(u.Z,{value:e.name,children:e.name},e.name))})]})}),(0,r.jsx)(t.Z,{sx:{borderBottom:1,borderColor:"divider"},children:(0,r.jsxs)(o.Z,{value:e,onChange:(e,a)=>{n(a)},"aria-label":"Player management tabs",children:[(0,r.jsx)(c.Z,{label:"Online Players"}),(0,r.jsx)(c.Z,{label:"Whitelist",disabled:!a}),(0,r.jsx)(c.Z,{label:"Operators",disabled:!a}),(0,r.jsx)(c.Z,{label:"Ban List",disabled:!a})]})}),(0,r.jsx)(eu,{value:e,index:0,children:(0,r.jsx)(M,{})}),(0,r.jsx)(eu,{value:e,index:1,children:a&&(0,r.jsxs)(i.ZP,{container:!0,spacing:3,children:[(0,r.jsx)(i.ZP,{item:!0,xs:12,md:8,children:(0,r.jsx)(Q,{serverName:a})}),(0,r.jsx)(i.ZP,{item:!0,xs:12,md:4,children:(0,r.jsxs)(t.Z,{sx:{p:2,bgcolor:"background.paper",borderRadius:1},children:[(0,r.jsx)(s.Z,{variant:"subtitle2",color:"text.secondary",gutterBottom:!0,children:"About Whitelist"}),(0,r.jsx)(s.Z,{variant:"body2",color:"text.secondary",children:"The whitelist controls which players can join your server. When enabled, only players on the whitelist can connect. Add players by their Minecraft username."})]})})]})}),(0,r.jsx)(eu,{value:e,index:2,children:a&&(0,r.jsxs)(i.ZP,{container:!0,spacing:3,children:[(0,r.jsx)(i.ZP,{item:!0,xs:12,md:8,children:(0,r.jsx)(ed,{serverName:a})}),(0,r.jsx)(i.ZP,{item:!0,xs:12,md:4,children:(0,r.jsxs)(t.Z,{sx:{p:2,bgcolor:"background.paper",borderRadius:1},children:[(0,r.jsx)(s.Z,{variant:"subtitle2",color:"text.secondary",gutterBottom:!0,children:"About Operators"}),(0,r.jsx)(s.Z,{variant:"body2",color:"text.secondary",children:"Operators (OPs) have elevated permissions on the server. They can use commands like /give, /gamemode, /tp, and more. OP levels range from 1-4, with 4 being the highest."}),(0,r.jsxs)(t.Z,{sx:{mt:2},children:[(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 1: Can bypass spawn protection"}),(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 2: Can use /clear, /gamemode, etc."}),(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 3: Can use /ban, /kick, /op, etc."}),(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 4: Can use /stop, full access"})]})]})})]})}),(0,r.jsx)(eu,{value:e,index:3,children:a&&(0,r.jsxs)(i.ZP,{container:!0,spacing:3,children:[(0,r.jsx)(i.ZP,{item:!0,xs:12,md:8,children:(0,r.jsx)(ex,{serverName:a})}),(0,r.jsx)(i.ZP,{item:!0,xs:12,md:4,children:(0,r.jsxs)(t.Z,{sx:{p:2,bgcolor:"background.paper",borderRadius:1},children:[(0,r.jsx)(s.Z,{variant:"subtitle2",color:"text.secondary",gutterBottom:!0,children:"About Bans"}),(0,r.jsx)(s.Z,{variant:"body2",color:"text.secondary",children:"Banned players cannot connect to your server. You can ban players by username and provide an optional reason. Bans can be removed (pardoned) at any time."})]})})]})})]})}}},function(e){e.O(0,[6812,9760,5004,7296,7436,1071,540,4416,2538,880,2539,8347,1658,5381,4187,4219,392,2666,3669,2757,1744],function(){return e(e.s=31809)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3767],{32823:function(e,n,r){Promise.resolve().then(r.bind(r,32050))},32050:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return d}});var s=r(94655),i=r(35106),o=r(31358),c=r(7281),l=r(31317),t=r(26138),a=r(41261),h=r(79983),u=r(10117),x=r(73660);function d(e){let{params:n}=e,r=(0,o.x)(),{name:d}=(0,i.use)(n),p=decodeURIComponent(d);return(0,s.jsxs)(c.Z,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:[(0,s.jsxs)(c.Z,{sx:{mb:2},children:[(0,s.jsxs)(c.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[(0,s.jsx)(h.Z,{onClick:()=>r.push("/servers/".concat(d)),size:"small","aria-label":"Back to server",children:(0,s.jsx)(u.Z,{})}),(0,s.jsxs)(t.Z,{"aria-label":"breadcrumb",children:[(0,s.jsx)(a.Z,{component:"button",variant:"body1",onClick:()=>r.push("/servers"),sx:{cursor:"pointer"},underline:"hover",color:"inherit",children:"Servers"}),(0,s.jsx)(a.Z,{component:"button",variant:"body1",onClick:()=>r.push("/servers/".concat(d)),sx:{cursor:"pointer"},underline:"hover",color:"inherit",children:p}),(0,s.jsx)(l.Z,{color:"text.primary",children:"Console"})]})]}),(0,s.jsxs)(l.Z,{variant:"h5",component:"h1",children:[p," Console"]})]}),(0,s.jsx)(c.Z,{sx:{flex:1,minHeight:0},children:(0,s.jsx)(x.K,{serverName:p})})]})}}},function(e){e.O(0,[6812,9760,5004,7296,7436,1658,6727,6645,1476,5787,3669,2757,1744],function(){return e(e.s=32823)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3767],{32823:function(e,n,r){Promise.resolve().then(r.bind(r,32050))},32050:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return d}});var s=r(94655),i=r(35106),o=r(31358),c=r(7281),l=r(31317),t=r(26138),a=r(41261),h=r(79983),u=r(10117),x=r(73660);function d(e){let{params:n}=e,r=(0,o.x)(),{name:d}=(0,i.use)(n),p=decodeURIComponent(d);return(0,s.jsxs)(c.Z,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:[(0,s.jsxs)(c.Z,{sx:{mb:2},children:[(0,s.jsxs)(c.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[(0,s.jsx)(h.Z,{onClick:()=>r.push("/servers/".concat(d)),size:"small","aria-label":"Back to server",children:(0,s.jsx)(u.Z,{})}),(0,s.jsxs)(t.Z,{"aria-label":"breadcrumb",children:[(0,s.jsx)(a.Z,{component:"button",variant:"body1",onClick:()=>r.push("/servers"),sx:{cursor:"pointer"},underline:"hover",color:"inherit",children:"Servers"}),(0,s.jsx)(a.Z,{component:"button",variant:"body1",onClick:()=>r.push("/servers/".concat(d)),sx:{cursor:"pointer"},underline:"hover",color:"inherit",children:p}),(0,s.jsx)(l.Z,{color:"text.primary",children:"Console"})]})]}),(0,s.jsxs)(l.Z,{variant:"h5",component:"h1",children:[p," Console"]})]}),(0,s.jsx)(c.Z,{sx:{flex:1,minHeight:0},children:(0,s.jsx)(x.K,{serverName:p})})]})}}},function(e){e.O(0,[6812,9760,5004,7296,7436,1658,6727,6645,682,5787,3669,2757,1744],function(){return e(e.s=32823)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[278],{59616:function(e,t,r){Promise.resolve().then(r.bind(r,46812))},46812:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return tl}});var s=r(94655),n=r(35106),i=r(74228),a=r(31358),o=r(7281),l=r(30417),d=r(79983),c=r(81071),x=r(93017),u=r(10721),h=r(628),p=r(41565),m=r(31317),v=r(88812),y=r(7178),j=r(17820),g=r(73424),b=r(99770),f=r(62508),Z=r(5682),w=r(76678),C=r(97436),S=r(84840),k=r(76492),R=r(10117),T=r(5501),I=r(37809),z=r(21111),W=r(17978),P=r(89573),F=r(96292),M=r(33104),A=r(25333),O=r(52082),D=r(69123),E=r(83855),q=r(44059),N=r(71185),B=r(30165),U=r(97293),L=r(11259),H=r(66615),K=r(89161),G=r(34071),V=r(4405);function J(e){let{value:t,unit:r,label:n,icon:i,progress:a,progressMax:l,color:d="#1bd96a"}=e;return(0,s.jsxs)(h.Z,{"data-testid":"resource-stat-card",sx:{p:2.5,bgcolor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:3},children:[(0,s.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:2},children:[(0,s.jsxs)(o.Z,{sx:{display:"flex",alignItems:"baseline",gap:.75,flexWrap:"wrap",minWidth:0},children:[(0,s.jsx)(m.Z,{variant:"h4",component:"span",sx:{fontWeight:700,color:"text.primary",fontFamily:'"Roboto Mono", monospace',letterSpacing:"-0.5px"},children:t}),(0,s.jsx)(m.Z,{variant:"body2",component:"span",sx:{color:"text.secondary",fontWeight:500},children:r})]}),(0,s.jsx)(o.Z,{sx:{color:"text.secondary",flexShrink:0},children:i})]}),(0,s.jsx)(m.Z,{variant:"body2",sx:{color:"text.secondary",fontWeight:500,mt:.5},children:n}),(0,s.jsx)(V.Z,{variant:"determinate",value:Math.min(a/l*100,100),sx:{mt:1,height:6,borderRadius:1.5,bgcolor:"#2a2d3a","& .MuiLinearProgress-bar":{borderRadius:1.5,background:"linear-gradient(90deg, ".concat(d," 0%, ").concat(d,"cc 100%)")}}})]})}var Q=r(163),_=r(73660),X=r(90158),$=r(58347),Y=r(95511),ee=r(46725),et=r(26577),er=r(56813),es=r(26892),en=r(84509);function ei(e){var t;let{serverName:r}=e,{data:n,isLoading:i,error:a}=(0,en.HZ)(r,{limit:20});if(i)return(0,s.jsx)(o.Z,{children:[void 0,void 0,void 0,void 0,void 0].map((e,t)=>(0,s.jsxs)(o.Z,{sx:{display:"flex",gap:2,py:1.5},children:[(0,s.jsx)(u.Z,{variant:"rounded",width:60,height:24}),(0,s.jsx)(u.Z,{variant:"text",width:"60%"}),(0,s.jsx)(u.Z,{variant:"text",width:50})]},t))});if(a)return(0,s.jsxs)(c.Z,{severity:"error",children:["Failed to load activity: ",a.message]});let d=null!==(t=null==n?void 0:n.logs)&&void 0!==t?t:[];if(0===d.length)return(0,s.jsx)(m.Z,{variant:"body2",color:"text.secondary",sx:{py:4,textAlign:"center"},children:"No activity recorded for this server yet."});let x="/audit-logs?targetType=server&targetName=".concat(encodeURIComponent(r));return(0,s.jsxs)(o.Z,{children:[(0,s.jsx)(X.Z,{sx:{py:0},children:d.map(e=>{var t;return(0,s.jsx)($.ZP,{sx:{px:0,py:1.5,"&:not(:last-child)":{borderBottom:"1px solid",borderColor:"divider"}},children:(0,s.jsx)(g.Z,{primary:(0,s.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,s.jsx)(er.I,{action:e.action,size:"small"}),(0,s.jsxs)(m.Z,{variant:"body2",color:"text.secondary",children:["by ",e.actor.replace("api:","").replace("cli:","")]}),(0,s.jsx)(es.c,{status:e.status,size:"small"})]}),secondary:(0,s.jsx)(Y.Z,{title:(t=e.timestamp,new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"}).format(new Date(t))),arrow:!0,children:(0,s.jsx)(m.Z,{variant:"caption",component:"span",color:"text.disabled",children:function(e){let t=new Date,r=new Date(e),s=Math.floor((t.getTime()-r.getTime())/6e4),n=Math.floor(s/60);return s<1?"just now":s<60?"".concat(s,"m ago"):n<24?"".concat(n,"h ago"):"".concat(Math.floor(n/24),"d ago")}(e.timestamp)})})})},e.id)})}),(0,s.jsx)(o.Z,{sx:{mt:2,textAlign:"center"},children:(0,s.jsx)(l.Z,{component:ee.default,href:x,size:"small",endIcon:(0,s.jsx)(et.Z,{}),sx:{textTransform:"none"},children:"View Full History"})})]})}var ea=r(37530),eo=r(84420),el=r(46121),ed=r(84775),ec=r(92666),ex=r(70115),eu=r(70603),eh=r(32366),ep=r(5942),em=r(25523);function ev(e){let{serverName:t}=e,{data:r,isLoading:i}=(0,ec.Js)(t),a=(0,ec.Bx)(),[u,v]=(0,n.useState)([]),[y,j]=(0,n.useState)(!1),[g,b]=(0,n.useState)(!1),[f,Z]=(0,n.useState)(""),[w,S]=(0,n.useState)(""),[k,R]=(0,n.useState)(!1),[T,I]=(0,n.useState)({open:!1,message:"",severity:"success"});(0,n.useEffect)(()=>{(null==r?void 0:r.customHostnames)&&(v(r.customHostnames),j(!1),R(!1))},[r]);let W=e=>{let t=e.trim().toLowerCase();return t?t.length>253?"Domain exceeds 253 characters":/^[a-z0-9]([a-z0-9\-.]*[a-z0-9])?$/.test(t)?t.endsWith(".local")?"Cannot use .local system domain":t.endsWith(".nip.io")?"Cannot use .nip.io system domain":u.includes(t)?"Domain already exists":"":"Invalid domain format":"Domain cannot be empty"},P=()=>{let e=f.trim().toLowerCase(),t=W(e);if(t){S(t);return}v(t=>[...t,e]),Z(""),S(""),b(!1),j(!0)},F=e=>{v(t=>t.filter(t=>t!==e)),j(!0)},M=async()=>{try{await a.mutateAsync({serverName:t,customHostnames:u}),j(!1),R(!0),I({open:!0,message:"Hostnames saved. Container recreation required to apply changes.",severity:"warning"})}catch(e){I({open:!0,message:e instanceof Error?e.message:"Failed to save hostnames",severity:"error"})}},O=()=>{b(!1),Z(""),S("")};return i?(0,s.jsx)(h.Z,{sx:{mb:3,borderRadius:3},children:(0,s.jsx)(p.Z,{children:(0,s.jsx)(o.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,s.jsx)(x.Z,{size:24})})})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h.Z,{sx:{mb:3,borderRadius:3},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[(0,s.jsx)(em.Z,{color:"primary"}),(0,s.jsx)(m.Z,{variant:"h6",fontWeight:600,children:"Hostnames / Domains"})]}),(0,s.jsx)(m.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Manage hostnames used by mc-router to route connections to this server."}),(0,s.jsx)(D.Z,{sx:{mb:3}}),(null==r?void 0:r.systemHostnames)&&r.systemHostnames.length>0&&(0,s.jsxs)(o.Z,{sx:{mb:3},children:[(0,s.jsx)(m.Z,{variant:"subtitle2",color:"text.secondary",sx:{mb:1},children:"System Hostnames (read-only)"}),(0,s.jsx)(ex.Z,{direction:"row",flexWrap:"wrap",gap:1,children:r.systemHostnames.map(e=>(0,s.jsx)(A.Z,{icon:(0,s.jsx)(eu.Z,{sx:{fontSize:16}}),label:e.hostname,title:e.description,variant:"outlined",color:"default",size:"small"},e.hostname))})]}),(0,s.jsxs)(o.Z,{sx:{mb:2},children:[(0,s.jsx)(m.Z,{variant:"subtitle2",color:"text.secondary",sx:{mb:1},children:"Custom Domains"}),0===u.length&&!g&&(0,s.jsx)(m.Z,{variant:"body2",color:"text.disabled",sx:{mb:1},children:"No custom domains configured."}),(0,s.jsx)(ex.Z,{spacing:1,children:u.map(e=>(0,s.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:.5,px:1.5,borderRadius:1,bgcolor:"action.hover"},children:[(0,s.jsx)(m.Z,{variant:"body2",fontFamily:'"Roboto Mono", monospace',children:e}),(0,s.jsx)(d.Z,{size:"small",color:"error",onClick:()=>F(e),title:"Remove domain",children:(0,s.jsx)(z.Z,{fontSize:"small"})})]},e))}),g?(0,s.jsxs)(o.Z,{sx:{display:"flex",alignItems:"flex-start",gap:1,mt:1},children:[(0,s.jsx)(C.Z,{size:"small",placeholder:"e.g. play.example.com",value:f,onChange:e=>{Z(e.target.value),S("")},onKeyDown:e=>{"Enter"===e.key&&P(),"Escape"===e.key&&O()},error:!!w,helperText:w,autoFocus:!0,sx:{flex:1}}),(0,s.jsx)(l.Z,{size:"small",variant:"contained",onClick:P,children:"Add"}),(0,s.jsx)(d.Z,{size:"small",onClick:O,children:(0,s.jsx)(N.Z,{fontSize:"small"})})]}):(0,s.jsx)(l.Z,{size:"small",startIcon:(0,s.jsx)(eh.Z,{}),onClick:()=>b(!0),sx:{mt:1},children:"Add Domain"})]}),k&&(0,s.jsxs)(c.Z,{severity:"warning",sx:{mb:2},children:["Container recreation is required for hostname changes to take effect. Run ",(0,s.jsx)("code",{children:"docker compose up -d"})," or restart the server from the dashboard."]}),(0,s.jsx)(o.Z,{sx:{display:"flex",justifyContent:"flex-end"},children:(0,s.jsx)(l.Z,{variant:"contained",size:"small",startIcon:(0,s.jsx)(ep.Z,{}),onClick:M,disabled:!y||a.isPending,children:a.isPending?"Saving...":"Save Hostnames"})})]})}),(0,s.jsx)(ea.Z,{open:T.open,autoHideDuration:6e3,onClose:()=>I({...T,open:!1}),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:(0,s.jsx)(c.Z,{onClose:()=>I({...T,open:!1}),severity:T.severity,sx:{width:"100%"},children:T.message})})]})}var ey=r(87716),ej=r(81960),eg=r(62328),eb=r(29793),ef=r(75726),eZ=r(40064),ew=r(38393),eC=r(28058),eS=r(42730);function ek(e){var t;let{field:r,value:i,onChange:a}=e,[l,c]=(0,n.useState)(!1),x=null!==(t=r.columns)&&void 0!==t?t:6;return(0,s.jsx)(S.ZP,{item:!0,xs:12,sm:x,children:(()=>{var e,t,n,x,u,h;switch(r.type){case"boolean":return(0,s.jsxs)(o.Z,{children:[(0,s.jsx)(eZ.Z,{control:(0,s.jsx)(ew.Z,{checked:null!=i&&i,onChange:e=>a(r.key,e.target.checked)}),label:r.label}),r.helperText&&(0,s.jsx)(m.Z,{variant:"caption",color:"text.secondary",sx:{ml:4,display:"block"},children:r.helperText})]});case"select":return(0,s.jsxs)(eb.Z,{fullWidth:!0,size:"small",children:[(0,s.jsx)(ef.Z,{children:r.label}),(0,s.jsx)(eg.Z,{value:null!==(x=null!=i?i:null===(t=r.options)||void 0===t?void 0:null===(e=t[0])||void 0===e?void 0:e.value)&&void 0!==x?x:"",label:r.label,onChange:e=>a(r.key,e.target.value),children:null===(n=r.options)||void 0===n?void 0:n.map(e=>(0,s.jsx)(y.Z,{value:e.value,children:e.label},e.value))})]});case"number":return(0,s.jsx)(C.Z,{fullWidth:!0,size:"small",type:"number",label:r.label,value:null!=i?i:"",onChange:e=>{let t=e.target.value;a(r.key,""===t?void 0:parseInt(t,10))},inputProps:{min:null===(u=r.validation)||void 0===u?void 0:u.min,max:null===(h=r.validation)||void 0===h?void 0:h.max},helperText:r.helperText,InputProps:r.unit?{endAdornment:(0,s.jsx)(O.Z,{position:"end",children:(0,s.jsx)(m.Z,{variant:"caption",color:"text.secondary",children:r.unit})})}:void 0});case"password":return(0,s.jsx)(C.Z,{fullWidth:!0,size:"small",type:l?"text":"password",label:r.label,value:null!=i?i:"",onChange:e=>a(r.key,e.target.value),helperText:r.helperText,InputProps:{endAdornment:(0,s.jsx)(O.Z,{position:"end",children:(0,s.jsx)(d.Z,{size:"small",onClick:()=>c(!l),edge:"end",children:l?(0,s.jsx)(eS.Z,{fontSize:"small"}):(0,s.jsx)(eC.Z,{fontSize:"small"})})})}});default:return(0,s.jsx)(C.Z,{fullWidth:!0,size:"small",label:r.label,value:null!=i?i:"",onChange:e=>a(r.key,e.target.value),helperText:r.helperText})}})()})}function eR(e){let{section:t,values:r,onChange:i}=e,[a,d]=(0,n.useState)(!1),c=t.icon,x=t.advancedFields.length;return(0,s.jsx)(h.Z,{sx:{mb:3,borderRadius:3},children:(0,s.jsxs)(p.Z,{sx:{p:3},children:[(0,s.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1.5,mb:1},children:[(0,s.jsx)(c,{sx:{fontSize:22,color:"primary.main"}}),(0,s.jsx)(m.Z,{variant:"h6",fontWeight:600,children:t.title})]}),(0,s.jsx)(m.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:t.description}),(0,s.jsx)(D.Z,{sx:{mb:3}}),(0,s.jsx)(S.ZP,{container:!0,spacing:2.5,children:t.essentialFields.map(e=>(0,s.jsx)(ek,{field:e,value:r[e.key],onChange:i},e.key))}),x>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(l.Z,{fullWidth:!0,variant:"text",onClick:()=>d(!a),endIcon:(0,s.jsx)(ej.Z,{sx:{transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.3s"}}),sx:{mt:2.5,justifyContent:"flex-start",color:"text.secondary",textTransform:"none",py:1,"&:hover":{bgcolor:"action.hover"}},children:[a?"Hide":"Show"," Advanced Settings (",x,")"]}),(0,s.jsx)(ey.Z,{in:a,timeout:300,children:(0,s.jsx)(o.Z,{sx:{pt:2,borderTop:"1px dashed",borderColor:"divider"},children:(0,s.jsx)(S.ZP,{container:!0,spacing:2.5,children:t.advancedFields.map(e=>(0,s.jsx)(ek,{field:e,value:r[e.key],onChange:i},e.key))})})})]})]})})}var eT=r(12550);function eI(e){let{hasChanges:t,changedCount:r,hasRestartChanges:n,restartFields:i=[],isSaving:a,onSave:d,onDiscard:c}=e;return(0,s.jsx)(eT.Z,{direction:"up",in:t,mountOnEnter:!0,unmountOnExit:!0,children:(0,s.jsxs)(o.Z,{sx:{position:"sticky",bottom:0,zIndex:1100,bgcolor:"background.paper",borderTop:2,borderColor:"primary.main",px:{xs:2,sm:3},py:2,mx:{xs:-2,sm:-3},mb:{xs:-2,sm:-3},boxShadow:"0 -4px 20px rgba(0,0,0,0.4)",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:1},children:[(0,s.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[n&&(0,s.jsx)(ed.Z,{sx:{color:"warning.main",fontSize:20}}),(0,s.jsxs)(m.Z,{variant:"body2",fontWeight:600,children:[r," unsaved change",1!==r?"s":""]}),n&&(0,s.jsxs)(m.Z,{variant:"caption",color:"warning.main",children:["(",i.length>0?i.join(", "):"some fields"," require restart)"]})]}),(0,s.jsxs)(o.Z,{sx:{display:"flex",gap:1},children:[(0,s.jsx)(l.Z,{variant:"text",color:"inherit",onClick:c,disabled:a,children:"Discard"}),(0,s.jsx)(l.Z,{variant:"contained",startIcon:a?(0,s.jsx)(x.Z,{size:16,color:"inherit"}):(0,s.jsx)(ep.Z,{}),onClick:d,disabled:a,children:a?"Saving...":"Save Changes (".concat(r,")")})]})]})})}function ez(e){let{open:t,changedFields:r,onSaveOnly:n,onSaveAndRestart:i,onCancel:a}=e;return(0,s.jsxs)(b.Z,{open:t,onClose:a,maxWidth:"sm",fullWidth:!0,children:[(0,s.jsx)(f.Z,{children:(0,s.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,s.jsx)(ed.Z,{color:"warning"}),(0,s.jsx)(m.Z,{variant:"h6",fontWeight:600,children:"Restart Required"})]})}),(0,s.jsxs)(Z.Z,{children:[(0,s.jsx)(m.Z,{variant:"body1",gutterBottom:!0,children:"The following changes require a server restart to take effect:"}),(0,s.jsx)(X.Z,{dense:!0,children:r.map(e=>(0,s.jsx)($.ZP,{sx:{py:0},children:(0,s.jsx)(g.Z,{primary:e,primaryTypographyProps:{variant:"body2",fontFamily:'"Roboto Mono", monospace'}})},e))})]}),(0,s.jsxs)(w.Z,{children:[(0,s.jsx)(l.Z,{onClick:a,color:"inherit",children:"Cancel"}),(0,s.jsx)(l.Z,{onClick:n,variant:"outlined",children:"Save Only"}),(0,s.jsx)(l.Z,{onClick:i,variant:"contained",color:"warning",children:"Save & Restart"})]})]})}var eW=r(1217),eP=r(84974),eF=r(23482),eM=r(61244),eA=r(87739);let eO=[{id:"gameplay",icon:eW.Z,title:"Gameplay",description:"Core game rules and player experience settings.",essentialFields:[{key:"difficulty",label:"Difficulty",type:"select",options:[{value:"peaceful",label:"Peaceful"},{value:"easy",label:"Easy"},{value:"normal",label:"Normal"},{value:"hard",label:"Hard"}]},{key:"gameMode",label:"Game Mode",type:"select",options:[{value:"survival",label:"Survival"},{value:"creative",label:"Creative"},{value:"adventure",label:"Adventure"},{value:"spectator",label:"Spectator"}]},{key:"maxPlayers",label:"Max Players",type:"number",validation:{min:1,max:1e3}},{key:"pvp",label:"Enable PvP",type:"boolean",helperText:"Allow players to damage each other"}],advancedFields:[{key:"forceGamemode",label:"Force Game Mode",type:"boolean",helperText:"Force game mode when players join"},{key:"hardcore",label:"Hardcore",type:"boolean",helperText:"One life only - world deleted on death"},{key:"allowFlight",label:"Allow Flight",type:"boolean",helperText:"Allow flight in survival mode"},{key:"allowNether",label:"Allow Nether",type:"boolean",helperText:"Enable Nether portal access"},{key:"enableCommandBlock",label:"Command Blocks",type:"boolean",helperText:"Enable command block functionality"},{key:"spawnProtection",label:"Spawn Protection",type:"number",helperText:"Radius around spawn (0 = disabled)",unit:"blocks",validation:{min:0,max:256}},{key:"spawnAnimals",label:"Spawn Animals",type:"boolean",helperText:"Spawn passive mobs (cows, pigs, etc.)"},{key:"spawnMonsters",label:"Spawn Monsters",type:"boolean",helperText:"Spawn hostile mobs (zombies, creepers, etc.)"},{key:"spawnNpcs",label:"Spawn NPCs",type:"boolean",helperText:"Spawn villagers and wandering traders"}]},{id:"world",icon:eP.Z,title:"World",description:"World generation and server identity settings.",essentialFields:[{key:"motd",label:"MOTD (Message of the Day)",type:"string",helperText:"Displayed in the server list",columns:12},{key:"level",label:"World Name",type:"string",helperText:"Save folder name",restartRequired:!0},{key:"levelType",label:"Level Type",type:"select",restartRequired:!0,options:[{value:"default",label:"Default"},{value:"flat",label:"Flat"},{value:"largeBiomes",label:"Large Biomes"},{value:"amplified",label:"Amplified"},{value:"buffet",label:"Buffet"}]},{key:"seed",label:"World Seed",type:"string",helperText:"Only affects new world generation",restartRequired:!0}],advancedFields:[{key:"generateStructures",label:"Generate Structures",type:"boolean",helperText:"Generate villages, temples, etc."},{key:"maxWorldSize",label:"Max World Size",type:"number",unit:"blocks",helperText:"Maximum world radius",validation:{min:1,max:29999984}},{key:"icon",label:"Server Icon URL",type:"string",helperText:"64x64 PNG image URL",columns:12}]},{id:"security",icon:eF.Z,title:"Security",description:"Authentication and access control settings.",essentialFields:[{key:"onlineMode",label:"Online Mode (Mojang Auth)",type:"boolean",helperText:"Disable to allow cracked clients (not recommended)",restartRequired:!0},{key:"enableWhitelist",label:"Enable Whitelist",type:"boolean",helperText:"Only whitelisted players can join",restartRequired:!0}],advancedFields:[{key:"enforceWhitelist",label:"Enforce Whitelist",type:"boolean",helperText:"Kick non-whitelisted players already online",restartRequired:!0},{key:"enforceSecureProfile",label:"Enforce Secure Profile",type:"boolean",helperText:"Require signed chat messages from players",restartRequired:!0}]},{id:"performance",icon:B.Z,title:"Performance & JVM",description:"Memory, view distance, and JVM optimization settings.",essentialFields:[{key:"memory",label:"Memory",type:"string",helperText:"e.g., 2G, 4G, 8G",restartRequired:!0},{key:"useAikarFlags",label:"Aikar's Flags",type:"boolean",helperText:"Optimized GC flags for Paper/Spigot",restartRequired:!0},{key:"viewDistance",label:"View Distance",type:"number",unit:"chunks",validation:{min:2,max:32}}],advancedFields:[{key:"simulationDistance",label:"Simulation Distance",type:"number",unit:"chunks",validation:{min:3,max:32}},{key:"maxTickTime",label:"Max Tick Time",type:"number",unit:"ms",helperText:"-1 to disable watchdog",validation:{min:-1}},{key:"initMemory",label:"Initial Heap",type:"string",helperText:"e.g., 1G (overrides Memory)",restartRequired:!0},{key:"maxMemory",label:"Max Heap",type:"string",helperText:"e.g., 8G (overrides Memory)",restartRequired:!0},{key:"jvmXxOpts",label:"JVM -XX Options",type:"string",helperText:"Additional -XX JVM flags",restartRequired:!0,columns:12}]},{id:"autopause",icon:eM.Z,title:"Auto-pause / Auto-stop",description:"Automatically pause or stop when no players are connected.",essentialFields:[{key:"enableAutopause",label:"Enable Auto-pause",type:"boolean",helperText:"Pause process when no players connected",restartRequired:!0},{key:"autopauseTimeoutEst",label:"Pause Timeout",type:"number",unit:"seconds",helperText:"Wait time after last player leaves",validation:{min:0}}],advancedFields:[{key:"autopauseTimeoutInit",label:"Init Timeout",type:"number",unit:"seconds",helperText:"Timeout after start without connections",validation:{min:0}},{key:"autopausePeriod",label:"Check Period",type:"number",unit:"seconds",helperText:"Status check interval",validation:{min:1}},{key:"enableAutostop",label:"Enable Auto-stop",type:"boolean",helperText:"Stop container when no players connected",restartRequired:!0},{key:"autostopTimeoutEst",label:"Stop Timeout",type:"number",unit:"seconds",helperText:"Wait time before stopping container",validation:{min:0}}]},{id:"system",icon:eA.Z,title:"System",description:"Timezone, resource pack, RCON, and container settings.",essentialFields:[{key:"tz",label:"Timezone",type:"string",helperText:"e.g., Asia/Seoul, UTC",restartRequired:!0},{key:"resourcePack",label:"Resource Pack URL",type:"string",helperText:"Direct download URL for resource pack",columns:12},{key:"enableRcon",label:"Enable RCON",type:"boolean",helperText:"Remote server console access",restartRequired:!0}],advancedFields:[{key:"resourcePackSha1",label:"Resource Pack SHA1",type:"string",helperText:"40-character hex checksum",columns:12},{key:"resourcePackEnforce",label:"Enforce Resource Pack",type:"boolean",helperText:"Kick players who decline"},{key:"resourcePackPrompt",label:"Resource Pack Prompt",type:"string",helperText:"Custom message for resource pack dialog",columns:12},{key:"rconPassword",label:"RCON Password",type:"password",restartRequired:!0},{key:"rconPort",label:"RCON Port",type:"number",validation:{min:1024,max:65535},restartRequired:!0},{key:"stopDuration",label:"Stop Timeout",type:"number",unit:"seconds",helperText:"Graceful shutdown wait time",restartRequired:!0,validation:{min:0}},{key:"uid",label:"User ID (UID)",type:"number",helperText:"Container process UID",restartRequired:!0,validation:{min:0}},{key:"gid",label:"Group ID (GID)",type:"number",helperText:"Container process GID",restartRequired:!0,validation:{min:0}}]}],eD=["memory","initMemory","maxMemory","useAikarFlags","jvmXxOpts","onlineMode","enableWhitelist","enforceWhitelist","enforceSecureProfile","level","seed","levelType","enableAutopause","enableAutostop","enableRcon","rconPassword","rconPort","tz","uid","gid","stopDuration"];function eE(e){let{serverName:t,isRunning:r}=e,{data:i,isLoading:a}=(0,ec.iC)(t),d=(0,ec.MH)(),u=(0,ec.gx)(),v=(0,ec._I)(),[y,j]=(0,n.useState)({}),[g,S]=(0,n.useState)({}),[k,R]=(0,n.useState)(!1),[T,I]=(0,n.useState)(""),[z,W]=(0,n.useState)(!1),[P,F]=(0,n.useState)({open:!1,message:"",severity:"info"});(0,n.useEffect)(()=>{(null==i?void 0:i.config)&&(j(i.config),S(i.config))},[i]);let M=(0,n.useMemo)(()=>{let e=[];for(let t of Object.keys(y))y[t]!==g[t]&&e.push(t);for(let t of Object.keys(g))y[t]===g[t]||e.includes(t)||e.push(t);return e},[y,g]),A=M.length>0,O=M.filter(e=>eD.includes(e)),E=O.length>0,q=(0,n.useCallback)((e,t)=>{j(r=>({...r,[e]:t}))},[]),N=(0,n.useCallback)(()=>{j(g)},[g]),B=(0,n.useCallback)(async e=>{try{let s=await d.mutateAsync({serverName:t,config:y});if(S(s.config),j(s.config),e&&r)try{await v.mutateAsync(t),F({open:!0,message:"Settings saved. Server is restarting...",severity:"warning"})}catch(e){F({open:!0,message:"Settings saved, but server restart failed. Please restart manually.",severity:"error"})}else F({open:!0,message:s.restartRequired?"Settings saved. Restart required for some changes to take effect.":"Settings saved successfully.",severity:s.restartRequired?"warning":"success"})}catch(e){F({open:!0,message:e instanceof Error?e.message:"Failed to save settings",severity:"error"})}finally{W(!1)}},[y,t,r,d,v]),U=(0,n.useCallback)(()=>{E&&r?W(!0):B(!1)},[E,r,B]),L=async()=>{if("RESET"!==T){F({open:!0,message:"Please type RESET to confirm",severity:"warning"});return}try{await u.mutateAsync(t),F({open:!0,message:"World reset successfully",severity:"success"}),R(!1),I("")}catch(e){F({open:!0,message:e instanceof Error?e.message:"Failed to reset world",severity:"error"})}};return a?(0,s.jsx)(o.Z,{sx:{display:"flex",justifyContent:"center",py:8},children:(0,s.jsx)(x.Z,{})}):(0,s.jsxs)(o.Z,{children:[(0,s.jsx)(ev,{serverName:t}),eO.map(e=>(0,s.jsx)(eR,{section:e,values:y,onChange:q},e.id)),(0,s.jsx)(h.Z,{sx:{borderRadius:3,borderColor:"error.main",borderWidth:1,borderStyle:"solid"},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsx)(m.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,color:"error",children:"Danger Zone"}),(0,s.jsx)(D.Z,{sx:{mb:3}}),(0,s.jsxs)(o.Z,{sx:{mb:3},children:[(0,s.jsx)(m.Z,{variant:"subtitle1",fontWeight:600,gutterBottom:!0,children:"Reset World"}),(0,s.jsx)(m.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"This will permanently delete the current world and generate a new one. This action cannot be undone."}),(0,s.jsx)(l.Z,{variant:"outlined",color:"error",startIcon:(0,s.jsx)(ed.Z,{}),onClick:()=>R(!0),disabled:r,children:"Reset World"}),r&&(0,s.jsx)(m.Z,{variant:"caption",color:"text.secondary",sx:{ml:2},children:"Stop the server first"})]})]})}),(0,s.jsx)(eI,{hasChanges:A,changedCount:M.length,hasRestartChanges:E,restartFields:O,isSaving:d.isPending,onSave:U,onDiscard:N}),(0,s.jsx)(ez,{open:z,changedFields:O,onSaveOnly:()=>B(!1),onSaveAndRestart:()=>B(!0),onCancel:()=>W(!1)}),(0,s.jsxs)(b.Z,{open:k,onClose:()=>R(!1),maxWidth:"sm",fullWidth:!0,children:[(0,s.jsx)(f.Z,{children:(0,s.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,s.jsx)(eo.Z,{color:"error"}),(0,s.jsx)(m.Z,{variant:"h6",fontWeight:600,children:"Reset World"})]})}),(0,s.jsxs)(Z.Z,{children:[(0,s.jsxs)(m.Z,{variant:"body1",gutterBottom:!0,children:["This will permanently delete the world for ",(0,s.jsx)("strong",{children:t})," and generate a new one."]}),(0,s.jsx)(m.Z,{variant:"body2",color:"text.secondary",gutterBottom:!0,children:"This action cannot be undone. All player progress and builds will be lost."}),(0,s.jsx)(C.Z,{fullWidth:!0,label:"Type RESET to confirm",value:T,onChange:e=>I(e.target.value),sx:{mt:3},autoFocus:!0})]}),(0,s.jsxs)(w.Z,{children:[(0,s.jsx)(l.Z,{onClick:()=>R(!1),children:"Cancel"}),(0,s.jsx)(l.Z,{variant:"contained",color:"error",onClick:L,disabled:"RESET"!==T||u.isPending,startIcon:u.isPending?(0,s.jsx)(x.Z,{size:16}):(0,s.jsx)(el.Z,{}),children:u.isPending?"Resetting...":"Reset World"})]})]}),(0,s.jsx)(ea.Z,{open:P.open,autoHideDuration:6e3,onClose:()=>F({...P,open:!1}),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:(0,s.jsx)(c.Z,{onClose:()=>F({...P,open:!1}),severity:P.severity,sx:{width:"100%"},children:P.message})})]})}var eq=r(86702),eN=r(47606),eB=r(407),eU=r(56056),eL=r(11597),eH=r(59602);let eK={admin:{label:"Owner",color:"primary",variant:"filled"},manage:{label:"Operator",color:"info",variant:"outlined"},view:{label:"Viewer",color:"default",variant:"outlined"}};function eG(e){let{permission:t,size:r="medium"}=e,n=eK[t];return(0,s.jsx)(A.Z,{label:n.label,color:n.color,variant:n.variant,size:r})}var eV=r(99046),eJ=r(68038),eQ=r(34080),e_=r(39181),eX=r(5632),e$=r(58919),eY=r(20367),e0=r(42936);function e1(e){var t,r;let{open:i,onClose:a,serverId:d}=e,[u,h]=(0,n.useState)(""),[p,v]=(0,n.useState)(null),[y,j]=(0,n.useState)("view"),{data:g,isLoading:S}=(r={enabled:i},(0,eX.a)({queryKey:["users","search",u],queryFn:()=>(0,e0.SC)("/api/users?q=".concat(encodeURIComponent(u))),enabled:(null==r?void 0:r.enabled)!==!1&&u.length>=2,staleTime:3e4})),k=function(){let e=(0,e$.NL)();return(0,eY.D)({mutationFn:e=>(0,e0.SC)("/api/user-servers",{method:"POST",body:JSON.stringify(e)}),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:["user-servers",r.serverId]}),e.invalidateQueries({queryKey:["user-servers"]})}})}(),R=(0,n.useMemo)(()=>{var e;return null!==(e=null==g?void 0:g.users)&&void 0!==e?e:[]},[g]),T=()=>{h(""),v(null),j("view"),k.reset(),a()};return(0,s.jsxs)(b.Z,{open:i,onClose:T,maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:3}},children:[(0,s.jsx)(f.Z,{sx:{fontWeight:600},children:"Add User Access"}),(0,s.jsxs)(Z.Z,{sx:{display:"flex",flexDirection:"column",gap:3,pt:"8px !important"},children:[k.isError&&(0,s.jsx)(c.Z,{severity:"error",sx:{mb:1},children:(null===(t=k.error)||void 0===t?void 0:t.message)||"Failed to grant access"}),(0,s.jsx)(eV.Z,{options:R,getOptionLabel:e=>e.name||e.email,isOptionEqualToValue:(e,t)=>e.id===t.id,value:p,onChange:(e,t)=>v(t),inputValue:u,onInputChange:(e,t)=>h(t),loading:S,filterOptions:e=>e,noOptionsText:u.length<2?"Type at least 2 characters":"No users found",renderInput:e=>(0,s.jsx)(C.Z,{...e,label:"Search User",placeholder:"Search by name or email...",InputProps:{...e.InputProps,endAdornment:(0,s.jsxs)(s.Fragment,{children:[S&&(0,s.jsx)(x.Z,{size:20}),e.InputProps.endAdornment]})}}),renderOption:(e,t)=>{var r,n,i;let{key:a,...l}=e;return(0,s.jsxs)(o.Z,{component:"li",...l,sx:{display:"flex",gap:1.5,py:1},children:[(0,s.jsx)(eq.Z,{src:null!==(i=t.image)&&void 0!==i?i:void 0,sx:{width:32,height:32,bgcolor:"primary.main",fontSize:14},children:((null===(r=t.name)||void 0===r?void 0:r[0])||(null===(n=t.email)||void 0===n?void 0:n[0])||"?").toUpperCase()}),(0,s.jsxs)(o.Z,{children:[(0,s.jsx)(m.Z,{variant:"body2",fontWeight:500,children:t.name||"Unknown"}),(0,s.jsx)(m.Z,{variant:"caption",color:"text.secondary",children:t.email})]})]},a)}}),(0,s.jsxs)(eb.Z,{children:[(0,s.jsx)(eJ.Z,{sx:{fontWeight:500,mb:1},children:"Permission Level"}),(0,s.jsxs)(eQ.Z,{value:y,onChange:e=>j(e.target.value),children:[(0,s.jsx)(eZ.Z,{value:"view",control:(0,s.jsx)(e_.Z,{size:"small"}),label:(0,s.jsxs)(o.Z,{children:[(0,s.jsx)(m.Z,{variant:"body2",fontWeight:500,children:"Viewer"}),(0,s.jsx)(m.Z,{variant:"caption",color:"text.secondary",children:"Can view server status and logs"})]})}),(0,s.jsx)(eZ.Z,{value:"manage",control:(0,s.jsx)(e_.Z,{size:"small"}),label:(0,s.jsxs)(o.Z,{children:[(0,s.jsx)(m.Z,{variant:"body2",fontWeight:500,children:"Operator"}),(0,s.jsx)(m.Z,{variant:"caption",color:"text.secondary",children:"Can start, stop, and configure the server"})]})}),(0,s.jsx)(eZ.Z,{value:"admin",control:(0,s.jsx)(e_.Z,{size:"small"}),label:(0,s.jsxs)(o.Z,{children:[(0,s.jsx)(m.Z,{variant:"body2",fontWeight:500,children:"Owner"}),(0,s.jsx)(m.Z,{variant:"caption",color:"text.secondary",children:"Full control including managing other users"})]})})]})]})]}),(0,s.jsxs)(w.Z,{sx:{px:3,pb:2},children:[(0,s.jsx)(l.Z,{onClick:T,color:"inherit",children:"Cancel"}),(0,s.jsx)(l.Z,{onClick:()=>{p&&k.mutate({userId:p.id,serverId:d,permission:y},{onSuccess:T})},variant:"contained",disabled:!p||k.isPending,sx:{borderRadius:2},children:k.isPending?"Adding...":"Add User"})]})]})}function e2(e){var t,r;let{serverId:i}=e,{data:a,isLoading:x,error:b}=(0,eX.a)({queryKey:["user-servers",i],queryFn:()=>(0,e0.SC)("/api/user-servers?serverId=".concat(encodeURIComponent(i))),enabled:!!i}),f=function(){let e=(0,e$.NL)();return(0,eY.D)({mutationFn:e=>{let{id:t,permission:r}=e;return(0,e0.SC)("/api/user-servers/".concat(encodeURIComponent(t)),{method:"PATCH",body:JSON.stringify({permission:r})})},onSuccess:()=>{e.invalidateQueries({queryKey:["user-servers"]})}})}(),Z=function(){let e=(0,e$.NL)();return(0,eY.D)({mutationFn:e=>(0,e0.SC)("/api/user-servers/".concat(encodeURIComponent(e)),{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["user-servers"]})}})}(),[w,C]=(0,n.useState)(!1),[S,k]=(0,n.useState)(null),[R,T]=(0,n.useState)(null),z=(e,t)=>{k(e.currentTarget),T(t)},W=()=>{k(null),T(null)},P=e=>{if(!R||R.permission===e){W();return}f.mutate({id:R.id,permission:e},{onSettled:W})},F=null!==(t=null==a?void 0:a.users.filter(e=>"admin"===e.permission).length)&&void 0!==t?t:0,M=(null==R?void 0:R.permission)==="admin"&&F<=1;if(x)return(0,s.jsx)(h.Z,{sx:{borderRadius:3},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,s.jsx)(u.Z,{variant:"text",width:"30%",height:32}),(0,s.jsx)(u.Z,{variant:"rounded",width:120,height:36,sx:{borderRadius:2}})]}),(0,s.jsx)(D.Z,{sx:{mb:2}}),[0,1,2].map(e=>(0,s.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:2,py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:[(0,s.jsx)(u.Z,{variant:"circular",width:40,height:40}),(0,s.jsxs)(o.Z,{sx:{flex:1},children:[(0,s.jsx)(u.Z,{variant:"text",width:"40%"}),(0,s.jsx)(u.Z,{variant:"text",width:"60%"})]}),(0,s.jsx)(u.Z,{variant:"rounded",width:80,height:28,sx:{borderRadius:10}}),(0,s.jsx)(u.Z,{variant:"circular",width:32,height:32})]},e))]})});if(b)return(0,s.jsxs)(c.Z,{severity:"error",children:["Failed to load access list: ",b.message]});let A=null!==(r=null==a?void 0:a.users)&&void 0!==r?r:[];return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h.Z,{sx:{borderRadius:3},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,s.jsx)(m.Z,{variant:"h6",fontWeight:600,children:"Server Access"}),(0,s.jsx)(l.Z,{variant:"contained",size:"small",startIcon:(0,s.jsx)(eN.Z,{}),onClick:()=>C(!0),sx:{borderRadius:2},children:"Add User"})]}),(0,s.jsx)(D.Z,{sx:{mb:1}}),0===A.length?(0,s.jsx)(o.Z,{sx:{py:4,textAlign:"center"},children:(0,s.jsx)(m.Z,{variant:"body2",color:"text.secondary",children:"No users have been granted access to this server yet."})}):A.map(e=>{var t,r,n,i,a,l,c,x;return(0,s.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:2,py:1.5,"&:not(:last-child)":{borderBottom:"1px solid",borderColor:"divider"}},children:[(0,s.jsx)(eq.Z,{src:null!==(x=null===(t=e.user)||void 0===t?void 0:t.image)&&void 0!==x?x:void 0,sx:{width:40,height:40,bgcolor:"primary.main",fontSize:16},children:((null===(n=e.user)||void 0===n?void 0:null===(r=n.name)||void 0===r?void 0:r[0])||(null===(a=e.user)||void 0===a?void 0:null===(i=a.email)||void 0===i?void 0:i[0])||"?").toUpperCase()}),(0,s.jsxs)(o.Z,{sx:{flex:1,minWidth:0},children:[(0,s.jsx)(m.Z,{variant:"body2",fontWeight:500,noWrap:!0,children:(null===(l=e.user)||void 0===l?void 0:l.name)||"Unknown User"}),(0,s.jsx)(m.Z,{variant:"caption",color:"text.secondary",noWrap:!0,children:(null===(c=e.user)||void 0===c?void 0:c.email)||e.userId})]}),(0,s.jsx)(eG,{permission:e.permission,size:"small"}),(0,s.jsx)(d.Z,{size:"small",onClick:t=>z(t,e),sx:{color:"text.secondary"},children:(0,s.jsx)(I.Z,{fontSize:"small"})})]},e.id)}),(0,s.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1,mt:2,pt:1},children:[(0,s.jsx)(eH.Z,{sx:{fontSize:16,color:"text.disabled"}}),(0,s.jsx)(m.Z,{variant:"caption",color:"text.disabled",children:"Only platform admins and server owners can manage access."})]})]})}),(0,s.jsxs)(v.Z,{anchorEl:S,open:!!S,onClose:W,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},disableScrollLock:!0,children:[(0,s.jsxs)(y.Z,{onClick:()=>P("admin"),disabled:(null==R?void 0:R.permission)==="admin",children:[(0,s.jsx)(j.Z,{children:(0,s.jsx)(eB.Z,{fontSize:"small"})}),(0,s.jsx)(g.Z,{children:"Change to Owner"})]}),(0,s.jsxs)(y.Z,{onClick:()=>P("manage"),disabled:(null==R?void 0:R.permission)==="manage"||M,children:[(0,s.jsx)(j.Z,{children:(0,s.jsx)(eU.Z,{fontSize:"small"})}),(0,s.jsx)(g.Z,{children:"Change to Operator"})]}),(0,s.jsxs)(y.Z,{onClick:()=>P("view"),disabled:(null==R?void 0:R.permission)==="view"||M,children:[(0,s.jsx)(j.Z,{children:(0,s.jsx)(eC.Z,{fontSize:"small"})}),(0,s.jsx)(g.Z,{children:"Change to Viewer"})]}),(0,s.jsx)(D.Z,{}),(0,s.jsxs)(y.Z,{onClick:()=>{R&&Z.mutate(R.id,{onSettled:W})},disabled:M,sx:{color:"error.main"},children:[(0,s.jsx)(j.Z,{children:(0,s.jsx)(eL.Z,{fontSize:"small",sx:{color:"error.main"}})}),(0,s.jsx)(g.Z,{children:"Remove Access"})]})]}),(0,s.jsx)(e1,{open:w,onClose:()=>C(!1),serverId:i})]})}var e3=r(37228),e6=r(97511);function e5(e){let{label:t,value:r,copyText:n}=e;return(0,s.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",py:1},children:[(0,s.jsx)(m.Z,{variant:"body2",color:"text.secondary",children:t}),(0,s.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,s.jsx)(m.Z,{variant:"body2",sx:{fontFamily:n?'"Roboto Mono", monospace':"inherit",color:n?"text.primary":"text.secondary",wordBreak:"break-all"},children:r}),n&&(0,s.jsx)(e6.q,{text:n,size:16})]})]})}function e4(e){let{serverName:t,hostname:r}=e,{data:n,isLoading:i}=(0,e3.UW)();if(i)return(0,s.jsx)(h.Z,{sx:{borderRadius:3},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsx)(u.Z,{variant:"text",width:"40%",height:28,sx:{mb:1}}),(0,s.jsx)(u.Z,{variant:"rectangular",height:1,sx:{mb:2}}),(0,s.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,s.jsx)(u.Z,{variant:"text",width:"30%"}),(0,s.jsx)(u.Z,{variant:"text",width:"40%"})]}),(0,s.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,s.jsx)(u.Z,{variant:"text",width:"30%"}),(0,s.jsx)(u.Z,{variant:"text",width:"40%"})]})]})});let a=(null==n?void 0:n.enabled)&&n.servers.length>0,l=null==n?void 0:n.servers.find(e=>e.serverName===t),d=(null==l?void 0:l.playitDomain)||"Not configured",c=!!(null==l?void 0:l.playitDomain);return(0,s.jsx)(h.Z,{sx:{borderRadius:3},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsx)(m.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Connection"}),(0,s.jsx)(D.Z,{sx:{mb:2}}),(0,s.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",py:1,gap:1},children:[(0,s.jsx)(m.Z,{variant:"body2",color:"text.secondary",sx:{flexShrink:0},children:"LAN Address"}),r?(0,s.jsx)(o.Z,{sx:{minWidth:0},children:(0,s.jsx)(e6.h,{hostname:r,portSuffix:25565,color:"text.primary",showCopyButton:!0})}):(0,s.jsx)(m.Z,{variant:"body2",color:"text.secondary",children:"Not configured"})]}),a&&(0,s.jsx)(e5,{label:"External Address",value:d,copyText:c?d:void 0})]})})}var e8=r(42431),e7=r(76777),e9=r(15761);function te(e){let{serverName:t}=e,{data:r,isLoading:i,error:a}=(0,eX.a)({queryKey:["servers",t,"mods"],queryFn:()=>(0,e0.SC)("/api/servers/".concat(encodeURIComponent(t),"/mods")),enabled:!!t}),u=function(){let e=(0,e$.NL)();return(0,eY.D)({mutationFn:e=>{let{serverName:t,slugs:r,source:s}=e;return(0,e0.SC)("/api/servers/".concat(encodeURIComponent(t),"/mods"),{method:"POST",body:JSON.stringify({slugs:r,source:s})})},onSuccess:(t,r)=>{let{serverName:s}=r;e.invalidateQueries({queryKey:["servers",s,"mods"]})}})}(),v=function(){let e=(0,e$.NL)();return(0,eY.D)({mutationFn:e=>{let{serverName:t,slug:r}=e;return(0,e0.SC)("/api/servers/".concat(encodeURIComponent(t),"/mods/").concat(encodeURIComponent(r)),{method:"DELETE"})},onSuccess:(t,r)=>{let{serverName:s}=r;e.invalidateQueries({queryKey:["servers",s,"mods"]})}})}(),[y,j]=(0,n.useState)(!1),[g,w]=(0,n.useState)(""),[S,k]=(0,n.useState)(""),[R,T]=(0,n.useState)(!1),[I,W]=(0,n.useState)({open:!1,message:"",severity:"info"}),{data:P,isLoading:F}=function(e,t){let r=new URLSearchParams;return e&&r.set("q",e),(null==t?void 0:t.limit)!=null&&r.set("limit",String(t.limit)),(null==t?void 0:t.offset)!=null&&r.set("offset",String(t.offset)),(0,eX.a)({queryKey:["mods","search",e,null==t?void 0:t.limit,null==t?void 0:t.offset],queryFn:()=>(0,e0.SC)("/api/mods/search?".concat(r)),enabled:(null==t?void 0:t.enabled)!==!1&&!!e.trim()})}(S,{limit:10,enabled:y&&S.length>0});(0,n.useEffect)(()=>{let e=setTimeout(()=>{k(g)},300);return()=>clearTimeout(e)},[g]);let M=(0,n.useCallback)(async e=>{try{await v.mutateAsync({serverName:t,slug:e}),T(!0),W({open:!0,message:"Removed ".concat(e),severity:"success"})}catch(e){W({open:!0,message:e instanceof Error?e.message:"Failed to remove mod",severity:"error"})}},[v,t]),E=(0,n.useCallback)(async e=>{try{await u.mutateAsync({serverName:t,slugs:[e]}),T(!0),W({open:!0,message:"Added ".concat(e),severity:"success"})}catch(e){W({open:!0,message:e instanceof Error?e.message:"Failed to add mod",severity:"error"})}},[u,t]),q=new Set;if(null==r?void 0:r.mods)for(let e of Object.values(r.mods))for(let t of e)q.add(t);if(i)return(0,s.jsx)(o.Z,{sx:{display:"flex",justifyContent:"center",py:6},children:(0,s.jsx)(x.Z,{})});if(a)return(0,s.jsxs)(c.Z,{severity:"error",sx:{mt:2},children:["Failed to load mods: ",a.message]});let B=q.size>0;return(0,s.jsxs)(o.Z,{children:[R&&(0,s.jsx)(c.Z,{severity:"info",sx:{mb:2},children:"Restart the server to apply mod changes."}),(0,s.jsx)(h.Z,{sx:{borderRadius:3},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,s.jsx)(m.Z,{variant:"h6",fontWeight:600,children:"Installed Mods"}),(0,s.jsx)(l.Z,{variant:"contained",size:"small",startIcon:(0,s.jsx)(eh.Z,{}),onClick:()=>{w(""),k(""),j(!0)},children:"Add Mods"})]}),(0,s.jsx)(D.Z,{sx:{mb:2}}),B?Object.entries(r.mods).map(e=>{let[t,r]=e;return(0,s.jsxs)(o.Z,{sx:{mb:2},children:[(0,s.jsx)(m.Z,{variant:"subtitle2",color:"text.secondary",sx:{mb:1,textTransform:"capitalize"},children:t}),(0,s.jsx)(o.Z,{sx:{display:"flex",flexWrap:"wrap",gap:1},children:r.map(e=>(0,s.jsx)(A.Z,{label:e,icon:(0,s.jsx)(e7.Z,{}),onDelete:()=>M(e),deleteIcon:(0,s.jsx)(z.Z,{}),variant:"outlined"},e))})]},t)}):(0,s.jsxs)(o.Z,{sx:{textAlign:"center",py:4},children:[(0,s.jsx)(e7.Z,{sx:{fontSize:48,color:"text.disabled",mb:1}}),(0,s.jsx)(m.Z,{variant:"body1",color:"text.secondary",children:"No mods installed"}),(0,s.jsx)(m.Z,{variant:"body2",color:"text.disabled",sx:{mt:.5},children:'Click "Add Mods" to search and install mods from Modrinth'})]})]})}),(0,s.jsxs)(b.Z,{open:y,onClose:()=>j(!1),maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{minHeight:400}},children:[(0,s.jsxs)(f.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:["Search Mods",(0,s.jsx)(d.Z,{onClick:()=>j(!1),size:"small",children:(0,s.jsx)(N.Z,{})})]}),(0,s.jsxs)(Z.Z,{children:[(0,s.jsx)(C.Z,{fullWidth:!0,autoFocus:!0,placeholder:"Search Modrinth...",value:g,onChange:e=>w(e.target.value),InputProps:{startAdornment:(0,s.jsx)(O.Z,{position:"start",children:(0,s.jsx)(e8.Z,{})})},sx:{mb:2}}),F&&(0,s.jsx)(o.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,s.jsx)(x.Z,{size:28})}),!F&&P&&0===P.hits.length&&S&&(0,s.jsxs)(m.Z,{variant:"body2",color:"text.secondary",sx:{textAlign:"center",py:4},children:['No mods found for "',S,'"']}),!F&&P&&P.hits.length>0&&(0,s.jsx)(o.Z,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:P.hits.map(e=>{var t;let r=q.has(e.slug);return(0,s.jsx)(h.Z,{variant:"outlined",sx:{borderRadius:2},children:(0,s.jsx)(p.Z,{sx:{py:1.5,px:2,"&:last-child":{pb:1.5}},children:(0,s.jsxs)(o.Z,{sx:{display:"flex",gap:1.5,alignItems:"flex-start"},children:[(0,s.jsx)(eq.Z,{src:e.iconUrl||void 0,variant:"rounded",sx:{width:40,height:40,bgcolor:"action.hover"},children:(0,s.jsx)(e7.Z,{})}),(0,s.jsxs)(o.Z,{sx:{flex:1,minWidth:0},children:[(0,s.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsx)(m.Z,{variant:"subtitle2",noWrap:!0,children:e.title}),(0,s.jsx)(l.Z,{size:"small",variant:r?"outlined":"contained",disabled:r||u.isPending,onClick:()=>E(e.slug),sx:{ml:1,minWidth:80,flexShrink:0},children:r?"Installed":"Add"})]}),(0,s.jsx)(m.Z,{variant:"body2",color:"text.secondary",sx:{mt:.25,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:e.description}),(0,s.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1,mt:.5},children:[(0,s.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:.25},children:[(0,s.jsx)(e9.Z,{sx:{fontSize:14,color:"text.disabled"}}),(0,s.jsx)(m.Z,{variant:"caption",color:"text.disabled",children:(t=e.downloads)>=1e6?"".concat((t/1e6).toFixed(1),"M"):t>=1e3?"".concat((t/1e3).toFixed(1),"K"):String(t)})]}),e.author&&(0,s.jsxs)(m.Z,{variant:"caption",color:"text.disabled",children:["by ",e.author]})]})]})]})})},e.slug)})})]})]}),(0,s.jsx)(ea.Z,{open:I.open,autoHideDuration:4e3,onClose:()=>W(e=>({...e,open:!1})),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:(0,s.jsx)(c.Z,{onClose:()=>W(e=>({...e,open:!1})),severity:I.severity,variant:"filled",children:I.message})})]})}let tt=["Overview","Activity","Mods","Files","Backups","Access","Options"];function tr(e){return e.replace(/\x1b\[\?[\d;]*[a-zA-Z]/g,"").replace(/\x1b\[[0-9;]*[a-zA-Z]/g,"").replace(/\x1b=/g,"").replace(/\[\?[\d;]*[a-zA-Z]/g,"").replace(/\[[0-9;]*[a-zA-Z]/g,"").replace(/\[m/g,"").replace(/>\.\.\.\.\r?/g,"").replace(/\r/g,"").trim()}function ts(e){var t,r,i,a,c;let{server:x,onSendCommand:u}=e,[v,y]=(0,n.useState)("Overview"),[j,g]=(0,n.useState)(""),[f,w]=(0,n.useState)(!0),[R,T]=(0,n.useState)(!1),I=(0,n.useRef)(null),z=(0,E.Z)(),W=(0,q.Z)(z.breakpoints.down("sm")),{logs:P,isConnected:F}=(0,Q.Y)({serverName:x.name}),M=(0,n.useMemo)(()=>P.filter(e=>!e.includes("RCON Listener")&&!e.includes("RCON Client")&&!e.includes("RconClient")),[P]);(0,n.useEffect)(()=>{I.current&&f&&(I.current.scrollTop=I.current.scrollHeight)},[M,f]);let V=async()=>{j.trim()&&u&&(await u(j.trim()),g(""))},X=null!==(a=null===(t=x.stats)||void 0===t?void 0:t.cpuPercent)&&void 0!==a?a:0;(null===(r=x.stats)||void 0===r?void 0:r.memoryUsage)&&x.stats.memoryUsage,function(e){if(!e)return;let t=e.match(/^(\d+)\s*(M|G)?$/i);if(t)parseInt(t[1],10),(t[2]||"M").toUpperCase()}(x.memory);let $=null!==(c=null===(i=x.stats)||void 0===i?void 0:i.memoryPercent)&&void 0!==c?c:0;return(0,s.jsxs)(o.Z,{children:[(0,s.jsx)(o.Z,{sx:{display:"flex",flexWrap:"wrap",gap:.5,mb:3},children:tt.map(e=>(0,s.jsx)(l.Z,{onClick:()=>y(e),sx:{px:2,py:1,borderRadius:5,fontSize:14,fontWeight:500,textTransform:"none",bgcolor:v===e?"primary.main":"transparent",color:v===e?"#0a0e14":"text.secondary","&:hover":{bgcolor:v===e?"primary.main":(0,k.Fq)("#1bd96a",.1)}},children:e},e))}),(0,s.jsxs)(o.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(3, 1fr)"},gap:2,mb:2.5},children:[(0,s.jsx)(J,{value:"".concat(X.toFixed(2),"%"),unit:"/ 100%",label:"CPU usage",icon:(0,s.jsx)(B.Z,{sx:{fontSize:28}}),progress:X,progressMax:100,color:"#1bd96a"}),(0,s.jsx)(J,{value:"".concat($.toFixed(2),"%"),unit:"/ 100%",label:"Memory usage",icon:(0,s.jsx)(U.Z,{sx:{fontSize:28}}),progress:$,progressMax:100,color:"#1bd96a"}),(0,s.jsx)(J,{value:x.worldSize||"0 B",unit:"/ 10 GB",label:"World size",icon:(0,s.jsx)(L.Z,{sx:{fontSize:28}}),progress:function(e){if(!e)return 0;let t=e.match(/^([\d.]+)\s*(B|KB|MB|MiB|GB|GiB)?$/i);if(!t)return 0;let r=parseFloat(t[1]);switch((t[2]||"B").toUpperCase()){case"GB":case"GIB":return 1024*r;case"MB":case"MIB":return r;case"KB":return r/1024;default:return r/1048576}}(x.worldSize),progressMax:10240,color:"#1bd96a"})]}),(0,s.jsxs)(h.Z,{sx:{bgcolor:"background.paper",borderRadius:3,border:"1px solid",borderColor:"divider",overflow:"hidden"},children:[(0,s.jsxs)(o.Z,{sx:{px:3,py:2,borderBottom:"1px solid",borderColor:"divider",display:"flex",alignItems:"center",gap:1.25},children:[(0,s.jsx)(m.Z,{variant:"h6",sx:{fontWeight:700,color:"text.primary"},children:"Console"}),(0,s.jsx)(o.Z,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:F?"primary.main":"error.main",boxShadow:F?"0 0 8px rgba(27, 217, 106, 0.4)":"0 0 8px rgba(239, 68, 68, 0.4)"}})]}),(0,s.jsxs)(o.Z,{sx:{position:"relative"},children:[(0,s.jsx)(o.Z,{ref:I,onScroll:()=>{if(!I.current)return;let{scrollTop:e,scrollHeight:t,clientHeight:r}=I.current;w(t-e-r<30)},sx:{height:{xs:240,sm:360},overflowY:"auto",px:2.5,py:2,fontFamily:'"Roboto Mono", monospace',fontSize:13,lineHeight:1.85,color:"#b4b6c4",bgcolor:"#0a0a0a",scrollbarWidth:"thin",scrollbarColor:"#3a3d4e #0a0a0a","&::-webkit-scrollbar":{width:8},"&::-webkit-scrollbar-track":{bgcolor:"#0a0a0a"},"&::-webkit-scrollbar-thumb":{bgcolor:"#3a3d4e",borderRadius:4}},children:0===M.length?(0,s.jsx)(m.Z,{sx:{color:"text.secondary",textAlign:"center",py:8},children:"Waiting for logs..."}):M.map((e,t)=>{let r=function(e){let t=tr(e).match(/\[(\d{2}:\d{2}:\d{2})\]\s*\[([^/]+)\/(\w+)\]:\s*(.+)/);return t?{time:t[1],thread:t[2],level:t[3]||"INFO",msg:t[4]}:null}(e);return r?(0,s.jsxs)(o.Z,{sx:{display:"flex",gap:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[(0,s.jsxs)(o.Z,{component:"span",sx:{color:"#4a4d60"},children:["[",r.time,"]"]}),(0,s.jsxs)(o.Z,{component:"span",sx:{color:"#4a4d60"},children:["\xa0[",r.thread,"/",(0,s.jsx)(o.Z,{component:"span",sx:{color:"WARN"===r.level?"#e8a848":"#6b6e80"},children:r.level}),"]:\xa0"]}),(0,s.jsx)(o.Z,{component:"span",sx:{color:"WARN"===r.level?"#c4a45a":"#b4b6c4"},children:r.msg})]},t):(0,s.jsx)(o.Z,{sx:{color:"#b4b6c4"},children:tr(e)},t)})}),(0,s.jsx)(d.Z,{onClick:()=>T(!0),sx:{position:"absolute",top:12,right:12,width:36,height:36,borderRadius:2,bgcolor:"#282a3a",border:"1px solid #3a3d4e",color:"#8b8da0","&:hover":{bgcolor:"#313440"}},children:(0,s.jsx)(H.Z,{sx:{fontSize:18}})}),!f&&(0,s.jsx)(d.Z,{onClick:()=>{I.current&&I.current.scrollTo({top:I.current.scrollHeight,behavior:"smooth"})},sx:{position:"absolute",bottom:12,right:12,width:36,height:36,borderRadius:2,bgcolor:"#282a3a",border:"1px solid #3a3d4e",color:"#8b8da0","&:hover":{bgcolor:"#313440"}},children:(0,s.jsx)(K.Z,{sx:{fontSize:18}})})]}),(0,s.jsx)(o.Z,{sx:{px:2.5,py:1.5,borderTop:"1px solid",borderColor:"divider"},children:(0,s.jsx)(C.Z,{fullWidth:!0,size:"small",placeholder:"Send a command",value:j,onChange:e=>g(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),V())},disabled:!F,InputProps:{startAdornment:(0,s.jsx)(O.Z,{position:"start",children:(0,s.jsx)(G.Z,{sx:{fontSize:16,color:"#999"}})}),sx:{bgcolor:"#13141c",borderRadius:2,fontFamily:'"Roboto Mono", monospace',fontSize:14,"& .MuiOutlinedInput-notchedOutline":{borderColor:"#2a2d3e"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#3a3d4e"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"primary.main"}}}})})]}),"Overview"===v&&(0,s.jsxs)(S.ZP,{container:!0,spacing:3,sx:{mt:1},children:[(0,s.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,s.jsx)(h.Z,{sx:{borderRadius:3},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsx)(m.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Server Information"}),(0,s.jsx)(D.Z,{sx:{mb:2}}),(0,s.jsx)(tn,{label:"Name",value:x.name}),(0,s.jsx)(tn,{label:"Container",value:x.container}),(0,s.jsx)(tn,{label:"Hostname",value:x.hostname?(0,s.jsx)(e6.h,{hostname:x.hostname,color:"text.primary"}):void 0}),(0,s.jsx)(tn,{label:"Type",value:x.type}),(0,s.jsx)(tn,{label:"Version",value:x.version}),(0,s.jsx)(tn,{label:"Memory",value:x.memory}),(0,s.jsx)(tn,{label:"Uptime",value:x.uptime||function(e){if(!e||e<0)return"0s";let t=Math.floor(e/3600),r=Math.floor(e%3600/60),s=e%60;return t>0?"".concat(t,"h ").concat(r,"m"):r>0?"".concat(r,"m ").concat(s,"s"):"".concat(s,"s")}(x.uptimeSeconds)})]})})}),(0,s.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,s.jsx)(h.Z,{sx:{borderRadius:3},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsx)(m.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Players"}),(0,s.jsx)(D.Z,{sx:{mb:2}}),x.players?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tn,{label:"Online",value:"".concat(x.players.online," / ").concat(x.players.max)}),x.players.players&&x.players.players.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.Z,{variant:"body2",color:"text.secondary",sx:{mt:2,mb:1},children:"Online Players"}),(0,s.jsx)(o.Z,{sx:{display:"flex",flexWrap:"wrap",gap:1},children:x.players.players.map(e=>(0,s.jsx)(A.Z,{label:e,size:"small"},e))})]})]}):(0,s.jsx)(m.Z,{variant:"body2",color:"text.secondary",children:"Player information unavailable"})]})})}),(0,s.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,s.jsx)(e4,{serverName:x.name,hostname:x.hostname})})]}),"Activity"===v&&(0,s.jsx)(o.Z,{sx:{mt:3},children:(0,s.jsx)(h.Z,{sx:{borderRadius:3},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsx)(m.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Server Activity"}),(0,s.jsx)(D.Z,{sx:{mb:2}}),(0,s.jsx)(ei,{serverName:x.name})]})})}),"Mods"===v&&(0,s.jsx)(o.Z,{sx:{mt:3},children:(0,s.jsx)(te,{serverName:x.name})}),"Files"===v&&(0,s.jsx)(o.Z,{sx:{mt:3},children:(0,s.jsx)(m.Z,{variant:"body1",color:"text.secondary",children:"File browser coming soon"})}),"Backups"===v&&(0,s.jsx)(o.Z,{sx:{mt:3},children:(0,s.jsx)(m.Z,{variant:"body1",color:"text.secondary",children:"Backup management coming soon"})}),"Access"===v&&(0,s.jsx)(o.Z,{sx:{mt:3},children:(0,s.jsx)(e2,{serverId:x.name})}),"Options"===v&&(0,s.jsx)(o.Z,{sx:{mt:3},children:(0,s.jsx)(eE,{serverName:x.name,isRunning:"running"===x.status})}),(0,s.jsxs)(b.Z,{open:R,onClose:()=>T(!1),maxWidth:"xl",fullWidth:!0,fullScreen:W,PaperProps:{sx:{height:W?"100vh":"90vh",bgcolor:"background.paper"}},children:[(0,s.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",p:2,borderBottom:1,borderColor:"divider"},children:[(0,s.jsxs)(m.Z,{variant:"h6",sx:{fontFamily:'"Minecraft", sans-serif',fontWeight:400,letterSpacing:"0.05em"},children:["Console - ",x.name]}),(0,s.jsx)(d.Z,{onClick:()=>T(!1),"aria-label":"Close console",children:(0,s.jsx)(N.Z,{})})]}),(0,s.jsx)(Z.Z,{sx:{p:0,display:"flex",flexDirection:"column"},children:(0,s.jsx)(_.K,{serverName:x.name})})]})]})}function tn(e){let{label:t,value:r}=e;return r?(0,s.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,s.jsx)(m.Z,{variant:"body2",color:"text.secondary",children:t}),(0,s.jsx)(m.Z,{variant:"body2",component:"div",sx:{fontWeight:500},children:r})]}):null}var ti=r(93757);function ta(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,s.jsx)("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]})}function to(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("path",{d:"M21 2v6h-6"}),(0,s.jsx)("path",{d:"M3 12a9 9 0 0115.36-6.36L21 8"}),(0,s.jsx)("path",{d:"M3 22v-6h6"}),(0,s.jsx)("path",{d:"M21 12a9 9 0 01-15.36 6.36L3 16"})]})}function tl(){var e,t,r,A;let O=(0,i.useParams)(),D=(0,a.x)(),E=decodeURIComponent(O.name),{data:q,isLoading:N,error:B}=(0,ec.Hy)(E),{status:U,health:L}=function(e){let{serverName:t,onStatusChange:r,enabled:s=!0,reconnectInterval:i=3e3}=e,[a,o]=(0,n.useState)(null),[l,d]=(0,n.useState)(null);(0,n.useEffect)(()=>{o(null),d(null)},[t]);let c=(0,n.useCallback)(e=>{if("server-status"===e.type){let t=e.data.status,s=e.data.health;o(t),d(s),null==r||r(t,s)}},[r]),{isConnected:x,reconnect:u,retryCount:h}=(0,ti.D)({url:"/api/sse/servers/".concat(encodeURIComponent(t),"/status"),onMessage:c,enabled:s,reconnectInterval:i});return{status:a,health:l,isConnected:x,reconnect:u,retryCount:h}}({serverName:E,enabled:!!E}),[H,K]=(0,n.useState)(null),[G,V]=(0,n.useState)(!1),[J,Q]=(0,n.useState)(""),_=(0,ec.jM)(),X=(0,ec.Aw)(),$=(0,ec._I)(),Y=(0,ec.Hq)(),ee=async()=>{try{await _.mutateAsync(E)}catch(e){console.error("Failed to start server:",e)}},et=async()=>{try{await X.mutateAsync(E)}catch(e){console.error("Failed to stop server:",e)}},er=async()=>{try{await $.mutateAsync(E)}catch(e){console.error("Failed to restart server:",e)}},es=async e=>{try{await fetch("/api/servers/".concat(encodeURIComponent(E),"/exec"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:e})})}catch(e){console.error("Failed to send command:",e)}},en=U||(null==q?void 0:q.server.status),ei=_.isPending||X.isPending||$.isPending,ea=null==q?void 0:q.server;return(0,s.jsxs)(s.Fragment,{children:[B&&(0,s.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to load server: ",B.message]}),_.isError&&(0,s.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to start server: ",null===(e=_.error)||void 0===e?void 0:e.message]}),X.isError&&(0,s.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to stop server: ",null===(t=X.error)||void 0===t?void 0:t.message]}),$.isError&&(0,s.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to restart server: ",null===(r=$.error)||void 0===r?void 0:r.message]}),Y.isError&&(0,s.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to delete server: ",null===(A=Y.error)||void 0===A?void 0:A.message]}),N?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:2,mb:2.5},children:[(0,s.jsx)(u.Z,{variant:"rounded",width:64,height:64,sx:{borderRadius:3,flexShrink:0}}),(0,s.jsxs)(o.Z,{sx:{flex:1},children:[(0,s.jsx)(u.Z,{variant:"text",width:80,height:18,sx:{mb:.5}}),(0,s.jsx)(u.Z,{variant:"text",width:"40%",height:40}),(0,s.jsxs)(o.Z,{sx:{display:"flex",gap:2,mt:.75},children:[(0,s.jsx)(u.Z,{variant:"text",width:100}),(0,s.jsx)(u.Z,{variant:"text",width:60}),(0,s.jsx)(u.Z,{variant:"text",width:140}),(0,s.jsx)(u.Z,{variant:"text",width:50})]})]}),(0,s.jsxs)(o.Z,{sx:{display:"flex",gap:1,flexShrink:0},children:[(0,s.jsx)(u.Z,{variant:"rounded",width:90,height:40,sx:{borderRadius:2}}),(0,s.jsx)(u.Z,{variant:"rounded",width:36,height:36,sx:{borderRadius:2}})]})]}),(0,s.jsx)(o.Z,{sx:{display:"flex",gap:.5,mb:3},children:[80,70,65,50,65,65].map((e,t)=>(0,s.jsx)(u.Z,{variant:"rounded",width:e,height:36,sx:{borderRadius:5}},t))}),(0,s.jsx)(o.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(3, 1fr)"},gap:2,mb:2.5},children:[0,1,2].map(e=>(0,s.jsx)(h.Z,{sx:{borderRadius:3},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1.5},children:[(0,s.jsx)(u.Z,{variant:"text",width:"50%"}),(0,s.jsx)(u.Z,{variant:"circular",width:28,height:28})]}),(0,s.jsx)(u.Z,{variant:"text",width:"60%",height:36}),(0,s.jsx)(u.Z,{variant:"rounded",width:"100%",height:6,sx:{borderRadius:3,mt:1}})]})},e))}),(0,s.jsxs)(h.Z,{sx:{borderRadius:3,border:"1px solid",borderColor:"divider"},children:[(0,s.jsxs)(o.Z,{sx:{px:3,py:2,borderBottom:"1px solid",borderColor:"divider",display:"flex",alignItems:"center",gap:1.25},children:[(0,s.jsx)(u.Z,{variant:"text",width:80,height:28}),(0,s.jsx)(u.Z,{variant:"circular",width:10,height:10})]}),(0,s.jsx)(u.Z,{variant:"rectangular",height:360,sx:{bgcolor:"#0a0a0a"}}),(0,s.jsx)(o.Z,{sx:{px:2.5,py:1.5,borderTop:"1px solid",borderColor:"divider"},children:(0,s.jsx)(u.Z,{variant:"rounded",width:"100%",height:40,sx:{borderRadius:2}})})]}),(0,s.jsxs)(S.ZP,{container:!0,spacing:3,sx:{mt:1},children:[(0,s.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,s.jsx)(h.Z,{sx:{borderRadius:3},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsx)(u.Z,{variant:"text",width:"40%",height:28,sx:{mb:1}}),(0,s.jsx)(u.Z,{variant:"rectangular",height:1,sx:{mb:2}}),[0,1,2,3,4,5,6].map(e=>(0,s.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,s.jsx)(u.Z,{variant:"text",width:"30%"}),(0,s.jsx)(u.Z,{variant:"text",width:"40%"})]},e))]})})}),(0,s.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,s.jsx)(h.Z,{sx:{borderRadius:3},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsx)(u.Z,{variant:"text",width:"30%",height:28,sx:{mb:1}}),(0,s.jsx)(u.Z,{variant:"rectangular",height:1,sx:{mb:2}}),(0,s.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,s.jsx)(u.Z,{variant:"text",width:"25%"}),(0,s.jsx)(u.Z,{variant:"text",width:"20%"})]})]})})})]})]}):ea?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:2,mb:2.5},children:[(0,s.jsx)(o.Z,{sx:{width:64,height:64,borderRadius:3,overflow:"hidden",bgcolor:"background.paper",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,border:"1px solid",borderColor:"divider",fontSize:36},children:function(e){if(!e)return"\uD83C\uDFAE";let t=e.toUpperCase();return["PAPER","SPIGOT","BUKKIT","PURPUR"].includes(t)?"\uD83D\uDD0C":["FORGE","NEOFORGE","FABRIC","QUILT"].includes(t)?"\uD83D\uDD27":"\uD83C\uDFAE"}(ea.type)}),(0,s.jsxs)(o.Z,{sx:{flex:1},children:[(0,s.jsxs)(m.Z,{onClick:()=>D.push("/servers"),sx:{fontSize:12,color:"primary.main",cursor:"pointer",mb:.25,display:"flex",alignItems:"center",gap:.5,"&:hover":{textDecoration:"underline"}},children:[(0,s.jsx)(R.Z,{sx:{fontSize:14}})," All servers"]}),(0,s.jsx)(m.Z,{variant:"h4",component:"h1",sx:{fontFamily:'"Minecraft", sans-serif',fontWeight:400,color:"text.primary",letterSpacing:"0.5px",m:0,textTransform:"uppercase"},children:E}),(0,s.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:0,mt:.75,flexWrap:"wrap",fontSize:13,color:"text.secondary"},children:[ea.version&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,s.jsx)(W.Z,{sx:{fontSize:14}}),"Minecraft ",ea.version]}),(0,s.jsx)(o.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),ea.type&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,s.jsx)(P.Z,{sx:{fontSize:14}}),ea.type]}),(0,s.jsx)(o.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),ea.hostname&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,s.jsx)(F.Z,{sx:{fontSize:14}}),(0,s.jsx)(e6.h,{hostname:ea.hostname,fontSize:13})]}),(0,s.jsx)(o.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),(0,s.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,s.jsx)(M.Z,{sx:{fontSize:14}}),ea.uptime||function(e){if(!e||e<0)return"0s";let t=Math.floor(e/3600),r=Math.floor(e%3600/60),s=e%60;return t>0?"".concat(t,"h ").concat(r,"m"):r>0?"".concat(r,"m ").concat(s,"s"):"".concat(s,"s")}(ea.uptimeSeconds)||"0s"]})]})]}),(0,s.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1.25,flexShrink:0},children:[("stopped"===en||"exited"===en||"not_created"===en)&&(0,s.jsx)(l.Z,{variant:"contained",color:"success",startIcon:ei?(0,s.jsx)(x.Z,{size:16,color:"inherit"}):(0,s.jsx)(T.Z,{}),onClick:ee,disabled:ei,sx:{px:2,py:1,borderRadius:2,fontSize:14,fontWeight:600},children:"Start"}),"running"===en&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.Z,{variant:"outlined",startIcon:ei?(0,s.jsx)(x.Z,{size:16}):(0,s.jsx)(ta,{}),onClick:et,disabled:ei,sx:{px:2,py:1,borderRadius:2,fontSize:14,fontWeight:500,borderColor:"divider",color:"text.secondary","&:hover":{borderColor:"text.secondary",bgcolor:(0,k.Fq)("#fff",.05)}},children:"Stop"}),(0,s.jsx)(l.Z,{variant:"contained",startIcon:ei?(0,s.jsx)(x.Z,{size:16,color:"inherit"}):(0,s.jsx)(to,{}),onClick:er,disabled:ei,sx:{px:2,py:1,borderRadius:2,fontSize:14,fontWeight:600,bgcolor:"primary.main",color:"#0a0e14","&:hover":{bgcolor:"primary.dark"}},children:"Restart"})]}),(0,s.jsx)(d.Z,{onClick:e=>K(e.currentTarget),sx:{width:36,height:36,borderRadius:2,border:"1px solid",borderColor:"divider",color:"text.secondary"},children:(0,s.jsx)(I.Z,{sx:{fontSize:18}})}),(0,s.jsx)(v.Z,{anchorEl:H,open:!!H,onClose:()=>K(null),children:(0,s.jsxs)(y.Z,{onClick:()=>{K(null),V(!0),Q("")},sx:{color:"error.main"},children:[(0,s.jsx)(j.Z,{children:(0,s.jsx)(z.Z,{fontSize:"small",sx:{color:"error.main"}})}),(0,s.jsx)(g.Z,{children:"Delete Server"})]})})]})]}),(0,s.jsx)(ts,{server:ea,onSendCommand:es})]}):(0,s.jsx)(c.Z,{severity:"warning",children:"Server not found"}),(0,s.jsxs)(b.Z,{open:G,onClose:()=>{V(!1),Q("")},maxWidth:"sm",fullWidth:!0,children:[(0,s.jsx)(f.Z,{children:"Delete Server"}),(0,s.jsxs)(Z.Z,{children:[(0,s.jsxs)(m.Z,{sx:{mb:2},children:["This action cannot be undone. Type ",(0,s.jsx)("strong",{children:E})," to confirm deletion."]}),(0,s.jsx)(C.Z,{label:"Server name",value:J,onChange:e=>Q(e.target.value),fullWidth:!0,autoFocus:!0})]}),(0,s.jsxs)(w.Z,{sx:{px:3,pb:2},children:[(0,s.jsx)(l.Z,{onClick:()=>{V(!1),Q("")},children:"Cancel"}),(0,s.jsx)(l.Z,{variant:"contained",color:"error",onClick:()=>{J===E&&Y.mutate({name:E,force:!0},{onSuccess:()=>{D.push("/servers")}})},disabled:J!==E||Y.isPending,startIcon:Y.isPending?(0,s.jsx)(x.Z,{size:16}):null,children:Y.isPending?"Deleting...":"Delete"})]})]})]})}},56813:function(e,t,r){"use strict";r.d(t,{I:function(){return a}});var s=r(94655),n=r(25333),i=r(82925);function a(e){let{action:t,size:r="small"}=e,a=i.Lu[t]||"default",o=i.n3[t]||t;return(0,s.jsx)(n.Z,{label:o,color:a,size:r,variant:"filled",sx:{fontWeight:600,fontSize:"small"===r?"0.7rem":"0.8rem"}})}},26892:function(e,t,r){"use strict";r.d(t,{c:function(){return o}});var s=r(94655),n=r(25333),i=r(46207),a=r(43436);function o(e){let{status:t,size:r="small"}=e;return(0,s.jsx)(n.Z,{icon:"success"===t?(0,s.jsx)(i.Z,{}):(0,s.jsx)(a.Z,{}),label:"success"===t?"OK":"Error",color:"success"===t?"success":"error",size:r,variant:"outlined",sx:{fontWeight:500,fontSize:"small"===r?"0.7rem":"0.8rem"}})}},97511:function(e,t,r){"use strict";r.d(t,{q:function(){return l},h:function(){return p}});var s=r(94655),n=r(35106),i=r(79983),a=r(10449),o=r(24559);function l(e){let{text:t,size:r=14}=e,[l,d]=(0,n.useState)(!1),c=async e=>{e.stopPropagation();try{await navigator.clipboard.writeText(t),d(!0),setTimeout(()=>d(!1),2e3)}catch(e){}};return(0,s.jsx)(i.Z,{size:"small",onClick:c,sx:{ml:.5,p:.25,color:l?"success.main":"text.secondary","&:hover":{bgcolor:"action.hover"}},"aria-label":l?"Copied":"Copy to clipboard",children:l?(0,s.jsx)(o.Z,{sx:{fontSize:r}}):(0,s.jsx)(a.Z,{sx:{fontSize:r}})})}var d=r(7281),c=r(31317),x=r(25333),u=r(93300);function h(e){return e?e.split(",").map(e=>e.trim()).filter(Boolean):[]}function p(e){let{hostname:t,portSuffix:r,color:i="text.secondary",fontSize:a,showCopyButton:o=!1}=e,[p,m]=(0,n.useState)(null),v=h(t),y=function(e){let t=h(e);return 0===t.length?"-":t.find(e=>e.endsWith(".local"))||t[0]}(t),j=e=>r?"".concat(e,":").concat(r):e;return 0===v.length?(0,s.jsx)(d.Z,{component:"span",sx:{color:i,fontSize:a,display:"inline"},children:"-"}):1===v.length?(0,s.jsxs)(d.Z,{component:"span",sx:{display:"inline-flex",alignItems:"center"},children:[(0,s.jsx)(d.Z,{component:"span",sx:{color:i,fontSize:a,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:j(y)}),o&&(0,s.jsx)(l,{text:j(y)})]}):(0,s.jsxs)(d.Z,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75,minWidth:0},children:[(0,s.jsx)(d.Z,{component:"span",sx:{color:i,fontSize:a,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:j(y)}),(0,s.jsx)(x.Z,{label:"+".concat(v.length-1),size:"small",onClick:e=>{e.stopPropagation(),m(e.currentTarget)},sx:{height:20,fontSize:11,cursor:"pointer","& .MuiChip-label":{px:.75}}}),(0,s.jsx)(u.ZP,{open:!!p,anchorEl:p,onClose:()=>{m(null)},onClick:e=>e.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,s.jsx)(d.Z,{sx:{p:1.5,minWidth:200},children:v.map(e=>(0,s.jsxs)(d.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:.5},children:[(0,s.jsx)(c.Z,{variant:"body2",sx:{fontFamily:'"Roboto Mono", monospace',fontSize:12},children:j(e)}),(0,s.jsx)(l,{text:j(e)})]},e))})})]})}},84509:function(e,t,r){"use strict";r.d(t,{DM:function(){return a},HZ:function(){return l},VM:function(){return o},hT:function(){return i},oL:function(){return d}});var s=r(5632),n=r(42936);function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=function(e){let t=new URLSearchParams;e.action&&t.set("action",e.action),e.actor&&t.set("actor",e.actor),e.targetType&&t.set("targetType",e.targetType),e.targetName&&t.set("targetName",e.targetName),e.status&&t.set("status",e.status),e.from&&t.set("from",e.from),e.to&&t.set("to",e.to),void 0!==e.limit&&t.set("limit",String(e.limit)),void 0!==e.offset&&t.set("offset",String(e.offset)),e.sort&&t.set("sort",e.sort);let r=t.toString();return r?"?".concat(r):""}(e);return(0,s.a)({queryKey:["audit-logs",e],queryFn:()=>(0,n.SC)("/api/audit-logs".concat(r)),enabled:(null==t?void 0:t.enabled)!==!1})}function a(e){return(0,s.a)({queryKey:["audit-logs","stats"],queryFn:()=>(0,n.SC)("/api/audit-logs/stats"),enabled:(null==e?void 0:e.enabled)!==!1,refetchInterval:3e4})}function o(e,t){return(0,s.a)({queryKey:["audit-logs",e],queryFn:()=>(0,n.SC)("/api/audit-logs/".concat(encodeURIComponent(e))),enabled:(null==t?void 0:t.enabled)!==!1&&!!e})}function l(e,t){var r;return i({targetType:"server",targetName:e,limit:null!==(r=null==t?void 0:t.limit)&&void 0!==r?r:20},{enabled:(null==t?void 0:t.enabled)!==!1&&!!e})}function d(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return i({limit:e,sort:"timestamp:desc"})}},37228:function(e,t,r){"use strict";r.d(t,{Bc:function(){return l},N$:function(){return d},UW:function(){return o}});var s=r(5632),n=r(58919),i=r(20367),a=r(42936);function o(){return(0,s.a)({queryKey:["playit-status"],queryFn:()=>(0,a.SC)("/api/playit/status"),refetchInterval:3e4})}function l(){let e=(0,n.NL)();return(0,i.D)({mutationFn:()=>(0,a.SC)("/api/playit/start",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["playit-status"]})}})}function d(){let e=(0,n.NL)();return(0,i.D)({mutationFn:()=>(0,a.SC)("/api/playit/stop",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["playit-status"]})}})}},82925:function(e,t,r){"use strict";r.d(t,{KK:function(){return o},Lu:function(){return s},Xn:function(){return a},n3:function(){return n},xg:function(){return i}});let s={"server.create":"success","server.delete":"error","server.start":"info","server.stop":"warning","server.restart":"secondary","player.whitelist.add":"success","player.whitelist.remove":"warning","player.ban":"error","player.unban":"success","player.op":"info","player.deop":"warning","player.kick":"error","audit.purge":"default"},n={"server.create":"Create","server.delete":"Delete","server.start":"Start","server.stop":"Stop","server.restart":"Restart","player.whitelist.add":"Whitelist Add","player.whitelist.remove":"Whitelist Remove","player.ban":"Ban","player.unban":"Unban","player.op":"Op","player.deop":"Deop","player.kick":"Kick","audit.purge":"Purge"},i=["server.create","server.delete","server.start","server.stop","server.restart","player.whitelist.add","player.whitelist.remove","player.ban","player.unban","player.op","player.deop","player.kick","audit.purge"],a=["server.create","server.delete","server.start","server.stop","server.restart"],o=["player.whitelist.add","player.whitelist.remove","player.ban","player.unban","player.op","player.deop","player.kick"]}},function(e){e.O(0,[6812,9760,5004,7296,7436,1071,540,4416,2538,880,5511,55,2539,8347,8738,1658,6727,6645,674,4219,837,1047,2666,5787,3669,2757,1744],function(){return e(e.s=59616)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[224],{49726:function(e,r,t){Promise.resolve().then(t.bind(t,7854))},7854:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return ea}});var s=t(94655),n=t(35106),a=t(31358),l=t(7281),i=t(30417),o=t(81071),c=t(93017),d=t(69899),x=t(31317),u=t(76492),m=t(32366),p=t(78067),h=t(84840),f=t(97436),g=t(52082),v=t(89923),j=t(10297),y=t(42431),Z=t(628),b=t(41565),S=t(25935),C=t(79983),k=t(25333),w=t(97511),I=t(5501),P=t(93315),T=t(27171),E=t(96292);let F=e=>{switch(e){case"running":return"success";case"stopped":case"exited":case"not_created":return"error";case"created":return"warning";default:return"default"}},R=e=>{switch(e){case"running":return"Running";case"stopped":case"exited":return"Stopped";case"not_created":return"Not Created";case"created":return"Created";default:return e||"Unknown"}};function W(e){let{server:r,statusOverride:t,onClick:n,onStart:a,onStop:i,loading:o=!1}=e,c=(null==t?void 0:t.status)||r.status,d=(e,t)=>{e.stopPropagation(),t(r.name)},u="running"===c,m="stopped"===c||"exited"===c||"not_created"===c;return(0,s.jsxs)(Z.Z,{role:"article",onClick:()=>{n&&n(r.name)},sx:{cursor:n?"pointer":"default",transition:"all 0.2s",height:{xs:"auto",sm:180},minHeight:{xs:140,sm:180},display:"flex",flexDirection:"column","&:hover":n?{transform:"translateY(-2px)",boxShadow:4}:{}},children:[(0,s.jsxs)(b.Z,{sx:{flex:1,pb:1},children:[(0,s.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,s.jsx)(x.Z,{variant:"h6",component:"h3",sx:{fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,mr:1},children:r.name}),(0,s.jsx)(k.Z,{label:R(c),size:"small",color:F(c),sx:{fontWeight:500,minWidth:70}})]}),(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1.5},children:[(0,s.jsx)(E.Z,{sx:{fontSize:16,color:"text.secondary"}}),(0,s.jsx)(w.h,{hostname:r.hostname})]}),(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,s.jsx)(T.Z,{sx:{fontSize:16,color:"text.secondary"}}),(0,s.jsx)(x.Z,{variant:"body2",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.container})]})]}),(0,s.jsxs)(S.Z,{sx:{justifyContent:"flex-end",px:2,py:1.5,borderTop:"1px solid",borderColor:"divider"},children:[m&&a&&(0,s.jsx)(C.Z,{"aria-label":"Start server",color:"success",onClick:e=>d(e,a),disabled:o,size:"small",children:(0,s.jsx)(I.Z,{})}),u&&i&&(0,s.jsx)(C.Z,{"aria-label":"Stop server",color:"error",onClick:e=>d(e,i),disabled:o,size:"small",children:(0,s.jsx)(P.Z,{})}),!m&&!u&&(0,s.jsx)(l.Z,{sx:{height:34}})]})]})}function z(e){let{servers:r,statusMap:t={},onServerClick:a,onStart:o,onStop:c,onCreate:d,loadingServers:u=[]}=e,[p,Z]=(0,n.useState)(""),[b,S]=(0,n.useState)("all"),C=(0,n.useMemo)(()=>r.filter(e=>{if(p&&!e.name.toLowerCase().includes(p.toLowerCase()))return!1;let r=t[e.name],s=(null==r?void 0:r.status)||e.status;return("running"!==b||"running"===s)&&("stopped"!==b||"stopped"===s||"exited"===s||"not_created"===s)}),[r,t,p,b]);return 0===r.length?(0,s.jsxs)(l.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"400px",gap:2},children:[(0,s.jsx)(x.Z,{variant:"h6",color:"text.secondary",children:"No servers found"}),d&&(0,s.jsx)(i.Z,{variant:"contained",startIcon:(0,s.jsx)(m.Z,{}),onClick:d,children:"Create Server"})]}):(0,s.jsxs)(l.Z,{children:[(0,s.jsxs)(l.Z,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},gap:2,mb:3,alignItems:{xs:"stretch",sm:"center"},justifyContent:"space-between"},children:[(0,s.jsxs)(j.Z,{value:b,exclusive:!0,onChange:(e,r)=>{null!==r&&S(r)},size:"small",sx:{flexShrink:0},children:[(0,s.jsx)(v.Z,{value:"all",children:"All"}),(0,s.jsx)(v.Z,{value:"running",children:"Running"}),(0,s.jsx)(v.Z,{value:"stopped",children:"Stopped"})]}),(0,s.jsx)(f.Z,{size:"small",placeholder:"Search servers...",value:p,onChange:e=>Z(e.target.value),InputProps:{startAdornment:(0,s.jsx)(g.Z,{position:"start",children:(0,s.jsx)(y.Z,{})})},sx:{flexGrow:{xs:1,sm:0},minWidth:{sm:300}}})]}),(0,s.jsxs)(x.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:[C.length," ",1===C.length?"server":"servers"]}),0===C.length?(0,s.jsx)(l.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"200px",gap:2},children:(0,s.jsx)(x.Z,{variant:"h6",color:"text.secondary",children:"No servers found"})}):(0,s.jsx)(h.ZP,{container:!0,spacing:2,children:C.map(e=>(0,s.jsx)(h.ZP,{item:!0,xs:12,sm:6,md:4,children:(0,s.jsx)(W,{server:e,statusOverride:t[e.name],onClick:a,onStart:o,onStop:c,loading:u.includes(e.name)})},e.name))})]})}var M=t(83855),O=t(44059),A=t(99770),L=t(62508),D=t(5682),N=t(76678),G=t(7178),_=t(40064),V=t(45547),q=t(4405),H=t(73383),U=t(82285),$=t(13609),B=t(46207),J=t(43436),Y=t(87716),K=t(71185);let Q=["VANILLA","PAPER","FABRIC","FORGE","NEOFORGE"],X=["","forge","fabric","neoforge","quilt"],ee={name:"",type:"PAPER",version:"1.21.1",memory:"4G",autoStart:!1,sudoPassword:""},er=[{key:"initializing",label:"Initializing"},{key:"creating",label:"Creating"},{key:"configuring",label:"Configuring"},{key:"starting",label:"Starting"}];function et(e){let r,{open:t,onClose:a,onSubmit:d,loading:u=!1,status:m="idle",progress:p=0,message:h=""}=e,g=(0,M.Z)(),y=(0,O.Z)(g.breakpoints.down("sm")),[Z,b]=(0,n.useState)("standard"),[S,k]=(0,n.useState)(ee),[w,I]=(0,n.useState)({}),[P,T]=(0,n.useState)(!1),E=(0,n.useRef)(null),F=(0,n.useRef)(null),R=er.findIndex(e=>e.key===m),W="idle"!==m&&"completed"!==m&&"error"!==m;(0,n.useEffect)(()=>{t||(b("standard"),k(ee),I({}),T(!1))},[t]);let z=e=>e?/^[a-z0-9-]+$/.test(e)?null:"Only lowercase letters, numbers, and hyphens are allowed":"Server name is required",et=e=>e?null:"Modpack slug is required",es=e=>r=>{let t=r.target.value;k(r=>({...r,[e]:t})),"memory"===e&&T(!0),w[e]&&I(r=>({...r,[e]:""}))};return(0,s.jsx)(A.Z,{open:t,onClose:W?void 0:a,maxWidth:"sm",fullWidth:!0,fullScreen:y,children:(0,s.jsxs)("form",{onSubmit:e=>{e.preventDefault(),I({});let r=z(S.name);if(r){I({name:r});return}if("modpack"===Z){let e=et(S.modpack||"");if(e){I({modpack:e});return}}let t={name:S.name,memory:S.memory,autoStart:S.autoStart,sudoPassword:S.sudoPassword};"standard"===Z?(t.type=S.type,t.version=S.version):(t.type="MODRINTH",t.modpack=S.modpack,S.modpackVersion&&(t.modpackVersion=S.modpackVersion),S.modLoader&&(t.modLoader=S.modLoader)),d(t)},children:[(0,s.jsxs)(L.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:["completed"===m?(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,s.jsx)(B.Z,{color:"success"}),"Server Created Successfully"]}):"error"===m?(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,s.jsx)(J.Z,{color:"error"}),"Creation Failed"]}):"Create New Server",y&&!W&&(0,s.jsx)(C.Z,{onClick:a,"aria-label":"Close dialog",edge:"end",children:(0,s.jsx)(K.Z,{})})]}),(0,s.jsx)(D.Z,{children:W||"completed"===m||"error"===m?(0,s.jsxs)(l.Z,{sx:{py:2},children:[(0,s.jsx)(H.Z,{activeStep:R,alternativeLabel:!0,sx:{mb:3},children:er.map(e=>(0,s.jsx)(U.Z,{children:(0,s.jsx)($.Z,{children:e.label})},e.key))}),W&&(0,s.jsxs)(l.Z,{sx:{mb:3},children:[(0,s.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",mb:1},children:[(0,s.jsx)(x.Z,{variant:"body2",color:"text.secondary",children:h}),(0,s.jsxs)(x.Z,{variant:"body2",color:"text.secondary",children:[p,"%"]})]}),(0,s.jsx)(q.Z,{variant:"determinate",value:p})]}),"completed"===m&&(0,s.jsx)(x.Z,{color:"success.main",sx:{textAlign:"center"},children:h}),"error"===m&&(0,s.jsx)(x.Z,{color:"error.main",sx:{textAlign:"center"},children:h})]}):(0,s.jsxs)(l.Z,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:[(0,s.jsx)(l.Z,{ref:F,role:"status","aria-live":"polite",sx:{position:"absolute",left:"-10000px",width:"1px",height:"1px",overflow:"hidden"}}),(0,s.jsx)(f.Z,{label:"Server Name",value:S.name,onChange:es("name"),error:!!w.name,helperText:w.name||"Only lowercase letters, numbers, and hyphens",fullWidth:!0,autoFocus:!0,disabled:W}),(0,s.jsxs)(l.Z,{sx:{display:"flex",flexDirection:"column",gap:2},children:[(0,s.jsx)(x.Z,{variant:"subtitle2",color:"text.secondary",children:"Server Type"}),(0,s.jsxs)(j.Z,{value:Z,exclusive:!0,onChange:(e,r)=>{null!==r&&(b(r),F.current&&(F.current.textContent="".concat("standard"===r?"Standard Server":"Modpack"," category selected")),P||k(e=>({...e,memory:"standard"===r?"4G":"6G"})),setTimeout(()=>{"modpack"===r&&E.current&&E.current.focus()},300))},"aria-label":"Server category",fullWidth:!0,disabled:W,children:[(0,s.jsx)(v.Z,{value:"standard","aria-label":"Standard Server",children:"Standard Server"}),(0,s.jsx)(v.Z,{value:"modpack","aria-label":"Modpack",children:"Modpack"})]}),(0,s.jsx)(Y.Z,{in:"standard"===Z,unmountOnExit:!0,children:(0,s.jsxs)(l.Z,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[(0,s.jsx)(f.Z,{label:"Server Type",select:!0,value:S.type,onChange:es("type"),fullWidth:!0,disabled:W,children:Q.map(e=>(0,s.jsx)(G.Z,{value:e,children:e},e))}),(0,s.jsx)(f.Z,{label:"Minecraft Version",value:S.version,onChange:es("version"),helperText:"e.g., 1.21.1, 1.20.4, latest",fullWidth:!0,disabled:W})]})}),(0,s.jsx)(Y.Z,{in:"modpack"===Z,unmountOnExit:!0,children:(0,s.jsxs)(l.Z,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[(0,s.jsx)(o.Z,{severity:"info",children:"Minecraft version is automatically determined by the modpack"}),(0,s.jsx)(f.Z,{label:"Modpack Slug",value:S.modpack||"",onChange:es("modpack"),error:!!w.modpack,helperText:w.modpack||"e.g., cobblemon, adrenaserver (from modrinth.com/modpacks/SLUG)",fullWidth:!0,disabled:W,inputRef:E}),(0,s.jsxs)(f.Z,{label:"Mod Loader",select:!0,value:S.modLoader||"",onChange:es("modLoader"),helperText:"Leave empty to auto-detect from modpack",fullWidth:!0,disabled:W,children:[(0,s.jsx)(G.Z,{value:"",children:"Auto-detect"}),X.filter(e=>e).map(e=>(0,s.jsx)(G.Z,{value:e,children:e},e))]}),(0,s.jsx)(f.Z,{label:"Modpack Version",value:S.modpackVersion||"",onChange:es("modpackVersion"),helperText:"Leave empty for latest",fullWidth:!0,disabled:W})]})})]}),(0,s.jsx)(f.Z,{label:"Memory",value:S.memory,onChange:es("memory"),helperText:"e.g., 4G, 8G, 16G",fullWidth:!0,disabled:W}),(0,s.jsx)(f.Z,{label:"Sudo Password",type:"password",value:S.sudoPassword||"",onChange:es("sudoPassword"),helperText:"Required for mDNS hostname registration (avahi)",fullWidth:!0,disabled:W}),(0,s.jsx)(_.Z,{control:(0,s.jsx)(V.Z,{checked:S.autoStart||!1,onChange:(r="autoStart",e=>{k(t=>({...t,[r]:e.target.checked}))}),disabled:W}),label:"Auto-start after creation"})]})}),(0,s.jsx)(N.Z,{sx:{px:3,pb:2},children:"completed"===m||"error"===m?(0,s.jsx)(i.Z,{onClick:a,variant:"contained",fullWidth:!0,children:"Close"}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.Z,{onClick:a,disabled:W,children:"Cancel"}),(0,s.jsx)(i.Z,{type:"submit",variant:"contained",disabled:W,startIcon:W?(0,s.jsx)(c.Z,{size:16}):null,children:W?"Creating...":"Create"})]})})]})})}var es=t(92666),en=t(59104);function ea(){var e,r;let t=(0,a.x)(),[h,f]=(0,n.useState)(!1),[g,v]=(0,n.useState)([]),{data:j,isLoading:y,error:Z}=(0,es.x$)(),{statusMap:b}=(0,en.d)(),S=(0,es.jM)(),C=(0,es.Aw)(),k=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{onSuccess:r,onError:t,onProgress:s}=e,[a,l]=(0,n.useState)("idle"),[i,o]=(0,n.useState)(0),[c,d]=(0,n.useState)(""),[x,u]=(0,n.useState)(null),m=(0,n.useRef)(null),p=(0,n.useRef)(""),h=(0,n.useCallback)(()=>{l("idle"),o(0),d(""),u(null),m.current&&(m.current.close(),m.current=null)},[]),f=(0,n.useCallback)((e,r,t)=>{l(e),d(r),o(t),null==s||s(e,r,t)},[s]),g=(0,n.useCallback)(async e=>{if("idle"===a||"completed"===a||"error"===a){u(null),f("initializing","Initializing server creation...",0),p.current=e.name,m.current&&m.current.close();try{let t=await fetch("/api/servers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){let e=await t.text();throw Error(e||"Server creation failed: ".concat(t.statusText))}await t.json(),f("creating","Creating server configuration...",25),await new Promise(e=>setTimeout(e,500)),f("configuring","Configuring Docker compose...",50),await new Promise(e=>setTimeout(e,500)),f("starting","Starting server container...",75),await new Promise(e=>setTimeout(e,500)),f("completed","Server created successfully!",100),null==r||r(e.name)}catch(r){let e=r instanceof Error?r.message:"Unknown error occurred";l("error"),u(e),d("Server creation failed"),null==t||t(e)}}},[a,f,r,t]);return(0,n.useEffect)(()=>()=>{m.current&&(m.current.close(),m.current=null)},[]),{status:a,progress:i,message:c,error:x,isCreating:"idle"!==a&&"completed"!==a&&"error"!==a,createServer:g,reset:h}}({onSuccess:()=>{f(!1)},onError:e=>{console.error("Failed to create server:",e)}}),w=async e=>{v(r=>[...r,e]);try{await S.mutateAsync(e)}catch(e){console.error("Failed to start server:",e)}finally{v(r=>r.filter(r=>r!==e))}},I=async e=>{v(r=>[...r,e]);try{await C.mutateAsync(e)}catch(e){console.error("Failed to stop server:",e)}finally{v(r=>r.filter(r=>r!==e))}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(d.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,u.Fq)(e.palette.info.main,.1)," 0%, ").concat((0,u.Fq)(e.palette.primary.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,u.Fq)(e.palette.info.main,.2)),display:"flex",flexDirection:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},gap:2},children:[(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,s.jsx)(l.Z,{sx:{display:{xs:"none",sm:"flex"},alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"info.main",color:"info.contrastText"},children:(0,s.jsx)(p.Z,{sx:{fontSize:32}})}),(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(x.Z,{variant:"h4",component:"h1",fontWeight:"bold",sx:{fontSize:{xs:"1.5rem",sm:"2.125rem"}},children:"Servers"}),(0,s.jsx)(x.Z,{variant:"body1",color:"text.secondary",children:"Manage your Minecraft servers"})]})]}),(0,s.jsx)(i.Z,{variant:"contained",startIcon:(0,s.jsx)(m.Z,{}),onClick:()=>f(!0),size:"large",sx:{width:{xs:"100%",sm:"auto"}},children:"Create Server"})]}),Z&&(0,s.jsxs)(o.Z,{severity:"error",sx:{mb:3},children:["Failed to load servers: ",Z.message]}),k.error&&(0,s.jsxs)(o.Z,{severity:"error",sx:{mb:3},children:["Failed to create server: ",k.error]}),S.isError&&(0,s.jsxs)(o.Z,{severity:"error",sx:{mb:3},children:["Failed to start server: ",null===(e=S.error)||void 0===e?void 0:e.message]}),C.isError&&(0,s.jsxs)(o.Z,{severity:"error",sx:{mb:3},children:["Failed to stop server: ",null===(r=C.error)||void 0===r?void 0:r.message]}),y?(0,s.jsx)(l.Z,{sx:{display:"flex",justifyContent:"center",py:8},children:(0,s.jsx)(c.Z,{})}):(0,s.jsx)(z,{servers:(null==j?void 0:j.servers)||[],statusMap:b,onServerClick:e=>{t.push("/servers/".concat(encodeURIComponent(e)))},onStart:w,onStop:I,onCreate:()=>f(!0),loadingServers:g}),(0,s.jsx)(et,{open:h,onClose:()=>{f(!1),k.reset()},onSubmit:e=>{k.createServer(e)},loading:k.isCreating,status:k.status,progress:k.progress,message:k.message})]})}}},function(e){e.O(0,[6812,9760,5004,7296,7436,1071,540,4416,2538,880,8738,1658,6909,6727,837,6646,2666,2701,3669,2757,1744],function(){return e(e.s=49726)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7701],{6199:function(e,s,n){Promise.resolve().then(n.bind(n,36405))},36405:function(e,s,n){"use strict";n.r(s),n.d(s,{default:function(){return H}});var l=n(94655),r=n(35106),t=n(83855),i=n(44059),o=n(7281),a=n(30417),d=n(81071),c=n(93017),x=n(69899),h=n(31317),u=n(99770),m=n(62508),j=n(5682),Z=n(76678),f=n(97436),g=n(76492),p=n(32366),v=n(84974),y=n(84840),b=n(52082),w=n(89923),C=n(10297),S=n(42431),k=n(628),W=n(41565),z=n(25935),D=n(79983),I=n(25333),A=n(95511),F=n(96292),L=n(97812),P=n(21111),E=n(78067),N=n(33104);function R(e){let{world:s,onAssign:n,onRelease:r,onDelete:t,loading:i=!1}=e,a=(e,n)=>{e.stopPropagation(),n(s.name)};return(0,l.jsxs)(k.Z,{role:"article",sx:{transition:"all 0.2s",height:{xs:"auto",sm:200},minHeight:{xs:160,sm:200},display:"flex",flexDirection:"column","&:hover":{transform:"translateY(-2px)",boxShadow:4}},children:[(0,l.jsxs)(W.Z,{sx:{flex:1,pb:1},children:[(0,l.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,l.jsx)(h.Z,{variant:"h6",component:"h3",sx:{fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,mr:1},children:s.name}),(0,l.jsx)(I.Z,{label:s.isLocked?"Locked":"Available",size:"small",color:s.isLocked?"warning":"success",sx:{fontWeight:500,minWidth:80}})]}),(0,l.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1.5},children:[(0,l.jsx)(E.Z,{sx:{fontSize:16,color:"text.secondary"}}),(0,l.jsx)(h.Z,{variant:"body2",color:"text.secondary",children:s.size||"Unknown size"})]}),s.isLocked&&s.lockedBy&&(0,l.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1.5},children:[(0,l.jsx)(F.Z,{sx:{fontSize:16,color:"text.secondary"}}),(0,l.jsx)(A.Z,{title:"Assigned to ".concat(s.lockedBy),arrow:!0,children:(0,l.jsx)(h.Z,{variant:"body2",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.lockedBy})})]}),(0,l.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,l.jsx)(N.Z,{sx:{fontSize:16,color:"text.secondary"}}),(0,l.jsx)(h.Z,{variant:"body2",color:"text.secondary",children:(e=>{if(!e)return"-";try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch(s){return e}})(s.lastModified)})]})]}),(0,l.jsxs)(z.Z,{sx:{justifyContent:"flex-end",px:2,py:1.5,borderTop:"1px solid",borderColor:"divider"},children:[!s.isLocked&&n&&(0,l.jsx)(A.Z,{title:"Assign to server",arrow:!0,children:(0,l.jsx)(D.Z,{"aria-label":"Assign world",color:"primary",onClick:e=>a(e,n),disabled:i,size:"small",children:(0,l.jsx)(F.Z,{})})}),s.isLocked&&r&&(0,l.jsx)(A.Z,{title:"Release from server",arrow:!0,children:(0,l.jsx)(D.Z,{"aria-label":"Release world",color:"warning",onClick:e=>a(e,r),disabled:i,size:"small",children:(0,l.jsx)(L.Z,{})})}),t&&(0,l.jsx)(A.Z,{title:"Delete world",arrow:!0,children:(0,l.jsx)(D.Z,{"aria-label":"Delete world",color:"error",onClick:e=>a(e,t),disabled:i,size:"small",children:(0,l.jsx)(P.Z,{})})})]})]})}function T(e){let{worlds:s,onAssign:n,onRelease:t,onDelete:i,onCreate:d,loadingWorlds:c=[]}=e,[x,u]=(0,r.useState)(""),[m,j]=(0,r.useState)("all"),Z=(0,r.useMemo)(()=>s.filter(e=>(!x||!!e.name.toLowerCase().includes(x.toLowerCase()))&&("available"!==m||!e.isLocked)&&("locked"!==m||!!e.isLocked)),[s,x,m]);return 0===s.length?(0,l.jsxs)(o.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"400px",gap:2},children:[(0,l.jsx)(h.Z,{variant:"h6",color:"text.secondary",children:"No worlds found"}),d&&(0,l.jsx)(a.Z,{variant:"contained",startIcon:(0,l.jsx)(p.Z,{}),onClick:d,children:"Create World"})]}):(0,l.jsxs)(o.Z,{children:[(0,l.jsxs)(o.Z,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},gap:2,mb:3,alignItems:{xs:"stretch",sm:"center"},justifyContent:"space-between"},children:[(0,l.jsxs)(C.Z,{value:m,exclusive:!0,onChange:(e,s)=>{null!==s&&j(s)},size:"small",sx:{flexShrink:0},children:[(0,l.jsx)(w.Z,{value:"all",children:"All"}),(0,l.jsx)(w.Z,{value:"available",children:"Available"}),(0,l.jsx)(w.Z,{value:"locked",children:"Locked"})]}),(0,l.jsx)(f.Z,{size:"small",placeholder:"Search worlds...",value:x,onChange:e=>u(e.target.value),InputProps:{startAdornment:(0,l.jsx)(b.Z,{position:"start",children:(0,l.jsx)(S.Z,{})})},sx:{flexGrow:{xs:1,sm:0},minWidth:{sm:300}}})]}),(0,l.jsxs)(h.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:[Z.length," ",1===Z.length?"world":"worlds"]}),0===Z.length?(0,l.jsx)(o.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"200px",gap:2},children:(0,l.jsx)(h.Z,{variant:"h6",color:"text.secondary",children:"No worlds found"})}):(0,l.jsx)(y.ZP,{container:!0,spacing:2,children:Z.map(e=>(0,l.jsx)(y.ZP,{item:!0,xs:12,sm:6,md:4,children:(0,l.jsx)(R,{world:e,onAssign:n,onRelease:t,onDelete:i,loading:c.includes(e.name)})},e.name))})]})}let O={name:"",seed:""};function _(e){let{open:s,onClose:n,onSubmit:t,loading:i=!1}=e,[d,x]=(0,r.useState)(O),[h,g]=(0,r.useState)({});(0,r.useEffect)(()=>{s||(x(O),g({}))},[s]);let p=e=>e?/^[a-z0-9-]+$/.test(e)?null:"Only lowercase letters, numbers, and hyphens are allowed":"World name is required",v=e=>s=>{let n=s.target.value;x(s=>({...s,[e]:n})),h[e]&&g(s=>({...s,[e]:""}))};return(0,l.jsx)(u.Z,{open:s,onClose:i?void 0:n,maxWidth:"sm",fullWidth:!0,children:(0,l.jsxs)("form",{onSubmit:e=>{e.preventDefault(),g({});let s=p(d.name);if(s){g({name:s});return}t({name:d.name,...d.seed?{seed:d.seed}:{}})},children:[(0,l.jsx)(m.Z,{children:"Create New World"}),(0,l.jsx)(j.Z,{children:(0,l.jsxs)(o.Z,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:[(0,l.jsx)(f.Z,{label:"World Name",value:d.name,onChange:v("name"),error:!!h.name,helperText:h.name||"Only lowercase letters, numbers, and hyphens",fullWidth:!0,autoFocus:!0,disabled:i}),(0,l.jsx)(f.Z,{label:"Seed (optional)",value:d.seed||"",onChange:v("seed"),helperText:"Leave empty for a random seed",fullWidth:!0,disabled:i})]})}),(0,l.jsxs)(Z.Z,{sx:{px:3,pb:2},children:[(0,l.jsx)(a.Z,{onClick:n,disabled:i,children:"Cancel"}),(0,l.jsx)(a.Z,{type:"submit",variant:"contained",disabled:i,startIcon:i?(0,l.jsx)(c.Z,{size:16}):null,children:i?"Creating...":"Create"})]})]})})}var q=n(7178),M=n(92666);function B(e){let{open:s,worldName:n,onClose:t,onSubmit:i,loading:x=!1}=e,[g,p]=(0,r.useState)(""),{data:v,isLoading:y}=(0,M.x$)();(0,r.useEffect)(()=>{s||p("")},[s]);let b=(null==v?void 0:v.servers)||[],w=b.filter(e=>"running"!==e.status),C=b.filter(e=>"running"===e.status);return(0,l.jsx)(u.Z,{open:s,onClose:x?void 0:t,maxWidth:"sm",fullWidth:!0,children:(0,l.jsxs)("form",{onSubmit:e=>{e.preventDefault(),g&&i(n,g)},children:[(0,l.jsxs)(m.Z,{children:["Assign World: ",n]}),(0,l.jsx)(j.Z,{children:(0,l.jsx)(o.Z,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:y?(0,l.jsx)(o.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,l.jsx)(c.Z,{})}):0===b.length?(0,l.jsx)(h.Z,{color:"text.secondary",children:"No servers available. Create a server first."}):(0,l.jsxs)(l.Fragment,{children:[0===w.length&&C.length>0&&(0,l.jsx)(d.Z,{severity:"warning",children:"All servers are currently running. It is recommended to assign worlds to stopped servers."}),(0,l.jsxs)(f.Z,{label:"Select Server",select:!0,value:g,onChange:e=>p(e.target.value),fullWidth:!0,disabled:x,helperText:"Select a server to assign this world to",children:[w.length>0&&(0,l.jsx)(q.Z,{disabled:!0,children:(0,l.jsx)(h.Z,{variant:"caption",color:"text.secondary",children:"Available Servers"})}),w.map(e=>(0,l.jsx)(q.Z,{value:e.name,children:e.name},e.name)),C.length>0&&(0,l.jsx)(q.Z,{disabled:!0,children:(0,l.jsx)(h.Z,{variant:"caption",color:"text.secondary",children:"Running Servers (not recommended)"})}),C.map(e=>(0,l.jsx)(q.Z,{value:e.name,children:e.name},e.name))]})]})})}),(0,l.jsxs)(Z.Z,{sx:{px:3,pb:2},children:[(0,l.jsx)(a.Z,{onClick:t,disabled:x,children:"Cancel"}),(0,l.jsx)(a.Z,{type:"submit",variant:"contained",disabled:x||!g||y,startIcon:x?(0,l.jsx)(c.Z,{size:16}):null,children:x?"Assigning...":"Assign"})]})]})})}function H(){var e,s,n,y;let b=(0,t.Z)(),w=(0,i.Z)(b.breakpoints.down("sm")),[C,S]=(0,r.useState)(!1),[k,W]=(0,r.useState)(null),[z,D]=(0,r.useState)(null),[I,A]=(0,r.useState)(""),[F,L]=(0,r.useState)([]),{data:P,isLoading:E,error:N}=(0,M.Sr)(),R=(0,M.hy)(),O=(0,M.nq)(),q=(0,M.g2)(),H=(0,M.Fv)(),$=async e=>{L(s=>[...s,e]);try{await q.mutateAsync({worldName:e})}catch(e){console.error("Failed to release world:",e)}finally{L(s=>s.filter(s=>s!==e))}};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(x.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,g.Fq)(e.palette.success.main,.1)," 0%, ").concat((0,g.Fq)(e.palette.primary.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,g.Fq)(e.palette.success.main,.2)),display:"flex",flexDirection:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},gap:2},children:[(0,l.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,l.jsx)(o.Z,{sx:{display:{xs:"none",sm:"flex"},alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"success.main",color:"success.contrastText"},children:(0,l.jsx)(v.Z,{sx:{fontSize:32}})}),(0,l.jsxs)(o.Z,{children:[(0,l.jsx)(h.Z,{variant:"h4",component:"h1",fontWeight:"bold",sx:{fontSize:{xs:"1.5rem",sm:"2.125rem"}},children:"Worlds"}),(0,l.jsx)(h.Z,{variant:"body1",color:"text.secondary",children:"Manage your Minecraft worlds"})]})]}),(0,l.jsx)(a.Z,{variant:"contained",startIcon:(0,l.jsx)(p.Z,{}),onClick:()=>S(!0),size:"large",sx:{width:{xs:"100%",sm:"auto"}},children:"Create World"})]}),N&&(0,l.jsxs)(d.Z,{severity:"error",sx:{mb:3},children:["Failed to load worlds: ",N.message]}),R.isError&&(0,l.jsxs)(d.Z,{severity:"error",sx:{mb:3},children:["Failed to create world: ",null===(e=R.error)||void 0===e?void 0:e.message]}),O.isError&&(0,l.jsxs)(d.Z,{severity:"error",sx:{mb:3},children:["Failed to assign world: ",null===(s=O.error)||void 0===s?void 0:s.message]}),q.isError&&(0,l.jsxs)(d.Z,{severity:"error",sx:{mb:3},children:["Failed to release world: ",null===(n=q.error)||void 0===n?void 0:n.message]}),H.isError&&(0,l.jsxs)(d.Z,{severity:"error",sx:{mb:3},children:["Failed to delete world: ",null===(y=H.error)||void 0===y?void 0:y.message]}),E?(0,l.jsx)(o.Z,{sx:{display:"flex",justifyContent:"center",py:8},children:(0,l.jsx)(c.Z,{})}):(0,l.jsx)(T,{worlds:(null==P?void 0:P.worlds)||[],onAssign:e=>W(e),onRelease:$,onDelete:e=>{D(e),A("")},onCreate:()=>S(!0),loadingWorlds:F}),(0,l.jsx)(_,{open:C,onClose:()=>{S(!1),R.reset()},onSubmit:e=>{R.mutate(e,{onSuccess:()=>{S(!1)}})},loading:R.isPending}),(0,l.jsx)(B,{open:!!k,worldName:k||"",onClose:()=>W(null),onSubmit:(e,s)=>{L(s=>[...s,e]),O.mutate({worldName:e,serverName:s},{onSuccess:()=>{W(null)},onSettled:()=>{L(s=>s.filter(s=>s!==e))}})},loading:O.isPending}),(0,l.jsxs)(u.Z,{open:!!z,onClose:()=>{D(null),A("")},maxWidth:"sm",fullWidth:!0,fullScreen:w,children:[(0,l.jsx)(m.Z,{children:"Delete World"}),(0,l.jsxs)(j.Z,{children:[(0,l.jsxs)(h.Z,{sx:{mb:2},children:["This action cannot be undone. Type ",(0,l.jsx)("strong",{children:z})," to confirm deletion."]}),(0,l.jsx)(f.Z,{label:"World name",value:I,onChange:e=>A(e.target.value),fullWidth:!0,autoFocus:!0})]}),(0,l.jsxs)(Z.Z,{sx:{px:3,pb:2},children:[(0,l.jsx)(a.Z,{onClick:()=>{D(null),A("")},children:"Cancel"}),(0,l.jsx)(a.Z,{variant:"contained",color:"error",onClick:()=>{z&&I===z&&(L(e=>[...e,z]),H.mutate({name:z,force:!0},{onSuccess:()=>{D(null),A("")},onSettled:()=>{L(e=>e.filter(e=>e!==z))}}))},disabled:I!==z||H.isPending,startIcon:H.isPending?(0,l.jsx)(c.Z,{size:16}):null,children:H.isPending?"Deleting...":"Delete"})]})]})]})}}},function(e){e.O(0,[6812,9760,5004,7296,7436,1071,540,4416,2538,880,5511,6909,6039,2666,3669,2757,1744],function(){return e(e.s=6199)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2626],{40527:function(e,r,t){Promise.resolve().then(t.bind(t,10672))},628:function(e,r,t){"use strict";t.d(r,{Z:function(){return g}});var n=t(81500),s=t(32324),i=t(35106),a=t(70316),l=t(65951),o=t(34519),d=t(28057),u=t(69899),c=t(11379),x=t(9049);function h(e){return(0,x.ZP)("MuiCard",e)}(0,c.Z)("MuiCard",["root"]);var m=t(94655);let p=["className","raised"],f=e=>{let{classes:r}=e;return(0,l.Z)({root:["root"]},h,r)},Z=(0,o.ZP)(u.Z,{name:"MuiCard",slot:"Root",overridesResolver:(e,r)=>r.root})(()=>({overflow:"hidden"}));var g=i.forwardRef(function(e,r){let t=(0,d.i)({props:e,name:"MuiCard"}),{className:i,raised:l=!1}=t,o=(0,s.Z)(t,p),u=(0,n.Z)({},t,{raised:l}),c=f(u);return(0,m.jsx)(Z,(0,n.Z)({className:(0,a.Z)(c.root,i),elevation:l?8:void 0,ref:r,ownerState:u},o))})},41565:function(e,r,t){"use strict";t.d(r,{Z:function(){return Z}});var n=t(81500),s=t(32324),i=t(35106),a=t(70316),l=t(65951),o=t(34519),d=t(28057),u=t(11379),c=t(9049);function x(e){return(0,c.ZP)("MuiCardContent",e)}(0,u.Z)("MuiCardContent",["root"]);var h=t(94655);let m=["className","component"],p=e=>{let{classes:r}=e;return(0,l.Z)({root:["root"]},x,r)},f=(0,o.ZP)("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(e,r)=>r.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}}));var Z=i.forwardRef(function(e,r){let t=(0,d.i)({props:e,name:"MuiCardContent"}),{className:i,component:l="div"}=t,o=(0,s.Z)(t,m),u=(0,n.Z)({},t,{component:l}),c=p(u);return(0,h.jsx)(f,(0,n.Z)({as:l,className:(0,a.Z)(c.root,i),ownerState:u,ref:r},o))})},10672:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return h}});var n=t(94655),s=t(74228),i=t(67337),a=t(7281),l=t(628),o=t(41565),d=t(31317),u=t(41261),c=t(85480),x=t(46725);function h(){let e=(0,s.useRouter)();return(0,n.jsx)(i.Z,{maxWidth:"sm",children:(0,n.jsx)(a.Z,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",py:4},children:(0,n.jsx)(l.Z,{sx:{width:"100%",maxWidth:500},children:(0,n.jsxs)(o.Z,{sx:{p:4},children:[(0,n.jsx)(d.Z,{variant:"h4",component:"h1",gutterBottom:!0,sx:{fontWeight:600,textAlign:"center",mb:3},children:"Welcome Back"}),(0,n.jsx)(d.Z,{variant:"body2",color:"text.secondary",sx:{textAlign:"center",mb:4},children:"Sign in to manage your Minecraft servers"}),(0,n.jsx)(c.U0,{onSuccess:()=>{e.push("/dashboard")}}),(0,n.jsx)(a.Z,{sx:{mt:3,textAlign:"center"},children:(0,n.jsxs)(d.Z,{variant:"body2",color:"text.secondary",children:["Don't have an account?"," ",(0,n.jsx)(u.Z,{component:x.default,href:"/signup",underline:"hover",children:"Sign up"})]})})]})})})})}},85480:function(e,r,t){"use strict";t.d(r,{U0:function(){return m},WS:function(){return p},Ie:function(){return q}});var n=t(94655),s=t(35106),i=t(7281),a=t(81071),l=t(97436),o=t(52082),d=t(79983),u=t(30417),c=t(36848),x=t(554),h=t(6986);function m(e){let{onSuccess:r}=e,[t,m]=(0,s.useState)(""),[p,f]=(0,s.useState)(""),[Z,g]=(0,s.useState)(!1),[j,v]=(0,s.useState)({}),[y,b]=(0,s.useState)(null),[C,w]=(0,s.useState)(!1),S=()=>{let e={};return t?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)||(e.email="Invalid email address"):e.email="Email is required",p||(e.password="Password is required"),v(e),0===Object.keys(e).length},P=async e=>{if(e.preventDefault(),b(null),S()){w(!0);try{let e=await h.cg.email({email:t,password:p});if(e.error){b(e.error.message||"Invalid credentials"),w(!1);return}r&&r()}catch(e){b("An unexpected error occurred. Please try again."),w(!1)}}};return(0,n.jsxs)(i.Z,{component:"form",onSubmit:P,sx:{display:"flex",flexDirection:"column",gap:2},children:[y&&(0,n.jsx)(a.Z,{severity:"error",onClose:()=>b(null),children:y}),(0,n.jsx)(l.Z,{label:"Email",type:"email",value:t,onChange:e=>m(e.target.value),error:!!j.email,helperText:j.email,disabled:C,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Password",type:Z?"text":"password",value:p,onChange:e=>f(e.target.value),error:!!j.password,helperText:j.password,disabled:C,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(d.Z,{"aria-label":"toggle password visibility",onClick:()=>{g(!Z)},edge:"end",children:Z?(0,n.jsx)(c.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(u.Z,{type:"submit",variant:"contained",color:"primary",disabled:C,fullWidth:!0,size:"large",children:C?"Signing in...":"Sign In"})]})}function p(e){let{onSuccess:r}=e,[t,m]=(0,s.useState)(""),[p,f]=(0,s.useState)(""),[Z,g]=(0,s.useState)(""),[j,v]=(0,s.useState)(""),[y,b]=(0,s.useState)(!1),[C,w]=(0,s.useState)(!1),[S,P]=(0,s.useState)({}),[k,W]=(0,s.useState)(null),[q,I]=(0,s.useState)(!1),R=()=>{let e={};return t||(e.name="Name is required"),p?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(p)||(e.email="Invalid email address"):e.email="Email is required",Z?Z.length<8&&(e.password="Password must be at least 8 characters"):e.password="Password is required",j?Z!==j&&(e.confirmPassword="Passwords do not match"):e.confirmPassword="Please confirm your password",P(e),0===Object.keys(e).length},U=async e=>{if(e.preventDefault(),W(null),R()){I(!0);try{let e=await h.y1.email({email:p,password:Z,name:t});if(e.error){W(e.error.message||"Registration failed"),I(!1);return}r&&r()}catch(e){W("An unexpected error occurred. Please try again."),I(!1)}}};return(0,n.jsxs)(i.Z,{component:"form",onSubmit:U,sx:{display:"flex",flexDirection:"column",gap:2},children:[k&&(0,n.jsx)(a.Z,{severity:"error",onClose:()=>W(null),children:k}),(0,n.jsx)(l.Z,{label:"Name",type:"text",value:t,onChange:e=>m(e.target.value),error:!!S.name,helperText:S.name,disabled:q,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Email",type:"email",value:p,onChange:e=>f(e.target.value),error:!!S.email,helperText:S.email,disabled:q,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Password",type:y?"text":"password",value:Z,onChange:e=>g(e.target.value),error:!!S.password,helperText:S.password,disabled:q,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(d.Z,{"aria-label":"toggle password visibility",onClick:()=>{b(!y)},edge:"end",children:y?(0,n.jsx)(c.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(l.Z,{label:"Confirm Password",type:C?"text":"password",value:j,onChange:e=>v(e.target.value),error:!!S.confirmPassword,helperText:S.confirmPassword,disabled:q,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(d.Z,{"aria-label":"toggle password visibility",onClick:()=>{w(!C)},edge:"end",children:C?(0,n.jsx)(c.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(u.Z,{type:"submit",variant:"contained",color:"primary",disabled:q,fullWidth:!0,size:"large",children:q?"Creating account...":"Sign Up"})]})}var f=t(74228),Z=t(93017),g=t(86702),j=t(88812),v=t(31317),y=t(25333),b=t(69123),C=t(7178),w=t(17820),S=t(73424),P=t(25169),k=t(41094),W=t(78319);function q(){let e=(0,f.useRouter)(),{data:r,isPending:t}=(0,h.kP)(),[a,l]=(0,s.useState)(null),o=()=>{l(null)},c=async()=>{o(),await (0,h.w7)(),e.push("/login")};if(t)return(0,n.jsx)(i.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)(Z.Z,{size:24})});if(!(null==r?void 0:r.user))return(0,n.jsx)(u.Z,{variant:"contained",color:"primary",onClick:()=>{e.push("/login")},children:"Sign In"});let{user:x}=r,m=((e,r)=>{if(e){let r=e.split(" ");return r.length>=2?"".concat(r[0][0]).concat(r[1][0]).toUpperCase():e.substring(0,2).toUpperCase()}return r?r[0].toUpperCase():"?"})(x.name,x.email);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d.Z,{onClick:e=>{l(e.currentTarget)},"aria-label":"user menu",children:(0,n.jsx)(g.Z,{sx:{bgcolor:"primary.main"},children:m})}),(0,n.jsxs)(j.Z,{anchorEl:a,open:!!a,onClose:o,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{mt:1},children:[(0,n.jsxs)(i.Z,{sx:{px:2,py:1.5,minWidth:200},children:[(0,n.jsx)(v.Z,{variant:"subtitle1",fontWeight:"600",children:x.name||"User"}),(0,n.jsx)(v.Z,{variant:"body2",color:"text.secondary",children:x.email}),"admin"===x.role&&(0,n.jsx)(y.Z,{label:"Admin",size:"small",color:"primary",sx:{mt:1}})]}),(0,n.jsx)(b.Z,{}),"admin"===x.role&&(0,n.jsxs)(C.Z,{onClick:()=>{o(),e.push("/admin/users")},children:[(0,n.jsx)(w.Z,{children:(0,n.jsx)(P.Z,{fontSize:"small"})}),(0,n.jsx)(S.Z,{children:"Users"})]}),(0,n.jsxs)(C.Z,{onClick:()=>{o(),e.push("/settings")},children:[(0,n.jsx)(w.Z,{children:(0,n.jsx)(k.Z,{fontSize:"small"})}),(0,n.jsx)(S.Z,{children:"Settings"})]}),(0,n.jsxs)(C.Z,{onClick:c,children:[(0,n.jsx)(w.Z,{children:(0,n.jsx)(W.Z,{fontSize:"small"})}),(0,n.jsx)(S.Z,{children:"Logout"})]})]})]})}},6986:function(e,r,t){"use strict";t.d(r,{Cp:function(){return x},Nq:function(){return c},cg:function(){return l},kP:function(){return u},w7:function(){return o},y1:function(){return d},zB:function(){return h}});var n=t(77054),s=t(61648),i=t(35016);let a=(0,n.X)({baseURL:i.env.NEXT_PUBLIC_BETTER_AUTH_URL||"",plugins:[(0,s.zB)()]}),{signIn:l,signOut:o,signUp:d,useSession:u,updateUser:c,changePassword:x}=a,h=a.admin}},function(e){e.O(0,[6812,9760,5004,7296,7436,1071,2542,55,7727,9949,3669,2757,1744],function(){return e(e.s=40527)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2626],{40527:function(e,r,t){Promise.resolve().then(t.bind(t,10672))},628:function(e,r,t){"use strict";t.d(r,{Z:function(){return g}});var n=t(81500),s=t(32324),i=t(35106),a=t(70316),l=t(65951),o=t(34519),d=t(28057),u=t(69899),c=t(11379),x=t(9049);function h(e){return(0,x.ZP)("MuiCard",e)}(0,c.Z)("MuiCard",["root"]);var m=t(94655);let p=["className","raised"],f=e=>{let{classes:r}=e;return(0,l.Z)({root:["root"]},h,r)},Z=(0,o.ZP)(u.Z,{name:"MuiCard",slot:"Root",overridesResolver:(e,r)=>r.root})(()=>({overflow:"hidden"}));var g=i.forwardRef(function(e,r){let t=(0,d.i)({props:e,name:"MuiCard"}),{className:i,raised:l=!1}=t,o=(0,s.Z)(t,p),u=(0,n.Z)({},t,{raised:l}),c=f(u);return(0,m.jsx)(Z,(0,n.Z)({className:(0,a.Z)(c.root,i),elevation:l?8:void 0,ref:r,ownerState:u},o))})},41565:function(e,r,t){"use strict";t.d(r,{Z:function(){return Z}});var n=t(81500),s=t(32324),i=t(35106),a=t(70316),l=t(65951),o=t(34519),d=t(28057),u=t(11379),c=t(9049);function x(e){return(0,c.ZP)("MuiCardContent",e)}(0,u.Z)("MuiCardContent",["root"]);var h=t(94655);let m=["className","component"],p=e=>{let{classes:r}=e;return(0,l.Z)({root:["root"]},x,r)},f=(0,o.ZP)("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(e,r)=>r.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}}));var Z=i.forwardRef(function(e,r){let t=(0,d.i)({props:e,name:"MuiCardContent"}),{className:i,component:l="div"}=t,o=(0,s.Z)(t,m),u=(0,n.Z)({},t,{component:l}),c=p(u);return(0,h.jsx)(f,(0,n.Z)({as:l,className:(0,a.Z)(c.root,i),ownerState:u,ref:r},o))})},10672:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return h}});var n=t(94655),s=t(74228),i=t(67337),a=t(7281),l=t(628),o=t(41565),d=t(31317),u=t(41261),c=t(85480),x=t(46725);function h(){let e=(0,s.useRouter)();return(0,n.jsx)(i.Z,{maxWidth:"sm",children:(0,n.jsx)(a.Z,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",py:4},children:(0,n.jsx)(l.Z,{sx:{width:"100%",maxWidth:500},children:(0,n.jsxs)(o.Z,{sx:{p:4},children:[(0,n.jsx)(d.Z,{variant:"h4",component:"h1",gutterBottom:!0,sx:{fontWeight:600,textAlign:"center",mb:3},children:"Welcome Back"}),(0,n.jsx)(d.Z,{variant:"body2",color:"text.secondary",sx:{textAlign:"center",mb:4},children:"Sign in to manage your Minecraft servers"}),(0,n.jsx)(c.U0,{onSuccess:()=>{e.push("/dashboard")}}),(0,n.jsx)(a.Z,{sx:{mt:3,textAlign:"center"},children:(0,n.jsxs)(d.Z,{variant:"body2",color:"text.secondary",children:["Don't have an account?"," ",(0,n.jsx)(u.Z,{component:x.default,href:"/signup",underline:"hover",children:"Sign up"})]})})]})})})})}},85480:function(e,r,t){"use strict";t.d(r,{U0:function(){return m},WS:function(){return p},Ie:function(){return q}});var n=t(94655),s=t(35106),i=t(7281),a=t(81071),l=t(97436),o=t(52082),d=t(79983),u=t(30417),c=t(36848),x=t(554),h=t(6986);function m(e){let{onSuccess:r}=e,[t,m]=(0,s.useState)(""),[p,f]=(0,s.useState)(""),[Z,g]=(0,s.useState)(!1),[j,v]=(0,s.useState)({}),[y,b]=(0,s.useState)(null),[C,w]=(0,s.useState)(!1),S=()=>{let e={};return t?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)||(e.email="Invalid email address"):e.email="Email is required",p||(e.password="Password is required"),v(e),0===Object.keys(e).length},P=async e=>{if(e.preventDefault(),b(null),S()){w(!0);try{let e=await h.cg.email({email:t,password:p});if(e.error){b(e.error.message||"Invalid credentials"),w(!1);return}r&&r()}catch(e){b("An unexpected error occurred. Please try again."),w(!1)}}};return(0,n.jsxs)(i.Z,{component:"form",onSubmit:P,sx:{display:"flex",flexDirection:"column",gap:2},children:[y&&(0,n.jsx)(a.Z,{severity:"error",onClose:()=>b(null),children:y}),(0,n.jsx)(l.Z,{label:"Email",type:"email",value:t,onChange:e=>m(e.target.value),error:!!j.email,helperText:j.email,disabled:C,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Password",type:Z?"text":"password",value:p,onChange:e=>f(e.target.value),error:!!j.password,helperText:j.password,disabled:C,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(d.Z,{"aria-label":"toggle password visibility",onClick:()=>{g(!Z)},edge:"end",children:Z?(0,n.jsx)(c.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(u.Z,{type:"submit",variant:"contained",color:"primary",disabled:C,fullWidth:!0,size:"large",children:C?"Signing in...":"Sign In"})]})}function p(e){let{onSuccess:r}=e,[t,m]=(0,s.useState)(""),[p,f]=(0,s.useState)(""),[Z,g]=(0,s.useState)(""),[j,v]=(0,s.useState)(""),[y,b]=(0,s.useState)(!1),[C,w]=(0,s.useState)(!1),[S,P]=(0,s.useState)({}),[k,W]=(0,s.useState)(null),[q,I]=(0,s.useState)(!1),R=()=>{let e={};return t||(e.name="Name is required"),p?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(p)||(e.email="Invalid email address"):e.email="Email is required",Z?Z.length<8&&(e.password="Password must be at least 8 characters"):e.password="Password is required",j?Z!==j&&(e.confirmPassword="Passwords do not match"):e.confirmPassword="Please confirm your password",P(e),0===Object.keys(e).length},U=async e=>{if(e.preventDefault(),W(null),R()){I(!0);try{let e=await h.y1.email({email:p,password:Z,name:t});if(e.error){W(e.error.message||"Registration failed"),I(!1);return}r&&r()}catch(e){W("An unexpected error occurred. Please try again."),I(!1)}}};return(0,n.jsxs)(i.Z,{component:"form",onSubmit:U,sx:{display:"flex",flexDirection:"column",gap:2},children:[k&&(0,n.jsx)(a.Z,{severity:"error",onClose:()=>W(null),children:k}),(0,n.jsx)(l.Z,{label:"Name",type:"text",value:t,onChange:e=>m(e.target.value),error:!!S.name,helperText:S.name,disabled:q,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Email",type:"email",value:p,onChange:e=>f(e.target.value),error:!!S.email,helperText:S.email,disabled:q,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Password",type:y?"text":"password",value:Z,onChange:e=>g(e.target.value),error:!!S.password,helperText:S.password,disabled:q,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(d.Z,{"aria-label":"toggle password visibility",onClick:()=>{b(!y)},edge:"end",children:y?(0,n.jsx)(c.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(l.Z,{label:"Confirm Password",type:C?"text":"password",value:j,onChange:e=>v(e.target.value),error:!!S.confirmPassword,helperText:S.confirmPassword,disabled:q,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(d.Z,{"aria-label":"toggle password visibility",onClick:()=>{w(!C)},edge:"end",children:C?(0,n.jsx)(c.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(u.Z,{type:"submit",variant:"contained",color:"primary",disabled:q,fullWidth:!0,size:"large",children:q?"Creating account...":"Sign Up"})]})}var f=t(74228),Z=t(93017),g=t(86702),j=t(88812),v=t(31317),y=t(25333),b=t(69123),C=t(7178),w=t(17820),S=t(73424),P=t(25169),k=t(41094),W=t(78319);function q(){let e=(0,f.useRouter)(),{data:r,isPending:t}=(0,h.kP)(),[a,l]=(0,s.useState)(null),o=()=>{l(null)},c=async()=>{o(),await (0,h.w7)(),e.push("/login")};if(t)return(0,n.jsx)(i.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)(Z.Z,{size:24})});if(!(null==r?void 0:r.user))return(0,n.jsx)(u.Z,{variant:"contained",color:"primary",onClick:()=>{e.push("/login")},children:"Sign In"});let{user:x}=r,m=((e,r)=>{if(e){let r=e.split(" ");return r.length>=2?"".concat(r[0][0]).concat(r[1][0]).toUpperCase():e.substring(0,2).toUpperCase()}return r?r[0].toUpperCase():"?"})(x.name,x.email);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d.Z,{onClick:e=>{l(e.currentTarget)},"aria-label":"user menu",children:(0,n.jsx)(g.Z,{sx:{bgcolor:"primary.main"},children:m})}),(0,n.jsxs)(j.Z,{anchorEl:a,open:!!a,onClose:o,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{mt:1},children:[(0,n.jsxs)(i.Z,{sx:{px:2,py:1.5,minWidth:200},children:[(0,n.jsx)(v.Z,{variant:"subtitle1",fontWeight:"600",children:x.name||"User"}),(0,n.jsx)(v.Z,{variant:"body2",color:"text.secondary",children:x.email}),"admin"===x.role&&(0,n.jsx)(y.Z,{label:"Admin",size:"small",color:"primary",sx:{mt:1}})]}),(0,n.jsx)(b.Z,{}),"admin"===x.role&&(0,n.jsxs)(C.Z,{onClick:()=>{o(),e.push("/admin/users")},children:[(0,n.jsx)(w.Z,{children:(0,n.jsx)(P.Z,{fontSize:"small"})}),(0,n.jsx)(S.Z,{children:"Users"})]}),(0,n.jsxs)(C.Z,{onClick:()=>{o(),e.push("/settings")},children:[(0,n.jsx)(w.Z,{children:(0,n.jsx)(k.Z,{fontSize:"small"})}),(0,n.jsx)(S.Z,{children:"Settings"})]}),(0,n.jsxs)(C.Z,{onClick:c,children:[(0,n.jsx)(w.Z,{children:(0,n.jsx)(W.Z,{fontSize:"small"})}),(0,n.jsx)(S.Z,{children:"Logout"})]})]})]})}},6986:function(e,r,t){"use strict";t.d(r,{Cp:function(){return x},Nq:function(){return c},cg:function(){return l},kP:function(){return u},w7:function(){return o},y1:function(){return d},zB:function(){return h}});var n=t(77054),s=t(61648),i=t(35016);let a=(0,n.X)({baseURL:i.env.NEXT_PUBLIC_BETTER_AUTH_URL||"",plugins:[(0,s.zB)()]}),{signIn:l,signOut:o,signUp:d,useSession:u,updateUser:c,changePassword:x}=a,h=a.admin}},function(e){e.O(0,[6812,9760,5004,7296,7436,1071,2542,55,2539,9949,3669,2757,1744],function(){return e(e.s=40527)}),_N_E=e.O()}]);