function e(e,t){let n={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_API_BASE_URL:`https://api.oquiserp.dev.absol.in`}[e];return!n&&t===void 0&&console.warn(`Environment variable ${e} is not set`),n||t}function t(e,t=!1){let n={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_API_BASE_URL:`https://api.oquiserp.dev.absol.in`}[e];return n===void 0?t:n===`true`}function n(e,t){let n={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_API_BASE_URL:`https://api.oquiserp.dev.absol.in`}[e];if(!n)return t;let r=Number(n);return isNaN(r)?t:r}var r={api:{baseUrl:e(`VITE_API_BASE_URL`,`http://localhost:8000`),version:`v1`,timeout:n(`VITE_API_TIMEOUT`,3e4)},app:{name:e(`VITE_APP_NAME`,`Oquis ERP`),version:e(`VITE_APP_VERSION`,`1.0.0`),environment:e(`VITE_APP_ENVIRONMENT`,`development`),isDevelopment:e(`VITE_APP_ENVIRONMENT`,`development`)===`development`,isProduction:e(`VITE_APP_ENVIRONMENT`,`development`)===`production`,isStaging:e(`VITE_APP_ENVIRONMENT`,`development`)===`staging`},features:{darkMode:t(`VITE_ENABLE_DARK_MODE`,!0),notifications:t(`VITE_ENABLE_NOTIFICATIONS`,!0),websocket:t(`VITE_ENABLE_WEBSOCKET`,!0),rememberMe:t(`VITE_ENABLE_REMEMBER_ME`,!0)},auth:{tokenExpiryMinutes:n(`VITE_JWT_EXPIRY_MINUTES`,30),refreshTokenExpiryDays:7},websocket:{enabled:t(`VITE_ENABLE_WEBSOCKET`,!0),url:e(`VITE_WEBSOCKET_URL`,`ws://localhost:8000/ws`),reconnectAttempts:5,reconnectInterval:3e3},upload:{maxFileSizeMB:n(`VITE_MAX_FILE_SIZE_MB`,5),allowedExtensions:e(`VITE_ALLOWED_FILE_EXTENSIONS`,`pdf,doc,docx,xls,xlsx,png,jpg,jpeg,csv`).split(`,`).map(e=>e.trim()),maxFiles:10},pagination:{defaultPageSize:n(`VITE_DEFAULT_PAGE_SIZE`,10),pageSizeOptions:[10,20,50,100]},dateFormat:`YYYY-MM-DD`,dateTimeFormat:`YYYY-MM-DD HH:mm:ss`,timeFormat:`HH:mm:ss`,storage:{authToken:`oquis_auth_token`,refreshToken:`oquis_refresh_token`,userPreferences:`oquis_user_preferences`,theme:`oquis_theme`,language:`oquis_language`},monitoring:{sentryDsn:e(`VITE_SENTRY_DSN`,``),googleAnalyticsId:e(`VITE_GOOGLE_ANALYTICS_ID`,``)},debug:{apiLogging:t(`VITE_DEBUG_API`,!1),verbose:t(`VITE_DEBUG_VERBOSE`,!1)}};function i(e){if(!e)return``;let t=document.createElement(`div`);return t.textContent=e,t.innerHTML}function a(e,t=`An unexpected error occurred`){if(e instanceof Error&&e.statusCode!==void 0){let t=e;if(typeof t.message==`string`)return i(t.message)}if(e instanceof Error){let t=e.message;return t.includes(`Network Error`)||t.includes(`CORS`)?`Unable to connect to the server. Please check your connection.`:t.includes(`401`)||t.includes(`Unauthorized`)?`Your session has expired. Please log in again.`:t.includes(`403`)||t.includes(`Forbidden`)?`You do not have permission to perform this action.`:t.includes(`404`)||t.includes(`Not Found`)?`The requested resource was not found.`:t.includes(`500`)||t.includes(`Internal Server Error`)?`A server error occurred. Please try again later.`:t.includes(`Timeout`)?`The request took too long. Please try again.`:i(t.substring(0,200))}return typeof e==`string`?i(e.substring(0,200)):t}function o(e,t=[`password`,`token`,`refreshToken`,`accessToken`,`apiKey`,`secret`,`creditCard`,`ssn`,`pin`]){let n={...e};return t.forEach(e=>{e in n&&(n[e]=`[REDACTED]`)}),n}[`default-src 'self'`,`script-src 'self' 'unsafe-inline' 'unsafe-eval'`,`style-src 'self' 'unsafe-inline'`,`img-src 'self' data: https:`,`font-src 'self'`,`connect-src 'self' wss: ws:`,`frame-ancestors 'none'`,`base-uri 'self'`,`form-action 'self'`].join(`; `);function s(e,t){new Date().toISOString(),o(t)}function c(e){"@babel/helpers - typeof";return c=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},c(e)}function l(e,t){if(c(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(c(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function u(e){var t=l(e,`string`);return c(t)==`symbol`?t:t+``}function d(e,t,n){return(t=u(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}export{r as a,o as i,a as n,s as r,d as t};