import{T as _}from"./index-fLATfv38.js";import{U as B}from"./error-Deo1phpd.js";import{g as D}from"./_commonjsHelpers-CqkleIqs.js";var y={exports:{}},O=y.exports,x;function W(){return x||(x=1,(function(s){(function(f,t){s.exports?s.exports=t():f.log=t()})(O,function(){var f=function(){},t="undefined",F=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),w=["trace","debug","info","warn","error"],c={},i=null;function L(o,r){var e=o[r];if(typeof e.bind=="function")return e.bind(o);try{return Function.prototype.bind.call(e,o)}catch{return function(){return Function.prototype.apply.apply(e,[o,arguments])}}}function I(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function R(o){return o==="debug"&&(o="log"),typeof console===t?!1:o==="trace"&&F?I:console[o]!==void 0?L(console,o):console.log!==void 0?L(console,"log"):f}function g(){for(var o=this.getLevel(),r=0;r<w.length;r++){var e=w[r];this[e]=r<o?f:this.methodFactory(e,o,this.name)}if(this.log=this.debug,typeof console===t&&o<this.levels.SILENT)return"No console available for logging"}function U(o){return function(){typeof console!==t&&(g.call(this),this[o].apply(this,arguments))}}function A(o,r,e){return R(o)||U.apply(this,arguments)}function m(o,r){var e=this,v,h,u,a="loglevel";typeof o=="string"?a+=":"+o:typeof o=="symbol"&&(a=void 0);function M(n){var l=(w[n]||"silent").toUpperCase();if(!(typeof window===t||!a)){try{window.localStorage[a]=l;return}catch{}try{window.document.cookie=encodeURIComponent(a)+"="+l+";"}catch{}}}function E(){var n;if(!(typeof window===t||!a)){try{n=window.localStorage[a]}catch{}if(typeof n===t)try{var l=window.document.cookie,p=encodeURIComponent(a),C=l.indexOf(p+"=");C!==-1&&(n=/^([^;]+)/.exec(l.slice(C+p.length+1))[1])}catch{}return e.levels[n]===void 0&&(n=void 0),n}}function N(){if(!(typeof window===t||!a)){try{window.localStorage.removeItem(a)}catch{}try{window.document.cookie=encodeURIComponent(a)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function d(n){var l=n;if(typeof l=="string"&&e.levels[l.toUpperCase()]!==void 0&&(l=e.levels[l.toUpperCase()]),typeof l=="number"&&l>=0&&l<=e.levels.SILENT)return l;throw new TypeError("log.setLevel() called with invalid level: "+n)}e.name=o,e.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},e.methodFactory=r||A,e.getLevel=function(){return u??h??v},e.setLevel=function(n,l){return u=d(n),l!==!1&&M(u),g.call(e)},e.setDefaultLevel=function(n){h=d(n),E()||e.setLevel(n,!1)},e.resetLevel=function(){u=null,N(),g.call(e)},e.enableAll=function(n){e.setLevel(e.levels.TRACE,n)},e.disableAll=function(n){e.setLevel(e.levels.SILENT,n)},e.rebuild=function(){if(i!==e&&(v=d(i.getLevel())),g.call(e),i===e)for(var n in c)c[n].rebuild()},v=d(i?i.getLevel():"WARN");var b=E();b!=null&&(u=d(b)),g.call(e)}i=new m,i.getLogger=function(r){if(typeof r!="symbol"&&typeof r!="string"||r==="")throw new TypeError("You must supply a name when creating a logger.");var e=c[r];return e||(e=c[r]=new m(r,i.methodFactory)),e};var S=typeof window!==t?window.log:void 0;return i.noConflict=function(){return typeof window!==t&&window.log===i&&(window.log=S),i},i.getLoggers=function(){return c},i.default=i,i})})(y)),y.exports}var $=W();const k=D($),T=k;T.enableAll();function q(s){T.error(s)}function V(s){if(s instanceof _){const f=s;if(f.data?.isUserVisible&&f.message)return[f.message,f.data.descriptionText].filter(Boolean).join(`
`);if(f.message.includes("Failed to fetch"))return"Could not connect to the server. Please start the server and try again."}return s instanceof B?s.message:"Check console logs for more details."}function z(s,f="Sorry, something went wrong."){const t=V(s);return`${f} ${t}`}function Y(s,f){return q(s),z(s,f)}export{q as a,z as f,Y as l};
//# sourceMappingURL=error-formatter-B41KnHG1.js.map
