"use strict";const a=require("./FetchConfigsUtils-c73b687c.js"),l=require("./starBgGradient-20cd2d76.js"),e=require("react"),n=require("react-i18next"),c=require("./CommonError-c282a0a2.js");const m=t=>{var i;const{error:r}=t;if(!r)return null;if(a.ErrorHelper.isAxiosNetworkError(r))return e.createElement(n.Trans,{i18nKey:"CommonError.networkError"},"The server cannot be reached. Please try again.");const s=a.ErrorHelper.extractServiceErrorCode(r)||0,o=c.translateServiceError(s);return o?e.createElement(e.Fragment,null,o):(a.ErrorHelper.isAxiosError(r)&&((i=r==null?void 0:r.response)==null?void 0:i.status))===403?e.createElement(n.Trans,{i18nKey:"CommonError.playerPortal.forbidden"},"You cannot access this page. Please go back."):a.ErrorHelper.isAxiosServerError(r)?e.createElement(n.Trans,{i18nKey:"CommonError.serverError"},"We are experiencing some technical issues right now. Please try again later."):e.createElement(n.Trans,{i18nKey:"CommonError.unknownError"},"Something went wrong. Please contact support for assistance.")},E=({error:t,appId:r,isWithBackground:s=!0})=>{var o;return a.ErrorHelper.isAxiosError(t)&&r&&((o=t.response)==null?void 0:o.status)===404?e.createElement("div",{className:"noMatchingGameError",style:{backgroundImage:s?`url(${l.starBgGradient})`:void 0}},e.createElement("div",null,e.createElement("h2",{className:"heading"},e.createElement(n.Trans,{i18nKey:"CommonError.noMatchingGame"},'Game "',{appId:r},`" doesn't exist in the store.`)),e.createElement("p",{className:"paragraph"},e.createElement(n.Trans,{i18nKey:"CommonError.noMatchingGameResolution"},"To fix this, do one of the following:")),e.createElement("ol",{className:"list"},e.createElement("li",null,e.createElement(n.Trans,{i18nKey:"CommonError.noMatchingGameResolutionEnsure"},'Ensure the game "',{appId:r},'" exists in the store,')),e.createElement("li",null,e.createElement(n.Trans,{i18nKey:"CommonError.noMatchingGameResolutionChangeAppID"},"Change the App ID to an existing game, or")),e.createElement("li",null,e.createElement(n.Trans,{i18nKey:"CommonError.noMatchingGameResolutionChangeTemplateConfig"},"Change the Template Config to multiple game."))))):e.createElement(m,{error:t})};exports.CommonError=m;exports.NoMatchingGameError=E;
