{"version":3,"sources":["src/shared/services/modal-info.service.ts","src/shared/components/modal-info/modal-info.component.ts","src/shared/components/modal-info/modal-info.component.html","src/shared/components/modal-info/modal-info.module.ts","node_modules/@angular/forms/fesm2022/forms.mjs"],"sourcesContent":["// modal.service.ts\nimport { Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { ModalData } from '../models/modal-data';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ModalService {\n private modalDataSubject = new BehaviorSubject(null);\n private showModalSubject = new BehaviorSubject(false);\n\n modalData$: Observable =\n this.modalDataSubject.asObservable();\n showModal$: Observable = this.showModalSubject.asObservable();\n\n openModal(data: ModalData): void {\n this.modalDataSubject.next(data);\n this.showModalSubject.next(true);\n\n if (data.autoCloseSeconds > 0) {\n setTimeout(() => this.closeModal(), data.autoCloseSeconds * 1000);\n }\n }\n\n closeModal(): void {\n this.showModalSubject.next(false);\n }\n}\n","// modal-info.component.ts\nimport { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { ModalData } from '../../models/modal-data';\n\n// Extendemos la interfaz ModalData para incluir la función opcional\ninterface ExtendedModalData extends ModalData {\n onCloseHandler?: () => void;\n}\n\n@Component({\n selector: 'app-modal-info',\n templateUrl: './modal-info.component.html',\n styleUrls: ['./modal-info.component.scss'],\n})\nexport class ModalInfoComponent {\n private _modalData: ExtendedModalData = {\n content: [''],\n imageUrl: 'ruta/a/tu/imagen.png',\n showCloseButton: false,\n autoCloseSeconds: 5,\n };\n\n @Input()\n set modalData(value: ExtendedModalData) {\n this._modalData = value;\n this.setupAutoClose();\n }\n\n get modalData(): ExtendedModalData {\n return this._modalData;\n }\n\n @Output() close = new EventEmitter();\n\n private autoCloseTimer: number | null = null;\n\n setupAutoClose() {\n this.clearAutoCloseTimer();\n if (this._modalData.autoCloseSeconds > 0) {\n this.autoCloseTimer = window.setTimeout(() => {\n this.closeModal();\n }, this._modalData.autoCloseSeconds * 1000);\n }\n }\n\n clearAutoCloseTimer() {\n if (this.autoCloseTimer !== null) {\n window.clearTimeout(this.autoCloseTimer);\n this.autoCloseTimer = null;\n }\n }\n\n closeModal() {\n this.clearAutoCloseTimer();\n\n // Ejecutar el método personalizado si existe\n if (this._modalData.onCloseHandler) {\n this._modalData.onCloseHandler();\n }\n\n this.close.emit();\n }\n}\n","
\n
\n
\n
\n \n ×\n \n \n
\n

\n
\n
\n
\n
\n
\n
\n","// modal-info.module.ts\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ModalService } from '../../services/modal-info.service';\nimport { ModalInfoComponent } from './modal-info.component';\n\n@NgModule({\n declarations: [ModalInfoComponent],\n imports: [CommonModule],\n exports: [ModalInfoComponent],\n providers: [ModalService],\n})\nexport class ModalInfoModule {}\n","/**\n * @license Angular v18.2.4\n * (c) 2010-2024 Google LLC. https://angular.io/\n * License: MIT\n */\n\nimport * as i0 from '@angular/core';\nimport { Directive, InjectionToken, forwardRef, Optional, Inject, ɵisPromise, ɵisSubscribable, ɵRuntimeError, Self, computed, signal, untracked, EventEmitter, Input, Host, SkipSelf, booleanAttribute, ChangeDetectorRef, Output, Injectable, inject, NgModule, Version } from '@angular/core';\nimport { ɵgetDOM } from '@angular/common';\nimport { from, forkJoin, Subject } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\n/**\n * Base class for all ControlValueAccessor classes defined in Forms package.\n * Contains common logic and utility functions.\n *\n * Note: this is an *internal-only* class and should not be extended or used directly in\n * applications code.\n */\nclass BaseControlValueAccessor {\n constructor(_renderer, _elementRef) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n /**\n * The registered callback function called when a change or input event occurs on the input\n * element.\n * @nodoc\n */\n this.onChange = _ => {};\n /**\n * The registered callback function called when a blur event occurs on the input element.\n * @nodoc\n */\n this.onTouched = () => {};\n }\n /**\n * Helper method that sets a property on a target element using the current Renderer\n * implementation.\n * @nodoc\n */\n setProperty(key, value) {\n this._renderer.setProperty(this._elementRef.nativeElement, key, value);\n }\n /**\n * Registers a function called when the control is touched.\n * @nodoc\n */\n registerOnTouched(fn) {\n this.onTouched = fn;\n }\n /**\n * Registers a function called when the control value changes.\n * @nodoc\n */\n registerOnChange(fn) {\n this.onChange = fn;\n }\n /**\n * Sets the \"disabled\" property on the range input element.\n * @nodoc\n */\n setDisabledState(isDisabled) {\n this.setProperty('disabled', isDisabled);\n }\n static {\n this.ɵfac = function BaseControlValueAccessor_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || BaseControlValueAccessor)(i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ElementRef));\n };\n }\n static {\n this.ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: BaseControlValueAccessor\n });\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(BaseControlValueAccessor, [{\n type: Directive\n }], () => [{\n type: i0.Renderer2\n }, {\n type: i0.ElementRef\n }], null);\n})();\n/**\n * Base class for all built-in ControlValueAccessor classes (except DefaultValueAccessor, which is\n * used in case no other CVAs can be found). We use this class to distinguish between default CVA,\n * built-in CVAs and custom CVAs, so that Forms logic can recognize built-in CVAs and treat custom\n * ones with higher priority (when both built-in and custom CVAs are present).\n *\n * Note: this is an *internal-only* class and should not be extended or used directly in\n * applications code.\n */\nclass BuiltInControlValueAccessor extends BaseControlValueAccessor {\n static {\n this.ɵfac = /* @__PURE__ */(() => {\n let ɵBuiltInControlValueAccessor_BaseFactory;\n return function BuiltInControlValueAccessor_Factory(__ngFactoryType__) {\n return (ɵBuiltInControlValueAccessor_BaseFactory || (ɵBuiltInControlValueAccessor_BaseFactory = i0.ɵɵgetInheritedFactory(BuiltInControlValueAccessor)))(__ngFactoryType__ || BuiltInControlValueAccessor);\n };\n })();\n }\n static {\n this.ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: BuiltInControlValueAccessor,\n features: [i0.ɵɵInheritDefinitionFeature]\n });\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(BuiltInControlValueAccessor, [{\n type: Directive\n }], null, null);\n})();\n/**\n * Used to provide a `ControlValueAccessor` for form controls.\n *\n * See `DefaultValueAccessor` for how to implement one.\n *\n * @publicApi\n */\nconst NG_VALUE_ACCESSOR = new InjectionToken(ngDevMode ? 'NgValueAccessor' : '');\nconst CHECKBOX_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => CheckboxControlValueAccessor),\n multi: true\n};\n/**\n * @description\n * A `ControlValueAccessor` for writing a value and listening to changes on a checkbox input\n * element.\n *\n * @usageNotes\n *\n * ### Using a checkbox with a reactive form.\n *\n * The following example shows how to use a checkbox with a reactive form.\n *\n * ```ts\n * const rememberLoginControl = new FormControl();\n * ```\n *\n * ```\n * \n * ```\n *\n * @ngModule ReactiveFormsModule\n * @ngModule FormsModule\n * @publicApi\n */\nclass CheckboxControlValueAccessor extends BuiltInControlValueAccessor {\n /**\n * Sets the \"checked\" property on the input element.\n * @nodoc\n */\n writeValue(value) {\n this.setProperty('checked', value);\n }\n static {\n this.ɵfac = /* @__PURE__ */(() => {\n let ɵCheckboxControlValueAccessor_BaseFactory;\n return function CheckboxControlValueAccessor_Factory(__ngFactoryType__) {\n return (ɵCheckboxControlValueAccessor_BaseFactory || (ɵCheckboxControlValueAccessor_BaseFactory = i0.ɵɵgetInheritedFactory(CheckboxControlValueAccessor)))(__ngFactoryType__ || CheckboxControlValueAccessor);\n };\n })();\n }\n static {\n this.ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: CheckboxControlValueAccessor,\n selectors: [[\"input\", \"type\", \"checkbox\", \"formControlName\", \"\"], [\"input\", \"type\", \"checkbox\", \"formControl\", \"\"], [\"input\", \"type\", \"checkbox\", \"ngModel\", \"\"]],\n hostBindings: function CheckboxControlValueAccessor_HostBindings(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵlistener(\"change\", function CheckboxControlValueAccessor_change_HostBindingHandler($event) {\n return ctx.onChange($event.target.checked);\n })(\"blur\", function CheckboxControlValueAccessor_blur_HostBindingHandler() {\n return ctx.onTouched();\n });\n }\n },\n features: [i0.ɵɵProvidersFeature([CHECKBOX_VALUE_ACCESSOR]), i0.ɵɵInheritDefinitionFeature]\n });\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(CheckboxControlValueAccessor, [{\n type: Directive,\n args: [{\n selector: 'input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]',\n host: {\n '(change)': 'onChange($event.target.checked)',\n '(blur)': 'onTouched()'\n },\n providers: [CHECKBOX_VALUE_ACCESSOR]\n }]\n }], null, null);\n})();\nconst DEFAULT_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DefaultValueAccessor),\n multi: true\n};\n/**\n * We must check whether the agent is Android because composition events\n * behave differently between iOS and Android.\n */\nfunction _isAndroid() {\n const userAgent = ɵgetDOM() ? ɵgetDOM().getUserAgent() : '';\n return /android (\\d+)/.test(userAgent.toLowerCase());\n}\n/**\n * @description\n * Provide this token to control if form directives buffer IME input until\n * the \"compositionend\" event occurs.\n * @publicApi\n */\nconst COMPOSITION_BUFFER_MODE = new InjectionToken(ngDevMode ? 'CompositionEventMode' : '');\n/**\n * The default `ControlValueAccessor` for writing a value and listening to changes on input\n * elements. The accessor is used by the `FormControlDirective`, `FormControlName`, and\n * `NgModel` directives.\n *\n *\n * @usageNotes\n *\n * ### Using the default value accessor\n *\n * The following example shows how to use an input element that activates the default value accessor\n * (in this case, a text field).\n *\n * ```ts\n * const firstNameControl = new FormControl();\n * ```\n *\n * ```\n * \n * ```\n *\n * This value accessor is used by default for `` and `