{"version":3,"file":"jaguards-ngx-viewer2.mjs","sources":["../../../projects/ngx-viewer2/src/lib/ngx-viewer2.directive.ts","../../../projects/ngx-viewer2/src/lib/ngx-viewer2.module.ts","../../../projects/ngx-viewer2/src/public-api.ts","../../../projects/ngx-viewer2/src/jaguards-ngx-viewer2.ts"],"sourcesContent":["import { Directive, ElementRef, OnDestroy, AfterViewInit, Input, Output, EventEmitter } from '@angular/core';\nimport Viewer from 'viewerjs';\n\n@Directive({\n    selector: '[ngxViewer2]',\n    standalone: false\n})\nexport class NgxViewer2Directive implements AfterViewInit, OnDestroy {\n  @Input() viewerOptions: Viewer.Options = {};\n\n  @Output() viewerReady: EventEmitter<Event> = new EventEmitter<Event>();\n  @Output() viewerShow: EventEmitter<Event> = new EventEmitter<Event>();\n  @Output() viewerShown: EventEmitter<Event> = new EventEmitter<Event>();\n  @Output() viewerHide: EventEmitter<Event> = new EventEmitter<Event>();\n  @Output() viewerHidden: EventEmitter<Event> = new EventEmitter<Event>();\n  @Output() viewerView: EventEmitter<Event> = new EventEmitter<Event>();\n  @Output() viewerViewed: EventEmitter<Event> = new EventEmitter<Event>();\n  @Output() viewerZoom: EventEmitter<Event> = new EventEmitter<Event>();\n  @Output() viewerZoomed: EventEmitter<Event> = new EventEmitter<Event>();\n\n  instance!: Viewer;\n\n  private nativeElement: HTMLElement;\n\n  constructor(private elementRef: ElementRef) {\n    this.nativeElement = this.elementRef.nativeElement;\n  }\n\n  public ngAfterViewInit(): void {\n    this.initViewer();\n  }\n\n  private initViewer(): void {\n    if (this.instance) {\n      this.instance.destroy();\n    }\n\n    this.instance = new Viewer(this.nativeElement, {\n      // Transitions currently break the Viewer when running optimizations during ng build (i.e in prod mode)\n      // TODO: Find a fix for this so we don't have to force disable transitions\n      transition: false,\n      ...this.viewerOptions\n    });\n\n    this.instance.zoomTo(1);\n\n    this.nativeElement.addEventListener('ready', event => this.viewerReady.emit(event), false);\n    this.nativeElement.addEventListener('show', event => this.viewerShow.emit(event), false);\n    this.nativeElement.addEventListener('shown', event => this.viewerShown.emit(event), false);\n    this.nativeElement.addEventListener('hide', event => this.viewerHide.emit(event), false);\n    this.nativeElement.addEventListener('hidden', event => this.viewerHidden.emit(event), false);\n    this.nativeElement.addEventListener('view', event => this.viewerView.emit(event), false);\n    this.nativeElement.addEventListener('viewed', event => this.viewerViewed.emit(event), false);\n    this.nativeElement.addEventListener('zoom', event => this.viewerZoom.emit(event), false);\n    this.nativeElement.addEventListener('zoomed', event => this.viewerZoomed.emit(event), false);\n  }\n\n  public ngOnDestroy(): void {\n    if (this.instance) {\n      this.instance.destroy();\n    }\n  }\n}\n","import { NgModule } from '@angular/core';\nimport { NgxViewer2Directive } from './ngx-viewer2.directive';\n\n\n\n\n\n@NgModule({\n  declarations: [\n    NgxViewer2Directive\n  ],\n  imports: [\n  ],\n  exports: [\n    NgxViewer2Directive\n  ]\n})\nexport class NgxViewer2Module { }\n","/*\n * Public API Surface of ngx-viewer2\n */\n\nexport * from './lib/ngx-viewer2.directive';\nexport * from './lib/ngx-viewer2.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAOa,mBAAmB,CAAA;AAiB9B,IAAA,WAAA,CAAoB,UAAsB,EAAA;QAAtB,IAAU,CAAA,UAAA,GAAV,UAAU;QAhBrB,IAAa,CAAA,aAAA,GAAmB,EAAE;AAEjC,QAAA,IAAA,CAAA,WAAW,GAAwB,IAAI,YAAY,EAAS;AAC5D,QAAA,IAAA,CAAA,UAAU,GAAwB,IAAI,YAAY,EAAS;AAC3D,QAAA,IAAA,CAAA,WAAW,GAAwB,IAAI,YAAY,EAAS;AAC5D,QAAA,IAAA,CAAA,UAAU,GAAwB,IAAI,YAAY,EAAS;AAC3D,QAAA,IAAA,CAAA,YAAY,GAAwB,IAAI,YAAY,EAAS;AAC7D,QAAA,IAAA,CAAA,UAAU,GAAwB,IAAI,YAAY,EAAS;AAC3D,QAAA,IAAA,CAAA,YAAY,GAAwB,I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