1"use strict";(self.webpackChunksgdb=self.webpackChunksgdb||[]).push([[2624],{92624:(e,t,n)=>{n.r(t),n.d(t,{default:()=>_}),n(10853),n(35054),n(27138),n(85005),n(73214),n(31807),n(29897),n(21562),n(54994),n(43326),n(26364),n(86632),n(61928),n(54883),n(45007),n(68995),n(18821),n(4845),n(16543),n(33142),n(80174),n(3973),n(80044),n(19701),n(80238),n(61078),n(6208),n(12938),n(26425);var r=n(89526),a=n(565),o=n(59934),l=n(32522),c=n(53672),i=n(52868),u=n.n(i),s=n(16092),m=n.n(s),p=n(47769),d=n(72005),f=n(54084),g=(n(9115),n(2652)),h=n.n(g),b=n(42609),E=n(11522),v=n(96814),y=(n(39180),n(33290),n(33130),n(8650),n(16750));function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w.apply(this,arguments)}var S=function(e){var t=e.id,n=e.badge,a=e.onShowToggle,o=(0,b.nB)({id:t}),l=o.attributes,c=o.listeners,i=o.setNodeRef,u=o.isDragging,s=o.transform,m=o.transition,p={transform:y.ux.Translate.toString(s),transition:m};return r.createElement("div",{ref:i,style:p,className:"badge-wrap".concat(u?" dragging":""),"data-hidden":n.isHidden?1:0},r.createElement("div",w({},l,c),r.createElement("img",{src:"/static/img/badges/".concat(t,".svg")})),r.createElement("span",{className:"btn badge-hide",onClick:a?function(){a(n)}:void 0},n.isHidden?"Show":"Hide"))};S.propTypes={id:h().number.isRequired,badge:h().any,onShowToggle:h().func};const k=S;var N=function(e){var t=e.badges,n=e.onMove,a=e.onShowToggle,o=(0,r.useMemo)((function(){return t.map((function(e){return e.id}))}),[t]),l=(0,E.Dy)((0,E.VT)(E.we),(0,E.VT)(E.LO));return r.createElement(E.LB,{autoScroll:!1,sensors:l,collisionDetection:E.pE,onDragEnd:function(e){var r=e.active,a=e.over,o=t.findIndex((function(e){return e.id===r.id})),l=t.findIndex((function(e){return e.id===a.id}));null==n||n((0,b.Rp)(t,o,l))}},r.createElement(b.Fo,{items:o,strategy:b.PG,modifiers:[v.K7,v.F4]},r.createElement("div",{id:"badges-manager"},t.map((function(e){return r.createElement(k,{key:e.id,id:e.id,onShowToggle:a,badge:e})})))))};N.propTypes={badges:h().array.isRequired,onMove:h().func,onShowToggle:h().func};const C=N;var O=n(40506);function P(e){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P(e)}function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==P(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==P(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===P(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,l,c=[],i=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;i=!1}else for(;!(i=(r=o.call(n)).done)&&(c.push(r.value),c.length!==t);i=!0);}catch(e){u=!0,a=e}finally{try{if(!i&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw a}}return c}}(e,t)||I(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(e,t){if(e){if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(e,t):void 0}}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var D=function(e){var t=T((0,r.useState)(!1),2),n=t[0],a=t[1],o=T((0,r.useState)(null),2),l=o[0],c=o[1];return{onAdd:function(t){a(!0);var n=t.target.files[0],r=new FormData;r.append("image",n),u().post(e,r,{headers:{"Content-Type":"multipart/form-data"}}).then((function(e){var t=e.data;c(t.data)})).catch((function(e){new(m())({timeout:5e3,type:"error",text:e.response.data.errors.join("<br>")}).show()})).finally((function(){a(!1)}))},onRemove:function(t){t.preventDefault(),u().delete(e).then((function(){return c(null)}))},processing:n,image:l}};const _=function(){var e=(0,r.useRef)(),t=(0,r.useRef)(),n=(0,d.Z)("/api/public/prefs").data,i=T((0,r.useState)(!1),2),s=i[0],g=i[1],h=T((0,r.useState)(!1),2),b=h[0],E=h[1],v=T((0,r.useState)(!1),2),y=v[0],w=v[1],S=T((0,r.useState)(""),2),k=S[0],N=S[1],P=T((0,r.useState)([]),2),_=P[0],F=P[1],R=T((0,r.useState)(!1),2),L=R[0],G=R[1],H=T((0,r.useState)(null),2),Z=H[0],M=H[1],U=T((0,r.useState)(null),2),B=U[0],J=U[1],q=T((0,r.useState)(!1),2),z=q[0],K=q[1],W=T((0,r.useState)(""),2),V=W[0],Y=W[1],$=D("/api/v2/patreon/avatar"),Q=$.onAdd,X=$.onRemove,ee=$.processing,te=$.image,ne=T((0,r.useState)(),2),re=ne[0],ae=ne[1],oe=D("/api/v2/patreon/header"),le=oe.onAdd,ce=oe.onRemove,ie=oe.processing,ue=oe.image,se=T((0,r.useState)(),2),me=se[0],pe=se[1],de=(0,r.useCallback)((function(e){var t=e.target.checked;u().patch("/api/v2/users/".concat(n.user.id),JSON.stringify({show_ads:t})).catch((function(e){var t=e.response.data;new(m())({timeout:2500,type:"error",text:t.errors.join("<br>")}).show(),g(!1)})),g(t)}),[n]),fe=(0,r.useCallback)((function(e){var t=e.target.checked;u().patch("/api/v2/users/".concat(n.user.id),JSON.stringify({low_performance:t})),E(t)}),[n]),ge=(0,r.useCallback)((function(e){u().post("/api/v2/patreon/update",{name:k,show_supporters:void 0!==e?e:y}
1)}),[k,y]),he=(0,r.useCallback)((function(e){e.preventDefault(),u().patch("/api/v2/users/".concat(n.user.id),JSON.stringify({username:V}))}),[n,V]),be=(0,l.Z)((function(e){u().get("/api/v2/users/checkname",{params:{username:e}}).then((function(e){var t=e.data;t.success?G(!1):G(t.data)}))}),450),Ee=function(e){var t=e.map((function(e){return{id:e.id,hidden:e.isHidden}}));u().patch("/api/v2/users/".concat(n.user.id),JSON.stringify({badges:t}))};return(0,r.useEffect)((function(){n.current_prefs&&(F(n.user.badges),ae(n.patreon.patron.avatar),pe(n.patreon.patron.header),w(n.patreon.patron.supporters_show),N(null==n.patreon.patron.name_custom?"":n.patreon.patron.name_custom),g(n.current_prefs.ads),M(n.user.api_key),E(n.current_prefs.low_performance))}),[n]),(0,r.useEffect)((function(){ae(te)}),[te]),(0,r.useEffect)((function(){pe(ue)}),[ue]),n?r.createElement("div",{className:"container profile"},r.createElement(c.q,null,r.createElement("title",null,"Preferences - SteamGridDB")),r.createElement("div",{className:"columns"},r.createElement("div",{className:"column"},r.createElement("div",{className:"tabs"},r.createElement("ul",null,r.createElement("li",null,r.createElement(a.OL,{activeClassName:"is-active",to:"/profile/preferences",exact:!0},"Profile")),r.createElement("li",null,r.createElement(a.OL,{activeClassName:"is-active",to:"/profile/preferences/filters"},"Filters")),r.createElement("li",null,r.createElement(a.OL,{activeClassName:"is-active",to:"/profile/preferences/account"},"Account")),r.createElement("li",null,r.createElement(a.OL,{activeClassName:"is-active",to:"/profile/preferences/api"},"API")))),r.createElement(o.AW,{path:"/profile/preferences",exact:!0},r.createElement("h3",null,"General"),r.createElement("p",null,r.createElement("b",null,"Username")),r.createElement("form",{method:"post",onSubmit:he},r.createElement("input",{type:"text",name:"username",minLength:"1",maxLength:"25",autoComplete:"off",value:V,onChange:function(e){Y(e.target.value),be(e.target.value)},placeholder:n.user.username}),L&&r.createElement("span",{className:"error-msg"},L),r.createElement("button",{className:"btn",type:"submit",disabled:!!L},"Save")),r.createElement("hr",null),r.createElement("p",null,r.createElement(f.Z,{type:"toggle",onChange:de,checked:s},"Show Advertising")),r.createElement(f.Z,{type:"toggle",onChange:fe,checked:b},"Low Performance Mode"),r.createElement("p",null,"Disables some effects that may slow down weak devices or browsers with GPU acceleration disabled."),r.createElement("hr",null),r.createElement("h3",null,"Badges"),r.createElement("p",null,"Drag and drop to change the order of your badges. Some parts of the site will only show the first 3 badges."),_.length>0?r.createElement(C,{badges:_,onMove:function(e){F((function(){return Ee(e),e}))},onShowToggle:function(e){F((function(t){var n,r=function(e){if(Array.isArray(e))return x(e)}(n=t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||I(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach((function(t){j(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e);return a.isHidden=!e.isHidden,r[t.indexOf(e)]=a,Ee(r),r}))}}):r.createElement("p",{className:"muted"},"You have no badges!"),r.createElement("hr",null),r.createElement("h3",null,"Profile Customization"),!(n.patreon.patron.has_token&&n.user.is_supporter)&&r.createElement("p",null,"The options below will not take effect until you ",r.createElement(a.rU,{to:"/profile/preferences/account"},"become a supporter on Patreon"),"."),r.createElement("div",{className:"columns"},r.createElement("div",{className:"column"},r.createElement("div",{className:"patreon-upload"},r.createElement("h3",null,"Custom Profile Picture"),r.createElement("p",null,"For best results, use a 200x200 image. Image will be resized/cropped if not square."),r.createElement("p",null,"File can be PNG, JPEG, or an animated GIF. Size must be under 3MB."),r.createElement("input",{onChange:Q,ref:e,type:"file",tabIndex:"-1",focusable:"false",name:"avatar",accept:"image/png, image/jpeg, image/gif",hidden:!0}),ee?r.createElement(p.Z,{name:"spinner",spin:!0}):r.createElement("button",{className:"btn",onClick:function(){return e.current.click()}},re?"Change":"Upload"," Avatar")," ",re&&!ee&&r.createElement(r.Fragment,null,r.createElement("button",{className:"btn",onClick:X},"Remove Custom Avatar"),r.createElement("div",{className:"preview"},r.createElement("img",{id:"custom-avatar-preview",src:re}))))),r.createElement("div",{className:"column"},r.createElement("div",{className:"patreon-upload"},r.createElement("h3",null,"Custom Profile Header"),r.createElement("p",null,"For best results, use a 3840x750 image. If your image height exceeds 750px, it will be resized."),r.createElement("p",null,"Sides will be cut depending on screen width, bottom 50px will be covered with a gradient.",r.createElement("br",null),"File must be PNG or JPEG and size under 10MB."),r.createElement("input",{onChange:le,ref:t,type:"file",tabIndex:"-1",focusable:"false",name:"header",accept:"image/png, image/jpeg",hidden:!0}),ie?r.createElement(p.Z,{name:"spinner",spin:!0}):r.createElement("button",{className:"btn",onClick:function(){return t.current.click()}},me?"Change":"Upload"," Header")," ",me&&!ie&&r.createElement(r.Fragment,null,r.createElement("button",{className:"btn",onClick:ce},"Remove Custom Header"),r.createElement("div",{className:"preview"},r.createElement("img",{id:"custom-avatar-preview",src:me}))))))),r.createElement(o.AW,{path:"/profile/preferences/account"},r.createElement("h3",null,"Patreon"),n.patreon.patron.has_token?r.createElement(r.Fragment,null,r.createElement("a",{href:"https://www.patreon.com/user?u=".concat(n.patreon.patron.id
1)},n.patreon.patron.name),0!==n.patreon.patron.tier&&n.user.is_supporter?r.createElement("p",null,"You are on Tier ",n.patreon.patron.tier,"."):r.createElement("p",null,"Patreon account linked, but you're not a patron ð¢"),r.createElement("a",{className:"btn",href:"/profile/unlink-patreon"},"Unlink Patreon Account")):r.createElement(r.Fragment,null,r.createElement("p",null,"Support development by pledging to ",r.createElement("a",{href:"https://www.patreon.com/steamgriddb"},"our Patreon"),"."),r.createElement("p",null,"If you're already a supporter, log in with Patreon to link your account and activate your rewards!"),r.createElement("a",{className:"patreon-btn",href:n.patreon.auth_url},r.createElement(p.Z,{name:"patreon"})," LOG IN WITH PATREON")),n.patreon.patron.has_token&&n.user.is_supporter&&r.createElement(r.Fragment,null,r.createElement("hr",null),r.createElement("h3",null,"Supporters Page"),r.createElement("form",{method:"post",onSubmit:function(e){e.preventDefault(),ge()}},r.createElement("p",null,r.createElement(f.Z,{type:"toggle",onChange:function(e){w(e.target.checked),ge(e.target.checked)},checked:y},"Show name on ",r.createElement(a.rU,{to:"/supporters"},"supporters")," page.")),r.createElement("p",null,r.createElement("label",{htmlFor:"supporters_name"},r.createElement("b",{className:"txt-small"},"Custom Supporter Name")),r.createElement("input",{id:"supporters_name",type:"text",maxLength:"30",placeholder:n.patreon.patron.name,value:k,onChange:function(e){return N(e.target.value)}})),r.createElement("button",{className:"btn",type:"submit"},"Save"))),r.createElement("hr",null),r.createElement("h3",null,"Delete account"),r.createElement("button",{className:"btn warn",onClick:function(){return J(!0)}},"Delete your SteamGridDB account."),B&&r.createElement(r.Fragment,null,r.createElement("p",null,"This will ",r.createElement("b",null,"permanently")," delete everything related to your account. This cannot be undone."),r.createElement("p",null,r.createElement("b",null,"Note:")," Due to caching, direct links to uploaded assets may take a few days to disappear."),r.createElement("br",null),r.createElement("p",null,'Type "I, ',n.user.username,', have chosen to descend into the digital void." below to delete your account.'),r.createElement("input",{type:"text",autoComplete:"false",required:!0,onChange:function(e){var t=e.target.value.trim();/^"?I,(.+)?, have chosen to descend into the digital void\."?$/.test(t)?K(!0):K(!1)}}),r.createElement("button",{className:"btn ".concat(z?"warn":""),disabled:!z,onClick:function(){u().delete("/api/v2/users").then((function(){setTimeout((function(){window.location.href="/"}),1500)}))}},"DELETE FOREVER"))),r.createElement(o.AW,{path:"/profile/preferences/filters"},r.createElement(O.Z,null)),r.createElement(o.AW,{path:"/profile/preferences/api"},r.createElement("h3",null,"API Key"),r.createElement("p",null,"API key for use with the ",r.createElement("a",{href:"/api"},"API"),"."),Z?r.createElement(r.Fragment,null,r.createElement("p",null,"Key: ",r.createElement("code",null,Z)),r.createElement("button",{className:"btn",onClick:function(){u().delete("/api/v2/users/apikey").then((function(){M(null)}))}},"Revoke API Key")):r.createElement("button",{className:"btn",onClick:function(){u().post("/api/v2/users/apikey").then((function(e){var t=e.data;M(t.data)}))}},"Create API Key"))))):null}}}]);
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.