vendor: 6,831 bytes, lines 1-151
1import{r as p,R as A,j as t}from"./vendor-react-BGN68_Lp.js";import{a as re,u as w}from"./vendor-redux-D8sX5Eqv.js";import{br as Ee,bs as _e,bt as ke,bu as te,q as se,m as oe,v as Ne,s as ae,bl as Re,u as Pe,g as Ae,x as Oe,aa as ze,a as Le,z as Be,bv as Me,b as $e}from"./index-uear5Vpj.js";import{u as Ie,L as ne,S as De}from"./SettingsList-r1rTfTV2.js";import{g as u}from"./vendor-styled-pkIKgjgv.js";import{T as Fe}from"./Templates-BbRzAw0Z.js";import{u as L}from"./vendor-i18n-BWleq_Sd.js";import{a as Ve}from"./maps-BaCKFVv9.js";import{T as G,P as Ge}from"./MatchIcons-CVn1p0ME.js";import"./vendor-socket-DSYo_sTV.js";import"./vendor-router-CYD8mbvC.js";import"./lobby-settings-BrXp16HJ.js";import"./premiumGroups-B_5uzJUp.js";import"./Switch-DOGNbJxj.js";import"./Range-CAfNV48s.js";import"./index-CGTDlQVZ.js";import"./LobbySettingsIndicators-C9uIMwnr.js";function We(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function W(e,c){var d=function(r){return c&&p.isValidElement(r)?c(r):r},s=Object.create(null);return e&&p.Children.map(e,function(n){return n}).forEach(function(n){s[n.key]=d(n)}),s}function He(e,c){e=e||{},c=c||{};function d(g){return g in c?c[g]:e[g]}var s=Object.create(null),n=[];for(var r in e)r in c?n.length&&(s[r]=n,n=[]):n.push(r);var o,a={};for(var i in c){if(s[i])for(o=0;o<s[i].length;o++){var f=s[i][o];a[s[i][o]]=d(f)}a[i]=d(i)}for(o=0;o<n.length;o++)a[n[o]]=d(n[o]);return a}function S(e,c,d){return d[c]!=null?d[c]:e.props[c]}function Ye(e,c){return W(e.children,function(d){return p.cloneElement(d,{onExited:c.bind(null,d),in:!0,appear:S(d,"appear",e),enter:S(d,"enter",e),exit:S(d,"exit",e)})})}function qe(e,c,d){var s=W(e.children),n=He(c,s);return Object.keys(n).forEach(function(r){var o=n[r];if(p.isValidElement(o)){var a=r in c,i=r in s,f=c[r],g=p.isValidElement(f)&&!f.props.in;i&&(!a||g)?n[r]=p.cloneElement(o,{onExited:d.bind(null,o),in:!0,exit:S(o,"exit",e),enter:S(o,"enter",e)}):!i&&a&&!g?n[r]=p.cloneElement(o,{in:!1}):i&&a&&p.isValidElement(f)&&(n[r]=p.cloneElement(o,{onExited:d.bind(null,o),in:f.props.in,exit:S(o,"exit",e),enter:S(o,"enter",e)}))}}),n}var Ue=Object.values||function(e){return Object.keys(e).map(function(c){return e[c]})},Je={component:"div",childFactory:function(c){return c}},H=(function(e){Ee(c,e);function c(s,n){var r;r=e.call(this,s,n)||this;var o=r.handleExited.bind(We(r));return r.state={contextValue:{isMounting:!0},handleExited:o,firstRender:!0},r}var d=c.prototype;return d.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},d.componentWillUnmount=function(){this.mounted=!1},c.getDerivedStateFromProps=function(n,r){var o=r.children,a=r.handleExited,i=r.firstRender;return{children:i?Ye(n,a):qe(n,o,a),firstRender:!1}},d.handleExited=function(n,r){var o=W(this.props.children);n.key in o||(n.props.onExited&&n.props.onExited(r),this.mounted&&this.setState(function(a){var i=_e({},a.children);return delete i[n.key],{children:i}}))},d.render=function(){var n=this.props,r=n.component,o=n.childFactory,a=ke(n,["component","childFactory"]),i=this.state.contextValue,f=Ue(this.state.children).map(o);return delete a.appear,delete a.enter,delete a.exit,r===null?A.createElement(te.Provider,{value:i},f):A.createElement(te.Provider,{value:i},A.createElement(r,a,f))},c})(A.Component);H.propTypes={};H.defaultProps=Je;const O=u.div` 2 display: flex; 3 flex-direction: column; 4 5 &.spaced { 6 margin-top: 16px; 7 } 8`,le=u.div` 9 display: flex; 10 flex-direction: column; 11 gap: 6px; 12 padding: 6px; 13 border-radius: 14px; 14 background: #171c2a; 15`,ce=u.button` 16 display: flex; 17 align-items: center; 18 justify-content: center; 19 width: 100%; 20 height: 46px; 21 border: 1px solid 22 ${({$secondary:e})=>e?"rgba(145, 175, 253, 0.2)":"transparent"}; 23 border-radius: 8px; 24 background: ${({$secondary:e})=>e?"transparent":"rgba(145, 175, 253, 0.06)"}; 25 color: #b8c2d3; 26 font-size: 14px; 27 font-weight: 700; 28 transition: 29 background 0.2s ease, 30 border-color 0.2s ease; 31 32 &:hover:not(:disabled), 33 &.active:not(:disabled) { 34 border-color: transparent; 35 background: rgba(96, 128, 255, 0.2); 36 color: #6080ff; 37 } 38 39 &:disabled { 40 opacity: 0.45; 41 cursor: default; 42 } 43`,j=u.div` 44 background: #171c2a; 45 padding: 6px; 46 margin: -3px 0; 47 transition: border-radius 0.2s ease; 48 49 button { 50 width: 228px; 51 border-radius: 8px; 52 background: rgba(145, 175, 253, 0.06); 53 padding: 13px 16px; 54 overflow: hidden; 55 color: #b8c2d3; 56 text-overflow: ellipsis; 57 font-size: 15px; 58 display: flex; 59 align-items: center; 60 gap: 12px; 61 transition: all 0.2s ease; 62 border: 1px solid transparent; 63 64 &.premium { 65 color: #ffc465; 66 border: 1px solid rgba(146, 132, 93, 0.26); 67 background: rgba(145, 175, 253, 0.06); 68 69 &::before { 70 content: ''; 71 width: 75px; 72 height: 58px; 73 position: absolute; 74 left: -25px; 75 bottom: -49px; 76 background: rgba(255, 196, 101, 0.44); 77 filter: blur(27px); 78 transition: opacity 0.2s ease; 79 } 80 } 81 82 &:hover { 83 background: rgba(145, 175, 253, 0.12); 84 } 85 } 86`,z=u.div` 87 padding-left: 24px; 88 transition: padding-left 0.2s ease; 89 90 &:first-child ${j} { 91 border-radius: 14px 14px 0 0; 92 } 93 94 &:last-child ${j} { 95 border-radius: 0 0 14px 14px; 96 } 97 98 &:only-child ${j} { 99 border-radius: 14px; 100 } 101 102 path { 103 transition: fill 0.2s ease; 104 } 105 106 &.active { 107 padding-left: 0; 108 109 ${j} { 110 border-top-left-radius: 14px; 111 border-bottom-left-radius: 14px; 112 113 button { 114 width: 100%; 115 color: #6080ff; 116 background: rgba(96, 128, 255, 0.2); 117 border-color: transparent; 118 119 &::before { 120 opacity: 0; 121 } 122 } 123 124 path { 125 fill: #6080ff !important; 126 } 127 } 128 } 129`,Xe=u.div` 130 display: flex; 131 flex-direction: column; 132 height: 100%; 133 min-height: 0; 134 overflow-y: auto; 135 /* gap: 12px; */ 136 padding: 12px 0; 137 138 @media (max-width: 1000px) { 139 flex: 0 0 auto; 140 flex-direction: row; 141 align-items: center; 142 gap: 6px; 143 height: auto; 144 padding: 6px; 145 border-radius: 14px; 146 background: #171c2a; 147 overflow-x: auto; 148 overflow-y: hidden; 149 scrollbar-width: none; 150 151 &::-webkit-scrollbar {
152 display: none; 153 } 154 155 ${O} { 156 flex: 0 0 auto; 157 flex-direction: row; 158 gap: 6px; 159 160 &.spaced { 161 margin-top: 0; 162 } 163 } 164 165 ${z} { 166 flex: 0 0 auto; 167 padding-left: 0; 168 169 &.active { 170 ${j} button { 171 width: auto; 172 } 173 } 174 } 175 176 ${j} { 177 margin: 0; 178 padding: 0; 179 background: transparent; 180 181 button { 182 width: auto; 183 padding: 11px 14px; 184 white-space: nowrap; 185 font-size: 14px; 186 } 187 } 188 189 ${le} { 190 flex-direction: row; 191 padding: 0; 192 background: transparent; 193 } 194 195 ${ce} { 196 width: auto; 197 height: 42px; 198 padding: 0 16px; 199 white-space: nowrap; 200 } 201 } 202`,Qe=({items:e=[],activeId:c,onChange:d,extraItems:s=[],extraActiveId:n,onExtraChange:r,actions:o=[]})=>!e.length&&!s.length&&!o.length?null:t.jsxs(Xe,{children:[!!e.length&&t.jsx(O,{children:e.map((a,i)=>t.jsx(z,{className:i===c?"active":"",children:t.jsx(j,{children:t.jsxs("button",{onClick:()=>d?.(i),className:a.className||"",children:[a.icon,a.title]})})},i))}),!!s.length&&t.jsx(O,{className:"spaced",children:s.map((a,i)=>t.jsx(z,{className:i===n?"active":"",children:t.jsx(j,{children:t.jsxs("button",{onClick:()=>r?.(i),className:a.className||"",children:[a.icon,a.title]})})},`extra-${i}`))}),!!o.length&&t.jsx(O,{className:"spaced",children:t.jsx(z,{children:t.jsx(le,{children:o.map(a=>t.jsx(ce,{type:"button",className:a.active?"active":"",$secondary:a.secondary,disabled:a.disabled,onClick:()=>a.onClick?.(),children:a.title},a.id))})})})]}),Ze=u.div` 203 display: flex; 204 flex-direction: column; 205 gap: 4px; 206`,D=u.div` 207 padding: 12px 16px; 208 border-radius: 8px; 209 background: rgba(145, 175, 253, 0.07); 210 gap: 3px; 211 display: flex; 212 flex-direction: column; 213 214 &:nth-child(odd) { 215 background: rgba(145, 175, 253, 0.09); 216 } 217`,F=u.h3` 218 color: #b8c2d3; 219 font-size: 15px; 220 font-weight: 700; 221 text-align: left; 222 text-transform: none; 223`,V=u.p` 224 color: #6a7587; 225 font-size: 14px; 226`,Ke=()=>{const{t:e}=L();return t.jsxs(Ze,{children:[t.jsxs(D,{children:[t.jsx(F,{children:e("CommandNumber",{number:1})}),t.jsx(V,{children:e("CommandDescriptionPlaceholder")})]}),t.jsxs(D,{children:[t.jsx(F,{children:e("CommandNumber",{number:2})}),t.jsx(V,{children:e("CommandDescriptionPlaceholder")})]}),t.jsxs(D,{children:[t.jsx(F,{children:e("CommandNumber",{number:3})}),t.jsx(V,{children:e("CommandDescriptionPlaceholder")})]})]})},et=new Set(["type_lobby","id_data_center"]),tt=u.div` 227 display: flex; 228 align-items: flex-end; 229 gap: 12px; 230 height: 50px; 231 padding-left: 14px; 232 margin-bottom: 24px; 233 234 svg { 235 width: 28px; 236 height: 28px; 237 } 238 239 path { 240 fill: #ecf1f8; 241 } 242 243 span { 244 color: #ecf1f8; 245 font-size: 24px; 246 font-weight: 700; 247 } 248`,nt=u.div` 249 display: flex; 250 flex: 1; 251 min-height: 0; 252 flex-direction: column; 253 gap: 12px; 254 padding: 18px; 255 overflow-y: auto; 256 border-radius: 8px 8px 0 0; 257 background: rgba(145, 175, 253, 0.04); 258 259 &.blue-scroll::-webkit-scrollbar {
260 width: 4px; 261 background: rgba(145, 175, 253, 0.07); 262 border-radius: 14px; 263 } 264 265 &.blue-scroll::-webkit-scrollbar-thumb { 266 border: 0; 267 border-radius: 20px; 268 } 269`,ie=u.div` 270 display: flex; 271 flex-direction: column; 272 gap: 12px; 273 274 h4 { 275 margin: 0; 276 color: #b8c2d3; 277 font-size: 15px; 278 font-weight: 700; 279 text-transform: none; 280 } 281 282 ul { 283 display: flex; 284 flex-direction: column; 285 margin: 0; 286 padding-left: 21px; 287 color: #6a7587; 288 font-size: 14px; 289 line-height: 1.3; 290 } 291 292 li span { 293 color: #d3ddeb; 294 } 295 296 li { 297 list-style: disc; 298 color: #6a7587; 299 } 300`,it=u.div` 301 display: flex; 302 flex: 0 0 178px; 303 flex-direction: column; 304 gap: 18px; 305 height: 178px; 306 margin-top: 4px; 307 margin-bottom: 18px; 308 padding: 24px; 309 box-sizing: border-box; 310 border-radius: 0 0 10px 10px; 311 background: rgba(145, 175, 253, 0.1); 312`,rt=u.div` 313 display: flex; 314 flex: 0 0 60px; 315 height: 60px; 316 align-items: flex-start; 317 gap: 14px; 318 319 & > svg { 320 flex: 0 0 auto; 321 } 322`,st=u.div` 323 display: flex; 324 flex: 1; 325 flex-direction: column; 326 min-width: 0; 327 gap: 8px; 328 329 h3 { 330 margin: 0; 331 color: #d3ddeb; 332 font-size: 14px; 333 line-height: 16px; 334 font-weight: 500; 335 text-align: left; 336 text-transform: none; 337 } 338 339 p { 340 max-width: 320px; 341 margin: 0; 342 color: #9ba9c0; 343 font-size: 13px; 344 line-height: 1.4; 345 } 346`,ot=u.form` 347 display: flex; 348 flex: 0 0 52px; 349 height: 52px; 350 align-items: center; 351 justify-content: space-between; 352 gap: 12px; 353 padding: 8px 8px 8px 16px; 354 border-radius: 8px; 355 background: #1b2131; 356 357 input { 358 width: auto; 359 min-width: 0; 360 flex: 1; 361 height: 36px; 362 padding: 0; 363 border: 0; 364 outline: 0; 365 background: transparent; 366 box-shadow: none; 367 color: #ecf1f8; 368 font-size: 14px; 369 370 &::placeholder { 371 color: rgba(197, 213, 255, 0.37); 372 } 373 } 374 375 button { 376 min-width: 102px; 377 height: 36px; 378 padding: 0 16px; 379 border-radius: 4px; 380 background: #6080ff; 381 color: #fff; 382 font-size: 14px; 383 font-weight: 400; 384 385 &:disabled { 386 background: #273259; 387 color: #49547b; 388 cursor: default; 389 } 390 } 391`,at=u.div` 392 display: flex; 393 flex: 1; 394 min-height: 0; 395 align-items: center; 396 justify-content: center; 397`,lt=u.div` 398 display: flex; 399 width: 400px; 400 max-width: 100%; 401 flex-direction: column; 402 align-items: center; 403 text-align: center; 404 405 h2 { 406 margin: 0 0 12px; 407 color: #ecf1f8; 408 font-size: 24px; 409 font-weight: 700; 410 } 411 412 p { 413 margin: 0 0 28px; 414 color: #6a7587; 415 font-size: 15px; 416 line-height: 21px; 417 } 418`,ct=u.div` 419 display: flex; 420 width: 300px; 421 max-width: 100%; 422 flex-direction: column; 423 gap: 6px; 424 425 button { 426 height: 56px; 427 border-radius: 6px; 428 color: #fff; 429 font-size: 14px; 430 font-weight: 700; 431 432 &:first-child { 433 background: #6080ff; 434 } 435 436 &:last-child { 437 border: 1px solid rgba(145, 175, 253, 0.2); 438 background: transparent; 439 color: #b8c2d3; 440 } 441 442 &:disabled { 443 opacity: 0.45; 444 cursor: default; 445 } 446 } 447`,dt=(e,c)=>{if(!Array.isArray(e))return null;const d=e.find(s=>[s.id,s.value,s.unique_name,s.name].some(n=>String(n)===String(c)));return d?.name??d?.city??d?.title??null},pt=(e,c,d)=>{const s=dt(c,e);return s?se(s):typeof e=="boolean"?d(e?"ENABLED-1":"OFF-2"):Array.isArray(e)?e.join(", ")||"â":e&&typeof e=="object"?Object.values(e).filter(Boolean).join(", ")||"â":e==null||e===""?"â":e},ut=({lobby:e,sections:c,availableSettings:d,onSaved:s})=>{const{t:n}=L(),[r,o]=p.useState(""),[a,i]=p.useState(!1),f=Ve(e?.match_settings),g=async m=>{m.preventDefault();const b=r.trim();if(!b||a)return;i(!0);const E=await oe.savePreset({id_preset:0,id_lobby:e?.id_lobby,name:b,description:"",arr_tags:[]});if(i(!1),!E||E.result==="error"){E?.text||Ne(n("ErrorOccurred"));return}ae(n("Successfully")),s?.()};return t.jsxs(t.Fragment,{children:[t.jsxs(tt,{children:[t.jsx(G,{}),t.jsx("span",{children:n("SaveTemplateTitle")})]}),t.jsxs(nt,{className:"blue-scroll",children:[c.map(m=>t.jsxs(ie,{children:[t.jsx("h4",{children:n(m.title)}),t.jsx("ul",{children:m.items.filter(b=>!b.disabled&&!et.has(b.key)).map(b=>t.jsxs("li",{children:[se(b.title),":"," ",t.jsx("span",{children:pt(e?.match_settings?.[b.key],d?.[b.ke
447y],n)})]},b.key))})]},m.title)),f.length>0&&t.jsxs(ie,{children:[t.jsx("h4",{children:n("Maps")}),t.jsx("ul",{children:f.map((m,b)=>t.jsxs("li",{children:[b+1,"."," ",t.jsx("span",{children:m.title||m.name}),m.id_workshop?" · Workshop":""]},`${m.name}-${b}`))})]})]}),t.jsxs(it,{children:[t.jsxs(rt,{children:[t.jsx(Ge,{color:"#7895ff"}),t.jsxs(st,{children:[t.jsx("h3",{children:n("SaveCurrentSettings")}),t.jsx("p",{children:n("SaveCurrentSettingsDescription")})]})]}),t.jsxs(ot,{onSubmit:g,children:[t.jsx("input",{value:r,maxLength:64,placeholder:n("TemplateName"),onChange:m=>o(m.target.value)}),t.jsx("button",{type:"submit",disabled:!r.trim()||a,children:n("Save")})]})]})]})},ft=({lobbyId:e,onCancel:c,onReset:d})=>{const{t:s}=L(),n=re(),[r,o]=p.useState(!1),a=async()=>{if(!e||r)return;o(!0);const i=await oe.resetSettings(e);o(!1),i?.result==="success"&&(i.data&&n(Re(i.data)),ae(s("ChangesApplied")),d?.())};return t.jsx(at,{children:t.jsxs(lt,{children:[t.jsx("h2",{children:s("ResetSettings")}),t.jsx("p",{children:s("ResetMatchSettings")}),t.jsxs(ct,{children:[t.jsx("button",{type:"button",disabled:r,onClick:a,children:s("Accept2")}),t.jsx("button",{type:"button",disabled:r,onClick:c,children:s("Cancel")})]})]})})},xt=u.div` 448 display: flex; 449 gap: 11px; 450 height: 670px; 451 max-width: 100%; 452 max-height: min(90vh, calc(100vh - 110px)); 453 454 @media (max-width: 1000px) { 455 width: 95%; 456 flex-direction: column; 457 gap: 8px; 458 } 459`,ht=u.div` 460 position: relative; 461 display: flex; 462 min-height: 0; 463 max-width: 100%; 464 465 @media (max-width: 1000px) { 466 flex: 1; 467 } 468`,gt=u.div` 469 flex: 0 0 240px; 470 align-self: flex-start; 471 max-height: 100%; 472 473 @media (max-width: 1200px) { 474 display: none; 475 } 476`,mt=u.div` 477 position: absolute; 478 top: 100%; 479 left: 0; 480 right: 0; 481 margin-top: 8px; 482 display: flex; 483 align-items: center; 484 justify-content: center; 485 gap: 10px; 486 padding: 10px 14px; 487 border-radius: 10px; 488 background: #22263c; 489 opacity: 0; 490 transform: translateY(-10px); 491 pointer-events: none; 492 transition: opacity 0.25s ease, transform 0.25s ease; 493 494 &.visible { 495 opacity: 1; 496 transform: translateY(0); 497 pointer-events: auto; 498 } 499 500 span { 501 min-width: 0; 502 color: #d3ddeb; 503 font-size: 13px; 504 font-weight: 500; 505 line-height: 17px; 506 white-space: nowrap; 507 overflow: hidden; 508 text-overflow: ellipsis; 509 } 510 511 button { 512 flex-shrink: 0; 513 background: none; 514 color: #6080ff; 515 font-size: 13px; 516 font-weight: 600; 517 line-height: 17px; 518 transition: color 0.2s ease; 519 520 &:hover { 521 color: #8aa2ff; 522 } 523 } 524 525 @media (prefers-reduced-motion: reduce) { 526 transition: none; 527 } 528`,bt=u.div` 529 display: flex; 530 flex-direction: column; 531 height: 100%; 532 min-height: 0; 533 box-sizing: border-box; 534 border-radius: 15px; 535 background: #171c2a; 536 padding: 18px; 537 width: 674px; 538 max-width: 100%; 539 overflow: hidden; 540 541 @media (max-width: 1000px) { 542 width: 100%; 543 height: auto; 544 flex: 1; 545 padding: 12px; 546 } 547`,vt=u.div` 548 flex: 1; 549 min-height: 0; 550 overflow-y: ${({$scrollable:e})=>e?"auto":"hidden"}; 551`,jt=u.div` 552 position: relative; 553 flex: 1; 554 min-height: 0; 555`,yt=u.div` 556 position: absolute; 557 inset: 0; 558 display: flex; 559 min-height: 0; 560 flex-direction: column; 561 562 &.settings-page-enter { 563 opacity: 0; 564 } 565 566 &.settings-page-enter-active, 567 &.settings-page-exit { 568 opacity: 1; 569 } 570 571 &.settings-page-enter-active, 572 &.settings-page-exit-active { 573 transition: opacity 0.16s ease; 574 } 575 576 &.settings-page-exit-active { 577 opacity: 0; 578 } 579 580 @media (prefers-reduced-motion: reduce) { 581 transition: none; 582 } 583`,wt=u.div` 584 display: flex; 585 align-items: flex-end; 586 gap: 12px; 587 height: 50px; 588 padding-left: 14px; 589 margin-bottom: 20px; 590 591 svg { 592 width: 28px; 593 height: 28px; 594 } 595 596 path { 597 fill: #ecf1f8; 598 } 599 600 span { 601 color: #ecf1f8; 602 font-size: 24px; 603 font-weight: 700; 604 } 605`,St=(e,c)=>JSON.stringify(e)!==JSON.stringify(c),Tt=e=>e.id??e.value??e.unique_name??e.name,Ct=e=>e?.is_default??e?.default,Et=e=>e?.is_default===!0||e?.default===!0,_t=(e,c)=>Object.entries(c??{}).reduce((d,[s,n])=>{const r=e?.[s],o=(a,i,f)=>{St(i,f)&&d.push({key:a,current:i,default:f})};
605if(Array.isArray(n)){if(r&&typeof r=="object")return n.forEach(i=>{const f=Ct(i);if(f===void 0)return;const g=Array.isArray(r)?r.includes(i.unique_name):r[i.id];o(`${s}.${i.unique_name??i.id}`,g??f,f)}),d;const a=n.find(Et);return a&&o(s,r,Tt(a)),d}return n&&typeof n=="object"&&"default"in n&&o(s,r??n.default,n.default),d},[]),Yt=()=>{var K;const{t:e}=L(),c=re(),d=Pe(),s=w(l=>l.modals.data.LOBBY_SETTINGS?.initialTab??0),n=w(l=>l.modals.data.LOBBY_SETTINGS?.initialParameter??null),r=w(l=>l.modals.data.LOBBY_SETTINGS?.initialView??null),[o,a]=p.useState(s),[i,f]=p.useState(r==="templates"?0:null),[g,m]=p.useState(null),[b,E]=p.useState(null),[de,Y]=p.useState(!1),[pe,ue]=p.useState(null),_=p.useRef(null),N=p.useRef([]),q=p.useRef({}),T=p.useRef(null),B=w(l=>l.auth.steamid64),U=w(l=>l.auth.premium.group),{available_settings:y,lobby:v,loading:fe}=w(l=>l.matches),xe=U&&U!=="LITE",he=w(l=>l.matches.status),k=!!v?.players?.[B]?.is_host&&he===0;p.useEffect(()=>{const l=setTimeout(()=>Y(!0),400);return()=>clearTimeout(l)},[]);const ge=()=>c($e(null)),me=Ie({enabled:k}),M=p.useMemo(()=>{if(!v?.match_settings)return ne;const l=v.players[B]?.is_host;return ne.map(x=>({...x,items:x.items.map(h=>h.key!=="type_lobby"?h:{...h,passwordDisabled:v.match_settings.type_lobby===0||!l})}))},[v,B]),J=l=>{const x=_.current,h=N.current[l];x&&h&&x.scrollTo({top:h.offsetTop,behavior:"smooth"})},be=l=>{const x=i!==null||g!==null;f(null),m(null),a(l),x||J(l)},X=l=>{const x=_.current,h=document.getElementById(l);if(!x||!h||!x.contains(h))return null;x.scrollTo({top:h.getBoundingClientRect().top-x.getBoundingClientRect().top+x.scrollTop-64,behavior:"smooth"}),h.classList.add("glow");const $=setTimeout(()=>h.classList.remove("glow"),1e3);return()=>clearTimeout($)};p.useLayoutEffect(()=>{const l=_.current;if(!l)return;if(n){const h=X(n);if(h)return h}const x=N.current[s];x&&(l.scrollTop=x.offsetTop)},[s,n]);const ve=p.useCallback(l=>{const x=l==="map_name"?y?.map_name_all:y?.[l];return x?l==="id_data_center"?x.map(h=>({...h,name:e(h.city),icon:{url:Ae(`/img/flags/${h.country}.svg`),size:14}})):x:[]},[y,e]),je=()=>{d("/premium"),ge()},ye=p.useCallback(()=>{if(i!==null||g!==null)return;const l=_.current;l&&(T.current||(T.current=requestAnimationFrame(()=>{T.current=null;const x=N.current,h=l.scrollHeight-l.clientHeight,$=h>0?l.scrollTop/h:0,Ce=l.scrollTop+$*l.clientHeight;let I=0;for(let P=0;P<x.length;P++){const ee=x[P];if(ee)if(ee.offsetTop<=Ce)I=P;else break}I!==o&&a(I)})))},[o,g,i]),we=l=>{m(null),f(l)},Q=l=>{f(null),m(l)},Se=()=>{c(Me()),m(null),f(0)},R=i===null&&g===null,Te=p.useMemo(()=>_t(v?.match_settings,y),[v?.match_settings,y]).length>0,C=R?"settings":g||(i===0?"templates":"console");(K=q.current)[C]??(K[C]=p.createRef());const Z=q.current[C];return p.useEffect(()=>()=>{T.current&&(cancelAnimationFrame(T.current),T.current=null)},[]),t.jsxs(xt,{children:[t.jsx(Qe,{items:M.map(l=>({title:e(l.title),icon:l.icon,className:l.className})),activeId:R?o:-1,onChange:be,extraItems:[{title:e("Templates"),icon:t.jsx(G,{})}],extraActiveId:i,onExtraChange:we,actions:k&&Te?[{id:"save",title:e("SaveTemplate"),active:g==="save",onClick:()=>Q("save")},{id:"reset",title:e("Reset"),active:g==="reset",secondary:!0,onClick:()=>Q("reset")}]:[]}),t.jsxs(ht,{ref:E,children:[t.jsxs(bt,{children:[t.jsx(Oe,{}),t.jsx(H,{component:jt,children:t.jsx(ze,{timeout:160,classNames:"settings-page",nodeRef:Z,onEntered:()=>{C==="settings"&&J(o)},children:t.jsx(yt,{ref:Z,children:R?t.jsx(De,{sections:M,t:e,isPremium:xe,availableSettings:y,lobby:v,loading:fe,isOwner:k,formatOptions:ve,onChange:me,listRef:_,sectionRefs:N,onWheel:ye,onBuyPremium:je,hintRoot:b,infoRoot:pe}):g==="save"?t.jsx(ut,{lobby:v,sections:M,availableSettings:y,onSaved:Se}):g==="reset"?t.jsx(ft,{lobbyId:v?.id_lobby,onCancel:()=>m(null),onReset:()=>m(null)}):t.jsxs(t.Fragment,{children:[t.jsxs(wt,{children:[i===0&&t.jsx(G,{}),t.jsx("span",{children:e(i===0?"Templates":"ConsoleCommands")})]}),t.jsx(vt,{className:"blue-scroll",$scrollable:i!==0,children:i===0?t.jsx(Fe,{isOwner:k}):t.jsx(Ke,{})})]})})},C)})]}),k&&t.jsxs(mt,{className:de&&R&&Number(v?.match_settings?.bo)<=1&&!Number(v?.match_settings?.id_mode_map_pick)?"visible":void 0,children:[t.jsx(Le,{children:"NEW"}),t.jsx("span",{children:e("PROMO-SERIES")}),t.jsx("button",{type:"button",onClick:()=>{Be()||Y(!1),X("id_mode_map_pick")},children:e("Try")})]})]}),t.jsx(gt,{ref:ue})]})};export{Yt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.