PageSourceSearch

https://indicator.gg/_next/static/chunks/pages/admin/edit-game-tool/[gameSlugParam]-7ccd538eb57e8ef3.js

js indicator.gg collected 2026-10-03 01:57:01 UTC 28,577 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[592],{74821:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/edit-game-tool/[gameSlugParam]",function(){return n(88464)}])},86994:function(e,t,n){"use strict";var i=n(85893),o=n(67294),s=n(45007),a=n(82084);n(50948);var l=n(89139),r=n(86018),d=n(12744),c=n(60846),u=n(51194),m=n(14065),h=n.n(m);let p=Math.PI/180,canvasPreview=async function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]&&arguments[5];(null==n?void 0:n.unit)==="%"&&(n.width=n.width/100*e.width,n.height=n.height/100*e.height,n.x=n.x/100*e.width,n.y=n.y/100*e.height,n.unit="px"),t.width=n.width,t.height=n.height;let a=t.getContext("2d");if(!a)throw Error("No 2d context");let l=e.naturalWidth/e.width,r=e.naturalHeight/e.height,d=Math.floor(n.width*l*1),c=Math.floor(n.height*r*1);t.width=d,t.height=c;let u=1;if(s){t.width=Math.min(400,d),t.height=Math.min(400,c);let e=400/Math.floor(n.width*l*1);u=e<1?e:1}a.scale(1,1),a.imageSmoothingQuality="high";let m=n.x*l*u,h=n.y*r*u,g=e.naturalWidth*u/2,v=e.naturalHeight*u/2;a.save(),a.translate(-m,-h),a.translate(g,v),a.rotate(o*p),a.scale(i,i),a.translate(-g,-v),a.drawImage(e,0,0,e.naturalWidth,e.naturalHeight,0,0,e.naturalWidth*u,e.naturalHeight*u),a.restore()},toBlob=e=>new Promise(t=>{e.toBlob(t,"image/jpeg")}),imgPreview=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=document.createElement("canvas");canvasPreview(e,s,t,n,i,o);let a=await toBlob(s);return a},centerAspectCrop=(e,t,n)=>(0,a._H)((0,a.YG)({unit:"%",width:90},n,e,t),e,t);t.Z=e=>{let{isUploading:t,submitFunction:n,minCrop:m,circular:p,aspect:g,header:v,className:x,initialImg:f,closeFunction:_,deleteFunction:b,isDeleting:j,shouldOptimizeImage:y=!1,fullscreen:w=!1}=e,T=(0,s.I0)(),C=(0,s.v9)(e=>e.ui.noBgScroll),A=(0,s.v9)(e=>e.ui.currentOpenModal),[S,k]=(0,o.useState)(!1),[N,I]=(0,o.useState)(!1),[D,Z]=(0,o.useState)(1),[E,O]=(0,o.useState)(0),[R,P]=(0,o.useState)(!1),[F,M]=(0,o.useState)(!1),W=(0,o.useRef)(null);(0,o.useEffect)(()=>(C||T((0,d.D6)(!0)),()=>{A||T((0,d.D6)(!1))}),[]);let G=(0,o.useRef)(null);return(0,c.t$)(G,()=>T(P(!0))),(0,i.jsxs)("div",{className:h()["add-image-overlay"],ref:G,children:[(0,i.jsxs)("div",{className:"".concat(h()["add-image-modal"]," ").concat(w?h().fullscreen:"").concat(x?" ".concat(x):""),children:[(0,i.jsxs)("header",{children:[(0,i.jsx)("h1",{children:v}),(0,i.jsx)(l.Z,{onClick:()=>{S?P(!0):_()},children:(0,i.jsx)(u._0,{})})]}),(0,i.jsx)("div",{className:h().content,children:S?(0,i.jsx)(a.ZP,{aspect:g||1,crop:N,onChange:e=>I(e),keepSelection:!0,minWidth:m&&m.width,minHeight:m&&m.height,circularCrop:p,children:(0,i.jsx)("img",{ref:W,src:S,onLoad:e=>{if(g){let{width:t,height:n}=e.currentTarget;I(centerAspectCrop(t,n,g))}},alt:"to crop and upload"})}):(0,i.jsx)("img",{src:f,className:"".concat(h()["initial-img"]," ").concat(p?h().circular:""),alt:"current"})}),(0,i.jsxs)("footer",{children:[!S&&b&&(0,i.jsx)(l.Z,{onClick:()=>M(!0),slimmer:!0,standard:!0,disabled:["/images/AvatarBlue.png","/images/DefaultCover.jpg"].includes(f),loading:j,children:(0,i.jsx)(u.Xm,{})}),(0,i.jsx)(l.Z,{standard:!0,content:"Change picture",slim:!0,children:(0,i.jsx)("label",{className:"hidden-input",children:(0,i.jsx)("input",{type:"file",accept:"image/png, image/jpeg",onChange:e=>{if(e.target.files&&e.target.files.length>0){let t=e.target.files[0];if(t.size>1e7)return window.alert("The file size is too large. The file size should be less than 10 MB."),document.getElementById("img-input").value="","";let n=new FileReader;n.addEventListener("load",()=>k(n.result.toString()||"")),n.readAsDataURL(t)}return!1},id:"img-input"})})}),(0,i.jsx)(l.Z,{content:"Save",disabled:!S,slim:!0,loading:t,onClick:async()=>{if((null==N?void 0:N.width)&&(null==N?void 0:N.height)&&W.current){let e=await imgPreview(W.current,N,D,E,y);n(e,()=>{document.getElementById("img-input").value="",k()})}}})]})]}),R&&(0,i.jsx)(r.Z,{closeFunction:()=>P(!1),confirmationFunction:()=>_(),text:"Are you sure you want to close the picture editing modal?",title:"Close?",buttonText:"Close"}),F&&(0,i.jsx)(r.Z,{closeFunction:()=>M(!1),confirmationFunction:()=>{b(),M(!1)},text:"Are you sure you want to remove the picture?",title:"Remove?",buttonText:"Remove"})]})}},40150:function(e,t,n){"use strict";n.d(t,{Z:function(){return common_withAuthentication}});var i=n(85893),o=n(67294),s=n(11163),a=n(62286),l=n(33768),r=n.n(l),ui_SiteSpinner=()=>(0,i.jsxs)("div",{className:r()["site-spinner-container"],children:[(0,i.jsx)("h1",{children:"Indicator"}),(0,i.jsx)("div",{className:r()["site-spinner-inner"],children:(0,i.jsxs)("div",{className:r()["site-spinner"],children:[(0,i.jsx)("div",{}),(0,i.jsx)("div",{})]})})]}),common_withAuthentication=e=>{let RequiresAuthentication=t=>{let n=(0,s.useRouter)(),l=(0,a.parseCookies)(),[r,d]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{d(!0)},[]),(0,o.useEffect)(()=>{l&&!l.accessToken&&n.push("/login?redirect=".concat(n.asPath))},[l]),RequiresAuthentication.getInitialProps=e.getInitialProps,!!r&&(l&&l.accessToken?(0,i.jsx)(e,{...t}):(0,i.jsx)("span",{children:(0,i.jsx)(ui_SiteSpinner,{})}))};return RequiresAuthentication}},86018:function(e,t,n){"use strict";var i=n(85893),o=n(67294),s=n(45007),a=n(12744),l=n(89139),r=n(51194),d=n(98019),c=n.n(d);t.Z=e=>{let{closeFunction:t,confirmationFunction:n,title:d,text:u,buttonText:m,cancelButtonText:h,loading:p}=e,g=(0,s.I0)(),v=(0,s.v9)(e=>e.ui.scrollbarWidth),x=(0,s.v9)(e=>e.ui.noBgScroll),f=(0,s.v9)(e=>e.ui.currentOpenModal),_=!x;return(0,o.useEffect)(()=>(x||g((0,a.D6)(!0)),()=>{!f&&_&&g((0,a.D6)(!1))}),[]),(0,i.jsx)("div",{className:c()["confirmation-overlay"],style:{paddingRight:v},children:(0,i.jsxs)("div",{className:c()["confirmation-modal"],children:[(0,i.jsxs)("header",{children:[(0,i.jsx)("h2",{children:d}),(0,i.jsx)(l.Z,{transparent:!0,onClick:t,children:(0,i.jsx)(r._0,{})})]}),(0,i.jsx)("p",{children:u}),(0,i.jsxs)("div",{children:[(0,i.jsx)(l.Z,{slim:!0,standard:!0,content:h||"Cancel",onClick:t}),(0,i.jsx)(l.Z,{slim:!0,loading:p,content:m,onClick:n})]})]})})}},87375:function(e,t,n){"use strict";var i=n(87066);n(66477);var o=n(62286),s=n.n(o),a=n(63197);let SSRAuthRequest=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,o=s().get(t),l=i.Z.create({baseURL:a.Z.apiUrl});l.interceptors.response.use(e=>e,e=>new Promise((n,l)=>{let r=e.config;if(e.response&&401===e.response.status&&e.config&&!e.config.__isRetryRequest){let d;r._retry=!0,o.refreshToken?d=fetch("".concat(a.Z.apiUrl,"/refresh"),{method:"POST",mode:"cors",cache:"no-cache",credentials:"same-origin",headers:{"Content-Type":"application/json","X-Auth":o.refreshToken},redirect:"follow",referrer:"no-referrer"}).then(e=>e.json()).then(n=>"WRONG_TOKEN"===n.error?l(e):(s().set(t,"accessToken",n.accessToken,{maxAge:2592e3,path:"/"}),r.headers["X-Auth"]=n.accessToken,(0,i.Z)(r))):n(l(e)),n(d)}n(l(e))}));let r=o.accessToken?{"X-Auth":o.accessToken}:{},d={headers:r};n&&(d.params=n);let c=await l.get(e,d).then(e=>e.data).catch(async n=>{if(n.response&&n.response.data&&"WRONG_TOKEN"===n.response.data.error){s().destroy(t,"accessToken",{path:"/"}),s().destroy(t,"refreshToken",{path:"/"});let n=await l.get(e).then(e=>e.data).catch(e=>(e.response&&e.response.data&&e.response.data.error,{redirectToLogin:!0}));return n}return console.log(n),n.response&&n.response.data});return c};t.Z=SSRAuthRequest},26131:function(e,t,n){"use strict";n.r(t);var i=n(85893),o=n(41664),s=n.n(o),a=n(9008),l=n.n(a),r=n(89139),d=n(74590),c=n.n(d);t.default=()=>(0,i.jsxs)("div",{className:c()["not-found"],children:[(0,i.jsx)(l(),{children:(0,i.jsx)("title",{children:"404 \xb7 Indicator"})}),(0,i.jsxs)("div",{className:c()["not-found-container"],children:[(0,i.jsx)("img",{src:"/images/404asset.svg",alt:"404"}),(0,i.jsx)("h1",{children:"Page not found"}),(0,i.jsx)("p",{children:"404 – That's an error code"}),(0,i.jsx)("p",{children:"It looks like the page you were looking for doesn't exist :("}),(0,i.jsx)(s(),{href:"/",children:(0,i.jsx)(r.Z,{slim:!0,content:"Go to Home"})})]})]})},88464:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return R}});var i=n(85893),o=n(67294),s=n(62286),a=n(45007),l=n(9008),r=n.n(l),d=n(23157),c=n(82241),u=n(9198),m=n.n(u),h=n(11163),p=n(89139),g=n(86994),v=n(86018),x=n(40150),f=n(26131),_=n(60887),b=n(45587),j=n(32339),y=n(24285),w=n(51194),ui_SortableItem=e=>{let{id:t,itemComponent:n,handle:o}=e,{attributes:s,listeners:a,setNodeRef:l,transform:r,transition:d,setActivatorNodeRef:c}=(0,b.nB)({id:t}),u={transform:y.ux.Transform.toString(r),transition:d},m=o?{ref:c}:void 0;return(0,i.jsxs)("div",{className:"sortable-item",ref:l,style:u,...s,children:[n,o&&(0,i.jsx)("button",{className:"drag-handle",...m,...a,tabIndex:0,type:"button",cursor:"grab",children:(0,i.jsx)(w.U9,{})})]})},ui_SortableDndList=e=>{let{items:t,setItems:n,getItemComponent:o,handle:s}=e,a=(0,_.Dy)((0,_.VT)(_.we),(0,_.VT)(_.Lg,{coordinateGetter:b.is}));return(0,i.jsx)(_.LB,{sensors:a,collisionDetection:_.pE,onDragEnd:e=>{let{active:t,over:i}=e;t.id!==i.id&&n(e=>{let n=e.findIndex(e=>e.id===t.id),o=e.findIndex(e=>e.id===i.id);return(0,b.Rp)(e,n,o)})},modifiers:[j.F4,j.DL,j.hg],children:(0,i.jsx)(b.Fo,{items:t,strategy:b.qw,children:t.map((e,t)=>{let n=o(e);return(0,i.jsx)(ui_SortableItem,{id:e.id,itemComponent:n,handle:s},e.id||t)})})})},T=n(62676),C=n(12744),A=n(79036),S=n(60846),k=n(74778),N=n(87375),I=n(92327);n(35890);var D=n(1937),Z=n.n(D);let E={IndicatorSeparator:()=>null,DropdownIndicator:()=>(0,i.jsx)(w.qL,{})},O={control:(e,t)=>({...e,outline:"none",cursor:"pointer",minHeight:"36px",borderWidth:"2px",borderColor:t.isFocused?"#1480f9":"transparent",backgroundColor:t.isFocused?"#0b0e10":"#393d40",boxShadow:"none","&:hover":{background:t.isFocused?"#0b0e10":"#444649"},fontSize:"15px"}),valueContainer:e=>({...e}),option:e=>({...e,cursor:"pointer",margin:"2px 8px",width:"calc(100% - 16px)","&:hover":{background:"#252a2f"},borderRadius:"6px",padding:"8px",fontWeight:600}),menu:e=>({...e,borderRadius:"6px",boxShadow:"0px 0px 2px 1px rgba(0, 0, 0, 0.45)",background:"#16181C"}),menuList:e=>({...e,padding:0}),multiValue:e=>({...e,background:"#1480f9"}),input:e=>({...e,padding:"0"}),noOptionsMessage:e=>({...e,textAlign:"left"}),loadingMessage:e=>({...e,textAlign:"left"}),indicatorsContainer:e=>({...e,marginRight:".5rem"}),placeholder:e=>({...e,color:"#d2d2d2",fontSize:"15px"}),loadingIndicator:e=>({...e,"& > span":{fontSize:"4px"}})},selectTheme=e=>({...e,borderRadius:5,colors:{...e.colors,primary25:"#212428",primary50:"#212428",neutral0:"#3a3d40",neutral80:"#ffffff"}}),selectFilterOption=(e,t)=>e&&e.label.props.children.toLowerCase().includes(t.toLowerCase()),getItem=(e,t)=>
1null==e?void 0:e.map(e=>{var n;return{value:e.id,label:(0,i.jsx)("span",{className:"custom-option",children:null===(n=t[null==e?void 0:e.id])||void 0===n?void 0:n.name})}}),getOtherTitles=e=>null==e?void 0:e.map(e=>({value:e,label:(0,i.jsx)("span",{className:"custom-option",children:e})})),handleCheckBoxChange=(e,t,n,i,o)=>{let s=[...i],a=s.indexOf(n),l=s[a].types;l=e?[...l,t]:l.filter(e=>e!==t),s[a]={...s[a],types:l},o(s)},WebsiteComponent=e=>{let{site:t,websites:n,setWebsites:o,removeWebsite:s,editWebsite:a}=e;return(0,i.jsxs)("div",{className:Z()["sortable-inner"],children:[(0,i.jsxs)("div",{className:Z()["icon-wrapper"],children:[(0,S.y)(t.type),(0,i.jsx)("span",{children:t.type})]}),(0,i.jsx)("input",{id:"".concat(t.type,"-field"),type:"text",value:t.url||"",onChange:e=>{let i=[...n],s=i.indexOf(t);i[s].url=e.target.value,o(i)},onBlur:e=>{let n={...t,url:e.target.value};delete n.id,a(n)}}),(0,i.jsx)(p.Z,{className:Z()["delete-btn"],onClick:()=>s(t.type),children:(0,i.jsx)(w.Xm,{})})]})},CompanyCheckbox=e=>{let{title:t,type:n,company:o,onChange:s}=e;return(0,i.jsxs)("label",{htmlFor:"".concat(o.id,"-").concat(n,"-checkbox"),className:Z()["company-checkbox"],children:[t,(0,i.jsx)("input",{id:"".concat(o.id,"-").concat(n,"-checkbox"),type:"checkbox",checked:o.types.includes(n),onChange:s})]})},CompanyComponent=e=>{let{company:t,companies:n,setCompanies:o}=e;return(0,i.jsxs)("div",{className:Z()["sortable-inner"],children:[(0,i.jsx)("input",{id:"".concat(t.id,"-title-field"),type:"text",value:t.title||"",onChange:e=>{let i=[...n],s=i.indexOf(t);i[s]={...i[s],title:e.target.value},o(i)}}),(0,i.jsx)(CompanyCheckbox,{title:"Pub",type:"PUBLISHER",company:t,onChange:e=>handleCheckBoxChange(e.target.checked,"PUBLISHER",t,n,o)}),(0,i.jsx)(CompanyCheckbox,{title:"Dev",type:"DEVELOPER",company:t,onChange:e=>handleCheckBoxChange(e.target.checked,"DEVELOPER",t,n,o)}),(0,i.jsx)(CompanyCheckbox,{title:"S.Dev",type:"DEVELOPER_SUPPORT",company:t,onChange:e=>handleCheckBoxChange(e.target.checked,"DEVELOPER_SUPPORT",t,n,o)}),(0,i.jsx)(p.Z,{className:Z()["delete-btn"],onClick:()=>o(n.filter(e=>e.id!==t.id)),children:(0,i.jsx)(w.Xm,{})})]})},EditGameTool=e=>{var t,n,l,u,x,_;let{errorCode:b,notAdmin:j}=e,y=(0,s.parseCookies)(),w=(0,a.I0)(),T=(0,h.useRouter)(),{gameSlugParam:k}=T.query,N=(0,a.v9)(e=>e.game.game),D=(null==N?void 0:null===(t=N.websites)||void 0===t?void 0:t.map(e=>({...e,id:e.type})))||[],R=(null==N?void 0:N.companies)||[],[P,F]=(0,o.useState)(N),[M,W]=(0,o.useState)(D),[G,L]=(0,o.useState)(R),[B,X]=(0,o.useState)((null==P?void 0:P.title)||""),[V,z]=(0,o.useState)(null==P?void 0:P.description),[U,q]=(0,o.useState)(null==P?void 0:P.releaseDate),[H,Q]=(0,o.useState)(getItem(null==P?void 0:P.platforms,S.wO)),[Y,J]=(0,o.useState)(getItem(null==P?void 0:P.genres,S.tV)),[K,$]=(0,o.useState)(getItem(null==P?void 0:P.gameModes,S.D8)),[ee,et]=(0,o.useState)(getOtherTitles(null==P?void 0:P.otherTitles)),[en,ei]=(0,o.useState)(!1),[eo,es]=(0,o.useState)(!1),[ea,el]=(0,o.useState)(M),[er,ed]=(0,o.useState)(G),[ec,eu]=(0,o.useState)(!1),[em,eh]=(0,o.useState)(!1),[ep,eg]=(0,o.useState)(!1),[ev,ex]=(0,o.useState)(!1),[ef,e_]=(0,o.useState)(!1),[eb,ej]=(0,o.useState)(!1),[ey,ew]=(0,o.useState)(!1),[eT,eC]=(0,o.useState)(!1),initializeData=e=>{F(e),X(null==e?void 0:e.title),z(null==e?void 0:e.description),q(null==e?void 0:e.releaseDate),Q(getItem(null==e?void 0:e.platforms,S.wO)),J(getItem(null==e?void 0:e.genres,S.tV)),$(getItem(null==e?void 0:e.gameModes,S.D8)),et(getOtherTitles(null==e?void 0:e.otherTitles)),ei(!1),es(!1),el(null==e?void 0:e.websites),ed(null==e?void 0:e.companies)},uploadImg=(e,t,n)=>{let i=new FormData,o=new File([e],"newFile.jpeg",{type:e.type});return i.append("file",o),I.Z.post("/upload",i,{headers:{"X-Auth":y.accessToken}}).then(t).catch(e=>{console.log(e),n()})},compareArrays=(e,t)=>(null==e?void 0:e.length)!==(null==t?void 0:t.length)||JSON.stringify(e)!==JSON.stringify(t),eA=null===S.pi||void 0===S.pi?void 0:S.pi.filter(e=>!(null==ea?void 0:ea.find(t=>(null==t?void 0:t.type)===e))),eS=null==H?void 0:H.map(e=>e.value),ek=null==P?void 0:null===(n=P.platforms)||void 0===n?void 0:n.map(e=>e.id),eN=null==Y?void 0:Y.map(e=>e.value),eI=null==P?void 0:null===(l=P.genres)||void 0===l?void 0:l.map(e=>e.id),eD=null==K?void 0:K.map(e=>e.value),eZ=null==P?void 0:null===(u=P.gameModes)||void 0===u?void 0:u.map(e=>e.id),eE=null==ee?void 0:ee.map(e=>e.value),hasChangedData=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(B!==(null==P?void 0:P.title)){if(!e)return!0;e.title=B}
1if(V!==(null==P?void 0:P.description)){if(!e)return!0;e.description=V}if(U!==(null==P?void 0:P.releaseDate)){if(!e)return!0;e.releaseDate={day:new Date(U).getDate(),month:new Date(U).getMonth()+1,year:new Date(U).getFullYear()}}if(compareArrays(eS,ek)){if(!e)return!0;e.platforms=eS}if(compareArrays(eN,eI)){if(!e)return!0;e.genres=eN}if(compareArrays(eD,eZ)){if(!e)return!0;e.gameModes=eD}if(compareArrays(eE,null==P?void 0:P.otherTitles)){if(!e)return!0;e.otherTitles=eE}if(en){if(!e)return!0;e.coverImageCode=en}if(eo){if(!e)return!0;e.iconImageCode=eo}return!1},editGame=async()=>{ej(!1),e_(!0);let e={};return await hasChangedData(e),I.Z.post("/admin/game/".concat(P.id,"/edit"),e,{headers:{"Content-Type":"application/json","X-Auth":y.accessToken}}).then(e=>{console.log("Game data updated successfully"),e_(!1),ew(!1),eu(!1),eh(!1),initializeData(null==e?void 0:e.data),w((0,C.bG)("Game data updated successfully!")),w((0,A.XP)(null==e?void 0:e.data)),T.push("/game/".concat(k),void 0,{shallow:!0})}).catch(e=>{console.log(e),ej(e.response.data),e_(!1),ew(!1),w((0,C.bG)(null==e?void 0:e.message))})},addWebsite=e=>{eC(!0);let t={type:e,name:e,url:""};return I.Z.post("/admin/game/".concat(P.id,"/website"),t,{headers:{"Content-Type":"application/json","X-Auth":y.accessToken}}).then(()=>{console.log("Website added successfully"),eC(!1),w((0,C.bG)("Website added successfully!"));let n={...t,id:e};el([...ea,n]),W([...M,n])}).catch(e=>{console.log(e),eC(!1),w((0,C.bG)(null==e?void 0:e.message))})},editWebsite=e=>I.Z.post("/admin/game/".concat(P.id,"/website"),e,{headers:{"Content-Type":"application/json","X-Auth":y.accessToken}}).then(()=>{w((0,C.bG)("Website edited successfully!"))}).catch(e=>{console.log(e),eC(!1),w((0,C.bG)(null==e?void 0:e.message))}),removeWebsite=e=>I.Z.post("/admin/game/".concat(P.id,"/website/remove"),{type:e},{headers:{"Content-Type":"application/json","X-Auth":y.accessToken}}).then(()=>{console.log("Website removed successfully"),w((0,C.bG)("Website removed successfully!")),el(ea.filter(t=>t.type!==e)),W(M.filter(t=>t.type!==e))}).catch(e=>{console.log(e),w((0,C.bG)(null==e?void 0:e.message))}),eO=[],eR=[],eP=[];return(Object.keys(S.tV).forEach(e=>{let t=S.tV[e];eO.push({value:e,label:(0,i.jsx)("span",{className:"custom-option",children:t.name})})}),Object.keys(S.wO).forEach(e=>{let t=S.wO[e];eR.push({value:e,label:(0,i.jsx)("span",{className:"custom-option",children:t.name})})}),Object.keys(S.D8).forEach(e=>{let t=S.D8[e];eP.push({value:e,label:(0,i.jsx)("span",{className:"custom-option",children:t.name})})}),(0,o.useEffect)(()=>{P||N||!k||w((0,A.kw)(k)).then(e=>{var t;(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.code)===400&&(T.back(),w((0,C.bG)("No game found with that slug! Try again or add the game.")))})},[k]),(0,o.useEffect)(()=>{!P&&N&&initializeData(N)},[N]),j||b)?(0,i.jsx)(f.default,{}):(0,i.jsxs)("div",{className:"".concat(Z()["edit-game-tool"]," ").concat(Z().wide),children:[(0,i.jsxs)(r(),{children:[(0,i.jsxs)("title",{children:["Edit: ",null==P?void 0:P.title," \xb7 Indicator"]}),(0,i.jsx)("meta",{name:"robots",content:"noindex,nofollow"})]}),(0,i.jsxs)("h1",{children:["Edit game tool: ",(0,i.jsx)("span",{children:null==P?void 0:P.title})]}),(0,i.jsxs)("div",{className:Z()["edit-container"],children:[(0,i.jsxs)("form",{onSubmit:e=>{e.preventDefault(),ew(!0)},className:Z()["multi-column-form"],children:[(0,i.jsxs)("div",{className:Z()["multi-column-form-content"],children:[(0,i.jsxs)("div",{children:[(0,i.jsxs)("label",{children:["Game title",(0,i.jsx)("input",{id:"title-field",type:"text",value:B,onChange:e=>{X(e.target.value),ej(!1)}})]}),(0,i.jsxs)("label",{children:["Game description",(0,i.jsx)("textarea",{id:"description-field",value:V||"",onChange:e=>{z(e.target.value),ej(!1)}})]}),(0,i.jsxs)("label",{children:["Release date (day.month.year)",(0,i.jsx)(m(),{selected:U,showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select",dateFormat:"dd.MM.yyyy",onChange:e=>{let t=new Date(e).getTime();q(t),ej(!1)},onSelect:e=>{let t=new Date(e).getTime();q(t),ej(!1)}})]}),(0,i.jsxs)("label",{htmlFor:"",children:["Icon image",eo?(0,i.jsxs)("p",{children:[(0,i.jsx)("b",{children:"Image uploaded successfully! Remember to save changes."}),(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),(0,i.jsx)(p.Z,{slimmer:!0,content:"Upload different image",standard:!0,onClick:()=>es(!1)})]}):(0,i.jsxs)("button",{className:Z()["icon-modal-btn"],onClick:()=>eh(!0),type:"button",children:[(0,i.jsx)("img",{src:(null==P?void 0:P.iconImage)||"/images/GameAvatarBlue.png",alt:"icon img placeholder"}),(0,i.jsx)("img",{className:Z()["custom-icon"],src:"/icons/camera.svg",alt:"camera icon"})]})]}),(0,i.jsxs)("label",{children:["Cover image (new img will also be added to screenshots)",en?(0,i.jsxs)("p",{children:[(0,i.jsx)("b",{children:"Image uploaded successfully! Remember to save changes."}),(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),(0,i.jsx)(p.Z,{slimmer:!0,content:"Upload different image",standard:!0,onClick:()=>ei(!1)})]}):(0,i.jsxs)("button",{className:Z()["cover-modal-btn"],onClick:()=>eu(!0),type:"button",children:[(0,i.jsx)("img",{src:(null==P?void 0:P.coverImage)||(null==P?void 0:null===(x=P.screenshots)||void 0===x?void 0:x[0])||"/images/DefaultCover.jpg",alt:"cover img placeholder"}),(0,i.jsx)("img",{className:Z()["custom-icon"],src:"/icons/camera.svg",alt:"camera icon"})]})]})]}),(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{children:"Genres"}),(0,i.jsx)(d.ZP,{className:Z()["tool-select"],options:eO,isMulti:!0,value:Y,onChange:e=>J(e),filterOption:selectFilterOption,components:E,styles:O,theme:selectTheme})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{children:"Platforms"}),(0,i.jsx)(d.ZP,{className:Z()["tool-select"],options:eR,isMulti:!0,value:H,onChange:e=>Q(e),filterOption:selectFilterOption,components:E,styles:O,theme:selectTheme})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{children:"Game modes"}),(0,i.jsx)(d.ZP,{className:Z()["tool-select"],options:eP,isMulti:!0,value:K,onChange:e=>$(e),filterOption:selectFilterOption,components:E,styles:O,theme:selectTheme})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{children:"Other titles"}),(0,i.jsx)(c.Z,{className:Z()["tool-select"],isMulti:!0,options:getOtherTitles(null==P?void 0:P.otherTitles),value:ee,onChange:e=>et(e),components:E,styles:O,theme:selectTheme})]})]})]}),eb&&(0,i.jsxs)("p",{className:Z().error,children:["Error: ",null==eb?void 0:eb.message]}),(0,i.jsx)(p.Z,{loading:ef,disabled:!hasChangedData(),type:"submit",className:Z()["submit-button"],content:"Save changes"})]}),(0,i.jsxs)("div",{className:Z()["reorderable-container"],children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{children:"Companies"}),(0,i.jsxs)("div",{className:Z()["sortable-list"],children:[(0,i.jsx)(ui_SortableDndList,{items:er,setItems:ed,getItemComponent:e=>(0,i.jsx)(CompanyComponent,{company:e,companies:er,setCompanies:ed}),handle:!0}),0===er.length&&"No companies to edit."]}),(0,i.jsx)("div",{className:Z()["add-new-actions"],children:er.length>0&&(0,i.jsx)(p.Z,{slimmer:!0,smallFont:!0,disabled:!compareArrays(G,er),onClick:()=>{let e={gameId:P.id,companies:er.map(e=>({id:e.id,types:e.types,title:e.title}))};return I.Z.post("/admin/game/companies",e,{headers:{"Content-Type":"application/json","X-Auth":y.accessToken}}).then(()=>{w((0,C.bG)("Companies updated successfully!")),L(er)}).catch(e=>{console.log(e),w((0,C.bG)(null==e?void 0:e.message))})},className:Z()["save-changes-btn"],children:"Save changes"})})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{children:"Websites"}),(0,i.jsxs)("div",{className:Z()["sortable-list"],children:[(0,i.jsx)(ui_SortableDndList,{items:ea,setItems:el,getItemComponent:e=>(0,i.jsx)(WebsiteComponent,{site:e,websites:ea,setWebsites:el,removeWebsite:removeWebsite,editWebsite:editWebsite}),handle:!0}),0===ea.length&&"No websites added yet."]}),(0,i.jsxs)("div",{className:Z()["add-new-actions"],children:[(0,i.jsxs)("div",{children:[eA.length>0?(0,i.jsx)("select",{id:"new-website-select",children:eA.map(e=>(0,i.jsx)("option",{value:e,children:e},e))}):(0,i.jsx)("span",{children:"All sites added. Nice!"}),(0,i.jsx)(p.Z,{slimmer:!0,smallFont:!0,loading:eT,disabled:0===eA.length||eT,onClick:()=>{let e=document.querySelector("#new-website-select").value;addWebsite(e)},children:"Add website"})]}),ea.length>0&&(0,i.jsx)(p.Z,{slimmer:!0,smallFont:!0,disabled:!compareArrays(M,ea),onClick:()=>{let e={types:ea.map(e=>e.type)};return I.Z.post("/admin/game/".concat(P.id,"/websites/reorder"),e,{headers:{"Content-Type":"application/json","X-Auth":y.accessToken}}).then(()=>{w((0,C.bG)("Websites reordered successfully!")),W(ea)}).catch(e=>{console.log(e),w((0,C.bG)(null==e?void 0:e.message))})},children:"Save order"})]})]})]})]}),ec&&(0,i.jsx)(g.Z,{fullscreen:!0,isUploading:ep,submitFunction:(e,t)=>{eg(!0),uploadImg(e,e=>{var n;ei(null==e?void 0:null===(n=e.data)||void 0===n?void 0:n.code),eg(!1),eu(!1),t()},()=>eg(!1))},aspect:3,minCrop:{width:768,height:256},header:"Edit cover picture",initialImg:(null==P?void 0:P.coverImage)||(null==P?void 0:null===(_=P.screenshots)||void 0===_?void 0:_[0])||"/images/DefaultCover.jpg",closeFunction:()=>eu(!1)}),em&&(0,i.jsx)(g.Z,{fullscreen:!0,isUploading:ev,submitFunction:(e,t)=>{ex(!0),uploadImg(e,e=>{var n;es(null==e?void 0:null===(n=e.data)||void 0===n?void 0:n.code),ex(!1),eh(!1),t()},()=>ex(!1))},aspect:.75,minCrop:{width:192,height:256},header:"Edit icon image",initialImg:(null==P?void 0:P.iconImage)||"/images/GameAvatarBlue.png",closeFunction:()=>eh(!1)}),ey&&(0,i.jsx)(v.Z,{closeFunction:()=>ew(!1),confirmationFunction:editGame,text:"Are you sure you want to save changes to this game?",title:"Save?",buttonText:"Save"})]})};EditGameTool.getInitialProps=k.Y.getInitialPageProps(e=>async t=>{let n,i;
1let{gameSlugParam:o}=t.query,s=o.toLowerCase();if(t.req&&(i=await (0,N.Z)("/profile/",t)),i&&!i.code){var a;if(null==i?void 0:null===(a=i.roles)||void 0===a?void 0:a.includes("ADMIN")){if(e.dispatch((0,T.fjI)(i)),!(0,S.kF)(s))return{errorCode:201};if((n=await (0,N.Z)("/game/".concat(s),t))&&!n.code)return e.dispatch((0,A.XP)(n)),{errorCode:n&&n.code}}return{notAdmin:!0}}return{}});var R=(0,x.Z)(EditGameTool)},14065:function(e){e.exports={"add-image-overlay":"AddImageModal_add-image-overlay__sgw42","add-image-modal":"AddImageModal_add-image-modal__rteQO",fullscreen:"AddImageModal_fullscreen__hJq_l","initial-img":"AddImageModal_initial-img__gowcb",content:"AddImageModal_content__g5teW",circular:"AddImageModal_circular__zJLP0"}},1937:function(e){e.exports={"invite-tool":"AdminTool_invite-tool__BoJeB","edit-game-tool":"AdminTool_edit-game-tool__zUQeQ","add-game-tool":"AdminTool_add-game-tool__4PB3_",admin:"AdminTool_admin__14wxE",reports:"AdminTool_reports__lXXVJ",wide:"AdminTool_wide__YHZ7Z","edit-container":"AdminTool_edit-container__2gzMV","multi-column-form":"AdminTool_multi-column-form__exTHi","multi-column-form-content":"AdminTool_multi-column-form-content__zd5yi","tool-select":"AdminTool_tool-select__vdKrM",error:"AdminTool_error__A3NlS",tip:"AdminTool_tip__DW94F","submit-button":"AdminTool_submit-button__mX3zC","import-actions":"AdminTool_import-actions__Dyc_E","cover-modal-btn":"AdminTool_cover-modal-btn___zf4s","icon-modal-btn":"AdminTool_icon-modal-btn__7uOun","custom-icon":"AdminTool_custom-icon__WYxTN","invitation-info-area":"AdminTool_invitation-info-area__93hIG","action-buttons":"AdminTool_action-buttons__ZZQTh",redo:"AdminTool_redo__wLVq6","reorderable-container":"AdminTool_reorderable-container__k5Tcs","sortable-list":"AdminTool_sortable-list__WmJvv","delete-btn":"AdminTool_delete-btn__36UNn",active:"AdminTool_active__RiOa9","sortable-inner":"AdminTool_sortable-inner__4rwYY","icon-wrapper":"AdminTool_icon-wrapper__M9NHE","add-new-actions":"AdminTool_add-new-actions___Ilr5","save-changes-btn":"AdminTool_save-changes-btn__UV53c","company-checkbox":"AdminTool_company-checkbox__ZQJ_Q","link-list":"AdminTool_link-list__bmagO","input-item":"AdminTool_input-item__5mWxy",disabled:"AdminTool_disabled__tLjeu","action-button":"AdminTool_action-button__2m3QC","reports-list":"AdminTool_reports-list__nqFQm",report:"AdminTool_report__lV0PH","no-link":"AdminTool_no-link__YURNd","report-actions":"AdminTool_report-actions__0f5zA","report-content-link":"AdminTool_report-content-link__8eKpV"}},98019:function(e){e.exports={"confirmation-overlay":"ConfirmationModal_confirmation-overlay__CHvWL","confirmation-modal":"ConfirmationModal_confirmation-modal__5kzR1"}},74590:function(e){e.exports={"not-found":"NotFound_not-found__RtfgX","not-found-container":"NotFound_not-found-container__Q_I8C"}},33768:function(e){e.exports={"site-spinner-container":"SiteSpinner_site-spinner-container__9F89W","site-spinner-inner":"SiteSpinner_site-spinner-inner__DtcXi","site-spinner":"SiteSpinner_site-spinner__6B__e",ripple:"SiteSpinner_ripple__Vmbw1"}}},function(e){e.O(0,[3157,304,266,1804,9774,2888,179],function(){return e(e.s=74821)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.