@nocios/crudify-ui 4.4.96 → 4.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import{b as Wr,c as ae,h as qr,j as he,l as jr,m as Kr,p as $r}from"./chunk-AD5AA75O.mjs";import{g as Y}from"./chunk-BJ6PIVZR.mjs";import{a as C,b as Mr,c as Vr,h as Hr}from"./chunk-SUWV767V.mjs";var ge={es:{"checkCode.codeLabel":"C\xF3digo de Verificaci\xF3n","checkCode.codePlaceholder":"Ingresa el c\xF3digo de 6 d\xEDgitos","checkCode.codeRequired":"El c\xF3digo es obligatorio","checkCode.emailLabel":"Correo Electr\xF3nico","checkCode.emailPlaceholder":"Ingresa tu correo electr\xF3nico","checkCode.emailRequired":"El correo electr\xF3nico es obligatorio","checkCode.instructions":"Ingresa el c\xF3digo de 6 d\xEDgitos que enviamos a tu correo electr\xF3nico.","checkCode.invalidEmail":"Ingresa un correo electr\xF3nico v\xE1lido","checkCode.resendCodeLink":"Reenviar c\xF3digo","checkCode.title":"Verificar C\xF3digo","checkCode.verifyButton":"Verificar C\xF3digo","base.btn.back":"Volver","base.btn.cancel":"Cancelar","error.app.config":"Error de Configuraci\xF3n: {{message}}","error.app.initialization":"Error durante la inicializaci\xF3n final de la aplicaci\xF3n.","error.transaction":"Error en la operaci\xF3n","base.errors.errorUnknown":"Ocurri\xF3 un error desconocido.","errors.DUPLICATE":"El campo <b>{{field}}</b> debe ser \xFAnico.","errors.FOREIGN_KEY_NOT_FOUND":"El campo <b>{{field}}</b> debe referenciar un \xEDtem existente.","errors.INVALID_EMAIL":"El campo <b>{{field}}</b> debe ser un correo electr\xF3nico v\xE1lido.","errors.INVALID_OBJECT_ID":"El campo <b>{{field}}</b> debe ser un valor v\xE1lido.","errors.IN_USE":"El \xEDtem est\xE1 en uso y no puede ser eliminado.","errors.MAX_LENGTH":"El campo <b>{{field}}</b> no debe exceder los <b>{{length}}</b> caracteres.","errors.MIN_LENGTH":"El campo <b>{{field}}</b> debe tener al menos <b>{{length}}</b> caracteres.","errors.MUST_NOT_BE_EMAIL":"El campo <b>{{field}}</b> no debe ser un correo electr\xF3nico.","errors.NO_PERMISSION":"No tienes permiso para realizar esta acci\xF3n.","errors.NO_SPACES":"El campo <b>{{field}}</b> no debe contener espacios.","errors.ONE_OR_MORE_OPERATIONS_FAILED":"Error en la operaci\xF3n","errors.REQUIRED":"El campo <b>{{field}}</b> es obligatorio.","errors.TOKEN_HAS_EXPIRED":"La sesi\xF3n ha expirado. Por favor, inicia sesi\xF3n nuevamente.","errors.TOO_MANY_REQUESTS":"L\xEDmite de solicitudes alcanzado. Por favor intenta m\xE1s tarde.","errors.UNAUTHORIZED":"No est\xE1s autorizado para realizar esta acci\xF3n.","errors.all_password_fields_required":"Todos los campos de contrase\xF1a son obligatorios","errors.auth.INVALID_API_KEY":"Clave de API inv\xE1lida","errors.auth.INVALID_CREDENTIALS":"Usuario y/o contrase\xF1a incorrectos","errors.auth.NO_PERMISSION":"No tienes permisos suficientes","errors.auth.SESSION_EXPIRED":"Tu sesi\xF3n ha expirado. Por favor, inicia sesi\xF3n nuevamente.","errors.auth.TOO_MANY_REQUESTS":"Demasiados intentos. Por favor espera 15 minutos e intenta nuevamente","errors.auth.UNAUTHORIZED":"No tienes permisos para realizar esta acci\xF3n","errors.auth.USER_NOT_ACTIVE":"Usuario no activo","errors.auth.USER_NOT_FOUND":"Usuario no encontrado","errors.data.BAD_REQUEST":"Solicitud inv\xE1lida","errors.data.FIELD_ERROR":"Error en los datos ingresados","errors.data.IN_USE":"El elemento est\xE1 en uso y no puede ser eliminado","errors.data.ITEM_NOT_FOUND":"El elemento solicitado no fue encontrado","errors.data.NOT_FOUND":"No se encontr\xF3 lo solicitado","errors.internal_error_changing_password":"Error interno al cambiar la contrase\xF1a. Intenta nuevamente","errors.password_min_length":"La contrase\xF1a debe tener al menos 8 caracteres","errors.password_mismatch":"Las contrase\xF1as no coinciden","errors.password_must_be_different":"La nueva contrase\xF1a debe ser diferente a la actual","errors.system.DATABASE_CONNECTION_ERROR":"Error de conexi\xF3n. Verifica tu conexi\xF3n a internet.","errors.system.INTERNAL_SERVER_ERROR":"Error interno del servidor. Intenta nuevamente.","errors.system.INVALID_CONFIGURATION":"Error de configuraci\xF3n del sistema","errors.system.TOO_MANY_REQUESTS":"Demasiadas solicitudes. Por favor espera un momento e intenta nuevamente","errors.system.UNKNOWN_OPERATION":"Operaci\xF3n no reconocida","errors.users_module_not_configured":"M\xF3dulo de usuarios no configurado","footer.copyright":"Nocios S.R.L. Todos los derechos reservados.","footer.version":"Versi\xF3n","forgotPassword.checkEmailInstructions":"Revisa tu bandeja de entrada para el c\xF3digo de verificaci\xF3n","forgotPassword.codeAlreadyExistsMessage":"Ya se envi\xF3 un c\xF3digo y a\xFAn es v\xE1lido","forgotPassword.emailLabel":"Correo Electr\xF3nico","forgotPassword.emailPlaceholder":"Ingresa tu correo electr\xF3nico","forgotPassword.emailRequired":"El correo electr\xF3nico es obligatorio","forgotPassword.emailSentMessage":"C\xF3digo enviado exitosamente","forgotPassword.enterCodeLink":"Ingresar C\xF3digo","forgotPassword.instructions":"Ingresa tu correo electr\xF3nico y te enviaremos un c\xF3digo para restablecer tu contrase\xF1a.","forgotPassword.invalidEmail":"Ingresa un correo electr\xF3nico v\xE1lido","forgotPassword.sendCodeButton":"Enviar C\xF3digo","forgotPassword.title":"Recuperar Contrase\xF1a","base.loading.configInitial":"Cargando configuraci\xF3n inicial...","base.loading.pleaseWait":"Cargando, por favor espera...","base.loading.starting":"Iniciando aplicaci\xF3n...","base.loading.themeSetup":"Generando tema...","base.loading.validatingSession":"Validando sesi\xF3n...","login.alreadyHaveCodeLink":"\xBFYa tienes un c\xF3digo?","login.forgotPasswordLink":"\xBFOlvidaste tu contrase\xF1a?","login.initializationError":"Error de inicializaci\xF3n","login.initializing":"Inicializando...","login.loginButton":"Iniciar Sesi\xF3n","login.logoAlt":"Logotipo","login.noAccountPrompt":"\xBFNo tienes una cuenta?","login.notInitialized":"Sistema no inicializado","login.passwordLabel":"Contrase\xF1a","login.passwordPlaceholder":"Ingresa tu contrase\xF1a","login.passwordRequired":"Contrase\xF1a es obligatoria","login.signUpLink":"Reg\xEDstrate","login.usernameOrEmailLabel":"Correo Electr\xF3nico","login.usernameOrEmailPlaceholder":"Ingresa tu correo electr\xF3nico","login.usernameRequired":"Correo electr\xF3nico es obligatorio","resetPassword.codeExpiredOrInvalid":"El c\xF3digo ha expirado o es inv\xE1lido","resetPassword.confirmPasswordLabel":"Confirmar Contrase\xF1a","resetPassword.confirmPasswordPlaceholder":"Confirma tu nueva contrase\xF1a","resetPassword.confirmPasswordRequired":"Confirma tu contrase\xF1a","resetPassword.goToLoginButton":"Ir al Login","resetPassword.instructions":"Ingresa tu nueva contrase\xF1a.","resetPassword.invalidCode":"El c\xF3digo de verificaci\xF3n es inv\xE1lido. Por favor, verifica el enlace o solicita uno nuevo.","resetPassword.missingParameters":"Faltan par\xE1metros obligatorios","resetPassword.newPasswordLabel":"Nueva Contrase\xF1a","resetPassword.newPasswordPlaceholder":"Ingresa tu nueva contrase\xF1a","resetPassword.newPasswordRequired":"La nueva contrase\xF1a es obligatoria","resetPassword.passwordTooShort":"La contrase\xF1a debe tener al menos 8 caracteres","resetPassword.passwordsDoNotMatch":"Las contrase\xF1as no coinciden","resetPassword.requestNewCodeButton":"Solicitar Nuevo C\xF3digo","resetPassword.resetPasswordButton":"Restablecer Contrase\xF1a","resetPassword.successInstructions":"Ahora puedes iniciar sesi\xF3n con tu nueva contrase\xF1a","resetPassword.successMessage":"Contrase\xF1a restablecida exitosamente","resetPassword.title":"Nueva Contrase\xF1a","resetPassword.validatingCode":"Validando c\xF3digo...","publicPolicies.fields.conditions.customEdit":"Edici\xF3n personalizada","base.file.clickToPreview":"Clic para ver imagen","base.file.clickToDownload":"Clic para descargar","base.file.privateFile":"Archivo privado","base.file.noPreview":"Sin vista previa","base.file.dropHere":"Suelta el archivo aqu\xED","base.file.dragOrClick":"Arrastra archivos aqu\xED o haz clic para seleccionar","base.file.uploading":"Subiendo archivos...","base.file.restore":"Restaurar","base.file.delete":"Eliminar","base.file.pendingDeletion":"Pendiente de eliminaci\xF3n","base.file.allowedTypes":"Tipos permitidos: {{types}}","base.file.maxSize":"M\xE1ximo {{size}} por archivo","base.file.maxFiles":"M\xE1ximo {{count}} archivos","base.file.validation.minFilesRequired":"Se requiere al menos un archivo","base.file.validation.minFilesRequiredPlural":"Se requieren al menos {{count}} archivos","base.file.validation.maxFilesExceeded":"M\xE1ximo {{count}} archivos permitidos","base.file.validation.filesWithErrors":"Algunos archivos tienen errores","base.file.confirmDelete.title":"Eliminar archivo","base.file.confirmDelete.message":"\xBFEst\xE1s seguro de que deseas eliminar este archivo? Esta acci\xF3n no se puede deshacer.","base.file.confirmDelete.confirm":"Eliminar","base.file.confirmDelete.cancel":"Cancelar","base.file.deleting":"Eliminando..."},en:{"checkCode.codeLabel":"Verification Code","checkCode.codePlaceholder":"Enter 6-digit code","checkCode.codeRequired":"Code is required","checkCode.emailLabel":"Email Address","checkCode.emailPlaceholder":"Enter your email address","checkCode.emailRequired":"Email address is required","checkCode.instructions":"Enter the 6-digit code we sent to your email address.","checkCode.invalidEmail":"Enter a valid email address","checkCode.resendCodeLink":"Resend code","checkCode.title":"Verify Code","checkCode.verifyButton":"Verify Code","base.btn.back":"Back","base.btn.cancel":"Cancel","error.app.config":"Configuration Error: {{message}}","error.app.initialization":"Error during final application initialization.","error.transaction":"Operation error","base.errors.errorUnknown":"An unknown error occurred.","errors.DUPLICATE":"The field <b>{{field}}</b> must be unique.","errors.FOREIGN_KEY_NOT_FOUND":"The field <b>{{field}}</b> must reference an existing item.","errors.INVALID_EMAIL":"The field <b>{{field}}</b> must be a valid email address.","errors.INVALID_OBJECT_ID":"The field <b>{{field}}</b> must be a valid value.","errors.IN_USE":"The item is currently in use and cannot be deleted.","errors.MAX_LENGTH":"The field <b>{{field}}</b> must not exceed <b>{{maxLength}}</b> characters.","errors.MIN_LENGTH":"The field <b>{{field}}</b> must have at least <b>{{minLength}}</b> characters.","errors.MUST_NOT_BE_EMAIL":"The field <b>{{field}}</b> must not be an email address.","errors.NO_PERMISSION":"You do not have permission to perform this action.","errors.NO_SPACES":"The field <b>{{field}}</b> must not contain spaces.","errors.ONE_OR_MORE_OPERATIONS_FAILED":"Operation error","errors.REQUIRED":"The field <b>{{field}}</b> is required.","errors.TOKEN_HAS_EXPIRED":"Your session has expired, please log in again.","errors.TOO_MANY_REQUESTS":"Request limit reached. Please try again later.","errors.UNAUTHORIZED":"You are not authorized to perform this action.","errors.all_password_fields_required":"All password fields are required","errors.auth.INVALID_API_KEY":"Invalid API key","errors.auth.INVALID_CREDENTIALS":"Incorrect username and/or password","errors.auth.NO_PERMISSION":"Insufficient permissions","errors.auth.SESSION_EXPIRED":"Your session has expired. Please log in again.","errors.auth.TOO_MANY_REQUESTS":"Too many attempts. Please wait 15 minutes and try again","errors.auth.UNAUTHORIZED":"You don't have permission to perform this action","errors.auth.USER_NOT_ACTIVE":"User account is not active","errors.auth.USER_NOT_FOUND":"User not found","errors.data.BAD_REQUEST":"Invalid request","errors.data.FIELD_ERROR":"Error in the provided data","errors.data.IN_USE":"The item is in use and cannot be deleted","errors.data.ITEM_NOT_FOUND":"The requested item was not found","errors.data.NOT_FOUND":"The requested resource was not found","errors.internal_error_changing_password":"Internal error changing password. Please try again","errors.password_min_length":"Password must be at least 8 characters","errors.password_mismatch":"Passwords do not match","errors.password_must_be_different":"New password must be different from current password","errors.system.DATABASE_CONNECTION_ERROR":"Connection error. Please check your internet connection.","errors.system.INTERNAL_SERVER_ERROR":"Internal server error. Please try again.","errors.system.INVALID_CONFIGURATION":"System configuration error","errors.system.TOO_MANY_REQUESTS":"Too many requests. Please wait a moment and try again","errors.system.UNKNOWN_OPERATION":"Unrecognized operation","errors.users_module_not_configured":"Users module not configured","footer.copyright":"Nocios S.R.L. All Rights Reserved.","footer.version":"Version","forgotPassword.checkEmailInstructions":"Check your inbox for the verification code","forgotPassword.codeAlreadyExistsMessage":"A code was already sent and is still valid","forgotPassword.emailLabel":"Email Address","forgotPassword.emailPlaceholder":"Enter your email address","forgotPassword.emailRequired":"Email address is required","forgotPassword.emailSentMessage":"Code sent successfully","forgotPassword.enterCodeLink":"Enter Code","forgotPassword.instructions":"Enter your email address and we'll send you a code to reset your password.","forgotPassword.invalidEmail":"Enter a valid email address","forgotPassword.sendCodeButton":"Send Code","forgotPassword.title":"Reset Password","base.loading.configInitial":"Loading initial configuration...","base.loading.pleaseWait":"Loading, please wait...","base.loading.starting":"Starting application...","base.loading.themeSetup":"Generating theme...","base.loading.validatingSession":"Validating session...","login.alreadyHaveCodeLink":"Already have a code?","login.forgotPasswordLink":"Forgot Password?","login.initializationError":"Initialization error","login.initializing":"Initializing...","login.loginButton":"Log In","login.logoAlt":"Logo","login.noAccountPrompt":"Don't have an account?","login.notInitialized":"System not initialized","login.passwordLabel":"Password","login.passwordPlaceholder":"Enter your password","login.passwordRequired":"Password is required","login.signUpLink":"Sign up","login.usernameOrEmailLabel":"Username or Email","login.usernameOrEmailPlaceholder":"Enter your username or email","login.usernameRequired":"Username or email is required","resetPassword.codeExpiredOrInvalid":"Code expired or invalid","resetPassword.confirmPasswordLabel":"Confirm Password","resetPassword.confirmPasswordPlaceholder":"Confirm your new password","resetPassword.confirmPasswordRequired":"Confirm your password","resetPassword.goToLoginButton":"Go to Login","resetPassword.instructions":"Enter your new password.","resetPassword.invalidCode":"The verification code is invalid. Please check the link or request a new one.","resetPassword.missingParameters":"Missing required parameters","resetPassword.newPasswordLabel":"New Password","resetPassword.newPasswordPlaceholder":"Enter your new password","resetPassword.newPasswordRequired":"New password is required","resetPassword.passwordTooShort":"Password must be at least 8 characters","resetPassword.passwordsDoNotMatch":"Passwords do not match","resetPassword.requestNewCodeButton":"Request New Code","resetPassword.resetPasswordButton":"Reset Password","resetPassword.successInstructions":"You can now log in with your new password","resetPassword.successMessage":"Password reset successfully","resetPassword.title":"New Password","resetPassword.validatingCode":"Validating code...","publicPolicies.fields.conditions.customEdit":"Custom Edit","base.file.clickToPreview":"Click to preview","base.file.clickToDownload":"Click to download","base.file.privateFile":"Private file","base.file.noPreview":"No preview","base.file.dropHere":"Drop file here","base.file.dragOrClick":"Drag files here or click to select","base.file.uploading":"Uploading files...","base.file.restore":"Restore","base.file.delete":"Delete","base.file.pendingDeletion":"Pending deletion","base.file.allowedTypes":"Allowed types: {{types}}","base.file.maxSize":"Max {{size}} per file","base.file.maxFiles":"Max {{count}} files","base.file.validation.minFilesRequired":"At least one file is required","base.file.validation.minFilesRequiredPlural":"At least {{count}} files are required","base.file.validation.maxFilesExceeded":"Maximum {{count}} files allowed","base.file.validation.filesWithErrors":"Some files have errors","base.file.confirmDelete.title":"Delete file","base.file.confirmDelete.message":"Are you sure you want to delete this file? This action cannot be undone.","base.file.confirmDelete.confirm":"Delete","base.file.deleting":"Deleting...","base.file.confirmDelete.cancel":"Cancel"}},Xi=()=>Object.keys(ge),Ji=e=>ge[e]||ge.es;import je from"@nocios/crudify-browser";var Gr="crudify_translations_",tt=3600*1e3;function Yr(e){let r=0;for(let o=0;o<e.length;o++){let t=e.charCodeAt(o);r=(r<<5)-r+t,r=r&r}return Math.abs(r).toString(36)}var sr=class e{constructor(){this.enableDebug=!1;this.initializationPromise=null;this.isInitialized=!1}static getInstance(){return e.instance||(e.instance=new e),e.instance}setDebug(r){this.enableDebug=r}async ensureCrudifyInitialized(r,o){if(!this.isInitialized)return this.initializationPromise?(this.enableDebug&&C.debug("[TranslationService] Waiting for crudify initialization..."),this.initializationPromise):(this.enableDebug&&C.debug("[TranslationService] Initializing crudify SDK..."),this.initializationPromise=(async()=>{try{let t=je.getTokenData();if(t&&t.endpoint){this.enableDebug&&C.debug("[TranslationService] Crudify already initialized"),this.isInitialized=!0;return}je.config(o);let a=await je.init(r,this.enableDebug?"debug":"none");if(a.success===!1)throw new Error(`Failed to initialize crudify: ${JSON.stringify(a.errors||"Unknown error")}`);this.isInitialized=!0,this.enableDebug&&C.debug("[TranslationService] Crudify SDK initialized successfully")}catch(t){throw C.error("[TranslationService] Failed to initialize crudify",t instanceof Error?t:{message:String(t)}),this.initializationPromise=null,t}})(),this.initializationPromise)}async fetchTranslations(r){let{apiKey:o,featureKeys:t,crudifyEnv:a="stg",urlTranslations:i}=r;this.enableDebug&&C.debug("[TranslationService] fetchTranslations called with:",{apiKeyHash:Yr(o),crudifyEnv:a,featureKeys:t,hasUrlTranslations:!!i});let n=this.getFromCache(o),s=n?this.isCacheExpired(n):!0;if(n&&!s)return this.enableDebug&&C.debug("[TranslationService] Using cached translations"),this.mergeWithUrlTranslations(n.data.translations,i);try{await this.ensureCrudifyInitialized(o,a)}catch(c){return C.error("[TranslationService] Failed to initialize crudify",c instanceof Error?c:{message:String(c)}),n?(C.warn("[TranslationService] Using expired cache (init failed)"),this.mergeWithUrlTranslations(n.data.translations,i)):(C.warn("[TranslationService] Using critical bundle (init failed)"),this.getCriticalTranslationsOnly())}try{this.enableDebug&&C.debug("[TranslationService] Fetching from API via crudify SDK");let c=await this.fetchFromAPI(t);this.hasDataChanged(n,c)||!n?this.saveToCache(o,c):this.refreshCacheTimestamp(o);let u=this.mergeWithUrlTranslations(c.translations,i);return this.enableDebug&&C.debug("[TranslationService] Translations loaded:",{languages:Object.keys(u),keysCount:u[Object.keys(u)[0]]?Object.keys(u[Object.keys(u)[0]]).length:0}),u}catch(c){return C.error("[TranslationService] API fetch failed",c instanceof Error?c:{message:String(c)}),n?(C.warn("[TranslationService] Using expired cache as fallback"),this.mergeWithUrlTranslations(n.data.translations,i)):(C.warn("[TranslationService] Using critical bundle translations"),this.getCriticalTranslationsOnly())}}async fetchFromAPI(r){let o=await je.getTranslation(r);if(!o.success)throw new Error(`Crudify API error: ${o.errors?JSON.stringify(o.errors):"Unknown error"}`);if(!o.data)throw new Error("No translation data in response");return o.data}mergeWithUrlTranslations(r,o){if(!o||Object.keys(o).length===0)return r;let t={};return Object.keys(r).forEach(a=>{t[a]={...r[a],...o}}),t}hasDataChanged(r,o){if(!r||r.data.timestamp!==o.timestamp)return!0;let t=this.hashData(o.translations);return r.dataHash!==t}hashData(r){let o=JSON.stringify(r),t=0;for(let a=0;a<o.length;a++){let i=o.charCodeAt(a);t=(t<<5)-t+i,t=t&t}return t.toString(36)}saveToCache(r,o){try{let t=this.getCacheKey(r),a={data:o,cachedAt:Date.now(),dataHash:this.hashData(o.translations)};localStorage.setItem(t,JSON.stringify(a)),this.enableDebug&&C.debug("[TranslationService] Saved to cache:",{cacheKey:t})}catch(t){C.error("[TranslationService] Failed to save cache",t instanceof Error?t:{message:String(t)})}}getFromCache(r){try{let o=this.getCacheKey(r),t=localStorage.getItem(o);return t?JSON.parse(t):null}catch(o){return C.error("[TranslationService] Failed to read cache",o instanceof Error?o:{message:String(o)}),null}}refreshCacheTimestamp(r){try{let o=this.getFromCache(r);if(o){o.cachedAt=Date.now();let t=this.getCacheKey(r);localStorage.setItem(t,JSON.stringify(o))}}catch(o){C.error("[TranslationService] Failed to refresh cache timestamp",o instanceof Error?o:{message:String(o)})}}isCacheExpired(r){return Date.now()-r.cachedAt>tt}hasValidCache(r){let o=this.getFromCache(r);return o?!this.isCacheExpired(o):!1}getCacheKey(r){return`${Gr}${Yr(r)}`}getCriticalTranslationsOnly(){return ge}invalidateCache(r){let o=this.getCacheKey(r);localStorage.removeItem(o),this.enableDebug&&C.debug("[TranslationService] Cache invalidated:",{cacheKey:o})}async prefetchTranslations(r){try{await this.fetchTranslations(r),this.enableDebug&&C.debug("[TranslationService] Prefetch completed")}catch(o){C.error("[TranslationService] Prefetch failed",o instanceof Error?o:{message:String(o)})}}clearAllCaches(){try{let o=Object.keys(localStorage).filter(t=>t.startsWith(Gr));o.forEach(t=>localStorage.removeItem(t)),this.enableDebug&&C.debug(`[TranslationService] Cleared ${o.length} cache entries`)}catch(r){C.error("[TranslationService] Failed to clear caches",r instanceof Error?r:{message:String(r)})}}},Ke=sr.getInstance();import{createContext as nt,useContext as it,useEffect as Qr,useState as Ie,useMemo as Xr,useCallback as at}from"react";import{Fragment as lt,jsx as Ge}from"react/jsx-runtime";var $e=null,lr=!1,Zr=nt(null);function Jr(e,r,o){return{...e,...r,...o||{}}}function st(e,r,o,t,a){Qr(()=>{if(!t||!e||!r)return;let i=o||typeof window<"u"&&window.i18next||typeof window<"u"&&window.i18n;if(!i||!i.addResourceBundle){a&&C.debug("[TranslationsProvider] i18next not found, skipping auto-sync");return}a&&C.debug("[TranslationsProvider] Auto-syncing translations with i18next",{languages:Object.keys(e),currentLanguage:r}),Object.keys(e).forEach(n=>{e[n]&&Object.keys(e[n]).length>0&&(i.addResourceBundle(n,"translation",e[n],!0,!0),a&&C.debug(`[TranslationsProvider] Synced ${Object.keys(e[n]).length} keys for language: ${n}`))}),i.language!==r&&(i.changeLanguage(r),a&&C.debug(`[TranslationsProvider] Changed i18next language to: ${r}`))},[e,r,o,t,a])}var ca=({children:e,apiKey:r,crudifyEnv:o="prod",featureKeys:t,language:a="es",devTranslations:i,translationUrl:n,enableDebug:s=!1,skipAutoInit:c=!0,autoSyncI18n:y=!0,i18nInstance:u,loadingFallback:b,waitForInitialLoad:f=!0})=>{let l=Xr(()=>Vr({publicApiKey:r,env:o,featureKeys:t,enableDebug:s}),[r,o,t,s]),d=l.publicApiKey||"",w=l.env||o||"prod",g=l.featureKeys||t,[p,m]=Ie({}),[P,I]=Ie(!0),[M,x]=Ie(!0),[h,R]=Ie(null),[L,_]=Ie(void 0),[re,oe]=Ie(!1),de=at(async()=>{if(!d){s&&C.debug("[TranslationsProvider] No apiKey - skipping translation fetch"),I(!1),x(!1);return}if(re){s&&C.debug("[TranslationsProvider] Skipping reload - using fallback translations");return}if(Ke.hasValidCache(d)&&M&&(s&&C.debug("[TranslationsProvider] Valid cache found - not blocking initial render"),x(!1)),lr&&$e){s&&C.debug("[TranslationsProvider] Fetch already in progress, waiting for existing promise");try{let S=await $e;m(S),I(!1);return}catch{s&&C.warn("[TranslationsProvider] Global fetch failed, retrying")}}lr=!0,I(!0),R(null);let N;if(n)try{s&&C.debug(`[TranslationsProvider] Fetching translations from URL: ${n}`);let S=await fetch(n);if(!S.ok)throw new Error(`Failed to fetch translations: ${S.statusText}`);N=await S.json(),_(N),s&&C.debug("[TranslationsProvider] URL translations loaded:",{keysCount:N?Object.keys(N).length:0})}catch(S){C.error("[TranslationsProvider] Failed to load URL translations",S instanceof Error?S:{message:String(S)}),N=void 0,_(void 0)}let ue=(async()=>{try{Ke.setDebug(s);let S=await Ke.fetchTranslations({apiKey:d,crudifyEnv:w,featureKeys:g,urlTranslations:N}),W={};return Object.keys(S).forEach(v=>{let k=ge[v]||{},F=S[v]||{};W[v]=Jr(k,F,i)}),s&&C.debug("[TranslationsProvider] Loaded translations:",{languages:Object.keys(W),keysCount:Object.keys(W[a]||{}).length}),W}catch(S){C.error("[TranslationsProvider] Failed to load",S instanceof Error?S:{message:String(S)}),R(S instanceof Error?S.message:String(S)),oe(!0);let W={};return Object.keys(ge).forEach(v=>{let k=ge[v],F=N||L||{};W[v]=Jr(k,F,i)}),s&&C.debug("[TranslationsProvider] Using fallback translations (critical + URL)"),W}})();$e=ue;try{let S=await ue;m(S)}finally{I(!1),x(!1),lr=!1,setTimeout(()=>{$e=null},1e3)}},[d,w,g,n,i,s,a,re]);Qr(()=>{de();let j=setInterval(de,3600*1e3);return()=>clearInterval(j)},[de]);let Re=Xr(()=>(j,N)=>{let S=(p[a]||{})[j];if(!S){let W=Object.keys(p);for(let v of W)if(p[v][j]){S=p[v][j];break}}return S||(s&&C.warn(`[TranslationsProvider] Missing translation: "${j}"`),S=j),N&&typeof S=="string"&&Object.entries(N).forEach(([W,v])=>{let k=new RegExp(`{{${W}}}`,"g");S=S.replace(k,String(v))}),S},[p,a,s]);st(p,a,u,y,s);let D={t:Re,language:a,availableLanguages:Object.keys(p),translations:p,isLoading:P,error:h,refreshTranslations:de};return d?f&&M&&P?b||Ge("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:Ge("div",{children:"Loading translations..."})}):Ge(Zr.Provider,{value:D,children:e}):(s&&C.warn("[TranslationsProvider] No API key available. Skipping translations. Provide apiKey via props or ensure cookies are set by Lambda."),Ge(lt,{children:e}))},_e=()=>{let e=it(Zr);if(!e)throw new Error("useTranslations must be used within TranslationsProvider");return e};import{Box as $t,Typography as Gt}from"@mui/material";import{createContext as dt,useContext as ut,useMemo as dr}from"react";import{useState as cr,useEffect as ct}from"react";var eo=(e,r)=>{let[o,t]=cr({}),[a,i]=cr(!1),[n,s]=cr(null);return ct(()=>{if(r&&Object.keys(r).length>0){t(r),i(!1),s(null);return}if(!e){t({}),i(!1),s(null);return}let c=!1;return i(!0),s(null),fetch(e).then(y=>{if(!y.ok)throw new Error(`Failed to load translations: ${y.status}`);return y.json()}).then(y=>{c||(t(y),i(!1))}).catch(y=>{c||(C.error("[I18nProvider] Failed to load translations from URL",y instanceof Error?y:{message:String(y),url:e}),s(y instanceof Error?y.message:String(y)),t({}),i(!1))}),()=>{c=!0}},[e,r]),{translations:o,loading:a,error:n}};import{jsx as ro}from"react/jsx-runtime";var oo=dt(null),gt=()=>{try{return _e()}catch{return null}},pt=(e,r)=>{if(r.includes(".")){let o=r.split(".").reduce((t,a)=>t&&typeof t=="object"?t[a]:void 0,e);if(o!==void 0)return o}if(e&&e[r])return e[r]},to=({children:e,translations:r,translationsUrl:o,language:t="en"})=>{let i=gt()?.translations?.[t]||{},{translations:n,loading:s}=eo(o,r),c=dr(()=>({...i,...n,...r||{}}),[i,n,r]),y=dr(()=>(b,f)=>{let l=pt(c,b);return l==null&&(l=b),f&&typeof l=="string"&&Object.entries(f).forEach(([d,w])=>{l=l.replace(new RegExp(`{{${d}}}`,"g"),w)}),typeof l=="string"?l:b},[c]),u=dr(()=>({t:y,language:t}),[y,t]);return s?ro("div",{children:"Loading translations..."}):ro(oo.Provider,{value:u,children:e})},Z=()=>{let e=ut(oo);if(!e)throw new Error("useTranslation must be used within I18nProvider");return e};import{createContext as ft,useContext as mt,useReducer as ht,useEffect as no}from"react";import{jsx as bt}from"react/jsx-runtime";var io={currentScreen:"login",searchParams:{},formData:{username:"",password:"",email:"",code:"",newPassword:"",confirmPassword:""},loading:!1,errors:{global:[]},emailSent:!1,codeAlreadyExists:!1,codeValidated:!1,fromCodeVerification:!1,config:{}};function yt(e,r){switch(r.type){case"SET_SCREEN":let o={...e,currentScreen:r.payload.screen,searchParams:r.payload.params||e.searchParams,errors:{global:[]}},t=new URLSearchParams(o.searchParams),a=t.toString()?`?${t.toString()}`:window.location.pathname;try{window.history.replaceState({},"",a)}catch{}return o;case"SET_SEARCH_PARAMS":return{...e,searchParams:r.payload};case"UPDATE_FORM_DATA":return{...e,formData:{...e.formData,...r.payload},errors:{...e.errors,...Object.keys(r.payload).reduce((i,n)=>({...i,[n]:void 0}),{})}};case"SET_LOADING":return{...e,loading:r.payload};case"SET_ERRORS":return{...e,errors:{...e.errors,...r.payload}};case"CLEAR_ERRORS":return{...e,errors:{global:[]}};case"SET_EMAIL_SENT":return{...e,emailSent:r.payload};case"SET_CODE_ALREADY_EXISTS":return{...e,codeAlreadyExists:r.payload};case"SET_CODE_VALIDATED":return{...e,codeValidated:r.payload};case"SET_FROM_CODE_VERIFICATION":return{...e,fromCodeVerification:r.payload};case"RESET_FORM":return{...e,formData:io.formData,errors:{global:[]},loading:!1,emailSent:!1,codeAlreadyExists:!1,codeValidated:!1,fromCodeVerification:!1};case"INIT_CONFIG":return{...e,config:r.payload};default:return e}}var ao=ft(void 0),so=({children:e,initialScreen:r="login",config:o,autoReadFromCookies:t=!0})=>{let[a,i]=ht(yt,{...io,currentScreen:r});no(()=>{i({type:"INIT_CONFIG",payload:(()=>{let l={};if(t)try{let d=Mr("logo");if(d){let w=decodeURIComponent(d);w.startsWith("http")&&(l.logo=w)}}catch(d){C.error("Error reading configuration from cookies",d instanceof Error?d:{message:String(d)})}return{publicApiKey:o?.publicApiKey,env:o?.env,appName:o?.appName,logo:o?.logo||l.logo,loginActions:o?.loginActions}})()})},[o,t]),no(()=>{let f=new URLSearchParams(window.location.search),l={};f.forEach((d,w)=>{l[w]=d}),Object.keys(l).length>0&&i({type:"SET_SEARCH_PARAMS",payload:l}),r==="checkCode"&&l.email&&i({type:"UPDATE_FORM_DATA",payload:{email:l.email,code:l.code||""}}),r==="resetPassword"&&l.link&&i({type:"SET_SEARCH_PARAMS",payload:l})},[r]);let b={state:a,dispatch:i,setScreen:(f,l)=>{i({type:"SET_SCREEN",payload:{screen:f,params:l}})},updateFormData:f=>{i({type:"UPDATE_FORM_DATA",payload:f})},setFieldError:(f,l)=>{i({type:"SET_ERRORS",payload:{[f]:l}})},clearErrors:()=>{i({type:"CLEAR_ERRORS"})},setLoading:f=>{i({type:"SET_LOADING",payload:f})}};return bt(ao.Provider,{value:b,children:e})},Ye=()=>{let e=mt(ao);if(e===void 0)throw new Error("useLoginState must be used within a LoginStateProvider");return e};import{useEffect as wt,useRef as xt}from"react";import{Typography as ur,TextField as lo,Button as Ct,Box as Oe,CircularProgress as vt,Alert as Pt,Link as co}from"@mui/material";import{Fragment as Et,jsx as ee,jsxs as Be}from"react/jsx-runtime";var Tt=({onScreenChange:e,onExternalNavigate:r,onLoginSuccess:o,onError:t,redirectUrl:a="/"})=>{let{crudify:i}=ae(),{state:n,updateFormData:s,setFieldError:c,clearErrors:y,setLoading:u}=Ye(),{login:b}=he(),f=Z(),{t:l}=f,d=f.i18n,w=xt(null),g=Hr(l,{currentLanguage:d?.language,enableDebug:!1}),p=()=>{if(n.searchParams.redirect)try{let h=decodeURIComponent(n.searchParams.redirect);if(h.startsWith("/")&&!h.startsWith("//"))return h}catch{}return a||"/"};wt(()=>{let h=setTimeout(()=>{w.current&&w.current.focus()},100);return()=>clearTimeout(h)},[]);let m=h=>g.translateError({code:h.code,message:h.message,field:h.field}),P=async()=>{if(!n.loading){if(!n.formData.username.trim()){c("username",l("login.usernameRequired"));return}if(!n.formData.password.trim()){c("password",l("login.passwordRequired"));return}y(),u(!0);try{let h=await b(n.formData.username,n.formData.password);if(u(!1),h.success){let R=p();o&&o(h.data,R)}else{let R=h.rawResponse||h;I(R)}}catch(h){u(!1);let L=Y(h).map(m);c("global",L),t&&t(L.join(", "))}}},I=h=>{let R=Y(h),L=[];R.forEach(_=>{_.field?c(_.field,m(_)):L.push(m(_))}),L.length>0&&c("global",L)};return Be(Et,{children:[Be(Oe,{component:"form",noValidate:!0,onSubmit:h=>{h.preventDefault(),P()},onKeyDown:h=>{h.key==="Enter"&&!n.loading&&(h.preventDefault(),P())},sx:{width:"100%",display:"flex",flexDirection:"column",gap:2},children:[Be(Oe,{sx:{mb:1},children:[ee(ur,{variant:"body2",component:"label",htmlFor:"email",sx:{display:"block",fontWeight:500,color:"grey.700",mb:.5},children:l("login.usernameOrEmailLabel")}),ee(lo,{fullWidth:!0,id:"email",name:"email",type:"email",value:n.formData.username,disabled:n.loading,onChange:h=>s({username:h.target.value}),error:!!n.errors.username,helperText:n.errors.username,autoComplete:"email",placeholder:l("login.usernameOrEmailPlaceholder"),inputRef:w,required:!0})]}),Be(Oe,{sx:{mb:1},children:[ee(ur,{variant:"body2",component:"label",htmlFor:"password",sx:{display:"block",fontWeight:500,color:"grey.700",mb:.5},children:l("login.passwordLabel")}),ee(lo,{fullWidth:!0,id:"password",name:"password",type:"password",value:n.formData.password,disabled:n.loading,onChange:h=>s({password:h.target.value}),error:!!n.errors.password,helperText:n.errors.password,autoComplete:"current-password",placeholder:l("login.passwordPlaceholder"),required:!0})]}),n.config.loginActions?.includes("forgotPassword")&&ee(Oe,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center"},children:ee(co,{sx:{cursor:"pointer"},onClick:()=>{e?.("forgotPassword",n.searchParams)},variant:"body2",color:"secondary",children:l("login.forgotPasswordLink")})}),ee(Ct,{disabled:n.loading,type:"submit",fullWidth:!0,variant:"contained",color:"primary",sx:{mt:1,mb:2},children:n.loading?ee(vt,{size:20}):l("login.loginButton")})]}),ee(Oe,{children:n.errors.global&&n.errors.global.length>0&&n.errors.global.map((h,R)=>ee(Pt,{variant:"filled",sx:{mt:2},severity:"error",children:ee("div",{children:h})},R))}),n.config.loginActions?.includes("createUser")&&Be(ur,{variant:"body2",align:"center",sx:{color:"text.secondary",mt:3},children:[l("login.noAccountPrompt")," ",ee(co,{sx:{cursor:"pointer"},onClick:()=>{let R=`/public/users/create${Object.keys(n.searchParams).length>0?`?${new URLSearchParams(n.searchParams).toString()}`:""}`;r?.(R)},fontWeight:"medium",color:"secondary",children:l("login.signUpLink")})]})]})},uo=Tt;import{useState as ke,useEffect as Rt,useRef as St}from"react";import{Typography as Le,TextField as It,Button as go,Box as ye,CircularProgress as kt,Alert as Lt,Link as gr}from"@mui/material";import{Fragment as po,jsx as V,jsxs as Pe}from"react/jsx-runtime";var At=({onScreenChange:e,onError:r})=>{let{crudify:o}=ae(),[t,a]=ke(""),[i,n]=ke(!1),[s,c]=ke([]),[y,u]=ke(null),[b,f]=ke(!1),[l,d]=ke(!1),w=St(null),{t:g}=Z();Rt(()=>{w.current&&!b&&!l&&w.current.focus()},[b,l]);let p=h=>{let R=[`errors.auth.${h.code}`,`errors.data.${h.code}`,`errors.system.${h.code}`,`errors.${h.code}`,`forgotPassword.${h.code.toLowerCase()}`];for(let L of R){let _=g(L);if(_!==L)return _}return h.message||g("base.errors.errorUnknown")},m=h=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(h),P=async()=>{if(!(i||!o)){if(c([]),u(null),!t){u(g("forgotPassword.emailRequired"));return}if(!m(t)){u(g("forgotPassword.invalidEmail"));return}n(!0);try{let h=[{operation:"requestPasswordReset",data:{email:t}}],R=await o.transaction(h);if(R.success)R.data&&R.data.existingCodeValid?d(!0):f(!0);else{let _=Y(R).map(p);c(_)}}catch(h){let L=Y(h).map(p);c(L),r&&r(L.join(", "))}finally{n(!1)}}},I=()=>{e?.("login")},M=()=>{if(b||l){e?.("checkCode",{email:t});return}if(!t){u(g("forgotPassword.emailRequired"));return}if(!m(t)){u(g("forgotPassword.invalidEmail"));return}e?.("checkCode",{email:t})};return b||l?V(po,{children:Pe(ye,{sx:{width:"100%",display:"flex",flexDirection:"column",gap:2,textAlign:"center"},children:[Pe(ye,{sx:{mb:2},children:[V(Le,{variant:"h5",component:"h1",sx:{mb:1,fontWeight:600},children:g(l?"forgotPassword.codeAlreadyExistsMessage":"forgotPassword.emailSentMessage")}),V(Le,{variant:"body2",sx:{color:l?"success.main":"grey.600"},children:g("forgotPassword.checkEmailInstructions")})]}),V(go,{type:"button",onClick:M,fullWidth:!0,variant:"contained",color:"primary",sx:{mt:2,mb:2},children:g("forgotPassword.enterCodeLink")}),V(ye,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:V(gr,{sx:{cursor:"pointer"},onClick:I,variant:"body2",color:"secondary",children:g("base.btn.back")})})]})}):Pe(po,{children:[Pe(ye,{component:"form",noValidate:!0,onSubmit:h=>{h.preventDefault(),P()},sx:{width:"100%",display:"flex",flexDirection:"column",gap:2},children:[Pe(ye,{sx:{mb:2},children:[V(Le,{variant:"h5",component:"h1",sx:{mb:1,fontWeight:600},children:g("forgotPassword.title")}),V(Le,{variant:"body2",sx:{color:"grey.600"},children:g("forgotPassword.instructions")})]}),Pe(ye,{sx:{mb:1},children:[V(Le,{variant:"body2",component:"label",htmlFor:"email",sx:{display:"block",fontWeight:500,color:"grey.700",mb:.5},children:g("forgotPassword.emailLabel")}),V(It,{fullWidth:!0,id:"email",name:"email",type:"email",value:t,disabled:i,onChange:h=>a(h.target.value),error:!!y,helperText:y,autoComplete:"email",placeholder:g("forgotPassword.emailPlaceholder"),required:!0,autoFocus:!0,inputRef:w})]}),V(go,{disabled:i,type:"submit",fullWidth:!0,variant:"contained",color:"primary",sx:{mt:2,mb:2},children:i?V(kt,{size:20}):g("forgotPassword.sendCodeButton")}),Pe(ye,{sx:{display:"flex",justifyContent:"center",alignItems:"center",gap:2},children:[V(gr,{sx:{cursor:"pointer"},onClick:I,variant:"body2",color:"secondary",children:g("base.btn.back")}),V(Le,{variant:"body2",sx:{color:"grey.400"},children:"\u2022"}),V(gr,{sx:{cursor:"pointer"},onClick:M,variant:"body2",color:"secondary",children:g("login.alreadyHaveCodeLink")})]})]}),V(ye,{children:s.length>0&&s.map((h,R)=>V(Lt,{variant:"filled",sx:{mt:2},severity:"error",children:h},R))})]})},fo=At;import{useState as J,useEffect as mo}from"react";import{Typography as Xe,TextField as ho,Button as Ft,Box as be,CircularProgress as yo,Alert as bo,Link as Dt}from"@mui/material";import{Fragment as Ot,jsx as q,jsxs as Ne}from"react/jsx-runtime";var _t=({onScreenChange:e,onError:r,searchParams:o,onResetSuccess:t})=>{let{crudify:a}=ae(),[i,n]=J(""),[s,c]=J(""),[y,u]=J(!1),[b,f]=J([]),[l,d]=J(null),[w,g]=J(null),[p,m]=J(""),[P,I]=J(""),[M,x]=J(!1),[h,R]=J(!0),[L,_]=J(!1),[re,oe]=J(null),[de,Re]=J(!1),{t:D}=Z(),j=v=>{let k=[`errors.auth.${v.code}`,`errors.data.${v.code}`,`errors.system.${v.code}`,`errors.${v.code}`,`resetPassword.${v.code.toLowerCase()}`];for(let F of k){let H=D(F);if(H!==F)return H}return v.message||D("base.errors.errorUnknown")},N=v=>o?o instanceof URLSearchParams?o.get(v):o[v]||null:null;mo(()=>{if(o){if(o){let v=N("fromCodeVerification"),k=N("email"),F=N("code");if(v==="true"&&k&&F){m(k),I(F),x(!0),_(!0),R(!1);return}let H=N("link");if(H)try{let G=decodeURIComponent(H),[X,me]=G.split("/");if(X&&me&&X.length===6){I(X),m(me),x(!1),oe({email:me,code:X});return}}catch{}if(k&&F){m(k),I(F),x(!1),oe({email:k,code:F});return}}f([D("resetPassword.invalidCode")]),R(!1),setTimeout(()=>e?.("forgotPassword"),3e3)}},[o,a,D,e]),mo(()=>{a&&re&&!de&&(Re(!0),(async(k,F)=>{try{let H=[{operation:"validatePasswordResetCode",data:{email:k,codePassword:F}}],G=await a.transaction(H);if(G.data&&Array.isArray(G.data)){let X=G.data[0];if(X&&X.response&&X.response.status==="OK"){_(!0);return}}if(G.success)_(!0);else{let me=Y(G).map(j);f(me),setTimeout(()=>e?.("forgotPassword"),3e3)}}catch(H){let X=Y(H).map(j);f(X),setTimeout(()=>e?.("forgotPassword"),3e3)}finally{R(!1),oe(null),Re(!1)}})(re.email,re.code))},[a,re,D,e]);let ue=v=>v.length<8?D("resetPassword.passwordTooShort"):null,S=async()=>{if(y||!a)return;f([]),d(null),g(null);let v=!1;if(!i)d(D("resetPassword.newPasswordRequired")),v=!0;else{let k=ue(i);k&&(d(k),v=!0)}if(s?i!==s&&(g(D("resetPassword.passwordsDoNotMatch")),v=!0):(g(D("resetPassword.confirmPasswordRequired")),v=!0),!v){u(!0);try{let k=[{operation:"validateAndResetPassword",data:{email:p,codePassword:P,newPassword:i}}],F=await a.transaction(k);if(F.success)f([]),setTimeout(()=>{t?.()},1e3);else{let G=Y(F).map(j);f(G)}}catch(k){let H=Y(k).map(j);f(H),r&&r(H.join(", "))}u(!1)}},W=()=>{M?e?.("checkCode",{email:p}):e?.("forgotPassword")};return h?q(be,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"300px"},children:q(yo,{})}):L?Ne(Ot,{children:[Ne(be,{component:"form",noValidate:!0,sx:{width:"100%",display:"flex",flexDirection:"column",gap:2},children:[Ne(be,{sx:{mb:2},children:[q(Xe,{variant:"h5",component:"h1",sx:{mb:1,fontWeight:600},children:D("resetPassword.title")}),q(Xe,{variant:"body2",sx:{color:"grey.600"},children:D("resetPassword.instructions")})]}),Ne(be,{sx:{mb:1},children:[q(Xe,{variant:"body2",component:"label",htmlFor:"newPassword",sx:{display:"block",fontWeight:500,color:"grey.700",mb:.5},children:D("resetPassword.newPasswordLabel")}),q(ho,{fullWidth:!0,id:"newPassword",name:"newPassword",type:"password",value:i,disabled:y,onChange:v=>n(v.target.value),error:!!l,helperText:l,autoComplete:"new-password",placeholder:D("resetPassword.newPasswordPlaceholder"),required:!0})]}),Ne(be,{sx:{mb:1},children:[q(Xe,{variant:"body2",component:"label",htmlFor:"confirmPassword",sx:{display:"block",fontWeight:500,color:"grey.700",mb:.5},children:D("resetPassword.confirmPasswordLabel")}),q(ho,{fullWidth:!0,id:"confirmPassword",name:"confirmPassword",type:"password",value:s,disabled:y,onChange:v=>c(v.target.value),error:!!w,helperText:w,autoComplete:"new-password",placeholder:D("resetPassword.confirmPasswordPlaceholder"),required:!0})]}),q(Ft,{disabled:y,type:"button",onClick:S,fullWidth:!0,variant:"contained",color:"primary",sx:{mt:2,mb:2},children:y?q(yo,{size:20}):D("resetPassword.resetPasswordButton")}),q(be,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:q(Dt,{sx:{cursor:"pointer"},onClick:W,variant:"body2",color:"secondary",children:D("base.btn.back")})})]}),q(be,{children:b.length>0&&b.map((v,k)=>q(bo,{variant:"filled",sx:{mt:2},severity:"error",children:v},k))})]}):q(be,{children:b.length>0&&b.map((v,k)=>q(bo,{variant:"filled",sx:{mt:2},severity:"error",children:v},k))})},wo=_t;import{useState as ze,useEffect as xo,useRef as Bt}from"react";import{Typography as pr,TextField as Nt,Button as zt,Box as Ue,CircularProgress as Ut,Alert as Mt,Link as Vt}from"@mui/material";import{Fragment as Ht,jsx as se,jsxs as Je}from"react/jsx-runtime";var Wt=({onScreenChange:e,onError:r,searchParams:o})=>{let{crudify:t}=ae(),[a,i]=ze(""),[n,s]=ze(!1),[c,y]=ze([]),[u,b]=ze(null),[f,l]=ze(""),d=Bt(null),{t:w}=Z(),g=x=>o?o instanceof URLSearchParams?o.get(x):o[x]||null:null,p=x=>{let h=[`errors.auth.${x.code}`,`errors.data.${x.code}`,`errors.system.${x.code}`,`errors.${x.code}`,`checkCode.${x.code.toLowerCase()}`];for(let R of h){let L=w(R);if(L!==R)return L}return x.message||w("base.errors.errorUnknown")};xo(()=>{let x=g("email");x?l(x):e?.("forgotPassword")},[o,e]),xo(()=>{d.current&&d.current.focus()},[]);let m=async()=>{if(!(n||!t)){if(y([]),b(null),!a){b(w("checkCode.codeRequired"));return}if(a.length!==6){b(w("checkCode.codeRequired"));return}s(!0);try{let x=[{operation:"validatePasswordResetCode",data:{email:f,codePassword:a}}],h=await t.transaction(x);if(h.success)e?.("resetPassword",{email:f,code:a,fromCodeVerification:"true"});else{let L=Y(h).map(p);y(L),s(!1)}}catch(x){let R=Y(x).map(p);y(R),s(!1),r&&r(R.join(", "))}}},P=()=>{e?.("forgotPassword")},I=x=>{let h=x.target.value.replace(/\D/g,"").slice(0,6);i(h)};return Je(Ht,{children:[Je(Ue,{component:"form",noValidate:!0,onSubmit:x=>{x.preventDefault(),m()},sx:{width:"100%",display:"flex",flexDirection:"column",gap:2},children:[Je(Ue,{sx:{mb:2},children:[se(pr,{variant:"h5",component:"h1",sx:{mb:1,fontWeight:600},children:w("checkCode.title")}),se(pr,{variant:"body2",sx:{color:"grey.600"},children:w("checkCode.instructions")})]}),Je(Ue,{sx:{mb:1},children:[se(pr,{variant:"body2",component:"label",htmlFor:"code",sx:{display:"block",fontWeight:500,color:"grey.700",mb:.5},children:w("checkCode.codeLabel")}),se(Nt,{fullWidth:!0,id:"code",name:"code",type:"text",value:a,disabled:n,onChange:I,error:!!u,helperText:u,placeholder:w("checkCode.codePlaceholder"),inputProps:{maxLength:6,style:{textAlign:"center",fontSize:"1.5rem",letterSpacing:"0.4rem"}},required:!0,autoFocus:!0,inputRef:d})]}),se(zt,{disabled:n||a.length!==6,type:"submit",fullWidth:!0,variant:"contained",color:"primary",sx:{mt:2,mb:2},children:n?se(Ut,{size:20}):w("checkCode.verifyButton")}),se(Ue,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:se(Vt,{sx:{cursor:"pointer"},onClick:P,variant:"body2",color:"secondary",children:w("base.btn.back")})})]}),se(Ue,{children:c.length>0&&c.map((x,h)=>se(Mt,{sx:{mt:2},severity:"error",children:x},h))})]})},Co=Wt;import{Box as qt,CircularProgress as jt,Alert as vo,Typography as fr}from"@mui/material";import{Fragment as Kt,jsx as Ae,jsxs as Po}from"react/jsx-runtime";var To=({children:e,fallback:r})=>{let{isLoading:o,error:t,isInitialized:a}=ae(),{t:i}=Z();return o?r||Po(qt,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"200px",gap:2},children:[Ae(jt,{}),Ae(fr,{variant:"body2",color:"text.secondary",children:i("login.initializing")!=="login.initializing"?i("login.initializing"):"Initializing..."})]}):t?Ae(vo,{severity:"error",sx:{mt:2},children:Po(fr,{variant:"body2",children:[i("login.initializationError")!=="login.initializationError"?i("login.initializationError"):"Initialization error",":"," ",t]})}):a?Ae(Kt,{children:e}):Ae(vo,{severity:"warning",sx:{mt:2},children:Ae(fr,{variant:"body2",children:i("login.notInitialized")!=="login.notInitialized"?i("login.notInitialized"):"System not initialized"})})};import{jsx as te,jsxs as Jt}from"react/jsx-runtime";var Yt=({onScreenChange:e,onExternalNavigate:r,onLoginSuccess:o,onError:t,redirectUrl:a="/"})=>{let{t:i}=Z(),{state:n,setScreen:s}=Ye(),{config:c}=he(),{showNotification:y}=qr(),u=(f,l)=>{let d=l;f==="login"?d={}:f==="forgotPassword"&&!l&&(d={}),s(f,d),e?.(f,d)},b=()=>{let f={onScreenChange:u,onExternalNavigate:r,onError:t,redirectUrl:a};switch(n.currentScreen){case"forgotPassword":return te(fo,{...f});case"checkCode":return te(Co,{...f,searchParams:n.searchParams});case"resetPassword":return te(wo,{...f,searchParams:n.searchParams,onResetSuccess:()=>{let l=i("resetPassword.successMessage");y(l,"success"),u("login")}});default:return te(uo,{...f,onLoginSuccess:o})}};return Jt(To,{children:[te($t,{sx:{display:"flex",justifyContent:"center",mb:3},children:te("img",{src:c.logo||"https://logos.crudia.com/nocios-default.png",alt:i("login.logoAlt"),style:{width:"100%",maxWidth:"150px",height:"auto"},onError:f=>{let l=f.target;l.src="https://logos.crudia.com/nocios-default.png"}})}),!c.logo&&c.appName&&te(Gt,{variant:"h6",component:"h1",sx:{textAlign:"center",mb:2},children:c.appName}),b()]})},Xt=({translations:e,translationsUrl:r,language:o="en",initialScreen:t="login",autoReadFromCookies:a=!0,...i})=>{let{config:n}=he();return te(to,{translations:e,translationsUrl:r,language:o,children:te(Wr,{config:n,children:te(so,{config:n,initialScreen:t,autoReadFromCookies:a,children:te(Yt,{...i})})})})},xs=Xt;import{Box as Q,Card as Eo,CardContent as Ro,Typography as ne,Chip as Qe,Avatar as Qt,Divider as Zt,CircularProgress as en,Alert as So,List as rn,ListItem as mr,ListItemText as hr,ListItemIcon as on,Collapse as tn,IconButton as yr}from"@mui/material";import{Person as nn,Email as an,Badge as sn,Security as ln,Schedule as cn,AccountCircle as dn,ExpandMore as un,ExpandLess as gn,Info as pn}from"@mui/icons-material";import{useState as fn}from"react";import{Fragment as yn,jsx as E,jsxs as O}from"react/jsx-runtime";var mn=({showExtendedData:e=!0,showProfileCard:r=!0,autoRefresh:o=!0})=>{let{userProfile:t,loading:a,error:i,extendedData:n,refreshProfile:s}=jr({autoFetch:o,retryOnError:!0,maxRetries:3}),[c,y]=fn(!1);if(a)return O(Q,{display:"flex",justifyContent:"center",alignItems:"center",p:3,children:[E(en,{}),E(ne,{variant:"body2",sx:{ml:2},children:"Cargando perfil de usuario..."})]});if(i)return O(So,{severity:"error",action:E(yr,{color:"inherit",size:"small",onClick:s,children:E(ne,{variant:"caption",children:"Reintentar"})}),children:["Error al cargar el perfil: ",i]});if(!t)return E(So,{severity:"warning",children:"No se encontr\xF3 informaci\xF3n del usuario"});let u=n?.displayData||{},b=n?.totalFields||0,f=m=>{if(!m)return"No disponible";try{return new Date(m).toLocaleString("es-ES",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return m}},l=(m,P)=>P==null?"No disponible":typeof P=="boolean"?P?"S\xED":"No":Array.isArray(P)?P.length>0?P.join(", "):"Ninguno":typeof P=="object"?JSON.stringify(P,null,2):String(P),d=[{key:"id",label:"ID",icon:E(sn,{})},{key:"email",label:"Email",icon:E(an,{})},{key:"username",label:"Usuario",icon:E(nn,{})},{key:"fullName",label:"Nombre completo",icon:E(dn,{})},{key:"role",label:"Rol",icon:E(ln,{})}],w=[{key:"firstName",label:"Nombre"},{key:"lastName",label:"Apellido"},{key:"isActive",label:"Activo"},{key:"lastLogin",label:"\xDAltimo login"},{key:"createdAt",label:"Creado"},{key:"updatedAt",label:"Actualizado"}],g=[...d.map(m=>m.key),...w.map(m=>m.key),"permissions"],p=Object.keys(u).filter(m=>!g.includes(m)).map(m=>({key:m,label:m}));return O(Q,{children:[r&&E(Eo,{sx:{mb:2},children:O(Ro,{children:[O(Q,{display:"flex",alignItems:"center",mb:2,children:[E(Qt,{src:u.avatar,sx:{width:56,height:56,mr:2},children:u.fullName?.[0]||u.username?.[0]||u.email?.[0]}),O(Q,{children:[E(ne,{variant:"h6",children:u.fullName||u.username||u.email}),E(ne,{variant:"body2",color:"text.secondary",children:u.role||"Usuario"}),u.isActive!==void 0&&E(Qe,{label:u.isActive?"Activo":"Inactivo",color:u.isActive?"success":"error",size:"small",sx:{mt:.5}})]})]}),E(Q,{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(250px, 1fr))",gap:2,children:d.map(({key:m,label:P,icon:I})=>u[m]?O(Q,{display:"flex",alignItems:"center",children:[E(Q,{sx:{mr:1,color:"text.secondary"},children:I}),O(Q,{children:[E(ne,{variant:"caption",color:"text.secondary",children:P}),E(ne,{variant:"body2",children:l(m,u[m])})]})]},m):null)}),u.permissions&&Array.isArray(u.permissions)&&u.permissions.length>0&&O(Q,{mt:2,children:[E(ne,{variant:"caption",color:"text.secondary",display:"block",children:"Permisos"}),O(Q,{display:"flex",flexWrap:"wrap",gap:.5,mt:.5,children:[u.permissions.slice(0,5).map((m,P)=>E(Qe,{label:m,size:"small",variant:"outlined"},P)),u.permissions.length>5&&E(Qe,{label:`+${u.permissions.length-5} m\xE1s`,size:"small"})]})]})]})}),e&&E(Eo,{children:O(Ro,{children:[O(Q,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,children:[O(ne,{variant:"h6",display:"flex",alignItems:"center",children:[E(pn,{sx:{mr:1}}),"Informaci\xF3n Detallada"]}),E(Qe,{label:`${b} campos totales`,size:"small"})]}),O(rn,{dense:!0,children:[w.map(({key:m,label:P})=>u[m]!==void 0&&O(mr,{divider:!0,children:[E(on,{children:E(cn,{fontSize:"small"})}),E(hr,{primary:P,secondary:m.includes("At")||m.includes("Login")?f(u[m]):l(m,u[m])})]},m)),p.length>0&&O(yn,{children:[E(Zt,{sx:{my:1}}),E(mr,{children:E(hr,{primary:O(Q,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[O(ne,{variant:"subtitle2",children:["Campos Personalizados (",p.length,")"]}),E(yr,{size:"small",onClick:()=>y(!c),children:c?E(gn,{}):E(un,{})})]})})}),E(tn,{in:c,children:p.map(({key:m,label:P})=>E(mr,{sx:{pl:4},children:E(hr,{primary:P,secondary:l(m,u[m])})},m))})]})]}),O(Q,{mt:2,display:"flex",justifyContent:"space-between",alignItems:"center",children:[O(ne,{variant:"caption",color:"text.secondary",children:["\xDAltima actualizaci\xF3n: ",f(u.updatedAt)]}),E(yr,{size:"small",onClick:s,disabled:a,children:E(ne,{variant:"caption",children:"Actualizar"})})]})]})})]})},hn=mn;var Io=["create","read","update","delete"],ko=["create","read","update","delete"];import{useRef as Mn}from"react";import{useTranslation as Vn}from"react-i18next";import{Box as rr,Typography as Bo,Button as Wn,Stack as Hn,Alert as No,Divider as qn}from"@mui/material";import{Add as jn}from"@mui/icons-material";import{forwardRef as Sn}from"react";import{useTranslation as In}from"react-i18next";import{Box as Te,FormControl as kn,InputLabel as Ln,Select as An,MenuItem as Fn,IconButton as Dn,Typography as Fe,FormHelperText as _n,Stack as er,Paper as Oo,Divider as On,Button as Cr}from"@mui/material";import{Delete as Bn,SelectAll as Nn,ClearAll as zn}from"@mui/icons-material";import{useState as Lo,useEffect as Ao,useRef as Fo}from"react";import{useTranslation as bn}from"react-i18next";import{Box as Ze,Typography as Me,Button as Do,Stack as br,FormControlLabel as wn,FormHelperText as _o,Switch as xn,ToggleButton as wr,ToggleButtonGroup as Cn}from"@mui/material";import{CheckCircle as vn,Cancel as Pn,SelectAll as Tn,ClearAll as En}from"@mui/icons-material";import{jsx as z,jsxs as we}from"react/jsx-runtime";var Rn=({value:e,onChange:r,availableFields:o,error:t,disabled:a=!1})=>{let{t:i}=bn(),[n,s]=Lo("custom"),[c,y]=Lo(!1),u=Fo(null);Ao(()=>{c&&u.current?.scrollIntoView({behavior:"smooth",block:"start"})},[c]);let b=Fo(!1);Ao(()=>{let g=e||{allow:[],owner_allow:[],deny:[]},p=new Set(o),m=(g.allow||[]).filter(x=>p.has(x)),P=(g.owner_allow||[]).filter(x=>p.has(x)),I=(g.deny||[]).filter(x=>p.has(x));o.forEach(x=>{!m.includes(x)&&!P.includes(x)&&!I.includes(x)&&I.push(x)});let M={allow:m,owner_allow:P,deny:I};JSON.stringify(M)!==JSON.stringify(g)&&r(M),m.length===o.length?s("all"):I.length===o.length?s("none"):s("custom")},[o,e]);let f=()=>{b.current=!0,r({allow:[...o],owner_allow:[],deny:[]}),s("all"),setTimeout(()=>{b.current=!1},0)},l=()=>{b.current=!0,r({allow:[],owner_allow:[],deny:[...o]}),s("none"),setTimeout(()=>{b.current=!1},0)},d=g=>e?.allow?.includes(g)?"allow":e?.owner_allow?.includes(g)?"owner_allow":"deny",w=(g,p)=>{b.current=!0;let m=new Set(e?.allow||[]),P=new Set(e?.owner_allow||[]),I=new Set(e?.deny||[]);m.delete(g),P.delete(g),I.delete(g),p==="allow"&&m.add(g),p==="owner_allow"&&P.add(g),p==="deny"&&I.add(g),r({allow:Array.from(m),owner_allow:Array.from(P),deny:Array.from(I)}),s("custom"),setTimeout(()=>{b.current=!1},0)};return o.length===0?we(Ze,{children:[z(Me,{variant:"body2",color:"text.secondary",sx:{mb:1},children:i("publicPolicies.fields.conditions.label")}),z(Me,{variant:"body2",color:"text.secondary",sx:{fontStyle:"italic"},children:i("publicPolicies.fields.conditions.noFieldsAvailable")}),t&&z(_o,{error:!0,sx:{mt:1},children:t})]}):we(Ze,{children:[z(Me,{variant:"body2",color:"text.secondary",sx:{mb:2},children:i("publicPolicies.fields.conditions.label")}),we(br,{direction:"row",spacing:1,alignItems:"center",sx:{mb:c?3:1},children:[z(Do,{variant:n==="all"?"contained":"outlined",startIcon:z(Tn,{}),onClick:f,disabled:a,size:"small",sx:{minWidth:120,...n==="all"&&{backgroundColor:"#16a34a","&:hover":{backgroundColor:"#15803d"}}},children:i("publicPolicies.fields.conditions.allFields")}),z(Do,{variant:n==="none"?"contained":"outlined",startIcon:z(En,{}),onClick:l,disabled:a,size:"small",sx:{minWidth:120,...n==="none"&&{backgroundColor:"#cf222e","&:hover":{backgroundColor:"#bc1f2c"}}},children:i("publicPolicies.fields.conditions.noFields")}),z(Ze,{sx:{display:"flex",alignItems:"center",px:1.5,py:.35,borderRadius:"999px",backgroundColor:"#f3f4f6",border:"1px solid #d1d9e0"},children:z(wn,{control:z(xn,{size:"small",checked:c,onChange:()=>y(g=>!g),disabled:a,color:"primary",sx:{transform:"scale(1.15)",transformOrigin:"center",m:0}}),label:i("publicPolicies.fields.conditions.customEdit"),labelPlacement:"end",sx:{ml:0,".MuiFormControlLabel-label":{fontSize:"0.75rem"}}})})]}),c&&we(Ze,{ref:u,sx:{p:2,border:"1px solid #d1d9e0",borderRadius:1,backgroundColor:"#f6f8fa"},children:[z(Me,{variant:"body2",color:"text.secondary",sx:{mb:2},children:i("publicPolicies.fields.conditions.help")}),z(br,{spacing:1,children:o.map(g=>{let p=d(g);return we(br,{direction:"row",spacing:1,alignItems:"center",children:[z(Me,{variant:"body2",sx:{minWidth:100,fontFamily:"monospace"},children:g}),we(Cn,{value:p,exclusive:!0,size:"small",children:[we(wr,{value:"allow",onClick:()=>w(g,"allow"),disabled:a,sx:{px:2,color:p==="allow"?"#ffffff":"#6b7280",backgroundColor:p==="allow"?"#16a34a":"#f3f4f6",borderColor:p==="allow"?"#16a34a":"#d1d5db","&:hover":{backgroundColor:p==="allow"?"#15803d":"#e5e7eb",borderColor:p==="allow"?"#15803d":"#9ca3af"},"&.Mui-selected":{backgroundColor:"#16a34a",color:"#ffffff","&:hover":{backgroundColor:"#15803d"}}},children:[z(vn,{sx:{fontSize:16,mr:.5}}),i("publicPolicies.fields.conditions.states.allow")]}),z(wr,{value:"owner_allow",onClick:()=>w(g,"owner_allow"),disabled:a,sx:{px:2,color:p==="owner_allow"?"#ffffff":"#6b7280",backgroundColor:p==="owner_allow"?"#0ea5e9":"#f3f4f6",borderColor:p==="owner_allow"?"#0ea5e9":"#d1d5db","&:hover":{backgroundColor:p==="owner_allow"?"#0284c7":"#e5e7eb",borderColor:p==="owner_allow"?"#0284c7":"#9ca3af"},"&.Mui-selected":{backgroundColor:"#0ea5e9",color:"#ffffff","&:hover":{backgroundColor:"#0284c7"}}},children:i("publicPolicies.fields.conditions.states.ownerAllow")}),we(wr,{value:"deny",onClick:()=>w(g,"deny"),disabled:a,sx:{px:2,color:p==="deny"?"#ffffff":"#6b7280",backgroundColor:p==="deny"?"#dc2626":"#f3f4f6",borderColor:p==="deny"?"#dc2626":"#d1d5db","&:hover":{backgroundColor:p==="deny"?"#b91c1c":"#e5e7eb",borderColor:p==="deny"?"#b91c1c":"#9ca3af"},"&.Mui-selected":{backgroundColor:"#dc2626",color:"#ffffff","&:hover":{backgroundColor:"#b91c1c"}}},children:[z(Pn,{sx:{fontSize:16,mr:.5}}),i("publicPolicies.fields.conditions.states.deny")]})]})]},g)})})]}),t&&z(_o,{error:!0,sx:{mt:1},children:t})]})},xr=Rn;import{jsx as U,jsxs as K}from"react/jsx-runtime";var Un=Sn(({policy:e,onChange:r,onRemove:o,availableFields:t,isSubmitting:a=!1,usedActions:i,error:n},s)=>{let{t:c}=In(),y=new Set(Array.from(i||[]));y.delete(e.action);let u=Io.map(b=>({value:b,label:c(`publicPolicies.fields.action.options.${b}`)}));return K(Oo,{ref:s,sx:{p:3,border:"1px solid #d1d9e0",borderRadius:2,position:"relative",backgroundColor:"#ffffff"},children:[K(Te,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",mb:3},children:[U(Fe,{variant:"subtitle1",sx:{fontWeight:600,color:"#111418",fontSize:"1rem"},children:c("publicPolicies.policyTitle")}),U(Dn,{onClick:o,size:"small",disabled:a,"aria-label":c("publicPolicies.removePolicy"),sx:{color:"#656d76","&:hover":{color:"#cf222e",backgroundColor:"rgba(207, 34, 46, 0.1)"}},children:U(Bn,{})})]}),K(er,{spacing:1,children:[U(er,{direction:{xs:"column",md:"row"},spacing:2,children:U(Te,{sx:{flex:1,minWidth:200},children:K(kn,{fullWidth:!0,children:[U(Ln,{children:c("publicPolicies.fields.action.label")}),U(An,{value:e.action,label:c("publicPolicies.fields.action.label"),disabled:a,onChange:b=>{let f=b.target.value,l={...e,action:f};f==="delete"?(l.permission="deny",delete l.fields):(l.fields={allow:[],owner_allow:[],deny:t},delete l.permission),r(l)},sx:{backgroundColor:"#ffffff","&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#8c959f"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"#0969da",borderWidth:2}},children:u.map(b=>{let f=y.has(b.value);return U(Fn,{value:b.value,disabled:f,children:b.label},b.value)})}),n&&U(_n,{error:!0,children:n})]})})}),e.action==="delete"?K(Te,{children:[U(Fe,{variant:"body2",color:"text.secondary",sx:{mb:2},children:c("publicPolicies.fields.conditions.label")}),K(er,{direction:"row",spacing:1,sx:{mb:1},children:[U(Cr,{variant:e.permission==="*"?"contained":"outlined",startIcon:U(Nn,{}),onClick:()=>r({...e,permission:"*"}),disabled:a,size:"small",sx:{minWidth:140,whiteSpace:"nowrap",...e.permission==="*"&&{backgroundColor:"#16a34a","&:hover":{backgroundColor:"#15803d"}}},children:c("publicPolicies.fields.conditions.allFields")}),U(Cr,{variant:e.permission==="owner"?"contained":"outlined",onClick:()=>r({...e,permission:"owner"}),disabled:a,size:"small",sx:{minWidth:140,whiteSpace:"nowrap",...e.permission==="owner"&&{backgroundColor:"#0ea5e9","&:hover":{backgroundColor:"#0284c7"}}},children:c("publicPolicies.fields.conditions.states.ownerAllow")}),U(Cr,{variant:e.permission==="deny"?"contained":"outlined",startIcon:U(zn,{}),onClick:()=>r({...e,permission:"deny"}),disabled:a,size:"small",sx:{minWidth:140,whiteSpace:"nowrap",...e.permission==="deny"&&{backgroundColor:"#cf222e","&:hover":{backgroundColor:"#bc1f2c"}}},children:c("publicPolicies.fields.conditions.noFields")})]})]}):U(xr,{value:e.fields||{allow:[],owner_allow:[],deny:[]},onChange:b=>r({...e,fields:b}),availableFields:t,disabled:a}),U(Oo,{variant:"outlined",sx:{p:2,backgroundColor:"#f9fafb"},children:e.action==="delete"?K(Fe,{variant:"body2",sx:{fontFamily:"monospace",color:"text.secondary"},children:[K(Te,{component:"span",sx:{color:e.permission==="*"?"#16a34a":e.permission==="owner"?"#0ea5e9":"#dc2626"},children:[c("publicPolicies.fields.conditions.states.allow"),":"]})," ",e.permission||"-"]}):K(er,{spacing:.5,divider:U(On,{sx:{borderColor:"#e5e7eb"}}),children:[K(Fe,{variant:"body2",sx:{fontFamily:"monospace",color:"text.secondary"},children:[K(Te,{component:"span",sx:{color:"#16a34a"},children:[c("publicPolicies.fields.conditions.states.allow"),":"]})," ",(e?.fields?.allow||[]).join(", ")||"-"]}),K(Fe,{variant:"body2",sx:{fontFamily:"monospace",color:"text.secondary"},children:[K(Te,{component:"span",sx:{color:"#0ea5e9"},children:[c("publicPolicies.fields.conditions.states.ownerAllow"),":"]})," ",(e?.fields?.owner_allow||[]).join(", ")||"-"]}),K(Fe,{variant:"body2",sx:{fontFamily:"monospace",color:"text.secondary"},children:[K(Te,{component:"span",sx:{color:"#dc2626"},children:[c("publicPolicies.fields.conditions.states.deny"),":"]})," ",(e?.fields?.deny||[]).join(", ")||"-"]})]})})]})]})}),vr=Un;import{Fragment as Gn,jsx as le,jsxs as or}from"react/jsx-runtime";var Kn=()=>{let e=globalThis?.crypto;return e&&typeof e.randomUUID=="function"?e.randomUUID():`${Date.now()}-${Math.random().toString(16).slice(2)}`},$n=({policies:e,onChange:r,availableFields:o,errors:t,isSubmitting:a=!1})=>{let{t:i}=Vn(),n=Mn({}),s=new Set((e||[]).map(d=>d.action).filter(Boolean)),c=ko.filter(d=>!s.has(d)),y=c.length>0,u=()=>{let d=c[0]||"create",w={id:Kn(),action:d};d==="delete"?w.permission="deny":w.fields={allow:[],owner_allow:[],deny:o};let g=[...e||[],w];r(g),setTimeout(()=>{let p=g.length-1,m=n.current[p];m&&m.scrollIntoView({behavior:"smooth",block:"center"})},100)},b=d=>{let w=[...e];w.splice(d,1),r(w)},f=(()=>{if(!t)return null;if(typeof t=="string")return t;let d=t._error;return typeof d=="string"?d:null})(),l=new Set((e||[]).map(d=>d.action));return or(Gn,{children:[le(qn,{sx:{borderColor:"#e0e4e7"}}),or(rr,{children:[le(rr,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3,children:or(rr,{children:[le(Bo,{variant:"h6",sx:{fontWeight:600,color:"#111418",mb:1},children:i("publicPolicies.title")}),le(Bo,{variant:"body2",color:"text.secondary",sx:{fontSize:"0.875rem"},children:i("publicPolicies.description")})]})}),f&&le(No,{severity:"error",sx:{mb:3},children:f}),or(Hn,{spacing:3,children:[(e||[]).length===0?le(No,{severity:"info",children:i("publicPolicies.noPolicies")}):e.map((d,w)=>le(vr,{ref:g=>{n.current[w]=g},policy:d,onChange:g=>{let p=[...e];p[w]=g,r(p)},onRemove:()=>b(w),availableFields:o,isSubmitting:a,usedActions:l,error:typeof t=="object"&&t&&d.id in t?t[d.id]:void 0},d.id)),y&&le(rr,{children:le(Wn,{type:"button",variant:"outlined",startIcon:le(jn,{}),onClick:u,disabled:a,sx:{borderColor:"#d0d7de",color:"#656d76","&:hover":{borderColor:"#8c959f",backgroundColor:"transparent"}},children:i("publicPolicies.addPolicy")})})]})]})]})},nl=$n;import{useState as Pr}from"react";import{Button as tr,TextField as zo,Box as De,Alert as Ve,Typography as xe,CircularProgress as Tr}from"@mui/material";import{jsx as B,jsxs as pe}from"react/jsx-runtime";function ul(){let[e,r]=Pr(""),[o,t]=Pr(""),[a,i]=Pr(!1),{isAuthenticated:n,isLoading:s,error:c,login:y,logout:u,refreshTokens:b,clearError:f,isExpiringSoon:l,expiresIn:d}=he(),w=async m=>{if(m.preventDefault(),!e||!o)return;(await y(e,o)).success&&(r(""),t(""),i(!1))},g=async()=>{await u()},p=async()=>{await b()};return n?pe(De,{sx:{maxWidth:600,mx:"auto",p:3},children:[B(xe,{variant:"h4",gutterBottom:!0,children:"Welcome! \u{1F389}"}),B(Ve,{severity:"success",sx:{mb:3},children:"You are successfully logged in with Refresh Token Pattern enabled"}),pe(De,{sx:{mb:3,p:2,bgcolor:"background.paper",border:1,borderColor:"divider",borderRadius:1},children:[B(xe,{variant:"h6",gutterBottom:!0,children:"Token Status"}),pe(xe,{variant:"body2",color:"text.secondary",children:["Access Token expires in: ",Math.round(d/1e3/60)," minutes"]}),l&&B(Ve,{severity:"warning",sx:{mt:1},children:"Token expires soon - automatic refresh will happen"})]}),pe(De,{sx:{display:"flex",gap:2,flexWrap:"wrap"},children:[B(tr,{variant:"contained",onClick:p,disabled:s,startIcon:s?B(Tr,{size:16}):null,children:"Refresh Tokens"}),B(tr,{variant:"outlined",color:"error",onClick:g,disabled:s,children:"Logout"})]}),c&&B(Ve,{severity:"error",sx:{mt:2},onClose:f,children:c})]}):pe(De,{sx:{maxWidth:400,mx:"auto",p:3},children:[B(xe,{variant:"h4",gutterBottom:!0,align:"center",children:"Login with Refresh Tokens"}),B(Ve,{severity:"info",sx:{mb:3},children:"This demo shows the new Refresh Token Pattern with automatic session management"}),a?pe("form",{onSubmit:w,children:[B(zo,{fullWidth:!0,label:"Email",type:"email",value:e,onChange:m=>r(m.target.value),margin:"normal",required:!0,autoComplete:"email"}),B(zo,{fullWidth:!0,label:"Password",type:"password",value:o,onChange:m=>t(m.target.value),margin:"normal",required:!0,autoComplete:"current-password"}),B(tr,{type:"submit",fullWidth:!0,variant:"contained",size:"large",disabled:s,startIcon:s?B(Tr,{size:16}):null,sx:{mt:3,mb:2},children:s?"Logging in...":"Login"})]}):B(tr,{fullWidth:!0,variant:"contained",size:"large",onClick:()=>i(!0),sx:{mt:2},children:"Show Login Form"}),c&&B(Ve,{severity:"error",sx:{mt:2},onClose:f,children:c})]})}function gl(){let{isAuthenticated:e,isLoading:r,isExpiringSoon:o,expiresIn:t}=he();return r?pe(De,{sx:{display:"flex",alignItems:"center",gap:1},children:[B(Tr,{size:16}),B(xe,{variant:"caption",children:"Loading session..."})]}):e?pe(De,{children:[B(xe,{variant:"caption",color:"success.main",children:"\u2713 Authenticated"}),o&&pe(xe,{variant:"caption",color:"warning.main",display:"block",children:["\u26A0 Token expires in ",Math.round(t/1e3/60)," min"]})]}):B(xe,{variant:"caption",color:"text.secondary",children:"Not logged in"})}import Yn from"@mui/material/TextField";import Xn from"@mui/material/CircularProgress";import Uo from"@mui/material/InputAdornment";import Jn from"@mui/material/IconButton";import Qn from"@mui/icons-material/Refresh";import{jsx as Ce}from"react/jsx-runtime";var Zn=e=>e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").replace(/javascript:/gi,"").replace(/on\w+\s*=/gi,"").replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi,""),ei=({html:e})=>Ce("span",{dangerouslySetInnerHTML:{__html:Zn(e)}}),Cl=({config:e,value:r,onChange:o,label:t,error:a=!1,helperText:i,readOnly:n=!1,disabled:s=!1})=>{let{value:c,loading:y,error:u,regenerate:b}=Kr(e,{autoFetch:!r,onSuccess:p=>{o?.(p)}}),f=r||c,l=a||!!u,d=u||i,w=l&&d&&(d.toLowerCase().includes("duplicate")||d.toLowerCase().includes("duplicado")||d.toLowerCase().includes("duplicada")||d.toLowerCase().includes("unique")||d.toLowerCase().includes("\xFAnico")||d.toLowerCase().includes("unico")||d.toLowerCase().includes("\xFAnica")||d.toLowerCase().includes("unica")||d.toLowerCase().includes("already exists")||d.toLowerCase().includes("ya existe")||d.toLowerCase().includes("e11000"));return Ce(Yn,{label:t,fullWidth:!0,value:f,error:l,helperText:d?Ce(ei,{html:d}):" ",disabled:s,InputProps:{readOnly:!0,startAdornment:y?Ce(Uo,{position:"start",children:Ce(Xn,{size:20})}):void 0,endAdornment:w&&!y?Ce(Uo,{position:"end",children:Ce(Jn,{edge:"end",onClick:async()=>{!s&&!y&&await b()},disabled:s,size:"small",color:"error","aria-label":"regenerar c\xF3digo",title:"Regenerar c\xF3digo",children:Ce(Qn,{})})}):void 0}})};import Er,{useCallback as fe,useRef as Mo,useState as We}from"react";import Ee from"@mui/material/Box";import ve from"@mui/material/Typography";import Rr from"@mui/material/IconButton";import ri from"@mui/material/LinearProgress";import nr from"@mui/material/CircularProgress";import Wo from"@mui/material/Chip";import oi from"@mui/material/Paper";import ti from"@mui/material/List";import ni from"@mui/material/ListItem";import ii from"@mui/material/ListItemText";import ai from"@mui/material/ListItemSecondaryAction";import si from"@mui/material/FormHelperText";import li from"@mui/material/Dialog";import ci from"@mui/material/DialogTitle";import di from"@mui/material/DialogContent";import ui from"@mui/material/DialogActions";import Vo from"@mui/material/Button";import gi from"@mui/icons-material/CloudUpload";import pi from"@mui/icons-material/InsertDriveFile";import fi from"@mui/icons-material/Image";import mi from"@mui/icons-material/PictureAsPdf";import hi from"@mui/icons-material/Delete";import yi from"@mui/icons-material/Refresh";import bi from"@mui/icons-material/Restore";import wi from"@mui/icons-material/CheckCircle";import xi from"@mui/icons-material/Error";import Ql from"@mui/icons-material/BrokenImage";import{jsx as T,jsxs as ce}from"react/jsx-runtime";var Ci=e=>e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").replace(/javascript:/gi,"").replace(/on\w+\s*=/gi,"").replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi,""),vi=e=>{if(e===0)return"0 B";let r=1024,o=["B","KB","MB","GB"],t=Math.floor(Math.log(e)/Math.log(r));return`${parseFloat((e/Math.pow(r,t)).toFixed(1))} ${o[t]}`},Pi=e=>e.startsWith("image/")?T(fi,{color:"primary"}):e==="application/pdf"?T(mi,{color:"error"}):T(pi,{color:"action"}),Ti=(e,r)=>{switch(e){case"completed":return T(wi,{color:"success",fontSize:"small"});case"error":return T(xi,{color:"error",fontSize:"small"});case"uploading":case"pending":return T(nr,{size:16});case"removing":return T(nr,{size:16,color:"error"});case"pendingDeletion":return T(Wo,{label:r("base.file.pendingDeletion"),size:"small",color:"warning",variant:"outlined",sx:{fontSize:"0.65rem",height:20}});default:return null}},Ei=({file:e,baseUrl:r,disabled:o,onRemove:t,onRestore:a,onRetry:i})=>{let{t:n}=_e(),[s,c]=We(!1),y=e.status==="pendingDeletion",u=!o&&e.status!=="uploading"&&e.status!=="removing"&&!y,b=!o&&y,f=!o&&e.status==="error"&&e.file,l=e.contentType.startsWith("image/"),d=e.visibility==="public"||e.filePath?.startsWith("public/")||e.filePath?.startsWith(r),g=!e.filePath||!d?null:e.filePath.startsWith("http://")||e.filePath.startsWith("https://")||e.filePath.startsWith(r)?e.filePath:`${r}${e.filePath}`,p=e.status==="completed"&&g,m=()=>l&&p&&!s?T(Ee,{component:p?"a":"div",href:g||void 0,target:"_blank",rel:"noopener noreferrer",sx:{width:48,height:48,borderRadius:1,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"grey.100",border:"1px solid",borderColor:"divider",cursor:p?"pointer":"default",transition:"all 0.2s ease",flexShrink:0,"&:hover":p?{borderColor:"primary.main",transform:"scale(1.05)"}:{}},children:T("img",{src:g,alt:e.name,style:{width:"100%",height:"100%",objectFit:"cover"},onError:()=>c(!0)})}):T(Ee,{component:p?"a":"div",href:g||void 0,target:"_blank",rel:"noopener noreferrer",sx:{width:48,height:48,borderRadius:1,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"grey.50",border:"1px solid",borderColor:"divider",cursor:p?"pointer":"default",transition:"all 0.2s ease",flexShrink:0,textDecoration:"none","&:hover":p?{borderColor:"primary.main",bgcolor:"action.hover"}:{}},children:Pi(e.contentType)});return ce(ni,{sx:{borderRadius:1,mb:.5,bgcolor:e.status==="error"?"error.lighter":"background.paper",border:"1px solid",borderColor:e.status==="error"?"error.light":"divider",gap:1.5},children:[m(),T(ii,{primary:ce(Ee,{sx:{display:"flex",alignItems:"center",gap:1},children:[T(ve,{variant:"body2",noWrap:!0,sx:{maxWidth:200,overflow:"hidden",textOverflow:"ellipsis",textDecoration:y?"line-through":"none",opacity:y?.6:1},children:e.name}),Ti(e.status,n)]}),secondary:ce(Ee,{sx:{opacity:y?.6:1},children:[e.size>0&&T(ve,{variant:"caption",color:"text.secondary",children:vi(e.size)}),e.status==="uploading"&&T(ri,{variant:"determinate",value:e.progress,sx:{mt:.5,height:4,borderRadius:2}}),e.status==="error"&&e.errorMessage&&T(ve,{variant:"caption",color:"error",display:"block",children:e.errorMessage}),p&&T(ve,{variant:"caption",color:"primary",display:"block",component:"a",href:g||void 0,target:"_blank",rel:"noopener noreferrer",sx:{cursor:"pointer",textDecoration:"underline","&:hover":{textDecoration:"none"}},children:n(l?"base.file.clickToPreview":"base.file.clickToDownload")})]})}),ce(ai,{children:[f&&T(Rr,{edge:"end",size:"small",onClick:()=>i(e.id),color:"primary",title:n("base.file.restore"),children:T(yi,{fontSize:"small"})}),b&&T(Rr,{edge:"end",size:"small",onClick:()=>a(e.id),color:"primary",title:n("base.file.restore"),children:T(bi,{fontSize:"small"})}),u&&T(Rr,{edge:"end",size:"small",onClick:()=>t(e.id),color:"error",title:n("base.file.delete"),children:T(hi,{fontSize:"small"})})]})]})};var rc=({label:e,accept:r,maxFileSize:o=10*1024*1024,multiple:t=!1,maxFiles:a,minFiles:i=0,required:n=!1,disabled:s=!1,error:c=!1,helperText:y,onChange:u,onValidation:b,initialFiles:f,placeholder:l,showFileList:d=!0,visibility:w="private",showPreview:g=!0,baseUrl:p,onDeletionHandlersReady:m,mode:P="create"})=>{let{t:I}=_e(),M=Mo(null),[x,h]=We(!1),[R,L]=We(!1),[_,re]=We(null),[oe,de]=We(!1),Re=t?a:1,D=n?Math.max(i,1):i,j={acceptedTypes:r,maxFileSize:o,maxFiles:Re,minFiles:D,visibility:w,mode:P,onFilesChange:A=>{let ie=A.filter(qe=>qe.status==="completed"&&qe.filePath).map(qe=>{let Se=qe.filePath;return Se.startsWith(p)||Se.startsWith("http://")||Se.startsWith("https://")?Se:p?`${p}${Se}`:Se});u?.(ie)}},{files:N,isUploading:ue,addFiles:S,removeFile:W,restoreFile:v,retryUpload:k,isValid:F,validationError:H,validationErrorKey:G,validationErrorParams:X,initializeFiles:me,isTouched:Ki,markAsTouched:He,isSubmitted:Ko,markAsSubmitted:Ir,getPreviewUrl:$i,commitDeletions:kr,restorePendingDeletions:Lr,hasPendingDeletions:Ar,deleteFileImmediately:Fr,activeFiles:Gi,activeFileCount:$o,waitForUploads:Dr,completedFilePaths:_r}=$r(j),Or=fe(()=>_r,[_r]),Br=Mo(!1);Er.useEffect(()=>{f&&f.length>0&&!Br.current&&(Br.current=!0,me(f,p))},[f,me,p]),Er.useEffect(()=>{b?.(F,H)},[F,H,b]),Er.useEffect(()=>{m?.({commitDeletions:kr,restorePendingDeletions:Lr,hasPendingDeletions:Ar,markAsSubmitted:Ir,isValid:F,isUploading:ue,waitForUploads:Dr,getCompletedFilePaths:Or})},[m,kr,Lr,Ar,Ir,F,ue,Dr,Or]);let Go=fe(A=>{He();let ie=A.target.files;ie&&ie.length>0&&S(ie),M.current&&(M.current.value="")},[S,He]),Yo=fe(()=>{s||M.current?.click()},[s]),Xo=fe(A=>{A.preventDefault(),A.stopPropagation(),s||h(!0)},[s]),Jo=fe(A=>{A.preventDefault(),A.stopPropagation(),h(!1)},[]),Qo=fe(A=>{if(A.preventDefault(),A.stopPropagation(),h(!1),s)return;He();let ie=A.dataTransfer.files;ie&&ie.length>0&&S(ie)},[s,S,He]),Zo=fe(async A=>{(await W(A)).needsConfirmation&&(re(A),L(!0))},[W]),et=fe(async()=>{if(_){de(!0);try{let A=await Fr(_);A.success||console.error("Error deleting file:",A.error)}finally{de(!1),L(!1),re(null)}}},[_,Fr]),Nr=fe(()=>{L(!1),re(null)},[]),rt=r?.join(",")||"",ot=!s&&(t||$o===0),zr=Ko&&!F,ar=c||zr,Ur=y||(zr&&G?I(G,X):null);return ce(Ee,{sx:{width:"100%"},children:[e&&ce(ve,{variant:"body2",sx:{mb:1,fontWeight:500,color:ar?"error.main":"text.primary"},children:[e,n&&T("span",{style:{color:"red"},children:" *"})]}),T("input",{ref:M,type:"file",accept:rt,multiple:t,onChange:Go,disabled:s,style:{display:"none"}}),ot&&ce(oi,{variant:"outlined",onClick:Yo,onDragOver:Xo,onDragLeave:Jo,onDrop:Qo,sx:{p:3,textAlign:"center",cursor:s?"not-allowed":"pointer",borderStyle:"dashed",borderWidth:2,borderColor:x?"primary.main":ar?"error.main":"divider",bgcolor:x?"primary.lighter":s?"action.disabledBackground":"background.paper",transition:"all 0.2s ease","&:hover":s?{}:{borderColor:"primary.main",bgcolor:"action.hover"}},children:[T(gi,{sx:{fontSize:48,color:x?"primary.main":s?"action.disabled":"action.active",mb:1}}),T(ve,{variant:"body2",color:s?"text.disabled":"text.secondary",children:l||I(x?"base.file.dropHere":"base.file.dragOrClick")}),r&&r.length>0&&!x&&T(Ee,{sx:{mt:1,display:"flex",gap:.5,justifyContent:"center",flexWrap:"wrap"},children:r.map(A=>T(Wo,{label:A.split("/")[1]?.toUpperCase()||A,size:"small",variant:"outlined",sx:{fontSize:"0.7rem"}},A))})]}),d&&N.length>0&&T(ti,{dense:!0,sx:{mt:1,p:0},children:N.map(A=>T(Ei,{file:A,baseUrl:p,disabled:s,onRemove:Zo,onRestore:v,onRetry:k},A.id))}),ue&&ce(Ee,{sx:{display:"flex",alignItems:"center",gap:1,mt:1},children:[T(nr,{size:16}),T(ve,{variant:"caption",color:"text.secondary",children:I("base.file.uploading")})]}),Ur&&T(si,{error:ar,sx:{mt:.5},dangerouslySetInnerHTML:{__html:Ci(Ur)}}),ce(li,{open:R,onClose:oe?void 0:Nr,children:[T(ci,{children:I("base.file.confirmDelete.title")}),T(di,{children:T(ve,{children:I("base.file.confirmDelete.message")})}),ce(ui,{children:[T(Vo,{onClick:Nr,disabled:oe,children:I("base.file.confirmDelete.cancel")}),T(Vo,{onClick:et,color:"error",variant:"contained",disabled:oe,startIcon:oe?T(nr,{size:16,color:"inherit"}):void 0,children:I(oe?"base.file.deleting":"base.file.confirmDelete.confirm")})]})]})]})};import{useCallback as Ri,useRef as Si,useEffect as Ii}from"react";import Ho from"@mui/material/Box";import qo from"@mui/material/Typography";import jo from"@mui/material/FormHelperText";import{MDXEditor as ki,headingsPlugin as Li,listsPlugin as Ai,quotePlugin as Fi,thematicBreakPlugin as Di,markdownShortcutPlugin as _i,linkPlugin as Oi,linkDialogPlugin as Bi,tablePlugin as Ni,toolbarPlugin as zi,UndoRedo as Ui,BoldItalicUnderlineToggles as Mi,BlockTypeSelect as Vi,CreateLink as Wi,InsertTable as Hi,ListsToggle as qi,Separator as ir}from"@mdxeditor/editor";import"@mdxeditor/editor/style.css";import{Fragment as ji,jsx as $,jsxs as Sr}from"react/jsx-runtime";var uc=({label:e,value:r="",onChange:o,required:t=!1,disabled:a=!1,error:i=!1,helperText:n,placeholder:s="Write here...",minHeight:c=200,maxHeight:y=500})=>{let u=Si(null);Ii(()=>{u.current&&u.current.getMarkdown()!==r&&u.current.setMarkdown(r||"")},[r]);let b=Ri(f=>{o?.(f)},[o]);return Sr(Ho,{sx:{width:"100%"},children:[e&&Sr(qo,{component:"label",sx:{display:"block",mb:.5,fontSize:"0.875rem",fontWeight:500,color:i?"error.main":"text.primary"},children:[e,t&&$(qo,{component:"span",color:"error.main",sx:{ml:.5},children:"*"})]}),$(Ho,{sx:{border:1,borderColor:i?"error.main":"divider",borderRadius:1,overflow:"hidden",opacity:a?.6:1,pointerEvents:a?"none":"auto","& .mdxeditor":{minHeight:c,maxHeight:y,overflow:"auto"},"& .mdxeditor-toolbar":{borderBottom:1,borderColor:"divider",backgroundColor:"background.default"},"& .mdxeditor-root-contenteditable":{padding:2,minHeight:c-50}},children:$(ki,{ref:u,markdown:r||"",onChange:b,placeholder:s,readOnly:a,plugins:[Li(),Ai(),Fi(),Di(),_i(),Oi(),Bi(),Ni(),zi({toolbarContents:()=>Sr(ji,{children:[$(Ui,{}),$(ir,{}),$(Mi,{}),$(ir,{}),$(Vi,{}),$(ir,{}),$(qi,{}),$(ir,{}),$(Wi,{}),$(Hi,{})]})})]})}),n&&$(jo,{error:i,sx:{mx:0,mt:.5},children:n}),!n&&$(jo,{sx:{mx:0,mt:.5},children:"\xA0"})]})};export{ge as a,Xi as b,Ji as c,sr as d,Ke as e,ca as f,_e as g,xs as h,hn as i,Io as j,ko as k,nl as l,ul as m,gl as n,Cl as o,rc as p,uc as q};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkRMN7APOFjs = require('./chunk-RMN7APOF.js');var _chunkVM6JVOLDjs = require('./chunk-VM6JVOLD.js');require('./chunk-YIIUEOXC.js');require('./chunk-34FAL7YW.js');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');function z({showBelowMinutes:f=5,position:m="bottom-right",colorNormal:c="#ed6c02",colorCritical:x="#d32f2f",style:u,className:g}={}){let{isAuthenticated:o,tokens:t}=_chunkVM6JVOLDjs.f.call(void 0, ),[i,y]=_react.useState.call(void 0, 0),[h,C]=_react.useState.call(void 0, 100);if(_react.useEffect.call(void 0, ()=>{if(!o||!t)return;let v=setInterval(()=>{let P=Date.now(),p=t.expiresAt-P,w=900*1e3;y(Math.max(0,p)),C(Math.max(0,p/w*100))},1e3);return()=>clearInterval(v)},[o,t]),!o||i<=0)return null;let e=Math.floor(i/6e4),S=Math.floor(i%6e4/1e3);if(e>=f)return null;let s=e<2,a=s?x:c,b={"top-left":{top:"16px",left:"16px"},"top-right":{top:"16px",right:"16px"},"bottom-left":{bottom:"16px",left:"16px"},"bottom-right":{bottom:"16px",right:"16px"}}[m];return _jsxruntime.jsxs.call(void 0, "div",{className:g,style:{position:"fixed",...b,padding:"12px 16px",backgroundColor:"white",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",minWidth:"200px",zIndex:9999,fontFamily:"system-ui, -apple-system, sans-serif",...u},children:[_jsxruntime.jsxs.call(void 0, "div",{style:{marginBottom:"8px"},children:[_jsxruntime.jsx.call(void 0, "div",{style:{fontSize:"12px",fontWeight:600,color:a,marginBottom:"4px"},children:s?"\u26A0\uFE0F Sesi\xF3n expirando":"\u23F0 Sesi\xF3n por expirar"}),_jsxruntime.jsxs.call(void 0, "div",{style:{fontSize:"14px",color:"#333",fontWeight:500},children:[e,":",S.toString().padStart(2,"0")]})]}),_jsxruntime.jsx.call(void 0, "div",{style:{width:"100%",height:"6px",backgroundColor:"#e0e0e0",borderRadius:"3px",overflow:"hidden"},children:_jsxruntime.jsx.call(void 0, "div",{style:{width:`${h}%`,height:"100%",backgroundColor:a,transition:"width 1s linear"}})})]})}exports.CrudiaAutoGenerate = _chunkRMN7APOFjs.o; exports.CrudiaFileField = _chunkRMN7APOFjs.p; exports.CrudiaMarkdownField = _chunkRMN7APOFjs.q; exports.CrudifyLogin = _chunkRMN7APOFjs.h; exports.GlobalNotificationProvider = _chunkVM6JVOLDjs.g; exports.LoginComponent = _chunkRMN7APOFjs.m; exports.Policies = _chunkRMN7APOFjs.l; exports.SessionStatus = _chunkRMN7APOFjs.n; exports.SessionTimeIndicator = z; exports.UserProfileDisplay = _chunkRMN7APOFjs.i; exports.useGlobalNotification = _chunkVM6JVOLDjs.h;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJCQC42XCjs = require('./chunk-JCQC42XC.js');var _chunkVM6JVOLDjs = require('./chunk-VM6JVOLD.js');require('./chunk-YIIUEOXC.js');require('./chunk-34FAL7YW.js');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');function z({showBelowMinutes:f=5,position:m="bottom-right",colorNormal:c="#ed6c02",colorCritical:x="#d32f2f",style:u,className:g}={}){let{isAuthenticated:o,tokens:t}=_chunkVM6JVOLDjs.f.call(void 0, ),[i,y]=_react.useState.call(void 0, 0),[h,C]=_react.useState.call(void 0, 100);if(_react.useEffect.call(void 0, ()=>{if(!o||!t)return;let v=setInterval(()=>{let P=Date.now(),p=t.expiresAt-P,w=900*1e3;y(Math.max(0,p)),C(Math.max(0,p/w*100))},1e3);return()=>clearInterval(v)},[o,t]),!o||i<=0)return null;let e=Math.floor(i/6e4),S=Math.floor(i%6e4/1e3);if(e>=f)return null;let s=e<2,a=s?x:c,b={"top-left":{top:"16px",left:"16px"},"top-right":{top:"16px",right:"16px"},"bottom-left":{bottom:"16px",left:"16px"},"bottom-right":{bottom:"16px",right:"16px"}}[m];return _jsxruntime.jsxs.call(void 0, "div",{className:g,style:{position:"fixed",...b,padding:"12px 16px",backgroundColor:"white",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",minWidth:"200px",zIndex:9999,fontFamily:"system-ui, -apple-system, sans-serif",...u},children:[_jsxruntime.jsxs.call(void 0, "div",{style:{marginBottom:"8px"},children:[_jsxruntime.jsx.call(void 0, "div",{style:{fontSize:"12px",fontWeight:600,color:a,marginBottom:"4px"},children:s?"\u26A0\uFE0F Sesi\xF3n expirando":"\u23F0 Sesi\xF3n por expirar"}),_jsxruntime.jsxs.call(void 0, "div",{style:{fontSize:"14px",color:"#333",fontWeight:500},children:[e,":",S.toString().padStart(2,"0")]})]}),_jsxruntime.jsx.call(void 0, "div",{style:{width:"100%",height:"6px",backgroundColor:"#e0e0e0",borderRadius:"3px",overflow:"hidden"},children:_jsxruntime.jsx.call(void 0, "div",{style:{width:`${h}%`,height:"100%",backgroundColor:a,transition:"width 1s linear"}})})]})}exports.CrudiaAutoGenerate = _chunkJCQC42XCjs.o; exports.CrudiaFileField = _chunkJCQC42XCjs.p; exports.CrudiaMarkdownField = _chunkJCQC42XCjs.q; exports.CrudifyLogin = _chunkJCQC42XCjs.h; exports.GlobalNotificationProvider = _chunkVM6JVOLDjs.g; exports.LoginComponent = _chunkJCQC42XCjs.m; exports.Policies = _chunkJCQC42XCjs.l; exports.SessionStatus = _chunkJCQC42XCjs.n; exports.SessionTimeIndicator = z; exports.UserProfileDisplay = _chunkJCQC42XCjs.i; exports.useGlobalNotification = _chunkVM6JVOLDjs.h;
@@ -1 +1 @@
1
- import{h as N,i as T,l as M,m as k,n as G,o as L,p as A,q as R}from"./chunk-P2NHZZZY.mjs";import{f as d,g as F,h as I}from"./chunk-AD5AA75O.mjs";import"./chunk-BJ6PIVZR.mjs";import"./chunk-SUWV767V.mjs";import{useEffect as B,useState as l}from"react";import{jsx as r,jsxs as n}from"react/jsx-runtime";function z({showBelowMinutes:f=5,position:m="bottom-right",colorNormal:c="#ed6c02",colorCritical:x="#d32f2f",style:u,className:g}={}){let{isAuthenticated:o,tokens:t}=d(),[i,y]=l(0),[h,C]=l(100);if(B(()=>{if(!o||!t)return;let v=setInterval(()=>{let P=Date.now(),p=t.expiresAt-P,w=900*1e3;y(Math.max(0,p)),C(Math.max(0,p/w*100))},1e3);return()=>clearInterval(v)},[o,t]),!o||i<=0)return null;let e=Math.floor(i/6e4),S=Math.floor(i%6e4/1e3);if(e>=f)return null;let s=e<2,a=s?x:c,b={"top-left":{top:"16px",left:"16px"},"top-right":{top:"16px",right:"16px"},"bottom-left":{bottom:"16px",left:"16px"},"bottom-right":{bottom:"16px",right:"16px"}}[m];return n("div",{className:g,style:{position:"fixed",...b,padding:"12px 16px",backgroundColor:"white",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",minWidth:"200px",zIndex:9999,fontFamily:"system-ui, -apple-system, sans-serif",...u},children:[n("div",{style:{marginBottom:"8px"},children:[r("div",{style:{fontSize:"12px",fontWeight:600,color:a,marginBottom:"4px"},children:s?"\u26A0\uFE0F Sesi\xF3n expirando":"\u23F0 Sesi\xF3n por expirar"}),n("div",{style:{fontSize:"14px",color:"#333",fontWeight:500},children:[e,":",S.toString().padStart(2,"0")]})]}),r("div",{style:{width:"100%",height:"6px",backgroundColor:"#e0e0e0",borderRadius:"3px",overflow:"hidden"},children:r("div",{style:{width:`${h}%`,height:"100%",backgroundColor:a,transition:"width 1s linear"}})})]})}export{L as CrudiaAutoGenerate,A as CrudiaFileField,R as CrudiaMarkdownField,N as CrudifyLogin,F as GlobalNotificationProvider,k as LoginComponent,M as Policies,G as SessionStatus,z as SessionTimeIndicator,T as UserProfileDisplay,I as useGlobalNotification};
1
+ import{h as N,i as T,l as M,m as k,n as G,o as L,p as A,q as R}from"./chunk-SQPHAKLM.mjs";import{f as d,g as F,h as I}from"./chunk-AD5AA75O.mjs";import"./chunk-BJ6PIVZR.mjs";import"./chunk-SUWV767V.mjs";import{useEffect as B,useState as l}from"react";import{jsx as r,jsxs as n}from"react/jsx-runtime";function z({showBelowMinutes:f=5,position:m="bottom-right",colorNormal:c="#ed6c02",colorCritical:x="#d32f2f",style:u,className:g}={}){let{isAuthenticated:o,tokens:t}=d(),[i,y]=l(0),[h,C]=l(100);if(B(()=>{if(!o||!t)return;let v=setInterval(()=>{let P=Date.now(),p=t.expiresAt-P,w=900*1e3;y(Math.max(0,p)),C(Math.max(0,p/w*100))},1e3);return()=>clearInterval(v)},[o,t]),!o||i<=0)return null;let e=Math.floor(i/6e4),S=Math.floor(i%6e4/1e3);if(e>=f)return null;let s=e<2,a=s?x:c,b={"top-left":{top:"16px",left:"16px"},"top-right":{top:"16px",right:"16px"},"bottom-left":{bottom:"16px",left:"16px"},"bottom-right":{bottom:"16px",right:"16px"}}[m];return n("div",{className:g,style:{position:"fixed",...b,padding:"12px 16px",backgroundColor:"white",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",minWidth:"200px",zIndex:9999,fontFamily:"system-ui, -apple-system, sans-serif",...u},children:[n("div",{style:{marginBottom:"8px"},children:[r("div",{style:{fontSize:"12px",fontWeight:600,color:a,marginBottom:"4px"},children:s?"\u26A0\uFE0F Sesi\xF3n expirando":"\u23F0 Sesi\xF3n por expirar"}),n("div",{style:{fontSize:"14px",color:"#333",fontWeight:500},children:[e,":",S.toString().padStart(2,"0")]})]}),r("div",{style:{width:"100%",height:"6px",backgroundColor:"#e0e0e0",borderRadius:"3px",overflow:"hidden"},children:r("div",{style:{width:`${h}%`,height:"100%",backgroundColor:a,transition:"width 1s linear"}})})]})}export{L as CrudiaAutoGenerate,A as CrudiaFileField,R as CrudiaMarkdownField,N as CrudifyLogin,F as GlobalNotificationProvider,k as LoginComponent,M as Policies,G as SessionStatus,z as SessionTimeIndicator,T as UserProfileDisplay,I as useGlobalNotification};
@@ -1,4 +1,4 @@
1
- import { J as JwtPayload } from './api-RK-xY1Ah.mjs';
1
+ import { J as JwtPayload } from './api-C_I7deA9.mjs';
2
2
 
3
3
  interface JWTPayload extends JwtPayload {
4
4
  "cognito:username"?: string;
@@ -1,4 +1,4 @@
1
- import { J as JwtPayload } from './api-RK-xY1Ah.js';
1
+ import { J as JwtPayload } from './api-C_I7deA9.js';
2
2
 
3
3
  interface JWTPayload extends JwtPayload {
4
4
  "cognito:username"?: string;
package/dist/hooks.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- export { F as FileItem, v as FileStatus, d as SessionState, n as UseAuthReturn, p as UseDataReturn, s as UseFileUploadOptions, t as UseFileUploadReturn, U as UseSessionOptions, k as UseUserDataOptions, j as UseUserDataReturn, l as UserData, m as useAuth, w as useCrudifyWithNotifications, o as useData, r as useFileUpload, u as useSession, i as useUserData, q as useUserProfile } from './index-C4x7kAdv.mjs';
1
+ export { F as FileItem, v as FileStatus, d as SessionState, n as UseAuthReturn, p as UseDataReturn, s as UseFileUploadOptions, t as UseFileUploadReturn, U as UseSessionOptions, k as UseUserDataOptions, j as UseUserDataReturn, l as UserData, m as useAuth, w as useCrudifyWithNotifications, o as useData, r as useFileUpload, u as useSession, i as useUserData, q as useUserProfile } from './index-FpnmfpFM.mjs';
2
2
  export { A as AutoGenerateConfig, d as UseAutoGenerateOptions, U as UseAutoGenerateReturn, c as useAutoGenerate } from './GlobalNotificationProvider-Zq18OkpI.mjs';
3
- import './api-RK-xY1Ah.mjs';
3
+ import './api-C_I7deA9.mjs';
4
4
  import 'react/jsx-runtime';
5
5
  import 'react';
6
6
  import '@nocios/crudify-browser';
package/dist/hooks.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export { F as FileItem, v as FileStatus, d as SessionState, n as UseAuthReturn, p as UseDataReturn, s as UseFileUploadOptions, t as UseFileUploadReturn, U as UseSessionOptions, k as UseUserDataOptions, j as UseUserDataReturn, l as UserData, m as useAuth, w as useCrudifyWithNotifications, o as useData, r as useFileUpload, u as useSession, i as useUserData, q as useUserProfile } from './index-CEe4Y7WD.js';
1
+ export { F as FileItem, v as FileStatus, d as SessionState, n as UseAuthReturn, p as UseDataReturn, s as UseFileUploadOptions, t as UseFileUploadReturn, U as UseSessionOptions, k as UseUserDataOptions, j as UseUserDataReturn, l as UserData, m as useAuth, w as useCrudifyWithNotifications, o as useData, r as useFileUpload, u as useSession, i as useUserData, q as useUserProfile } from './index-DLlGvAEz.js';
2
2
  export { A as AutoGenerateConfig, d as UseAutoGenerateOptions, U as UseAutoGenerateReturn, c as useAutoGenerate } from './GlobalNotificationProvider-Zq18OkpI.js';
3
- import './api-RK-xY1Ah.js';
3
+ import './api-C_I7deA9.js';
4
4
  import 'react/jsx-runtime';
5
5
  import 'react';
6
6
  import '@nocios/crudify-browser';
package/dist/hooks.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk452ZFITEjs = require('./chunk-452ZFITE.js');var _chunkVM6JVOLDjs = require('./chunk-VM6JVOLD.js');require('./chunk-34FAL7YW.js');exports.useAuth = _chunk452ZFITEjs.b; exports.useAutoGenerate = _chunkVM6JVOLDjs.m; exports.useCrudifyWithNotifications = _chunk452ZFITEjs.d; exports.useData = _chunk452ZFITEjs.c; exports.useFileUpload = _chunkVM6JVOLDjs.p; exports.useSession = _chunkVM6JVOLDjs.f; exports.useUserData = _chunk452ZFITEjs.a; exports.useUserProfile = _chunkVM6JVOLDjs.l;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkCKGV4C6Ajs = require('./chunk-CKGV4C6A.js');var _chunkVM6JVOLDjs = require('./chunk-VM6JVOLD.js');require('./chunk-34FAL7YW.js');exports.useAuth = _chunkCKGV4C6Ajs.b; exports.useAutoGenerate = _chunkVM6JVOLDjs.m; exports.useCrudifyWithNotifications = _chunkCKGV4C6Ajs.d; exports.useData = _chunkCKGV4C6Ajs.c; exports.useFileUpload = _chunkVM6JVOLDjs.p; exports.useSession = _chunkVM6JVOLDjs.f; exports.useUserData = _chunkCKGV4C6Ajs.a; exports.useUserProfile = _chunkVM6JVOLDjs.l;
package/dist/hooks.mjs CHANGED
@@ -1 +1 @@
1
- import{a as s,b as u,c as a,d as p}from"./chunk-CUSGL4AB.mjs";import{f as e,l as t,m as o,p as r}from"./chunk-AD5AA75O.mjs";import"./chunk-SUWV767V.mjs";export{u as useAuth,o as useAutoGenerate,p as useCrudifyWithNotifications,a as useData,r as useFileUpload,e as useSession,s as useUserData,t as useUserProfile};
1
+ import{a as s,b as u,c as a,d as p}from"./chunk-IRHFZZXY.mjs";import{f as e,l as t,m as o,p as r}from"./chunk-AD5AA75O.mjs";import"./chunk-SUWV767V.mjs";export{u as useAuth,o as useAutoGenerate,p as useCrudifyWithNotifications,a as useData,r as useFileUpload,e as useSession,s as useUserData,t as useUserProfile};
@@ -1,4 +1,4 @@
1
- import { U as UserProfile, d as CrudifyRequestOptions, C as CrudifyApiResponse, e as TransactionInput } from './api-RK-xY1Ah.js';
1
+ import { U as UserProfile, d as CrudifyRequestOptions, C as CrudifyApiResponse, e as TransactionInput } from './api-C_I7deA9.js';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
  import { ReactNode } from 'react';
4
4
  import { b as NotificationSeverity } from './GlobalNotificationProvider-Zq18OkpI.js';
@@ -1,4 +1,4 @@
1
- import { U as UserProfile, d as CrudifyRequestOptions, C as CrudifyApiResponse, e as TransactionInput } from './api-RK-xY1Ah.mjs';
1
+ import { U as UserProfile, d as CrudifyRequestOptions, C as CrudifyApiResponse, e as TransactionInput } from './api-C_I7deA9.mjs';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
  import { ReactNode } from 'react';
4
4
  import { b as NotificationSeverity } from './GlobalNotificationProvider-Zq18OkpI.mjs';
package/dist/index.d.mts CHANGED
@@ -4,12 +4,12 @@ export { default as crudify } from '@nocios/crudify-browser';
4
4
  import { d as CrudifyLoginConfig } from './CrudiaMarkdownField-8s252xsM.mjs';
5
5
  export { B as BoxScreenType, a as CrudiaAutoGenerate, i as CrudiaAutoGenerateProps, b as CrudiaFileField, n as CrudiaFileFieldDeletionHandlers, j as CrudiaFileFieldProps, c as CrudiaMarkdownField, k as CrudiaMarkdownFieldProps, C as CrudifyLogin, e as CrudifyLoginProps, f as CrudifyLoginTranslations, L as LoginComponent, l as POLICY_ACTIONS, m as PREFERRED_POLICY_ORDER, P as Policies, h as PolicyAction, S as SessionStatus, g as UserLoginData, U as UserProfileDisplay } from './CrudiaMarkdownField-8s252xsM.mjs';
6
6
  import React, { ReactNode } from 'react';
7
- export { A as ApiError, C as CrudifyApiResponse, a as CrudifyTransactionResponse, F as ForgotPasswordRequest, J as JwtPayload, b as LoginRequest, L as LoginResponse, R as ResetPasswordRequest, T as TransactionResponseData, U as UserProfile, V as ValidateCodeRequest, c as ValidationError } from './api-RK-xY1Ah.mjs';
8
- export { F as FileItem, v as FileStatus, L as LoginResult, N as NotificationOptions, a as SessionConfig, g as SessionDebugInfo, S as SessionManager, e as SessionProvider, h as SessionProviderProps, d as SessionState, c as StorageType, b as TokenData, T as TokenStorage, n as UseAuthReturn, p as UseDataReturn, s as UseFileUploadOptions, t as UseFileUploadReturn, U as UseSessionOptions, k as UseUserDataOptions, j as UseUserDataReturn, l as UserData, m as useAuth, w as useCrudifyWithNotifications, o as useData, r as useFileUpload, u as useSession, f as useSessionContext, i as useUserData, q as useUserProfile } from './index-C4x7kAdv.mjs';
7
+ export { A as ApiError, C as CrudifyApiResponse, a as CrudifyTransactionResponse, F as ForgotPasswordRequest, J as JwtPayload, b as LoginRequest, L as LoginResponse, R as ResetPasswordRequest, T as TransactionResponseData, U as UserProfile, V as ValidateCodeRequest, c as ValidationError } from './api-C_I7deA9.mjs';
8
+ export { F as FileItem, v as FileStatus, L as LoginResult, N as NotificationOptions, a as SessionConfig, g as SessionDebugInfo, S as SessionManager, e as SessionProvider, h as SessionProviderProps, d as SessionState, c as StorageType, b as TokenData, T as TokenStorage, n as UseAuthReturn, p as UseDataReturn, s as UseFileUploadOptions, t as UseFileUploadReturn, U as UseSessionOptions, k as UseUserDataOptions, j as UseUserDataReturn, l as UserData, m as useAuth, w as useCrudifyWithNotifications, o as useData, r as useFileUpload, u as useSession, f as useSessionContext, i as useUserData, q as useUserProfile } from './index-FpnmfpFM.mjs';
9
9
  import * as react_jsx_runtime from 'react/jsx-runtime';
10
10
  import { ThemeOptions } from '@mui/material';
11
11
  export { A as AutoGenerateConfig, G as GlobalNotificationProvider, a as GlobalNotificationProviderProps, N as Notification, b as NotificationSeverity, d as UseAutoGenerateOptions, U as UseAutoGenerateReturn, c as useAutoGenerate, u as useGlobalNotification } from './GlobalNotificationProvider-Zq18OkpI.mjs';
12
- export { E as ERROR_CODES, j as ERROR_SEVERITY_MAP, n as ErrorCode, o as ErrorSeverity, q as ErrorTranslationConfig, P as ParsedError, m as createErrorTranslator, d as decodeJwtSafely, a as getCookie, g as getCurrentUserEmail, f as getErrorMessage, h as handleCrudifyError, i as isTokenExpired, p as parseApiError, e as parseJavaScriptError, c as parseTransactionError, b as secureLocalStorage, s as secureSessionStorage, l as translateError, t as translateErrorCode, k as translateErrorCodes } from './errorTranslation-B4wcHzD3.mjs';
12
+ export { E as ERROR_CODES, j as ERROR_SEVERITY_MAP, n as ErrorCode, o as ErrorSeverity, q as ErrorTranslationConfig, P as ParsedError, m as createErrorTranslator, d as decodeJwtSafely, a as getCookie, g as getCurrentUserEmail, f as getErrorMessage, h as handleCrudifyError, i as isTokenExpired, p as parseApiError, e as parseJavaScriptError, c as parseTransactionError, b as secureLocalStorage, s as secureSessionStorage, l as translateError, t as translateErrorCode, k as translateErrorCodes } from './errorTranslation-CXaKqIZY.mjs';
13
13
  import { ApiResponse, IModule, ModuleCreateInput, ModuleEditInput, ActionListFilters, IAction, ActionCreateInput, ActionEditInput, UpdateActionsProfilesInput, UpdateActionsProfilesResponse } from '@nocios/crudify-admin';
14
14
  export { ActionCreateInput, ActionEditInput, ActionListFilters, ApiResponse, IAction, IModule, ModuleCreateInput, ModuleEditInput, UpdateActionsProfilesInput, UpdateActionsProfilesResponse } from '@nocios/crudify-admin';
15
15
 
@@ -730,12 +730,12 @@ declare const CRITICAL_TRANSLATIONS: {
730
730
  readonly "checkCode.resendCodeLink": "Reenviar código";
731
731
  readonly "checkCode.title": "Verificar Código";
732
732
  readonly "checkCode.verifyButton": "Verificar Código";
733
- readonly "common.back": "Volver";
734
- readonly "common.backToLogin": "Volver";
733
+ readonly "base.btn.back": "Volver";
734
+ readonly "base.btn.cancel": "Cancelar";
735
735
  readonly "error.app.config": "Error de Configuración: {{message}}";
736
736
  readonly "error.app.initialization": "Error durante la inicialización final de la aplicación.";
737
737
  readonly "error.transaction": "Error en la operación";
738
- readonly "error.unknown": "Ocurrió un error desconocido.";
738
+ readonly "base.errors.errorUnknown": "Ocurrió un error desconocido.";
739
739
  readonly "errors.DUPLICATE": "El campo <b>{{field}}</b> debe ser único.";
740
740
  readonly "errors.FOREIGN_KEY_NOT_FOUND": "El campo <b>{{field}}</b> debe referenciar un ítem existente.";
741
741
  readonly "errors.INVALID_EMAIL": "El campo <b>{{field}}</b> debe ser un correo electrónico válido.";
@@ -788,11 +788,11 @@ declare const CRITICAL_TRANSLATIONS: {
788
788
  readonly "forgotPassword.invalidEmail": "Ingresa un correo electrónico válido";
789
789
  readonly "forgotPassword.sendCodeButton": "Enviar Código";
790
790
  readonly "forgotPassword.title": "Recuperar Contraseña";
791
- readonly "loading.app.configInitial": "Cargando configuración inicial...";
792
- readonly "loading.app.generic": "Cargando...";
793
- readonly "loading.app.starting": "Iniciando aplicación...";
794
- readonly "loading.app.themeSetup": "Generando tema...";
795
- readonly "loading.app.validatingSession": "Validando sesión...";
791
+ readonly "base.loading.configInitial": "Cargando configuración inicial...";
792
+ readonly "base.loading.pleaseWait": "Cargando, por favor espera...";
793
+ readonly "base.loading.starting": "Iniciando aplicación...";
794
+ readonly "base.loading.themeSetup": "Generando tema...";
795
+ readonly "base.loading.validatingSession": "Validando sesión...";
796
796
  readonly "login.alreadyHaveCodeLink": "¿Ya tienes un código?";
797
797
  readonly "login.forgotPasswordLink": "¿Olvidaste tu contraseña?";
798
798
  readonly "login.initializationError": "Error de inicialización";
@@ -827,29 +827,29 @@ declare const CRITICAL_TRANSLATIONS: {
827
827
  readonly "resetPassword.successMessage": "Contraseña restablecida exitosamente";
828
828
  readonly "resetPassword.title": "Nueva Contraseña";
829
829
  readonly "resetPassword.validatingCode": "Validando código...";
830
- readonly "modules.form.publicPolicies.fields.conditions.customEdit": "Edición personalizada";
831
- readonly "file.clickToPreview": "Clic para ver imagen";
832
- readonly "file.clickToDownload": "Clic para descargar";
833
- readonly "file.privateFile": "Archivo privado";
834
- readonly "file.noPreview": "Sin vista previa";
835
- readonly "file.dropHere": "Suelta el archivo aquí";
836
- readonly "file.dragOrClick": "Arrastra archivos aquí o haz clic para seleccionar";
837
- readonly "file.uploading": "Subiendo archivos...";
838
- readonly "file.restore": "Restaurar";
839
- readonly "file.delete": "Eliminar";
840
- readonly "file.pendingDeletion": "Pendiente de eliminación";
841
- readonly "file.allowedTypes": "Tipos permitidos: {{types}}";
842
- readonly "file.maxSize": "Máximo {{size}} por archivo";
843
- readonly "file.maxFiles": "Máximo {{count}} archivos";
844
- readonly "file.validation.minFilesRequired": "Se requiere al menos un archivo";
845
- readonly "file.validation.minFilesRequiredPlural": "Se requieren al menos {{count}} archivos";
846
- readonly "file.validation.maxFilesExceeded": "Máximo {{count}} archivos permitidos";
847
- readonly "file.validation.filesWithErrors": "Algunos archivos tienen errores";
848
- readonly "file.confirmDelete.title": "Eliminar archivo";
849
- readonly "file.confirmDelete.message": "¿Estás seguro de que deseas eliminar este archivo? Esta acción no se puede deshacer.";
850
- readonly "file.confirmDelete.confirm": "Eliminar";
851
- readonly "file.confirmDelete.cancel": "Cancelar";
852
- readonly "file.deleting": "Eliminando...";
830
+ readonly "publicPolicies.fields.conditions.customEdit": "Edición personalizada";
831
+ readonly "base.file.clickToPreview": "Clic para ver imagen";
832
+ readonly "base.file.clickToDownload": "Clic para descargar";
833
+ readonly "base.file.privateFile": "Archivo privado";
834
+ readonly "base.file.noPreview": "Sin vista previa";
835
+ readonly "base.file.dropHere": "Suelta el archivo aquí";
836
+ readonly "base.file.dragOrClick": "Arrastra archivos aquí o haz clic para seleccionar";
837
+ readonly "base.file.uploading": "Subiendo archivos...";
838
+ readonly "base.file.restore": "Restaurar";
839
+ readonly "base.file.delete": "Eliminar";
840
+ readonly "base.file.pendingDeletion": "Pendiente de eliminación";
841
+ readonly "base.file.allowedTypes": "Tipos permitidos: {{types}}";
842
+ readonly "base.file.maxSize": "Máximo {{size}} por archivo";
843
+ readonly "base.file.maxFiles": "Máximo {{count}} archivos";
844
+ readonly "base.file.validation.minFilesRequired": "Se requiere al menos un archivo";
845
+ readonly "base.file.validation.minFilesRequiredPlural": "Se requieren al menos {{count}} archivos";
846
+ readonly "base.file.validation.maxFilesExceeded": "Máximo {{count}} archivos permitidos";
847
+ readonly "base.file.validation.filesWithErrors": "Algunos archivos tienen errores";
848
+ readonly "base.file.confirmDelete.title": "Eliminar archivo";
849
+ readonly "base.file.confirmDelete.message": "¿Estás seguro de que deseas eliminar este archivo? Esta acción no se puede deshacer.";
850
+ readonly "base.file.confirmDelete.confirm": "Eliminar";
851
+ readonly "base.file.confirmDelete.cancel": "Cancelar";
852
+ readonly "base.file.deleting": "Eliminando...";
853
853
  };
854
854
  readonly en: {
855
855
  readonly "checkCode.codeLabel": "Verification Code";
@@ -863,12 +863,12 @@ declare const CRITICAL_TRANSLATIONS: {
863
863
  readonly "checkCode.resendCodeLink": "Resend code";
864
864
  readonly "checkCode.title": "Verify Code";
865
865
  readonly "checkCode.verifyButton": "Verify Code";
866
- readonly "common.back": "Back";
867
- readonly "common.backToLogin": "Back to Login";
866
+ readonly "base.btn.back": "Back";
867
+ readonly "base.btn.cancel": "Cancel";
868
868
  readonly "error.app.config": "Configuration Error: {{message}}";
869
869
  readonly "error.app.initialization": "Error during final application initialization.";
870
870
  readonly "error.transaction": "Operation error";
871
- readonly "error.unknown": "An unknown error occurred.";
871
+ readonly "base.errors.errorUnknown": "An unknown error occurred.";
872
872
  readonly "errors.DUPLICATE": "The field <b>{{field}}</b> must be unique.";
873
873
  readonly "errors.FOREIGN_KEY_NOT_FOUND": "The field <b>{{field}}</b> must reference an existing item.";
874
874
  readonly "errors.INVALID_EMAIL": "The field <b>{{field}}</b> must be a valid email address.";
@@ -921,11 +921,11 @@ declare const CRITICAL_TRANSLATIONS: {
921
921
  readonly "forgotPassword.invalidEmail": "Enter a valid email address";
922
922
  readonly "forgotPassword.sendCodeButton": "Send Code";
923
923
  readonly "forgotPassword.title": "Reset Password";
924
- readonly "loading.app.configInitial": "Loading initial configuration...";
925
- readonly "loading.app.generic": "Loading...";
926
- readonly "loading.app.starting": "Starting application...";
927
- readonly "loading.app.themeSetup": "Generating theme...";
928
- readonly "loading.app.validatingSession": "Validating session...";
924
+ readonly "base.loading.configInitial": "Loading initial configuration...";
925
+ readonly "base.loading.pleaseWait": "Loading, please wait...";
926
+ readonly "base.loading.starting": "Starting application...";
927
+ readonly "base.loading.themeSetup": "Generating theme...";
928
+ readonly "base.loading.validatingSession": "Validating session...";
929
929
  readonly "login.alreadyHaveCodeLink": "Already have a code?";
930
930
  readonly "login.forgotPasswordLink": "Forgot Password?";
931
931
  readonly "login.initializationError": "Initialization error";
@@ -960,29 +960,29 @@ declare const CRITICAL_TRANSLATIONS: {
960
960
  readonly "resetPassword.successMessage": "Password reset successfully";
961
961
  readonly "resetPassword.title": "New Password";
962
962
  readonly "resetPassword.validatingCode": "Validating code...";
963
- readonly "modules.form.publicPolicies.fields.conditions.customEdit": "Custom Edit";
964
- readonly "file.clickToPreview": "Click to preview";
965
- readonly "file.clickToDownload": "Click to download";
966
- readonly "file.privateFile": "Private file";
967
- readonly "file.noPreview": "No preview";
968
- readonly "file.dropHere": "Drop file here";
969
- readonly "file.dragOrClick": "Drag files here or click to select";
970
- readonly "file.uploading": "Uploading files...";
971
- readonly "file.restore": "Restore";
972
- readonly "file.delete": "Delete";
973
- readonly "file.pendingDeletion": "Pending deletion";
974
- readonly "file.allowedTypes": "Allowed types: {{types}}";
975
- readonly "file.maxSize": "Max {{size}} per file";
976
- readonly "file.maxFiles": "Max {{count}} files";
977
- readonly "file.validation.minFilesRequired": "At least one file is required";
978
- readonly "file.validation.minFilesRequiredPlural": "At least {{count}} files are required";
979
- readonly "file.validation.maxFilesExceeded": "Maximum {{count}} files allowed";
980
- readonly "file.validation.filesWithErrors": "Some files have errors";
981
- readonly "file.confirmDelete.title": "Delete file";
982
- readonly "file.confirmDelete.message": "Are you sure you want to delete this file? This action cannot be undone.";
983
- readonly "file.confirmDelete.confirm": "Delete";
984
- readonly "file.deleting": "Deleting...";
985
- readonly "file.confirmDelete.cancel": "Cancel";
963
+ readonly "publicPolicies.fields.conditions.customEdit": "Custom Edit";
964
+ readonly "base.file.clickToPreview": "Click to preview";
965
+ readonly "base.file.clickToDownload": "Click to download";
966
+ readonly "base.file.privateFile": "Private file";
967
+ readonly "base.file.noPreview": "No preview";
968
+ readonly "base.file.dropHere": "Drop file here";
969
+ readonly "base.file.dragOrClick": "Drag files here or click to select";
970
+ readonly "base.file.uploading": "Uploading files...";
971
+ readonly "base.file.restore": "Restore";
972
+ readonly "base.file.delete": "Delete";
973
+ readonly "base.file.pendingDeletion": "Pending deletion";
974
+ readonly "base.file.allowedTypes": "Allowed types: {{types}}";
975
+ readonly "base.file.maxSize": "Max {{size}} per file";
976
+ readonly "base.file.maxFiles": "Max {{count}} files";
977
+ readonly "base.file.validation.minFilesRequired": "At least one file is required";
978
+ readonly "base.file.validation.minFilesRequiredPlural": "At least {{count}} files are required";
979
+ readonly "base.file.validation.maxFilesExceeded": "Maximum {{count}} files allowed";
980
+ readonly "base.file.validation.filesWithErrors": "Some files have errors";
981
+ readonly "base.file.confirmDelete.title": "Delete file";
982
+ readonly "base.file.confirmDelete.message": "Are you sure you want to delete this file? This action cannot be undone.";
983
+ readonly "base.file.confirmDelete.confirm": "Delete";
984
+ readonly "base.file.deleting": "Deleting...";
985
+ readonly "base.file.confirmDelete.cancel": "Cancel";
986
986
  };
987
987
  };
988
988
  type CriticalTranslationKey = keyof typeof CRITICAL_TRANSLATIONS.es;