"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7243],{7243:function(e,n,t){t.d(n,{Z:function(){return Layout}});var i=t(85893),o=t(67294),r=t(9473),a=t(78603),s=t(64720),l=t(6154),c=t(9103),u=t(36448),d=t(13594);function SkellyIntlProvider(e){let{children:n}=e,t=(0,c.T)(),r=(0,c.C)(e=>e.settings.locale),a=o.useRef(void 0),[l,g]=o.useState(void 0);return(o.useEffect(()=>{if(d.ZP.log("SkellyIntlProvider(): Locale set to '".concat(r,"'")),"en"===r){t((0,u.i_)("en-US"));return}if("de"===r){t((0,u.i_)("de-DE"));return}if("ru"===r){t((0,u.i_)("ru-RU"));return}void 0!==r&&a.current!==r&&(a.current=r,fetchMessages(r).then(e=>g(e)))},[r]),o.useEffect(()=>{l&&d.ZP.log("SkellyIntlProvider(): Messages loaded")},[l]),void 0===r||void 0===l)?null:(0,i.jsx)(s.Z,{locale:r,messages:l,children:n})}let fetchMessages=async e=>new Promise((n,t)=>{let i="/i18n/".concat(e,".json");d.ZP.log("SkellyIntlProvider.fetchMessages(locale: ".concat(e,"): Fetching ").concat(i)),l.Z.get(i).then(e=>{n(e.data)}).catch(e=>{console.log(e),t(e)})});var g=t(87138),m=t(53768),f=t(47669);function evictUserProfile(e){e&&(e.evict({id:"ROOT_QUERY",fieldName:"getMyFollowers",broadcast:!1}),e.evict({id:"ROOT_QUERY",fieldName:"getMyFollowees",broadcast:!1}),e.evict({id:"ROOT_QUERY",fieldName:"getMyFriendships",broadcast:!1}),e.evict({id:"ROOT_QUERY",fieldName:"getMyProfile",broadcast:!1}),e.evict({id:"ROOT_QUERY",fieldName:"getMySettings",broadcast:!1}),e.gc())}function evictUserActivties(e){e&&(e.evict({id:"ROOT_QUERY",fieldName:"getMyActivities",broadcast:!1}),e.gc())}function evictGroups(e){e&&(e.evict({id:"ROOT_QUERY",fieldName:"getGroups",broadcast:!1}),e.evict({id:"ROOT_QUERY",fieldName:"getGroupMembers",broadcast:!1}),e.gc())}var p=t(10638),v=t(51191),h=t(38854),y=t(72198),b=t(48702),_=t(51142),x=t(30424),k=t(82729),Z=t(31230);function _templateObject(){let e=(0,k._)(['\n #\n # IGDB\n #\n type IGDBGame {\n id: Int\n cover: IGDBCover\n first_release_date: Long\n involved_companies: [IGDBInvolvedCompany!]\n name: String\n platforms: [IGDBPlatform!]\n url: String\n }\n\n type IGDBCover {\n id: Int\n url: String\n }\n\n type IGDBInvolvedCompany {\n id: Int\n company: IGDBCompany\n developer: Boolean\n }\n\n type IGDBCompany {\n id: Int\n name: String\n websites: [IGDBWebsite!]\n }\n\n type IGDBWebsite {\n id: Int\n url: String\n }\n\n type IGDBPlatform {\n id: Int\n name: String\n }\n\n #\n # Overwolf game events\n #\n type OverwolfGameStatus {\n game_id: Int!\n # 0: Coming soon\n # 1: Good to go\n # 2: Some game events may be unavailable\n # 3: Game events are currently unavailable\n state: Int!\n disabled: Boolean!\n\n # Field only provided when requesting details\n published: Boolean\n features: [OverwolfGameFeature!]\n }\n\n type OverwolfGameFeature {\n name: String\n state: Int\n published: Boolean\n keys: [OverwolfGameKey!]\n }\n\n type OverwolfGameKey {\n name: String\n type: Int\n state: Int\n is_index: Boolean\n category: String\n sample_data: String\n published: Boolean\n }\n\n #\n # Websites\n #\n\n type WebsiteInfo {\n url: String\n title: String\n description: String\n image: String\n }\n\n #\n # Skelly - Search Public Profiles\n #\n type PubliProfiles {\n profiles: [PublicProfiles!]\n hasMore: boolean\n }\n\n type PublicProfile {\n friend_id: String\n customized_id: String\n languages: [String]\n country_of_residence: String\n avatar: String\n background: String\n summary: String\n real_name: String\n gamer_names: [String!]\n games: [String!]\n }\n\n #\n # Queries\n #\n\n extend type Query {\n # Input is array of game ids, e.g. ["2312", "4333"]\n getIGDBGames(input: [String!]!): [IGDBGame]!\n getIGDBGame(input: String!): IGDBGame!\n searchIGDBGames(input: String!): [IGDBGame]!\n\n getWebsiteInfo(input: String!): WebsiteInfo!\n getWebsiteInfos(input: [String!]!): [WebsiteInfo]!\n\n getOverwolfGameStatuses: [OverwolfGameStatus]!\n getOverwolfGameStatus(classId: String!): OverwolfGameStatus!\n\n searchPublicProfiles(\n games: [String!]\n country_of_residence: String\n languages: [String!]\n customized_id: String\n ): [PublicProfiles!]\n }\n']);return _templateObject=function(){return e},e}let j=(0,Z.Ps)(_templateObject());var S=t(69483),P=t.n(S);d.cM("ApolloConfig(): connectToDevTools: ",!1);let I=new x.xm(P());var w=t(32393);let C=new w.h({typePolicies:{MyProfile:{keyFields:[],fields:{accounts:{merge:(e,n)=>n},social_networks:{merge:(e,n)=>n},games:{merge:(e,n)=>n}}},IGDBGame:{keyFields:["id"]},Profile:{keyFields:["friend_id"]},Activity:{keyFields:!1},SocialNetwork:{keyFields:!1},TwitterAccount:{keyFields:!1},Friendships:{keyFields:!1},Account:{keyFields:!1},Group:{keyFields:["group_id"]},GroupMembers:{keyFields:["group_id"]},Websites:{keyFields:!1},FeedbackConsolidated:{keyFields:["game","account"]},TextFeedback:{keyFields:["game","account","feedback_id"]},Messages__:{keyFields:["chat_id"],fields:{messages:{merge(e,n,t){let{variables:i}=t;if(!e||!e.length)return n;let o=[...n||[],...e||[]],r=o.filter((e,n)=>o.findIndex(n=>n.message_id===e.message_id)===n);return r.sort((e,n)=>n.message_id-e.message_id),r}},nextToken:{merge(e,n,t){let{variables:i}=t;return e&&(null==i?void 0:i.nextToken)!==e?e:n}},scannedCount:{merge:(e,n)=>null},startedAt:{merge:(e,n)=>null}}},Activities:{keyFields:[],fields:{activities:{merge(e,n){let t=[...n];for(let n of e||[])t.find(e=>e.activity_id===n.activity_id)||t.push(n);return t.sort((e,n)=>n.activity_id-e.activity_id),t}},nextToken:{merge:(e,n)=>"n/a"===n?e:n},scannedCount:{merge:(e,n)=>(e||0)+(n||0)},startedAt:{merge:(e,n)=>-1===n?e:e||n}}},Query:{fields:{getMessages:{keyArgs:["chat_id"],read(e,n){let{args:t}=n;return e},merge(e,n,t){var i,o;let{args:r}=t;return e?0===((null===(i=n.messages)||void 0===i?void 0:i.length)||0)?e:0===((null===(o=e.messages)||void 0===o?void 0:o.length)||0)?n:n.messages[0].message_id>e.messages[0].message_id?n.nextToken?n:{chat_id:n.chat_id,messages:[...n.messages,...e.messages],nextToken:e.nextToken,scannedCount:null,startedAt:null}:{chat_id:n.chat_id,messages:[...e.messages,...n.messages],nextToken:n.nextToken,scannedCount:null,startedAt:null}:n}},getGroups:{merge:(e,n)=>n},getFCMTokens:{merge:(e,n)=>(console.log("cache.Query.fields.getFCMTokens(): Processing"),n)},getMyFriendships:{merge:(e,n)=>n}}},IGDBCover:{keyFields:!1},IGDBInvolvedCompany:{keyFields:!1},IGDBCompany:{keyFields:!1},IGDBWebsite:{keyFields:!1},IGDBPlatform:{keyFields:!1},WebsiteInfo:{keyFields:["url"]}}});async function getOverwolfGameStatuses(e,n,t){let{cache:i}=t;d.ZP.log("ApolloWrapper(): Local resolver getOverwolfGameStatuses called");let o=await l.Z.get("https://game-events-status.overwolf.com/gamestatus_prod.json"),r=o.data;return d.ZP.log("ApolloWrapper(): getOverwolfGameStatuses returned"),r}async function getOverwolfGameStatus(e,n,t){let{classId:i}=n,{cache:o}=t;d.ZP.log("ApolloWrapper(): Local resolver getOverwolfGameStatuses called (search: ".concat(i,")"));let r=await l.Z.get("https://game-events-status.overwolf.com/".concat(i,"_prod.json")),a=r.data;return d.ZP.log("ApolloWrapper(): getOverwolfGameStatuses returned"),a}var O=t(63200);async function fetchMetaData(e){let n;console.log("fetchMetaData(url: ".concat(e,"): Called"));let t=fetch(e),i=await t,o=await i.text(),r={name:{},property:{},title:null};for(;n=A.exec(o);)Array.isArray(n)&&4===n.length&&(r[n[1]][n[2]]=n[3]);let a=R.exec(o);return Array.isArray(a)&&a.length>=1&&(r.title=a[1]),r}let A=//g,R=/(.*?)<\/title>/g;async function getWebsiteInfo(e,n){let{input:t}=n;return d.ZP.log("ApolloWrapper(): Local resolver getPreviewLink called (url: ".concat(t,")")),null}async function getWebsiteInfos(e,n){let{input:t}=n;if(d.ZP.log("ApolloWrapper(): Local resolver getPreviewLinks called (urls: ".concat(JSON.stringify(t),")")),!t)return null;let i=[];for(let e of t){let n={link:void 0};n.link=e;let t=await fetchMetaData(e);i.push({url:e,title:t.title||t.property["og:title"]||t.name["twitter:title"]||null,description:t.property["og:description"]||t.name["twitter:description"]||null,image:t.property["og:image"]||t.name["twitter:image"]||null})}return i}var G=t(16243);async function searchIGDBGames(e){return await (0,G.d)("arn:aws:lambda:us-east-1:063451354639:function:skelly_igdb_games_search",e)}async function getIGDBGames(e){return(d.ZP.log("igdb.getIGDBGames(".concat(JSON.stringify(e),"): Called")),0===e.length)?{success:!0,games:[]}:await (0,G.d)("arn:aws:lambda:us-east-1:063451354639:function:skelly_igdb_games_get",e)}var L=t(23497);async function igdbGames_getIGDBGames(e,n,t){let i,{input:o}=n,{cache:r}=t;if(!Array.isArray(o)||0===o.length)return d.ZP.log("ApolloClient.getIGDBGames(): Local resolver returning 'null' (as there was no relevant input)"),null;d.ZP.log("ApolloClient.getIGDBGames(): Local resolver called (gameIds: ".concat(JSON.stringify(o),")"));let a=Array(o.length),s=[];for(let e=0;e=i.games.length)throw"InternalErrorIGDBGames";a[n]=transformGame(i.games[e++]);let t={query:L.wQ,variables:{gameId:null===(l=a[n])||void 0===l?void 0:l.id.toString()},data:{getIGDBGame:{...a[n]}}};r.writeQuery(t)}}catch(e){d.ZP.error("ApolloClient.getIGDBGames(): Lambda failed: ",e)}return d.ZP.log("ApolloClient.getIGDBGames(): result: ",a),a}let M={};async function getIGDBGame(e,n,t){let i,{input:o}=n,{client:r,cache:a}=t;if(d.ZP.log("ApolloClient.getIGDBGame(gameId: ".concat(o,"): Local resolver getIGDBGame called")),M[o])return new Promise((e,n)=>{M[o].push({resolve:e,reject:n})});M[o]=[];try{i=await getIGDBGames([o])}catch(e){for(d.ZP.log("ApolloClient.getIGDBGame(): *** ERROR: ",e),console.log(e),console.log(JSON.stringify(e));M[o].length;)M[o].shift().reject(e);throw delete M[o],e}if(!1===i.success||!i.games||1!==i.games.length){for(;M[o].length;)M[o].shift().resolve(null);return delete M[o],null}let s=transformGame(i.games[0]);for(;M[o].length;)M[o].shift().resolve(s);return delete M[o],s}async function igdbGames_searchIGDBGames(e,n,t){let{input:i}=n,{cache:o}=t;d.ZP.log("ApolloClient.searchIGDBGames(): Local resolver searchIGDBGames called (search: ".concat(JSON.stringify(i),")"));let r=await searchIGDBGames(i);if(!1===r.success||!r.games)return null;let a=r.games.map(e=>transformGame(e));return a}function transformGame(e){if(void 0===e.cover&&(e.cover=null),void 0===e.first_release_date&&(e.first_release_date=null),void 0===e.involved_companies)e.involved_companies=null;else if(e.involved_companies)for(let n of e.involved_companies)if(void 0===n.id&&(n.id=null),n.company){if(n.company.websites)for(let e of n.company.websites)void 0===e.id&&(e.id=null),void 0===e.url&&(e.url=null);else n.company.websites=null}else n.company=null;if(void 0===e.name&&(e.name=null),void 0===e.platforms)e.platforms=null;else if(e.platforms)for(let n of e.platforms)void 0===n.id&&(n.id=null),void 0===n.name&&(n.name=null);return void 0===e.url&&(e.url=null),{...e,__typename:"IGDBGame"}}var T=t(55576),D=t(51136),E=t(30490);async function searchPublicProfiles(e,n,t){var i;let{cache:o}=t;d.ZP.log("ApolloClient.searchPublicProfile(): Local resolver searchPublicProfile called (search: ".concat(JSON.stringify(n),")"));let r=new URL("web"===E.N||"ios"===E.N?"https://server.skelly.gg:3001/searchProfiles":"http://server.skelly.gg:3000/searchProfiles");n.games&&r.searchParams.set("games",n.games.join(",")),n.country_of_residence&&r.searchParams.set("country_of_residence",n.country_of_residence),n.languages&&r.searchParams.set("languages",n.languages.join(",")),n.customized_id&&r.searchParams.set("customized_id",n.customized_id),d.ZP.log("ApolloClient.searchPublicProfile(): url: ".concat(r.toString()));let a=await l.Z.get(r.toString(),{headers:{"Cache-Control":"no-cache"}});if(!(null==a?void 0:null===(i=a.data)||void 0===i?void 0:i.profiles))return null;for(let e of a.data.profiles)e.customized_id=e.customized_id||null,e.languages=e.languages||null,e.country_of_residence=e.country_of_residence||null,e.avatar=e.avatar||null,e.background=e.background||null,e.summary=e.summary||null,e.real_name=e.real_name||null,e.gamer_names=e.gamer_names||null,e.games=e.games||null;return null==a?void 0:a.data}let F="us-east-1",B="https://57oy2nj6xrbtxfrqkfjev3raoy.appsync-api.us-east-1.amazonaws.com/graphql";var N=t(75750),W=t(39518),wrapper_ApolloWrapper=e=>{let{children:n}=e,t=(0,c.T)(),{createClient:r,client:a,stopClient:s}=function(){let{getAuthOptions:e}=function(){let{getIdToken:e,getCredentials:n}=o.useContext(D.e),t=(0,c.C)(e=>e.account.loginState),i=o.useCallback(async()=>{switch(t){case f.zZ.CreatingApolloClientPrivate:case f.zZ.LoggedIn:{let n=await e();return{type:"AMAZON_COGNITO_USER_POOLS",jwtToken:n}}case f.zZ.CreatingApolloClientPublic:case f.zZ.LoggedOut:{let e=await n();return{type:"AWS_IAM",credentials:e}}default:throw d.ZP.error("getAuthOptions(): Invalid login state: ".concat(t)),"getAuthOptions(): Invalid login state (".concat(t,")")}},[e,n,t]);return{getAuthOptions:i}}(),n=(0,c.C)(e=>e.account.loginState),[t,i]=o.useState(void 0),r=o.useCallback(async()=>{d.ZP.log("createClient(): Called"),await (0,x.zE)({cache:C,storage:I});let t=new h.f({cache:C,typeDefs:j,connectToDevTools:!1,resolvers:{Query:{getIGDBGames:igdbGames_getIGDBGames,getIGDBGame:getIGDBGame,searchIGDBGames:igdbGames_searchIGDBGames,getWebsiteInfo:getWebsiteInfo,getWebsiteInfos:getWebsiteInfos,getOverwolfGameStatuses:getOverwolfGameStatuses,getOverwolfGameStatus:getOverwolfGameStatus,searchPublicProfiles:searchPublicProfiles}}});if(n===f.zZ.CreatingApolloClientPrivate||n===f.zZ.CreatingApolloClientPublic){let n=await e(),i=new y.u({uri:B}),o=(0,O.q)(r=>{let{graphQLErrors:a,networkError:s,operation:l,forward:c}=r;if(a){for(let r of a)if(d.ZP.error("createClient.errorLink.onError.graphQLErrors(): ".concat(JSON.stringify(r))),"UnauthorizedException"===r.errorType){d.ZP.log("createClient.errorLink.onError.graphQLErrors(): Refreshing authorisation token");let a=(0,v.createSubscriptionHandshakeLink)({url:B,region:F,auth:n},i);a.setOnError(e=>{let{graphQLErrors:n,networkError:t,operation:i,forward:o}=e;if(n)for(let e of n)d.ZP.log("createClient.subscriptionHandshakeLink.setOnError(): graphQLError: ".concat(JSON.stringify(e)));t&&d.ZP.log("createClient.subscriptionHandshakeLink.setOnError(): networkError: ".concat(JSON.stringify(r)))}),e().then(e=>{let n=b.i.from([o,(0,p.createAuthLink)({url:B,region:F,auth:e}),a]);return t.setLink(n),c(l)})}}s&&d.ZP.log("createClient.errorLink.onError.networkError(): Not processed here (".concat(JSON.stringify(s),")"))}),r=new _.W({attempts:(e,n,t)=>{var i;if(d.ZP.log("client.retryLink.attempts(): count: ".concat(e,", operation: ").concat(JSON.stringify(null==n?void 0:n.operationName),", error: ").concat(JSON.stringify(t))),"messageSubscription"===n.operationName||"messageSubscriptionV2"===n.operationName)return d.ZP.log("client.retryLink.attempts(): Not retrying 'messageSubscription'"),!1;if(null==t?void 0:null===(i=t.errors)||void 0===i?void 0:i.find(e=>"Connection closed"===e.message))return d.ZP.log("client.retryLink.attempts(): Not retrying as connection is closed"),!1;let o=globalThis.skelly.reduxStore.getState().internetConnection.isOnline;if(!o)return d.ZP.log("client.retryLink.attempts(): Not retrying, there is no internet connection"),!1;let r=globalThis.skelly.reduxStore.getState().internetConnection.apolloError;return r?(d.ZP.log("client.retryLink.attempts(): Not retrying, there was previously an error (".concat(r,")")),!1):!(e>3)||(d.ZP.log("client.retryLink.attempts(): Giving up after 3 times"),globalThis.skelly.reduxStore.dispatch((0,T.iC)("RetryLinkFailed")),!1)},delay:(e,n,t)=>(d.ZP.log("client.retryLink.delay(): count: ".concat(e,", operation: ").concat(n.operationName,", error: ").concat(JSON.stringify(t))),1===e?1e3:2===e?3e3:6e3)}),a=(0,v.createSubscriptionHandshakeLink)({url:B,region:F,auth:n},i);a.setOnError(e=>{let{graphQLErrors:n,networkError:t,operation:i,forward:o}=e;if(n)for(let e of n)d.ZP.log("createClient.subscriptionHandshakeLink.setOnError.graphQLErrors(): ".concat(JSON.stringify(e)));t&&d.ZP.log("createClient.subscriptionHandshakeLink.networkError((): ".concat(JSON.stringify(t)))});let s=b.i.from([r,o,(0,p.createAuthLink)({url:B,region:F,auth:n}),a]);t.setLink(s)}let o=C.extract();return d.ZP.log("ApolloWrapper.createClient(): Pre-cache: ",o),evictUserProfile(C),C&&(C.evict({id:"ROOT_QUERY",fieldName:"getProfiles",broadcast:!0}),C.evict({id:"ROOT_QUERY",fieldName:"getProfile",broadcast:!0}),C.evict({id:"ROOT_QUERY",fieldName:"getFriendId",broadcast:!0}),C.evict({id:"ROOT_QUERY",fieldName:"searchPublicProfiles",broadcast:!0}),C.gc()),C&&(C.evict({id:"ROOT_QUERY",fieldName:"getFeedbacks",broadcast:!0}),C.evict({id:"ROOT_QUERY",fieldName:"getTextFeedbacks",broadcast:!0}),C.gc()),C&&(C.evict({id:"ROOT_QUERY",fieldName:"getOverwolfGameStatuses",broadcast:!0}),C.gc()),evictGroups(C),evictUserActivties(C),d.ZP.log("createClient(): Initialization completed"),globalThis.skelly.apolloClient=t,i(t),t},[e,n]);return{createClient:r,client:t,stopClient:()=>{null==t||t.stop(),i(void 0)}}}(),{removeFCMToken:l}={removeFCMToken:function(){}},{removePushKitToken:u}={removePushKitToken:function(){}},{clientDispatch:g}={clientDispatch:()=>{}},k=(0,c.C)(e=>e.account.loginState);return(o.useEffect(()=>(d.ZP.log("ApolloWrapper(): Mounted"),()=>{d.ZP.log("ApolloWrapper(): Unmounted (client: ".concat(!!a,")"))}),[]),o.useEffect(()=>{switch(d.ZP.log("ApolloWrapper(): loginState is ".concat(k)),k){case f.zZ.CreatingApolloClientPrivate:d.ZP.log("ApolloWrapper(): Creating private apollo client"),r().then(()=>{d.ZP.log("ApolloWrapper(): Private apollo client created")}).catch(e=>{d.ZP.error("ApolloWrapper(): Creating private client failed: ".concat(e)),console.error(e),(0,W.f)("event","skelly_error",{skelly_event_source:"Apollo",skelly_event_action:k,skelly_event_label:e.toString()}),t((0,f.av)(f.zZ.LoggedOut))});break;case f.zZ.CreatingApolloClientPublic:d.ZP.log("ApolloWrapper(): Creating public apollo client"),r().then(()=>{d.ZP.log("ApolloWrapper(): Public apollo client created")}).catch(e=>{d.ZP.error("ApolloWrapper(): Creating public client failed: ".concat(e)),console.error(e),(0,W.f)("event","skelly_error",{skelly_event_source:"Apollo",skelly_event_action:k,skelly_event_label:e.toString()}),t((0,f.av)(f.zZ.LoggedOut))});break;case f.zZ.CreatingApolloClientLocal:d.ZP.log("ApolloWrapper(): Creating local apollo client"),r().then(()=>{d.ZP.log("ApolloWrapper(): Local apollo client created")}).catch(e=>{d.ZP.error("ApolloWrapper(): Creating local client failed: ".concat(e)),console.error(e),(0,W.f)("event","skelly_error",{skelly_event_source:"Apollo",skelly_event_action:k,skelly_event_label:e.toString()}),t((0,f.av)(f.zZ.LoggedOut))});break;case f.zZ.ClosingApolloClientPublicLocal:d.ZP.log("ApolloWrapper(): Closing public/local apollo client"),"web"===E.N&&d.ZP.error("ApolloWrapper(): Unexpected login state 'ClosingApolloClientPublicLocal'"),s(),t((0,f.Dj)(void 0)),t((0,f.av)(f.zZ.CreatingApolloClientPrivate));break;case f.zZ.ClosingApolloClientPrivate:{let closingApolloClientPrivate=async()=>{var e,n,i,o,r;d.ZP.log("ApolloWrapper(): Closing private apollo client"),await l(),await u(),d.ZP.log("ApolloWrapper(): Evicting apollo cache"),await new Promise(e=>setTimeout(e,1e3)),evictUserProfile(null==a?void 0:a.cache),evictUserActivties(null==a?void 0:a.cache),(e=null==a?void 0:a.cache)&&(e.evict({id:"ROOT_QUERY",fieldName:"getMessages",broadcast:!1}),e.evict({id:"ROOT_QUERY",fieldName:"getMessagesSeen",broadcast:!1}),e.gc()),evictGroups(null==a?void 0:a.cache),(n=null==a?void 0:a.cache)&&(n.evict({id:"ROOT_QUERY",fieldName:"getIGDBGames",broadcast:!1}),n.evict({id:"ROOT_QUERY",fieldName:"getIGDBGame",broadcast:!1}),n.evict({id:"ROOT_QUERY",fieldName:"searchIGDBGames",broadcast:!1}),n.gc()),(i=null==a?void 0:a.cache)&&(i.evict({id:"ROOT_QUERY",fieldName:"getFCMTokens",broadcast:!1}),i.gc()),(o=null==a?void 0:a.cache)&&(o.evict({id:"ROOT_QUERY",fieldName:"getWebsiteInfos",broadcast:!1}),o.gc()),(r=null==a?void 0:a.cache)&&(r.evict({id:"ROOT_SUBSCRIPTION",fieldName:"invite",broadcast:!1}),r.evict({id:"ROOT_SUBSCRIPTION",fieldName:"message",broadcast:!1}),r.evict({id:"ROOT_SUBSCRIPTION",fieldName:"realTime",broadcast:!1}),r.gc()),await new Promise(e=>setTimeout(e,1e3)),d.ZP.log("ApolloWrapper(): Stopping apollo client"),s(),t((0,f.ni)()),(0,N.f)()?t((0,f.av)(f.zZ.CreatingApolloClientPublic)):t((0,f.av)(f.zZ.CreatingApolloClientLocal))};closingApolloClientPrivate();break}default:d.ZP.log("ApolloWrapper(): loginState ".concat(k," not processed"))}},[k]),o.useRef(!1),o.useEffect(()=>{d.ZP.log("ApolloWrapper(): Client changed (current state: ".concat(k,"; client active: ").concat(!!a,")")),g(),a&&(d.ZP.log("ApolloWrapper(): Client was set, migrating state"),(0,W.f)("event","skelly_apollo_created",{skelly_event_action:k}),k===f.zZ.CreatingApolloClientPrivate?t((0,f.av)(f.zZ.LoggedIn)):t((0,f.av)(f.zZ.LoggedOut)))},[a]),a)?(0,i.jsx)(m.e,{client:a,children:n}):n},z=t(54799),U=t(9008),$=t.n(U);function Head(e){let{title:n,description:t,metaName:o,metaProperty:r,canonical:a}=e;return o=o||{},t&&(o.description=t),r=r||{},(0,i.jsxs)($(),{children:[n?(0,i.jsx)("title",{children:n}):null,Object.entries(o).map(e=>{let[n,t]=e;return(0,i.jsx)("meta",{name:n,content:t},n)}),Object.entries(r).map(e=>{let[n,t]=e;return(0,i.jsx)("meta",{property:n,content:t},n)}),a?(0,i.jsx)("link",{rel:"canonical",href:a}):null]})}var Q=t(98396);function InitMode(e){let{children:n}=e,t=(0,c.C)(e=>e.settings.mode),i=(0,c.T)(),o=(0,Q.Z)("(prefers-color-scheme: dark)");if(void 0===t){let e=!0===o?"dark":"light";return d.ZP.log("Layout(): Setting mode to '".concat(e,"'")),i((0,u.PM)(e)),null}return n}var q=t(2734),K=t(44012),J=t(22571),H=t(99078),V=t(46646),Y=t(21023),X=t(21455),ee=t(64553);function ModeButton(e){let n=(0,c.T)(),t=(0,c.C)(e=>e.settings.mode),o=(0,c.C)(e=>e.account.username);return(0,i.jsx)("div",{style:e.style,children:(0,i.jsx)(Y.Z,{title:"light"===t?(0,i.jsx)(K.Z,{id:"SwitchDark"}):(0,i.jsx)(K.Z,{id:"SwitchLight"}),arrow:!0,children:"light"===t?(0,i.jsx)(J.Z,{onClick:()=>{n((0,u.PM)("dark")),o&&(0,ee.c$)(X.Gk.dark)},children:(0,i.jsx)(H.Z,{})}):(0,i.jsx)(J.Z,{onClick:()=>{n((0,u.PM)("light")),o&&(0,ee.c$)(X.Gk.light)},children:(0,i.jsx)(V.Z,{})})})})}var en=t(11163),et=t(26447),ei=t(69397),eo=t(75316),er=t(26989),ea=t(93862),es=t(39485),el=t(32701),ec=t(84818),eu=t(2684),ed=t(85216),eg=t(15398),em=t(73079),ef=t(94229),ep=t(46396),ev=t(13540),eh=t(68378),ey=t(89349),eb=t(42761),e_=t(81261),ex=t(77858);let ek=[{value:"search",icon:(0,i.jsx)(eb.Z,{}),label:(0,i.jsx)(K.Z,{id:"Search"}),route:"/search",loggedIn:!1,isActive:e=>e.startsWith("/search")},{value:"auth",icon:(0,i.jsx)(es.Z,{}),label:(0,i.jsx)(K.Z,{id:"Login"}),route:"/auth/".concat(ea.D.LogIn),loggedIn:!1,isActive:e=>e.startsWith("/auth")},{value:"gaming",icon:(0,i.jsx)(ec.Z,{}),iconActive:(0,i.jsx)(el.Z,{}),label:(0,i.jsx)(K.Z,{id:"Gaming"}),route:"/gaming",loggedIn:!0,isActive:e=>"/gaming"===e},{value:"network",icon:(0,i.jsx)(ed.Z,{}),iconActive:(0,i.jsx)(eu.Z,{}),label:(0,i.jsx)(K.Z,{id:"Network"}),route:"/network",loggedIn:!0,isActive:e=>"/network"===e},{value:"profile",icon:(0,i.jsx)(em.Z,{}),iconActive:(0,i.jsx)(eg.Z,{}),label:(0,i.jsx)(K.Z,{id:"Profile"}),route:"/profile",loggedIn:!0,isActive:e=>"/profile"===e},{value:"developer",icon:(0,i.jsx)(ey.Z,{}),iconActive:(0,i.jsx)(eh.Z,{}),label:(0,i.jsx)(K.Z,{id:"Developer"}),route:"/developer",loggedIn:!0,developer:!0,isActive:e=>"/developer"===e},{value:"server",icon:(0,i.jsx)(ex.Z,{}),iconActive:(0,i.jsx)(e_.Z,{}),label:(0,i.jsx)(K.Z,{id:"Server"}),route:"/server",loggedIn:!0,developer:!0,isActive:e=>"/server"===e},{value:"settings",icon:(0,i.jsx)(ep.Z,{}),iconActive:(0,i.jsx)(ef.Z,{}),label:(0,i.jsx)(K.Z,{id:"Settings"}),route:"/settings",loggedIn:!0,isActive:e=>"/settings"===e},{value:"logout",icon:(0,i.jsx)(ev.Z,{}),label:(0,i.jsx)(K.Z,{id:"Logout"}),route:"/",shallRoute:()=>!1,loggedIn:!0,isActive:()=>!1}];function TabsMenu(e){let n,{setDrawerOpen:t}=e;(0,r.I0)();let a=(0,en.useRouter)(),s=(0,c.C)(e=>e.account.username),l=(0,c.C)(e=>e.account.isDeveloper);n=window.location.pathname;let u=ek.filter(e=>e.developer?l:void 0===e.loggedIn||e.loggedIn===(void 0!==s)),g=u.find(e=>e.isActive(n)),{logOut:m}=o.useContext(D.e);return(0,i.jsx)(er.Z,{value:void 0!==g&&g.value,onChange:async(e,n)=>{d.ZP.log("TabsMenu(): onChange value ".concat(n));try{var t;let e=ek.find(e=>e.value===n);if("logout"===e.value)m();else if((null===(t=e.shallRoute)||void 0===t?void 0:t.call(e))===!1)d.ZP.log("TabsMenu(): Not routing page");else{let n=await a.push(e.route);d.ZP.log("TabsMenu(): Navigation result is '".concat(n,"'"))}}catch(e){d.ZP.log("TabsMenu(): Navigation failed"),console.error(e)}},"aria-label":"icon label tabs example",children:u.map(e=>(0,i.jsx)(eo.Z,{icon:e===g&&e.iconActive?e.iconActive:e.icon,label:e.label,value:e.value},e.value))})}var eZ=t(326),ej=t(19058),eS=t(23972);function DrawerMenu(e){let{setDrawerOpen:n}=e,t=(0,c.C)(e=>e.account.username),r=(0,c.C)(e=>e.account.isDeveloper),a=ek.filter(e=>e.developer?r:void 0===e.loggedIn||e.loggedIn===(void 0!==t)),s=(0,en.useRouter)(),l=(0,c.C)(e=>e.settings.mode),g=(0,c.T)(),{logOut:m}=o.useContext(D.e);return(0,i.jsxs)(et.Z,{direction:"column",children:[a.map(e=>(0,i.jsx)(ei.Z,{onClick:async()=>{try{var t;if("logout"===e.value)m();else if((null===(t=e.shallRoute)||void 0===t?void 0:t.call(e))===!1)d.ZP.log("Header(): Not routing page");else{let n=await s.push(e.route);d.ZP.log("Header(): Navigation result is '".concat(n,"'"))}}catch(e){d.ZP.log("Header(): Navigation failed")}n(!1)},children:(0,i.jsxs)(et.Z,{direction:"row",gap:"0.5rem",style:{marginRight:"auto"},children:[e.icon,(0,i.jsx)(eS.Z,{variant:"body1",children:e.label})]})},e.value)),(0,i.jsx)(ei.Z,{onClick:()=>{n(!1),g((0,u.PM)("light"===l?"dark":"light")),t&&(0,ee.c$)("light"===l?X.Gk.dark:X.Gk.light)},children:(0,i.jsx)(et.Z,{direction:"row",gap:"0.5rem",style:{marginRight:"auto"},children:"light"===l?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(H.Z,{}),(0,i.jsx)(eS.Z,{variant:"body1",children:(0,i.jsx)(K.Z,{id:"DarkMode"})})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(V.Z,{}),(0,i.jsx)(eS.Z,{variant:"body1",children:(0,i.jsx)(K.Z,{id:"LightMode"})})]})})})]})}var eP=t(57629);function Header(e){let{withBorder:n}=e,t=(0,Q.Z)("(min-width:800px)"),r=(0,en.useRouter)(),a=(0,q.Z)(),[s,l]=o.useState(!1);return(0,i.jsx)("div",{style:{display:"flex",flexDirection:"row",width:"100%",borderStyle:!0===n?"none none solid none":void 0,borderWidth:"thin",borderColor:a.palette.background.outline},children:(0,i.jsxs)(et.Z,{direction:"row",style:{width:"100%",maxWidth:1200,marginLeft:"auto",marginRight:"auto",paddingTop:"0.5rem",paddingBottom:"0.5rem",alignItems:"center",boxSizing:"border-box"},children:[(0,i.jsx)(ei.Z,{onClick:()=>{r.push("/")},style:{marginLeft:"0.5rem",marginRight:"auto"},children:(0,i.jsx)(eP.Z,{style:{height:"2rem",marginRight:"0.7rem"}})}),t?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(TabsMenu,{setDrawerOpen:l}),(0,i.jsx)(ModeButton,{style:{marginRight:"0.5rem",marginLeft:"auto"}})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eZ.Z,{style:{marginRight:"0.5rem",marginLeft:"auto"},onClick:()=>{!1===s&&l(!0)}}),(0,i.jsx)(ej.ZP,{anchor:"left",open:s,onClose:()=>{!0===s&&l(!1)},style:{userSelect:"none"},children:(0,i.jsx)(DrawerMenu,{setDrawerOpen:l})})]})]})})}var eI=t(67720),ew=t(57709),eC=t(63931),eO=t(53640),eA=t(69587);let eR=[{name:"Deutsch",flag:"/img/languages/flagGermany.webp",locale:"de-DE"},{name:"English",flag:"/img/languages/flagUS.png",locale:"en-US"},{name:"Espa\xf1ol",flag:"/img/languages/flagSpain.gif",locale:"es-ES"},{name:"Fran\xe7ais",flag:"/img/languages/flagFrance.gif",locale:"fr-FR"},{name:"Italiano",flag:"/img/languages/flagItaly.gif",locale:"it-IT"},{name:"日本語",flag:"/img/languages/flagJapan.gif",locale:"ja-JP"},{name:"한국어",flag:"/img/languages/flagKorea.gif",locale:"ko-KR"},{name:"Portugu\xeas do Brasil",flag:"/img/languages/flagBrazil.gif",locale:"pt-BR"},{name:"русский",flag:"/img/languages/flagRU.gif",locale:"ru-RU"},{name:"Svenska",flag:"/img/languages/flagSweden.gif",locale:"sv-SE"},{name:"Українська",flag:"/img/languages/flagUkraine.gif",locale:"uk-UA"},{name:"中文",flag:"/img/languages/flagChina.gif",locale:"zh-CN"}];function Languages(){let e=(0,c.C)(e=>e.account.username),n=(0,c.C)(e=>e.settings.locale),t=(0,c.T)();return(0,i.jsx)(eO.Z,{sx:{width:"calc(100vw - 2rem)",maxWidth:"14rem"},children:(0,i.jsx)(eA.Z,{value:eR.findIndex(e=>e.locale===n),onChange:n=>{let i=n.target.value,o=eR[i].locale;t((0,u.i_)(o)),e&&(0,ee.gK)({language:o})},color:"primary",input:(0,i.jsx)(ew.Z,{}),children:eR.map((e,n)=>(0,i.jsx)(eC.Z,{value:n,children:(0,i.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"},children:[(0,i.jsx)("img",{src:e.flag,style:{width:"2rem"}}),(0,i.jsx)(eS.Z,{variant:"body1",style:{marginLeft:"1rem"},children:e.name})]})},e.locale))})})}var eG=t(36815),eL=t(2373),icons_XIcon=function(e){return(0,i.jsx)(eL.Z,{...e,children:(0,i.jsx)("svg",{width:"200",height:"200",viewBox:"-213 -200 1614 1627",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"})})})},eM=t(50891);function SocialMedia(){let e=(0,q.Z)();return(0,i.jsxs)(et.Z,{direction:"row",gap:"0.2rem",children:[(0,i.jsx)(J.Z,{type:"button",sx:{p:"10px"},"aria-label":"search",onClick:()=>{window.open("https://discord.com/invite/TfCRZrQh2K","_blank")},children:(0,i.jsx)(eG.Z,{})}),(0,i.jsx)(J.Z,{type:"button",sx:{p:"10px"},"aria-label":"search",onClick:()=>{window.open("https://twitter.com/SkellyApp","_blank")},children:(0,i.jsx)(icons_XIcon,{style:{fill:e.palette.surfaceVariant.contrastText}})}),(0,i.jsx)(J.Z,{type:"button",sx:{p:"10px"},"aria-label":"search",onClick:()=>{window.open("mailto:info@skelly.gg","_blank")},children:(0,i.jsx)(eM.Z,{})})]})}var eT=t(21830);function Product(){let e=(0,en.useRouter)();return(0,i.jsxs)(et.Z,{direction:"column",children:[(0,i.jsx)(eS.Z,{variant:"h6",children:(0,i.jsx)(K.Z,{id:"Product"})}),(0,i.jsx)(eT.Z,{messageId:"Pricing",onClick:()=>{e.push("/pricing")}}),(0,i.jsx)(eT.Z,{messageId:"Integration",onClick:()=>{e.push("/integration")}}),(0,i.jsx)(eT.Z,{messageId:"Support",onClick:()=>{e.push("/support")}})]})}function Policies(){let e=(0,en.useRouter)();return(0,i.jsxs)(et.Z,{direction:"column",children:[(0,i.jsx)(eS.Z,{variant:"h6",children:(0,i.jsx)(K.Z,{id:"Policies"})}),(0,i.jsx)(eT.Z,{messageId:"Terms",onClick:()=>{e.push("/terms")}}),(0,i.jsx)(eT.Z,{messageId:"Privacy",onClick:()=>{e.push("/privacy")}})]})}function Company(){let e=(0,en.useRouter)();return(0,i.jsxs)(et.Z,{direction:"column",children:[(0,i.jsx)(eS.Z,{variant:"h6",children:(0,i.jsx)(K.Z,{id:"Company"})}),(0,i.jsx)(eT.Z,{messageId:"About",onClick:()=>{e.push("/about")}})]})}var eD=t(6831);function Download(){return(0,i.jsxs)(et.Z,{direction:"column",children:[(0,i.jsx)(eS.Z,{variant:"h6",children:(0,i.jsx)(K.Z,{id:"Download"})}),(0,i.jsx)(eT.Z,{messageId:"Windows",reactIntl:!1,onClick:()=>{(0,eD._)("Overwolf","https://www.overwolf.com/app/Skelly"),window.open("https://www.overwolf.com/app/Skelly","_blank")}}),(0,i.jsx)(eT.Z,{messageId:"Android",reactIntl:!1,onClick:()=>{(0,eD._)("GooglePlay","https://play.google.com/store/apps/details?id=gg.skelly"),window.open("https://play.google.com/store/apps/details?id=gg.skelly","_blank")}}),(0,i.jsx)(eT.Z,{messageId:"iOS",reactIntl:!1,onClick:()=>{(0,eD._)("AppleAppStore","https://play.google.com/store/apps/details?id=gg.skelly"),window.open("https://apps.apple.com/app/skelly-gg/id6443595946","_blank")}})]})}function Footer(){let e=(0,q.Z)();return(0,i.jsx)("div",{style:{width:"100%",marginTop:"auto",backgroundColor:e.palette.surfaceVariant.default,color:e.palette.surfaceVariant.contrastText,zIndex:100},children:(0,i.jsxs)(et.Z,{direction:"column",gap:"1rem",style:{maxWidth:1200,marginLeft:"auto",marginRight:"auto",padding:"1rem"},children:[(0,i.jsxs)(et.Z,{direction:"row",gap:"1rem",style:{flexWrap:"wrap",boxSizing:"border-box"},children:[(0,i.jsxs)(et.Z,{direction:"column",gap:"0.5rem",style:{marginRight:"auto"},children:[(0,i.jsx)(eS.Z,{variant:"h6",children:(0,i.jsx)(K.Z,{id:"Language"})}),(0,i.jsx)(Languages,{})]}),(0,i.jsxs)(et.Z,{direction:"row",gap:"3rem",style:{flexWrap:"wrap"},children:[(0,i.jsx)(Download,{}),(0,i.jsx)(Product,{}),(0,i.jsx)(Company,{}),(0,i.jsx)(Policies,{})]})]}),(0,i.jsx)(eI.Z,{}),(0,i.jsxs)(et.Z,{direction:"row",flexWrap:"wrap",justifyContent:"space-between",alignItems:"center",style:{marginTop:"-0.9rem"},children:[(0,i.jsxs)(eS.Z,{variant:"body1",children:["\xa9 ",new Date().getFullYear()," Skelly."," ",(0,i.jsx)(K.Z,{id:"AllRightsReserved"})]}),(0,i.jsx)(SocialMedia,{})]})]})})}let ErrorBoundary=class ErrorBoundary extends o.Component{static getDerivedStateFromError(e){return d.cM("ErrorBoundry.getDerivedStateFromError(): Called (error: ".concat(e,")")),{error:e}}componentDidCatch(e,n){let t;d.cM("ErrorBoundry.componentDidCatch(): Called (error: ".concat(e,", errorInfo: ").concat(n,")")),console.log("Potential length issues: "),console.log(n),console.log(e);try{t=window.location.pathname.split("/")[2]}catch(e){d.vU("ErrorBoundry(): ".concat(JSON.stringify(e)))}(0,W.f)("event","skelly_error",{skelly_event_action:"ErrorBoundry",skelly_event_window:t,skelly_event_label:n,skelly_event_source:e})}render(){return this.state.error?(d.cM("ErrorBoundry.render(): this.state.error: ".concat(this.state.error)),(0,i.jsx)(Message,{error:this.state.error,onClose:()=>{this.setState({error:void 0})}})):this.props.children}constructor(e){super(e),this.state={error:void 0}}};let Message=e=>{let{error:n,onClose:t}=e,o=(0,q.Z)();return(0,i.jsx)("div",{style:{flexGrow:1,backgroundColor:o.palette.background.default},children:(0,i.jsxs)(et.Z,{direction:"column",style:{padding:"1rem",paddingTop:"3rem",maxWidth:400,marginRight:"auto",marginLeft:"auto",alignItems:"center"},gap:"1rem",children:[(0,i.jsx)(eS.Z,{variant:"subtitle1",children:"SOMETHING WENT WRONG"}),(0,i.jsx)(eS.Z,{variant:"body1",children:"We are very sorry for the inconvenience."}),(0,i.jsxs)(eS.Z,{variant:"body1",style:{wordBreak:"break-word"},children:["(",n.toString(),")"]}),(0,i.jsx)(ei.Z,{color:"primary",variant:"contained",onClick:()=>{t()},style:{marginTop:"1rem"},children:"Go back"})]})})};var eE=t(1409);function SettingsManager(){(0,eE.L)({query:ee.Cn,onSubscribed:()=>{d.ZP.log("SettingsManager.onSubscribed(): Fetching settings"),fetchSettings()},onNext:e=>{d.ZP.log("SettingsManager.onNext(): Data received: ",e),d.ZP.log("SettingsManager.onNext(): Refetching settings"),fetchSettings()},onError:e=>{d.ZP.error("SettingsManager.onError(): ".concat(JSON.stringify(e)))}});let fetchSettings=()=>{let e=globalThis.skelly.apolloClient;null==e||e.query({query:ee._c,fetchPolicy:"network-only"}).then(e=>{let n=null==e?void 0:e.data.getMySettings;d.ZP.log("SettingsManager(): Fetched settings: ".concat(JSON.stringify(n)));let t=globalThis.skelly.reduxStore.dispatch,i=globalThis.skelly.reduxStore.getState(),o=i.settings.mode,r=i.settings.locale;if(!n){d.ZP.log("SettingsManager(): Returning as settings was undefined");return}let a="overwolf"===E.N?"desktop_mode":"web"===E.N?"web_mode":"mobile_mode",s=null==n?void 0:n[a];d.ZP.log("SettingsManager(): mode: ".concat(o,", serverMode: ").concat(s)),s&&s!==o&&(d.ZP.log("SettingsManager(): Updating mode"),t((0,u.PM)(s)));let l=null==n?void 0:n.language;d.ZP.log("SettingsManager(): locale: ".concat(r,", serverLanguage: ").concat(l)),l&&l!==r&&(d.ZP.log("SettingsManager(): Updating language"),t((0,u.i_)(l)))}).catch(e=>{d.ZP.error("SettingsManager(): Could not fetch settings (".concat(JSON.stringify(e),")"))})};return null}var eF=t(34556),eB=t(30898),eN=t(8525);function ProcessInviteCode(){let{addSnackbar:e}=o.useContext(z.J),{accept:n,acceptLoading:t,acceptData:i,acceptError:r}=(0,eN.cm)();return o.useEffect(()=>{let t=(0,eB.e)();d.ZP.log("ProcessInviteCode(): ".concat(t?"Processing invite code "+t:"No code to be processed")),t&&(e("ProcessingInvitation",!0),n(t).then(()=>{e("InvitationSuccessfullyAccepted",!0)}).catch(n=>{d.ZP.warn("Invite(): Accepting invite failed (".concat(JSON.stringify(n.message),")")),"CodeNotFound"===n.message?e("InvitationNotLongerValid",!0):"UsersAlreadyConnected"===n.message?e("YouAlreadyConnected",!0):e(n.toString())}))},[]),null}function Core(e){let{children:n}=e,t=(0,c.C)(e=>e.account.loginState);switch(t){case f.zZ.Initializing:return(0,i.jsx)(eF.Z,{size:"8rem",messageId:"InitializingApp..."});case f.zZ.CreatingApolloClientPrivate:return(0,i.jsx)(eF.Z,{size:"8rem",messageId:"LoggingIn..."});case f.zZ.LoggedIn:return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(SettingsManager,{}),(0,i.jsx)(ProcessInviteCode,{}),n]});case f.zZ.ClosingApolloClientPrivate:return(0,i.jsx)(eF.Z,{size:"8rem",messageId:"LoggingOut..."});case f.zZ.CreatingApolloClientPublic:case f.zZ.CreatingApolloClientLocal:return(0,i.jsx)(eF.Z,{size:"8rem"});case f.zZ.LoggedOut:return n;default:return(0,i.jsx)(eF.Z,{size:"8rem",messageId:"Internal Error"})}}function Content(e){let{withHeaderBorder:n,context:t,floater:r,children:a}=e,s=(0,q.Z)(),l=(0,c.C)(e=>e.account.friendId);o.useEffect(()=>(l?d.ZP.log("Content(): Mounted (user is logged in)"):d.ZP.log("Content(): Mounted (User is not logged in)"),window.addEventListener("print",()=>console.log("PRINT CALLED!!!!")),()=>d.ZP.log("Content(): Unmounted")),[]);let u=(0,i.jsxs)("div",{style:{display:"flex",flexDirection:"column",marginLeft:"auto",marginRight:"auto",width:"100vw",height:"100vh",position:"absolute",top:0,left:0,userSelect:"none",color:s.palette.background.contrastText},children:[(0,i.jsx)(Header,{withBorder:n}),(0,i.jsx)("div",{style:{position:"relative",width:"100%",flexGrow:1,overflowY:"hidden"},className:"scrollable-printable",children:(0,i.jsxs)("div",{style:{width:"100%",height:"100%",overflowY:"auto",overflowX:"hidden",display:"flex",flexDirection:"column"},children:[(0,i.jsx)(ErrorBoundary,{children:(0,i.jsx)(Core,{children:t?(0,i.jsxs)(t,{children:[a,void 0===r?null:r]}):(0,i.jsxs)(i.Fragment,{children:[a,void 0===r?null:r]})})}),(0,i.jsx)(Footer,{})]})})]});return u}function Layout(e){let{title:n,description:t,metaName:o,metaProperty:s,canonical:l,withHeaderBorder:c,context:u,floater:d,children:m}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Head,{title:n,description:t,metaName:o,metaProperty:s,canonical:l}),(0,i.jsx)(r.zt,{store:globalThis.skelly.reduxStore,children:(0,i.jsxs)(a.r,{loading:null,persistor:globalThis.skelly.persistor,children:[(0,i.jsx)(PageTransition,{}),(0,i.jsx)(InitMode,{children:(0,i.jsx)(SkellyIntlProvider,{children:(0,i.jsx)(g.Z,{children:(0,i.jsx)(z.Z,{children:(0,i.jsx)(D.Z,{shallow:!1,children:(0,i.jsx)(wrapper_ApolloWrapper,{children:(0,i.jsx)(Content,{withHeaderBorder:c,context:u,floater:d,children:m})})})})})})})]})})]})}let PageTransition=()=>{let e=(0,c.T)();return o.useEffect(()=>()=>{d.ZP.log("PageTransition(): Unmounting, resetting login state"),e((0,f.av)(f.zZ.Initializing))},[]),null}},21830:function(e,n,t){t.d(n,{Z:function(){return FooterLink}});var i=t(85893);t(67294);var o=t(23972),r=t(44012);function FooterLink(e){let{messageId:n,onClick:t,reactIntl:a=!0}=e;return(0,i.jsx)(o.Z,{variant:"body1",onClick:t,sx:{cursor:"pointer","&:hover":{textDecoration:"underline"}},children:a?(0,i.jsx)(r.Z,{id:n}):n})}},37171:function(e,n,t){t.d(n,{Z:function(){return ALinkButton}});var i=t(85893);t(67294);var o=t(44012),r=t(23972),a=t(2734);function ALinkButton(e){let n=(0,a.Z)();return(0,i.jsx)("span",{style:{...e.style},onClick:n=>{n.stopPropagation(),e.onClick&&e.onClick()},children:(0,i.jsx)(r.Z,{variant:"link",component:"span",style:{color:n.palette.primary.main},children:e.messageId?(0,i.jsx)(o.Z,{id:e.messageId}):e.message})})}},60718:function(e,n,t){t.d(n,{Z:function(){return SkellyAlert}});var i=t(85893);t(67294);var o=t(1691),r=t(44012),a=t(23972);function SkellyAlert(e){let{message:n,style:t}=e;return void 0!==n?(0,i.jsx)("div",{style:t,children:(0,i.jsx)(o.Z,{variant:"filled",severity:n.type||"success",style:{maxWidth:"16rem",marginLeft:"auto",marginRight:"auto",boxSizing:"border-box"},children:(0,i.jsx)(a.Z,{variant:"body1",children:!0===n.reactIntl?(0,i.jsx)(r.Z,{id:n.text}):n.text})})}):null}},36815:function(e,n,t){var i=t(85893);t(67294);var o=t(2373);n.Z=function(e){return(0,i.jsx)(o.Z,{...e,viewBox:"-5 -5 137.14 106.36",children:(0,i.jsx)("g",{id:"图层_2","data-name":"图层 2",children:(0,i.jsx)("g",{id:"Discord_Logos","data-name":"Discord Logos",children:(0,i.jsx)("g",{id:"Discord_Logo_-_Large_-_White","data-name":"Discord Logo - Large - White",children:(0,i.jsx)("path",{d:"M107.7,8.07A105.15,105.15,0,0,0,81.47,0a72.06,72.06,0,0,0-3.36,6.83A97.68,97.68,0,0,0,49,6.83,72.37,72.37,0,0,0,45.64,0,105.89,105.89,0,0,0,19.39,8.09C2.79,32.65-1.71,56.6.54,80.21h0A105.73,105.73,0,0,0,32.71,96.36,77.7,77.7,0,0,0,39.6,85.25a68.42,68.42,0,0,1-10.85-5.18c.91-.66,1.8-1.34,2.66-2a75.57,75.57,0,0,0,64.32,0c.87.71,1.76,1.39,2.66,2a68.68,68.68,0,0,1-10.87,5.19,77,77,0,0,0,6.89,11.1A105.25,105.25,0,0,0,126.6,80.22h0C129.24,52.84,122.09,29.11,107.7,8.07ZM42.45,65.69C36.18,65.69,31,60,31,53s5-12.74,11.43-12.74S54,46,53.89,53,48.84,65.69,42.45,65.69Zm42.24,0C78.41,65.69,73.25,60,73.25,53s5-12.74,11.44-12.74S96.23,46,96.12,53,91.08,65.69,84.69,65.69Z"})})})})})}},57629:function(e,n,t){t.d(n,{Z:function(){return SkellyLogo}});var i=t(85893);t(67294);var o=t(9103);function SkellyLogo(e){let{style:n}=e,t=(0,o.C)(e=>e.settings.mode);return(0,i.jsx)("img",{src:"/img/icons/skelly_face_logo_".concat(t,"_1.svg"),style:n})}},72748:function(e,n,t){t.d(n,{Z:function(){return PasswordInput}});var i=t(85893),o=t(67294),r=t(22571),a=t(57709),s=t(60076),l=t(91057),c=t(53640),u=t(22961),d=t(72450),g=t(44012);function PasswordInput(e){let[n,t]=o.useState(!1),m=(0,i.jsx)(g.Z,{id:void 0===e.messageId?"Password":e.messageId});return(0,i.jsxs)(c.Z,{sx:{maxWidth:"16rem",width:"100%",marginLeft:"auto",marginRight:"auto",...e.style},variant:"outlined",children:[(0,i.jsx)(s.Z,{children:m}),(0,i.jsx)(a.Z,{autoComplete:e.autoComplete,type:!0===n?"text":"password",inputRef:e.passwodRef,label:m,onChange:n=>{e.setPassword&&e.setPassword(n.target.value)},onKeyDown:n=>{e.onEnter&&"Enter"===n.key&&e.onEnter()},endAdornment:(0,i.jsx)(l.Z,{position:"end",children:(0,i.jsx)(r.Z,{"aria-label":"toggle password visibility",onClick:()=>{t(!n)},onMouseDown:e=>{e.preventDefault()},edge:"end",children:!0===n?(0,i.jsx)(d.Z,{}):(0,i.jsx)(u.Z,{})})}),disabled:e.disabled})]})}},93307:function(e,n,t){t.d(n,{Z:function(){return StandardInput}});var i=t(85893);t(67294);var o=t(57709),r=t(53640),a=t(60076),s=t(44012);function StandardInput(e){let n=void 0===e.messageId?"EMail":e.messageId;return(0,i.jsxs)(r.Z,{sx:{m:1,maxWidth:"16rem",width:"100%",marginLeft:"auto",marginRight:"auto",...e.sx},children:[(0,i.jsx)(a.Z,{variant:"outlined",children:(0,i.jsx)(s.Z,{id:n})}),(0,i.jsx)(o.Z,{label:(0,i.jsx)(s.Z,{id:n}),onChange:n=>{e.setValue(n.target.value)},onKeyDown:n=>{e.onEnter&&"Enter"===n.key&&e.onEnter()},disabled:e.disabled,autoComplete:e.autoComplete})]})}},93862:function(e,n,t){t.d(n,{D:function(){return o},Z:function(){return Auth}});var i,o,r=t(85893),a=t(67294),s=t(23972),l=t(69397),c=t(37171),u=t(93307),d=t(72748),g=t(60718),m=t(29406),f=t(44012),p=t(57629),v=t(51136),h=t(21023);function PasswordTooltip(e){return(0,r.jsx)(h.Z,{title:void 0===e.username||(0,m.K)(e.username)?(0,m.m)(e.password)?"":(0,r.jsx)(f.Z,{id:"PasswordDescription"}):(0,r.jsx)(f.Z,{id:"ProvideValidEMail"}),placement:"right",arrow:!0,children:(0,r.jsx)("span",{style:{maxWidth:"16rem",width:"100%",marginLeft:"auto",marginRight:"auto",marginTop:"0.5rem",marginBottom:"0.5rem"},children:e.children})})}var y=t(13594);function SignIn(e){let[n,t]=a.useState(void 0),{logIn:i}=a.useContext(v.e),[h,b]=a.useState(!1),[_,x]=a.useState(""),[k,Z]=a.useState(""),j=h||void 0!==n||!(0,m.K)(_)||!(0,m.m)(k),logIn_=async()=>{y.ZP.log("LogIn.logIn_(): Called (window.location.search: ".concat(window.location.search,")")),b(!0),i(_,k).then(()=>{e.loggedIn()}).catch(e=>{y.ZP.log("LogIn.logIn_(): Login failed ".concat(e)),t({type:"error",text:e,reactIntl:!0})}).finally(()=>{b(!1)})},resetSkellyAlert=()=>{void 0!==n&&t(void 0)};return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[(0,r.jsx)(p.Z,{style:{width:"8rem",marginLeft:"auto",marginRight:"auto",marginTop:"2rem",marginBottom:"1rem"}}),(0,r.jsx)(s.Z,{variant:"h5",style:{marginBottom:"1rem",marginLeft:"auto",marginRight:"auto"},children:(0,r.jsx)(f.Z,{id:"WelcomeSkelly"})}),(0,r.jsx)(u.Z,{messageId:"EMail",setValue:e=>{resetSkellyAlert(),x(e)},sx:{marginBottom:"0.5rem"},disabled:h}),(0,r.jsx)(d.Z,{setPassword:e=>{resetSkellyAlert(),Z(e)},onEnter:()=>{j||logIn_()},disabled:h,autoComplete:"old-password",style:{marginTop:"0.5rem"}}),(0,r.jsx)(c.Z,{messageId:"ForgotPasswordQuestion",onClick:()=>{e.setDisplay(o.ForgotPassword)},style:{marginLeft:"auto",marginRight:"auto",marginTop:"1rem",marginBottom:"0.5rem"},disabled:h}),(0,r.jsx)(PasswordTooltip,{username:_,password:k,children:(0,r.jsx)(l.Z,{variant:"contained",onClick:logIn_,color:"secondary",style:{maxWidth:"16rem",width:"100%",marginLeft:"auto",marginRight:"auto"},disabled:j,children:(0,r.jsx)(f.Z,{id:"LogIn"})})}),(0,r.jsx)(c.Z,{onClick:()=>{e.setDisplay(o.SignUp)},messageId:"NeedAccountQuestion",style:{marginLeft:"auto",marginRight:"auto",marginTop:"0.5rem",textAlign:"center"}}),(0,r.jsx)(c.Z,{messageId:"ResendLinkQuestion",onClick:()=>{e.setDisplay(o.ResendLink)},style:{marginLeft:"auto",marginRight:"auto",marginTop:"1rem",textAlign:"center"}}),(0,r.jsx)(g.Z,{message:n,style:{marginTop:"1rem"}})]})})}var b=t(58128),_=t(31011),x=t(9103),k=t(66252),Z=t(50319),j=t(82729),S=t(31230);function _templateObject(){let e=(0,j._)(["\n mutation MyMutation($sub: String!) {\n registerSignUp(sub: $sub)\n }\n"]);return _templateObject=function(){return e},e}function _templateObject1(){let e=(0,j._)(["\n subscription MySubscription {\n confirmSignUp\n }\n"]);return _templateObject1=function(){return e},e}let P=(0,S.Ps)(_templateObject()),I=(0,S.Ps)(_templateObject1()),w=a.createContext(void 0);function ConfirmationLinkContextProvider(e){let{children:n}=e,t=(0,k.x)(),[i,{loading:o}]=(0,Z.D)(P),[s,l]=a.useState(void 0),[c,u]=a.useState(void 0),d=a.useRef(void 0);return a.useEffect(()=>()=>{d.current&&(y.cM("ConfirmationLink(): Unsubscribing from Subscription"),d.current.unsubscribe(),d.current=void 0)},[]),(0,r.jsx)(w.Provider,{value:{registerSub:async e=>{y.cM("ConfirmationLink(): Registering sub ".concat(e)),await i({variables:{sub:e}}),y.cM("ConfirmationLink(): Subscribing to sub updates");let n=t.subscribe({query:I}),o=n.subscribe({next(e){var n;(null===(n=e.data)||void 0===n?void 0:n.confirmSignUp)&&s!==e.data.confirmSignUp&&l(e.data.confirmSignUp)},error(e){y.cM("ConfirmationLink(): Subscription to sub updates failed.",e),u(e)}});d.current=o},registeringSub:o,linkConfirmation:s},children:n})}var C=t(12039),O=t(39518);function SignUp(e){let n=(0,x.C)(e=>e.settings.locale),{logIn:t}=a.useContext(v.e),[i,h]=a.useState(""),[k,Z]=a.useState(""),[j,S]=a.useState(!1),P=a.useRef(void 0),I=a.useRef(void 0),A=a.useRef(void 0),[R,G]=a.useState(void 0),resetSkellyAlert=()=>{void 0!==R&&G(void 0)},{registerSub:L,registeringSub:M,linkConfirmation:T}=a.useContext(w);return a.useEffect(()=>{y.ZP.log("SingUp(): linkConfirmation received (".concat(T,")")),void 0!==T&&T===P.current&&(console.log("SkellyAuth.signUp(): Sign up link was confirmed, processing with login"),t(I.current,A.current).then(()=>{h(""),Z(""),G(void 0),S(!1),P.current=void 0,I.current=void 0,A.current=void 0,e.loggedIn()}).catch(e=>{y.ZP.log("SignUp(): Log-in after sign-up failed ".concat(e)),(0,O.f)("event","skelly_error",{skelly_event_action:"SignUp.tsx",skelly_event_pathname:window.location.pathname,skelly_event_source:"skelly-utilities/redux/account/functions.logIn",skelly_event_label:"string"==typeof e?e:e.toString()})}))},[T]),(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[(0,r.jsx)(p.Z,{style:{width:"8rem",marginLeft:"auto",marginRight:"auto",marginTop:"2rem",marginBottom:"1rem"}}),(0,r.jsx)(s.Z,{variant:"h5",style:{marginBottom:"1rem",marginLeft:"auto",marginRight:"auto"},children:(0,r.jsx)(f.Z,{id:"CreateAccount"})}),(0,r.jsx)(u.Z,{messageId:"EMail",setValue:e=>{resetSkellyAlert(),h(e)},sx:{marginBottom:"0.5rem"}}),(0,r.jsx)(d.Z,{setPassword:e=>{resetSkellyAlert(),Z(e)},autoComplete:"new-password",style:{marginTop:"0.5rem"}}),(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"row",width:"15rem",marginLeft:"auto",marginRight:"auto",marginTop:"1rem",marginBottom:"0.5rem",position:"relative"},children:[(0,r.jsx)(b.Z,{checked:j,onClick:()=>{S(!j)},style:{position:"absolute",top:"-0.70rem",left:"-1.25rem"}}),(0,r.jsx)(s.Z,{variant:"body1",component:"div",style:{marginLeft:"1.3rem"},children:(0,r.jsx)(f.Z,{id:"TermsAndPrivacyAgreement",values:{TermsLink:e=>(0,r.jsx)(c.Z,{message:e,onClick:()=>{(0,C.n)("https://skelly.gg/terms")}}),PrivacyLink:e=>(0,r.jsx)(c.Z,{message:e,onClick:()=>{(0,C.n)("https://skelly.gg/privacy")}})}})})]}),(0,r.jsx)(PasswordTooltip,{username:i,password:k,children:(0,r.jsx)(l.Z,{onClick:async()=>{if(!M)try{let e=await (0,_.y1)(i,k,n);console.log("SignUp(): SignUp was successful (userSub: ".concat(e,")")),G({type:"info",text:"CreateAccontSuccess",reactIntl:!0}),await L(e),P.current=e,I.current=i,A.current=k}catch(e){console.warn("SignUp(): Registration of 'sub' with Skelly server failed",e),G({type:"error",text:e,reactIntl:!0})}},disabled:!(0,m.K)(i)||!(0,m.m)(k)||M||void 0!==R||!1===j,variant:"contained",color:"secondary",style:{width:"100%"},children:(0,r.jsx)(f.Z,{id:"CreateAccountMinor"})})}),(0,r.jsx)(c.Z,{messageId:"HaveAccountQuestion",onClick:()=>{e.setDisplay(o.LogIn)},style:{marginLeft:"auto",marginRight:"auto",marginTop:"0.5rem"}}),(0,r.jsx)(g.Z,{message:R,style:{marginTop:"1rem"}})]})})}let A=!1,R=!1;function ForgotPassword(e){let[n,t]=a.useState(void 0),[i,h]=a.useState(""),[b,x]=a.useState(""),[k,Z]=a.useState(""),[j,S]=a.useState(""),[P,I]=a.useState(!1),[w,C]=a.useState(!1),{logIn:O}=a.useContext(v.e),resetSkellyAlert=()=>{void 0!==n&&t(void 0)},forgotPassword_=()=>{!0!==A&&(A=!0,x(i),C(!0),(0,_.gF)(i).then(()=>{t({type:"info",text:"VerificationCodeSent",reactIntl:!0})}).catch(e=>{t({type:"error",text:e,reactIntl:!0})}).finally(()=>{A=!1,C(!1)}))},resetPassword_=()=>{!0!==R&&(R=!0,C(!0),!0!==P&&I(!0),(0,_.c0)(i,j,k).then(()=>{y.ZP.log("ForgotPassword.resetPassword_(): Reset was successful"),t({type:"info",text:"Password was successfully reset."}),O(i,k).then(()=>{y.ZP.log("ForgotPassword.resetPassword_(): Automated login was successful")}).finally(()=>{C(!1)})}).catch(e=>{y.ZP.log("ForgotPassword.resetPassword_(): Reset failed"),t({type:"info",text:e}),C(!1)}).finally(()=>{R=!1}))};return(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[(0,r.jsx)(p.Z,{style:{width:"8rem",marginLeft:"auto",marginRight:"auto",marginTop:"2rem",marginBottom:"1rem"}}),(0,r.jsx)(s.Z,{variant:"h5",style:{marginBottom:"1rem",marginLeft:"auto",marginRight:"auto"},children:(0,r.jsx)(f.Z,{id:"ForgotPassword"})}),(0,r.jsx)(u.Z,{messageId:"EMail",setValue:e=>{resetSkellyAlert(),x(""),h(e)},onEnter:()=>{forgotPassword_()},disabled:w}),(0,r.jsx)(l.Z,{variant:"contained",disabled:!(0,m.K)(i)||i===b||w,onClick:forgotPassword_,color:"secondary",style:{maxWidth:"16rem",width:"100%",marginLeft:"auto",marginRight:"auto",marginBottom:"0.5rem"},children:(0,r.jsx)(f.Z,{id:"RequestVerificationCode"})}),(0,r.jsx)(u.Z,{messageId:"VerificationCode",setValue:e=>{!0===P&&I(!1),resetSkellyAlert(),S(e)},disabled:w,sx:{marginBottom:"0.5rem"}}),(0,r.jsx)(d.Z,{messageId:"NewPassword",setPassword:e=>{!0===P&&I(!1),resetSkellyAlert(),Z(e)},onEnter:resetPassword_,disabled:w}),(0,r.jsx)(PasswordTooltip,{password:k,children:(0,r.jsx)(l.Z,{disabled:""===j||!(0,m.m)(k)||P||w,variant:"contained",onClick:resetPassword_,color:"secondary",style:{maxWidth:"16rem",width:"100%",marginLeft:"auto",marginRight:"auto"},children:(0,r.jsx)(f.Z,{id:"ResetPassword"})})}),(0,r.jsx)(c.Z,{messageId:"RememberPasswordQuestion",onClick:()=>{e.setDisplay(o.LogIn)},style:{marginLeft:"auto",marginRight:"auto",marginTop:"0.5rem"},disabled:w}),(0,r.jsx)(g.Z,{message:n,style:{marginTop:"0.5rem"}})]})}let G=!1;function ResendLink(e){let[n,t]=a.useState(void 0),[i,d]=a.useState(""),v=!(0,m.K)(i)||void 0!==n,resendLink_=()=>{v||!0===G||(G=!0,(0,_.S5)(i).then(()=>{t({type:"info",text:"ResendLinkInfo",reactIntl:!0})}).catch(e=>{t({type:"error",text:void 0!==e.message?e.message:e,reactIntl:!0})}).finally(()=>{G=!1}))};return(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[(0,r.jsx)(p.Z,{style:{width:"8rem",marginLeft:"auto",marginRight:"auto",marginTop:"2rem",marginBottom:"1rem"}}),(0,r.jsx)(s.Z,{variant:"h5",style:{marginBottom:"1rem",marginLeft:"auto",marginRight:"auto"},children:(0,r.jsx)(f.Z,{id:"ResendLink"})}),(0,r.jsx)(u.Z,{messageId:"EMail",setValue:e=>{void 0!==n&&t(void 0),d(e)},onEnter:()=>{resendLink_()}}),(0,r.jsx)(l.Z,{variant:"contained",disabled:v,onClick:resendLink_,color:"secondary",style:{maxWidth:"16rem",width:"100%",marginLeft:"auto",marginRight:"auto",marginTop:"0.5rem",marginBottom:"0.5rem"},children:(0,r.jsx)(f.Z,{id:"RequestLink"})}),(0,r.jsx)(c.Z,{messageId:"ConfirmedLinkQuestion",onClick:()=>{e.setDisplay(o.LogIn)},style:{marginLeft:"auto",marginRight:"auto",marginTop:"0.5rem"}}),(0,r.jsx)(g.Z,{message:n,style:{marginTop:"0.5rem"}})]})}var L=t(21987);function Auth(e){let{initialDisplay:n,onDisplayChange:t,loggedIn:i}=e,[o,s]=a.useState(void 0===n?"login":n);return a.useEffect(()=>{t&&t(o)},[o]),(0,r.jsx)(L.Z,{style:{width:"22rem",marginLeft:"auto",marginRight:"auto",padding:"1rem",marginTop:"1rem",marginBottom:"1rem",paddingBottom:"3rem",height:"fit-content"},children:"account"===o?(0,r.jsx)(ConfirmationLinkContextProvider,{children:(0,r.jsx)(SignUp,{setDisplay:s,loggedIn:i})}):"resend"===o?(0,r.jsx)(ConfirmationLinkContextProvider,{children:(0,r.jsx)(ResendLink,{setDisplay:s})}):"login"===o?(0,r.jsx)(SignIn,{setDisplay:s,loggedIn:i}):(0,r.jsx)(ForgotPassword,{setDisplay:s})})}(i=o||(o={})).SignUp="account",i.ResendLink="resend",i.LogIn="login",i.ForgotPassword="password"},34556:function(e,n,t){t.d(n,{Z:function(){return LoadingScreen}});var i=t(85893);t(67294);var o=t(44012),r=t(26447),a=t(66489),s=t(23972);function LoadingScreen(e){let{size:n="4rem",messageId:t}=e;return(0,i.jsx)("div",{style:{minWidth:"15em",minHeight:"10rem",display:"flex",flexGrow:1},children:(0,i.jsxs)(r.Z,{style:{margin:"auto"},gap:"2rem",children:[(0,i.jsx)(a.Z,{size:n}),t?(0,i.jsx)(s.Z,{variant:"body1",style:{marginLeft:"auto",marginRight:"auto"},children:(0,i.jsx)(o.Z,{id:t})}):null]})})}},87138:function(e,n,t){t.d(n,{Z:function(){return SkellyThemeProvider}});var i=t(85893),o=t(67294),r=t(77257),a=t(46008);let getDesignTokens=e=>({palette:{mode:e,background:{default:a.Kj[e].background,paper:a.Kj[e].background,contrastText:a.Kj[e].onBackground,outline:a.Kj[e].outline},surface:{default:a.Kj[e].surface,contrastText:a.Kj[e].onSurface},surfaceVariant:{default:a.Kj[e].surfaceVariant,contrastText:a.Kj[e].onSurfaceVariant,outline:a.Kj[e].outlineVariant},primary:{main:a.Kj[e].primary,contrastText:a.Kj[e].onPrimary},secondary:{main:a.Kj[e].secondary,contrastText:a.Kj[e].onSecondary}},typography:{fontFamily:'"DM Sans", "Roboto", "Helvetica", "Arial", sans-serif',fontSize:15,h1:{fontSize:"56px",fontWeight:700},h2:{fontSize:"48px",fontWeight:700},h3:{fontSize:"38px",fontWeight:700},h4:{fontSize:"32px",fontWeight:700},h5:{fontSize:"24px",fontWeight:700},h6:{fontSize:"14px",fontWeight:700},subtitle1:{fontSize:"15px",fontWeight:600},subtitle1Selected:{fontSize:"15px",fontWeight:600,padding:"0.3rem",borderRadius:"0.4rem"},body1:{fontSize:"14px",fontWeight:400},body2:{fontSize:"11px",fontWeight:400,opacity:.6},button:{fontSize:"14px",fontWeight:700,textTransform:"none"},link:{fontFamily:'"DM Sans", "Roboto", "Helvetica", "Arial", sans-serif',fontSize:14,fontWeight:400,textDecoration:"none",cursor:"pointer","&:hover":{textDecoration:"underline"}},linkColored:{fontFamily:'"DM Sans", "Roboto", "Helvetica", "Arial", sans-serif',fontSize:14,fontWeight:400,color:"light"===e?"006ce7":"#209df6",textDecoration:"none",cursor:"pointer","&:hover":{textDecoration:"underline"}}},components:{MuiTableCell:{styleOverrides:{root:{opacity:1,padding:"1rem 2rem 1rem 0"}}}}});var s=t(22233),l=t(9103),c=t(68824),u=t(31955),d=t(13594);function SkellyThemeProvider(e){let n=(0,l.C)(e=>e.settings.mode),t=o.useMemo(()=>(0,r.Z)(getDesignTokens(n)),[n]);return o.useEffect(()=>{d.cM("SkellyThemeProvider(): mode = ".concat(n)),document.body.style.backgroundColor=(0,c.d)(n),u.Z.set("mode",n)},[n]),(0,i.jsx)(s.Z,{theme:t,children:e.children})}},12039:function(e,n,t){t.d(n,{n:function(){return openLink}});function openLink(e,n){window.open(e,n||"_blank")}},6831:function(e,n,t){t.d(n,{_:function(){return captureOutboundClick}});var i=t(39518);function captureOutboundClick(e,n){return()=>{(0,i.f)("event","skelly_outbound",{skelly_event_action:e,skelly_event_label:n})}}},23497:function(e,n,t){t.d(n,{kA:function(){return s},m7:function(){return r},wQ:function(){return a}});var i=t(82729),o=t(31230);function _templateObject(){let e=(0,i._)(["\n query getIGDBGames($gameIds: [String!]!) {\n getIGDBGames(input: $gameIds) @client {\n id\n cover {\n id\n url\n }\n first_release_date\n involved_companies {\n id\n company {\n id\n name\n websites {\n id\n url\n }\n }\n developer\n }\n name\n platforms {\n id\n name\n }\n url\n }\n }\n"]);return _templateObject=function(){return e},e}function _templateObject1(){let e=(0,i._)(["\n query getIGDBGame($gameId: String!) {\n getIGDBGame(input: $gameId) @client {\n id\n cover {\n id\n url\n }\n first_release_date\n involved_companies {\n id\n company {\n id\n name\n websites {\n id\n url\n }\n }\n developer\n }\n name\n platforms {\n id\n name\n }\n url\n }\n }\n"]);return _templateObject1=function(){return e},e}function _templateObject2(){let e=(0,i._)(["\n query searchIGDBGames($search: String!) {\n searchIGDBGames(input: $search) @client {\n id\n cover\n name\n first_release_date\n involved_companies {\n company {\n name\n websites\n }\n developer\n }\n }\n }\n"]);return _templateObject2=function(){return e},e}let r=(0,o.Ps)(_templateObject()),a=(0,o.Ps)(_templateObject1()),s=(0,o.Ps)(_templateObject2())},67296:function(e,n,t){t.d(n,{LN:function(){return addInviteIncoming},Td:function(){return addInviteOutgoing},xI:function(){return removeConnection}});var i=t(32798),o=t(13594);function addInviteOutgoing(e,n){e.updateQuery({query:i.m8},e=>{let{getMyFriendships:t}=e,i=t||{friendships:[],invitesInbound:[],invitesOutbound:[]},o=i.invitesInbound.includes(n);return{getMyFriendships:o?{friendships:i.friendships.includes(n)?i.friendships:[n,...i.friendships],invitesInbound:i.invitesInbound.filter(e=>e!==n),invitesOutbound:i.invitesOutbound}:{friendships:i.friendships,invitesInbound:i.invitesInbound,invitesOutbound:i.invitesOutbound.includes(n)?i.invitesOutbound:[n,...i.invitesOutbound]}}})}function addInviteIncoming(e,n){e.updateQuery({query:i.m8},e=>{let{getMyFriendships:t}=e,i=t||{friendships:[],invitesInbound:[],invitesOutbound:[]};o.ZP.log("addInviteIncoming(): friendships: ".concat(JSON.stringify(i))),o.ZP.log("addInviteIncoming(): inviter: ",n);let r=i.invitesOutbound.includes(n);return{getMyFriendships:r?{friendships:i.friendships.includes(n)?i.friendships:[n,...i.friendships],invitesInbound:i.invitesInbound,invitesOutbound:i.invitesOutbound.filter(e=>e!==n)}:{friendships:i.friendships,invitesInbound:i.invitesInbound.includes(n)?i.invitesInbound:[n,...i.invitesInbound],invitesOutbound:i.invitesOutbound}}})}function removeConnection(e,n){e.updateQuery({query:i.m8},e=>{let{getMyFriendships:t}=e,i=t||{friendships:[],invitesInbound:[],invitesOutbound:[]};return{getMyFriendships:{friendships:i.friendships.filter(e=>e!==n),invitesInbound:i.invitesInbound.filter(e=>e!==n),invitesOutbound:i.invitesOutbound.filter(e=>e!==n)}}})}},8525:function(e,n,t){t.d(n,{Xd:function(){return useMyFriendships},cm:function(){return useAnonymousAccept},gk:function(){return useInviteFriend},j4:function(){return useRemoveFriend}});var i=t(67294),o=t(37887),r=t(50319),a=t(32798),s=t(67296),l=t(86896),c=t(47797),u=t(18510),d=t(26222),g=t(13594);function useMyFriendships(){let[e,n]=i.useState([]),[t,r]=i.useState([]),[s,l]=i.useState([]),{data:c,loading:u,error:d}=(0,o.a)(a.m8,{fetchPolicy:"cache-first"});return i.useEffect(()=>{var e,t,i;n((null==c?void 0:null===(e=c.getMyFriendships)||void 0===e?void 0:e.friendhips)||[]),r((null==c?void 0:null===(t=c.getMyFriendships)||void 0===t?void 0:t.invitesOutbound)||[]),l((null==c?void 0:null===(i=c.getMyFriendships)||void 0===i?void 0:i.invitesInbound)||[])},[c]),{friendships:e,invitesOutbound:t,invitesInbound:s,loading:u,error:d}}function useInviteFriend(){let e=(0,l.Z)(),{myProfile:n}=(0,d.C)(),{invitesInbound:t}=useMyFriendships(),[o,{loading:m,error:f,data:p}]=(0,r.D)(a.sf,{update(e,n){let{data:{invite:t}}=n;g.ZP.log("useInviteFriend(): Invitation of ".concat(JSON.stringify(t)," completed")),(0,s.Td)(e,t.invitee)}}),v=i.useCallback(async i=>{var r,a;if(!n){g.ZP.log("useInviteFriend.inviteFriend(accountId: ".concat(i,"): Returning, as myProfile is not available"));return}g.ZP.log("useInviteFriend.inviteFriend(): Called (invitesInbound: ".concat(JSON.stringify(t),")"));let s=[...t],l=await o({variables:{accountId:i}}),d=null===(a=l.data)||void 0===a?void 0:null===(r=a.invite)||void 0===r?void 0:r.invitee;g.ZP.log("useInviteFriend.inviteFriend(): Sending notification");let m=s.includes(d);g.ZP.log("useInviteFriend.inviteFriend(): invitesInbound: ",t),g.ZP.log("useInviteFriend.inviteFriend(): invitestInboundCopy: ",s);let f=await (0,c.i)(d,{title:(0,u.Jl)(n),body:m?e.formatMessage({id:"AcceptedYourInvite"}):e.formatMessage({id:"WantsToConnect"})},{sender:d,message:m?"invite_accepted":"invite"});g.ZP.log("useInviteFriend.inviteFriend(): Result from send notification: ",f)},[e,o,n,t]);return{inviteFriend:v,inviteLoading:m,inviteData:p,inviteError:f}}function useRemoveFriend(){let[e,{loading:n,error:t,data:i}]=(0,r.D)(a.Od,{update(e,n){let{data:{remove:t}}=n;g.ZP.log("useRemoveFriend(): Removal of ".concat(JSON.stringify(t)," completed")),(0,s.xI)(e,t.removee)}}),removeFriend=async n=>e({variables:{accountId:n}});return{removeFriend,removeLoading:n,removeData:i,removeError:t}}function useAnonymousAccept(){let[e,{loading:n,error:t,data:o}]=(0,r.D)(a.yg);return i.useEffect(()=>{g.ZP.log("useAnonymousAccept(): Error: ",t)},[t]),i.useEffect(()=>{g.ZP.log("useAnonymousAccept(): loading: ",n)},[n]),i.useEffect(()=>{g.ZP.log("useAnonymousAccept(): data: ",o)},[o]),{accept:n=>e({variables:{code:n}}),acceptLoading:n,acceptData:o,acceptError:t}}},32798:function(e,n,t){t.d(n,{Od:function(){return a},Wp:function(){return f},ZN:function(){return l},fv:function(){return c},g4:function(){return g},m8:function(){return u},sf:function(){return r},xE:function(){return m},yU:function(){return d},yg:function(){return s}});var i=t(82729),o=t(31230);function _templateObject(){let e=(0,i._)(["\n mutation invite($accountId: String!) {\n invite(accountId: $accountId) {\n inviter\n invitee\n }\n }\n"]);return _templateObject=function(){return e},e}function _templateObject1(){let e=(0,i._)(["\n mutation remove($accountId: String!) {\n remove(accountId: $accountId) {\n remover\n removee\n }\n }\n"]);return _templateObject1=function(){return e},e}function _templateObject2(){let e=(0,i._)(["\n mutation anonymousInvite {\n anonymousInvite\n }\n"]);return _templateObject2=function(){return e},e}function _templateObject3(){let e=(0,i._)(["\n mutation anonymousAccept($code: String!) {\n anonymousAccept(code: $code) {\n invitee\n inviter\n }\n }\n"]);return _templateObject3=function(){return e},e}function _templateObject4(){let e=(0,i._)(["\n mutation follow($accountId: String!) {\n follow(accountId: $accountId)\n }\n"]);return _templateObject4=function(){return e},e}function _templateObject5(){let e=(0,i._)(["\n mutation unfollow($accountId: String!) {\n unfollow(accountId: $accountId)\n }\n"]);return _templateObject5=function(){return e},e}function _templateObject6(){let e=(0,i._)(["\n query getMyFriendships {\n getMyFriendships {\n friendships\n invitesInbound\n invitesOutbound\n }\n }\n"]);return _templateObject6=function(){return e},e}function _templateObject7(){let e=(0,i._)(["\n query getMyFriendshipsOnly {\n getMyFriendships {\n friendships\n }\n }\n"]);return _templateObject7=function(){return e},e}function _templateObject8(){let e=(0,i._)(["\n query getMyFollowees {\n getMyFollowees\n }\n"]);return _templateObject8=function(){return e},e}function _templateObject9(){let e=(0,i._)(["\n query getMyFollowers {\n getMyFollowers\n }\n"]);return _templateObject9=function(){return e},e}function _templateObject10(){let e=(0,i._)(["\n subscription subscribeInvite {\n invite {\n invitee\n inviter\n }\n }\n"]);return _templateObject10=function(){return e},e}function _templateObject11(){let e=(0,i._)(["\n subscription subscribeRemove {\n remove {\n removee\n remover\n }\n }\n"]);return _templateObject11=function(){return e},e}let r=(0,o.Ps)(_templateObject()),a=(0,o.Ps)(_templateObject1());(0,o.Ps)(_templateObject2());let s=(0,o.Ps)(_templateObject3()),l=(0,o.Ps)(_templateObject4()),c=(0,o.Ps)(_templateObject5()),u=(0,o.Ps)(_templateObject6());(0,o.Ps)(_templateObject7());let d=(0,o.Ps)(_templateObject8()),g=(0,o.Ps)(_templateObject9()),m=(0,o.Ps)(_templateObject10()),f=(0,o.Ps)(_templateObject11())},26222:function(e,n,t){t.d(n,{$:function(){return useCustomizedId},C:function(){return useMyProfile}});var i=t(67294),o=t(37887),r=t(73359),a=t(44194),s=t(13594),l=t(43262);function useMyProfile(){let{data:e,loading:n,error:t}=(0,o.a)(a.US,{fetchPolicy:"cache-first"}),[r,s]=i.useState(void 0);return i.useEffect(()=>{s(null==e?void 0:e.getMyProfile)},[e]),{myProfile:r,loading:n,error:t}}function useCustomizedId(){let[e,{loading:n,error:t,data:i}]=(0,r.t)(a.Ri,{fetchPolicy:"network-only"}),loadFriendId=async n=>{if(!(0,l.iH)(n))return;let t=await e({variables:{customizedId:n}});return s.ZP.log("useCustomizedId(): ",t.data),t.data};return{loadFriendId,friendIdLoading:n}}},44194:function(e,n,t){t.d(n,{Ai:function(){return l},EG:function(){return c},Nd:function(){return s},Ri:function(){return a},US:function(){return r},lF:function(){return d},y5:function(){return u}});var i=t(82729),o=t(31230);function _templateObject(){let e=(0,i._)(["\n query getMyProfile {\n getMyProfile {\n fcmTokens\n pushKitTokens\n subscriptions {\n type\n source\n payPal {\n subscriptionID\n status\n plan_id\n start_time\n create_time\n update_time\n last_payment_time\n next_billing_time\n }\n }\n subscription_overwolf {\n plan_id\n state\n expiry_date\n }\n subscription_manual {\n expiry_date\n }\n version\n friendships_version\n followees_version\n followers_version\n friend_id\n customized_id\n customized_id_version\n visibility\n avatar\n background\n summary\n gamer_names\n real_name\n birthdate\n birthdate_display\n nationalities\n country_of_residence\n languages\n games {\n id\n visible\n }\n platforms {\n id\n visible\n }\n accounts {\n account_id\n position\n verified\n visible\n dota2_mmr\n dota2_confidence\n dota2_rank\n dota2_timestamp\n valorant_rank\n valorant_timestamp\n }\n accounts_version\n teams {\n id\n name\n active\n from\n to\n role\n }\n tournaments {\n id\n name\n date\n rank\n }\n social_networks {\n id\n account\n }\n websites {\n title\n url\n }\n discord\n eMail\n phone\n followees_count\n followers_count\n }\n }\n"]);return _templateObject=function(){return e},e}function _templateObject1(){let e=(0,i._)(["\n query getFriendId($customizedId: String!) {\n getFriendId(input: $customizedId)\n }\n"]);return _templateObject1=function(){return e},e}function _templateObject2(){let e=(0,i._)(["\n mutation setCustomizedId($customizedId: String!) {\n setCustomizedId(customizedId: $customizedId)\n }\n"]);return _templateObject2=function(){return e},e}function _templateObject3(){let e=(0,i._)(["\n query getProfile($accountId: String!) {\n getProfile(input: $accountId) {\n friend_id\n fcmTokens\n pushKitTokens\n is_friend\n customized_id\n visibility\n subscription\n avatar\n background\n summary\n gamer_names\n real_name\n birthdate\n birthdate_display\n nationalities\n country_of_residence\n languages\n games {\n id\n visible\n }\n platforms {\n id\n visible\n }\n accounts {\n account_id\n position\n verified\n visible\n dota2_mmr\n dota2_confidence\n dota2_rank\n dota2_timestamp\n valorant_rank\n valorant_timestamp\n }\n teams {\n active\n from\n id\n name\n to\n role\n }\n tournaments {\n date\n id\n name\n rank\n }\n social_networks {\n account\n id\n }\n websites {\n title\n url\n }\n discord\n eMail\n phone\n followees_count\n followers_count\n\n real_time {\n friend_id\n user_status\n game\n account\n timestamp\n dota {\n team_name\n players {\n team_slot\n team\n rank\n hero\n account\n name\n }\n mmr\n match_outcome\n match_id\n lobby_type\n hero\n game_state\n game_mode\n confidence\n }\n minecraft {\n server\n scene\n name\n mc_version\n }\n valorant {\n roster {\n teammate\n rank\n local\n character\n name\n }\n round_number\n region\n ranked\n mode\n match_outcome\n custom\n agent\n map\n }\n }\n }\n }\n"]);return _templateObject3=function(){return e},e}function _templateObject4(){let e=(0,i._)(["\n query getProfiles($accountIds: [String!]!) {\n getProfiles(input: $accountIds) {\n friend_id\n fcmTokens\n pushKitTokens\n is_friend\n customized_id\n visibility\n subscription\n avatar\n background\n summary\n gamer_names\n real_name\n birthdate\n birthdate_display\n nationalities\n country_of_residence\n languages\n games {\n id\n visible\n }\n platforms {\n id\n visible\n }\n accounts {\n account_id\n position\n verified\n }\n teams {\n active\n from\n id\n name\n to\n role\n }\n tournaments {\n date\n id\n name\n rank\n }\n social_networks {\n account\n id\n }\n websites {\n title\n url\n }\n discord\n eMail\n phone\n followees_count\n followers_count\n }\n }\n"]);return _templateObject4=function(){return e},e}function _templateObject5(){let e=(0,i._)(["\n query getShortProfiles($accountIds: [String!]!) {\n getProfiles(input: $accountIds) {\n friend_id\n fcmTokens\n pushKitTokens\n visibility\n avatar\n gamer_names\n real_name\n subscription\n real_time {\n friend_id\n user_status\n game\n account\n timestamp\n dota {\n team_name\n players {\n team_slot\n team\n rank\n hero\n account\n name\n }\n mmr\n match_outcome\n match_id\n lobby_type\n hero\n game_state\n game_mode\n confidence\n }\n minecraft {\n server\n scene\n name\n mc_version\n }\n valorant {\n roster {\n teammate\n rank\n local\n character\n name\n }\n round_number\n region\n ranked\n mode\n match_outcome\n custom\n agent\n map\n }\n }\n }\n }\n"]);return _templateObject5=function(){return e},e}function _templateObject6(){let e=(0,i._)(["\n query getShortProfile($accountId: String!) {\n getProfile(input: $accountId) {\n friend_id\n visibility\n avatar\n gamer_names\n real_name\n subscription\n\n real_time {\n friend_id\n user_status\n game\n account\n timestamp\n dota {\n team_name\n players {\n team_slot\n team\n rank\n hero\n account\n name\n }\n mmr\n match_outcome\n match_id\n lobby_type\n hero\n game_state\n game_mode\n confidence\n }\n minecraft {\n server\n scene\n name\n mc_version\n }\n valorant {\n roster {\n teammate\n rank\n local\n character\n name\n }\n round_number\n region\n ranked\n mode\n match_outcome\n custom\n agent\n map\n }\n }\n }\n }\n"]);return _templateObject6=function(){return e},e}function _templateObject7(){let e=(0,i._)(["\n mutation UpdateMyProfile(\n $includeProfile: Boolean!\n $profile: MyProfileInput!\n $includeUpdate: Boolean!\n $updateGameAccounts: [GameAccountUpdate!]!\n $includeRemove: Boolean!\n $removeGameAccounts: [GameAccountRemove!]!\n ) {\n updateMyProfile(profile: $profile) @include(if: $includeProfile)\n updateMyGameAccounts(gameAccounts: $updateGameAccounts)\n @include(if: $includeUpdate)\n removeMyGameAccounts(gameAccounts: $removeGameAccounts)\n @include(if: $includeRemove)\n }\n"]);return _templateObject7=function(){return e},e}let r=(0,o.Ps)(_templateObject()),a=(0,o.Ps)(_templateObject1()),s=(0,o.Ps)(_templateObject2()),l=(0,o.Ps)(_templateObject3());(0,o.Ps)(_templateObject4());let c=(0,o.Ps)(_templateObject5()),u=(0,o.Ps)(_templateObject6()),d=(0,o.Ps)(_templateObject7())},64553:function(e,n,t){t.d(n,{Cn:function(){return u},U_:function(){return addWebhook},VP:function(){return updateSettings},_c:function(){return c},c$:function(){return updateModeBestEffort},gK:function(){return updateSettingsBestEffort}});var i=t(82729),o=t(31230),r=t(21455),a=t(30490),s=t(13594);function _templateObject(){let e=(0,i._)(["\n mutation updateMySettings($settingsInput: SettingsInput!) {\n updateMySettings(settings: $settingsInput) {\n friend_id\n language\n mobile_mode\n web_mode\n desktop_mode\n desktop_incoming_invitations\n desktop_accepted_invitations\n desktop_incoming_messages\n desktop_automationGames\n desktop_automationAccounts\n webhooks {\n dota2\n label\n secret\n url\n }\n version\n }\n }\n"]);return _templateObject=function(){return e},e}function _templateObject1(){let e=(0,i._)(["\n query getMySettings {\n getMySettings {\n language\n mobile_mode\n web_mode\n desktop_mode\n desktop_incoming_invitations\n desktop_accepted_invitations\n desktop_incoming_messages\n desktop_automationGames\n desktop_automationAccounts\n webhooks {\n label\n url\n secret\n dota2\n }\n version\n }\n }\n"]);return _templateObject1=function(){return e},e}function _templateObject2(){let e=(0,i._)(["\n subscription subscribeMySettings {\n settings {\n language\n mobile_mode\n web_mode\n desktop_mode\n desktop_incoming_invitations\n desktop_accepted_invitations\n desktop_incoming_messages\n desktop_automationGames\n desktop_automationAccounts\n webhooks {\n label\n url\n secret\n dota2\n }\n version\n }\n }\n"]);return _templateObject2=function(){return e},e}async function updateModeBestEffort(e){return updateSettingsBestEffort({["".concat("overwolf"===a.N?"desktop_mode":"web"===a.N?"web_mode":"mobile_mode")]:e})}async function updateSettingsBestEffort(e){let n=globalThis.skelly.apolloClient;if(n)try{updateSettings(n,e)}catch(e){s.ZP.error("updateSettingsBestEffort(): ",e)}}async function updateSettings(e,n){e.mutate({mutation:l,variables:{settingsInput:n},update:(e,t)=>{let{data:i}=t;e.updateQuery({query:c},e=>{let t=(null==e?void 0:e.getMySettings)||r.Rw;return{getMySettings:{...t,...n}}})}})}async function addWebhook(e,n){var t,i;s.ZP.log("addWebhook(".concat(JSON.stringify(n),"): Called"));let o=await e.query({query:c,fetchPolicy:"cache-only"}),r=(null===(i=o.data)||void 0===i?void 0:null===(t=i.getMySettings)||void 0===t?void 0:t.webhooks)||[],a=r.map(e=>({label:e.label,url:e.url,secret:e.secret,dota2:e.dota2}));a.push(n),await updateSettings(e,a)}let l=(0,o.Ps)(_templateObject()),c=(0,o.Ps)(_templateObject1()),u=(0,o.Ps)(_templateObject2())},21455:function(e,n,t){var i,o,r,a;t.d(n,{Gk:function(){return i},Rw:function(){return s}}),(r=i||(i={})).dark="dark",r.light="light",(a=o||(o={})).en="en",a.de="de",a.ru="ru";let s={language:null,desktop_mode:null,desktop_incoming_invitations:null,desktop_accepted_invitations:null,desktop_incoming_messages:null,desktop_automationGames:null,desktop_automationAccounts:null,mobile_mode:null,web_mode:null,webhooks:null,version:null}},1409:function(e,n,t){t.d(n,{L:function(){return useResilientSubscription}});var i=t(67294),o=t(66252),r=t(9103),a=t(36765),s=t(13594);let l=[0,0,15e3,6e4,3e5];function useResilientSubscription(e){let{query:n,variables:t,onSubscribed:c,onNext:u,onComplete:d,onError:g,isActive:m=!0}=e,f=(0,o.x)(),p=i.useRef((0,a.rY)(n)),v=i.useRef(0),h=i.useRef(null),y=i.useRef(null),[b,_]=i.useState(!1),x=(0,r.C)(e=>e.internetConnection.isOnline),k=i.useRef(void 0);return i.useEffect(()=>{b&&(s.ZP.log("useResilientSubscription(".concat(p.current,"): Variables of subscription changed. Subscription is shut down (").concat(JSON.stringify(t),")")),_(!1))},[t]),i.useEffect(()=>{if(s.ZP.log("useResilientSubscription(".concat(p.current,"): State update (subscribed: ").concat(b,", isOnline: ").concat(x,", isActive=").concat(m,")")),y.current&&(clearTimeout(y.current),y.current=null),!0===b||(k.current&&(k.current.unsubscribe(),k.current=void 0),!1===x))return;let e=l[v.current];s.ZP.log("useResilientSubscription(".concat(p.current,"): Subscribing (delay: ").concat(e/1e3," secs)")),y.current=setTimeout(()=>{y.current=null;try{let e=f.subscribe({query:n,variables:t});k.current=e.subscribe(u,e=>{h.current&&(clearTimeout(h.current),h.current=null),v.current=Math.min(v.current+1,l.length-1),h.current=setTimeout(()=>{s.ZP.log("hooks.delayLevelTimeoutRef(): Resetting delay level"),v.current=0,h.current=null},6e5),_(!1),g&&g(e)},d),_(!0)}catch(e){s.ZP.error("useResilientSubscription(".concat(p.current,"): Error thrown (").concat(JSON.stringify(e),")"))}},e)},[b,x,m]),i.useEffect(()=>{!0===b&&(s.ZP.log("useResilientSubscription(".concat(p.current,"): Subscription is active now")),c&&c())},[b]),i.useEffect(()=>{!1===m&&(k.current&&(k.current.unsubscribe(),k.current=void 0),_(!1))},[m]),i.useEffect(()=>(s.ZP.log("useResilientSubscription(".concat(p.current,"): Mounted")),()=>{s.ZP.log("useResilientSubscription(".concat(p.current,"): Unmounted")),k.current&&(k.current.unsubscribe(),k.current=void 0)}),[]),{subscribed:b}}},9103:function(e,n,t){t.d(n,{C:function(){return r},T:function(){return o}});var i=t(9473);let o=i.I0,r=i.v9},51136:function(e,n,t){t.d(n,{e:function(){return d},Z:function(){return CognitoManager}});var i=t(85893),o=t(67294),r=t(47669),a=t(9103),s=t(75750),l=t(31011),c=t(13594),u=t(76872);let d=o.createContext(void 0);function CognitoManager(e){let{shallow:n=!1,children:t}=e,g=(0,a.T)(),m=(0,a.C)(e=>e.account.loginState),f=(0,a.C)(e=>e.account.username),p=!!f,{cleanUp:v}={cleanUp:()=>{}};return o.useEffect(()=>(c.ZP.log("CognitoManager(): Mounted"),()=>c.ZP.log("CognitoManager(): Unmounting")),[]),o.useEffect(()=>{if(!n)switch(c.ZP.log("CognitoManager(): loginState is ".concat(m)),m){case r.zZ.Initializing:p?g((0,r.av)(r.zZ.CreatingApolloClientPrivate)):(0,s.f)()?g((0,r.av)(r.zZ.CreatingApolloClientPublic)):g((0,r.av)(r.zZ.CreatingApolloClientLocal));break;case r.zZ.LoggedOut:g((0,u.YZ)(u.e.Connections)),g((0,u.hs)(void 0)),g((0,u.Wd)(void 0)),v()}},[m]),(0,i.jsx)(d.Provider,{value:{signUp:l.y1,resendConfirmationCode:l.S5,logIn:l.Ib,getIdToken:l.lI,getAccessToken:l.hP,getCredentials:l.UR,changePassword:l.Cp,forgotPassword:l.gF,resetPassword:l.c0,deleteUser:l.h8,logOut:l.ni},children:t})}},75750:function(e,n,t){t.d(n,{f:function(){return pageRequiresPublicClient}});var i=t(13594);function pageRequiresPublicClient(){let e=window.location.pathname,n=e.startsWith("/auth/")||e.startsWith("/g/")||e.startsWith("/search");return i.ZP.log("pageRequiresPublicClient(): Called (path: ".concat(e,", pageRequiresPublicClient: ").concat(n,")")),n}},29406:function(e,n,t){t.d(n,{K:function(){return isEMailValid},m:function(){return isPasswordValid}});let isEMailValid=e=>/^.+@.+$/.test(e),isPasswordValid=e=>{let n=e.length>=8,t="a-zA-Z0-9\\^\\$\\*\\.\\[\\]\\{\\}\\(\\)\\?\"!@#%&/\\\\,><':;\\|_~`=\\+-\\s",i=new RegExp("^[".concat(t,"]*[0-9][").concat(t,"]*$")).test(e),o=new RegExp("^[".concat(t,"]*[A-Z][").concat(t,"]*$")).test(e),r=new RegExp("^[".concat(t,"]*[a-z][").concat(t,"]*$")).test(e);return n&&i&&o&&r}},54799:function(e,n,t){t.d(n,{J:function(){return d},Z:function(){return SkellySnackbarProvider}});var i=t(85893),o=t(67294),r=t(86896),a=t(2734),s=t(55065),l=t(62623),c=t(23972),u=t(13594);function SkellySnackbarRender(e){let{message:n,autoHideDuration:t,onClose:r}=e,d=(0,a.Z)();return o.useEffect(()=>(u.ZP.log("SkellySnackbarRender(): Mounted"),()=>u.ZP.log("SkellySnackbarRender(): Unmounting")),[]),(0,i.jsx)(s.Z,{open:!!n,autoHideDuration:t,onClose:r,children:(0,i.jsx)(l.Z,{style:{padding:"1rem",backgroundColor:d.palette.surface.default,color:d.palette.surface.contrastText},children:(0,i.jsx)(c.Z,{variant:"body1",children:n})})})}let d=o.createContext(void 0);function SkellySnackbarProvider(e){let{children:n}=e,t=(0,r.Z)(),[a,s]=o.useState([]),[l,c]=o.useState(void 0);return o.useEffect(()=>(u.ZP.log("SkellySnackbarProvider(): Mounted"),()=>u.ZP.log("SkellySnackbarProvider(): Unmounting")),[]),o.useEffect(()=>{if(void 0===l&&a.length>0){let e=a[0];c(e),s(n=>n.filter(n=>n!==e))}},[a,l]),(0,i.jsxs)(d.Provider,{value:{addSnackbar:(e,n)=>{void 0===n||(e=!0===n?t.formatMessage({id:e}):t.formatMessage({id:e},n)),s(n=>[...n,e])}},children:[n,void 0===l?null:(0,i.jsx)(SkellySnackbarRender,{message:l,autoHideDuration:6e3,onClose:()=>{c(void 0)}})]})}},43262:function(e,n,t){t.d(n,{F2:function(){return usernameIsValid},gl:function(){return isFriendId},iH:function(){return usernameIsValid}});let i=/^[a-zA-Z0-9_]{1,15}$/,o=/[a-zA-Z_]+/;function usernameIsValid(e){return i.test(e)&&o.test(e)}let r=/^[1-9][0-9]{4,11}$/;function isFriendId(e){return r.test(e)}},30898:function(e,n,t){t.d(n,{e:function(){return getInviteCode},t:function(){return setInviteCode}});let i="skelly:inviteCode";function setInviteCode(e){sessionStorage.setItem(i,e)}function getInviteCode(){let e=sessionStorage.getItem(i);return e&&sessionStorage.removeItem(i),e}}}]);