{"version":3,"file":"g2-common-reference-documents.mjs","sources":["../../../projects/reference-documents/src/lib/components/tab-item/tab-item.component.ts","../../../projects/reference-documents/src/lib/components/tab-item/tab-item.component.html","../../../projects/reference-documents/src/lib/components/tabs/tabs.component.ts","../../../projects/reference-documents/src/lib/components/tabs/tabs.component.html","../../../projects/reference-documents/src/lib/animations.ts","../../../projects/reference-documents/src/lib/components/reference-document-to-tab/delete/delete.component.ts","../../../projects/reference-documents/src/lib/components/reference-document-to-tab/delete/delete.component.html","../../../projects/reference-documents/src/lib/components/reference-document-to-tab/reference-document-to-tab.component.ts","../../../projects/reference-documents/src/lib/components/reference-document-to-tab/reference-document-to-tab.component.html","../../../projects/reference-documents/src/lib/components/reference-document-by-tab/delete/delete.component.ts","../../../projects/reference-documents/src/lib/components/reference-document-by-tab/delete/delete.component.html","../../../projects/reference-documents/src/lib/components/reference-document-by-tab/reference-document-by-tab.component.ts","../../../projects/reference-documents/src/lib/components/reference-document-by-tab/reference-document-by-tab.component.html","../../../projects/reference-documents/src/lib/components/add/add.component.ts","../../../projects/reference-documents/src/lib/components/add/add.component.html","../../../projects/reference-documents/src/lib/reference-documents.component.ts","../../../projects/reference-documents/src/lib/reference-documents.component.html","../../../projects/reference-documents/src/public-api.ts","../../../projects/reference-documents/src/g2-common-reference-documents.ts"],"sourcesContent":["import {\r\n  ChangeDetectionStrategy,\r\n  Component,\r\n  TemplateRef,\r\n  input,\r\n} from '@angular/core';\r\n\r\n@Component({\r\n  selector: 'lib-tab-item',\r\n  standalone: true,\r\n  imports: [],\r\n  templateUrl: './tab-item.component.html',\r\n  styleUrl: './tab-item.component.css',\r\n  changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class TabItemComponent {\r\n  tabName = input.required<string>();\r\n  templateRef = input.required<TemplateRef<any>>();\r\n}\r\n","<p>tab-item works!</p>\r\n","import {\r\n  AfterContentInit,\r\n  ChangeDetectionStrategy,\r\n  Component,\r\n  contentChildren,\r\n  signal,\r\n} from '@angular/core';\r\nimport { TabItemComponent } from '../tab-item/tab-item.component';\r\nimport { NgClass, NgTemplateOutlet } from '@angular/common';\r\nimport { CbmHorizontalOverflowShadowDirective } from '@g2-common/horizontal-overflow-shadow-directive';\r\n\r\n@Component({\r\n  selector: 'lib-tabs',\r\n  standalone: true,\r\n  imports: [\r\n    TabItemComponent,\r\n    NgClass,\r\n    NgTemplateOutlet,\r\n    CbmHorizontalOverflowShadowDirective,\r\n  ],\r\n  templateUrl: './tabs.component.html',\r\n  styleUrl: './tabs.component.css',\r\n  changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class TabsComponent implements AfterContentInit {\r\n  // #region children\r\n  tabs = contentChildren(TabItemComponent);\r\n\r\n  // #region state\r\n  activeTab = signal<TabItemComponent | null>(null);\r\n\r\n  // #region hooks\r\n  ngAfterContentInit(): void {\r\n    this.activeTab.set(this.tabs()[0]);\r\n  }\r\n}\r\n","<div>\r\n  <div class=\"flex overflow-auto\" cbmHorizontalOverflowShadow>\r\n    @for (tab of tabs(); track tab.tabName) {\r\n      <button\r\n        [ngClass]=\"{\r\n          'bg-info text-white hover:text-white': tab === activeTab(),\r\n          'text-info hover:text-[#7460ee]': tab !== activeTab()\r\n        }\"\r\n        class=\"outline-none py-2 px-5 rounded-full flex justify-center items-center font-normal transition-colors text-nowrap\"\r\n        (click)=\"activeTab.set(tab)\"\r\n        type=\"button\"\r\n      >\r\n        {{ tab.tabName() }}\r\n      </button>\r\n    }\r\n  </div>\r\n\r\n  @if (activeTab()) {\r\n    <div class=\"mt-4\">\r\n      <ng-template\r\n        [ngTemplateOutlet]=\"activeTab()!.templateRef()\"\r\n      ></ng-template>\r\n    </div>\r\n  }\r\n</div>\r\n","import { animate, style, transition, trigger } from '@angular/animations';\r\n\r\nexport const fadeInOutAnimation = trigger('fadeInOutAnimation', [\r\n  transition(':enter', [\r\n    style({ opacity: 0 }),\r\n    animate('100ms ease-out', style({ opacity: 1 })),\r\n  ]),\r\n  transition(':leave', [\r\n    style({ opacity: 1 }),\r\n    animate('100ms ease-in', style({ opacity: 0 })),\r\n  ]),\r\n]);\r\n","import { DatePipe } from '@angular/common';\r\nimport {\r\n  ChangeDetectionStrategy,\r\n  Component,\r\n  DestroyRef,\r\n  OnChanges,\r\n  SimpleChanges,\r\n  input,\r\n  output,\r\n  signal,\r\n} from '@angular/core';\r\nimport { FormControl, ReactiveFormsModule, Validators } from '@angular/forms';\r\nimport {\r\n  CbmDocumentReferenceModel,\r\n  CbmDocumentReferenceRepository,\r\n} from '@g2-common/document-reference-repository';\r\nimport { CbmErrorTranslatePipe } from '@g2-common/error-translate-pipe';\r\nimport { TStatus } from '../../../types';\r\nimport { CbmNotificationService } from '@g2-common/notification-service';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { fadeInOutAnimation } from '../../../animations';\r\n\r\n@Component({\r\n  selector: 'lib-delete',\r\n  standalone: true,\r\n  imports: [DatePipe, ReactiveFormsModule, CbmErrorTranslatePipe],\r\n  templateUrl: './delete.component.html',\r\n  styleUrl: './delete.component.css',\r\n  changeDetection: ChangeDetectionStrategy.OnPush,\r\n  animations: [fadeInOutAnimation],\r\n  host: { id: crypto.randomUUID() },\r\n})\r\nexport class DeleteComponent implements OnChanges {\r\n  // #region inputs\r\n  document = input.required<CbmDocumentReferenceModel.ListResponse.Data>();\r\n\r\n  // #region output\r\n  goBack = output<void>();\r\n  remove = output<void>();\r\n\r\n  // #region state\r\n  statusOfDelete = signal<TStatus>('init');\r\n\r\n  // #region controls\r\n  confirmControl = new FormControl<string | null>(null);\r\n\r\n  // #region constructor\r\n  constructor(\r\n    private notificationService: CbmNotificationService,\r\n    private documentReferenceRepository: CbmDocumentReferenceRepository,\r\n    private destroyRef: DestroyRef,\r\n  ) {}\r\n\r\n  // #region hooks\r\n  ngOnChanges(changes: SimpleChanges): void {\r\n    if (changes['document']) {\r\n      this.confirmControl.setValidators([\r\n        Validators.required,\r\n        Validators.pattern(this.document().document_destination_name),\r\n      ]);\r\n    }\r\n  }\r\n\r\n  // #region methods\r\n  getTransactionType(collectionName: string): string {\r\n    switch (collectionName) {\r\n      case 'goods_receipts':\r\n        return 'Entrada de mercancías';\r\n      case 'goods_issue':\r\n        return 'Salida de mercancías';\r\n      case 'income':\r\n        return 'Gestión de cobranza a clientes';\r\n      case 'document_liquidation':\r\n        return 'Liquidación de documentos';\r\n      case 'invoice':\r\n        return 'Factura';\r\n      default:\r\n        return 'Externo';\r\n    }\r\n  }\r\n\r\n  deleteDocument(): void {\r\n    if (this.confirmControl.invalid) {\r\n      this.confirmControl.markAllAsTouched();\r\n\r\n      this.notificationService.sendAlert({\r\n        type: 'toast',\r\n        status: 'error',\r\n        message: 'El formulario contiene datos inválidos o incompletos',\r\n      });\r\n\r\n      return;\r\n    }\r\n\r\n    this.statusOfDelete.set('loading');\r\n\r\n    this.documentReferenceRepository\r\n      .delete(this.document()._id)\r\n      .pipe(takeUntilDestroyed(this.destroyRef))\r\n      .subscribe({\r\n        next: (response) => {\r\n          this.statusOfDelete.set('success');\r\n\r\n          this.notificationService.sendAlert({\r\n            type: 'sweetAlert',\r\n            status: 'success',\r\n            message: response.data,\r\n          });\r\n\r\n          this.remove.emit();\r\n        },\r\n        error: (error) => {\r\n          this.statusOfDelete.set('failed');\r\n\r\n          this.notificationService.sendAlert({\r\n            type: 'sweetAlert',\r\n            status: 'error',\r\n            message: JSON.stringify(error.error?.message),\r\n          });\r\n        },\r\n      });\r\n  }\r\n}\r\n","<section class=\"flex shadow-md rounded-md border-r border-info\">\r\n  <div class=\"bg-light-info text-info p-4\">\r\n    <svg\r\n      xmlns=\"http://www.w3.org/2000/svg\"\r\n      width=\"25\"\r\n      height=\"25\"\r\n      viewBox=\"0 0 24 24\"\r\n      fill=\"none\"\r\n      stroke=\"currentColor\"\r\n      stroke-width=\"2\"\r\n      stroke-linecap=\"round\"\r\n      stroke-linejoin=\"round\"\r\n    >\r\n      <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n      <path d=\"M14 3v4a1 1 0 0 0 1 1h4\" />\r\n      <path\r\n        d=\"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z\"\r\n      />\r\n    </svg>\r\n  </div>\r\n  <div class=\"flex-grow flex-col p-4\">\r\n    <h3 class=\"text-info text-xl font-bold\">\r\n      {{ document().document_destination_name }}\r\n    </h3>\r\n\r\n    <div class=\"flex flex-col sm:flex-row gap-4 items-stretch mt-3\">\r\n      <div\r\n        class=\"sm:flex-grow text-base leading-5 text-secondary grid grid-cols-[auto_1fr] gap-x-1 gap-y-2\"\r\n      >\r\n        <svg\r\n          xmlns=\"http://www.w3.org/2000/svg\"\r\n          width=\"20\"\r\n          height=\"20\"\r\n          viewBox=\"0 0 24 24\"\r\n          fill=\"none\"\r\n          stroke=\"currentColor\"\r\n          stroke-width=\"2\"\r\n          stroke-linecap=\"round\"\r\n          stroke-linejoin=\"round\"\r\n        >\r\n          <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n          <path d=\"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0\" />\r\n          <path d=\"M12 9h.01\" />\r\n          <path d=\"M11 12h1v4h1\" />\r\n        </svg>\r\n\r\n        <p>\r\n          <strong class=\"font-semibold\">Tipo de transacción: </strong>\r\n          <span>\r\n            {{ getTransactionType(document().collection_destination_name) }}\r\n          </span>\r\n        </p>\r\n\r\n        <svg\r\n          xmlns=\"http://www.w3.org/2000/svg\"\r\n          width=\"20\"\r\n          height=\"20\"\r\n          viewBox=\"0 0 24 24\"\r\n          fill=\"none\"\r\n          stroke=\"currentColor\"\r\n          stroke-width=\"2\"\r\n          stroke-linecap=\"round\"\r\n          stroke-linejoin=\"round\"\r\n        >\r\n          <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n          <path d=\"M4 4h6v6h-6z\" />\r\n          <path d=\"M14 4h6v6h-6z\" />\r\n          <path d=\"M4 14h6v6h-6z\" />\r\n          <path d=\"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0\" />\r\n        </svg>\r\n\r\n        <p>\r\n          <strong class=\"font-semibold\">Tipo: </strong>\r\n          <span>\r\n            {{ document().type === \"internal\" ? \"Interno\" : \"Externo\" }}\r\n          </span>\r\n        </p>\r\n\r\n        <svg\r\n          xmlns=\"http://www.w3.org/2000/svg\"\r\n          width=\"20\"\r\n          height=\"20\"\r\n          viewBox=\"0 0 24 24\"\r\n          fill=\"none\"\r\n          stroke=\"currentColor\"\r\n          stroke-width=\"2\"\r\n          stroke-linecap=\"round\"\r\n          stroke-linejoin=\"round\"\r\n        >\r\n          <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n          <path\r\n            d=\"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12z\"\r\n          />\r\n          <path d=\"M16 3v4\" />\r\n          <path d=\"M8 3v4\" />\r\n          <path d=\"M4 11h16\" />\r\n          <path d=\"M11 15h1\" />\r\n          <path d=\"M12 15v3\" />\r\n        </svg>\r\n\r\n        <p>\r\n          <strong class=\"font-semibold\">Fecha de creación: </strong>\r\n          <span>{{ document().created_at | date: \"dd/MM/yyyy HH:mm:ss\" }}</span>\r\n        </p>\r\n\r\n        <svg\r\n          xmlns=\"http://www.w3.org/2000/svg\"\r\n          width=\"20\"\r\n          height=\"20\"\r\n          viewBox=\"0 0 24 24\"\r\n          fill=\"none\"\r\n          stroke=\"currentColor\"\r\n          stroke-width=\"2\"\r\n          stroke-linecap=\"round\"\r\n          stroke-linejoin=\"round\"\r\n        >\r\n          <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n          <path d=\"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0\" />\r\n          <path d=\"M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2\" />\r\n        </svg>\r\n\r\n        <p>\r\n          <strong class=\"font-semibold\">Creado por: </strong>\r\n          <span>{{ document().created_user }}</span>\r\n        </p>\r\n      </div>\r\n\r\n      <div class=\"flex justify-end items-end\">\r\n        <button\r\n          class=\"outline-none bg-secondary text-white hover:bg-[#5c636a] flex justify-center items-center py-2 px-6 rounded-full font-medium gap-2 transition-colors flex-grow sm:flex-grow-0\"\r\n          (click)=\"goBack.emit()\"\r\n          type=\"button\"\r\n        >\r\n          <svg\r\n            xmlns=\"http://www.w3.org/2000/svg\"\r\n            width=\"20\"\r\n            height=\"20\"\r\n            viewBox=\"0 0 24 24\"\r\n            fill=\"none\"\r\n            stroke=\"currentColor\"\r\n            stroke-width=\"2\"\r\n            stroke-linecap=\"round\"\r\n            stroke-linejoin=\"round\"\r\n          >\r\n            <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n            <path d=\"M5 12l14 0\" />\r\n            <path d=\"M5 12l6 6\" />\r\n            <path d=\"M5 12l6 -6\" />\r\n          </svg>\r\n\r\n          <span>Regresar</span>\r\n        </button>\r\n      </div>\r\n    </div>\r\n  </div>\r\n</section>\r\n\r\n<section\r\n  class=\"flex gap-1 mt-5 border bg-danger-subtle border-[#feb7c4] rounded-md text-danger p-4\"\r\n>\r\n  <span class=\"pt-0.5\">\r\n    <svg\r\n      xmlns=\"http://www.w3.org/2000/svg\"\r\n      width=\"20\"\r\n      height=\"20\"\r\n      viewBox=\"0 0 24 24\"\r\n      fill=\"none\"\r\n      stroke=\"currentColor\"\r\n      stroke-width=\"2\"\r\n      stroke-linecap=\"round\"\r\n      stroke-linejoin=\"round\"\r\n    >\r\n      <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n      <path d=\"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0\" />\r\n      <path d=\"M12 8v4\" />\r\n      <path d=\"M12 16h.01\" />\r\n    </svg>\r\n  </span>\r\n\r\n  <p>\r\n    ¿Está seguro que desea eliminar esta solicitud? esta acción es irreversible,\r\n    Escriba \"<strong class=\"font-bold\">{{\r\n      document().document_destination_name\r\n    }}</strong\r\n    >\" para eliminar.\r\n  </p>\r\n</section>\r\n\r\n<input\r\n  type=\"text\"\r\n  class=\"form-control w-full mt-4\"\r\n  [placeholder]=\"document().document_destination_name\"\r\n  [formControl]=\"confirmControl\"\r\n  [class.is-invalid]=\"confirmControl.invalid && confirmControl.touched\"\r\n/>\r\n\r\n@if (confirmControl.invalid && confirmControl.touched) {\r\n  <div class=\"invalid-feedback\" [@fadeInOutAnimation]>\r\n    {{\r\n      confirmControl.errors\r\n        | cbmErrorTranslate: { pattern: \"El texto no coincide\" }\r\n    }}\r\n  </div>\r\n}\r\n\r\n<div class=\"flex flex-wrap justify-center gap-2 mt-4\">\r\n  <button\r\n    type=\"button\"\r\n    class=\"outline-none py-2 px-6 text-white rounded-full flex justify-center items-center gap-2 font-medium bg-info hover:bg-[#409ae9] transition-colors flex-grow sm:flex-grow-0 disabled:pointer-events-none disabled:opacity-70\"\r\n    [disabled]=\"confirmControl.invalid || statusOfDelete() === 'loading'\"\r\n    (click)=\"deleteDocument()\"\r\n  >\r\n    @if (statusOfDelete() === \"loading\") {\r\n      <div role=\"status\">\r\n        <svg\r\n          aria-hidden=\"true\"\r\n          class=\"w-5 h-5 text-gray-400 animate-spin fill-white\"\r\n          viewBox=\"0 0 100 101\"\r\n          fill=\"none\"\r\n          xmlns=\"http://www.w3.org/2000/svg\"\r\n        >\r\n          <path\r\n            d=\"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z\"\r\n            fill=\"currentColor\"\r\n          />\r\n          <path\r\n            d=\"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z\"\r\n            fill=\"currentFill\"\r\n          />\r\n        </svg>\r\n        <span class=\"sr-only\">Loading...</span>\r\n      </div>\r\n    } @else {\r\n      <svg\r\n        xmlns=\"http://www.w3.org/2000/svg\"\r\n        width=\"20\"\r\n        height=\"20\"\r\n        viewBox=\"0 0 24 24\"\r\n        fill=\"none\"\r\n        stroke=\"currentColor\"\r\n        stroke-width=\"2\"\r\n        stroke-linecap=\"round\"\r\n        stroke-linejoin=\"round\"\r\n      >\r\n        <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n        <path d=\"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\" />\r\n        <path d=\"M9 12l2 2l4 -4\" />\r\n      </svg>\r\n    }\r\n\r\n    Procesar\r\n  </button>\r\n\r\n  <button\r\n    type=\"button\"\r\n    class=\"outline-none py-2 px-6 text-secondary rounded-full flex justify-center items-center gap-2 font-medium bg-light-secondary hover:bg-secondary hover:text-white transition-colors flex-grow sm:flex-grow-0 disabled:pointer-events-none disabled:opacity-70\"\r\n    (click)=\"goBack.emit()\"\r\n    [disabled]=\"statusOfDelete() === 'loading'\"\r\n  >\r\n    <svg\r\n      xmlns=\"http://www.w3.org/2000/svg\"\r\n      width=\"20\"\r\n      height=\"20\"\r\n      viewBox=\"0 0 24 24\"\r\n      fill=\"none\"\r\n      stroke=\"currentColor\"\r\n      stroke-width=\"2\"\r\n      stroke-linecap=\"round\"\r\n      stroke-linejoin=\"round\"\r\n    >\r\n      <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n      <path d=\"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\" />\r\n      <path d=\"M10 10l4 4m0 -4l-4 4\" />\r\n    </svg>\r\n\r\n    Cancelar\r\n  </button>\r\n</div>\r\n","import { DatePipe, NgClass, formatDate } from '@angular/common';\r\nimport {\r\n  AfterViewChecked,\r\n  ChangeDetectionStrategy,\r\n  Component,\r\n  DestroyRef,\r\n  ElementRef,\r\n  OnChanges,\r\n  OnInit,\r\n  SimpleChanges,\r\n  input,\r\n  signal,\r\n  viewChildren,\r\n} from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';\r\nimport {\r\n  CbmDocumentReferenceModel,\r\n  CbmDocumentReferenceRepository,\r\n} from '@g2-common/document-reference-repository';\r\nimport { CbmNotificationService } from '@g2-common/notification-service';\r\nimport { NgSelectModule } from '@ng-select/ng-select';\r\nimport { DeleteComponent } from './delete/delete.component';\r\nimport { TStatus } from '../../types';\r\nimport { fadeInOutAnimation } from '../../animations';\r\nimport { CbmTooltipDirective } from '@g2-common/tooltip-directive';\r\nimport { CbmEmptyComponent } from '@g2-common/empty';\r\n\r\n@Component({\r\n  selector: 'lib-reference-document-to-tab',\r\n  standalone: true,\r\n  imports: [\r\n    ReactiveFormsModule,\r\n    DatePipe,\r\n    NgSelectModule,\r\n    NgClass,\r\n    DeleteComponent,\r\n    CbmTooltipDirective,\r\n    CbmEmptyComponent,\r\n  ],\r\n  templateUrl: './reference-document-to-tab.component.html',\r\n  styleUrl: './reference-document-to-tab.component.css',\r\n  changeDetection: ChangeDetectionStrategy.OnPush,\r\n  animations: [fadeInOutAnimation],\r\n})\r\nexport class ReferenceDocumentToTabComponent implements OnChanges, OnInit, AfterViewChecked {\r\n  // #region refs\r\n  dropdownMenus = viewChildren<ElementRef>('dropdownMenu');\r\n\r\n  // #region inputs\r\n  collectionId = input.required<string>();\r\n  collectionName = input.required<string>();\r\n\r\n  // #region state\r\n  isFormForFilterVisible = signal<boolean>(false);\r\n  statusOfFetchDocuments = signal<TStatus>('init');\r\n  statusOfDeleteDocument = signal<TStatus>('init');\r\n  documents = signal<CbmDocumentReferenceModel.ListResponse.Data[]>([]);\r\n  isSmallScreen = signal<boolean>(false);\r\n  isDeleteViewVisible = signal<boolean>(false);\r\n\r\n  documentToDelete = signal<CbmDocumentReferenceModel.ListResponse.Data | null>(null);\r\n\r\n  // #region varibles\r\n  now = new Date();\r\n\r\n  namesOfCollections = [\r\n    {\r\n      name: 'blanket_agreements',\r\n      friendly_name: 'ACUERDOS GLOBALES',\r\n    },\r\n    {\r\n      name: 'delivery',\r\n      friendly_name: 'ENTREGA DE MERCANCIAS',\r\n    },\r\n    {\r\n      name: 'goods_issue',\r\n      friendly_name: 'SALIDA DE MERCANCIAS',\r\n    },\r\n    {\r\n      name: 'goods_receipts',\r\n      friendly_name: 'ENTRADA DE MERCANCIAS',\r\n    },\r\n    {\r\n      name: 'goods_transfer',\r\n      friendly_name: 'TRANSFERENCIA DE MERCANCIAS',\r\n    },\r\n    {\r\n      name: 'income',\r\n      friendly_name: 'GESTION DE COBROS',\r\n    },\r\n    {\r\n      name: 'initial_balance',\r\n      friendly_name: 'BALANCE INICIAL',\r\n    },\r\n    {\r\n      name: 'items',\r\n      friendly_name: 'ARTICULOS',\r\n    },\r\n    {\r\n      name: 'order',\r\n      friendly_name: 'PEDIDO DE VENTA',\r\n    },\r\n    {\r\n      name: 'quotation',\r\n      friendly_name: 'OFERTA DE VENTA',\r\n    },\r\n    {\r\n      name: 'return',\r\n      friendly_name: 'DEVOLUCION DE MERCADERIA',\r\n    },\r\n    {\r\n      name: 'return_request',\r\n      friendly_name: 'SOLICITUD DE DEVOLUCION DE MERCADERIA',\r\n    },\r\n    {\r\n      name: 'invoice',\r\n      friendly_name: 'FACTURA',\r\n    },\r\n  ];\r\n\r\n  documentListener = () => {\r\n    const dropdownMenus = this.dropdownMenus();\r\n\r\n    if (dropdownMenus.length) {\r\n      dropdownMenus.forEach(({ nativeElement: dropdownMenu }) => {\r\n        if (!dropdownMenu.classList.contains('invisible')) {\r\n          dropdownMenu.classList.toggle('invisible');\r\n          dropdownMenu.classList.toggle('translate-y-2');\r\n          dropdownMenu.classList.toggle('opacity-0');\r\n        }\r\n      });\r\n    }\r\n  };\r\n\r\n  // #region forms\r\n  formForFilter = new FormGroup({\r\n    collectionDestinationName: new FormControl<string | null>(null),\r\n    startDate: new FormControl<string | null>(\r\n      formatDate(new Date().setDate(1), 'yyyy-MM-dd', 'en'),\r\n    ),\r\n    endDate: new FormControl<string | null>(formatDate(new Date(), 'yyyy-MM-dd', 'en')),\r\n  });\r\n\r\n  // #region constructor\r\n  constructor(\r\n    private documentReferenceRepository: CbmDocumentReferenceRepository,\r\n    private notificationService: CbmNotificationService,\r\n    private destroyRef: DestroyRef,\r\n  ) {}\r\n\r\n  // #region hooks\r\n  ngOnChanges(changes: SimpleChanges): void {\r\n    this.fetchDocuments();\r\n  }\r\n\r\n  ngOnInit(): void {\r\n    if (window.matchMedia('(min-width: 875px)').matches) {\r\n      this.isSmallScreen.set(false);\r\n    } else {\r\n      this.isSmallScreen.set(true);\r\n    }\r\n\r\n    window.matchMedia('(min-width: 875px)').addEventListener('change', (event) => {\r\n      this.isSmallScreen.set(!event.matches);\r\n    });\r\n  }\r\n\r\n  ngAfterViewChecked(): void {\r\n    document.documentElement.removeEventListener('click', this.documentListener);\r\n\r\n    document.documentElement.addEventListener('click', this.documentListener);\r\n  }\r\n\r\n  // #region methods\r\n  fetchDocuments(): void {\r\n    this.statusOfFetchDocuments.set('loading');\r\n\r\n    const { collectionDestinationName, startDate, endDate } = this.formForFilter.getRawValue();\r\n\r\n    const params: CbmDocumentReferenceModel.ListParams = {\r\n      collection_origin_id: this.collectionId(),\r\n      collection_origin_name: this.collectionName(),\r\n    };\r\n\r\n    if (collectionDestinationName) params.collection_destination_name = collectionDestinationName;\r\n\r\n    if (startDate) {\r\n      const [year, month, day] = startDate.split('-').map(Number);\r\n      params.start_date = new Date(year, month - 1, day).getTime();\r\n    }\r\n\r\n    if (endDate) {\r\n      const [year, month, day] = endDate.split('-').map(Number);\r\n      params.end_date = new Date(year, month - 1, day).getTime();\r\n    }\r\n\r\n    this.documentReferenceRepository\r\n      .list(params)\r\n      .pipe(takeUntilDestroyed(this.destroyRef))\r\n      .subscribe({\r\n        next: (response) => {\r\n          this.documents.set(response.data);\r\n          this.statusOfFetchDocuments.set('success');\r\n        },\r\n        error: (error) => {\r\n          this.statusOfFetchDocuments.set('failed');\r\n\r\n          this.notificationService.sendAlert({\r\n            type: 'toast',\r\n            status: 'error',\r\n            message: JSON.stringify(error.error?.message),\r\n          });\r\n        },\r\n      });\r\n  }\r\n\r\n  onDropdownMenuClick(event: MouseEvent, dropdownMenu: HTMLUListElement): void {\r\n    event.stopPropagation();\r\n\r\n    this.dropdownMenus().forEach((ref) => {\r\n      if (ref.nativeElement === dropdownMenu) {\r\n        dropdownMenu.classList.toggle('invisible');\r\n        dropdownMenu.classList.toggle('translate-y-2');\r\n        dropdownMenu.classList.toggle('opacity-0');\r\n      } else {\r\n        ref.nativeElement.classList.add('invisible');\r\n        ref.nativeElement.classList.add('translate-y-2');\r\n        ref.nativeElement.classList.add('opacity-0');\r\n      }\r\n    });\r\n  }\r\n\r\n  getTransactionType(collectionName: string): string {\r\n    switch (collectionName) {\r\n      case 'quotation':\r\n        return 'Oferta de venta';\r\n      case 'order':\r\n        return 'Pedido de venta';\r\n      case 'invoice':\r\n        return 'Factura';\r\n      case 'credit_management':\r\n        return 'Créditos';\r\n      case 'credit_management_installment':\r\n        return 'Cuotas';\r\n      case 'income':\r\n        return 'Cobro';\r\n      case 'export_invoice':\r\n        return 'Factura de exportación';\r\n      case 'sale_note':\r\n        return 'Nota de venta';\r\n      case 'billing_order':\r\n        return 'Orden de facturación';\r\n      case 'credit_note':\r\n        return 'Nota de crédito';\r\n      case 'referal_guide':\r\n        return 'Guía de remisión';\r\n      case 'retention':\r\n        return 'Retención de venta';\r\n      case 'debit_note':\r\n        return 'Nota de débito';\r\n      case 'closing_of_cash':\r\n        return 'Cierre de caja';\r\n      case 'document_liquidation':\r\n        return 'Liquidación de documentos';\r\n      case 'initial_balance':\r\n        return 'Saldo inicial';\r\n      case 'cash_liquidation':\r\n        return 'Liquidación en efectivo';\r\n      case 'down_payment':\r\n        return 'Anticipo';\r\n      case 'internal_credit':\r\n        return 'Crédito interno';\r\n      case 'crossing_account':\r\n        return 'Cruce de cuentas';\r\n      case 'delivery_request':\r\n        return 'Solicitud de entrega';\r\n      case 'delivery':\r\n        return 'Entrega de mercancías';\r\n      case 'delivery_return':\r\n        return 'Devolución de entrega';\r\n      case 'invoice_reverse':\r\n        return 'Reversión de facturas';\r\n      case 'credit_note_reverse':\r\n        return 'Reversión de nota de crédito';\r\n      case 'document_liquidation_reverse':\r\n        return 'Reversión de liquidación de documentos';\r\n      case 'retention_reverse':\r\n        return 'Reversión de retención de venta';\r\n      case 'income_reverse':\r\n        return 'Reversión de cobro';\r\n      case 'cash_liquidation_reverse':\r\n        return 'Reversión de liquidación en efectivo';\r\n      case 'down_payment_reverse':\r\n        return 'Reversión de anticipo';\r\n      case 'sale_note_reverse':\r\n        return 'Reversión de nota de venta';\r\n      case 'internal_credit_reverse':\r\n        return 'Reversión de crédito interno';\r\n      case 'debit_note_reverse_sales':\r\n        return 'Reversión de nota de débito';\r\n      case 'crossing_accounts_reverse':\r\n        return 'Reversión de cruce de cuentas';\r\n      case 'outgoing_banking_transaction':\r\n        return 'Transacción bancaria de egreso';\r\n      case 'outgoing_banking_transaction_reverse':\r\n        return 'Reversión de transacción bancaria de egreso';\r\n      case 'deposit_cheque':\r\n        return 'Depósito de cheques recibidos';\r\n      default:\r\n        return collectionName;\r\n    }\r\n  }\r\n\r\n  onDeletePress(document: CbmDocumentReferenceModel.ListResponse.Data): void {\r\n    if (!document.type_record) {\r\n      this.notificationService.sendAlert({\r\n        type: 'sweetAlert',\r\n        status: 'warning',\r\n        message: 'No se puede borrar la relacion de documento de tipo automático.',\r\n      });\r\n      return;\r\n    }\r\n    this.documentToDelete.set(document);\r\n    this.isDeleteViewVisible.set(true);\r\n  }\r\n\r\n  onBackPress(): void {\r\n    this.documentToDelete.set(null);\r\n    this.isDeleteViewVisible.set(false);\r\n  }\r\n}\r\n","@if (isDeleteViewVisible() && documentToDelete()) {\r\n  <lib-delete\r\n    [document]=\"documentToDelete()!\"\r\n    (goBack)=\"onBackPress()\"\r\n    (remove)=\"fetchDocuments(); onBackPress()\"\r\n  ></lib-delete>\r\n} @else {\r\n  <div class=\"flex justify-end\">\r\n    @if (isFormForFilterVisible()) {\r\n      <button\r\n        class=\"outline-none bg-secondary text-white hover:bg-[#5c636a] rounded-md px-2 py-1 text-xs transition-colors flex justify-center items-center gap-1\"\r\n        (click)=\"isFormForFilterVisible.set(false)\"\r\n        type=\"button\"\r\n      >\r\n        <svg\r\n          xmlns=\"http://www.w3.org/2000/svg\"\r\n          viewBox=\"0 0 24 24\"\r\n          fill=\"none\"\r\n          stroke=\"currentColor\"\r\n          stroke-width=\"2\"\r\n          stroke-linecap=\"round\"\r\n          stroke-linejoin=\"round\"\r\n          class=\"size-3\"\r\n        >\r\n          <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n          <path d=\"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\" />\r\n          <path d=\"M10 10l4 4m0 -4l-4 4\" />\r\n        </svg>\r\n        <span>Cerrar</span>\r\n      </button>\r\n    } @else {\r\n      <button\r\n        class=\"outline-none bg-info text-white hover:bg-[#409ae9] rounded-md px-2 py-1 text-xs transition-colors flex justify-center items-center gap-1\"\r\n        (click)=\"isFormForFilterVisible.set(true)\"\r\n        type=\"button\"\r\n      >\r\n        <svg\r\n          xmlns=\"http://www.w3.org/2000/svg\"\r\n          viewBox=\"0 0 24 24\"\r\n          fill=\"currentColor\"\r\n          class=\"size-3\"\r\n        >\r\n          <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n          <path\r\n            d=\"M20 3h-16a1 1 0 0 0 -1 1v2.227l.008 .223a3 3 0 0 0 .772 1.795l4.22 4.641v8.114a1 1 0 0 0 1.316 .949l6 -2l.108 -.043a1 1 0 0 0 .576 -.906v-6.586l4.121 -4.12a3 3 0 0 0 .879 -2.123v-2.171a1 1 0 0 0 -1 -1z\"\r\n          />\r\n        </svg>\r\n        <span>Filtrar</span>\r\n      </button>\r\n    }\r\n  </div>\r\n\r\n  @if (isFormForFilterVisible()) {\r\n    <form\r\n      [formGroup]=\"formForFilter\"\r\n      (ngSubmit)=\"fetchDocuments()\"\r\n      class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 mt-3 gap-3\"\r\n      [@fadeInOutAnimation]\r\n    >\r\n      <div class=\"flex flex-col items-start\">\r\n        <label\r\n          class=\"text-base font-normal text-[#67757c]\"\r\n          for=\"start-date-input\"\r\n        >\r\n          Rango de fechas (Desde - Hasta)\r\n        </label>\r\n\r\n        <div class=\"flex gap-1 mt-2 self-stretch\">\r\n          <input\r\n            id=\"start-date-input\"\r\n            type=\"date\"\r\n            class=\"form-control form-control-sm flex-grow\"\r\n            formControlName=\"startDate\"\r\n          />\r\n\r\n          <span class=\"self-center\">-</span>\r\n\r\n          <input\r\n            type=\"date\"\r\n            class=\"form-control form-control-sm flex-grow\"\r\n            formControlName=\"endDate\"\r\n            [max]=\"now | date: 'yyyy-MM-dd'\"\r\n          />\r\n        </div>\r\n      </div>\r\n\r\n      <div class=\"flex flex-col items-start\">\r\n        <label\r\n          class=\"text-base font-normal text-[#67757c]\"\r\n          for=\"collection-destination-name-select\"\r\n        >\r\n          Colección de destino\r\n        </label>\r\n\r\n        <ng-select\r\n          labelForId=\"collection-destination-name-select\"\r\n          class=\"ng-select ng-select-sm mt-2 self-stretch\"\r\n          formControlName=\"collectionDestinationName\"\r\n          placeholder=\"Ej. Entrada de mercancías\"\r\n        >\r\n          @for (collection of namesOfCollections; track collection.name) {\r\n            <ng-option [value]=\"collection.name\">\r\n              {{ collection.friendly_name }}\r\n            </ng-option>\r\n          }\r\n        </ng-select>\r\n      </div>\r\n\r\n      <div class=\"md:col-span-2 lg:col-span-3 flex justify-end mt-2\">\r\n        <button\r\n          type=\"submit\"\r\n          class=\"outline-none py-2 px-6 text-white rounded-full flex justify-center items-center gap-2 font-medium bg-info hover:bg-[#409ae9] transition-colors flex-grow sm:flex-grow-0 disabled:pointer-events-none disabled:opacity-70\"\r\n          [disabled]=\"statusOfFetchDocuments() === 'loading'\"\r\n        >\r\n          @if (statusOfFetchDocuments() === \"loading\") {\r\n            <div role=\"status\">\r\n              <svg\r\n                aria-hidden=\"true\"\r\n                class=\"w-5 h-5 text-gray-400 animate-spin fill-white\"\r\n                viewBox=\"0 0 100 101\"\r\n                fill=\"none\"\r\n                xmlns=\"http://www.w3.org/2000/svg\"\r\n              >\r\n                <path\r\n                  d=\"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z\"\r\n                  fill=\"currentColor\"\r\n                />\r\n                <path\r\n                  d=\"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z\"\r\n                  fill=\"currentFill\"\r\n                />\r\n              </svg>\r\n              <span class=\"sr-only\">Loading...</span>\r\n            </div>\r\n          } @else {\r\n            <svg\r\n              xmlns=\"http://www.w3.org/2000/svg\"\r\n              width=\"20\"\r\n              height=\"20\"\r\n              viewBox=\"0 0 24 24\"\r\n              fill=\"none\"\r\n              stroke=\"currentColor\"\r\n              stroke-width=\"2\"\r\n              stroke-linecap=\"round\"\r\n              stroke-linejoin=\"round\"\r\n            >\r\n              <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n              <path d=\"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0\" />\r\n              <path d=\"M21 21l-6 -6\" />\r\n            </svg>\r\n          }\r\n\r\n          Buscar\r\n        </button>\r\n      </div>\r\n    </form>\r\n  }\r\n\r\n  @if (isSmallScreen()) {\r\n    <div class=\"mt-4 border-y border-[#dde3e7] grid grid-cols-[auto_1fr_auto]\">\r\n      <!-- 💀 -->\r\n      @if (statusOfFetchDocuments() === \"loading\") {\r\n        @for (_ of [].constructor(4); track _) {\r\n          <div\r\n            class=\"bg-[#d2e7fa] p-3 text-xs font-semibold text-left align-top loading-skeleton\"\r\n            [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n          >\r\n            <p>-</p>\r\n          </div>\r\n          <div\r\n            class=\"flex-grow grid grid-cols-[auto_1fr] text-[#67757c] loading-skeleton\"\r\n            [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n          >\r\n            <div class=\"p-3 text-xs text-left align-top font-semibold\">\r\n              <p>Tipo de registro</p>\r\n            </div>\r\n            <div class=\"p-3 text-xs text-left align-top\">\r\n              <p>-</p>\r\n            </div>\r\n            <div class=\"p-3 text-xs text-left align-top font-semibold\">\r\n              <p>Tipo</p>\r\n            </div>\r\n            <div class=\"p-3 text-xs text-left align-top\">\r\n              <p>-</p>\r\n            </div>\r\n            <div class=\"p-3 text-xs text-left align-top font-semibold\">\r\n              <p>Modulo</p>\r\n            </div>\r\n            <div class=\"p-3 text-xs text-left align-top\">\r\n              <p>-</p>\r\n            </div>\r\n            <div\r\n              class=\"p-3 text-xs text-left align-top font-semibold border-t border-[#dde3e7]\"\r\n            >\r\n              <p>Secuencial</p>\r\n            </div>\r\n            <div\r\n              class=\"p-3 text-xs text-left align-top border-t border-[#dde3e7]\"\r\n            >\r\n              <p>-</p>\r\n            </div>\r\n\r\n            <div\r\n              class=\"p-3 text-xs text-left align-top font-semibold border-t border-[#dde3e7]\"\r\n            >\r\n              <p>Fecha</p>\r\n            </div>\r\n            <div\r\n              class=\"p-3 text-xs text-left align-top border-t border-[#dde3e7]\"\r\n            >\r\n              <p>-</p>\r\n            </div>\r\n\r\n            <div\r\n              class=\"p-3 text-xs text-left align-top font-semibold border-t border-[#dde3e7]\"\r\n            >\r\n              <p>Fecha de referencia</p>\r\n            </div>\r\n            <div\r\n              class=\"p-3 text-xs text-left align-top border-t border-[#dde3e7]\"\r\n            >\r\n              <p>-</p>\r\n            </div>\r\n          </div>\r\n          <div\r\n            class=\"p-2 align-top bg-[#e7ebee] relative loading-skeleton\"\r\n            [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n          >\r\n            <button\r\n              class=\"outline-none text-secondary hover:text-info\"\r\n              type=\"button\"\r\n            >\r\n              <svg\r\n                xmlns=\"http://www.w3.org/2000/svg\"\r\n                width=\"16\"\r\n                height=\"16\"\r\n                viewBox=\"0 0 24 24\"\r\n                fill=\"none\"\r\n                stroke=\"currentColor\"\r\n                stroke-width=\"2\"\r\n                stroke-linecap=\"round\"\r\n                stroke-linejoin=\"round\"\r\n              >\r\n                <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n                <path d=\"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\" />\r\n                <path d=\"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\" />\r\n                <path d=\"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\" />\r\n              </svg>\r\n            </button>\r\n          </div>\r\n        }\r\n      }\r\n      <!-- 💀 -->\r\n\r\n      <!-- 👨 -->\r\n      @if (statusOfFetchDocuments() === \"success\") {\r\n        @if (documents().length) {\r\n          @for (document of documents(); track document._id) {\r\n            <div\r\n              class=\"bg-[#d2e7fa] p-3 text-xs font-semibold text-left align-top\"\r\n              [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n            >\r\n              {{ $index + 1 }}\r\n            </div>\r\n\r\n            <div\r\n              class=\"flex-grow grid grid-cols-[auto_1fr] text-[#67757c]\"\r\n              [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n            >\r\n              <div class=\"p-3 text-xs text-left align-top font-semibold\">\r\n                Tipo de registro\r\n              </div>\r\n              <div class=\"p-3 text-xs text-left align-top\">\r\n                <span class=\"inline-block align-baseline leading-5\">\r\n                  @if (document.type_record) {\r\n                    <span\r\n                      class=\"py-0.5 px-1 bg-light-success rounded-md text-success\"\r\n                    >\r\n                      Manual\r\n                    </span>\r\n                  } @else {\r\n                    <span\r\n                      class=\"py-0.5 px-1 rounded-md text-info bg-light-info\"\r\n                    >\r\n                      Automático\r\n                    </span>\r\n                  }\r\n                </span>\r\n              </div>\r\n              <div\r\n                class=\"p-3 text-xs text-left align-top font-semibold border-t border-[#dde3e7]\"\r\n              >\r\n                Tipo\r\n              </div>\r\n              <div\r\n                class=\"p-3 text-xs text-left align-top border-t border-[#dde3e7] text-ellipsis overflow-hidden\"\r\n              >\r\n                <span class=\"inline-block align-baseline leading-5\">\r\n                  @switch (document.type) {\r\n                    @case (\"internal\") {\r\n                      <span\r\n                        class=\"py-0.5 px-1 bg-light-info rounded-md text-info\"\r\n                      >\r\n                        Interno\r\n                      </span>\r\n                    }\r\n\r\n                    @case (\"external\") {\r\n                      <span\r\n                        class=\"py-0.5 px-1 bg-light-info rounded-md text-success\"\r\n                      >\r\n                        Externo\r\n                      </span>\r\n                    }\r\n                  }\r\n                </span>\r\n              </div>\r\n              <div\r\n                class=\"p-3 text-xs text-left align-top font-semibold border-t border-[#dde3e7]\"\r\n              >\r\n                Módulo\r\n              </div>\r\n              <div\r\n                class=\"p-3 text-xs text-left align-top border-t border-[#dde3e7] text-ellipsis overflow-hidden\"\r\n              >\r\n                {{ getTransactionType(document.collection_destination_name) }}\r\n              </div>\r\n\r\n              <div\r\n                class=\"p-3 text-xs text-left align-top font-semibold border-t border-[#dde3e7]\"\r\n              >\r\n                Secuencial\r\n              </div>\r\n              <div\r\n                class=\"p-3 text-xs text-left align-top border-t border-[#dde3e7] text-ellipsis overflow-hidden\"\r\n              >\r\n                {{ document.document_destination_name }}\r\n              </div>\r\n\r\n              <div\r\n                class=\"p-3 text-xs text-left align-top font-semibold border-t border-[#dde3e7]\"\r\n              >\r\n                Fecha\r\n              </div>\r\n              <div\r\n                class=\"p-3 text-xs text-left align-top border-t border-[#dde3e7] text-ellipsis overflow-hidden\"\r\n              >\r\n                {{\r\n                  document.document_destination_date\r\n                    | date: \"dd/MM/yyyy HH:mm:ss\"\r\n                }}\r\n              </div>\r\n\r\n              <div\r\n                class=\"p-3 text-xs text-left align-top font-semibold border-t border-[#dde3e7]\"\r\n              >\r\n                Fecha de referencia\r\n              </div>\r\n              <div\r\n                class=\"p-3 text-xs text-left align-top border-t border-[#dde3e7] text-ellipsis overflow-hidden\"\r\n              >\r\n                {{ document.created_at | date: \"dd/MM/yyyy HH:mm:ss\" }}\r\n              </div>\r\n            </div>\r\n\r\n            <div\r\n              class=\"p-2 align-top bg-[#e7ebee] relative\"\r\n              [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n            >\r\n              <button\r\n                class=\"outline-none text-secondary hover:text-info\"\r\n                id=\"actions-button-{{ document._id }}\"\r\n                (click)=\"onDropdownMenuClick($event, dropdownMenu)\"\r\n                cbmTooltip=\"Opciones\"\r\n                type=\"button\"\r\n              >\r\n                <svg\r\n                  xmlns=\"http://www.w3.org/2000/svg\"\r\n                  width=\"16\"\r\n                  height=\"16\"\r\n                  viewBox=\"0 0 24 24\"\r\n                  fill=\"none\"\r\n                  stroke=\"currentColor\"\r\n                  stroke-width=\"2\"\r\n                  stroke-linecap=\"round\"\r\n                  stroke-linejoin=\"round\"\r\n                >\r\n                  <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n                  <path d=\"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\" />\r\n                  <path d=\"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\" />\r\n                  <path d=\"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\" />\r\n                </svg>\r\n              </button>\r\n\r\n              <ul\r\n                class=\"z-10 absolute bg-white divide-y divide-gray-50 text-[#67757c] rounded-md shadow-lg py-2 text-sm -translate-x-[85%] transition-transform translate-y-2 invisible opacity-0 w-44\"\r\n                [attr.aria-labelledby]=\"'actions-button-' + document._id\"\r\n                #dropdownMenu\r\n              >\r\n                <li>\r\n                  <button\r\n                    class=\"flex px-4 py-2 hover:bg-gray-100 w-full gap-2 items-center\"\r\n                    (click)=\"onDeletePress(document)\"\r\n                    type=\"button\"\r\n                  >\r\n                    <svg\r\n                      xmlns=\"http://www.w3.org/2000/svg\"\r\n                      width=\"16\"\r\n                      height=\"16\"\r\n                      viewBox=\"0 0 24 24\"\r\n                      fill=\"none\"\r\n                      stroke=\"currentColor\"\r\n                      stroke-width=\"2\"\r\n                      stroke-linecap=\"round\"\r\n                      stroke-linejoin=\"round\"\r\n                    >\r\n                      <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n                      <path d=\"M4 7l16 0\" />\r\n                      <path d=\"M10 11l0 6\" />\r\n                      <path d=\"M14 11l0 6\" />\r\n                      <path\r\n                        d=\"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12\"\r\n                      />\r\n                      <path d=\"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3\" />\r\n                    </svg>\r\n\r\n                    <span>Eliminar</span>\r\n                  </button>\r\n                </li>\r\n              </ul>\r\n            </div>\r\n          }\r\n        } @else {\r\n          <div class=\"col-span-3 px-4 py-5 border-x border-[#dde3e7]\">\r\n            <cbm-empty />\r\n          </div>\r\n        }\r\n      }\r\n      <!-- 👨 -->\r\n    </div>\r\n  } @else {\r\n    <table aria-label=\"Tabla de documentos\" class=\"w-full mt-4\">\r\n      <thead class=\"bg-[#d2e7fa] border-b border-info text-black\">\r\n        <tr>\r\n          <th class=\"p-3 text-xs font-semibold text-left align-bottom\">N°</th>\r\n          <th class=\"p-3 text-xs font-semibold text-left align-bottom\">\r\n            Tipo de registro\r\n          </th>\r\n          <th class=\"p-3 text-xs font-semibold text-left align-bottom\">Tipo</th>\r\n          <th class=\"p-3 text-xs font-semibold text-left align-bottom\">\r\n            Módulo\r\n          </th>\r\n          <th class=\"p-3 text-xs font-semibold text-left align-bottom\">\r\n            Secuencial\r\n          </th>\r\n          <th class=\"p-3 text-xs font-semibold text-left align-bottom\">\r\n            Fecha\r\n          </th>\r\n          <th class=\"p-3 text-xs font-semibold text-left align-bottom\">\r\n            Fecha de referencia\r\n          </th>\r\n          <th class=\"p-3 text-xs font-semibold text-center align-bottom\">\r\n            Acciones\r\n          </th>\r\n        </tr>\r\n      </thead>\r\n\r\n      <!-- 💀 -->\r\n      @if (statusOfFetchDocuments() === \"loading\") {\r\n        <tbody class=\"loading-skeleton\">\r\n          @for (_ of [].constructor(4); track _) {\r\n            <tr class=\"border-b border-[#dde3e7]\">\r\n              @for (__ of [].constructor(8); track __) {\r\n                <td class=\"p-3\">\r\n                  <p>-</p>\r\n                </td>\r\n              }\r\n            </tr>\r\n          }\r\n        </tbody>\r\n      }\r\n      <!-- 💀 -->\r\n\r\n      <!-- 👨 -->\r\n      @if (statusOfFetchDocuments() === \"success\") {\r\n        <tbody class=\"text-[#67757c]\">\r\n          @if (documents().length) {\r\n            @for (document of documents(); track document._id) {\r\n              <tr class=\"border-b border-[#dde3e7]\">\r\n                <td class=\"p-3 text-xs text-left font-bold align-top\">\r\n                  {{ $index + 1 }}\r\n                </td>\r\n                <td class=\"p-3 text-xs text-left align-top min-w-44\">\r\n                  <span class=\"inline-block align-baseline leading-5\">\r\n                    @if (document.type_record) {\r\n                      <span\r\n                        class=\"py-0.5 px-1 bg-light-success rounded-md text-success\"\r\n                      >\r\n                        Manual\r\n                      </span>\r\n                    } @else {\r\n                      <span\r\n                        class=\"py-0.5 px-1 rounded-md text-info bg-light-info\"\r\n                      >\r\n                        Automático\r\n                      </span>\r\n                    }\r\n                  </span>\r\n                </td>\r\n                <td class=\"p-3 text-xs text-left align-top min-w-44\">\r\n                  <span class=\"inline-block align-baseline leading-5\">\r\n                    @switch (document.type) {\r\n                      @case (\"internal\") {\r\n                        <span\r\n                          class=\"py-0.5 px-1 bg-light-info rounded-md text-info\"\r\n                        >\r\n                          Interno\r\n                        </span>\r\n                      }\r\n\r\n                      @case (\"external\") {\r\n                        <span\r\n                          class=\"py-0.5 px-1 bg-light-info rounded-md text-success\"\r\n                        >\r\n                          Externo\r\n                        </span>\r\n                      }\r\n                    }\r\n                  </span>\r\n                </td>\r\n                <td class=\"p-3 text-xs text-left align-top min-w-44\">\r\n                  {{ getTransactionType(document.collection_destination_name) }}\r\n                </td>\r\n                <td class=\"p-3 text-xs text-left align-top min-w-28\">\r\n                  {{ document.document_destination_name }}\r\n                </td>\r\n                <td class=\"p-3 text-xs text-left align-top min-w-40\">\r\n                  {{\r\n                    document.document_destination_date\r\n                      | date: \"dd/MM/yyyy HH:mm:ss\"\r\n                  }}\r\n                </td>\r\n                <td class=\"p-3 text-xs text-left align-top min-w-40\">\r\n                  {{ document.created_at | date: \"dd/MM/yyyy HH:mm:ss\" }}\r\n                </td>\r\n                <td class=\"p-3 text-xs text-center align-top relative\">\r\n                  <button\r\n                    class=\"outline-none text-secondary hover:text-info\"\r\n                    id=\"actions-button-{{ document._id }}\"\r\n                    (click)=\"onDropdownMenuClick($event, dropdownMenu)\"\r\n                    cbmTooltip=\"Opciones\"\r\n                    type=\"button\"\r\n                  >\r\n                    <svg\r\n                      xmlns=\"http://www.w3.org/2000/svg\"\r\n                      width=\"20\"\r\n                      height=\"20\"\r\n                      viewBox=\"0 0 24 24\"\r\n                      fill=\"none\"\r\n                      stroke=\"currentColor\"\r\n                      stroke-width=\"2\"\r\n                      stroke-linecap=\"round\"\r\n                      stroke-linejoin=\"round\"\r\n                    >\r\n                      <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n                      <path d=\"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\" />\r\n                      <path d=\"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\" />\r\n                      <path d=\"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\" />\r\n                    </svg>\r\n                  </button>\r\n\r\n                  <ul\r\n                    class=\"z-10 absolute bg-white divide-y divide-gray-50 text-[#67757c] rounded-md shadow-lg py-2 text-sm -translate-x-[70%] transition-transform translate-y-2 invisible opacity-0 w-44\"\r\n                    [attr.aria-labelledby]=\"'actions-button-' + document._id\"\r\n                    #dropdownMenu\r\n                  >\r\n                    <li>\r\n                      <button\r\n                        class=\"flex px-4 py-2 hover:bg-gray-100 w-full gap-2 items-center\"\r\n                        (click)=\"onDeletePress(document)\"\r\n                        type=\"button\"\r\n                      >\r\n                        <svg\r\n                          xmlns=\"http://www.w3.org/2000/svg\"\r\n                          width=\"16\"\r\n                          height=\"16\"\r\n                          viewBox=\"0 0 24 24\"\r\n                          fill=\"none\"\r\n                          stroke=\"currentColor\"\r\n                          stroke-width=\"2\"\r\n                          stroke-linecap=\"round\"\r\n                          stroke-linejoin=\"round\"\r\n                        >\r\n                          <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n                          <path d=\"M4 7l16 0\" />\r\n                          <path d=\"M10 11l0 6\" />\r\n                          <path d=\"M14 11l0 6\" />\r\n                          <path\r\n                            d=\"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12\"\r\n                          />\r\n                          <path d=\"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3\" />\r\n                        </svg>\r\n\r\n                        <span>Eliminar</span>\r\n                      </button>\r\n                    </li>\r\n                  </ul>\r\n                </td>\r\n              </tr>\r\n            }\r\n          } @else {\r\n            <tr class=\"border-b border-[#dde3e7]\">\r\n              <td colspan=\"8\" class=\"px-4 py-5\">\r\n                <cbm-empty />\r\n              </td>\r\n            </tr>\r\n          }\r\n        </tbody>\r\n      }\r\n      <!-- 👨 -->\r\n    </table>\r\n  }\r\n}\r\n","import { DatePipe } from '@angular/common';\r\nimport {\r\n  ChangeDetectionStrategy,\r\n  Component,\r\n  DestroyRef,\r\n  OnChanges,\r\n  SimpleChanges,\r\n  input,\r\n  output,\r\n  signal,\r\n} from '@angular/core';\r\nimport { FormControl, ReactiveFormsModule, Validators } from '@angular/forms';\r\nimport {\r\n  CbmDocumentReferenceModel,\r\n  CbmDocumentReferenceRepository,\r\n} from '@g2-common/document-reference-repository';\r\nimport { CbmErrorTranslatePipe } from '@g2-common/error-translate-pipe';\r\nimport { TStatus } from '../../../types';\r\nimport { CbmNotificationService } from '@g2-common/notification-service';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { fadeInOutAnimation } from '../../../animations';\r\n\r\n@Component({\r\n  selector: 'lib-delete',\r\n  standalone: true,\r\n  imports: [DatePipe, ReactiveFormsModule, CbmErrorTranslatePipe],\r\n  templateUrl: './delete.component.html',\r\n  styleUrl: './delete.component.css',\r\n  changeDetection: ChangeDetectionStrategy.OnPush,\r\n  host: { id: crypto.randomUUID() },\r\n  animations: [fadeInOutAnimation],\r\n})\r\nexport class DeleteComponent implements OnChanges {\r\n  // #region inputs\r\n  document = input.required<CbmDocumentReferenceModel.ListResponse.Data>();\r\n\r\n  // #region output\r\n  goBack = output<void>();\r\n  remove = output<void>();\r\n\r\n  // #region state\r\n  statusOfDelete = signal<TStatus>('init');\r\n\r\n  // #region controls\r\n  confirmControl = new FormControl<string | null>(null);\r\n\r\n  // #region constructor\r\n  constructor(\r\n    private notificationService: CbmNotificationService,\r\n    private documentReferenceRepository: CbmDocumentReferenceRepository,\r\n    private destroyRef: DestroyRef,\r\n  ) {}\r\n\r\n  // #region hooks\r\n  ngOnChanges(changes: SimpleChanges): void {\r\n    if (changes['document']) {\r\n      this.confirmControl.setValidators([\r\n        Validators.required,\r\n        Validators.pattern(this.document().document_origin_name),\r\n      ]);\r\n    }\r\n  }\r\n\r\n  // #region methods\r\n  getTransactionType(collectionName: string): string {\r\n    switch (collectionName) {\r\n      case 'goods_receipts':\r\n        return 'Entrada de mercancías';\r\n      case 'goods_issue':\r\n        return 'Salida de mercancías';\r\n      case 'income':\r\n        return 'Gestión de cobranza a clientes';\r\n      case 'document_liquidation':\r\n        return 'Liquidación de documentos';\r\n      case 'invoice':\r\n        return 'Factura';\r\n      default:\r\n        return 'Externo';\r\n    }\r\n  }\r\n\r\n  deleteDocument(): void {\r\n    if (this.confirmControl.invalid) {\r\n      this.confirmControl.markAllAsTouched();\r\n\r\n      this.notificationService.sendAlert({\r\n        type: 'toast',\r\n        status: 'error',\r\n        message: 'El formulario contiene datos inválidos o incompletos',\r\n      });\r\n\r\n      return;\r\n    }\r\n\r\n    this.statusOfDelete.set('loading');\r\n\r\n    this.documentReferenceRepository\r\n      .delete(this.document()._id)\r\n      .pipe(takeUntilDestroyed(this.destroyRef))\r\n      .subscribe({\r\n        next: (response) => {\r\n          this.statusOfDelete.set('success');\r\n\r\n          this.notificationService.sendAlert({\r\n            type: 'sweetAlert',\r\n            status: 'success',\r\n            message: response.data,\r\n          });\r\n\r\n          this.remove.emit();\r\n        },\r\n        error: (error) => {\r\n          this.statusOfDelete.set('failed');\r\n\r\n          this.notificationService.sendAlert({\r\n            type: 'sweetAlert',\r\n            status: 'error',\r\n            message: JSON.stringify(error.error?.message),\r\n          });\r\n        },\r\n      });\r\n  }\r\n}\r\n","<section class=\"flex shadow-md rounded-md border-r border-info\">\r\n  <div class=\"bg-light-info text-info p-4\">\r\n    <svg\r\n      xmlns=\"http://www.w3.org/2000/svg\"\r\n      width=\"25\"\r\n      height=\"25\"\r\n      viewBox=\"0 0 24 24\"\r\n      fill=\"none\"\r\n      stroke=\"currentColor\"\r\n      stroke-width=\"2\"\r\n      stroke-linecap=\"round\"\r\n      stroke-linejoin=\"round\"\r\n    >\r\n      <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n      <path d=\"M14 3v4a1 1 0 0 0 1 1h4\" />\r\n      <path\r\n        d=\"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z\"\r\n      />\r\n    </svg>\r\n  </div>\r\n  <div class=\"flex-grow flex-col p-4\">\r\n    <h3 class=\"text-info text-xl font-bold\">\r\n      {{ document().document_origin_name }}\r\n    </h3>\r\n\r\n    <div class=\"flex flex-col sm:flex-row gap-4 items-stretch mt-3\">\r\n      <div\r\n        class=\"sm:flex-grow text-base leading-5 text-secondary grid grid-cols-[auto_1fr] gap-x-1 gap-y-2\"\r\n      >\r\n        <svg\r\n          xmlns=\"http://www.w3.org/2000/svg\"\r\n          width=\"20\"\r\n          height=\"20\"\r\n          viewBox=\"0 0 24 24\"\r\n          fill=\"none\"\r\n          stroke=\"currentColor\"\r\n          stroke-width=\"2\"\r\n          stroke-linecap=\"round\"\r\n          stroke-linejoin=\"round\"\r\n        >\r\n          <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n          <path d=\"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0\" />\r\n          <path d=\"M12 9h.01\" />\r\n          <path d=\"M11 12h1v4h1\" />\r\n        </svg>\r\n\r\n        <p>\r\n          <strong class=\"font-semibold\">Tipo de transacción: </strong>\r\n          <span>\r\n            {{ getTransactionType(document().collection_origin_name) }}\r\n          </span>\r\n        </p>\r\n\r\n        <svg\r\n          xmlns=\"http://www.w3.org/2000/svg\"\r\n          width=\"20\"\r\n          height=\"20\"\r\n          viewBox=\"0 0 24 24\"\r\n          fill=\"none\"\r\n          stroke=\"currentColor\"\r\n          stroke-width=\"2\"\r\n          stroke-linecap=\"round\"\r\n          stroke-linejoin=\"round\"\r\n        >\r\n          <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n          <path d=\"M4 4h6v6h-6z\" />\r\n          <path d=\"M14 4h6v6h-6z\" />\r\n          <path d=\"M4 14h6v6h-6z\" />\r\n          <path d=\"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0\" />\r\n        </svg>\r\n\r\n        <p>\r\n          <strong class=\"font-semibold\">Tipo: </strong>\r\n          <span>\r\n            {{ document().type === \"internal\" ? \"Interno\" : \"Externo\" }}\r\n          </span>\r\n        </p>\r\n\r\n        <svg\r\n          xmlns=\"http://www.w3.org/2000/svg\"\r\n          width=\"20\"\r\n          height=\"20\"\r\n          viewBox=\"0 0 24 24\"\r\n          fill=\"none\"\r\n          stroke=\"currentColor\"\r\n          stroke-width=\"2\"\r\n          stroke-linecap=\"round\"\r\n          stroke-linejoin=\"round\"\r\n        >\r\n          <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n          <path\r\n            d=\"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12z\"\r\n          />\r\n          <path d=\"M16 3v4\" />\r\n          <path d=\"M8 3v4\" />\r\n          <path d=\"M4 11h16\" />\r\n          <path d=\"M11 15h1\" />\r\n          <path d=\"M12 15v3\" />\r\n        </svg>\r\n\r\n        <p>\r\n          <strong class=\"font-semibold\">Fecha de creación: </strong>\r\n          <span>{{ document().created_at | date: \"dd/MM/yyyy HH:mm:ss\" }}</span>\r\n        </p>\r\n\r\n        <svg\r\n          xmlns=\"http://www.w3.org/2000/svg\"\r\n          width=\"20\"\r\n          height=\"20\"\r\n          viewBox=\"0 0 24 24\"\r\n          fill=\"none\"\r\n          stroke=\"currentColor\"\r\n          stroke-width=\"2\"\r\n          stroke-linecap=\"round\"\r\n          stroke-linejoin=\"round\"\r\n        >\r\n          <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n          <path d=\"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0\" />\r\n          <path d=\"M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2\" />\r\n        </svg>\r\n\r\n        <p>\r\n          <strong class=\"font-semibold\">Creado por: </strong>\r\n          <span>{{ document().created_user }}</span>\r\n        </p>\r\n      </div>\r\n\r\n      <div class=\"flex justify-end items-end\">\r\n        <button\r\n          class=\"outline-none bg-secondary text-white hover:bg-[#5c636a] flex justify-center items-center py-2 px-6 rounded-full font-medium gap-2 transition-colors flex-grow sm:flex-grow-0\"\r\n          (click)=\"goBack.emit()\"\r\n          type=\"button\"\r\n        >\r\n          <svg\r\n            xmlns=\"http://www.w3.org/2000/svg\"\r\n            width=\"20\"\r\n            height=\"20\"\r\n            viewBox=\"0 0 24 24\"\r\n            fill=\"none\"\r\n            stroke=\"currentColor\"\r\n            stroke-width=\"2\"\r\n            stroke-linecap=\"round\"\r\n            stroke-linejoin=\"round\"\r\n          >\r\n            <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n            <path d=\"M5 12l14 0\" />\r\n            <path d=\"M5 12l6 6\" />\r\n            <path d=\"M5 12l6 -6\" />\r\n          </svg>\r\n\r\n          <span>Regresar</span>\r\n        </button>\r\n      </div>\r\n    </div>\r\n  </div>\r\n</section>\r\n\r\n<section\r\n  class=\"flex gap-1 mt-5 border bg-danger-subtle border-[#feb7c4] rounded-md text-danger p-4\"\r\n>\r\n  <span class=\"pt-0.5\">\r\n    <svg\r\n      xmlns=\"http://www.w3.org/2000/svg\"\r\n      width=\"20\"\r\n      height=\"20\"\r\n      viewBox=\"0 0 24 24\"\r\n      fill=\"none\"\r\n      stroke=\"currentColor\"\r\n      stroke-width=\"2\"\r\n      stroke-linecap=\"round\"\r\n      stroke-linejoin=\"round\"\r\n    >\r\n      <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n      <path d=\"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0\" />\r\n      <path d=\"M12 8v4\" />\r\n      <path d=\"M12 16h.01\" />\r\n    </svg>\r\n  </span>\r\n\r\n  <p>\r\n    ¿Está seguro que desea eliminar esta solicitud? esta acción es irreversible,\r\n    Escriba \"<strong class=\"font-bold\">{{\r\n      document().document_origin_name\r\n    }}</strong\r\n    >\" para eliminar.\r\n  </p>\r\n</section>\r\n\r\n<input\r\n  type=\"text\"\r\n  class=\"form-control w-full mt-4\"\r\n  [placeholder]=\"document().document_origin_name\"\r\n  [formControl]=\"confirmControl\"\r\n  [class.is-invalid]=\"confirmControl.invalid && confirmControl.touched\"\r\n/>\r\n\r\n@if (confirmControl.invalid && confirmControl.touched) {\r\n  <div class=\"invalid-feedback\" [@fadeInOutAnimation]>\r\n    {{\r\n      confirmControl.errors\r\n        | cbmErrorTranslate: { pattern: \"El texto no coincide\" }\r\n    }}\r\n  </div>\r\n}\r\n\r\n<div class=\"flex flex-wrap justify-center gap-2 mt-4\">\r\n  <button\r\n    type=\"button\"\r\n    class=\"outline-none py-2 px-6 text-white rounded-full flex justify-center items-center gap-2 font-medium bg-info hover:bg-[#409ae9] transition-colors flex-grow sm:flex-grow-0 disabled:pointer-events-none disabled:opacity-70\"\r\n    [disabled]=\"confirmControl.invalid || statusOfDelete() === 'loading'\"\r\n    (click)=\"deleteDocument()\"\r\n  >\r\n    @if (statusOfDelete() === \"loading\") {\r\n      <div role=\"status\">\r\n        <svg\r\n          aria-hidden=\"true\"\r\n          class=\"w-5 h-5 text-gray-400 animate-spin fill-white\"\r\n          viewBox=\"0 0 100 101\"\r\n          fill=\"none\"\r\n          xmlns=\"http://www.w3.org/2000/svg\"\r\n        >\r\n          <path\r\n            d=\"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z\"\r\n            fill=\"currentColor\"\r\n          />\r\n          <path\r\n            d=\"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z\"\r\n            fill=\"currentFill\"\r\n          />\r\n        </svg>\r\n        <span class=\"sr-only\">Loading...</span>\r\n      </div>\r\n    } @else {\r\n      <svg\r\n        xmlns=\"http://www.w3.org/2000/svg\"\r\n        width=\"20\"\r\n        height=\"20\"\r\n        viewBox=\"0 0 24 24\"\r\n        fill=\"none\"\r\n        stroke=\"currentColor\"\r\n        stroke-width=\"2\"\r\n        stroke-linecap=\"round\"\r\n        stroke-linejoin=\"round\"\r\n      >\r\n        <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n        <path d=\"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\" />\r\n        <path d=\"M9 12l2 2l4 -4\" />\r\n      </svg>\r\n    }\r\n\r\n    Procesar\r\n  </button>\r\n\r\n  <button\r\n    type=\"button\"\r\n    class=\"outline-none py-2 px-6 text-secondary rounded-full flex justify-center items-center gap-2 font-medium bg-light-secondary hover:bg-secondary hover:text-white transition-colors flex-grow sm:flex-grow-0 disabled:pointer-events-none disabled:opacity-70\"\r\n    (click)=\"goBack.emit()\"\r\n    [disabled]=\"statusOfDelete() === 'loading'\"\r\n  >\r\n    <svg\r\n      xmlns=\"http://www.w3.org/2000/svg\"\r\n      width=\"20\"\r\n      height=\"20\"\r\n      viewBox=\"0 0 24 24\"\r\n      fill=\"none\"\r\n      stroke=\"currentColor\"\r\n      stroke-width=\"2\"\r\n      stroke-linecap=\"round\"\r\n      stroke-linejoin=\"round\"\r\n    >\r\n      <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n      <path d=\"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\" />\r\n      <path d=\"M10 10l4 4m0 -4l-4 4\" />\r\n    </svg>\r\n\r\n    Cancelar\r\n  </button>\r\n</div>\r\n","import {\r\n  ChangeDetectionStrategy,\r\n  Component,\r\n  DestroyRef,\r\n  ElementRef,\r\n  SimpleChanges,\r\n  input,\r\n  signal,\r\n  viewChildren,\r\n} from '@angular/core';\r\nimport { TStatus } from '../../types';\r\nimport {\r\n  CbmDocumentReferenceModel,\r\n  CbmDocumentReferenceRepository,\r\n} from '@g2-common/document-reference-repository';\r\nimport { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';\r\nimport { DatePipe, NgClass, formatDate } from '@angular/common';\r\nimport { CbmNotificationService } from '@g2-common/notification-service';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { DeleteComponent } from './delete/delete.component';\r\nimport { NgSelectModule } from '@ng-select/ng-select';\r\nimport { fadeInOutAnimation } from '../../animations';\r\nimport { CbmTooltipDirective } from '@g2-common/tooltip-directive';\r\nimport { CbmEmptyComponent } from '@g2-common/empty';\r\n\r\n@Component({\r\n  selector: 'lib-reference-document-by-tab',\r\n  standalone: true,\r\n  imports: [\r\n    ReactiveFormsModule,\r\n    DatePipe,\r\n    NgSelectModule,\r\n    NgClass,\r\n    DeleteComponent,\r\n    CbmTooltipDirective,\r\n    CbmEmptyComponent,\r\n  ],\r\n  templateUrl: './reference-document-by-tab.component.html',\r\n  styleUrl: './reference-document-by-tab.component.css',\r\n  changeDetection: ChangeDetectionStrategy.OnPush,\r\n  animations: [fadeInOutAnimation],\r\n})\r\nexport class ReferenceDocumentByTabComponent {\r\n  // #region refs\r\n  dropdownMenus = viewChildren<ElementRef>('dropdownMenu');\r\n\r\n  // #region inputs\r\n  collectionId = input.required<string>();\r\n  collectionName = input.required<string>();\r\n\r\n  // #region state\r\n  isFormForFilterVisible = signal<boolean>(false);\r\n  statusOfFetchDocuments = signal<TStatus>('init');\r\n  statusOfDeleteDocument = signal<TStatus>('init');\r\n  documents = signal<CbmDocumentReferenceModel.ListResponse.Data[]>([]);\r\n  isSmallScreen = signal<boolean>(false);\r\n  isDeleteViewVisible = signal<boolean>(false);\r\n\r\n  documentToDelete = signal<CbmDocumentReferenceModel.ListResponse.Data | null>(\r\n    null,\r\n  );\r\n\r\n  // #region varibles\r\n  now = new Date();\r\n\r\n  documentListener = () => {\r\n    const dropdownMenus = this.dropdownMenus();\r\n\r\n    if (dropdownMenus.length) {\r\n      dropdownMenus.forEach(({ nativeElement: dropdownMenu }) => {\r\n        if (!dropdownMenu.classList.contains('invisible')) {\r\n          dropdownMenu.classList.toggle('invisible');\r\n          dropdownMenu.classList.toggle('translate-y-2');\r\n          dropdownMenu.classList.toggle('opacity-0');\r\n        }\r\n      });\r\n    }\r\n  };\r\n\r\n  // #region forms\r\n  formForFilter = new FormGroup({\r\n    startDate: new FormControl<string | null>(\r\n      formatDate(new Date().setDate(1), 'yyyy-MM-dd', 'en'),\r\n    ),\r\n    endDate: new FormControl<string | null>(\r\n      formatDate(new Date(), 'yyyy-MM-dd', 'en'),\r\n    ),\r\n  });\r\n\r\n  // #region constructor\r\n  constructor(\r\n    private documentReferenceRepository: CbmDocumentReferenceRepository,\r\n    private notificationService: CbmNotificationService,\r\n    private destroyRef: DestroyRef,\r\n  ) {}\r\n\r\n  // #region hooks\r\n  ngOnChanges(changes: SimpleChanges): void {\r\n    this.fetchDocuments();\r\n  }\r\n\r\n  ngOnInit(): void {\r\n    if (window.matchMedia('(min-width: 875px)').matches) {\r\n      this.isSmallScreen.set(false);\r\n    } else {\r\n      this.isSmallScreen.set(true);\r\n    }\r\n\r\n    window\r\n      .matchMedia('(min-width: 875px)')\r\n      .addEventListener('change', (event) => {\r\n        this.isSmallScreen.set(!event.matches);\r\n      });\r\n  }\r\n\r\n  ngAfterViewChecked(): void {\r\n    document.documentElement.removeEventListener(\r\n      'click',\r\n      this.documentListener,\r\n    );\r\n\r\n    document.documentElement.addEventListener('click', this.documentListener);\r\n  }\r\n\r\n  // #region methods\r\n  fetchDocuments(): void {\r\n    this.statusOfFetchDocuments.set('loading');\r\n\r\n    const { startDate, endDate } = this.formForFilter.getRawValue();\r\n\r\n    const params: CbmDocumentReferenceModel.ListParams = {\r\n      collection_destination_id: this.collectionId(),\r\n      collection_destination_name: this.collectionName(),\r\n    };\r\n\r\n    if (startDate) {\r\n      const [year, month, day] = startDate.split('-').map(Number);\r\n      params.start_date = new Date(year, month - 1, day).getTime();\r\n    }\r\n\r\n    if (endDate) {\r\n      const [year, month, day] = endDate.split('-').map(Number);\r\n      params.end_date = new Date(year, month - 1, day).getTime();\r\n    }\r\n\r\n    this.documentReferenceRepository\r\n      .list(params)\r\n      .pipe(takeUntilDestroyed(this.destroyRef))\r\n      .subscribe({\r\n        next: (response) => {\r\n          this.documents.set(response.data);\r\n          this.statusOfFetchDocuments.set('success');\r\n        },\r\n        error: (error) => {\r\n          this.statusOfFetchDocuments.set('failed');\r\n\r\n          this.notificationService.sendAlert({\r\n            type: 'toast',\r\n            status: 'error',\r\n            message: JSON.stringify(error.error?.message),\r\n          });\r\n        },\r\n      });\r\n  }\r\n\r\n  onDropdownMenuClick(event: MouseEvent, dropdownMenu: HTMLUListElement): void {\r\n    event.stopPropagation();\r\n\r\n    this.dropdownMenus().forEach((ref) => {\r\n      if (ref.nativeElement === dropdownMenu) {\r\n        dropdownMenu.classList.toggle('invisible');\r\n        dropdownMenu.classList.toggle('translate-y-2');\r\n        dropdownMenu.classList.toggle('opacity-0');\r\n      } else {\r\n        ref.nativeElement.classList.add('invisible');\r\n        ref.nativeElement.classList.add('translate-y-2');\r\n        ref.nativeElement.classList.add('opacity-0');\r\n      }\r\n    });\r\n  }\r\n\r\n  getTransactionType(collectionName: string): string {\r\n    switch (collectionName) {\r\n      case 'quotation':\r\n        return 'Oferta de venta';\r\n      case 'order':\r\n        return 'Pedido de venta';\r\n      case 'invoice':\r\n        return 'Factura';\r\n      case 'credit_management':\r\n        return 'Créditos';\r\n      case 'credit_management_installment':\r\n        return 'Cuotas';\r\n      case 'income':\r\n        return 'Cobro';\r\n      case 'export_invoice':\r\n        return 'Factura de exportación';\r\n      case 'sale_note':\r\n        return 'Nota de venta';\r\n      case 'billing_order':\r\n        return 'Orden de facturación';\r\n      case 'credit_note':\r\n        return 'Nota de crédito';\r\n      case 'referal_guide':\r\n        return 'Guía de remisión';\r\n      case 'retention':\r\n        return 'Retención de venta';\r\n      case 'debit_note':\r\n        return 'Nota de débito';\r\n      case 'closing_of_cash':\r\n        return 'Cierre de caja';\r\n      case 'document_liquidation':\r\n        return 'Liquidación de documentos';\r\n      case 'initial_balance':\r\n        return 'Saldo inicial';\r\n      case 'cash_liquidation':\r\n        return 'Liquidación en efectivo';\r\n      case 'down_payment':\r\n        return 'Anticipo';\r\n      case 'internal_credit':\r\n        return 'Crédito interno';\r\n      case 'crossing_account':\r\n        return 'Cruce de cuentas';\r\n      case 'delivery_request':\r\n        return 'Solicitud de entrega';\r\n      case 'delivery':\r\n        return 'Entrega de mercancías';\r\n      case 'delivery_return':\r\n        return 'Devolución de entrega';\r\n      case 'invoice_reverse':\r\n        return 'Reversión de facturas';\r\n      case 'credit_note_reverse':\r\n        return 'Reversión de nota de crédito';\r\n      case 'document_liquidation_reverse':\r\n        return 'Reversión de liquidación de documentos';\r\n      case 'retention_reverse':\r\n        return 'Reversión de retención de venta';\r\n      case 'income_reverse':\r\n        return 'Reversión de cobro';\r\n      case 'cash_liquidation_reverse':\r\n        return 'Reversión de liquidación en efectivo';\r\n      case 'down_payment_reverse':\r\n        return 'Reversión de anticipo';\r\n      case 'sale_note_reverse':\r\n        return 'Reversión de nota de venta';\r\n      case 'internal_credit_reverse':\r\n        return 'Reversión de crédito interno';\r\n      case 'debit_note_reverse_sales':\r\n        return 'Reversión de nota de débito';\r\n      case 'crossing_accounts_reverse':\r\n        return 'Reversión de cruce de cuentas';\r\n      case 'outgoing_banking_transaction':\r\n        return 'Transacción bancaria de egreso';\r\n      case 'outgoing_banking_transaction_reverse':\r\n        return 'Reversión de transacción bancaria de egreso';\r\n      case 'deposit_cheque':\r\n        return 'Depósito de cheques recibidos';\r\n      default:\r\n        return collectionName;\r\n    }\r\n  }\r\n\r\n  onDeletePress(document: CbmDocumentReferenceModel.ListResponse.Data): void {\r\n    if (!document.type_record) {\r\n      this.notificationService.sendAlert({\r\n        type: 'sweetAlert',\r\n        status: 'warning',\r\n        message:\r\n          'No se puede borrar la relacion de documento de tipo automático.',\r\n      });\r\n      return;\r\n    }\r\n    this.documentToDelete.set(document);\r\n    this.isDeleteViewVisible.set(true);\r\n  }\r\n\r\n  onBackPress(): void {\r\n    this.documentToDelete.set(null);\r\n    this.isDeleteViewVisible.set(false);\r\n  }\r\n}\r\n","@if (isDeleteViewVisible() && documentToDelete()) {\r\n  <lib-delete\r\n    [document]=\"documentToDelete()!\"\r\n    (goBack)=\"onBackPress()\"\r\n    (remove)=\"fetchDocuments(); onBackPress()\"\r\n  ></lib-delete>\r\n} @else {\r\n  <div class=\"flex justify-end\">\r\n    @if (isFormForFilterVisible()) {\r\n      <button\r\n        class=\"outline-none bg-secondary text-white hover:bg-[#5c636a] rounded-md px-2 py-1 text-xs transition-colors flex justify-center items-center gap-1\"\r\n        (click)=\"isFormForFilterVisible.set(false)\"\r\n        type=\"button\"\r\n      >\r\n        <svg\r\n          xmlns=\"http://www.w3.org/2000/svg\"\r\n          viewBox=\"0 0 24 24\"\r\n          fill=\"none\"\r\n          stroke=\"currentColor\"\r\n          stroke-width=\"2\"\r\n          stroke-linecap=\"round\"\r\n          stroke-linejoin=\"round\"\r\n          class=\"size-3\"\r\n        >\r\n          <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n          <path d=\"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\" />\r\n          <path d=\"M10 10l4 4m0 -4l-4 4\" />\r\n        </svg>\r\n        <span>Cerrar</span>\r\n      </button>\r\n    } @else {\r\n      <button\r\n        class=\"outline-none bg-info text-white hover:bg-[#409ae9] rounded-md px-2 py-1 text-xs transition-colors flex justify-center items-center gap-1\"\r\n        (click)=\"isFormForFilterVisible.set(true)\"\r\n        type=\"button\"\r\n      >\r\n        <svg\r\n          xmlns=\"http://www.w3.org/2000/svg\"\r\n          viewBox=\"0 0 24 24\"\r\n          fill=\"currentColor\"\r\n          class=\"size-3\"\r\n        >\r\n          <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n          <path\r\n            d=\"M20 3h-16a1 1 0 0 0 -1 1v2.227l.008 .223a3 3 0 0 0 .772 1.795l4.22 4.641v8.114a1 1 0 0 0 1.316 .949l6 -2l.108 -.043a1 1 0 0 0 .576 -.906v-6.586l4.121 -4.12a3 3 0 0 0 .879 -2.123v-2.171a1 1 0 0 0 -1 -1z\"\r\n          />\r\n        </svg>\r\n        <span>Filtrar</span>\r\n      </button>\r\n    }\r\n  </div>\r\n\r\n  @if (isFormForFilterVisible()) {\r\n    <form\r\n      [formGroup]=\"formForFilter\"\r\n      (ngSubmit)=\"fetchDocuments()\"\r\n      class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 mt-3 gap-3\"\r\n      [@fadeInOutAnimation]\r\n    >\r\n      <div class=\"flex flex-col items-start\">\r\n        <label\r\n          class=\"text-base font-normal text-[#67757c]\"\r\n          for=\"start-date-input\"\r\n        >\r\n          Rango de fechas (Desde - Hasta)\r\n        </label>\r\n\r\n        <div class=\"flex gap-1 mt-2 self-stretch\">\r\n          <input\r\n            id=\"start-date-input\"\r\n            type=\"date\"\r\n            class=\"form-control form-control-sm flex-grow\"\r\n            formControlName=\"startDate\"\r\n          />\r\n\r\n          <span class=\"self-center\">-</span>\r\n\r\n          <input\r\n            type=\"date\"\r\n            class=\"form-control form-control-sm flex-grow\"\r\n            formControlName=\"endDate\"\r\n            [max]=\"now | date: 'yyyy-MM-dd'\"\r\n          />\r\n        </div>\r\n      </div>\r\n\r\n      <div class=\"md:col-span-2 lg:col-span-3 flex justify-end mt-2\">\r\n        <button\r\n          type=\"submit\"\r\n          class=\"outline-none py-2 px-6 text-white rounded-full flex justify-center items-center gap-2 font-medium bg-info hover:bg-[#409ae9] transition-colors flex-grow sm:flex-grow-0 disabled:pointer-events-none\"\r\n          [disabled]=\"statusOfFetchDocuments() === 'loading'\"\r\n        >\r\n          @if (statusOfFetchDocuments() === \"loading\") {\r\n            <div role=\"status\">\r\n              <svg\r\n                aria-hidden=\"true\"\r\n                class=\"w-5 h-5 text-gray-400 animate-spin fill-white\"\r\n                viewBox=\"0 0 100 101\"\r\n                fill=\"none\"\r\n                xmlns=\"http://www.w3.org/2000/svg\"\r\n              >\r\n                <path\r\n                  d=\"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z\"\r\n                  fill=\"currentColor\"\r\n                />\r\n                <path\r\n                  d=\"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z\"\r\n                  fill=\"currentFill\"\r\n                />\r\n              </svg>\r\n              <span class=\"sr-only\">Loading...</span>\r\n            </div>\r\n          } @else {\r\n            <svg\r\n              xmlns=\"http://www.w3.org/2000/svg\"\r\n              width=\"20\"\r\n              height=\"20\"\r\n              viewBox=\"0 0 24 24\"\r\n              fill=\"none\"\r\n              stroke=\"currentColor\"\r\n              stroke-width=\"2\"\r\n              stroke-linecap=\"round\"\r\n              stroke-linejoin=\"round\"\r\n            >\r\n              <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n              <path d=\"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0\" />\r\n              <path d=\"M21 21l-6 -6\" />\r\n            </svg>\r\n          }\r\n\r\n          Buscar\r\n        </button>\r\n      </div>\r\n    </form>\r\n  }\r\n\r\n  @if (isSmallScreen()) {\r\n    <div class=\"mt-4 border-y border-[#dde3e7] grid grid-cols-[auto_1fr_auto]\">\r\n      <!-- 💀 -->\r\n      @if (statusOfFetchDocuments() === \"loading\") {\r\n        @for (_ of [].constructor(4); track _) {\r\n          <div\r\n            class=\"bg-[#d2e7fa] p-3 text-xs fon4t-semibold text-left align-top loading-skeleton\"\r\n            [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n          >\r\n            <p>-</p>\r\n          </div>\r\n          <div\r\n            class=\"flex-grow grid grid-cols-[auto_1fr] text-[#67757c] loading-skeleton\"\r\n            [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n          >\r\n            <div class=\"p-3 text-xs text-left align-top font-semibold\">\r\n              <p>Tipo de registro</p>\r\n            </div>\r\n            <div class=\"p-3 text-xs text-left align-top\">\r\n              <p>-</p>\r\n            </div>\r\n            <div class=\"p-3 text-xs text-left align-top font-semibold\">\r\n              <p>Tipo</p>\r\n            </div>\r\n            <div class=\"p-3 text-xs text-left align-top\">\r\n              <p>-</p>\r\n            </div>\r\n            <div class=\"p-3 text-xs text-left align-top font-semibold\">\r\n              <p>Módulo</p>\r\n            </div>\r\n            <div class=\"p-3 text-xs text-left align-top\">\r\n              <p>-</p>\r\n            </div>\r\n\r\n            <div\r\n              class=\"p-3 text-xs text-left align-top font-semibold border-t border-[#dde3e7]\"\r\n            >\r\n              <p>Secuencial</p>\r\n            </div>\r\n            <div\r\n              class=\"p-3 text-xs text-left align-top border-t border-[#dde3e7]\"\r\n            >\r\n              <p>-</p>\r\n            </div>\r\n\r\n            <div\r\n              class=\"p-3 text-xs text-left align-top font-semibold border-t border-[#dde3e7]\"\r\n            >\r\n              <p>Fecha</p>\r\n            </div>\r\n            <div\r\n              class=\"p-3 text-xs text-left align-top border-t border-[#dde3e7]\"\r\n            >\r\n              <p>-</p>\r\n            </div>\r\n\r\n            <div\r\n              class=\"p-3 text-xs text-left align-top font-semibold border-t border-[#dde3e7]\"\r\n            >\r\n              <p>Fecha de referencia</p>\r\n            </div>\r\n            <div\r\n              class=\"p-3 text-xs text-left align-top border-t border-[#dde3e7]\"\r\n            >\r\n              <p>-</p>\r\n            </div>\r\n          </div>\r\n          <div\r\n            class=\"p-2 align-top bg-[#e7ebee] relative loading-skeleton\"\r\n            [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n          >\r\n            <button\r\n              class=\"outline-none text-secondary hover:text-info\"\r\n              type=\"button\"\r\n            >\r\n              <svg\r\n                xmlns=\"http://www.w3.org/2000/svg\"\r\n                width=\"16\"\r\n                height=\"16\"\r\n                viewBox=\"0 0 24 24\"\r\n                fill=\"none\"\r\n                stroke=\"currentColor\"\r\n                stroke-width=\"2\"\r\n                stroke-linecap=\"round\"\r\n                stroke-linejoin=\"round\"\r\n              >\r\n                <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n                <path d=\"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\" />\r\n                <path d=\"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\" />\r\n                <path d=\"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\" />\r\n              </svg>\r\n            </button>\r\n          </div>\r\n        }\r\n      }\r\n      <!-- 💀 -->\r\n\r\n      <!-- 👨 -->\r\n      @if (statusOfFetchDocuments() === \"success\") {\r\n        @if (documents().length) {\r\n          @for (document of documents(); track document._id) {\r\n            <div\r\n              class=\"bg-[#d2e7fa] p-3 text-xs font-semibold text-left align-top\"\r\n              [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n            >\r\n              {{ $index + 1 }}\r\n            </div>\r\n\r\n            <div\r\n              class=\"flex-grow grid grid-cols-[auto_1fr] text-[#67757c]\"\r\n              [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n            >\r\n              <div class=\"p-3 text-xs text-left align-top font-semibold\">\r\n                Tipo de registro\r\n              </div>\r\n              <div class=\"p-3 text-xs text-left align-top\">\r\n                <span class=\"inline-block align-baseline leading-5\">\r\n                  @if (document.type_record) {\r\n                    <span\r\n                      class=\"py-0.5 px-1 bg-light-success rounded-md text-success\"\r\n                    >\r\n                      Manual\r\n                    </span>\r\n                  } @else {\r\n                    <span\r\n                      class=\"py-0.5 px-1 rounded-md text-info bg-light-info\"\r\n                    >\r\n                      Automático\r\n                    </span>\r\n                  }\r\n                </span>\r\n              </div>\r\n              <div\r\n                class=\"p-3 text-xs text-left align-top font-semibold border-t border-[#dde3e7]\"\r\n              >\r\n                Tipo\r\n              </div>\r\n              <div\r\n                class=\"p-3 text-xs text-left align-top border-t border-[#dde3e7] text-ellipsis overflow-hidden\"\r\n              >\r\n                <span class=\"inline-block align-baseline leading-5\">\r\n                  @switch (document.type) {\r\n                    @case (\"internal\") {\r\n                      <span\r\n                        class=\"py-0.5 px-1 bg-light-info rounded-md text-info\"\r\n                      >\r\n                        Interno\r\n                      </span>\r\n                    }\r\n\r\n                    @case (\"external\") {\r\n                      <span\r\n                        class=\"py-0.5 px-1 bg-light-info rounded-md text-success\"\r\n                      >\r\n                        Externo\r\n                      </span>\r\n                    }\r\n                  }\r\n                </span>\r\n              </div>\r\n              <div class=\"p-3 text-xs text-left align-top font-semibold\">\r\n                Módulo\r\n              </div>\r\n              <div class=\"p-3 text-xs text-left align-top\">\r\n                {{ getTransactionType(document.collection_origin_name) }}\r\n              </div>\r\n\r\n              <div\r\n                class=\"p-3 text-xs text-left align-top font-semibold border-t border-[#dde3e7]\"\r\n              >\r\n                Secuencial\r\n              </div>\r\n              <div\r\n                class=\"p-3 text-xs text-left align-top border-t border-[#dde3e7] text-ellipsis overflow-hidden\"\r\n              >\r\n                {{ document.document_origin_name }}\r\n              </div>\r\n\r\n              <div\r\n                class=\"p-3 text-xs text-left align-top font-semibold border-t border-[#dde3e7]\"\r\n              >\r\n                Fecha\r\n              </div>\r\n              <div\r\n                class=\"p-3 text-xs text-left align-top border-t border-[#dde3e7] text-ellipsis overflow-hidden\"\r\n              >\r\n                {{\r\n                  document.document_origin_date | date: \"dd/MM/yyyy HH:mm:ss\"\r\n                }}\r\n              </div>\r\n\r\n              <div\r\n                class=\"p-3 text-xs text-left align-top font-semibold border-t border-[#dde3e7]\"\r\n              >\r\n                Fecha de referencia\r\n              </div>\r\n              <div\r\n                class=\"p-3 text-xs text-left align-top border-t border-[#dde3e7] text-ellipsis overflow-hidden\"\r\n              >\r\n                {{ document.created_at | date: \"dd/MM/yyyy HH:mm:ss\" }}\r\n              </div>\r\n            </div>\r\n\r\n            <div\r\n              class=\"p-2 align-top bg-[#e7ebee] relative\"\r\n              [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n            >\r\n              <button\r\n                class=\"outline-none text-secondary hover:text-info\"\r\n                id=\"actions-button-{{ document._id }}\"\r\n                (click)=\"onDropdownMenuClick($event, dropdownMenu)\"\r\n                cbmTooltip=\"Opciones\"\r\n                type=\"button\"\r\n              >\r\n                <svg\r\n                  xmlns=\"http://www.w3.org/2000/svg\"\r\n                  width=\"16\"\r\n                  height=\"16\"\r\n                  viewBox=\"0 0 24 24\"\r\n                  fill=\"none\"\r\n                  stroke=\"currentColor\"\r\n                  stroke-width=\"2\"\r\n                  stroke-linecap=\"round\"\r\n                  stroke-linejoin=\"round\"\r\n                >\r\n                  <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n                  <path d=\"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\" />\r\n                  <path d=\"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\" />\r\n                  <path d=\"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\" />\r\n                </svg>\r\n              </button>\r\n\r\n              <ul\r\n                class=\"z-10 absolute bg-white divide-y divide-gray-50 text-[#67757c] rounded-md shadow-lg py-2 text-sm -translate-x-[85%] transition-transform translate-y-2 invisible opacity-0 w-44\"\r\n                [attr.aria-labelledby]=\"'actions-button-' + document._id\"\r\n                #dropdownMenu\r\n              >\r\n                <li>\r\n                  <button\r\n                    class=\"flex px-4 py-2 hover:bg-gray-100 w-full gap-2 items-center\"\r\n                    (click)=\"onDeletePress(document)\"\r\n                    type=\"button\"\r\n                  >\r\n                    <svg\r\n                      xmlns=\"http://www.w3.org/2000/svg\"\r\n                      width=\"16\"\r\n                      height=\"16\"\r\n                      viewBox=\"0 0 24 24\"\r\n                      fill=\"none\"\r\n                      stroke=\"currentColor\"\r\n                      stroke-width=\"2\"\r\n                      stroke-linecap=\"round\"\r\n                      stroke-linejoin=\"round\"\r\n                    >\r\n                      <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n                      <path d=\"M4 7l16 0\" />\r\n                      <path d=\"M10 11l0 6\" />\r\n                      <path d=\"M14 11l0 6\" />\r\n                      <path\r\n                        d=\"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12\"\r\n                      />\r\n                      <path d=\"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3\" />\r\n                    </svg>\r\n\r\n                    <span>Eliminar</span>\r\n                  </button>\r\n                </li>\r\n              </ul>\r\n            </div>\r\n          }\r\n        } @else {\r\n          <div class=\"col-span-3 px-4 py-5 border-x border-[#dde3e7]\">\r\n            <cbm-empty />\r\n          </div>\r\n        }\r\n      }\r\n      <!-- 👨 -->\r\n    </div>\r\n  } @else {\r\n    <table aria-label=\"Tabla de documentos\" class=\"w-full mt-4\">\r\n      <thead class=\"bg-[#d2e7fa] border-b border-info text-black\">\r\n        <tr>\r\n          <th class=\"p-3 text-xs font-semibold text-left align-bottom\">N°</th>\r\n          <th class=\"p-3 text-xs font-semibold text-left align-bottom\">\r\n            Tipo de registro\r\n          </th>\r\n          <th class=\"p-3 text-xs font-semibold text-left align-bottom\">Tipo</th>\r\n          <th class=\"p-3 text-xs font-semibold text-left align-bottom\">\r\n            Módulo\r\n          </th>\r\n          <th class=\"p-3 text-xs font-semibold text-left align-bottom\">\r\n            Secuencial\r\n          </th>\r\n          <th class=\"p-3 text-xs font-semibold text-left align-bottom\">\r\n            Fecha\r\n          </th>\r\n          <th class=\"p-3 text-xs font-semibold text-left align-bottom\">\r\n            Fecha de referencia\r\n          </th>\r\n          <th class=\"p-3 text-xs font-semibold text-center align-bottom\">\r\n            Acciones\r\n          </th>\r\n        </tr>\r\n      </thead>\r\n\r\n      <!-- 💀 -->\r\n      @if (statusOfFetchDocuments() === \"loading\") {\r\n        <tbody class=\"loading-skeleton\">\r\n          @for (_ of [].constructor(4); track _) {\r\n            <tr class=\"border-b border-[#dde3e7]\">\r\n              @for (__ of [].constructor(8); track __) {\r\n                <td class=\"p-3\">\r\n                  <p>-</p>\r\n                </td>\r\n              }\r\n            </tr>\r\n          }\r\n        </tbody>\r\n      }\r\n      <!-- 💀 -->\r\n\r\n      <!-- 👨 -->\r\n      @if (statusOfFetchDocuments() === \"success\") {\r\n        <tbody class=\"text-[#67757c]\">\r\n          @if (documents().length) {\r\n            @for (document of documents(); track document._id) {\r\n              <tr class=\"border-b border-[#dde3e7]\">\r\n                <td class=\"p-3 text-xs text-left font-bold align-top\">\r\n                  {{ $index + 1 }}\r\n                </td>\r\n                <td class=\"p-3 text-xs text-left align-top min-w-44\">\r\n                  <span class=\"inline-block align-baseline leading-5\">\r\n                    @if (document.type_record) {\r\n                      <span\r\n                        class=\"py-0.5 px-1 bg-light-success rounded-md text-success\"\r\n                      >\r\n                        Manual\r\n                      </span>\r\n                    } @else {\r\n                      <span\r\n                        class=\"py-0.5 px-1 rounded-md text-info bg-light-info\"\r\n                      >\r\n                        Automático\r\n                      </span>\r\n                    }\r\n                  </span>\r\n                </td>\r\n                <td class=\"p-3 text-xs text-left align-top min-w-44\">\r\n                  <span class=\"inline-block align-baseline leading-5\">\r\n                    @switch (document.type) {\r\n                      @case (\"internal\") {\r\n                        <span\r\n                          class=\"py-0.5 px-1 bg-light-info rounded-md text-info\"\r\n                        >\r\n                          Interno\r\n                        </span>\r\n                      }\r\n\r\n                      @case (\"external\") {\r\n                        <span\r\n                          class=\"py-0.5 px-1 bg-light-info rounded-md text-success\"\r\n                        >\r\n                          Externo\r\n                        </span>\r\n                      }\r\n                    }\r\n                  </span>\r\n                </td>\r\n                <td class=\"p-3 text-xs text-left align-top min-w-44\">\r\n                  {{ getTransactionType(document.collection_origin_name) }}\r\n                </td>\r\n                <td class=\"p-3 text-xs text-left align-top min-w-28\">\r\n                  {{ document.document_origin_name }}\r\n                </td>\r\n                <td class=\"p-3 text-xs text-left align-top min-w-40\">\r\n                  {{\r\n                    document.document_origin_date | date: \"dd/MM/yyyy HH:mm:ss\"\r\n                  }}\r\n                </td>\r\n                <td class=\"p-3 text-xs text-left align-top min-w-40\">\r\n                  {{ document.created_at | date: \"dd/MM/yyyy HH:mm:ss\" }}\r\n                </td>\r\n                <td class=\"p-3 text-xs text-center align-top relative\">\r\n                  <button\r\n                    class=\"outline-none text-secondary hover:text-info\"\r\n                    id=\"actions-button-{{ document._id }}\"\r\n                    (click)=\"onDropdownMenuClick($event, dropdownMenu)\"\r\n                    cbmTooltip=\"Opciones\"\r\n                    type=\"button\"\r\n                  >\r\n                    <svg\r\n                      xmlns=\"http://www.w3.org/2000/svg\"\r\n                      width=\"20\"\r\n                      height=\"20\"\r\n                      viewBox=\"0 0 24 24\"\r\n                      fill=\"none\"\r\n                      stroke=\"currentColor\"\r\n                      stroke-width=\"2\"\r\n                      stroke-linecap=\"round\"\r\n                      stroke-linejoin=\"round\"\r\n                    >\r\n                      <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n                      <path d=\"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\" />\r\n                      <path d=\"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\" />\r\n                      <path d=\"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\" />\r\n                    </svg>\r\n                  </button>\r\n\r\n                  <ul\r\n                    class=\"z-10 absolute bg-white divide-y divide-gray-50 text-[#67757c] rounded-md shadow-lg py-2 text-sm -translate-x-[70%] transition-transform translate-y-2 invisible opacity-0 w-44\"\r\n                    [attr.aria-labelledby]=\"'actions-button-' + document._id\"\r\n                    #dropdownMenu\r\n                  >\r\n                    <li>\r\n                      <button\r\n                        class=\"flex px-4 py-2 hover:bg-gray-100 w-full gap-2 items-center\"\r\n                        (click)=\"onDeletePress(document)\"\r\n                        type=\"button\"\r\n                      >\r\n                        <svg\r\n                          xmlns=\"http://www.w3.org/2000/svg\"\r\n                          width=\"16\"\r\n                          height=\"16\"\r\n                          viewBox=\"0 0 24 24\"\r\n                          fill=\"none\"\r\n                          stroke=\"currentColor\"\r\n                          stroke-width=\"2\"\r\n                          stroke-linecap=\"round\"\r\n                          stroke-linejoin=\"round\"\r\n                        >\r\n                          <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n                          <path d=\"M4 7l16 0\" />\r\n                          <path d=\"M10 11l0 6\" />\r\n                          <path d=\"M14 11l0 6\" />\r\n                          <path\r\n                            d=\"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12\"\r\n                          />\r\n                          <path d=\"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3\" />\r\n                        </svg>\r\n\r\n                        <span>Eliminar</span>\r\n                      </button>\r\n                    </li>\r\n                  </ul>\r\n                </td>\r\n              </tr>\r\n            }\r\n          } @else {\r\n            <tr class=\"border-b border-[#dde3e7]\">\r\n              <td colspan=\"8\" class=\"px-4 py-5\">\r\n                <cbm-empty />\r\n              </td>\r\n            </tr>\r\n          }\r\n        </tbody>\r\n      }\r\n      <!-- 👨 -->\r\n    </table>\r\n  }\r\n}\r\n","import {\r\n  ChangeDetectionStrategy,\r\n  Component,\r\n  DestroyRef,\r\n  OnInit,\r\n  computed,\r\n  input,\r\n  output,\r\n  signal,\r\n} from '@angular/core';\r\nimport {\r\n  FormArray,\r\n  FormControl,\r\n  FormGroup,\r\n  ReactiveFormsModule,\r\n  ValidationErrors,\r\n  Validators,\r\n} from '@angular/forms';\r\nimport { CbmErrorTranslatePipe } from '@g2-common/error-translate-pipe';\r\nimport { NgSelectModule } from '@ng-select/ng-select';\r\nimport { fadeInOutAnimation } from '../../animations';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { DatePipe, NgClass, formatDate } from '@angular/common';\r\nimport { CbmTextInputDirective } from '@g2-common/text-input-directive';\r\nimport { TStatus } from '../../types';\r\nimport {\r\n  CbmGoodsReceiptModel,\r\n  CbmGoodsReceiptRepository,\r\n} from '@g2-common/goods-receipt-repository';\r\nimport {\r\n  CbmGoodsIssueModel,\r\n  CbmGoodsIssueRepository,\r\n} from '@g2-common/goods-issue-repository';\r\nimport {\r\n  CbmIncomeModel,\r\n  CbmIncomeRepository,\r\n} from '@g2-common/income-repository';\r\nimport {\r\n  CbmInvoiceModel,\r\n  CbmInvoiceRepository,\r\n} from '@g2-common/invoice-repository';\r\nimport {\r\n  CbmDocumentLiquidationModel,\r\n  CbmDocumentLiquidationRepository,\r\n} from '@g2-common/document-liquidation-repository';\r\nimport { CbmNotificationService } from '@g2-common/notification-service';\r\nimport { CbmTooltipDirective } from '@g2-common/tooltip-directive';\r\nimport { CbmPaginationNavComponent } from '@g2-common/pagination-nav';\r\nimport { CbmHorizontalOverflowShadowDirective } from '@g2-common/horizontal-overflow-shadow-directive';\r\nimport {\r\n  CbmDocumentReferenceModel,\r\n  CbmDocumentReferenceRepository,\r\n} from '@g2-common/document-reference-repository';\r\nimport { CbmEmptyComponent } from '@g2-common/empty';\r\n\r\ntype TTransactionType =\r\n  | 'goods_receipts'\r\n  | 'goods_issue'\r\n  | 'income'\r\n  | 'invoice'\r\n  | 'document_liquidation';\r\n\r\ninterface IPagination {\r\n  page: number;\r\n  size: number;\r\n  totalPages: number | null;\r\n  totalRecords: number;\r\n}\r\n\r\ninterface IAddedDocument {\r\n  _id: string;\r\n  transaction_type: TTransactionType;\r\n  document_number: string;\r\n  document_nomenclature: string;\r\n  created_at: number;\r\n}\r\n\r\nconst initialPagination: IPagination = {\r\n  page: 1,\r\n  size: 20,\r\n  totalPages: null,\r\n  totalRecords: 0,\r\n};\r\n\r\n@Component({\r\n  selector: 'lib-add',\r\n  standalone: true,\r\n  imports: [\r\n    NgSelectModule,\r\n    ReactiveFormsModule,\r\n    CbmErrorTranslatePipe,\r\n    CbmTextInputDirective,\r\n    DatePipe,\r\n    NgClass,\r\n    CbmTooltipDirective,\r\n    CbmEmptyComponent,\r\n    CbmPaginationNavComponent,\r\n    CbmHorizontalOverflowShadowDirective,\r\n  ],\r\n  templateUrl: './add.component.html',\r\n  styleUrl: './add.component.css',\r\n  changeDetection: ChangeDetectionStrategy.OnPush,\r\n  animations: [fadeInOutAnimation],\r\n})\r\nexport class AddComponent implements OnInit {\r\n  // #region inputs\r\n  collectionId = input.required<string>();\r\n  collectionName = input.required<string>();\r\n  documentOriginName = input.required<string>();\r\n  documentOriginNumber = input.required<string>();\r\n  documentOriginDate = input.required<number>();\r\n\r\n  // #region outputs\r\n  goBack = output<void>();\r\n\r\n  // #region state\r\n  isSmallScreen = signal<boolean>(false);\r\n  isFormForFilterVisible = signal<boolean>(false);\r\n  statusOfFetchInternalDocuments = signal<TStatus>('init');\r\n  goodsReceipts = signal<CbmGoodsReceiptModel.ListResponse.Item[]>([]);\r\n  goodsReceiptsPagination = signal<IPagination>(initialPagination);\r\n  goodsIssues = signal<CbmGoodsIssueModel.ListResponse.Item[]>([]);\r\n  goodsIssuesPagination = signal<IPagination>(initialPagination);\r\n  incomes = signal<CbmIncomeModel.ListResponse.Item[]>([]);\r\n  incomesPagination = signal<IPagination>(initialPagination);\r\n  invoices = signal<CbmInvoiceModel.ListResponse.Item[]>([]);\r\n  invoicesPagination = signal<IPagination>(initialPagination);\r\n  documentLiquidationsPagination = signal<IPagination>(initialPagination);\r\n  addedDocuments = signal<IAddedDocument[]>([]);\r\n  statusOfSaveDocuments = signal<TStatus>('init');\r\n  externalDocumentsArrayErrors = signal<ValidationErrors | null>(null);\r\n  externalDocumentErrorLocation = signal<string | null>(null);\r\n  externalDocumentErrorRowIndex = signal<number | null>(null);\r\n  statusOfFetchExistingDocuments = signal<TStatus>('init');\r\n  existingDocuments = signal<CbmDocumentReferenceModel.ListResponse.Data[]>([]);\r\n\r\n  documentLiquidations = signal<\r\n    CbmDocumentLiquidationModel.ListResponse.Item[]\r\n  >([]);\r\n\r\n  computedGoodsReceipts = computed(() =>\r\n    this.goodsReceipts().filter(\r\n      (goodsReceipt) =>\r\n        !this.addedDocuments().some(\r\n          (addedDocument) =>\r\n            addedDocument._id === goodsReceipt._id &&\r\n            addedDocument.transaction_type === 'goods_receipts',\r\n        ) &&\r\n        !this.existingDocuments().some(\r\n          (existingDocument) =>\r\n            existingDocument.collection_destination_id === goodsReceipt._id &&\r\n            existingDocument.collection_destination_name === 'goods_receipts',\r\n        ),\r\n    ),\r\n  );\r\n\r\n  computedGoodsIssues = computed(() =>\r\n    this.goodsIssues().filter(\r\n      (goodsIssue) =>\r\n        !this.addedDocuments().some(\r\n          (addedDocument) =>\r\n            addedDocument._id === goodsIssue._id &&\r\n            addedDocument.transaction_type === 'goods_issue',\r\n        ) &&\r\n        !this.existingDocuments().some(\r\n          (existingDocument) =>\r\n            existingDocument.collection_destination_id === goodsIssue._id &&\r\n            existingDocument.collection_destination_name === 'goods_issue',\r\n        ),\r\n    ),\r\n  );\r\n\r\n  computedIncomes = computed(() =>\r\n    this.incomes().filter(\r\n      (income) =>\r\n        !this.addedDocuments().some(\r\n          (addedDocument) =>\r\n            addedDocument._id === income._id &&\r\n            addedDocument.transaction_type === 'income',\r\n        ) &&\r\n        !this.existingDocuments().some(\r\n          (existingDocument) =>\r\n            existingDocument.collection_destination_id === income._id &&\r\n            existingDocument.collection_destination_name === 'income',\r\n        ),\r\n    ),\r\n  );\r\n\r\n  computedInvoices = computed(() =>\r\n    this.invoices().filter(\r\n      (invoice) =>\r\n        !this.addedDocuments().some(\r\n          (addedDocument) =>\r\n            addedDocument._id === invoice._id &&\r\n            addedDocument.transaction_type === 'invoice',\r\n        ) &&\r\n        !this.existingDocuments().some(\r\n          (existingDocument) =>\r\n            existingDocument.collection_destination_id === invoice._id &&\r\n            existingDocument.collection_destination_name === 'invoice',\r\n        ),\r\n    ),\r\n  );\r\n\r\n  computedDocumentLiquidations = computed(() =>\r\n    this.documentLiquidations().filter(\r\n      (documentLiquidation) =>\r\n        !this.addedDocuments().some(\r\n          (addedDocument) =>\r\n            addedDocument._id === documentLiquidation._id &&\r\n            addedDocument.transaction_type === 'document_liquidation',\r\n        ) &&\r\n        !this.existingDocuments().some(\r\n          (existingDocument) =>\r\n            existingDocument.collection_destination_id ===\r\n              documentLiquidation._id &&\r\n            existingDocument.collection_destination_name ===\r\n              'document_liquidation',\r\n        ),\r\n    ),\r\n  );\r\n\r\n  // #region variables\r\n  now = new Date();\r\n\r\n  // #region forms\r\n  formToSave = new FormGroup({\r\n    type: new FormControl<'internal' | 'external' | null>(\r\n      null,\r\n      Validators.required,\r\n    ),\r\n    transactionType: new FormControl<TTransactionType | null>(null),\r\n    externalDocuments: new FormArray<\r\n      FormGroup<{\r\n        date: FormControl<string | null>;\r\n        documentNumber: FormControl<string | null>;\r\n        documentName: FormControl<string | null>;\r\n      }>\r\n    >([]),\r\n  });\r\n\r\n  formForFilter = new FormGroup({\r\n    startDate: new FormControl<string | null>(\r\n      formatDate(new Date().setDate(1), 'yyyy-MM-dd', 'en'),\r\n    ),\r\n    endDate: new FormControl<string | null>(\r\n      formatDate(new Date(), 'yyyy-MM-dd', 'en'),\r\n    ),\r\n    documentNumber: new FormControl<string | null>(null),\r\n  });\r\n\r\n  // #region constructor\r\n  constructor(\r\n    private goodsReceiptRepository: CbmGoodsReceiptRepository,\r\n    private goodsIssueRepository: CbmGoodsIssueRepository,\r\n    private incomeRepository: CbmIncomeRepository,\r\n    private invoiceRepository: CbmInvoiceRepository,\r\n    private documentLiquidationRepository: CbmDocumentLiquidationRepository,\r\n    private documentReferenceRepository: CbmDocumentReferenceRepository,\r\n    private notificationService: CbmNotificationService,\r\n    private destroyRef: DestroyRef,\r\n  ) {}\r\n\r\n  // #region hooks\r\n  ngOnInit(): void {\r\n    if (window.matchMedia('(min-width: 750px)').matches) {\r\n      this.isSmallScreen.set(false);\r\n    } else {\r\n      this.isSmallScreen.set(true);\r\n    }\r\n\r\n    window\r\n      .matchMedia('(min-width: 750px)')\r\n      .addEventListener('change', (event) => {\r\n        this.isSmallScreen.set(!event.matches);\r\n      });\r\n\r\n    this.typeControl.valueChanges\r\n      .pipe(takeUntilDestroyed(this.destroyRef))\r\n      .subscribe((value) => {\r\n        this.externalDocumentsArray.clearValidators();\r\n        this.transactionTypeControl.clearValidators();\r\n        this.transactionTypeControl.setValue(null);\r\n        this.addedDocuments.set([]);\r\n        this.externalDocumentsArray.clear();\r\n\r\n        if (value === 'internal') {\r\n          this.transactionTypeControl.setValidators(Validators.required);\r\n        } else if (value === 'external') {\r\n          this.externalDocumentsArray.setValidators(Validators.required);\r\n        }\r\n\r\n        this.transactionTypeControl.updateValueAndValidity();\r\n        this.externalDocumentsArray.updateValueAndValidity();\r\n      });\r\n\r\n    this.transactionTypeControl.valueChanges\r\n      .pipe(takeUntilDestroyed(this.destroyRef))\r\n      .subscribe((value) => {\r\n        if (value) this.searchInternalDocuments();\r\n      });\r\n\r\n    this.externalDocumentsArray.valueChanges\r\n      .pipe(takeUntilDestroyed(this.destroyRef))\r\n      .subscribe(() => {\r\n        this.checkForExternalDocumentsErrors();\r\n      });\r\n\r\n    this.fetchExistingDocuments();\r\n  }\r\n\r\n  // #region controls\r\n  get typeControl() {\r\n    return this.formToSave.controls.type;\r\n  }\r\n\r\n  get transactionTypeControl() {\r\n    return this.formToSave.controls.transactionType;\r\n  }\r\n\r\n  get startDateControl() {\r\n    return this.formForFilter.controls.startDate;\r\n  }\r\n\r\n  get endDateControl() {\r\n    return this.formForFilter.controls.endDate;\r\n  }\r\n\r\n  get documentNumberControl() {\r\n    return this.formForFilter.controls.documentNumber;\r\n  }\r\n\r\n  get externalDocumentsArray() {\r\n    return this.formToSave.controls.externalDocuments;\r\n  }\r\n\r\n  groupDateControl(index: number) {\r\n    return this.externalDocumentsArray.at(index).controls.date;\r\n  }\r\n\r\n  groupDocumentNumberControl(index: number) {\r\n    return this.externalDocumentsArray.at(index).controls.documentNumber;\r\n  }\r\n\r\n  groupDocumentNameControl(index: number) {\r\n    return this.externalDocumentsArray.at(index).controls.documentName;\r\n  }\r\n\r\n  // #region methods\r\n  fetchExistingDocuments(): void {\r\n    this.statusOfFetchExistingDocuments.set('loading');\r\n\r\n    const params: CbmDocumentReferenceModel.ListParams = {\r\n      collection_origin_id: this.collectionId(),\r\n      collection_origin_name: this.collectionName(),\r\n    };\r\n\r\n    this.documentReferenceRepository\r\n      .list(params)\r\n      .pipe(takeUntilDestroyed(this.destroyRef))\r\n      .subscribe({\r\n        next: (response) => {\r\n          this.existingDocuments.set(response.data);\r\n          this.statusOfFetchExistingDocuments.set('success');\r\n        },\r\n        error: (error) => {\r\n          this.statusOfFetchExistingDocuments.set('failed');\r\n\r\n          this.notificationService.sendAlert({\r\n            type: 'toast',\r\n            status: 'error',\r\n            message: JSON.stringify(error.error?.message),\r\n          });\r\n        },\r\n      });\r\n  }\r\n\r\n  saveDocuments(): void {\r\n    if (this.formToSave.invalid) {\r\n      this.formToSave.markAllAsTouched();\r\n\r\n      this.notificationService.sendAlert({\r\n        type: 'toast',\r\n        status: 'error',\r\n        message: 'El formulario contiene datos inválidos o incompletos',\r\n      });\r\n\r\n      return;\r\n    }\r\n\r\n    const { type, externalDocuments } = this.formToSave.getRawValue();\r\n\r\n    switch (type) {\r\n      case 'internal': {\r\n        if (this.addedDocuments().length === 0) {\r\n          this.formToSave.markAllAsTouched();\r\n\r\n          this.notificationService.sendAlert({\r\n            type: 'toast',\r\n            status: 'error',\r\n            message: 'Debe agregar al menos un documento',\r\n          });\r\n\r\n          return;\r\n        }\r\n\r\n        this.statusOfSaveDocuments.set('loading');\r\n\r\n        this.documentReferenceRepository\r\n          .saveMany({\r\n            data: this.addedDocuments().map((document) => ({\r\n              type_record: 'manual',\r\n              collection_destination_id: document._id,\r\n              collection_destination_name: document.transaction_type,\r\n              document_destination_name: `${document.document_nomenclature}-${document.document_number}`,\r\n              document_destination_number: document.document_number,\r\n              document_destination_date: document.created_at,\r\n              collection_origin_id: this.collectionId(),\r\n              collection_origin_name: this.collectionName(),\r\n              document_origin_name: this.documentOriginName(),\r\n              document_origin_number: this.documentOriginNumber(),\r\n              document_origin_date: this.documentOriginDate(),\r\n              type: type,\r\n            })),\r\n          })\r\n          .pipe(takeUntilDestroyed(this.destroyRef))\r\n          .subscribe({\r\n            next: (response) => {\r\n              this.statusOfSaveDocuments.set('success');\r\n\r\n              this.notificationService.sendAlert({\r\n                type: 'sweetAlert',\r\n                status: 'success',\r\n                message: response.message,\r\n              });\r\n\r\n              this.goBack.emit();\r\n            },\r\n            error: (error) => {\r\n              this.statusOfSaveDocuments.set('failed');\r\n\r\n              this.notificationService.sendAlert({\r\n                type: 'sweetAlert',\r\n                status: 'error',\r\n                message: JSON.stringify(error.error?.message),\r\n              });\r\n            },\r\n          });\r\n\r\n        break;\r\n      }\r\n      case 'external': {\r\n        this.statusOfSaveDocuments.set('loading');\r\n\r\n        this.documentReferenceRepository\r\n          .saveMany({\r\n            data: externalDocuments.map((document) => {\r\n              const [year, month, day] = document.date!.split('-').map(Number);\r\n              const timestamp = new Date(year, month - 1, day).getTime();\r\n\r\n              return {\r\n                type_record: 'manual',\r\n                document_destination_name: document.documentName!,\r\n                document_destination_number: document.documentNumber!,\r\n                document_destination_date: timestamp,\r\n                collection_origin_id: this.collectionId(),\r\n                collection_origin_name: this.collectionName(),\r\n                document_origin_name: this.documentOriginName(),\r\n                document_origin_number: this.documentOriginNumber(),\r\n                document_origin_date: this.documentOriginDate(),\r\n                type: type,\r\n              };\r\n            }),\r\n          })\r\n          .pipe(takeUntilDestroyed(this.destroyRef))\r\n          .subscribe({\r\n            next: (response) => {\r\n              this.statusOfSaveDocuments.set('success');\r\n\r\n              this.notificationService.sendAlert({\r\n                type: 'sweetAlert',\r\n                status: 'success',\r\n                message: response.message,\r\n              });\r\n\r\n              this.goBack.emit();\r\n            },\r\n            error: (error) => {\r\n              this.statusOfSaveDocuments.set('failed');\r\n\r\n              this.notificationService.sendAlert({\r\n                type: 'sweetAlert',\r\n                status: 'error',\r\n                message: JSON.stringify(error.error?.message),\r\n              });\r\n            },\r\n          });\r\n\r\n        break;\r\n      }\r\n    }\r\n  }\r\n\r\n  searchInternalDocuments(): void {\r\n    const transactionType = this.transactionTypeControl.value;\r\n\r\n    if (!transactionType) return;\r\n\r\n    switch (transactionType) {\r\n      case 'goods_receipts':\r\n        this.searchGoodsReceipts();\r\n        break;\r\n      case 'goods_issue':\r\n        this.searchGoodsIssues();\r\n        break;\r\n      case 'income':\r\n        this.searchIncomes();\r\n        break;\r\n      case 'invoice':\r\n        this.searchInvoices();\r\n        break;\r\n      case 'document_liquidation':\r\n        this.searchDocumentLiquidations();\r\n        break;\r\n    }\r\n  }\r\n\r\n  searchGoodsReceipts(): void {\r\n    this.goodsReceiptsPagination.set(initialPagination);\r\n    this.fetchGoodsReceipts();\r\n  }\r\n\r\n  searchGoodsIssues(): void {\r\n    this.goodsIssuesPagination.set(initialPagination);\r\n    this.fetchGoodsIssues();\r\n  }\r\n\r\n  searchIncomes(): void {\r\n    this.incomesPagination.set(initialPagination);\r\n    this.fetchIncomes();\r\n  }\r\n\r\n  searchInvoices(): void {\r\n    this.invoicesPagination.set(initialPagination);\r\n    this.fetchInvoices();\r\n  }\r\n\r\n  searchDocumentLiquidations(): void {\r\n    this.documentLiquidationsPagination.set(initialPagination);\r\n    this.fetchDocumentLiquidations();\r\n  }\r\n\r\n  fetchGoodsReceipts(): void {\r\n    this.statusOfFetchInternalDocuments.set('loading');\r\n\r\n    const params: CbmGoodsReceiptModel.ListParams = {\r\n      page: this.goodsReceiptsPagination().page,\r\n      size: this.goodsReceiptsPagination().size,\r\n      reverse_status: false,\r\n    };\r\n\r\n    const { documentNumber, endDate, startDate } =\r\n      this.formForFilter.getRawValue();\r\n\r\n    if (documentNumber) params.document_number = documentNumber;\r\n\r\n    if (startDate) {\r\n      const [year, month, day] = startDate.split('-').map(Number);\r\n      params.from_account_date = new Date(year, month - 1, day).getTime();\r\n    }\r\n\r\n    if (endDate) {\r\n      const [year, month, day] = endDate.split('-').map(Number);\r\n      params.to_account_date = new Date(year, month - 1, day).getTime();\r\n    }\r\n\r\n    this.goodsReceiptRepository\r\n      .list(params)\r\n      .pipe(takeUntilDestroyed(this.destroyRef))\r\n      .subscribe({\r\n        next: (response) => {\r\n          this.goodsReceipts.set(response.items);\r\n\r\n          this.goodsReceiptsPagination.update((prev) => ({\r\n            ...prev,\r\n            totalPages: response.pages,\r\n            totalRecords: response.total,\r\n          }));\r\n\r\n          this.statusOfFetchInternalDocuments.set('success');\r\n        },\r\n        error: (error) => {\r\n          this.statusOfFetchInternalDocuments.set('failed');\r\n\r\n          this.notificationService.sendAlert({\r\n            type: 'toast',\r\n            status: 'error',\r\n            message: JSON.stringify(error.error?.message),\r\n          });\r\n        },\r\n      });\r\n  }\r\n\r\n  fetchGoodsIssues(): void {\r\n    this.statusOfFetchInternalDocuments.set('loading');\r\n\r\n    const params: CbmGoodsIssueModel.ListParams = {\r\n      page: this.goodsIssuesPagination().page,\r\n      size: this.goodsIssuesPagination().size,\r\n      reverse_status: false,\r\n    };\r\n\r\n    const { documentNumber, endDate, startDate } =\r\n      this.formForFilter.getRawValue();\r\n\r\n    if (documentNumber) params.document_number = documentNumber;\r\n\r\n    if (startDate) {\r\n      const [year, month, day] = startDate.split('-').map(Number);\r\n      params.from_account_date = new Date(year, month - 1, day).getTime();\r\n    }\r\n\r\n    if (endDate) {\r\n      const [year, month, day] = endDate.split('-').map(Number);\r\n      params.to_account_date = new Date(year, month - 1, day).getTime();\r\n    }\r\n\r\n    this.goodsIssueRepository\r\n      .list(params)\r\n      .pipe(takeUntilDestroyed(this.destroyRef))\r\n      .subscribe({\r\n        next: (response) => {\r\n          this.goodsIssues.set(response.items);\r\n\r\n          this.goodsIssuesPagination.update((prev) => ({\r\n            ...prev,\r\n            totalPages: response.pages,\r\n            totalRecords: response.total,\r\n          }));\r\n\r\n          this.statusOfFetchInternalDocuments.set('success');\r\n        },\r\n        error: (error) => {\r\n          this.statusOfFetchInternalDocuments.set('failed');\r\n\r\n          this.notificationService.sendAlert({\r\n            type: 'toast',\r\n            status: 'error',\r\n            message: JSON.stringify(error.error?.message),\r\n          });\r\n        },\r\n      });\r\n  }\r\n\r\n  fetchIncomes(): void {\r\n    this.statusOfFetchInternalDocuments.set('loading');\r\n\r\n    const params: CbmIncomeModel.ListParams = {\r\n      page: this.incomesPagination().page,\r\n      size: this.incomesPagination().size,\r\n      reverse_status: false,\r\n    };\r\n\r\n    const { documentNumber, endDate, startDate } =\r\n      this.formForFilter.getRawValue();\r\n\r\n    if (documentNumber) params.document_number = documentNumber;\r\n\r\n    if (startDate) {\r\n      const [year, month, day] = startDate.split('-').map(Number);\r\n      params.date_begin = new Date(year, month - 1, day).getTime();\r\n    }\r\n\r\n    if (endDate) {\r\n      const [year, month, day] = endDate.split('-').map(Number);\r\n      params.date_end = new Date(year, month - 1, day).getTime();\r\n    }\r\n\r\n    this.incomeRepository\r\n      .list(params)\r\n      .pipe(takeUntilDestroyed(this.destroyRef))\r\n      .subscribe({\r\n        next: (response) => {\r\n          this.incomes.set(response.items);\r\n\r\n          this.incomesPagination.update((prev) => ({\r\n            ...prev,\r\n            totalPages: response.pages,\r\n            totalRecords: response.total,\r\n          }));\r\n\r\n          this.statusOfFetchInternalDocuments.set('success');\r\n        },\r\n        error: (error) => {\r\n          this.statusOfFetchInternalDocuments.set('failed');\r\n\r\n          this.notificationService.sendAlert({\r\n            type: 'toast',\r\n            status: 'error',\r\n            message: JSON.stringify(error.error?.message),\r\n          });\r\n        },\r\n      });\r\n  }\r\n\r\n  fetchInvoices(): void {\r\n    this.statusOfFetchInternalDocuments.set('loading');\r\n\r\n    const params: CbmInvoiceModel.ListParams = {\r\n      page: this.invoicesPagination().page,\r\n      size: this.invoicesPagination().size,\r\n    };\r\n\r\n    const { documentNumber, endDate, startDate } =\r\n      this.formForFilter.getRawValue();\r\n\r\n    if (documentNumber) params.sequential = documentNumber;\r\n\r\n    if (startDate) {\r\n      const [year, month, day] = startDate.split('-').map(Number);\r\n      params.from_date = new Date(year, month - 1, day).getTime();\r\n    }\r\n\r\n    if (endDate) {\r\n      const [year, month, day] = endDate.split('-').map(Number);\r\n      params.to_date = new Date(year, month - 1, day).getTime();\r\n    }\r\n\r\n    this.invoiceRepository\r\n      .list(params)\r\n      .pipe(takeUntilDestroyed(this.destroyRef))\r\n      .subscribe({\r\n        next: (response) => {\r\n          this.invoices.set(response.items);\r\n\r\n          this.invoicesPagination.update((prev) => ({\r\n            ...prev,\r\n            totalPages: response.pages,\r\n            totalRecords: response.total,\r\n          }));\r\n\r\n          this.statusOfFetchInternalDocuments.set('success');\r\n        },\r\n        error: (error) => {\r\n          this.statusOfFetchInternalDocuments.set('failed');\r\n\r\n          this.notificationService.sendAlert({\r\n            type: 'toast',\r\n            status: 'error',\r\n            message: JSON.stringify(error.error?.message),\r\n          });\r\n        },\r\n      });\r\n  }\r\n\r\n  fetchDocumentLiquidations(): void {\r\n    this.statusOfFetchInternalDocuments.set('loading');\r\n\r\n    const params: CbmDocumentLiquidationModel.ListParams = {\r\n      page: this.documentLiquidationsPagination().page,\r\n      size: this.documentLiquidationsPagination().size,\r\n      reverse_status: false,\r\n    };\r\n\r\n    const { documentNumber, endDate, startDate } =\r\n      this.formForFilter.getRawValue();\r\n\r\n    if (documentNumber) params.document_number = documentNumber;\r\n\r\n    if (startDate) {\r\n      const [year, month, day] = startDate.split('-').map(Number);\r\n      params.date_begin = new Date(year, month - 1, day).getTime();\r\n    }\r\n\r\n    if (endDate) {\r\n      const [year, month, day] = endDate.split('-').map(Number);\r\n      params.date_end = new Date(year, month - 1, day).getTime();\r\n    }\r\n\r\n    this.documentLiquidationRepository\r\n      .list(params)\r\n      .pipe(takeUntilDestroyed(this.destroyRef))\r\n      .subscribe({\r\n        next: (response) => {\r\n          this.documentLiquidations.set(response.items);\r\n\r\n          this.documentLiquidationsPagination.update((prev) => ({\r\n            ...prev,\r\n            totalPages: response.pages,\r\n            totalRecords: response.total,\r\n          }));\r\n\r\n          this.statusOfFetchInternalDocuments.set('success');\r\n        },\r\n        error: (error) => {\r\n          this.statusOfFetchInternalDocuments.set('failed');\r\n\r\n          this.notificationService.sendAlert({\r\n            type: 'toast',\r\n            status: 'error',\r\n            message: JSON.stringify(error.error?.message),\r\n          });\r\n        },\r\n      });\r\n  }\r\n\r\n  onGoToPage(page: number): void {\r\n    const transactionType = this.transactionTypeControl.value;\r\n\r\n    if (!transactionType) return;\r\n\r\n    switch (transactionType) {\r\n      case 'goods_receipts': {\r\n        if (this.goodsReceiptsPagination().page !== page) {\r\n          this.goodsReceiptsPagination.update((prev) => ({ ...prev, page }));\r\n          this.fetchGoodsReceipts();\r\n        }\r\n\r\n        break;\r\n      }\r\n      case 'goods_issue': {\r\n        if (this.goodsIssuesPagination().page !== page) {\r\n          this.goodsIssuesPagination.update((prev) => ({ ...prev, page }));\r\n          this.fetchGoodsIssues();\r\n        }\r\n\r\n        break;\r\n      }\r\n      case 'income': {\r\n        if (this.incomesPagination().page !== page) {\r\n          this.incomesPagination.update((prev) => ({ ...prev, page }));\r\n          this.fetchIncomes();\r\n        }\r\n\r\n        break;\r\n      }\r\n      case 'invoice': {\r\n        if (this.invoicesPagination().page !== page) {\r\n          this.invoicesPagination.update((prev) => ({ ...prev, page }));\r\n          this.fetchInvoices();\r\n        }\r\n\r\n        break;\r\n      }\r\n      case 'document_liquidation': {\r\n        if (this.documentLiquidationsPagination().page !== page) {\r\n          this.documentLiquidationsPagination.update((prev) => ({\r\n            ...prev,\r\n            page,\r\n          }));\r\n\r\n          this.fetchDocumentLiquidations();\r\n        }\r\n\r\n        break;\r\n      }\r\n    }\r\n  }\r\n\r\n  onNextPage(page: number): void {\r\n    const transactionType = this.transactionTypeControl.value;\r\n\r\n    if (!transactionType) return;\r\n\r\n    switch (transactionType) {\r\n      case 'goods_receipts': {\r\n        this.goodsReceiptsPagination.update((prev) => ({\r\n          ...prev,\r\n          page: page + 1,\r\n        }));\r\n\r\n        this.fetchGoodsReceipts();\r\n\r\n        break;\r\n      }\r\n      case 'goods_issue': {\r\n        this.goodsIssuesPagination.update((prev) => ({\r\n          ...prev,\r\n          page: page + 1,\r\n        }));\r\n\r\n        this.fetchGoodsIssues();\r\n\r\n        break;\r\n      }\r\n      case 'income': {\r\n        this.incomesPagination.update((prev) => ({\r\n          ...prev,\r\n          page: page + 1,\r\n        }));\r\n\r\n        this.fetchIncomes();\r\n\r\n        break;\r\n      }\r\n      case 'invoice': {\r\n        this.invoicesPagination.update((prev) => ({\r\n          ...prev,\r\n          page: page + 1,\r\n        }));\r\n\r\n        this.fetchInvoices();\r\n\r\n        break;\r\n      }\r\n      case 'document_liquidation': {\r\n        this.documentLiquidationsPagination.update((prev) => ({\r\n          ...prev,\r\n          page: page + 1,\r\n        }));\r\n\r\n        this.fetchDocumentLiquidations();\r\n\r\n        break;\r\n      }\r\n    }\r\n  }\r\n\r\n  onPreviousPage(page: number): void {\r\n    const transactionType = this.transactionTypeControl.value;\r\n\r\n    if (!transactionType) return;\r\n\r\n    switch (transactionType) {\r\n      case 'goods_receipts': {\r\n        this.goodsReceiptsPagination.update((prev) => ({\r\n          ...prev,\r\n          page: page - 1,\r\n        }));\r\n\r\n        this.fetchGoodsReceipts();\r\n\r\n        break;\r\n      }\r\n      case 'goods_issue': {\r\n        this.goodsIssuesPagination.update((prev) => ({\r\n          ...prev,\r\n          page: page - 1,\r\n        }));\r\n\r\n        this.fetchGoodsIssues();\r\n\r\n        break;\r\n      }\r\n      case 'income': {\r\n        this.incomesPagination.update((prev) => ({\r\n          ...prev,\r\n          page: page - 1,\r\n        }));\r\n\r\n        this.fetchIncomes();\r\n\r\n        break;\r\n      }\r\n      case 'invoice': {\r\n        this.invoicesPagination.update((prev) => ({\r\n          ...prev,\r\n          page: page - 1,\r\n        }));\r\n\r\n        this.fetchInvoices();\r\n\r\n        break;\r\n      }\r\n      case 'document_liquidation': {\r\n        this.documentLiquidationsPagination.update((prev) => ({\r\n          ...prev,\r\n          page: page - 1,\r\n        }));\r\n\r\n        this.fetchDocumentLiquidations();\r\n\r\n        break;\r\n      }\r\n    }\r\n  }\r\n\r\n  onPageSizeChange(size: number): void {\r\n    const transactionType = this.transactionTypeControl.value;\r\n\r\n    if (!transactionType) return;\r\n\r\n    switch (transactionType) {\r\n      case 'goods_receipts': {\r\n        this.goodsReceiptsPagination.update((prev) => ({\r\n          ...prev,\r\n          page: 1,\r\n          size,\r\n        }));\r\n\r\n        this.fetchGoodsReceipts();\r\n\r\n        break;\r\n      }\r\n      case 'goods_issue': {\r\n        this.goodsIssuesPagination.update((prev) => ({\r\n          ...prev,\r\n          page: 1,\r\n          size,\r\n        }));\r\n\r\n        this.fetchGoodsIssues();\r\n\r\n        break;\r\n      }\r\n      case 'income': {\r\n        this.incomesPagination.update((prev) => ({\r\n          ...prev,\r\n          page: 1,\r\n          size,\r\n        }));\r\n\r\n        this.fetchIncomes();\r\n\r\n        break;\r\n      }\r\n      case 'invoice': {\r\n        this.invoicesPagination.update((prev) => ({\r\n          ...prev,\r\n          page: 1,\r\n          size,\r\n        }));\r\n\r\n        this.fetchInvoices();\r\n\r\n        break;\r\n      }\r\n      case 'document_liquidation': {\r\n        this.documentLiquidationsPagination.update((prev) => ({\r\n          ...prev,\r\n          page: 1,\r\n          size,\r\n        }));\r\n\r\n        this.fetchDocumentLiquidations();\r\n\r\n        break;\r\n      }\r\n    }\r\n  }\r\n\r\n  areThereDocuments(): boolean {\r\n    const transactionType = this.transactionTypeControl.value;\r\n\r\n    if (!transactionType) return false;\r\n\r\n    switch (transactionType) {\r\n      case 'goods_receipts':\r\n        return this.goodsReceipts().length > 0;\r\n      case 'goods_issue':\r\n        return this.goodsIssues().length > 0;\r\n      case 'income':\r\n        return this.incomes().length > 0;\r\n      case 'invoice':\r\n        return this.invoices().length > 0;\r\n      case 'document_liquidation':\r\n        return this.documentLiquidations().length > 0;\r\n    }\r\n  }\r\n\r\n  removeAddedDocument(index: number): void {\r\n    this.addedDocuments.update((prev) => {\r\n      const copy = [...prev];\r\n      copy.splice(index, 1);\r\n      return copy;\r\n    });\r\n  }\r\n\r\n  addGoodsReceipt(goodsReceipt: CbmGoodsReceiptModel.ListResponse.Item): void {\r\n    this.addedDocuments.update((prev) => [\r\n      ...prev,\r\n      {\r\n        _id: goodsReceipt._id,\r\n        transaction_type: 'goods_receipts',\r\n        document_nomenclature: goodsReceipt.document_nomenclature,\r\n        document_number: goodsReceipt.document_number,\r\n        created_at: goodsReceipt.created_at,\r\n      },\r\n    ]);\r\n  }\r\n\r\n  addGoodsIssue(goodsIssue: CbmGoodsIssueModel.ListResponse.Item): void {\r\n    this.addedDocuments.update((prev) => [\r\n      ...prev,\r\n      {\r\n        _id: goodsIssue._id,\r\n        transaction_type: 'goods_issue',\r\n        document_nomenclature: goodsIssue.document_nomenclature,\r\n        document_number: goodsIssue.document_number,\r\n        created_at: goodsIssue.created_at,\r\n      },\r\n    ]);\r\n  }\r\n\r\n  addIncome(income: CbmIncomeModel.ListResponse.Item): void {\r\n    this.addedDocuments.update((prev) => [\r\n      ...prev,\r\n      {\r\n        _id: income._id,\r\n        transaction_type: 'income',\r\n        document_nomenclature: income.document_nomenclature,\r\n        document_number: income.document_number,\r\n        created_at: income.created_at,\r\n      },\r\n    ]);\r\n  }\r\n\r\n  addInvoice(invoice: CbmInvoiceModel.ListResponse.Item): void {\r\n    this.addedDocuments.update((prev) => [\r\n      ...prev,\r\n      {\r\n        _id: invoice._id,\r\n        transaction_type: 'invoice',\r\n        document_nomenclature: invoice.document_nomenclature,\r\n        document_number: invoice.document_number,\r\n        created_at: invoice.created_at,\r\n      },\r\n    ]);\r\n  }\r\n\r\n  addDocumentLiquidation(\r\n    documentLiquidation: CbmDocumentLiquidationModel.ListResponse.Item,\r\n  ): void {\r\n    this.addedDocuments.update((prev) => [\r\n      ...prev,\r\n      {\r\n        _id: documentLiquidation._id,\r\n        transaction_type: 'document_liquidation',\r\n        document_nomenclature: documentLiquidation.document_nomenclature,\r\n        document_number: documentLiquidation.document_number,\r\n        created_at: documentLiquidation.created_at!,\r\n      },\r\n    ]);\r\n  }\r\n\r\n  addExternalDocumentGroup(): void {\r\n    const newGroup = new FormGroup({\r\n      date: new FormControl<string | null>(\r\n        formatDate(new Date(), 'yyyy-MM-dd', 'en'),\r\n        Validators.required,\r\n      ),\r\n      documentNumber: new FormControl<string | null>(null, [\r\n        Validators.required,\r\n        Validators.pattern(/^\\d+$/),\r\n      ]),\r\n      documentName: new FormControl<string | null>(null, Validators.required),\r\n    });\r\n\r\n    this.externalDocumentsArray.push(newGroup);\r\n  }\r\n\r\n  removeExternalDocumentGroup(index: number): void {\r\n    this.externalDocumentsArray.removeAt(index);\r\n  }\r\n\r\n  checkForExternalDocumentsErrors(): void {\r\n    for (const row in this.externalDocumentsArray.controls) {\r\n      const group = this.externalDocumentsArray.controls[row];\r\n\r\n      for (const key in group.controls) {\r\n        type K = keyof typeof group.controls;\r\n        const errors = group.controls[key as K].errors;\r\n\r\n        if (errors) {\r\n          const errorKeyMap: { [P in K]: string } = {\r\n            date: 'Fecha',\r\n            documentNumber: 'Número de documento',\r\n            documentName: 'Nombre de documento',\r\n          };\r\n\r\n          this.externalDocumentsArrayErrors.set(errors);\r\n\r\n          this.externalDocumentErrorLocation.set(\r\n            `(Ubicación: Fila ${Number(row) + 1}, ${errorKeyMap[key as K]})`,\r\n          );\r\n\r\n          this.externalDocumentErrorRowIndex.set(Number(row));\r\n\r\n          return;\r\n        }\r\n      }\r\n    }\r\n\r\n    this.externalDocumentsArrayErrors.set(null);\r\n    this.externalDocumentErrorLocation.set(null);\r\n    this.externalDocumentErrorRowIndex.set(null);\r\n  }\r\n}\r\n","<div class=\"flex justify-end\">\r\n  <button\r\n    class=\"outline-none bg-secondary text-white hover:bg-[#5c636a] flex justify-center items-center py-2 px-6 rounded-full font-medium gap-2 transition-colors flex-grow sm:flex-grow-0\"\r\n    (click)=\"goBack.emit()\"\r\n    type=\"button\"\r\n  >\r\n    <svg\r\n      xmlns=\"http://www.w3.org/2000/svg\"\r\n      width=\"20\"\r\n      height=\"20\"\r\n      viewBox=\"0 0 24 24\"\r\n      fill=\"none\"\r\n      stroke=\"currentColor\"\r\n      stroke-width=\"2\"\r\n      stroke-linecap=\"round\"\r\n      stroke-linejoin=\"round\"\r\n    >\r\n      <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n      <path d=\"M5 12l14 0\" />\r\n      <path d=\"M5 12l6 6\" />\r\n      <path d=\"M5 12l6 -6\" />\r\n    </svg>\r\n\r\n    <span>Regresar</span>\r\n  </button>\r\n</div>\r\n\r\n<form [formGroup]=\"formToSave\" (ngSubmit)=\"saveDocuments()\">\r\n  <div class=\"mt-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\r\n    <div class=\"flex flex-col items-start\">\r\n      <label class=\"text-base font-normal text-[#67757c]\" for=\"type-select\">\r\n        Tipo <span class=\"text-danger\">*</span>\r\n      </label>\r\n\r\n      <ng-select\r\n        labelForId=\"type-select\"\r\n        class=\"ng-select ng-select-sm mt-2 self-stretch\"\r\n        formControlName=\"type\"\r\n        placeholder=\"Seleccione un tipo\"\r\n        [class.is-invalid]=\"typeControl.invalid && typeControl.touched\"\r\n      >\r\n        <ng-option value=\"internal\">Interno</ng-option>\r\n        <ng-option value=\"external\">Externo</ng-option>\r\n      </ng-select>\r\n\r\n      @if (typeControl.invalid && typeControl.touched) {\r\n        <div class=\"invalid-feedback\" [@fadeInOutAnimation]>\r\n          {{ typeControl.errors | cbmErrorTranslate }}\r\n        </div>\r\n      }\r\n    </div>\r\n\r\n    @if (typeControl.value === \"internal\") {\r\n      <div class=\"flex flex-col items-start\" [@fadeInOutAnimation]>\r\n        <label\r\n          class=\"text-base font-normal text-[#67757c]\"\r\n          for=\"transaction-type-select\"\r\n        >\r\n          Tipo de transacción <span class=\"text-danger\">*</span>\r\n        </label>\r\n\r\n        <ng-select\r\n          labelForId=\"transaction-type-select\"\r\n          class=\"ng-select ng-select-sm mt-2 self-stretch\"\r\n          formControlName=\"transactionType\"\r\n          placeholder=\"Seleccione tipo de transacción\"\r\n          [class.is-invalid]=\"\r\n            transactionTypeControl.invalid && transactionTypeControl.touched\r\n          \"\r\n        >\r\n          <ng-option value=\"goods_receipts\">Entrada de mercancías</ng-option>\r\n          <ng-option value=\"goods_issue\">Salida de mercancías</ng-option>\r\n          <ng-option value=\"income\">Cobranza a clientes</ng-option>\r\n          <ng-option value=\"invoice\">Facturas</ng-option>\r\n          <ng-option value=\"document_liquidation\">\r\n            Liquidaciones de documentos\r\n          </ng-option>\r\n        </ng-select>\r\n\r\n        @if (transactionTypeControl.invalid && transactionTypeControl.touched) {\r\n          <div class=\"invalid-feedback\" [@fadeInOutAnimation]>\r\n            {{ transactionTypeControl.errors | cbmErrorTranslate }}\r\n          </div>\r\n        }\r\n      </div>\r\n    }\r\n  </div>\r\n\r\n  @if (typeControl.value === \"internal\" && transactionTypeControl.value) {\r\n    <div class=\"mt-4\">\r\n      <div class=\"flex justify-end\">\r\n        @if (isFormForFilterVisible()) {\r\n          <button\r\n            class=\"outline-none bg-secondary text-white hover:bg-[#5c636a] rounded-md px-2 py-1 text-xs transition-colors\"\r\n            (click)=\"isFormForFilterVisible.set(false)\"\r\n            type=\"button\"\r\n          >\r\n            Cerrar\r\n          </button>\r\n        } @else {\r\n          <button\r\n            class=\"outline-none bg-info text-white hover:bg-[#409ae9] rounded-md px-2 py-1 text-xs transition-colors\"\r\n            (click)=\"isFormForFilterVisible.set(true)\"\r\n            type=\"button\"\r\n          >\r\n            Filtrar\r\n          </button>\r\n        }\r\n      </div>\r\n    </div>\r\n\r\n    @if (isFormForFilterVisible()) {\r\n      <form\r\n        [formGroup]=\"formForFilter\"\r\n        (ngSubmit)=\"searchInternalDocuments()\"\r\n        class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 mt-3 gap-4\"\r\n        [@fadeInOutAnimation]\r\n      >\r\n        <div class=\"flex flex-col items-start\">\r\n          <label\r\n            class=\"text-base font-normal text-[#67757c]\"\r\n            for=\"start-date-input\"\r\n          >\r\n            Rango de fechas (Desde - Hasta)\r\n          </label>\r\n\r\n          <div class=\"flex gap-1 mt-2 self-stretch\">\r\n            <input\r\n              id=\"start-date-input\"\r\n              type=\"date\"\r\n              class=\"form-control form-control-sm flex-grow\"\r\n              formControlName=\"startDate\"\r\n            />\r\n\r\n            <span class=\"self-center\">-</span>\r\n\r\n            <input\r\n              type=\"date\"\r\n              class=\"form-control form-control-sm flex-grow\"\r\n              formControlName=\"endDate\"\r\n              [max]=\"now | date: 'yyyy-MM-dd'\"\r\n            />\r\n          </div>\r\n        </div>\r\n\r\n        <div class=\"flex flex-col items-start\">\r\n          <label\r\n            for=\"document-number-input\"\r\n            class=\"text-base font-normal text-[#67757c]\"\r\n          >\r\n            N° de documento\r\n          </label>\r\n\r\n          <input\r\n            id=\"document-number-input\"\r\n            class=\"form-control form-control-sm mt-2 self-stretch\"\r\n            formControlName=\"documentNumber\"\r\n            placeholder=\"000183\"\r\n            cbmTextInput\r\n            pattern=\"^\\d*$\"\r\n          />\r\n        </div>\r\n\r\n        <div class=\"md:col-span-2 lg:col-span-3 flex justify-end mt-2\">\r\n          <button\r\n            type=\"submit\"\r\n            class=\"outline-none py-2 px-6 text-white rounded-full flex justify-center items-center gap-2 font-medium bg-info hover:bg-[#409ae9] transition-colors flex-grow sm:flex-grow-0 disabled:pointer-events-none disabled:opacity-70\"\r\n            [disabled]=\"statusOfFetchInternalDocuments() === 'loading'\"\r\n          >\r\n            @if (statusOfFetchInternalDocuments() === \"loading\") {\r\n              <div role=\"status\">\r\n                <svg\r\n                  aria-hidden=\"true\"\r\n                  class=\"w-5 h-5 text-gray-400 animate-spin fill-white\"\r\n                  viewBox=\"0 0 100 101\"\r\n                  fill=\"none\"\r\n                  xmlns=\"http://www.w3.org/2000/svg\"\r\n                >\r\n                  <path\r\n                    d=\"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z\"\r\n                    fill=\"currentColor\"\r\n                  />\r\n                  <path\r\n                    d=\"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z\"\r\n                    fill=\"currentFill\"\r\n                  />\r\n                </svg>\r\n                <span class=\"sr-only\">Loading...</span>\r\n              </div>\r\n            } @else {\r\n              <svg\r\n                xmlns=\"http://www.w3.org/2000/svg\"\r\n                width=\"20\"\r\n                height=\"20\"\r\n                viewBox=\"0 0 24 24\"\r\n                fill=\"none\"\r\n                stroke=\"currentColor\"\r\n                stroke-width=\"2\"\r\n                stroke-linecap=\"round\"\r\n                stroke-linejoin=\"round\"\r\n              >\r\n                <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n                <path d=\"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0\" />\r\n                <path d=\"M21 21l-6 -6\" />\r\n              </svg>\r\n            }\r\n\r\n            Buscar\r\n          </button>\r\n        </div>\r\n      </form>\r\n    }\r\n\r\n    <div class=\"mt-4 grid grid-cols-1 md:grid-cols-2 gap-8\">\r\n      <div>\r\n        <h3 class=\"text-lg font-medium text-info\">\r\n          @switch (transactionTypeControl.value) {\r\n            @case (\"goods_receipts\") {\r\n              Entradas de mercancías\r\n            }\r\n            @case (\"goods_issue\") {\r\n              Salidas de mercancías\r\n            }\r\n            @case (\"income\") {\r\n              Cobranza a clientes\r\n            }\r\n            @case (\"invoice\") {\r\n              Facturas\r\n            }\r\n            @case (\"document_liquidation\") {\r\n              Liquidaciones de documentos\r\n            }\r\n          }\r\n        </h3>\r\n\r\n        <div\r\n          class=\"border-y border-[#dde3e7] grid grid-cols-[auto_1fr_auto] mt-3\"\r\n        >\r\n          <!-- 💀 -->\r\n          @if (statusOfFetchInternalDocuments() === \"loading\") {\r\n            @for (_ of [].constructor(6); track _) {\r\n              <div\r\n                class=\"bg-[#d2e7fa] p-3 text-xs font-semibold text-left align-top loading-skeleton\"\r\n                [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n              >\r\n                <p>-</p>\r\n              </div>\r\n              <div\r\n                class=\"flex-grow grid grid-cols-[auto_1fr] text-[#67757c] loading-skeleton\"\r\n                [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n              >\r\n                <div class=\"p-3 text-xs text-left align-top font-semibold\">\r\n                  <p>Secuencial</p>\r\n                </div>\r\n                <div class=\"p-3 text-xs text-left align-top\">\r\n                  <p>-</p>\r\n                </div>\r\n                <div\r\n                  class=\"p-3 text-xs text-left align-top font-semibold border-t border-[#dde3e7]\"\r\n                >\r\n                  <p>Fecha</p>\r\n                </div>\r\n                <div\r\n                  class=\"p-3 text-xs text-left align-top border-t border-[#dde3e7]\"\r\n                >\r\n                  <p>-</p>\r\n                </div>\r\n              </div>\r\n              <div\r\n                class=\"p-2 align-top bg-[#e7ebee] relative loading-skeleton\"\r\n                [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n              >\r\n                <button\r\n                  class=\"outline-none text-secondary hover:text-info\"\r\n                  type=\"button\"\r\n                >\r\n                  <svg\r\n                    xmlns=\"http://www.w3.org/2000/svg\"\r\n                    width=\"16\"\r\n                    height=\"16\"\r\n                    viewBox=\"0 0 24 24\"\r\n                    fill=\"none\"\r\n                    stroke=\"currentColor\"\r\n                    stroke-width=\"2\"\r\n                    stroke-linecap=\"round\"\r\n                    stroke-linejoin=\"round\"\r\n                  >\r\n                    <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n                    <path d=\"M12 5l0 14\" />\r\n                    <path d=\"M5 12l14 0\" />\r\n                  </svg>\r\n                </button>\r\n              </div>\r\n            }\r\n          }\r\n          <!-- 💀 -->\r\n\r\n          <!-- 👨 -->\r\n          @if (statusOfFetchInternalDocuments() === \"success\") {\r\n            @switch (transactionTypeControl.value) {\r\n              @case (\"goods_receipts\") {\r\n                @if (computedGoodsReceipts().length) {\r\n                  @for (\r\n                    goodsReceipt of computedGoodsReceipts();\r\n                    track goodsReceipt._id\r\n                  ) {\r\n                    <div\r\n                      class=\"bg-[#d2e7fa] p-3 text-xs font-semibold text-left align-top\"\r\n                      [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n                    >\r\n                      {{ $index + 1 }}\r\n                    </div>\r\n                    <div\r\n                      class=\"flex-grow grid grid-cols-[auto_1fr] text-[#67757c]\"\r\n                      [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n                    >\r\n                      <div\r\n                        class=\"p-3 text-xs text-left align-top font-semibold\"\r\n                      >\r\n                        Secuencial\r\n                      </div>\r\n                      <div class=\"p-3 text-xs text-left align-top\">\r\n                        {{ goodsReceipt.document_nomenclature }}-{{\r\n                          goodsReceipt.document_number\r\n                        }}\r\n                      </div>\r\n                      <div\r\n                        class=\"p-3 text-xs text-left align-top font-semibold border-t border-[#dde3e7]\"\r\n                      >\r\n                        Fecha\r\n                      </div>\r\n                      <div\r\n                        class=\"p-3 text-xs text-left align-top border-t border-[#dde3e7] text-ellipsis overflow-hidden\"\r\n                      >\r\n                        {{\r\n                          goodsReceipt.created_at | date: \"dd/MM/yyyy HH:mm:ss\"\r\n                        }}\r\n                      </div>\r\n                    </div>\r\n                    <div\r\n                      class=\"p-2 align-top bg-[#e7ebee] relative\"\r\n                      [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n                    >\r\n                      <button\r\n                        class=\"outline-none text-secondary hover:text-info\"\r\n                        cbmTooltip=\"Agregar\"\r\n                        type=\"button\"\r\n                        (click)=\"addGoodsReceipt(goodsReceipt)\"\r\n                      >\r\n                        <svg\r\n                          xmlns=\"http://www.w3.org/2000/svg\"\r\n                          width=\"16\"\r\n                          height=\"16\"\r\n                          viewBox=\"0 0 24 24\"\r\n                          fill=\"none\"\r\n                          stroke=\"currentColor\"\r\n                          stroke-width=\"2\"\r\n                          stroke-linecap=\"round\"\r\n                          stroke-linejoin=\"round\"\r\n                        >\r\n                          <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n                          <path d=\"M12 5l0 14\" />\r\n                          <path d=\"M5 12l14 0\" />\r\n                        </svg>\r\n                      </button>\r\n                    </div>\r\n                  }\r\n                } @else {\r\n                  <div class=\"col-span-3 px-4 py-5 border-x border-[#dde3e7]\">\r\n                    <cbm-empty />\r\n                  </div>\r\n                }\r\n              }\r\n              @case (\"goods_issue\") {\r\n                @if (computedGoodsIssues().length) {\r\n                  @for (\r\n                    goodsIssue of computedGoodsIssues();\r\n                    track goodsIssue._id\r\n                  ) {\r\n                    <div\r\n                      class=\"bg-[#d2e7fa] p-3 text-xs font-semibold text-left align-top\"\r\n                      [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n                    >\r\n                      {{ $index + 1 }}\r\n                    </div>\r\n                    <div\r\n                      class=\"flex-grow grid grid-cols-[auto_1fr] text-[#67757c]\"\r\n                      [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n                    >\r\n                      <div\r\n                        class=\"p-3 text-xs text-left align-top font-semibold\"\r\n                      >\r\n                        Secuencial\r\n                      </div>\r\n                      <div class=\"p-3 text-xs text-left align-top\">\r\n                        {{ goodsIssue.document_nomenclature }}-{{\r\n                          goodsIssue.document_number\r\n                        }}\r\n                      </div>\r\n                      <div\r\n                        class=\"p-3 text-xs text-left align-top font-semibold border-t border-[#dde3e7]\"\r\n                      >\r\n                        Fecha\r\n                      </div>\r\n                      <div\r\n                        class=\"p-3 text-xs text-left align-top border-t border-[#dde3e7] text-ellipsis overflow-hidden\"\r\n                      >\r\n                        {{\r\n                          goodsIssue.created_at | date: \"dd/MM/yyyy HH:mm:ss\"\r\n                        }}\r\n                      </div>\r\n                    </div>\r\n                    <div\r\n                      class=\"p-2 align-top bg-[#e7ebee] relative\"\r\n                      [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n                    >\r\n                      <button\r\n                        class=\"outline-none text-secondary hover:text-info\"\r\n                        cbmTooltip=\"Agregar\"\r\n                        type=\"button\"\r\n                        (click)=\"addGoodsIssue(goodsIssue)\"\r\n                      >\r\n                        <svg\r\n                          xmlns=\"http://www.w3.org/2000/svg\"\r\n                          width=\"16\"\r\n                          height=\"16\"\r\n                          viewBox=\"0 0 24 24\"\r\n                          fill=\"none\"\r\n                          stroke=\"currentColor\"\r\n                          stroke-width=\"2\"\r\n                          stroke-linecap=\"round\"\r\n                          stroke-linejoin=\"round\"\r\n                        >\r\n                          <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n                          <path d=\"M12 5l0 14\" />\r\n                          <path d=\"M5 12l14 0\" />\r\n                        </svg>\r\n                      </button>\r\n                    </div>\r\n                  }\r\n                } @else {\r\n                  <div class=\"col-span-3 px-4 py-5 border-x border-[#dde3e7]\">\r\n                    <cbm-empty />\r\n                  </div>\r\n                }\r\n              }\r\n              @case (\"income\") {\r\n                @if (computedIncomes().length) {\r\n                  @for (income of computedIncomes(); track income._id) {\r\n                    <div\r\n                      class=\"bg-[#d2e7fa] p-3 text-xs font-semibold text-left align-top\"\r\n                      [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n                    >\r\n                      {{ $index + 1 }}\r\n                    </div>\r\n                    <div\r\n                      class=\"flex-grow grid grid-cols-[auto_1fr] text-[#67757c]\"\r\n                      [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n                    >\r\n                      <div\r\n                        class=\"p-3 text-xs text-left align-top font-semibold\"\r\n                      >\r\n                        Secuencial\r\n                      </div>\r\n                      <div class=\"p-3 text-xs text-left align-top\">\r\n                        {{ income.document_nomenclature }}-{{\r\n                          income.document_number\r\n                        }}\r\n                      </div>\r\n                      <div\r\n                        class=\"p-3 text-xs text-left align-top font-semibold border-t border-[#dde3e7]\"\r\n                      >\r\n                        Fecha\r\n                      </div>\r\n                      <div\r\n                        class=\"p-3 text-xs text-left align-top border-t border-[#dde3e7] text-ellipsis overflow-hidden\"\r\n                      >\r\n                        {{ income.created_at | date: \"dd/MM/yyyy HH:mm:ss\" }}\r\n                      </div>\r\n                    </div>\r\n                    <div\r\n                      class=\"p-2 align-top bg-[#e7ebee] relative\"\r\n                      [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n                    >\r\n                      <button\r\n                        class=\"outline-none text-secondary hover:text-info\"\r\n                        cbmTooltip=\"Agregar\"\r\n                        type=\"button\"\r\n                        (click)=\"addIncome(income)\"\r\n                      >\r\n                        <svg\r\n                          xmlns=\"http://www.w3.org/2000/svg\"\r\n                          width=\"16\"\r\n                          height=\"16\"\r\n                          viewBox=\"0 0 24 24\"\r\n                          fill=\"none\"\r\n                          stroke=\"currentColor\"\r\n                          stroke-width=\"2\"\r\n                          stroke-linecap=\"round\"\r\n                          stroke-linejoin=\"round\"\r\n                        >\r\n                          <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n                          <path d=\"M12 5l0 14\" />\r\n                          <path d=\"M5 12l14 0\" />\r\n                        </svg>\r\n                      </button>\r\n                    </div>\r\n                  }\r\n                } @else {\r\n                  <div class=\"col-span-3 px-4 py-5 border-x border-[#dde3e7]\">\r\n                    <cbm-empty />\r\n                  </div>\r\n                }\r\n              }\r\n              @case (\"invoice\") {\r\n                @if (computedInvoices().length) {\r\n                  @for (invoice of computedInvoices(); track invoice._id) {\r\n                    <div\r\n                      class=\"bg-[#d2e7fa] p-3 text-xs font-semibold text-left align-top\"\r\n                      [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n                    >\r\n                      {{ $index + 1 }}\r\n                    </div>\r\n                    <div\r\n                      class=\"flex-grow grid grid-cols-[auto_1fr] text-[#67757c]\"\r\n                      [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n                    >\r\n                      <div\r\n                        class=\"p-3 text-xs text-left align-top font-semibold\"\r\n                      >\r\n                        Secuencial\r\n                      </div>\r\n                      <div class=\"p-3 text-xs text-left align-top\">\r\n                        {{ invoice.document_nomenclature }}-{{\r\n                          invoice.document_number\r\n                        }}\r\n                      </div>\r\n                      <div\r\n                        class=\"p-3 text-xs text-left align-top font-semibold border-t border-[#dde3e7]\"\r\n                      >\r\n                        Fecha\r\n                      </div>\r\n                      <div\r\n                        class=\"p-3 text-xs text-left align-top border-t border-[#dde3e7] text-ellipsis overflow-hidden\"\r\n                      >\r\n                        {{ invoice.created_at | date: \"dd/MM/yyyy HH:mm:ss\" }}\r\n                      </div>\r\n                    </div>\r\n                    <div\r\n                      class=\"p-2 align-top bg-[#e7ebee] relative\"\r\n                      [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n                    >\r\n                      <button\r\n                        class=\"outline-none text-secondary hover:text-info\"\r\n                        cbmTooltip=\"Agregar\"\r\n                        type=\"button\"\r\n                        (click)=\"addInvoice(invoice)\"\r\n                      >\r\n                        <svg\r\n                          xmlns=\"http://www.w3.org/2000/svg\"\r\n                          width=\"16\"\r\n                          height=\"16\"\r\n                          viewBox=\"0 0 24 24\"\r\n                          fill=\"none\"\r\n                          stroke=\"currentColor\"\r\n                          stroke-width=\"2\"\r\n                          stroke-linecap=\"round\"\r\n                          stroke-linejoin=\"round\"\r\n                        >\r\n                          <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n                          <path d=\"M12 5l0 14\" />\r\n                          <path d=\"M5 12l14 0\" />\r\n                        </svg>\r\n                      </button>\r\n                    </div>\r\n                  }\r\n                } @else {\r\n                  <div class=\"col-span-3 px-4 py-5 border-x border-[#dde3e7]\">\r\n                    <cbm-empty />\r\n                  </div>\r\n                }\r\n              }\r\n              @case (\"document_liquidation\") {\r\n                @if (computedDocumentLiquidations().length) {\r\n                  @for (\r\n                    documentLiquidation of computedDocumentLiquidations();\r\n                    track documentLiquidation._id\r\n                  ) {\r\n                    <div\r\n                      class=\"bg-[#d2e7fa] p-3 text-xs font-semibold text-left align-top\"\r\n                      [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n                    >\r\n                      {{ $index + 1 }}\r\n                    </div>\r\n                    <div\r\n                      class=\"flex-grow grid grid-cols-[auto_1fr] text-[#67757c]\"\r\n                      [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n                    >\r\n                      <div\r\n                        class=\"p-3 text-xs text-left align-top font-semibold\"\r\n                      >\r\n                        Secuencial\r\n                      </div>\r\n                      <div class=\"p-3 text-xs text-left align-top\">\r\n                        {{ documentLiquidation.document_nomenclature }}-{{\r\n                          documentLiquidation.document_number\r\n                        }}\r\n                      </div>\r\n                      <div\r\n                        class=\"p-3 text-xs text-left align-top font-semibold border-t border-[#dde3e7]\"\r\n                      >\r\n                        Fecha\r\n                      </div>\r\n                      <div\r\n                        class=\"p-3 text-xs text-left align-top border-t border-[#dde3e7] text-ellipsis overflow-hidden\"\r\n                      >\r\n                        {{\r\n                          documentLiquidation.created_at\r\n                            | date: \"dd/MM/yyyy HH:mm:ss\"\r\n                        }}\r\n                      </div>\r\n                    </div>\r\n                    <div\r\n                      class=\"p-2 align-top bg-[#e7ebee] relative\"\r\n                      [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n                    >\r\n                      <button\r\n                        class=\"outline-none text-secondary hover:text-info\"\r\n                        cbmTooltip=\"Agregar\"\r\n                        type=\"button\"\r\n                        (click)=\"addDocumentLiquidation(documentLiquidation)\"\r\n                      >\r\n                        <svg\r\n                          xmlns=\"http://www.w3.org/2000/svg\"\r\n                          width=\"16\"\r\n                          height=\"16\"\r\n                          viewBox=\"0 0 24 24\"\r\n                          fill=\"none\"\r\n                          stroke=\"currentColor\"\r\n                          stroke-width=\"2\"\r\n                          stroke-linecap=\"round\"\r\n                          stroke-linejoin=\"round\"\r\n                        >\r\n                          <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n                          <path d=\"M12 5l0 14\" />\r\n                          <path d=\"M5 12l14 0\" />\r\n                        </svg>\r\n                      </button>\r\n                    </div>\r\n                  }\r\n                } @else {\r\n                  <div class=\"col-span-3 px-4 py-5 border-x border-[#dde3e7]\">\r\n                    <cbm-empty />\r\n                  </div>\r\n                }\r\n              }\r\n            }\r\n          }\r\n          <!-- 👨 -->\r\n        </div>\r\n\r\n        @if (areThereDocuments()) {\r\n          <div class=\"mt-4 overflow-x-auto\" cbmHorizontalOverflowShadow>\r\n            @switch (transactionTypeControl.value) {\r\n              @case (\"goods_receipts\") {\r\n                <cbm-pagination-nav\r\n                  [current]=\"goodsReceiptsPagination().page\"\r\n                  [total]=\"goodsReceiptsPagination().totalPages ?? 0\"\r\n                  (goTo)=\"onGoToPage($event)\"\r\n                  (next)=\"onNextPage($event)\"\r\n                  (previous)=\"onPreviousPage($event)\"\r\n                  (pageSizeChange)=\"onPageSizeChange($event)\"\r\n                  [totalRecords]=\"goodsReceiptsPagination().totalRecords\"\r\n                  [shownRecords]=\"goodsReceipts().length\"\r\n                  [pageSize]=\"goodsReceiptsPagination().size\"\r\n                ></cbm-pagination-nav>\r\n              }\r\n              @case (\"goods_issue\") {\r\n                <cbm-pagination-nav\r\n                  [current]=\"goodsIssuesPagination().page\"\r\n                  [total]=\"goodsIssuesPagination().totalPages ?? 0\"\r\n                  (goTo)=\"onGoToPage($event)\"\r\n                  (next)=\"onNextPage($event)\"\r\n                  (previous)=\"onPreviousPage($event)\"\r\n                  (pageSizeChange)=\"onPageSizeChange($event)\"\r\n                  [totalRecords]=\"goodsIssuesPagination().totalRecords\"\r\n                  [shownRecords]=\"goodsIssues().length\"\r\n                  [pageSize]=\"goodsIssuesPagination().size\"\r\n                ></cbm-pagination-nav>\r\n              }\r\n              @case (\"income\") {\r\n                <cbm-pagination-nav\r\n                  [current]=\"incomesPagination().page\"\r\n                  [total]=\"incomesPagination().totalPages ?? 0\"\r\n                  (goTo)=\"onGoToPage($event)\"\r\n                  (next)=\"onNextPage($event)\"\r\n                  (previous)=\"onPreviousPage($event)\"\r\n                  (pageSizeChange)=\"onPageSizeChange($event)\"\r\n                  [totalRecords]=\"incomesPagination().totalRecords\"\r\n                  [shownRecords]=\"incomes().length\"\r\n                  [pageSize]=\"incomesPagination().size\"\r\n                ></cbm-pagination-nav>\r\n              }\r\n              @case (\"invoice\") {\r\n                <cbm-pagination-nav\r\n                  [current]=\"invoicesPagination().page\"\r\n                  [total]=\"invoicesPagination().totalPages ?? 0\"\r\n                  (goTo)=\"onGoToPage($event)\"\r\n                  (next)=\"onNextPage($event)\"\r\n                  (previous)=\"onPreviousPage($event)\"\r\n                  (pageSizeChange)=\"onPageSizeChange($event)\"\r\n                  [totalRecords]=\"invoicesPagination().totalRecords\"\r\n                  [shownRecords]=\"invoices().length\"\r\n                  [pageSize]=\"invoicesPagination().size\"\r\n                ></cbm-pagination-nav>\r\n              }\r\n              @case (\"document_liquidation\") {\r\n                <cbm-pagination-nav\r\n                  [current]=\"documentLiquidationsPagination().page\"\r\n                  [total]=\"documentLiquidationsPagination().totalPages ?? 0\"\r\n                  (goTo)=\"onGoToPage($event)\"\r\n                  (next)=\"onNextPage($event)\"\r\n                  (previous)=\"onPreviousPage($event)\"\r\n                  (pageSizeChange)=\"onPageSizeChange($event)\"\r\n                  [totalRecords]=\"documentLiquidationsPagination().totalRecords\"\r\n                  [shownRecords]=\"documentLiquidations().length\"\r\n                  [pageSize]=\"documentLiquidationsPagination().size\"\r\n                ></cbm-pagination-nav>\r\n              }\r\n            }\r\n          </div>\r\n        }\r\n      </div>\r\n\r\n      <div>\r\n        <h3 class=\"text-lg font-medium text-info\">Documentos agregados</h3>\r\n\r\n        <div\r\n          class=\"border-y border-[#dde3e7] grid grid-cols-[auto_1fr_auto] mt-3\"\r\n        >\r\n          @if (addedDocuments().length) {\r\n            @for (addedDocument of addedDocuments(); track addedDocument._id) {\r\n              <div\r\n                class=\"bg-[#d2e7fa] p-3 text-xs font-semibold text-left align-top\"\r\n                [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n              >\r\n                {{ $index + 1 }}\r\n              </div>\r\n              <div\r\n                class=\"flex-grow grid grid-cols-[auto_1fr] text-[#67757c]\"\r\n                [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n              >\r\n                <div class=\"p-3 text-xs text-left align-top font-semibold\">\r\n                  Secuencial\r\n                </div>\r\n                <div class=\"p-3 text-xs text-left align-top\">\r\n                  {{ addedDocument.document_nomenclature }}-{{\r\n                    addedDocument.document_number\r\n                  }}\r\n                </div>\r\n                <div\r\n                  class=\"p-3 text-xs text-left align-top font-semibold border-t border-[#dde3e7]\"\r\n                >\r\n                  Fecha\r\n                </div>\r\n                <div\r\n                  class=\"p-3 text-xs text-left align-top border-t border-[#dde3e7] text-ellipsis overflow-hidden\"\r\n                >\r\n                  {{ addedDocument.created_at | date: \"dd/MM/yyyy HH:mm:ss\" }}\r\n                </div>\r\n              </div>\r\n              <div\r\n                class=\"p-2 align-top bg-[#e7ebee] relative\"\r\n                [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n              >\r\n                <button\r\n                  class=\"outline-none text-secondary hover:text-info\"\r\n                  cbmTooltip=\"Eliminar\"\r\n                  type=\"button\"\r\n                  (click)=\"removeAddedDocument($index)\"\r\n                >\r\n                  <svg\r\n                    xmlns=\"http://www.w3.org/2000/svg\"\r\n                    width=\"16\"\r\n                    height=\"16\"\r\n                    viewBox=\"0 0 24 24\"\r\n                    fill=\"none\"\r\n                    stroke=\"currentColor\"\r\n                    stroke-width=\"2\"\r\n                    stroke-linecap=\"round\"\r\n                    stroke-linejoin=\"round\"\r\n                  >\r\n                    <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n                    <path d=\"M4 7l16 0\" />\r\n                    <path d=\"M10 11l0 6\" />\r\n                    <path d=\"M14 11l0 6\" />\r\n                    <path d=\"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12\" />\r\n                    <path d=\"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3\" />\r\n                  </svg>\r\n                </button>\r\n              </div>\r\n            }\r\n          } @else {\r\n            <div class=\"col-span-3 px-4 py-5 border-x border-[#dde3e7]\">\r\n              <cbm-empty\r\n                title=\"Sin documentos\"\r\n                message=\"Aún no se han agregado documentos\"\r\n              />\r\n            </div>\r\n          }\r\n        </div>\r\n      </div>\r\n    </div>\r\n\r\n    <div class=\"flex flex-wrap justify-center gap-2 mt-5\">\r\n      <button\r\n        type=\"submit\"\r\n        class=\"outline-none py-2 px-6 text-white rounded-full flex justify-center items-center gap-2 font-medium bg-info hover:bg-[#409ae9] transition-colors flex-grow sm:flex-grow-0 disabled:pointer-events-none disabled:opacity-70\"\r\n        [disabled]=\"statusOfSaveDocuments() === 'loading'\"\r\n      >\r\n        @if (statusOfSaveDocuments() === \"loading\") {\r\n          <div role=\"status\">\r\n            <svg\r\n              aria-hidden=\"true\"\r\n              class=\"w-5 h-5 text-gray-400 animate-spin fill-white\"\r\n              viewBox=\"0 0 100 101\"\r\n              fill=\"none\"\r\n              xmlns=\"http://www.w3.org/2000/svg\"\r\n            >\r\n              <path\r\n                d=\"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z\"\r\n                fill=\"currentColor\"\r\n              />\r\n              <path\r\n                d=\"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z\"\r\n                fill=\"currentFill\"\r\n              />\r\n            </svg>\r\n            <span class=\"sr-only\">Loading...</span>\r\n          </div>\r\n        } @else {\r\n          <svg\r\n            xmlns=\"http://www.w3.org/2000/svg\"\r\n            width=\"20\"\r\n            height=\"20\"\r\n            viewBox=\"0 0 24 24\"\r\n            fill=\"none\"\r\n            stroke=\"currentColor\"\r\n            stroke-width=\"2\"\r\n            stroke-linecap=\"round\"\r\n            stroke-linejoin=\"round\"\r\n          >\r\n            <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n            <path d=\"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\" />\r\n            <path d=\"M9 12l2 2l4 -4\" />\r\n          </svg>\r\n        }\r\n\r\n        Agregar\r\n      </button>\r\n\r\n      <button\r\n        type=\"button\"\r\n        class=\"outline-none py-2 px-6 text-secondary rounded-full flex justify-center items-center gap-2 font-medium bg-light-secondary hover:bg-secondary hover:text-white transition-colors flex-grow sm:flex-grow-0 disabled:pointer-events-none disabled:opacity-70\"\r\n        (click)=\"goBack.emit()\"\r\n        [disabled]=\"statusOfSaveDocuments() === 'loading'\"\r\n      >\r\n        <svg\r\n          xmlns=\"http://www.w3.org/2000/svg\"\r\n          width=\"20\"\r\n          height=\"20\"\r\n          viewBox=\"0 0 24 24\"\r\n          fill=\"none\"\r\n          stroke=\"currentColor\"\r\n          stroke-width=\"2\"\r\n          stroke-linecap=\"round\"\r\n          stroke-linejoin=\"round\"\r\n        >\r\n          <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n          <path d=\"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\" />\r\n          <path d=\"M10 10l4 4m0 -4l-4 4\" />\r\n        </svg>\r\n\r\n        Cancelar\r\n      </button>\r\n    </div>\r\n  } @else if (typeControl.value === \"external\") {\r\n    @if (isSmallScreen()) {\r\n      <div\r\n        class=\"mt-4 border-y border-[#dde3e7] grid grid-cols-[auto_1fr_auto]\"\r\n        formArrayName=\"externalDocuments\"\r\n      >\r\n        @if (externalDocumentsArray.length) {\r\n          @for (group of externalDocumentsArray.controls; track group) {\r\n            <div\r\n              class=\"bg-[#d2e7fa] p-3 pt-5 text-xs font-semibold text-left align-top\"\r\n              [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n            >\r\n              {{ $index + 1 }}\r\n            </div>\r\n\r\n            <div\r\n              class=\"flex-grow grid grid-cols-[auto_1fr] text-[#67757c]\"\r\n              [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n              [formGroup]=\"group\"\r\n            >\r\n              <div class=\"p-3 pt-5 text-xs text-left align-top font-semibold\">\r\n                Fecha\r\n              </div>\r\n              <div class=\"p-3 text-xs text-left align-top\">\r\n                <input\r\n                  formControlName=\"date\"\r\n                  type=\"date\"\r\n                  class=\"form-control form-control-sm\"\r\n                  [class.is-invalid]=\"\r\n                    groupDateControl($index).invalid &&\r\n                    groupDateControl($index).touched\r\n                  \"\r\n                />\r\n              </div>\r\n\r\n              <div\r\n                class=\"p-3 pt-5 text-xs text-left align-top font-semibold border-t border-[#dde3e7]\"\r\n              >\r\n                Número de documento\r\n              </div>\r\n              <div\r\n                class=\"p-3 text-xs text-left align-top border-t border-[#dde3e7] text-ellipsis overflow-hidden\"\r\n              >\r\n                <input\r\n                  formControlName=\"documentNumber\"\r\n                  type=\"text\"\r\n                  class=\"form-control form-control-sm\"\r\n                  placeholder=\"000483\"\r\n                  cbmTextInput\r\n                  pattern=\"^\\d*$\"\r\n                  [class.is-invalid]=\"\r\n                    groupDocumentNumberControl($index).invalid &&\r\n                    groupDocumentNumberControl($index).touched\r\n                  \"\r\n                />\r\n              </div>\r\n\r\n              <div\r\n                class=\"p-3 pt-5 text-xs text-left align-top font-semibold border-t border-[#dde3e7]\"\r\n              >\r\n                Nombre de documento\r\n              </div>\r\n              <div\r\n                class=\"p-3 text-xs text-left align-top border-t border-[#dde3e7] text-ellipsis overflow-hidden\"\r\n              >\r\n                <input\r\n                  formControlName=\"documentName\"\r\n                  type=\"text\"\r\n                  class=\"form-control form-control-sm\"\r\n                  placeholder=\"FAC-008982\"\r\n                  [class.is-invalid]=\"\r\n                    groupDocumentNameControl($index).invalid &&\r\n                    groupDocumentNameControl($index).touched\r\n                  \"\r\n                />\r\n              </div>\r\n            </div>\r\n\r\n            <div\r\n              class=\"p-2 pt-4 align-top bg-[#e7ebee] relative\"\r\n              [ngClass]=\"{ 'border-t border-info': $index !== 0 }\"\r\n            >\r\n              <button\r\n                class=\"outline-none text-secondary hover:text-info\"\r\n                cbmTooltip=\"Eliminar\"\r\n                type=\"button\"\r\n                (click)=\"removeExternalDocumentGroup($index)\"\r\n              >\r\n                <svg\r\n                  xmlns=\"http://www.w3.org/2000/svg\"\r\n                  width=\"16\"\r\n                  height=\"16\"\r\n                  viewBox=\"0 0 24 24\"\r\n                  fill=\"none\"\r\n                  stroke=\"currentColor\"\r\n                  stroke-width=\"2\"\r\n                  stroke-linecap=\"round\"\r\n                  stroke-linejoin=\"round\"\r\n                >\r\n                  <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n                  <path d=\"M4 7l16 0\" />\r\n                  <path d=\"M10 11l0 6\" />\r\n                  <path d=\"M14 11l0 6\" />\r\n                  <path d=\"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12\" />\r\n                  <path d=\"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3\" />\r\n                </svg>\r\n              </button>\r\n            </div>\r\n          }\r\n        } @else {\r\n          <div class=\"col-span-3 px-4 py-5 border-x border-[#dde3e7]\">\r\n            <cbm-empty\r\n              title=\"Sin documentos\"\r\n              message=\"Aún no se han agregado documentos\"\r\n            />\r\n          </div>\r\n        }\r\n      </div>\r\n    } @else {\r\n      <table aria-label=\"Tabla de documentos externos\" class=\"w-full mt-4\">\r\n        <thead class=\"bg-[#d2e7fa] border-b border-info text-black\">\r\n          <tr>\r\n            <th class=\"p-3 text-xs font-semibold text-left align-bottom\">N°</th>\r\n            <th class=\"p-3 text-xs font-semibold text-left align-bottom\">\r\n              Fecha\r\n            </th>\r\n            <th class=\"p-3 text-xs font-semibold text-left align-bottom\">\r\n              Número de documento\r\n            </th>\r\n            <th class=\"p-3 text-xs font-semibold text-left align-bottom\">\r\n              Nombre de documento\r\n            </th>\r\n            <th class=\"p-3 text-xs font-semibold text-center align-bottom\">\r\n              Acciones\r\n            </th>\r\n          </tr>\r\n        </thead>\r\n\r\n        <tbody class=\"text-[#67757c]\" formArrayName=\"externalDocuments\">\r\n          @if (externalDocumentsArray.length) {\r\n            @for (group of externalDocumentsArray.controls; track group) {\r\n              <tr class=\"border-b border-[#dde3e7]\" [formGroup]=\"group\">\r\n                <td class=\"p-3 pt-5 text-xs text-left font-bold align-top\">\r\n                  {{ $index + 1 }}\r\n                </td>\r\n                <td class=\"p-3 text-xs text-left align-top min-w-40\">\r\n                  <input\r\n                    formControlName=\"date\"\r\n                    type=\"date\"\r\n                    class=\"form-control form-control-sm\"\r\n                    [class.is-invalid]=\"\r\n                      groupDateControl($index).invalid &&\r\n                      groupDateControl($index).touched\r\n                    \"\r\n                  />\r\n                </td>\r\n                <td class=\"p-3 text-xs text-left align-top min-w-40\">\r\n                  <input\r\n                    formControlName=\"documentNumber\"\r\n                    type=\"text\"\r\n                    class=\"form-control form-control-sm\"\r\n                    placeholder=\"000483\"\r\n                    cbmTextInput\r\n                    pattern=\"^\\d*$\"\r\n                    [class.is-invalid]=\"\r\n                      groupDocumentNumberControl($index).invalid &&\r\n                      groupDocumentNumberControl($index).touched\r\n                    \"\r\n                  />\r\n                </td>\r\n                <td class=\"p-3 text-xs text-left align-top min-w-40\">\r\n                  <input\r\n                    formControlName=\"documentName\"\r\n                    type=\"text\"\r\n                    class=\"form-control form-control-sm\"\r\n                    placeholder=\"FAC-008982\"\r\n                    [class.is-invalid]=\"\r\n                      groupDocumentNameControl($index).invalid &&\r\n                      groupDocumentNameControl($index).touched\r\n                    \"\r\n                  />\r\n                </td>\r\n                <td class=\"p-3 text-xs text-center align-top relative\">\r\n                  <button\r\n                    class=\"p-1 text-[#6c757d] hover:text-white border border-[#6c757d] hover:bg-[#6c757d] rounded-md outline-none transition-colors\"\r\n                    (click)=\"removeExternalDocumentGroup($index)\"\r\n                    type=\"button\"\r\n                    cbmTooltip=\"Eliminar\"\r\n                  >\r\n                    <svg\r\n                      xmlns=\"http://www.w3.org/2000/svg\"\r\n                      width=\"16\"\r\n                      height=\"16\"\r\n                      viewBox=\"0 0 24 24\"\r\n                      fill=\"none\"\r\n                      stroke=\"currentColor\"\r\n                      stroke-width=\"2\"\r\n                      stroke-linecap=\"round\"\r\n                      stroke-linejoin=\"round\"\r\n                      class=\"icon icon-tabler icons-tabler-outline icon-tabler-trash\"\r\n                    >\r\n                      <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n                      <path d=\"M4 7l16 0\" />\r\n                      <path d=\"M10 11l0 6\" />\r\n                      <path d=\"M14 11l0 6\" />\r\n                      <path\r\n                        d=\"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12\"\r\n                      />\r\n                      <path d=\"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3\" />\r\n                    </svg>\r\n                  </button>\r\n                </td>\r\n              </tr>\r\n            }\r\n          } @else {\r\n            <tr class=\"border-b border-[#dde3e7]\">\r\n              <td colspan=\"5\" class=\"px-4 py-5\">\r\n                <cbm-empty\r\n                  title=\"Sin documentos\"\r\n                  message=\"Aún no se han agregado documentos\"\r\n                />\r\n              </td>\r\n            </tr>\r\n          }\r\n        </tbody>\r\n      </table>\r\n    }\r\n\r\n    @if (externalDocumentsArray.invalid && externalDocumentsArray.touched) {\r\n      <p class=\"text-danger text-sm mt-2\" [@fadeInOutAnimation]>\r\n        {{\r\n          externalDocumentsArray.errors ?? externalDocumentsArrayErrors()\r\n            | cbmErrorTranslate\r\n        }}\r\n        {{\r\n          externalDocumentsArray.errors ? \"\" : externalDocumentErrorLocation()\r\n        }}\r\n      </p>\r\n    }\r\n\r\n    <div class=\"flex mt-4\">\r\n      <button\r\n        type=\"button\"\r\n        class=\"outline-none border border-info py-2 px-6 text-info rounded-md flex justify-center items-center gap-2 font-medium hover:bg-info hover:text-white transition-colors flex-grow sm:flex-grow-0 disabled:pointer-events-none disabled:opacity-70\"\r\n        (click)=\"addExternalDocumentGroup()\"\r\n      >\r\n        <svg\r\n          xmlns=\"http://www.w3.org/2000/svg\"\r\n          width=\"20\"\r\n          height=\"20\"\r\n          viewBox=\"0 0 24 24\"\r\n          fill=\"none\"\r\n          stroke=\"currentColor\"\r\n          stroke-width=\"2\"\r\n          stroke-linecap=\"round\"\r\n          stroke-linejoin=\"round\"\r\n        >\r\n          <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n          <path d=\"M12 5l0 14\" />\r\n          <path d=\"M5 12l14 0\" />\r\n        </svg>\r\n\r\n        Agregar\r\n      </button>\r\n    </div>\r\n\r\n    <div class=\"flex flex-wrap justify-center gap-2 mt-5\">\r\n      <button\r\n        type=\"submit\"\r\n        class=\"outline-none py-2 px-6 text-white rounded-full flex justify-center items-center gap-2 font-medium bg-info hover:bg-[#409ae9] transition-colors flex-grow sm:flex-grow-0 disabled:pointer-events-none disabled:opacity-70\"\r\n        [disabled]=\"statusOfSaveDocuments() === 'loading'\"\r\n      >\r\n        @if (statusOfSaveDocuments() === \"loading\") {\r\n          <div role=\"status\">\r\n            <svg\r\n              aria-hidden=\"true\"\r\n              class=\"w-5 h-5 text-gray-400 animate-spin fill-white\"\r\n              viewBox=\"0 0 100 101\"\r\n              fill=\"none\"\r\n              xmlns=\"http://www.w3.org/2000/svg\"\r\n            >\r\n              <path\r\n                d=\"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z\"\r\n                fill=\"currentColor\"\r\n              />\r\n              <path\r\n                d=\"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z\"\r\n                fill=\"currentFill\"\r\n              />\r\n            </svg>\r\n            <span class=\"sr-only\">Loading...</span>\r\n          </div>\r\n        } @else {\r\n          <svg\r\n            xmlns=\"http://www.w3.org/2000/svg\"\r\n            width=\"20\"\r\n            height=\"20\"\r\n            viewBox=\"0 0 24 24\"\r\n            fill=\"none\"\r\n            stroke=\"currentColor\"\r\n            stroke-width=\"2\"\r\n            stroke-linecap=\"round\"\r\n            stroke-linejoin=\"round\"\r\n          >\r\n            <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n            <path d=\"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\" />\r\n            <path d=\"M9 12l2 2l4 -4\" />\r\n          </svg>\r\n        }\r\n\r\n        Agregar\r\n      </button>\r\n\r\n      <button\r\n        type=\"button\"\r\n        class=\"outline-none py-2 px-6 text-secondary rounded-full flex justify-center items-center gap-2 font-medium bg-light-secondary hover:bg-secondary hover:text-white transition-colors flex-grow sm:flex-grow-0 disabled:pointer-events-none disabled:opacity-70\"\r\n        (click)=\"goBack.emit()\"\r\n        [disabled]=\"statusOfSaveDocuments() === 'loading'\"\r\n      >\r\n        <svg\r\n          xmlns=\"http://www.w3.org/2000/svg\"\r\n          width=\"20\"\r\n          height=\"20\"\r\n          viewBox=\"0 0 24 24\"\r\n          fill=\"none\"\r\n          stroke=\"currentColor\"\r\n          stroke-width=\"2\"\r\n          stroke-linecap=\"round\"\r\n          stroke-linejoin=\"round\"\r\n        >\r\n          <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n          <path d=\"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\" />\r\n          <path d=\"M10 10l4 4m0 -4l-4 4\" />\r\n        </svg>\r\n\r\n        Cancelar\r\n      </button>\r\n    </div>\r\n  }\r\n</form>\r\n","import { Component, ViewEncapsulation, input, signal } from '@angular/core';\r\nimport { BrowserAnimationsModule } from '@angular/platform-browser/animations';\r\nimport { TabsComponent } from './components/tabs/tabs.component';\r\nimport { TabItemComponent } from './components/tab-item/tab-item.component';\r\nimport { ReferenceDocumentToTabComponent } from './components/reference-document-to-tab/reference-document-to-tab.component';\r\nimport { NgSelectConfig, NgSelectModule } from '@ng-select/ng-select';\r\nimport { fadeInOutAnimation } from './animations';\r\nimport { CbmNotificationService } from '@g2-common/notification-service';\r\nimport { ReferenceDocumentByTabComponent } from './components/reference-document-by-tab/reference-document-by-tab.component';\r\nimport { AddComponent } from './components/add/add.component';\r\n\r\n@Component({\r\n  selector: 'cbm-reference-documents',\r\n  standalone: true,\r\n  imports: [\r\n    TabsComponent,\r\n    TabItemComponent,\r\n    ReferenceDocumentToTabComponent,\r\n    ReferenceDocumentByTabComponent,\r\n    NgSelectModule,\r\n    AddComponent,\r\n  ],\r\n  styleUrls: ['./styles.css'],\r\n  templateUrl: './reference-documents.component.html',\r\n  encapsulation: ViewEncapsulation.ShadowDom,\r\n  animations: [fadeInOutAnimation],\r\n  providers: [BrowserAnimationsModule, CbmNotificationService],\r\n})\r\nexport class CbmReferenceDocumentsComponent {\r\n  // #region inputs\r\n  collectionId = input.required<string>();\r\n  collectionName = input.required<string>();\r\n  documentOriginName = input.required<string>();\r\n  documentOriginNumber = input.required<string>();\r\n  documentOriginDate = input.required<number>();\r\n\r\n  // #region state\r\n  isAddViewVisible = signal<boolean>(false);\r\n\r\n  // #region constructor\r\n  constructor(private config: NgSelectConfig) {\r\n    this.config.notFoundText = 'No se encontraron resultados';\r\n    this.config.loadingText = 'Cargando...';\r\n  }\r\n}\r\n","@if (isAddViewVisible()) {\r\n  <lib-add\r\n    (goBack)=\"isAddViewVisible.set(false)\"\r\n    [collectionId]=\"collectionId()\"\r\n    [collectionName]=\"collectionName()\"\r\n    [documentOriginDate]=\"documentOriginDate()\"\r\n    [documentOriginName]=\"documentOriginName()\"\r\n    [documentOriginNumber]=\"documentOriginNumber()\"\r\n  ></lib-add>\r\n} @else {\r\n  <div class=\"flex justify-end\">\r\n    <button\r\n      class=\"outline-none py-2 px-6 text-info rounded-full flex justify-center items-center gap-2 font-medium bg-light-info hover:bg-info hover:text-white transition-colors flex-grow sm:flex-grow-0\"\r\n      (click)=\"isAddViewVisible.set(true)\"\r\n      type=\"button\"\r\n    >\r\n      <svg\r\n        xmlns=\"http://www.w3.org/2000/svg\"\r\n        width=\"20\"\r\n        height=\"20\"\r\n        viewBox=\"0 0 24 24\"\r\n        fill=\"none\"\r\n        stroke=\"currentColor\"\r\n        stroke-width=\"2\"\r\n        stroke-linecap=\"round\"\r\n        stroke-linejoin=\"round\"\r\n      >\r\n        <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n        <path d=\"M14 3v4a1 1 0 0 0 1 1h4\" />\r\n        <path\r\n          d=\"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z\"\r\n        />\r\n      </svg>\r\n\r\n      <span>Agregar Documento</span>\r\n    </button>\r\n  </div>\r\n\r\n  <div class=\"mt-4\">\r\n    <lib-tabs>\r\n      <lib-tab-item\r\n        tabName=\"Documento referenciado a\"\r\n        [templateRef]=\"referenceDocumentToTab\"\r\n      ></lib-tab-item>\r\n\r\n      <lib-tab-item\r\n        tabName=\"Documento referenciado por\"\r\n        [templateRef]=\"referenceDocumentByTab\"\r\n      ></lib-tab-item>\r\n    </lib-tabs>\r\n\r\n    <ng-template #referenceDocumentToTab>\r\n      <lib-reference-document-to-tab\r\n        [collectionId]=\"collectionId()\"\r\n        [collectionName]=\"collectionName()\"\r\n      ></lib-reference-document-to-tab>\r\n    </ng-template>\r\n\r\n    <ng-template #referenceDocumentByTab>\r\n      <lib-reference-document-by-tab\r\n        [collectionId]=\"collectionId()\"\r\n        [collectionName]=\"collectionName()\"\r\n      ></lib-reference-document-by-tab>\r\n    </ng-template>\r\n  </div>\r\n}\r\n","/*\r\n * Public API Surface of reference-documents\r\n */\r\n\r\nexport * from './lib/index';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["DeleteComponent","i1","i2","i3","i4","i6","i7","i8","i9"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;MAea,gBAAgB,CAAA;AAR7B,IAAA,WAAA,GAAA;AASE,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAU;AAClC,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAC,QAAQ,EAAoB;AACjD;8GAHY,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAhB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,gBAAgB,0VCf7B,4BACA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FDca,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAR5B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,cAAc,cACZ,IAAI,EAAA,OAAA,EACP,EAAE,EAGM,eAAA,EAAA,uBAAuB,CAAC,MAAM,E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