@guajiritos/image-picker 20.0.0 → 20.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,21 +3,21 @@ import { Pipe, NgModule, signal, EventEmitter, Input, Output, ViewChild, ChangeD
3
3
  import { ResizeObserver } from 'resize-observer';
4
4
  import * as i2 from '@angular/material/icon';
5
5
  import { MatIconModule } from '@angular/material/icon';
6
- import * as i11 from '@angular/forms';
6
+ import * as i9 from '@angular/forms';
7
7
  import { UntypedFormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
8
8
  import * as i1 from '@angular/material/tooltip';
9
9
  import { MatTooltipModule } from '@angular/material/tooltip';
10
- import * as i7 from '@angular/material/checkbox';
10
+ import * as i5 from '@angular/material/checkbox';
11
11
  import { MatCheckboxModule } from '@angular/material/checkbox';
12
- import * as i6 from '@angular/material/slider';
12
+ import * as i4 from '@angular/material/slider';
13
13
  import { MatSliderModule } from '@angular/material/slider';
14
- import * as i5 from '@angular/material/button';
14
+ import * as i3 from '@angular/material/button';
15
15
  import { MatButtonModule } from '@angular/material/button';
16
- import * as i8 from '@angular/material/form-field';
16
+ import * as i6 from '@angular/material/form-field';
17
17
  import { MatFormFieldModule } from '@angular/material/form-field';
18
- import * as i9 from '@angular/material/input';
18
+ import * as i7 from '@angular/material/input';
19
19
  import { MatInputModule } from '@angular/material/input';
20
- import * as i10 from '@angular/material/select';
20
+ import * as i8 from '@angular/material/select';
21
21
  import { MatSelectModule } from '@angular/material/select';
22
22
  import { NgStyle } from '@angular/common';
23
23
 
@@ -65,10 +65,10 @@ class I18nPipe {
65
65
  transform(key, language) {
66
66
  return language === 'en' ? this.en?.[key] : this.es?.[key];
67
67
  }
68
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: I18nPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
69
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.0.0", ngImport: i0, type: I18nPipe, isStandalone: false, name: "i18n" });
68
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: I18nPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
69
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.21", ngImport: i0, type: I18nPipe, isStandalone: false, name: "i18n" });
70
70
  }
71
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: I18nPipe, decorators: [{
71
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: I18nPipe, decorators: [{
72
72
  type: Pipe,
73
73
  args: [{
74
74
  name: 'i18n',
@@ -88,10 +88,10 @@ class CalculateSizePipe {
88
88
  return 0;
89
89
  }
90
90
  }
91
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CalculateSizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
92
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.0.0", ngImport: i0, type: CalculateSizePipe, isStandalone: false, name: "calculateSize" });
91
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: CalculateSizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
92
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.21", ngImport: i0, type: CalculateSizePipe, isStandalone: false, name: "calculateSize" });
93
93
  }
94
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CalculateSizePipe, decorators: [{
94
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: CalculateSizePipe, decorators: [{
95
95
  type: Pipe,
96
96
  args: [{
97
97
  name: 'calculateSize',
@@ -100,11 +100,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
100
100
  }] });
101
101
 
102
102
  class PipesModule {
103
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: PipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
104
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.0", ngImport: i0, type: PipesModule, declarations: [I18nPipe, CalculateSizePipe], exports: [I18nPipe, CalculateSizePipe] });
105
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: PipesModule });
103
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: PipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
104
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.21", ngImport: i0, type: PipesModule, declarations: [I18nPipe, CalculateSizePipe], exports: [I18nPipe, CalculateSizePipe] });
105
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: PipesModule });
106
106
  }
107
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: PipesModule, decorators: [{
107
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: PipesModule, decorators: [{
108
108
  type: NgModule,
109
109
  args: [{
110
110
  declarations: [I18nPipe, CalculateSizePipe],
@@ -119,7 +119,7 @@ class GuajiritosImagePicker {
119
119
  lastOriginSrc;
120
120
  arrayCopiedImages = [];
121
121
  uuidFilePicker = Date.now().toString(20);
122
- allFormats = ['webp', 'jpeg', 'png'];
122
+ allFormats = ['webp', 'jpeg', 'png', 'svg'];
123
123
  showCrop = new UntypedFormControl({ value: false, disabled: false });
124
124
  maintainAspectRatio = new UntypedFormControl({ value: true, disabled: false });
125
125
  quality = new UntypedFormControl({ value: 70, disabled: false });
@@ -138,13 +138,14 @@ class GuajiritosImagePicker {
138
138
  hideDownloadBtn: false,
139
139
  hideEditBtn: false,
140
140
  hideAddBtn: false,
141
- });
142
- imageSrc = signal(null);
143
- loadImage = signal(false);
144
- noEdit = signal(false);
145
- showEditPanel = signal(false);
146
- imageName = signal('download');
147
- currentLanguage = signal('es');
141
+ }, ...(ngDevMode ? [{ debugName: "config" }] : []));
142
+ imageSrc = signal(null, ...(ngDevMode ? [{ debugName: "imageSrc" }] : []));
143
+ loadImage = signal(false, ...(ngDevMode ? [{ debugName: "loadImage" }] : []));
144
+ noEdit = signal(false, ...(ngDevMode ? [{ debugName: "noEdit" }] : []));
145
+ showEditPanel = signal(false, ...(ngDevMode ? [{ debugName: "showEditPanel" }] : []));
146
+ imageName = signal('download', ...(ngDevMode ? [{ debugName: "imageName" }] : []));
147
+ currentLanguage = signal('es', ...(ngDevMode ? [{ debugName: "currentLanguage" }] : []));
148
+ isVideo = signal(false, ...(ngDevMode ? [{ debugName: "isVideo" }] : []));
148
149
  appearance = 'outline';
149
150
  color = 'primary';
150
151
  imagesAllowed = 'image/*';
@@ -154,6 +155,9 @@ class GuajiritosImagePicker {
154
155
  imageRemoved = new EventEmitter();
155
156
  set base64Image(image) {
156
157
  if (image) {
158
+ // Detectar si es un video
159
+ const isVideoData = this.isVideoContent(image);
160
+ this.isVideo.set(isVideoData);
157
161
  this.imageSrc.set(image);
158
162
  this.arrayCopiedImages = [];
159
163
  this.arrayCopiedImages.push(this.imageSrc());
@@ -161,15 +165,20 @@ class GuajiritosImagePicker {
161
165
  this.lastOriginSrc = image;
162
166
  this.$imageOriginal.next(this.originImageSrc);
163
167
  this.loadImage.set(true);
164
- this.noEdit.set(false);
168
+ this.noEdit.set(isVideoData); // Si es video, no permitir edición
165
169
  }
166
170
  }
167
171
  set _imageSrc(image) {
168
172
  if (image && image !== this.imageSrc()) {
173
+ // Detectar si es un video
174
+ const isVideoData = this.isVideoContent(image);
175
+ this.isVideo.set(isVideoData);
169
176
  let types = image.split('.');
170
177
  this.format.setValue(types[types.length - 1]);
171
- if (!this.format.value || (this.format.value !== 'png' && this.format.value !== 'webp')) {
172
- this.format.setValue('jpeg');
178
+ if (!isVideoData) {
179
+ if (!this.format.value || (this.format.value !== 'png' && this.format.value !== 'webp')) {
180
+ this.format.setValue('jpeg');
181
+ }
173
182
  }
174
183
  this.imageSrc.set(image);
175
184
  this.arrayCopiedImages = [];
@@ -181,6 +190,8 @@ class GuajiritosImagePicker {
181
190
  this.noEdit.set(true);
182
191
  }
183
192
  else if (image && this.imageSrc() && image === this.imageSrc()) {
193
+ const isVideoData = this.isVideoContent(image);
194
+ this.isVideo.set(isVideoData);
184
195
  this.arrayCopiedImages = [];
185
196
  this.arrayCopiedImages.push(this.imageSrc());
186
197
  this.originImageSrc = image;
@@ -204,6 +215,7 @@ class GuajiritosImagePicker {
204
215
  this.cropWidth.setValue(150);
205
216
  this.maintainAspectRatio.setValue(true);
206
217
  this.showEditPanel.set(false);
218
+ this.isVideo.set(false);
207
219
  }
208
220
  }
209
221
  set _config(value) {
@@ -355,22 +367,41 @@ class GuajiritosImagePicker {
355
367
  const files = evt?.target?.files;
356
368
  if (files) {
357
369
  const file = files[0];
358
- if (file?.type?.indexOf('png') !== -1) {
359
- this.format.setValue('png');
360
- }
361
- else if (file?.type?.indexOf('webp') !== -1) {
362
- this.format.setValue('webp');
370
+ // Detectar si es video
371
+ const isVideoFile = file?.type?.startsWith('video/');
372
+ this.isVideo.set(isVideoFile);
373
+ if (isVideoFile) {
374
+ // Para videos, crear URL directamente sin procesamiento
375
+ this.imageName.set(file?.name?.split('.')[0]);
376
+ const reader = new FileReader();
377
+ reader.onload = (e) => {
378
+ this.imageSrc.set(e.target.result);
379
+ this.$imageChanged.next(this.imageSrc());
380
+ this.$imageOriginal.next(this.imageSrc());
381
+ this.loadImage.set(true);
382
+ this.noEdit.set(true); // Deshabilitar edición para videos
383
+ };
384
+ reader.readAsDataURL(file);
363
385
  }
364
386
  else {
365
- this.format.setValue('jpeg');
366
- }
367
- this.imageName.set(file?.name?.split('.')[0]);
368
- this.urlImage = `data:${file?.type};base64,`;
369
- this.noEdit.set(false);
370
- if (files && file) {
371
- const reader = new FileReader();
372
- reader.onload = this.handleReaderLoaded.bind(this);
373
- reader.readAsBinaryString(file);
387
+ // Procesamiento original para imágenes
388
+ if (file?.type?.indexOf('png') !== -1) {
389
+ this.format.setValue('png');
390
+ }
391
+ else if (file?.type?.indexOf('webp') !== -1) {
392
+ this.format.setValue('webp');
393
+ }
394
+ else {
395
+ this.format.setValue('jpeg');
396
+ }
397
+ this.imageName.set(file?.name?.split('.')[0]);
398
+ this.urlImage = `data:${file?.type};base64,`;
399
+ this.noEdit.set(false);
400
+ if (files && file) {
401
+ const reader = new FileReader();
402
+ reader.onload = this.handleReaderLoaded.bind(this);
403
+ reader.readAsBinaryString(file);
404
+ }
374
405
  }
375
406
  }
376
407
  }
@@ -584,12 +615,33 @@ class GuajiritosImagePicker {
584
615
  this.maintainAspectRatio.setValue(true);
585
616
  this.showEditPanel.set(false);
586
617
  this.noEdit.set(false);
618
+ this.isVideo.set(false);
587
619
  this.imageRemoved.emit();
588
620
  }
589
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: GuajiritosImagePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
590
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: GuajiritosImagePicker, isStandalone: true, selector: "guajiritos-image-picker", inputs: { appearance: "appearance", color: "color", imagesAllowed: "imagesAllowed", base64Image: "base64Image", _imageSrc: "_imageSrc", _config: "_config" }, outputs: { $imageChanged: "$imageChanged", $imageOriginal: "$imageOriginal", imageRemoved: "imageRemoved" }, viewQueries: [{ propertyName: "imagePicker", first: true, predicate: ["imagePicker"], descendants: true }], ngImport: i0, template: "@if (!loadImage()) {\n <div class='place-image'>\n <div class='image-holder'\n [ngStyle]='{ width: config()?.width,height: config()?.height,borderRadius: config()?.borderRadius}'>\n <button [matTooltip]=\"'UPLOAD_A_IMAGE' | i18n: config()?.language\" class='image-upload-btn' mat-icon-button\n (click)='onUpload($event)'>\n <mat-icon class='mat-18'>add_a_photo</mat-icon>\n </button>\n <input #imagePicker type='file' class='d-none' [id]=\"'filePicker-' + uuidFilePicker\"\n (change)='handleFileSelect($event)' [accept]='imagesAllowed'>\n </div>\n </div>\n}\n\n\n@if (loadImage()) {\n <div class='place-image'>\n <div class='image-holder-loaded'\n [ngStyle]='{width: config()?.width,height: config()?.height,borderRadius: config()?.borderRadius}'>\n <img [src]='imageSrc()' alt='image-loaded' [ngStyle]='{ borderRadius: config()?.borderRadius }'>\n <input #imagePicker type='file' class='d-none' [id]=\"'filePicker-' + uuidFilePicker\"\n (change)='handleFileSelect($event)' [accept]='imagesAllowed'>\n </div>\n @if (imageSrc()?.length) {\n <p class='mat-caption image-caption' [class.warn]='(imageSrc()?.length | calculateSize) > 200'\n [class.fw-600]='(imageSrc()?.length | calculateSize) > 200'>\n {{\"SIZE\" | i18n: currentLanguage()}}: {{ (imageSrc()?.length | calculateSize) }}Kb &nbsp; {{ format.value }}\n<!-- {{\"FORMAT\" | i18n: currentLanguage()}}: {{ format.value }}-->\n </p>\n }\n\n <div class='editing-bar-btn'>\n @if (!config()?.hideAddBtn) {\n <button id='upload-img' mat-icon-button (click)='onUpload($event)'\n [matTooltip]=\"'UPLOAD_A_IMAGE' | i18n: config()?.language\">\n <mat-icon class='mat-18'>add_a_photo</mat-icon>\n </button>\n }\n @if (!config()?.hideEditBtn && !noEdit()) {\n <button id='edit-img' mat-icon-button (click)='showEditPanel.set(true)'\n [matTooltip]=\"'OPEN_EDITOR_PANEL' | i18n: config()?.language\">\n <mat-icon class='mat-18'>edit</mat-icon>\n </button>\n }\n @if (!config()?.hideDownloadBtn) {\n <a id='download-img' [matTooltip]=\"'DOWNLOAD' | i18n: config()?.language\"\n [href]='imageSrc()' mat-icon-button [download]='imageName()'>\n <mat-icon class='mat-18'>cloud_download</mat-icon>\n </a>\n }\n @if (!config()?.hideDeleteBtn) {\n <button id='delete-img' mat-icon-button (click)='onRemove()'\n [matTooltip]=\"'REMOVE' | i18n: config()?.language\">\n <mat-icon class='mat-18'>delete</mat-icon>\n </button>\n }\n\n\n\n\n </div>\n </div>\n}\n\n@if (showEditPanel()) {\n <div id='popup' class='popup'>\n <div class='popup-clear'>\n <button mat-icon-button (click)='onCloseEditPanel()'>\n <mat-icon class='mat-18'>clear</mat-icon>\n </button>\n </div>\n\n <div class='image-container'>\n <div class='image-holder-full'>\n <img id='image-full' [src]='imageSrc()' alt=''>\n <div id='image-cropper' class='image-cropper'>\n <div id='image-cropper-header'>\n <mat-icon>drag_indicator</mat-icon>\n </div>\n </div>\n </div>\n\n <div class='control-panel'>\n <p class='item-panel fw-600'>{{ 'QUALITY' | i18n: config()?.language }}</p>\n <div class='quality-container'>\n <mat-slider ngDefaultControl [color]='color' class='w-100 mw-100' (change)='onChangeQuality()'\n [max]='100' [min]='0' [step]='1' [discrete]='true' [showTickMarks]='true'>\n <input matSliderThumb [formControl]='quality'>\n </mat-slider>\n </div>\n\n <div class='item-panel'>\n <span class='fw-600'>{{ 'MAX_DIMENSIONS' | i18n: config()?.language }}</span>\n <mat-checkbox class='float-right' [formControl]='maintainAspectRatio' [color]='color'>\n <span>{{ 'ASPECT_RATIO' | i18n: config()?.language }}</span>\n </mat-checkbox>\n </div>\n\n <div class='max-dimension-container'>\n <mat-form-field class='w-48' [appearance]='appearance' [color]='color'>\n <mat-label>{{ 'MAX_WIDTH_PX' | i18n: config()?.language }}</mat-label>\n <input (change)='onChangeSize(true, false)' matInput [placeholder]=\"'MAX_WIDTH_PX' | i18n: config()?.language\"\n [(ngModel)]='maxWidth' type='number' [min]='0' [max]='2000'>\n </mat-form-field>\n\n <mat-form-field class='w-48' [appearance]='appearance' [color]='color'>\n <mat-label>{{ 'MAX_HEIGHT_PX' | i18n: config()?.language }}</mat-label>\n <input (change)='onChangeSize(false, true)' matInput [placeholder]=\"'MAX_HEIGHT_PX' | i18n: config()?.language\"\n [(ngModel)]='maxHeight' type='number' [min]='0' [max]='2000'>\n </mat-form-field>\n </div>\n\n <p class='item-panel fw-600'>{{ 'FORMAT' | i18n: config()?.language }}</p>\n <div class='formats-selection'>\n <mat-form-field class='w-100 mw-100' [appearance]='appearance' [color]='color'>\n <mat-select [formControl]='format' (selectionChange)='onChangeFormat()'>\n @for (format of allFormats; track format) {\n <mat-option [value]='format'>\n {{ format }}\n </mat-option>\n }\n\n </mat-select>\n </mat-form-field>\n </div>\n\n <div class='refresh-container'>\n <mat-checkbox (change)='onCropStateChange()' [formControl]='showCrop' [color]='color'>\n <p class='item-panel fw-600'>{{ 'CROP' | i18n: config()?.language }}</p>\n </mat-checkbox>\n <div class='d-flex '>\n <button class='float-right' mat-icon-button [color]='color' (click)='onRestore()'>\n <mat-icon>refresh</mat-icon>\n </button>\n @if (showCrop.value) {\n <p>\n <button mat-icon-button [color]='color' (click)='onCrop()'>\n <mat-icon>crop</mat-icon>\n </button>\n </p>\n }\n\n </div>\n </div>\n @if (showCrop.value) {\n <ng-container>\n <div class='dimension-container'>\n <mat-form-field class='w-48 mw-48' [appearance]='appearance' [color]='color'>\n <mat-label>{{ 'WIDTH_PX' | i18n: config()?.language }}</mat-label>\n <input (change)='onChangeCrop()' matInput [placeholder]=\"'WIDTH_PX' | i18n: config()?.language\"\n [formControl]='cropWidth' type='number' [min]='0' [max]='2000'>\n </mat-form-field>\n <mat-form-field class='w-48 mw-48' [appearance]='appearance' [color]='color'>\n <mat-label>{{ 'HEIGHT_PX' | i18n: config()?.language }}</mat-label>\n <input (change)='onChangeCrop()' matInput [placeholder]=\"'HEIGHT_PX' | i18n: config()?.language\"\n [formControl]='cropHeight' type='number' [min]='0' [max]='2000'>\n </mat-form-field>\n </div>\n </ng-container>\n }\n\n\n <div class='save-container'>\n <button mat-flat-button (click)='onCloseEditPanel()' [color]='color' class='save-button'>\n {{ 'SAVE' | i18n: config()?.language}}\n </button>\n\n @if (imageSrc()?.length) {\n <p class='mat-caption image-caption'\n [class.warn]='(imageSrc()?.length | calculateSize) > 200'\n [class.fw-600]='(imageSrc()?.length | calculateSize) > 200'>\n<!-- {{\"SIZE\" | i18n: currentLanguage()}}: {{ (imageSrc()?.length | calculateSize) }}Kb &nbsp; {{ format.value }}-->\n {{\"FORMAT\" | i18n: currentLanguage()}}: {{ format.value }}\n </p>\n }\n\n </div>\n </div>\n </div>\n </div>\n}\n\n", styles: [".d-none{display:none}.d-flex{display:flex}.fw-600{font-weight:600}.w-100{width:100%}.mw-100{max-width:100%}.w-48{width:48%}.mw-48{max-width:48%}.float-right{float:right}p{margin:0!important;padding:0!important}.place-image{flex-direction:column;box-sizing:border-box;display:flex;place-content:flex-start;align-items:center}.place-image .image-holder{flex-direction:column;box-sizing:border-box;display:flex;place-content:center;align-items:center;position:relative;width:320px;height:240px;border-radius:16px;max-width:100%!important;background-color:#fff}@media (max-width: 599px){.place-image .image-holder{max-width:100%!important;max-height:250px!important}}.place-image .image-holder .image-upload-btn{transition:all .5s ease;position:relative;opacity:.85;width:50px;height:50px;box-sizing:content-box}.place-image .image-holder .image-upload-btn mat-icon{font-size:50px;width:50px;height:50px;line-height:50px}@media (max-width: 599px){.place-image .image-holder .image-upload-btn{opacity:1;width:30px;height:30px}.place-image .image-holder .image-upload-btn mat-icon{font-size:30px;width:30px;height:30px;line-height:30px}}.place-image .image-holder:hover .image-upload-btn{opacity:1;transition:all .5s ease}.place-image .image-holder-loaded{flex-direction:column;box-sizing:border-box;display:flex;place-content:center;align-items:center;position:relative;max-width:100%!important;width:320px;height:240px;border-radius:4px;padding:2px}.place-image .image-holder-loaded .image-caption{position:absolute;right:0;bottom:-22px}.place-image .image-holder-loaded img{height:100%;max-height:100%;width:100%;max-width:100%;object-fit:contain;object-position:center}@media (max-width: 599px){.place-image .image-holder-loaded{max-height:195px!important}}.place-image .image-holder-loaded .image-upload-btn{transition:all .5s ease;position:relative;opacity:.85;width:50px;height:50px;box-sizing:content-box}.place-image .image-holder-loaded .image-upload-btn mat-icon{font-size:50px;width:50px;height:50px;line-height:50px}@media (max-width: 599px){.place-image .image-holder-loaded .image-upload-btn{opacity:1;width:30px;height:30px}.place-image .image-holder-loaded .image-upload-btn mat-icon{font-size:30px;width:30px;height:30px;line-height:30px}}.place-image .image-holder-loaded:hover .image-upload-btn{opacity:1;transition:all .5s ease}.place-image .editing-bar-btn{margin-top:2px;display:flex;flex-direction:row;box-sizing:border-box;place-content:flex-start;align-items:flex-start}.place-image .editing-bar-btn .mat-icon-button{height:20px;line-height:20px;width:24px}.place-image .editing-bar-btn mat-icon{line-height:20px!important;font-size:20px!important;width:20px!important;height:20px!important}.place-image .editing-bar-btn button,.place-image .editing-bar-btn a{margin:2px}.popup{width:100vw;max-height:100%;height:100%;overflow:auto;position:fixed;top:0;left:0;z-index:1000;padding:24px;color:#fff;box-sizing:border-box;animation-name:show;animation-duration:.4s}.popup .popup-clear{flex-direction:row;box-sizing:border-box;display:flex;place-content:center flex-end;align-items:center}.popup .image-container{margin-top:50px;margin-bottom:50px;height:calc(100vh - 188px);min-height:calc(100vh - 188px);min-width:100%;width:100%;flex-flow:row wrap;box-sizing:border-box;display:flex;place-content:flex-start center;align-items:flex-start}.popup .image-container .image-holder-full{height:auto;width:auto;position:relative;display:contents}.popup img{max-height:600px;max-width:100%;object-fit:contain;object-position:center;margin:8px;transition:all .5s ease}@media (max-width: 1024px){.popup{background-color:#000000d9;padding:8px}.popup img{max-height:100%;max-width:100%}}@media (max-width: 599px){.popup img{margin:0}}.popup .control-panel{color:#000;background-color:#fff;margin:8px;padding:16px;max-width:100%;width:18rem;border-radius:8px;flex-direction:column;box-sizing:border-box;display:flex;place-content:stretch flex-start;align-items:stretch}@media (max-width: 599px){.popup .control-panel{margin:8px 0;width:100%}}.popup .control-panel .title-panel{padding:0 4px;font-size:16px;margin-bottom:16px!important}.popup .control-panel .item-panel{padding:0 4px!important;font-size:12px;display:flex;justify-content:space-between;align-items:center;gap:4px}.popup .control-panel .formats-selection{margin-top:8px!important;flex-direction:row;box-sizing:border-box;display:flex;place-content:flex-start;align-items:flex-start}.popup .control-panel .max-dimension-container{margin-top:16px!important;flex-flow:row;box-sizing:border-box;display:flex;place-content:flex-start space-between;align-items:flex-start}.popup .control-panel .dimension-container{margin-top:8px!important;flex-flow:row wrap;box-sizing:border-box;display:flex;place-content:flex-start space-between;align-items:flex-start}.popup .control-panel .save-container{flex-direction:row;box-sizing:border-box;display:flex;place-content:center space-between;align-items:center}.popup .control-panel .save-container .save-button{padding:0 8px;height:34px;box-sizing:border-box;font-weight:600}.popup .control-panel .quality-container{flex-direction:row;box-sizing:border-box;display:flex;place-content:flex-start;align-items:flex-start}.popup .control-panel .refresh-container{display:flex;justify-content:space-between;align-items:center}.popup .control-panel .refresh-container div{display:flex;align-items:center}@keyframes show{0%{top:-100vh;opacity:0}to{top:0;opacity:1}}.mat-form-field-appearance-fill .mat-form-field-flex{background-color:#fff!important}.mat-select-panel{background:#fff!important}input.mat-input-element{color:#000000d9}.mat-checkbox-background{background-color:#fff}.image-cropper{position:absolute;width:150px;height:150px;border:2.5px solid white;box-sizing:border-box;resize:both;overflow:auto;opacity:0}.image-cropper #image-cropper-header{padding:10px;cursor:move;z-index:10;background-color:transparent;height:85%}.image-cropper #image-cropper-header mat-icon{color:#fff}.btn{padding:4px 8px;border-radius:4px;cursor:pointer}.btn mat-icon{color:#000000d1}\n"], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: PipesModule }, { kind: "pipe", type: I18nPipe, name: "i18n" }, { kind: "pipe", type: CalculateSizePipe, name: "calculateSize" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i5.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatSliderModule }, { kind: "component", type: i6.MatSlider, selector: "mat-slider", inputs: ["disabled", "discrete", "showTickMarks", "min", "color", "disableRipple", "max", "step", "displayWith"], exportAs: ["matSlider"] }, { kind: "directive", type: i6.MatSliderThumb, selector: "input[matSliderThumb]", inputs: ["value"], outputs: ["valueChange", "dragStart", "dragEnd"], exportAs: ["matSliderThumb"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i7.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i8.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i8.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i9.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i10.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i10.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i11.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i11.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i11.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i11.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i11.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i11.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i11.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
621
+ /**
622
+ * Detecta si el contenido es un video basándose en:
623
+ * 1. Data URL que comienza con data:video/
624
+ * 2. Extensión de archivo (.mp4, .webm, .ogg, .mov, etc.)
625
+ */
626
+ isVideoContent(src) {
627
+ if (!src)
628
+ return false;
629
+ // Verificar si es un data URL de video
630
+ if (src.startsWith('data:video/')) {
631
+ return true;
632
+ }
633
+ // Verificar extensiones de video comunes
634
+ const videoExtensions = ['.mp4', '.webm', '.ogg', '.mov', '.avi', '.mkv', '.flv', '.wmv'];
635
+ const lowerSrc = src.toLowerCase();
636
+ return videoExtensions.some(ext => {
637
+ // Verificar si termina con la extensión o si la tiene antes de parámetros de query
638
+ return lowerSrc.endsWith(ext) || lowerSrc.includes(ext + '?');
639
+ });
640
+ }
641
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: GuajiritosImagePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
642
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.21", type: GuajiritosImagePicker, isStandalone: true, selector: "guajiritos-image-picker", inputs: { appearance: "appearance", color: "color", imagesAllowed: "imagesAllowed", base64Image: "base64Image", _imageSrc: "_imageSrc", _config: "_config" }, outputs: { $imageChanged: "$imageChanged", $imageOriginal: "$imageOriginal", imageRemoved: "imageRemoved" }, viewQueries: [{ propertyName: "imagePicker", first: true, predicate: ["imagePicker"], descendants: true }], ngImport: i0, template: "@if (!loadImage()) {\n <div class='place-image'>\n <div class='image-holder'\n [ngStyle]='{ width: config()?.width,height: config()?.height,borderRadius: config()?.borderRadius}'>\n <button [matTooltip]=\"'UPLOAD_A_IMAGE' | i18n: config()?.language\" class='image-upload-btn' mat-icon-button\n (click)='onUpload($event)'>\n <mat-icon class='mat-18'>add_a_photo</mat-icon>\n </button>\n <input #imagePicker type='file' class='d-none' [id]=\"'filePicker-' + uuidFilePicker\"\n (change)='handleFileSelect($event)' [accept]='imagesAllowed'>\n </div>\n </div>\n}\n\n\n@if (loadImage()) {\n <div class='place-image'>\n <div class='image-holder-loaded'\n [ngStyle]='{width: config()?.width,height: config()?.height,borderRadius: config()?.borderRadius}'>\n @if (isVideo()) {\n <video\n [src]='imageSrc()'\n controls\n preload=\"metadata\"\n [ngStyle]='{ borderRadius: config()?.borderRadius, width: \"100%\", height: \"100%\", objectFit: \"cover\" }'>\n Tu navegador no soporta la reproducci\u00F3n de video.\n </video>\n } @else {\n <img [src]='imageSrc()' alt='image-loaded' [ngStyle]='{ borderRadius: config()?.borderRadius }'>\n }\n <input #imagePicker type='file' class='d-none' [id]=\"'filePicker-' + uuidFilePicker\"\n (change)='handleFileSelect($event)' [accept]='imagesAllowed'>\n </div>\n @if (imageSrc()?.length) {\n <p class='mat-caption image-caption' [class.warn]='(imageSrc()?.length | calculateSize) > 200'\n [class.fw-600]='(imageSrc()?.length | calculateSize) > 200'>\n @if (!noEdit()) {\n {{\"SIZE\" | i18n: currentLanguage()}}: {{ (imageSrc()?.length | calculateSize) }}Kb &nbsp; {{ format.value }}\n } @else {\n @if (isVideo()) {\n {{\"FORMAT\" | i18n: currentLanguage()}}: video\n } @else {\n {{\"FORMAT\" | i18n: currentLanguage()}}: {{ format.value }}\n }\n }\n </p>\n }\n\n <div class='editing-bar-btn'>\n @if (!config()?.hideAddBtn) {\n <button id='upload-img' mat-icon-button (click)='onUpload($event)'\n [matTooltip]=\"'UPLOAD_A_IMAGE' | i18n: config()?.language\">\n <mat-icon class='mat-18'>add_a_photo</mat-icon>\n </button>\n }\n @if (!config()?.hideEditBtn && !noEdit()) {\n <button id='edit-img' mat-icon-button (click)='showEditPanel.set(true)'\n [matTooltip]=\"'OPEN_EDITOR_PANEL' | i18n: config()?.language\">\n <mat-icon class='mat-18'>edit</mat-icon>\n </button>\n }\n @if (!config()?.hideDownloadBtn) {\n <a id='download-img' [matTooltip]=\"'DOWNLOAD' | i18n: config()?.language\"\n [href]='imageSrc()' mat-icon-button [download]='imageName()'>\n <mat-icon class='mat-18'>cloud_download</mat-icon>\n </a>\n }\n @if (!config()?.hideDeleteBtn) {\n <button id='delete-img' mat-icon-button (click)='onRemove()'\n [matTooltip]=\"'REMOVE' | i18n: config()?.language\">\n <mat-icon class='mat-18'>delete</mat-icon>\n </button>\n }\n\n\n\n\n </div>\n </div>\n}\n\n@if (showEditPanel()) {\n <div id='popup' class='popup'>\n <div class='popup-clear'>\n <button mat-icon-button (click)='onCloseEditPanel()'>\n <mat-icon class='mat-18'>clear</mat-icon>\n </button>\n </div>\n\n <div class='image-container'>\n <div class='image-holder-full'>\n <img id='image-full' [src]='imageSrc()' alt=''>\n <div id='image-cropper' class='image-cropper'>\n <div id='image-cropper-header'>\n <mat-icon>drag_indicator</mat-icon>\n </div>\n </div>\n </div>\n\n <div class='control-panel'>\n <p class='item-panel fw-600'>{{ 'QUALITY' | i18n: config()?.language }}</p>\n <div class='quality-container'>\n <mat-slider ngDefaultControl [color]='color' class='w-100 mw-100' (change)='onChangeQuality()'\n [max]='100' [min]='0' [step]='1' [discrete]='true' [showTickMarks]='true'>\n <input matSliderThumb [formControl]='quality'>\n </mat-slider>\n </div>\n\n <div class='item-panel'>\n <span class='fw-600'>{{ 'MAX_DIMENSIONS' | i18n: config()?.language }}</span>\n <mat-checkbox class='float-right' [formControl]='maintainAspectRatio' [color]='color'>\n <span>{{ 'ASPECT_RATIO' | i18n: config()?.language }}</span>\n </mat-checkbox>\n </div>\n\n <div class='max-dimension-container'>\n <mat-form-field class='w-48' [appearance]='appearance' [color]='color'>\n <mat-label>{{ 'MAX_WIDTH_PX' | i18n: config()?.language }}</mat-label>\n <input (change)='onChangeSize(true, false)' matInput [placeholder]=\"'MAX_WIDTH_PX' | i18n: config()?.language\"\n [(ngModel)]='maxWidth' type='number' [min]='0' [max]='2000'>\n </mat-form-field>\n\n <mat-form-field class='w-48' [appearance]='appearance' [color]='color'>\n <mat-label>{{ 'MAX_HEIGHT_PX' | i18n: config()?.language }}</mat-label>\n <input (change)='onChangeSize(false, true)' matInput [placeholder]=\"'MAX_HEIGHT_PX' | i18n: config()?.language\"\n [(ngModel)]='maxHeight' type='number' [min]='0' [max]='2000'>\n </mat-form-field>\n </div>\n\n <p class='item-panel fw-600'>{{ 'FORMAT' | i18n: config()?.language }}</p>\n <div class='formats-selection'>\n <mat-form-field class='w-100 mw-100' [appearance]='appearance' [color]='color'>\n <mat-select [formControl]='format' (selectionChange)='onChangeFormat()'>\n @for (format of allFormats; track format) {\n <mat-option [value]='format'>\n {{ format }}\n </mat-option>\n }\n\n </mat-select>\n </mat-form-field>\n </div>\n\n <div class='refresh-container'>\n <mat-checkbox (change)='onCropStateChange()' [formControl]='showCrop' [color]='color'>\n <p class='item-panel fw-600'>{{ 'CROP' | i18n: config()?.language }}</p>\n </mat-checkbox>\n <div class='d-flex '>\n <button class='float-right' mat-icon-button [color]='color' (click)='onRestore()'>\n <mat-icon>refresh</mat-icon>\n </button>\n @if (showCrop.value) {\n <p>\n <button mat-icon-button [color]='color' (click)='onCrop()'>\n <mat-icon>crop</mat-icon>\n </button>\n </p>\n }\n\n </div>\n </div>\n @if (showCrop.value) {\n <ng-container>\n <div class='dimension-container'>\n <mat-form-field class='w-48 mw-48' [appearance]='appearance' [color]='color'>\n <mat-label>{{ 'WIDTH_PX' | i18n: config()?.language }}</mat-label>\n <input (change)='onChangeCrop()' matInput [placeholder]=\"'WIDTH_PX' | i18n: config()?.language\"\n [formControl]='cropWidth' type='number' [min]='0' [max]='2000'>\n </mat-form-field>\n <mat-form-field class='w-48 mw-48' [appearance]='appearance' [color]='color'>\n <mat-label>{{ 'HEIGHT_PX' | i18n: config()?.language }}</mat-label>\n <input (change)='onChangeCrop()' matInput [placeholder]=\"'HEIGHT_PX' | i18n: config()?.language\"\n [formControl]='cropHeight' type='number' [min]='0' [max]='2000'>\n </mat-form-field>\n </div>\n </ng-container>\n }\n\n\n <div class='save-container'>\n <button mat-flat-button (click)='onCloseEditPanel()' [color]='color' class='save-button'>\n {{ 'SAVE' | i18n: config()?.language}}\n </button>\n\n @if (imageSrc()?.length) {\n <p class='mat-caption image-caption'\n [class.warn]='(imageSrc()?.length | calculateSize) > 200'\n [class.fw-600]='(imageSrc()?.length | calculateSize) > 200'>\n<!-- {{\"SIZE\" | i18n: currentLanguage()}}: {{ (imageSrc()?.length | calculateSize) }}Kb &nbsp; {{ format.value }}-->\n {{\"FORMAT\" | i18n: currentLanguage()}}: {{ format.value }}\n </p>\n }\n\n </div>\n </div>\n </div>\n </div>\n}\n\n", styles: [".d-none{display:none}.d-flex{display:flex}.fw-600{font-weight:600}.w-100{width:100%}.mw-100{max-width:100%}.w-48{width:48%}.mw-48{max-width:48%}.float-right{float:right}p{margin:0!important;padding:0!important}.place-image{flex-direction:column;box-sizing:border-box;display:flex;place-content:flex-start;align-items:center}.place-image .image-holder{flex-direction:column;box-sizing:border-box;display:flex;place-content:center;align-items:center;position:relative;width:320px;height:240px;border-radius:16px;max-width:100%!important;background-color:#fff}@media(max-width:599px){.place-image .image-holder{max-width:100%!important;max-height:250px!important}}.place-image .image-holder .image-upload-btn{transition:all .5s ease;position:relative;opacity:.85;width:50px;height:50px;box-sizing:content-box}.place-image .image-holder .image-upload-btn mat-icon{font-size:50px;width:50px;height:50px;line-height:50px}@media(max-width:599px){.place-image .image-holder .image-upload-btn{opacity:1;width:30px;height:30px}.place-image .image-holder .image-upload-btn mat-icon{font-size:30px;width:30px;height:30px;line-height:30px}}.place-image .image-holder:hover .image-upload-btn{opacity:1;transition:all .5s ease}.place-image .image-holder-loaded{flex-direction:column;box-sizing:border-box;display:flex;place-content:center;align-items:center;position:relative;max-width:100%!important;width:320px;height:240px;border-radius:4px;padding:2px}.place-image .image-holder-loaded .image-caption{position:absolute;right:0;bottom:-22px}.place-image .image-holder-loaded img{height:100%;max-height:100%;width:100%;max-width:100%;object-fit:contain;object-position:center}@media(max-width:599px){.place-image .image-holder-loaded{max-height:195px!important}}.place-image .image-holder-loaded .image-upload-btn{transition:all .5s ease;position:relative;opacity:.85;width:50px;height:50px;box-sizing:content-box}.place-image .image-holder-loaded .image-upload-btn mat-icon{font-size:50px;width:50px;height:50px;line-height:50px}@media(max-width:599px){.place-image .image-holder-loaded .image-upload-btn{opacity:1;width:30px;height:30px}.place-image .image-holder-loaded .image-upload-btn mat-icon{font-size:30px;width:30px;height:30px;line-height:30px}}.place-image .image-holder-loaded:hover .image-upload-btn{opacity:1;transition:all .5s ease}.place-image .editing-bar-btn{margin-top:2px;display:flex;flex-direction:row;box-sizing:border-box;place-content:flex-start;align-items:flex-start}.place-image .editing-bar-btn .mat-icon-button{height:20px;line-height:20px;width:24px}.place-image .editing-bar-btn mat-icon{line-height:20px!important;font-size:20px!important;width:20px!important;height:20px!important}.place-image .editing-bar-btn button,.place-image .editing-bar-btn a{margin:2px}.popup{width:100vw;max-height:100%;height:100%;overflow:auto;position:fixed;top:0;left:0;z-index:1000;padding:24px;color:#fff;box-sizing:border-box;animation-name:show;animation-duration:.4s}.popup .popup-clear{flex-direction:row;box-sizing:border-box;display:flex;place-content:center flex-end;align-items:center}.popup .image-container{margin-top:50px;margin-bottom:50px;height:calc(100vh - 188px);min-height:calc(100vh - 188px);min-width:100%;width:100%;flex-flow:row wrap;box-sizing:border-box;display:flex;place-content:flex-start center;align-items:flex-start}.popup .image-container .image-holder-full{height:auto;width:auto;position:relative;display:contents}.popup img{max-height:600px;max-width:100%;object-fit:contain;object-position:center;margin:8px;transition:all .5s ease}@media(max-width:1024px){.popup{background-color:#000000d9;padding:8px}.popup img{max-height:100%;max-width:100%}}@media(max-width:599px){.popup img{margin:0}}.popup .control-panel{color:#000;background-color:#fff;margin:8px;padding:16px;max-width:100%;width:18rem;border-radius:8px;flex-direction:column;box-sizing:border-box;display:flex;place-content:stretch flex-start;align-items:stretch}@media(max-width:599px){.popup .control-panel{margin:8px 0;width:100%}}.popup .control-panel .title-panel{padding:0 4px;font-size:16px;margin-bottom:16px!important}.popup .control-panel .item-panel{padding:0 4px!important;font-size:12px;display:flex;justify-content:space-between;align-items:center;gap:4px}.popup .control-panel .formats-selection{margin-top:8px!important;flex-direction:row;box-sizing:border-box;display:flex;place-content:flex-start;align-items:flex-start}.popup .control-panel .max-dimension-container{margin-top:16px!important;flex-flow:row;box-sizing:border-box;display:flex;place-content:flex-start space-between;align-items:flex-start}.popup .control-panel .dimension-container{margin-top:8px!important;flex-flow:row wrap;box-sizing:border-box;display:flex;place-content:flex-start space-between;align-items:flex-start}.popup .control-panel .save-container{flex-direction:row;box-sizing:border-box;display:flex;place-content:center space-between;align-items:center}.popup .control-panel .save-container .save-button{padding:0 8px;height:34px;box-sizing:border-box;font-weight:600}.popup .control-panel .quality-container{flex-direction:row;box-sizing:border-box;display:flex;place-content:flex-start;align-items:flex-start}.popup .control-panel .refresh-container{display:flex;justify-content:space-between;align-items:center}.popup .control-panel .refresh-container div{display:flex;align-items:center}@keyframes show{0%{top:-100vh;opacity:0}to{top:0;opacity:1}}.mat-form-field-appearance-fill .mat-form-field-flex{background-color:#fff!important}.mat-select-panel{background:#fff!important}input.mat-input-element{color:#000000d9}.mat-checkbox-background{background-color:#fff}.image-cropper{position:absolute;width:150px;height:150px;border:2.5px solid white;box-sizing:border-box;resize:both;overflow:auto;opacity:0}.image-cropper #image-cropper-header{padding:10px;cursor:move;z-index:10;background-color:transparent;height:85%}.image-cropper #image-cropper-header mat-icon{color:#fff}.btn{padding:4px 8px;border-radius:4px;cursor:pointer}.btn mat-icon{color:#000000d1}\n"], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: PipesModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatSliderModule }, { kind: "component", type: i4.MatSlider, selector: "mat-slider", inputs: ["disabled", "discrete", "showTickMarks", "min", "color", "disableRipple", "max", "step", "displayWith"], exportAs: ["matSlider"] }, { kind: "directive", type: i4.MatSliderThumb, selector: "input[matSliderThumb]", inputs: ["value"], outputs: ["valueChange", "dragStart", "dragEnd"], exportAs: ["matSliderThumb"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i5.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i7.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i8.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i8.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i9.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i9.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i9.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i9.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i9.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i9.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: I18nPipe, name: "i18n" }, { kind: "pipe", type: CalculateSizePipe, name: "calculateSize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
591
643
  }
592
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: GuajiritosImagePicker, decorators: [{
644
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: GuajiritosImagePicker, decorators: [{
593
645
  type: Component,
594
646
  args: [{ selector: 'guajiritos-image-picker', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
595
647
  NgStyle,
@@ -604,7 +656,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
604
656
  MatSelectModule,
605
657
  FormsModule,
606
658
  ReactiveFormsModule,
607
- ], template: "@if (!loadImage()) {\n <div class='place-image'>\n <div class='image-holder'\n [ngStyle]='{ width: config()?.width,height: config()?.height,borderRadius: config()?.borderRadius}'>\n <button [matTooltip]=\"'UPLOAD_A_IMAGE' | i18n: config()?.language\" class='image-upload-btn' mat-icon-button\n (click)='onUpload($event)'>\n <mat-icon class='mat-18'>add_a_photo</mat-icon>\n </button>\n <input #imagePicker type='file' class='d-none' [id]=\"'filePicker-' + uuidFilePicker\"\n (change)='handleFileSelect($event)' [accept]='imagesAllowed'>\n </div>\n </div>\n}\n\n\n@if (loadImage()) {\n <div class='place-image'>\n <div class='image-holder-loaded'\n [ngStyle]='{width: config()?.width,height: config()?.height,borderRadius: config()?.borderRadius}'>\n <img [src]='imageSrc()' alt='image-loaded' [ngStyle]='{ borderRadius: config()?.borderRadius }'>\n <input #imagePicker type='file' class='d-none' [id]=\"'filePicker-' + uuidFilePicker\"\n (change)='handleFileSelect($event)' [accept]='imagesAllowed'>\n </div>\n @if (imageSrc()?.length) {\n <p class='mat-caption image-caption' [class.warn]='(imageSrc()?.length | calculateSize) > 200'\n [class.fw-600]='(imageSrc()?.length | calculateSize) > 200'>\n {{\"SIZE\" | i18n: currentLanguage()}}: {{ (imageSrc()?.length | calculateSize) }}Kb &nbsp; {{ format.value }}\n<!-- {{\"FORMAT\" | i18n: currentLanguage()}}: {{ format.value }}-->\n </p>\n }\n\n <div class='editing-bar-btn'>\n @if (!config()?.hideAddBtn) {\n <button id='upload-img' mat-icon-button (click)='onUpload($event)'\n [matTooltip]=\"'UPLOAD_A_IMAGE' | i18n: config()?.language\">\n <mat-icon class='mat-18'>add_a_photo</mat-icon>\n </button>\n }\n @if (!config()?.hideEditBtn && !noEdit()) {\n <button id='edit-img' mat-icon-button (click)='showEditPanel.set(true)'\n [matTooltip]=\"'OPEN_EDITOR_PANEL' | i18n: config()?.language\">\n <mat-icon class='mat-18'>edit</mat-icon>\n </button>\n }\n @if (!config()?.hideDownloadBtn) {\n <a id='download-img' [matTooltip]=\"'DOWNLOAD' | i18n: config()?.language\"\n [href]='imageSrc()' mat-icon-button [download]='imageName()'>\n <mat-icon class='mat-18'>cloud_download</mat-icon>\n </a>\n }\n @if (!config()?.hideDeleteBtn) {\n <button id='delete-img' mat-icon-button (click)='onRemove()'\n [matTooltip]=\"'REMOVE' | i18n: config()?.language\">\n <mat-icon class='mat-18'>delete</mat-icon>\n </button>\n }\n\n\n\n\n </div>\n </div>\n}\n\n@if (showEditPanel()) {\n <div id='popup' class='popup'>\n <div class='popup-clear'>\n <button mat-icon-button (click)='onCloseEditPanel()'>\n <mat-icon class='mat-18'>clear</mat-icon>\n </button>\n </div>\n\n <div class='image-container'>\n <div class='image-holder-full'>\n <img id='image-full' [src]='imageSrc()' alt=''>\n <div id='image-cropper' class='image-cropper'>\n <div id='image-cropper-header'>\n <mat-icon>drag_indicator</mat-icon>\n </div>\n </div>\n </div>\n\n <div class='control-panel'>\n <p class='item-panel fw-600'>{{ 'QUALITY' | i18n: config()?.language }}</p>\n <div class='quality-container'>\n <mat-slider ngDefaultControl [color]='color' class='w-100 mw-100' (change)='onChangeQuality()'\n [max]='100' [min]='0' [step]='1' [discrete]='true' [showTickMarks]='true'>\n <input matSliderThumb [formControl]='quality'>\n </mat-slider>\n </div>\n\n <div class='item-panel'>\n <span class='fw-600'>{{ 'MAX_DIMENSIONS' | i18n: config()?.language }}</span>\n <mat-checkbox class='float-right' [formControl]='maintainAspectRatio' [color]='color'>\n <span>{{ 'ASPECT_RATIO' | i18n: config()?.language }}</span>\n </mat-checkbox>\n </div>\n\n <div class='max-dimension-container'>\n <mat-form-field class='w-48' [appearance]='appearance' [color]='color'>\n <mat-label>{{ 'MAX_WIDTH_PX' | i18n: config()?.language }}</mat-label>\n <input (change)='onChangeSize(true, false)' matInput [placeholder]=\"'MAX_WIDTH_PX' | i18n: config()?.language\"\n [(ngModel)]='maxWidth' type='number' [min]='0' [max]='2000'>\n </mat-form-field>\n\n <mat-form-field class='w-48' [appearance]='appearance' [color]='color'>\n <mat-label>{{ 'MAX_HEIGHT_PX' | i18n: config()?.language }}</mat-label>\n <input (change)='onChangeSize(false, true)' matInput [placeholder]=\"'MAX_HEIGHT_PX' | i18n: config()?.language\"\n [(ngModel)]='maxHeight' type='number' [min]='0' [max]='2000'>\n </mat-form-field>\n </div>\n\n <p class='item-panel fw-600'>{{ 'FORMAT' | i18n: config()?.language }}</p>\n <div class='formats-selection'>\n <mat-form-field class='w-100 mw-100' [appearance]='appearance' [color]='color'>\n <mat-select [formControl]='format' (selectionChange)='onChangeFormat()'>\n @for (format of allFormats; track format) {\n <mat-option [value]='format'>\n {{ format }}\n </mat-option>\n }\n\n </mat-select>\n </mat-form-field>\n </div>\n\n <div class='refresh-container'>\n <mat-checkbox (change)='onCropStateChange()' [formControl]='showCrop' [color]='color'>\n <p class='item-panel fw-600'>{{ 'CROP' | i18n: config()?.language }}</p>\n </mat-checkbox>\n <div class='d-flex '>\n <button class='float-right' mat-icon-button [color]='color' (click)='onRestore()'>\n <mat-icon>refresh</mat-icon>\n </button>\n @if (showCrop.value) {\n <p>\n <button mat-icon-button [color]='color' (click)='onCrop()'>\n <mat-icon>crop</mat-icon>\n </button>\n </p>\n }\n\n </div>\n </div>\n @if (showCrop.value) {\n <ng-container>\n <div class='dimension-container'>\n <mat-form-field class='w-48 mw-48' [appearance]='appearance' [color]='color'>\n <mat-label>{{ 'WIDTH_PX' | i18n: config()?.language }}</mat-label>\n <input (change)='onChangeCrop()' matInput [placeholder]=\"'WIDTH_PX' | i18n: config()?.language\"\n [formControl]='cropWidth' type='number' [min]='0' [max]='2000'>\n </mat-form-field>\n <mat-form-field class='w-48 mw-48' [appearance]='appearance' [color]='color'>\n <mat-label>{{ 'HEIGHT_PX' | i18n: config()?.language }}</mat-label>\n <input (change)='onChangeCrop()' matInput [placeholder]=\"'HEIGHT_PX' | i18n: config()?.language\"\n [formControl]='cropHeight' type='number' [min]='0' [max]='2000'>\n </mat-form-field>\n </div>\n </ng-container>\n }\n\n\n <div class='save-container'>\n <button mat-flat-button (click)='onCloseEditPanel()' [color]='color' class='save-button'>\n {{ 'SAVE' | i18n: config()?.language}}\n </button>\n\n @if (imageSrc()?.length) {\n <p class='mat-caption image-caption'\n [class.warn]='(imageSrc()?.length | calculateSize) > 200'\n [class.fw-600]='(imageSrc()?.length | calculateSize) > 200'>\n<!-- {{\"SIZE\" | i18n: currentLanguage()}}: {{ (imageSrc()?.length | calculateSize) }}Kb &nbsp; {{ format.value }}-->\n {{\"FORMAT\" | i18n: currentLanguage()}}: {{ format.value }}\n </p>\n }\n\n </div>\n </div>\n </div>\n </div>\n}\n\n", styles: [".d-none{display:none}.d-flex{display:flex}.fw-600{font-weight:600}.w-100{width:100%}.mw-100{max-width:100%}.w-48{width:48%}.mw-48{max-width:48%}.float-right{float:right}p{margin:0!important;padding:0!important}.place-image{flex-direction:column;box-sizing:border-box;display:flex;place-content:flex-start;align-items:center}.place-image .image-holder{flex-direction:column;box-sizing:border-box;display:flex;place-content:center;align-items:center;position:relative;width:320px;height:240px;border-radius:16px;max-width:100%!important;background-color:#fff}@media (max-width: 599px){.place-image .image-holder{max-width:100%!important;max-height:250px!important}}.place-image .image-holder .image-upload-btn{transition:all .5s ease;position:relative;opacity:.85;width:50px;height:50px;box-sizing:content-box}.place-image .image-holder .image-upload-btn mat-icon{font-size:50px;width:50px;height:50px;line-height:50px}@media (max-width: 599px){.place-image .image-holder .image-upload-btn{opacity:1;width:30px;height:30px}.place-image .image-holder .image-upload-btn mat-icon{font-size:30px;width:30px;height:30px;line-height:30px}}.place-image .image-holder:hover .image-upload-btn{opacity:1;transition:all .5s ease}.place-image .image-holder-loaded{flex-direction:column;box-sizing:border-box;display:flex;place-content:center;align-items:center;position:relative;max-width:100%!important;width:320px;height:240px;border-radius:4px;padding:2px}.place-image .image-holder-loaded .image-caption{position:absolute;right:0;bottom:-22px}.place-image .image-holder-loaded img{height:100%;max-height:100%;width:100%;max-width:100%;object-fit:contain;object-position:center}@media (max-width: 599px){.place-image .image-holder-loaded{max-height:195px!important}}.place-image .image-holder-loaded .image-upload-btn{transition:all .5s ease;position:relative;opacity:.85;width:50px;height:50px;box-sizing:content-box}.place-image .image-holder-loaded .image-upload-btn mat-icon{font-size:50px;width:50px;height:50px;line-height:50px}@media (max-width: 599px){.place-image .image-holder-loaded .image-upload-btn{opacity:1;width:30px;height:30px}.place-image .image-holder-loaded .image-upload-btn mat-icon{font-size:30px;width:30px;height:30px;line-height:30px}}.place-image .image-holder-loaded:hover .image-upload-btn{opacity:1;transition:all .5s ease}.place-image .editing-bar-btn{margin-top:2px;display:flex;flex-direction:row;box-sizing:border-box;place-content:flex-start;align-items:flex-start}.place-image .editing-bar-btn .mat-icon-button{height:20px;line-height:20px;width:24px}.place-image .editing-bar-btn mat-icon{line-height:20px!important;font-size:20px!important;width:20px!important;height:20px!important}.place-image .editing-bar-btn button,.place-image .editing-bar-btn a{margin:2px}.popup{width:100vw;max-height:100%;height:100%;overflow:auto;position:fixed;top:0;left:0;z-index:1000;padding:24px;color:#fff;box-sizing:border-box;animation-name:show;animation-duration:.4s}.popup .popup-clear{flex-direction:row;box-sizing:border-box;display:flex;place-content:center flex-end;align-items:center}.popup .image-container{margin-top:50px;margin-bottom:50px;height:calc(100vh - 188px);min-height:calc(100vh - 188px);min-width:100%;width:100%;flex-flow:row wrap;box-sizing:border-box;display:flex;place-content:flex-start center;align-items:flex-start}.popup .image-container .image-holder-full{height:auto;width:auto;position:relative;display:contents}.popup img{max-height:600px;max-width:100%;object-fit:contain;object-position:center;margin:8px;transition:all .5s ease}@media (max-width: 1024px){.popup{background-color:#000000d9;padding:8px}.popup img{max-height:100%;max-width:100%}}@media (max-width: 599px){.popup img{margin:0}}.popup .control-panel{color:#000;background-color:#fff;margin:8px;padding:16px;max-width:100%;width:18rem;border-radius:8px;flex-direction:column;box-sizing:border-box;display:flex;place-content:stretch flex-start;align-items:stretch}@media (max-width: 599px){.popup .control-panel{margin:8px 0;width:100%}}.popup .control-panel .title-panel{padding:0 4px;font-size:16px;margin-bottom:16px!important}.popup .control-panel .item-panel{padding:0 4px!important;font-size:12px;display:flex;justify-content:space-between;align-items:center;gap:4px}.popup .control-panel .formats-selection{margin-top:8px!important;flex-direction:row;box-sizing:border-box;display:flex;place-content:flex-start;align-items:flex-start}.popup .control-panel .max-dimension-container{margin-top:16px!important;flex-flow:row;box-sizing:border-box;display:flex;place-content:flex-start space-between;align-items:flex-start}.popup .control-panel .dimension-container{margin-top:8px!important;flex-flow:row wrap;box-sizing:border-box;display:flex;place-content:flex-start space-between;align-items:flex-start}.popup .control-panel .save-container{flex-direction:row;box-sizing:border-box;display:flex;place-content:center space-between;align-items:center}.popup .control-panel .save-container .save-button{padding:0 8px;height:34px;box-sizing:border-box;font-weight:600}.popup .control-panel .quality-container{flex-direction:row;box-sizing:border-box;display:flex;place-content:flex-start;align-items:flex-start}.popup .control-panel .refresh-container{display:flex;justify-content:space-between;align-items:center}.popup .control-panel .refresh-container div{display:flex;align-items:center}@keyframes show{0%{top:-100vh;opacity:0}to{top:0;opacity:1}}.mat-form-field-appearance-fill .mat-form-field-flex{background-color:#fff!important}.mat-select-panel{background:#fff!important}input.mat-input-element{color:#000000d9}.mat-checkbox-background{background-color:#fff}.image-cropper{position:absolute;width:150px;height:150px;border:2.5px solid white;box-sizing:border-box;resize:both;overflow:auto;opacity:0}.image-cropper #image-cropper-header{padding:10px;cursor:move;z-index:10;background-color:transparent;height:85%}.image-cropper #image-cropper-header mat-icon{color:#fff}.btn{padding:4px 8px;border-radius:4px;cursor:pointer}.btn mat-icon{color:#000000d1}\n"] }]
659
+ ], template: "@if (!loadImage()) {\n <div class='place-image'>\n <div class='image-holder'\n [ngStyle]='{ width: config()?.width,height: config()?.height,borderRadius: config()?.borderRadius}'>\n <button [matTooltip]=\"'UPLOAD_A_IMAGE' | i18n: config()?.language\" class='image-upload-btn' mat-icon-button\n (click)='onUpload($event)'>\n <mat-icon class='mat-18'>add_a_photo</mat-icon>\n </button>\n <input #imagePicker type='file' class='d-none' [id]=\"'filePicker-' + uuidFilePicker\"\n (change)='handleFileSelect($event)' [accept]='imagesAllowed'>\n </div>\n </div>\n}\n\n\n@if (loadImage()) {\n <div class='place-image'>\n <div class='image-holder-loaded'\n [ngStyle]='{width: config()?.width,height: config()?.height,borderRadius: config()?.borderRadius}'>\n @if (isVideo()) {\n <video\n [src]='imageSrc()'\n controls\n preload=\"metadata\"\n [ngStyle]='{ borderRadius: config()?.borderRadius, width: \"100%\", height: \"100%\", objectFit: \"cover\" }'>\n Tu navegador no soporta la reproducci\u00F3n de video.\n </video>\n } @else {\n <img [src]='imageSrc()' alt='image-loaded' [ngStyle]='{ borderRadius: config()?.borderRadius }'>\n }\n <input #imagePicker type='file' class='d-none' [id]=\"'filePicker-' + uuidFilePicker\"\n (change)='handleFileSelect($event)' [accept]='imagesAllowed'>\n </div>\n @if (imageSrc()?.length) {\n <p class='mat-caption image-caption' [class.warn]='(imageSrc()?.length | calculateSize) > 200'\n [class.fw-600]='(imageSrc()?.length | calculateSize) > 200'>\n @if (!noEdit()) {\n {{\"SIZE\" | i18n: currentLanguage()}}: {{ (imageSrc()?.length | calculateSize) }}Kb &nbsp; {{ format.value }}\n } @else {\n @if (isVideo()) {\n {{\"FORMAT\" | i18n: currentLanguage()}}: video\n } @else {\n {{\"FORMAT\" | i18n: currentLanguage()}}: {{ format.value }}\n }\n }\n </p>\n }\n\n <div class='editing-bar-btn'>\n @if (!config()?.hideAddBtn) {\n <button id='upload-img' mat-icon-button (click)='onUpload($event)'\n [matTooltip]=\"'UPLOAD_A_IMAGE' | i18n: config()?.language\">\n <mat-icon class='mat-18'>add_a_photo</mat-icon>\n </button>\n }\n @if (!config()?.hideEditBtn && !noEdit()) {\n <button id='edit-img' mat-icon-button (click)='showEditPanel.set(true)'\n [matTooltip]=\"'OPEN_EDITOR_PANEL' | i18n: config()?.language\">\n <mat-icon class='mat-18'>edit</mat-icon>\n </button>\n }\n @if (!config()?.hideDownloadBtn) {\n <a id='download-img' [matTooltip]=\"'DOWNLOAD' | i18n: config()?.language\"\n [href]='imageSrc()' mat-icon-button [download]='imageName()'>\n <mat-icon class='mat-18'>cloud_download</mat-icon>\n </a>\n }\n @if (!config()?.hideDeleteBtn) {\n <button id='delete-img' mat-icon-button (click)='onRemove()'\n [matTooltip]=\"'REMOVE' | i18n: config()?.language\">\n <mat-icon class='mat-18'>delete</mat-icon>\n </button>\n }\n\n\n\n\n </div>\n </div>\n}\n\n@if (showEditPanel()) {\n <div id='popup' class='popup'>\n <div class='popup-clear'>\n <button mat-icon-button (click)='onCloseEditPanel()'>\n <mat-icon class='mat-18'>clear</mat-icon>\n </button>\n </div>\n\n <div class='image-container'>\n <div class='image-holder-full'>\n <img id='image-full' [src]='imageSrc()' alt=''>\n <div id='image-cropper' class='image-cropper'>\n <div id='image-cropper-header'>\n <mat-icon>drag_indicator</mat-icon>\n </div>\n </div>\n </div>\n\n <div class='control-panel'>\n <p class='item-panel fw-600'>{{ 'QUALITY' | i18n: config()?.language }}</p>\n <div class='quality-container'>\n <mat-slider ngDefaultControl [color]='color' class='w-100 mw-100' (change)='onChangeQuality()'\n [max]='100' [min]='0' [step]='1' [discrete]='true' [showTickMarks]='true'>\n <input matSliderThumb [formControl]='quality'>\n </mat-slider>\n </div>\n\n <div class='item-panel'>\n <span class='fw-600'>{{ 'MAX_DIMENSIONS' | i18n: config()?.language }}</span>\n <mat-checkbox class='float-right' [formControl]='maintainAspectRatio' [color]='color'>\n <span>{{ 'ASPECT_RATIO' | i18n: config()?.language }}</span>\n </mat-checkbox>\n </div>\n\n <div class='max-dimension-container'>\n <mat-form-field class='w-48' [appearance]='appearance' [color]='color'>\n <mat-label>{{ 'MAX_WIDTH_PX' | i18n: config()?.language }}</mat-label>\n <input (change)='onChangeSize(true, false)' matInput [placeholder]=\"'MAX_WIDTH_PX' | i18n: config()?.language\"\n [(ngModel)]='maxWidth' type='number' [min]='0' [max]='2000'>\n </mat-form-field>\n\n <mat-form-field class='w-48' [appearance]='appearance' [color]='color'>\n <mat-label>{{ 'MAX_HEIGHT_PX' | i18n: config()?.language }}</mat-label>\n <input (change)='onChangeSize(false, true)' matInput [placeholder]=\"'MAX_HEIGHT_PX' | i18n: config()?.language\"\n [(ngModel)]='maxHeight' type='number' [min]='0' [max]='2000'>\n </mat-form-field>\n </div>\n\n <p class='item-panel fw-600'>{{ 'FORMAT' | i18n: config()?.language }}</p>\n <div class='formats-selection'>\n <mat-form-field class='w-100 mw-100' [appearance]='appearance' [color]='color'>\n <mat-select [formControl]='format' (selectionChange)='onChangeFormat()'>\n @for (format of allFormats; track format) {\n <mat-option [value]='format'>\n {{ format }}\n </mat-option>\n }\n\n </mat-select>\n </mat-form-field>\n </div>\n\n <div class='refresh-container'>\n <mat-checkbox (change)='onCropStateChange()' [formControl]='showCrop' [color]='color'>\n <p class='item-panel fw-600'>{{ 'CROP' | i18n: config()?.language }}</p>\n </mat-checkbox>\n <div class='d-flex '>\n <button class='float-right' mat-icon-button [color]='color' (click)='onRestore()'>\n <mat-icon>refresh</mat-icon>\n </button>\n @if (showCrop.value) {\n <p>\n <button mat-icon-button [color]='color' (click)='onCrop()'>\n <mat-icon>crop</mat-icon>\n </button>\n </p>\n }\n\n </div>\n </div>\n @if (showCrop.value) {\n <ng-container>\n <div class='dimension-container'>\n <mat-form-field class='w-48 mw-48' [appearance]='appearance' [color]='color'>\n <mat-label>{{ 'WIDTH_PX' | i18n: config()?.language }}</mat-label>\n <input (change)='onChangeCrop()' matInput [placeholder]=\"'WIDTH_PX' | i18n: config()?.language\"\n [formControl]='cropWidth' type='number' [min]='0' [max]='2000'>\n </mat-form-field>\n <mat-form-field class='w-48 mw-48' [appearance]='appearance' [color]='color'>\n <mat-label>{{ 'HEIGHT_PX' | i18n: config()?.language }}</mat-label>\n <input (change)='onChangeCrop()' matInput [placeholder]=\"'HEIGHT_PX' | i18n: config()?.language\"\n [formControl]='cropHeight' type='number' [min]='0' [max]='2000'>\n </mat-form-field>\n </div>\n </ng-container>\n }\n\n\n <div class='save-container'>\n <button mat-flat-button (click)='onCloseEditPanel()' [color]='color' class='save-button'>\n {{ 'SAVE' | i18n: config()?.language}}\n </button>\n\n @if (imageSrc()?.length) {\n <p class='mat-caption image-caption'\n [class.warn]='(imageSrc()?.length | calculateSize) > 200'\n [class.fw-600]='(imageSrc()?.length | calculateSize) > 200'>\n<!-- {{\"SIZE\" | i18n: currentLanguage()}}: {{ (imageSrc()?.length | calculateSize) }}Kb &nbsp; {{ format.value }}-->\n {{\"FORMAT\" | i18n: currentLanguage()}}: {{ format.value }}\n </p>\n }\n\n </div>\n </div>\n </div>\n </div>\n}\n\n", styles: [".d-none{display:none}.d-flex{display:flex}.fw-600{font-weight:600}.w-100{width:100%}.mw-100{max-width:100%}.w-48{width:48%}.mw-48{max-width:48%}.float-right{float:right}p{margin:0!important;padding:0!important}.place-image{flex-direction:column;box-sizing:border-box;display:flex;place-content:flex-start;align-items:center}.place-image .image-holder{flex-direction:column;box-sizing:border-box;display:flex;place-content:center;align-items:center;position:relative;width:320px;height:240px;border-radius:16px;max-width:100%!important;background-color:#fff}@media(max-width:599px){.place-image .image-holder{max-width:100%!important;max-height:250px!important}}.place-image .image-holder .image-upload-btn{transition:all .5s ease;position:relative;opacity:.85;width:50px;height:50px;box-sizing:content-box}.place-image .image-holder .image-upload-btn mat-icon{font-size:50px;width:50px;height:50px;line-height:50px}@media(max-width:599px){.place-image .image-holder .image-upload-btn{opacity:1;width:30px;height:30px}.place-image .image-holder .image-upload-btn mat-icon{font-size:30px;width:30px;height:30px;line-height:30px}}.place-image .image-holder:hover .image-upload-btn{opacity:1;transition:all .5s ease}.place-image .image-holder-loaded{flex-direction:column;box-sizing:border-box;display:flex;place-content:center;align-items:center;position:relative;max-width:100%!important;width:320px;height:240px;border-radius:4px;padding:2px}.place-image .image-holder-loaded .image-caption{position:absolute;right:0;bottom:-22px}.place-image .image-holder-loaded img{height:100%;max-height:100%;width:100%;max-width:100%;object-fit:contain;object-position:center}@media(max-width:599px){.place-image .image-holder-loaded{max-height:195px!important}}.place-image .image-holder-loaded .image-upload-btn{transition:all .5s ease;position:relative;opacity:.85;width:50px;height:50px;box-sizing:content-box}.place-image .image-holder-loaded .image-upload-btn mat-icon{font-size:50px;width:50px;height:50px;line-height:50px}@media(max-width:599px){.place-image .image-holder-loaded .image-upload-btn{opacity:1;width:30px;height:30px}.place-image .image-holder-loaded .image-upload-btn mat-icon{font-size:30px;width:30px;height:30px;line-height:30px}}.place-image .image-holder-loaded:hover .image-upload-btn{opacity:1;transition:all .5s ease}.place-image .editing-bar-btn{margin-top:2px;display:flex;flex-direction:row;box-sizing:border-box;place-content:flex-start;align-items:flex-start}.place-image .editing-bar-btn .mat-icon-button{height:20px;line-height:20px;width:24px}.place-image .editing-bar-btn mat-icon{line-height:20px!important;font-size:20px!important;width:20px!important;height:20px!important}.place-image .editing-bar-btn button,.place-image .editing-bar-btn a{margin:2px}.popup{width:100vw;max-height:100%;height:100%;overflow:auto;position:fixed;top:0;left:0;z-index:1000;padding:24px;color:#fff;box-sizing:border-box;animation-name:show;animation-duration:.4s}.popup .popup-clear{flex-direction:row;box-sizing:border-box;display:flex;place-content:center flex-end;align-items:center}.popup .image-container{margin-top:50px;margin-bottom:50px;height:calc(100vh - 188px);min-height:calc(100vh - 188px);min-width:100%;width:100%;flex-flow:row wrap;box-sizing:border-box;display:flex;place-content:flex-start center;align-items:flex-start}.popup .image-container .image-holder-full{height:auto;width:auto;position:relative;display:contents}.popup img{max-height:600px;max-width:100%;object-fit:contain;object-position:center;margin:8px;transition:all .5s ease}@media(max-width:1024px){.popup{background-color:#000000d9;padding:8px}.popup img{max-height:100%;max-width:100%}}@media(max-width:599px){.popup img{margin:0}}.popup .control-panel{color:#000;background-color:#fff;margin:8px;padding:16px;max-width:100%;width:18rem;border-radius:8px;flex-direction:column;box-sizing:border-box;display:flex;place-content:stretch flex-start;align-items:stretch}@media(max-width:599px){.popup .control-panel{margin:8px 0;width:100%}}.popup .control-panel .title-panel{padding:0 4px;font-size:16px;margin-bottom:16px!important}.popup .control-panel .item-panel{padding:0 4px!important;font-size:12px;display:flex;justify-content:space-between;align-items:center;gap:4px}.popup .control-panel .formats-selection{margin-top:8px!important;flex-direction:row;box-sizing:border-box;display:flex;place-content:flex-start;align-items:flex-start}.popup .control-panel .max-dimension-container{margin-top:16px!important;flex-flow:row;box-sizing:border-box;display:flex;place-content:flex-start space-between;align-items:flex-start}.popup .control-panel .dimension-container{margin-top:8px!important;flex-flow:row wrap;box-sizing:border-box;display:flex;place-content:flex-start space-between;align-items:flex-start}.popup .control-panel .save-container{flex-direction:row;box-sizing:border-box;display:flex;place-content:center space-between;align-items:center}.popup .control-panel .save-container .save-button{padding:0 8px;height:34px;box-sizing:border-box;font-weight:600}.popup .control-panel .quality-container{flex-direction:row;box-sizing:border-box;display:flex;place-content:flex-start;align-items:flex-start}.popup .control-panel .refresh-container{display:flex;justify-content:space-between;align-items:center}.popup .control-panel .refresh-container div{display:flex;align-items:center}@keyframes show{0%{top:-100vh;opacity:0}to{top:0;opacity:1}}.mat-form-field-appearance-fill .mat-form-field-flex{background-color:#fff!important}.mat-select-panel{background:#fff!important}input.mat-input-element{color:#000000d9}.mat-checkbox-background{background-color:#fff}.image-cropper{position:absolute;width:150px;height:150px;border:2.5px solid white;box-sizing:border-box;resize:both;overflow:auto;opacity:0}.image-cropper #image-cropper-header{padding:10px;cursor:move;z-index:10;background-color:transparent;height:85%}.image-cropper #image-cropper-header mat-icon{color:#fff}.btn{padding:4px 8px;border-radius:4px;cursor:pointer}.btn mat-icon{color:#000000d1}\n"] }]
608
660
  }], propDecorators: { appearance: [{
609
661
  type: Input
610
662
  }], color: [{
@@ -1 +1 @@
1
- {"version":3,"file":"guajiritos-image-picker.mjs","sources":["../../../projects/guachos-image-picker/src/utils/pipes/i18n/i18n.pipe.ts","../../../projects/guachos-image-picker/src/utils/pipes/calculate-size/calculate-size.pipe.ts","../../../projects/guachos-image-picker/src/utils/pipes/pipes.module.ts","../../../projects/guachos-image-picker/src/lib/guachos-image-picker.component.ts","../../../projects/guachos-image-picker/src/lib/guachos-image-picker.component.html","../../../projects/guachos-image-picker/src/public-api.ts","../../../projects/guachos-image-picker/src/guajiritos-image-picker.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'i18n',\n standalone: false\n})\nexport class I18nPipe implements PipeTransform {\n private en: any = {\n UPLOAD_A_IMAGE: 'Upload an image',\n MUST_EDIT: 'You must edit the image in order to resize it',\n TOO_LARGE: 'too large',\n OPEN_EDITOR_PANEL: 'Open the editor panel',\n DOWNLOAD: 'Download the image',\n CONTROL_PANEL: 'Control Panel',\n QUALITY: 'Quality',\n SAVE: 'Save',\n MAX_DIMENSIONS: 'Max dimensions',\n ASPECT_RATIO: 'Aspect ratio',\n MAX_WIDTH_PX: 'max-width(px)',\n MAX_HEIGHT_PX: 'max-height(px)',\n FORMAT: 'Format',\n CROP: 'Crop',\n WIDTH_PX: 'width(px)',\n HEIGHT_PX: 'height(px)',\n REMOVE: 'Remove',\n SIZE: 'Size'\n };\n\n private es: any = {\n UPLOAD_A_IMAGE: 'Suba una imagen',\n MUST_EDIT: 'Debe editar la imagen para disminuir su tamaño',\n TOO_LARGE: 'muy grande',\n OPEN_EDITOR_PANEL: 'Abra el panel de edición',\n DOWNLOAD: 'Descargue la imagen',\n CONTROL_PANEL: 'Panel de control',\n REMOVE: 'Eliminar',\n SAVE: 'Guardar',\n QUALITY: 'Calidad',\n MAX_DIMENSIONS: 'Dimensiones',\n ASPECT_RATIO: 'Relación-Aspecto',\n MAX_WIDTH_PX: 'max. ancho',\n MAX_HEIGHT_PX: 'max. alto',\n FORMAT: 'Formato',\n CROP: 'Recortar',\n WIDTH_PX: 'ancho(px)',\n HEIGHT_PX: 'altura(px)',\n SIZE: 'Tamaño'\n };\n\n transform(key: string, language: string): string {\n return language === 'en' ? this.en?.[key] : this.es?.[key];\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'calculateSize',\n standalone: false\n})\nexport class CalculateSizePipe implements PipeTransform {\n\n transform(imageLength: number): number {\n if (!imageLength) {\n return 0;\n }\n\n if (imageLength) {\n return Math.ceil(((3 / 4) * imageLength) / 1024);\n } else {\n return 0;\n }\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { I18nPipe } from './i18n/i18n.pipe';\nimport { CalculateSizePipe } from './calculate-size/calculate-size.pipe';\n\n\n@NgModule({\n declarations: [I18nPipe, CalculateSizePipe],\n exports: [I18nPipe, CalculateSizePipe],\n})\nexport class PipesModule { }\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n Output,\n signal,\n ViewChild,\n WritableSignal,\n} from '@angular/core';\nimport { ResizeObserver } from 'resize-observer';\nimport { ResizeObserverEntry } from 'resize-observer/lib/ResizeObserverEntry';\nimport { ThemePalette } from '@angular/material/core';\nimport { MatIconModule } from '@angular/material/icon';\nimport { FormsModule, ReactiveFormsModule, UntypedFormControl } from '@angular/forms';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatSliderModule } from '@angular/material/slider';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatFormFieldAppearance, MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatSelectModule } from '@angular/material/select';\nimport { NgStyle } from '@angular/common';\n\nimport { PipesModule } from '../utils/pipes/pipes.module';\n\nexport interface ImagePickerConf {\n width?: string;\n height?: string;\n borderRadius?: string;\n compressInitial?: boolean;\n language?: string;\n hideDeleteBtn?: boolean;\n hideDownloadBtn?: boolean;\n hideEditBtn?: boolean;\n hideAddBtn?: boolean;\n}\n\nexport interface ImageConverterInput {\n width?: number;\n height?: number;\n quality?: number;\n dataType?: string;\n maintainRatio?: boolean;\n changeHeight?: boolean;\n changeWidth?: boolean;\n}\n\nexport type ImageAllowedTypes =\n 'image/*'\n | '.webp'\n | '.png'\n | '.webp, .jpg, .jpeg'\n | '.webp, .png'\n | '.jpg, .jpeg'\n | '.png, .jpg, .jpeg'\n | '.webp, .png, .jpg, .jpeg';\n\n@Component({\n selector: 'guajiritos-image-picker',\n templateUrl: './guachos-image-picker.component.html',\n styleUrls: ['./guachos-image-picker.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n NgStyle,\n MatTooltipModule,\n MatIconModule,\n PipesModule,\n MatButtonModule,\n MatSliderModule,\n MatCheckboxModule,\n MatFormFieldModule,\n MatInputModule,\n MatSelectModule,\n FormsModule,\n ReactiveFormsModule,\n ]\n})\nexport class GuajiritosImagePicker {\n private observer: any = null;\n private originImageSrc: any;\n private urlImage: string | undefined;\n private lastOriginSrc: any;\n private arrayCopiedImages: any[] = [];\n\n public readonly uuidFilePicker: string = Date.now().toString(20);\n public readonly allFormats: string[] = ['webp', 'jpeg', 'png'];\n public showCrop: UntypedFormControl = new UntypedFormControl({ value: false, disabled: false });\n public maintainAspectRatio: UntypedFormControl = new UntypedFormControl({ value: true, disabled: false });\n public quality: UntypedFormControl = new UntypedFormControl({ value: 70, disabled: false });\n public format: UntypedFormControl = new UntypedFormControl({ value: null, disabled: false });\n public cropHeight: UntypedFormControl = new UntypedFormControl({ value: 150, disabled: false });\n public cropWidth: UntypedFormControl = new UntypedFormControl({ value: 150, disabled: false });\n public maxHeight: number = 2000;\n public maxWidth: number = 2000;\n public config: WritableSignal<ImagePickerConf> = signal({\n height: '240px',\n width: '320px',\n borderRadius: '16px',\n compressInitial: true,\n language: 'es',\n hideDeleteBtn: false,\n hideDownloadBtn: false,\n hideEditBtn: false,\n hideAddBtn: false,\n });\n public imageSrc: WritableSignal<string> = signal(null);\n public loadImage: WritableSignal<boolean> = signal(false);\n public noEdit: WritableSignal<boolean> = signal(false);\n public showEditPanel: WritableSignal<boolean> = signal(false);\n public imageName: WritableSignal<string> = signal('download');\n public currentLanguage: WritableSignal<string> = signal('es');\n\n @Input() appearance: MatFormFieldAppearance = 'outline';\n @Input() color: ThemePalette = 'primary';\n @Input() imagesAllowed: ImageAllowedTypes = 'image/*';\n\n @ViewChild('imagePicker', { static: false }) imagePicker: ElementRef | undefined;\n\n @Output() $imageChanged: EventEmitter<any> = new EventEmitter<any>();\n @Output() $imageOriginal: EventEmitter<any> = new EventEmitter<any>();\n @Output() imageRemoved: EventEmitter<void> = new EventEmitter<void>();\n\n @Input() set base64Image(image: string) {\n if (image) {\n this.imageSrc.set(image);\n this.arrayCopiedImages = [];\n this.arrayCopiedImages.push(this.imageSrc());\n this.originImageSrc = image;\n this.lastOriginSrc = image;\n this.$imageOriginal.next(this.originImageSrc);\n this.loadImage.set(true);\n this.noEdit.set(false);\n }\n }\n\n @Input() set _imageSrc(image: string) {\n if (image && image !== this.imageSrc()) {\n let types: string[] = image.split('.');\n this.format.setValue(types[types.length - 1]);\n\n if (!this.format.value || (this.format.value !== 'png' && this.format.value !== 'webp')) {\n this.format.setValue('jpeg');\n }\n\n this.imageSrc.set(image);\n this.arrayCopiedImages = [];\n this.arrayCopiedImages.push(this.imageSrc());\n this.originImageSrc = image;\n this.lastOriginSrc = image;\n this.$imageOriginal.next(this.originImageSrc);\n this.loadImage.set(true);\n this.noEdit.set(true);\n } else if (image && this.imageSrc() && image === this.imageSrc()) {\n this.arrayCopiedImages = [];\n this.arrayCopiedImages.push(this.imageSrc());\n this.originImageSrc = image;\n this.lastOriginSrc = image;\n this.$imageOriginal.next(this.originImageSrc);\n this.noEdit.set(false);\n this.loadImage.set(true);\n } else {\n this.imageSrc.set(null);\n this.originImageSrc = null;\n this.loadImage.set(false);\n this.noEdit.set(false);\n this.arrayCopiedImages = [];\n this.lastOriginSrc = null;\n this.$imageOriginal.next(null);\n this.format.setValue('jpeg');\n this.maxHeight = 2000;\n this.maxWidth = 2000;\n this.cropHeight.setValue(150);\n this.cropWidth.setValue(150);\n this.maintainAspectRatio.setValue(true);\n this.showEditPanel.set(false);\n }\n }\n\n @Input() set _config(value: ImagePickerConf) {\n if (value && value.constructor == Object) {\n this.config.set({\n ...this.config(),\n ...value,\n });\n }\n }\n\n private async handleReaderLoaded(readerEvt: { target: { result: any; }; }): Promise<void> {\n const binaryString: string = readerEvt.target.result;\n const base64textString: string = btoa(binaryString);\n this.originImageSrc = this.urlImage + base64textString;\n this.lastOriginSrc = this.urlImage + base64textString;\n if (this.config()?.compressInitial) {\n this.quality.setValue(70);\n const input: ImageConverterInput = {\n dataType: this.format.value,\n quality: 0.70,\n maintainRatio: true,\n };\n this.imageSrc.set(await this.resizeDataURL(this.urlImage + base64textString, input));\n } else {\n this.imageSrc.set(this.urlImage + base64textString);\n this.arrayCopiedImages = [];\n this.arrayCopiedImages.push({\n lastImage: this.imageSrc(),\n width: this.maxWidth,\n height: this.maxHeight,\n quality: this.quality.value,\n });\n this.$imageOriginal.next(this.imageSrc());\n }\n this.$imageChanged.next(this.imageSrc());\n this.loadImage.set(true);\n }\n\n private async resizeDataURL(datas: string, input: ImageConverterInput): Promise<any> {\n return await new Promise(async function(resolve): Promise<void> {\n let img: HTMLImageElement = document.createElement('img');\n img.src = datas + '';\n img.crossOrigin = 'Anonymous';\n let quality: number = input?.quality ?? 1.0;\n let maintainRatio: boolean = input.maintainRatio !== undefined ? input.maintainRatio : true;\n\n img.onload = function(): void {\n const canvas: HTMLCanvasElement = document.createElement('canvas');\n const ctx: CanvasRenderingContext2D = canvas.getContext('2d');\n let ratio: number = img.width / img.height;\n let width: number = input?.width ?? img.width;\n let height: number = input?.height ?? img.height;\n\n if (maintainRatio) {\n if (input.changeHeight) {\n canvas.width = height * ratio;\n canvas.height = height;\n } else {\n canvas.width = width;\n canvas.height = width / ratio;\n }\n } else {\n canvas.width = width;\n canvas.height = height;\n }\n\n ctx?.drawImage(img, 0, 0, canvas.width, canvas.height);\n let type: string = input?.dataType ?? 'webp';\n const dataURI: string = canvas.toDataURL(`image/${type}`, quality);\n resolve({\n dataUri: dataURI,\n width: canvas.width,\n height: canvas.height,\n });\n };\n }).then((data: any) => {\n this.maxHeight = data?.height;\n this.maxWidth = data?.width;\n if (this.arrayCopiedImages?.length <= 20) {\n this.arrayCopiedImages.push({\n lastImage: data?.dataUri,\n width: this.maxWidth,\n height: this.maxHeight,\n quality: this.quality.value,\n });\n }\n\n return data.dataUri;\n });\n }\n\n private wait(ms?: number | undefined): Promise<any> {\n ms = ms ?? 1000;\n return new Promise((resolve): void => {\n setTimeout(() => {\n return resolve(true);\n }, ms);\n });\n }\n\n private dragElement(element: HTMLElement): void {\n let pos1: number = 0, pos2: number = 0, pos3: number = 0, pos4: number = 0;\n\n let el: HTMLElement = document.getElementById(element.id + '-header');\n if (el) {\n el.onmousedown = dragMouseDown;\n el.ontouchstart = dragMouseDown;\n } else {\n element.onmousedown = dragMouseDown;\n element.ontouchstart = dragMouseDown;\n }\n\n function dragMouseDown(e: any): void {\n e = e || window.event;\n e?.preventDefault();\n pos3 = e?.clientX;\n pos4 = e?.clientY;\n document.onmouseup = closeDragElement;\n document.ontouchend = closeDragElement;\n document.onmousemove = elementDrag;\n document.ontouchmove = elementDrag;\n }\n\n function elementDrag(e: any): void {\n let holderImage: any = document.getElementById('image-full');\n e = e || window.event;\n e?.preventDefault();\n pos1 = pos3 - e?.clientX;\n pos2 = pos4 - e?.clientY;\n pos3 = e?.clientX;\n pos4 = e?.clientY;\n\n const newTop: number = element.offsetTop - pos2;\n const newLeft: number = element.offsetLeft - pos1;\n const rectHolder = holderImage.getBoundingClientRect();\n const rectElement: DOMRect = element.getBoundingClientRect();\n if (newTop >= rectHolder.y + 8) {\n element.style.top = Math.min(newTop, rectHolder.y + rectHolder.height - rectElement.height - 4) + 'px';\n }\n if (newLeft > rectHolder.x + 4 && rectHolder.x + rectHolder.width > rectElement.x + rectElement.width + 2) {\n element.style.left = Math.min(newLeft, rectHolder.x + rectHolder.width - rectElement.width - 4) + 'px';\n }\n }\n\n function closeDragElement(): void {\n document.onmouseup = null;\n document.onmousemove = null;\n document.ontouchend = null;\n document.ontouchmove = null;\n }\n }\n\n public onUpload(event: { preventDefault: () => void; }): void {\n event.preventDefault();\n this.imagePicker?.nativeElement.click();\n }\n\n public handleFileSelect(evt: any): void {\n const files = evt?.target?.files;\n if (files) {\n const file = files[0];\n\n if (file?.type?.indexOf('png') !== -1) {\n this.format.setValue('png');\n } else if (file?.type?.indexOf('webp') !== -1) {\n this.format.setValue('webp');\n } else {\n this.format.setValue('jpeg');\n }\n\n this.imageName.set(file?.name?.split('.')[0]);\n this.urlImage = `data:${file?.type};base64,`;\n this.noEdit.set(false);\n\n if (files && file) {\n const reader: any = new FileReader();\n reader.onload = this.handleReaderLoaded.bind(this);\n reader.readAsBinaryString(file);\n }\n }\n }\n\n public onCloseEditPanel(): void {\n if (this.observer instanceof ResizeObserver) {\n let imageCropper: any = document.getElementById('image-cropper');\n let imageFull: any = document.getElementById('image-full');\n this.observer.unobserve(imageCropper);\n this.observer.unobserve(imageFull);\n }\n this.showCrop.setValue(false);\n this.showEditPanel.set(false);\n }\n\n public async onChangeQuality(): Promise<void> {\n const qualityItem: number = this.quality.value / 100;\n this.maxHeight = this.maxHeight ?? 2000;\n this.maxWidth = this.maxWidth ?? 2000;\n\n await this.wait(250);\n try {\n const input: ImageConverterInput = {\n height: this.maxHeight,\n width: this.maxWidth,\n dataType: this.format.value,\n quality: qualityItem,\n maintainRatio: this.maintainAspectRatio.value,\n };\n\n this.imageSrc.set(await this.resizeDataURL(this.originImageSrc, input));\n this.$imageChanged.next(this.imageSrc());\n this.loadImage.set(true);\n } catch (error) {\n this.loadImage.set(true);\n }\n }\n\n public async onChangeFormat(): Promise<void> {\n let qualityItem: number = this.quality.value / 100;\n this.maxHeight = this.maxHeight ?? 2000;\n this.maxWidth = this.maxWidth ?? 2000;\n\n await this.wait(250);\n try {\n let input: ImageConverterInput = {\n height: this.maxHeight,\n width: this.maxWidth,\n dataType: this.format.value,\n quality: qualityItem,\n maintainRatio: this.maintainAspectRatio.value,\n };\n this.imageSrc.set(await this.resizeDataURL(this.originImageSrc, input));\n this.$imageChanged.next(this.imageSrc());\n this.loadImage.set(true);\n } catch (error) {\n this.loadImage.set(true);\n }\n }\n\n public async onChangeSize(changeWidth?: any, changeHeight?: any): Promise<void> {\n let qualityItem: number = this.quality.value / 100;\n this.maxHeight = this.maxHeight ?? 2000;\n this.maxWidth = this.maxWidth ?? 2000;\n\n await this.wait(500);\n\n try {\n let input: ImageConverterInput = {\n height: this.maxHeight,\n width: this.maxWidth,\n dataType: this.format.value,\n quality: qualityItem,\n maintainRatio: this.maintainAspectRatio.value,\n changeHeight: changeHeight,\n changeWidth: changeWidth,\n };\n this.imageSrc.set(await this.resizeDataURL(this.originImageSrc, input));\n this.$imageChanged.next(this.imageSrc());\n this.loadImage.set(true);\n } catch (error) {\n this.loadImage.set(true);\n }\n }\n\n public onChangeCrop(): void {\n const cropper: any = document.getElementById('image-cropper');\n cropper.style.width = this.cropWidth.value + 'px';\n cropper.style.height = this.cropHeight.value + 'px';\n }\n\n public onCropStateChange(): void {\n const cropper: HTMLElement = document.getElementById('image-cropper');\n const fullImage: HTMLElement = document.getElementById('image-full');\n const aspectRatio: number = fullImage.offsetWidth / fullImage.offsetHeight;\n\n if (this.showCrop.value) {\n cropper.style.opacity = '1.0';\n this.dragElement(cropper);\n this.observer = new ResizeObserver((entries: ResizeObserverEntry[]): void => {\n entries.forEach((entry: ResizeObserverEntry): void => {\n if (this.showEditPanel()) {\n const elementCropper: HTMLElement = document.getElementById('image-cropper');\n const elementFull: HTMLElement = document.getElementById('image-full');\n\n const rectHolder: DOMRect = elementFull.getBoundingClientRect();\n const rectElement: DOMRect = elementCropper.getBoundingClientRect();\n\n const maxWidth: number = rectHolder.x + rectHolder.width - rectElement.x - 4;\n const maxHeight: number = rectHolder.y + rectHolder.height - rectElement.y - 4;\n\n // Obtener el tamaño del área de recorte seleccionada por el usuario\n const cropWidth: number = elementCropper.offsetWidth;\n const cropHeight: number = elementCropper.offsetHeight;\n\n // Calcular el ancho y el alto del área de recorte manteniendo la relación de aspecto de la imagen original\n let newWidth: number = cropWidth;\n let newHeight: number = cropHeight;\n\n if (this.maintainAspectRatio.value) {\n if (cropWidth / cropHeight > aspectRatio) {\n newHeight = cropWidth / aspectRatio;\n } else {\n newWidth = cropHeight * aspectRatio;\n }\n }\n\n // Ajustar el ancho y el alto del área de recorte si supera los límites\n newWidth = Math.min(newWidth, maxWidth);\n newHeight = Math.min(newHeight, maxHeight);\n\n // Establecer el tamaño y la posición del área de recorte\n elementCropper.style.width = `${newWidth}px`;\n elementCropper.style.height = `${newHeight}px`;\n\n this.cropWidth.setValue(rectElement.width);\n this.cropHeight.setValue(rectElement.height);\n\n if (entry.target.id == 'image-full') {\n if (rectHolder.top > 0) {\n elementCropper.style.top = rectHolder.top + 4 + 'px';\n }\n elementCropper.style.left = rectHolder.left + 4 + 'px';\n }\n }\n });\n });\n this.observer.observe(document.getElementById('image-cropper'));\n this.observer.observe(document.getElementById('image-full'));\n } else {\n cropper.style.opacity = '0.0';\n if (this.observer instanceof ResizeObserver) {\n const elementCropper: HTMLElement = document.getElementById('image-cropper');\n const elementFull: HTMLElement = document.getElementById('image-full');\n this.observer.unobserve(elementCropper);\n this.observer.unobserve(elementFull);\n }\n }\n }\n\n public onCrop(type?: any): void {\n type = type ?? this.format.value;\n const cropper: HTMLElement = document.getElementById('image-cropper');\n const elementFull: HTMLElement = document.getElementById('image-full');\n const rectCropper: DOMRect = cropper.getBoundingClientRect();\n const dataHolderRect: DOMRect = elementFull.getBoundingClientRect();\n const canvas: HTMLCanvasElement = document.createElement('canvas');\n new Promise((resolve, reject): void => {\n let ctx: CanvasRenderingContext2D | null = canvas.getContext('2d');\n let image: HTMLImageElement = new Image();\n image.src = this.imageSrc();\n image.onload = (): void => {\n let ratio: number = image.height / dataHolderRect.height;\n let newWidth: number = rectCropper.width * ratio;\n let newHeight: number = rectCropper.height * ratio;\n canvas.width = newWidth;\n canvas.height = newHeight;\n ctx?.drawImage(\n image,\n Math.abs(rectCropper.x * ratio) - Math.abs(dataHolderRect.x * ratio),\n Math.abs(rectCropper.y * ratio) - Math.abs(dataHolderRect.y * ratio),\n newWidth,\n newHeight,\n 0,\n 0,\n newWidth,\n newHeight,\n );\n\n resolve(canvas.toDataURL(`image/${type}`, this.quality.value));\n };\n image.onerror = (e: string | Event): void => {\n reject(e);\n };\n })\n .then((dataUri: any): void => {\n this.imageSrc.set(dataUri);\n this.showCrop.setValue(false);\n this.onCropStateChange();\n this.maxWidth = canvas?.width;\n this.maxHeight = canvas?.height;\n this.lastOriginSrc = this.originImageSrc + '';\n this.originImageSrc = dataUri;\n this.$imageChanged.next(this.imageSrc());\n })\n .catch((e): void => {\n console.log(e);\n });\n }\n\n public onRestore(): void {\n if (this.arrayCopiedImages.length) {\n let lastState = this.arrayCopiedImages.pop();\n this.imageSrc.set(lastState.lastImage);\n this.maxWidth = lastState.width;\n this.maxHeight = lastState.height;\n this.originImageSrc = this.lastOriginSrc + '';\n this.noEdit.set(false);\n } else {\n this.imageSrc.set(this.lastOriginSrc);\n this.originImageSrc = this.lastOriginSrc + '';\n this.noEdit.set(false);\n }\n\n this.$imageChanged.next(this.imageSrc());\n }\n\n public onRemove(): void {\n this.imageSrc.set(null);\n this.originImageSrc = null;\n this.loadImage.set(false);\n this.arrayCopiedImages = [];\n this.lastOriginSrc = null;\n this.$imageOriginal.next(null);\n this.$imageChanged.next(null);\n this.format.setValue(null);\n this.maxHeight = 2000;\n this.maxWidth = 2000;\n this.cropHeight.setValue(150);\n this.cropWidth.setValue(150);\n this.maintainAspectRatio.setValue(true);\n this.showEditPanel.set(false);\n this.noEdit.set(false);\n this.imageRemoved.emit();\n }\n}\n","@if (!loadImage()) {\n <div class='place-image'>\n <div class='image-holder'\n [ngStyle]='{ width: config()?.width,height: config()?.height,borderRadius: config()?.borderRadius}'>\n <button [matTooltip]=\"'UPLOAD_A_IMAGE' | i18n: config()?.language\" class='image-upload-btn' mat-icon-button\n (click)='onUpload($event)'>\n <mat-icon class='mat-18'>add_a_photo</mat-icon>\n </button>\n <input #imagePicker type='file' class='d-none' [id]=\"'filePicker-' + uuidFilePicker\"\n (change)='handleFileSelect($event)' [accept]='imagesAllowed'>\n </div>\n </div>\n}\n\n\n@if (loadImage()) {\n <div class='place-image'>\n <div class='image-holder-loaded'\n [ngStyle]='{width: config()?.width,height: config()?.height,borderRadius: config()?.borderRadius}'>\n <img [src]='imageSrc()' alt='image-loaded' [ngStyle]='{ borderRadius: config()?.borderRadius }'>\n <input #imagePicker type='file' class='d-none' [id]=\"'filePicker-' + uuidFilePicker\"\n (change)='handleFileSelect($event)' [accept]='imagesAllowed'>\n </div>\n @if (imageSrc()?.length) {\n <p class='mat-caption image-caption' [class.warn]='(imageSrc()?.length | calculateSize) > 200'\n [class.fw-600]='(imageSrc()?.length | calculateSize) > 200'>\n {{\"SIZE\" | i18n: currentLanguage()}}: {{ (imageSrc()?.length | calculateSize) }}Kb &nbsp; {{ format.value }}\n<!-- {{\"FORMAT\" | i18n: currentLanguage()}}: {{ format.value }}-->\n </p>\n }\n\n <div class='editing-bar-btn'>\n @if (!config()?.hideAddBtn) {\n <button id='upload-img' mat-icon-button (click)='onUpload($event)'\n [matTooltip]=\"'UPLOAD_A_IMAGE' | i18n: config()?.language\">\n <mat-icon class='mat-18'>add_a_photo</mat-icon>\n </button>\n }\n @if (!config()?.hideEditBtn && !noEdit()) {\n <button id='edit-img' mat-icon-button (click)='showEditPanel.set(true)'\n [matTooltip]=\"'OPEN_EDITOR_PANEL' | i18n: config()?.language\">\n <mat-icon class='mat-18'>edit</mat-icon>\n </button>\n }\n @if (!config()?.hideDownloadBtn) {\n <a id='download-img' [matTooltip]=\"'DOWNLOAD' | i18n: config()?.language\"\n [href]='imageSrc()' mat-icon-button [download]='imageName()'>\n <mat-icon class='mat-18'>cloud_download</mat-icon>\n </a>\n }\n @if (!config()?.hideDeleteBtn) {\n <button id='delete-img' mat-icon-button (click)='onRemove()'\n [matTooltip]=\"'REMOVE' | i18n: config()?.language\">\n <mat-icon class='mat-18'>delete</mat-icon>\n </button>\n }\n\n\n\n\n </div>\n </div>\n}\n\n@if (showEditPanel()) {\n <div id='popup' class='popup'>\n <div class='popup-clear'>\n <button mat-icon-button (click)='onCloseEditPanel()'>\n <mat-icon class='mat-18'>clear</mat-icon>\n </button>\n </div>\n\n <div class='image-container'>\n <div class='image-holder-full'>\n <img id='image-full' [src]='imageSrc()' alt=''>\n <div id='image-cropper' class='image-cropper'>\n <div id='image-cropper-header'>\n <mat-icon>drag_indicator</mat-icon>\n </div>\n </div>\n </div>\n\n <div class='control-panel'>\n <p class='item-panel fw-600'>{{ 'QUALITY' | i18n: config()?.language }}</p>\n <div class='quality-container'>\n <mat-slider ngDefaultControl [color]='color' class='w-100 mw-100' (change)='onChangeQuality()'\n [max]='100' [min]='0' [step]='1' [discrete]='true' [showTickMarks]='true'>\n <input matSliderThumb [formControl]='quality'>\n </mat-slider>\n </div>\n\n <div class='item-panel'>\n <span class='fw-600'>{{ 'MAX_DIMENSIONS' | i18n: config()?.language }}</span>\n <mat-checkbox class='float-right' [formControl]='maintainAspectRatio' [color]='color'>\n <span>{{ 'ASPECT_RATIO' | i18n: config()?.language }}</span>\n </mat-checkbox>\n </div>\n\n <div class='max-dimension-container'>\n <mat-form-field class='w-48' [appearance]='appearance' [color]='color'>\n <mat-label>{{ 'MAX_WIDTH_PX' | i18n: config()?.language }}</mat-label>\n <input (change)='onChangeSize(true, false)' matInput [placeholder]=\"'MAX_WIDTH_PX' | i18n: config()?.language\"\n [(ngModel)]='maxWidth' type='number' [min]='0' [max]='2000'>\n </mat-form-field>\n\n <mat-form-field class='w-48' [appearance]='appearance' [color]='color'>\n <mat-label>{{ 'MAX_HEIGHT_PX' | i18n: config()?.language }}</mat-label>\n <input (change)='onChangeSize(false, true)' matInput [placeholder]=\"'MAX_HEIGHT_PX' | i18n: config()?.language\"\n [(ngModel)]='maxHeight' type='number' [min]='0' [max]='2000'>\n </mat-form-field>\n </div>\n\n <p class='item-panel fw-600'>{{ 'FORMAT' | i18n: config()?.language }}</p>\n <div class='formats-selection'>\n <mat-form-field class='w-100 mw-100' [appearance]='appearance' [color]='color'>\n <mat-select [formControl]='format' (selectionChange)='onChangeFormat()'>\n @for (format of allFormats; track format) {\n <mat-option [value]='format'>\n {{ format }}\n </mat-option>\n }\n\n </mat-select>\n </mat-form-field>\n </div>\n\n <div class='refresh-container'>\n <mat-checkbox (change)='onCropStateChange()' [formControl]='showCrop' [color]='color'>\n <p class='item-panel fw-600'>{{ 'CROP' | i18n: config()?.language }}</p>\n </mat-checkbox>\n <div class='d-flex '>\n <button class='float-right' mat-icon-button [color]='color' (click)='onRestore()'>\n <mat-icon>refresh</mat-icon>\n </button>\n @if (showCrop.value) {\n <p>\n <button mat-icon-button [color]='color' (click)='onCrop()'>\n <mat-icon>crop</mat-icon>\n </button>\n </p>\n }\n\n </div>\n </div>\n @if (showCrop.value) {\n <ng-container>\n <div class='dimension-container'>\n <mat-form-field class='w-48 mw-48' [appearance]='appearance' [color]='color'>\n <mat-label>{{ 'WIDTH_PX' | i18n: config()?.language }}</mat-label>\n <input (change)='onChangeCrop()' matInput [placeholder]=\"'WIDTH_PX' | i18n: config()?.language\"\n [formControl]='cropWidth' type='number' [min]='0' [max]='2000'>\n </mat-form-field>\n <mat-form-field class='w-48 mw-48' [appearance]='appearance' [color]='color'>\n <mat-label>{{ 'HEIGHT_PX' | i18n: config()?.language }}</mat-label>\n <input (change)='onChangeCrop()' matInput [placeholder]=\"'HEIGHT_PX' | i18n: config()?.language\"\n [formControl]='cropHeight' type='number' [min]='0' [max]='2000'>\n </mat-form-field>\n </div>\n </ng-container>\n }\n\n\n <div class='save-container'>\n <button mat-flat-button (click)='onCloseEditPanel()' [color]='color' class='save-button'>\n {{ 'SAVE' | i18n: config()?.language}}\n </button>\n\n @if (imageSrc()?.length) {\n <p class='mat-caption image-caption'\n [class.warn]='(imageSrc()?.length | calculateSize) > 200'\n [class.fw-600]='(imageSrc()?.length | calculateSize) > 200'>\n<!-- {{\"SIZE\" | i18n: currentLanguage()}}: {{ (imageSrc()?.length | calculateSize) }}Kb &nbsp; {{ format.value }}-->\n {{\"FORMAT\" | i18n: currentLanguage()}}: {{ format.value }}\n </p>\n }\n\n </div>\n </div>\n </div>\n </div>\n}\n\n","/*\n * Public API Surface of guachos-image-picker\n */\n\nexport * from './lib/guachos-image-picker.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i3.I18nPipe","i4.CalculateSizePipe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;MAMa,QAAQ,CAAA;AACX,IAAA,EAAE,GAAQ;AAChB,QAAA,cAAc,EAAE,iBAAiB;AACjC,QAAA,SAAS,EAAE,+CAA+C;AAC1D,QAAA,SAAS,EAAE,WAAW;AACtB,QAAA,iBAAiB,EAAE,uBAAuB;AAC1C,QAAA,QAAQ,EAAE,oBAAoB;AAC9B,QAAA,aAAa,EAAE,eAAe;AAC9B,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,IAAI,EAAE,MAAM;AACZ,QAAA,cAAc,EAAE,gBAAgB;AAChC,QAAA,YAAY,EAAE,cAAc;AAC5B,QAAA,YAAY,EAAE,eAAe;AAC7B,QAAA,aAAa,EAAE,gBAAgB;AAC/B,QAAA,MAAM,EAAE,QAAQ;AAChB,QAAA,IAAI,EAAE,MAAM;AACZ,QAAA,QAAQ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AAA,aAAA,EAAA,UAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAGd,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBApBjC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,yBAAyB,EAGlB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EACtC,OAAA,EAAA;wBACL,OAAO;wBACP,gBAAgB;wBAChB,aAAa;wBACb,WAAW;wBACX,eAAe;wBACf,eAAe;wBACf,iBAAiB;wBACjB,kBAAkB;wBAClB,cAAc;wBACd,eAAe;wBACf,WAAW;wBACX,mBAAmB;AACtB,qBAAA,EAAA,QAAA,EAAA,80PAAA,EAAA,MAAA,EAAA,CAAA,+7LAAA,CAAA,EAAA;8BAqCM,UAAU,EAAA,CAAA;sBAAlB;gBACQ,KAAK,EAAA,CAAA;sBAAb;gBACQ,aAAa,EAAA,CAAA;sBAArB;gBAE4C,WAAW,EAAA,CAAA;sBAAvD,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,aAAa,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;gBAEjC,aAAa,EAAA,CAAA;sBAAtB;gBACS,cAAc,EAAA,CAAA;sBAAvB;gBACS,YAAY,EAAA,CAAA;sBAArB;gBAEY,WAAW,EAAA,CAAA;sBAAvB;gBAaY,SAAS,EAAA,CAAA;sBAArB;gBA2CY,OAAO,EAAA,CAAA;sBAAnB;;;AEpLH;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"guajiritos-image-picker.mjs","sources":["../../../projects/guachos-image-picker/src/utils/pipes/i18n/i18n.pipe.ts","../../../projects/guachos-image-picker/src/utils/pipes/calculate-size/calculate-size.pipe.ts","../../../projects/guachos-image-picker/src/utils/pipes/pipes.module.ts","../../../projects/guachos-image-picker/src/lib/guachos-image-picker.component.ts","../../../projects/guachos-image-picker/src/lib/guachos-image-picker.component.html","../../../projects/guachos-image-picker/src/public-api.ts","../../../projects/guachos-image-picker/src/guajiritos-image-picker.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'i18n',\n standalone: false\n})\nexport class I18nPipe implements PipeTransform {\n private en: any = {\n UPLOAD_A_IMAGE: 'Upload an image',\n MUST_EDIT: 'You must edit the image in order to resize it',\n TOO_LARGE: 'too large',\n OPEN_EDITOR_PANEL: 'Open the editor panel',\n DOWNLOAD: 'Download the image',\n CONTROL_PANEL: 'Control Panel',\n QUALITY: 'Quality',\n SAVE: 'Save',\n MAX_DIMENSIONS: 'Max dimensions',\n ASPECT_RATIO: 'Aspect ratio',\n MAX_WIDTH_PX: 'max-width(px)',\n MAX_HEIGHT_PX: 'max-height(px)',\n FORMAT: 'Format',\n CROP: 'Crop',\n WIDTH_PX: 'width(px)',\n HEIGHT_PX: 'height(px)',\n REMOVE: 'Remove',\n SIZE: 'Size'\n };\n\n private es: any = {\n UPLOAD_A_IMAGE: 'Suba una imagen',\n MUST_EDIT: 'Debe editar la imagen para disminuir su tamaño',\n TOO_LARGE: 'muy grande',\n OPEN_EDITOR_PANEL: 'Abra el panel de edición',\n DOWNLOAD: 'Descargue la imagen',\n CONTROL_PANEL: 'Panel de control',\n REMOVE: 'Eliminar',\n SAVE: 'Guardar',\n QUALITY: 'Calidad',\n MAX_DIMENSIONS: 'Dimensiones',\n ASPECT_RATIO: 'Relación-Aspecto',\n MAX_WIDTH_PX: 'max. ancho',\n MAX_HEIGHT_PX: 'max. alto',\n FORMAT: 'Formato',\n CROP: 'Recortar',\n WIDTH_PX: 'ancho(px)',\n HEIGHT_PX: 'altura(px)',\n SIZE: 'Tamaño'\n };\n\n transform(key: string, language: string): string {\n return language === 'en' ? this.en?.[key] : this.es?.[key];\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'calculateSize',\n standalone: false\n})\nexport class CalculateSizePipe implements PipeTransform {\n\n transform(imageLength: number): number {\n if (!imageLength) {\n return 0;\n }\n\n if (imageLength) {\n return Math.ceil(((3 / 4) * imageLength) / 1024);\n } else {\n return 0;\n }\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { I18nPipe } from './i18n/i18n.pipe';\nimport { CalculateSizePipe } from './calculate-size/calculate-size.pipe';\n\n\n@NgModule({\n declarations: [I18nPipe, CalculateSizePipe],\n exports: [I18nPipe, CalculateSizePipe],\n})\nexport class PipesModule { }\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n Output,\n signal,\n ViewChild,\n WritableSignal,\n} from '@angular/core';\nimport { ResizeObserver } from 'resize-observer';\nimport { ResizeObserverEntry } from 'resize-observer/lib/ResizeObserverEntry';\nimport { ThemePalette } from '@angular/material/core';\nimport { MatIconModule } from '@angular/material/icon';\nimport { FormsModule, ReactiveFormsModule, UntypedFormControl } from '@angular/forms';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatSliderModule } from '@angular/material/slider';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatFormFieldAppearance, MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatSelectModule } from '@angular/material/select';\nimport { NgStyle } from '@angular/common';\n\nimport { PipesModule } from '../utils/pipes/pipes.module';\n\nexport interface ImagePickerConf {\n width?: string;\n height?: string;\n borderRadius?: string;\n compressInitial?: boolean;\n language?: string;\n hideDeleteBtn?: boolean;\n hideDownloadBtn?: boolean;\n hideEditBtn?: boolean;\n hideAddBtn?: boolean;\n}\n\nexport interface ImageConverterInput {\n width?: number;\n height?: number;\n quality?: number;\n dataType?: string;\n maintainRatio?: boolean;\n changeHeight?: boolean;\n changeWidth?: boolean;\n}\n\nexport type ImageAllowedTypes =\n 'image/*'\n | 'video/*'\n | 'image/*, video/*'\n | '.webp'\n | '.png'\n | '.svg'\n | '.webp, .jpg, .jpeg'\n | '.webp, .png'\n | '.jpg, .jpeg'\n | '.png, .jpg, .jpeg'\n | '.webp, .png, .jpg, .jpeg'\n | '.mp4, .webm, .ogg'\n | '.webp, .png, .jpg, .jpeg, .mp4, .webm, .ogg';\n\n@Component({\n selector: 'guajiritos-image-picker',\n templateUrl: './guachos-image-picker.component.html',\n styleUrls: ['./guachos-image-picker.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n NgStyle,\n MatTooltipModule,\n MatIconModule,\n PipesModule,\n MatButtonModule,\n MatSliderModule,\n MatCheckboxModule,\n MatFormFieldModule,\n MatInputModule,\n MatSelectModule,\n FormsModule,\n ReactiveFormsModule,\n ]\n})\nexport class GuajiritosImagePicker {\n private observer: any = null;\n private originImageSrc: any;\n private urlImage: string | undefined;\n private lastOriginSrc: any;\n private arrayCopiedImages: any[] = [];\n\n public readonly uuidFilePicker: string = Date.now().toString(20);\n public readonly allFormats: string[] = ['webp', 'jpeg', 'png', 'svg'];\n public showCrop: UntypedFormControl = new UntypedFormControl({ value: false, disabled: false });\n public maintainAspectRatio: UntypedFormControl = new UntypedFormControl({ value: true, disabled: false });\n public quality: UntypedFormControl = new UntypedFormControl({ value: 70, disabled: false });\n public format: UntypedFormControl = new UntypedFormControl({ value: null, disabled: false });\n public cropHeight: UntypedFormControl = new UntypedFormControl({ value: 150, disabled: false });\n public cropWidth: UntypedFormControl = new UntypedFormControl({ value: 150, disabled: false });\n public maxHeight: number = 2000;\n public maxWidth: number = 2000;\n public config: WritableSignal<ImagePickerConf> = signal({\n height: '240px',\n width: '320px',\n borderRadius: '16px',\n compressInitial: true,\n language: 'es',\n hideDeleteBtn: false,\n hideDownloadBtn: false,\n hideEditBtn: false,\n hideAddBtn: false,\n });\n public imageSrc: WritableSignal<string> = signal(null);\n public loadImage: WritableSignal<boolean> = signal(false);\n public noEdit: WritableSignal<boolean> = signal(false);\n public showEditPanel: WritableSignal<boolean> = signal(false);\n public imageName: WritableSignal<string> = signal('download');\n public currentLanguage: WritableSignal<string> = signal('es');\n public isVideo: WritableSignal<boolean> = signal(false);\n\n @Input() appearance: MatFormFieldAppearance = 'outline';\n @Input() color: ThemePalette = 'primary';\n @Input() imagesAllowed: ImageAllowedTypes = 'image/*';\n\n @ViewChild('imagePicker', { static: false }) imagePicker: ElementRef | undefined;\n\n @Output() $imageChanged: EventEmitter<any> = new EventEmitter<any>();\n @Output() $imageOriginal: EventEmitter<any> = new EventEmitter<any>();\n @Output() imageRemoved: EventEmitter<void> = new EventEmitter<void>();\n\n @Input() set base64Image(image: string) {\n if (image) {\n // Detectar si es un video\n const isVideoData = this.isVideoContent(image);\n this.isVideo.set(isVideoData);\n\n this.imageSrc.set(image);\n this.arrayCopiedImages = [];\n this.arrayCopiedImages.push(this.imageSrc());\n this.originImageSrc = image;\n this.lastOriginSrc = image;\n this.$imageOriginal.next(this.originImageSrc);\n this.loadImage.set(true);\n this.noEdit.set(isVideoData); // Si es video, no permitir edición\n }\n }\n\n @Input() set _imageSrc(image: string) {\n if (image && image !== this.imageSrc()) {\n // Detectar si es un video\n const isVideoData = this.isVideoContent(image);\n this.isVideo.set(isVideoData);\n\n let types: string[] = image.split('.');\n this.format.setValue(types[types.length - 1]);\n\n if (!isVideoData) {\n if (!this.format.value || (this.format.value !== 'png' && this.format.value !== 'webp')) {\n this.format.setValue('jpeg');\n }\n }\n\n this.imageSrc.set(image);\n this.arrayCopiedImages = [];\n this.arrayCopiedImages.push(this.imageSrc());\n this.originImageSrc = image;\n this.lastOriginSrc = image;\n this.$imageOriginal.next(this.originImageSrc);\n this.loadImage.set(true);\n this.noEdit.set(true);\n } else if (image && this.imageSrc() && image === this.imageSrc()) {\n const isVideoData = this.isVideoContent(image);\n this.isVideo.set(isVideoData);\n\n this.arrayCopiedImages = [];\n this.arrayCopiedImages.push(this.imageSrc());\n this.originImageSrc = image;\n this.lastOriginSrc = image;\n this.$imageOriginal.next(this.originImageSrc);\n this.noEdit.set(false);\n this.loadImage.set(true);\n } else {\n this.imageSrc.set(null);\n this.originImageSrc = null;\n this.loadImage.set(false);\n this.noEdit.set(false);\n this.arrayCopiedImages = [];\n this.lastOriginSrc = null;\n this.$imageOriginal.next(null);\n this.format.setValue('jpeg');\n this.maxHeight = 2000;\n this.maxWidth = 2000;\n this.cropHeight.setValue(150);\n this.cropWidth.setValue(150);\n this.maintainAspectRatio.setValue(true);\n this.showEditPanel.set(false);\n this.isVideo.set(false);\n }\n }\n\n @Input() set _config(value: ImagePickerConf) {\n if (value && value.constructor == Object) {\n this.config.set({\n ...this.config(),\n ...value,\n });\n }\n }\n\n private async handleReaderLoaded(readerEvt: { target: { result: any; }; }): Promise<void> {\n const binaryString: string = readerEvt.target.result;\n const base64textString: string = btoa(binaryString);\n this.originImageSrc = this.urlImage + base64textString;\n this.lastOriginSrc = this.urlImage + base64textString;\n if (this.config()?.compressInitial) {\n this.quality.setValue(70);\n const input: ImageConverterInput = {\n dataType: this.format.value,\n quality: 0.70,\n maintainRatio: true,\n };\n this.imageSrc.set(await this.resizeDataURL(this.urlImage + base64textString, input));\n } else {\n this.imageSrc.set(this.urlImage + base64textString);\n this.arrayCopiedImages = [];\n this.arrayCopiedImages.push({\n lastImage: this.imageSrc(),\n width: this.maxWidth,\n height: this.maxHeight,\n quality: this.quality.value,\n });\n this.$imageOriginal.next(this.imageSrc());\n }\n this.$imageChanged.next(this.imageSrc());\n this.loadImage.set(true);\n }\n\n private async resizeDataURL(datas: string, input: ImageConverterInput): Promise<any> {\n return await new Promise(async function(resolve): Promise<void> {\n let img: HTMLImageElement = document.createElement('img');\n img.src = datas + '';\n img.crossOrigin = 'Anonymous';\n let quality: number = input?.quality ?? 1.0;\n let maintainRatio: boolean = input.maintainRatio !== undefined ? input.maintainRatio : true;\n\n img.onload = function(): void {\n const canvas: HTMLCanvasElement = document.createElement('canvas');\n const ctx: CanvasRenderingContext2D = canvas.getContext('2d');\n let ratio: number = img.width / img.height;\n let width: number = input?.width ?? img.width;\n let height: number = input?.height ?? img.height;\n\n if (maintainRatio) {\n if (input.changeHeight) {\n canvas.width = height * ratio;\n canvas.height = height;\n } else {\n canvas.width = width;\n canvas.height = width / ratio;\n }\n } else {\n canvas.width = width;\n canvas.height = height;\n }\n\n ctx?.drawImage(img, 0, 0, canvas.width, canvas.height);\n let type: string = input?.dataType ?? 'webp';\n const dataURI: string = canvas.toDataURL(`image/${type}`, quality);\n resolve({\n dataUri: dataURI,\n width: canvas.width,\n height: canvas.height,\n });\n };\n }).then((data: any) => {\n this.maxHeight = data?.height;\n this.maxWidth = data?.width;\n if (this.arrayCopiedImages?.length <= 20) {\n this.arrayCopiedImages.push({\n lastImage: data?.dataUri,\n width: this.maxWidth,\n height: this.maxHeight,\n quality: this.quality.value,\n });\n }\n\n return data.dataUri;\n });\n }\n\n private wait(ms?: number | undefined): Promise<any> {\n ms = ms ?? 1000;\n return new Promise((resolve): void => {\n setTimeout(() => {\n return resolve(true);\n }, ms);\n });\n }\n\n private dragElement(element: HTMLElement): void {\n let pos1: number = 0, pos2: number = 0, pos3: number = 0, pos4: number = 0;\n\n let el: HTMLElement = document.getElementById(element.id + '-header');\n if (el) {\n el.onmousedown = dragMouseDown;\n el.ontouchstart = dragMouseDown;\n } else {\n element.onmousedown = dragMouseDown;\n element.ontouchstart = dragMouseDown;\n }\n\n function dragMouseDown(e: any): void {\n e = e || window.event;\n e?.preventDefault();\n pos3 = e?.clientX;\n pos4 = e?.clientY;\n document.onmouseup = closeDragElement;\n document.ontouchend = closeDragElement;\n document.onmousemove = elementDrag;\n document.ontouchmove = elementDrag;\n }\n\n function elementDrag(e: any): void {\n let holderImage: any = document.getElementById('image-full');\n e = e || window.event;\n e?.preventDefault();\n pos1 = pos3 - e?.clientX;\n pos2 = pos4 - e?.clientY;\n pos3 = e?.clientX;\n pos4 = e?.clientY;\n\n const newTop: number = element.offsetTop - pos2;\n const newLeft: number = element.offsetLeft - pos1;\n const rectHolder = holderImage.getBoundingClientRect();\n const rectElement: DOMRect = element.getBoundingClientRect();\n if (newTop >= rectHolder.y + 8) {\n element.style.top = Math.min(newTop, rectHolder.y + rectHolder.height - rectElement.height - 4) + 'px';\n }\n if (newLeft > rectHolder.x + 4 && rectHolder.x + rectHolder.width > rectElement.x + rectElement.width + 2) {\n element.style.left = Math.min(newLeft, rectHolder.x + rectHolder.width - rectElement.width - 4) + 'px';\n }\n }\n\n function closeDragElement(): void {\n document.onmouseup = null;\n document.onmousemove = null;\n document.ontouchend = null;\n document.ontouchmove = null;\n }\n }\n\n public onUpload(event: { preventDefault: () => void; }): void {\n event.preventDefault();\n this.imagePicker?.nativeElement.click();\n }\n\n public handleFileSelect(evt: any): void {\n const files = evt?.target?.files;\n if (files) {\n const file = files[0];\n\n // Detectar si es video\n const isVideoFile = file?.type?.startsWith('video/');\n this.isVideo.set(isVideoFile);\n\n if (isVideoFile) {\n // Para videos, crear URL directamente sin procesamiento\n this.imageName.set(file?.name?.split('.')[0]);\n const reader: any = new FileReader();\n reader.onload = (e: any): void => {\n this.imageSrc.set(e.target.result);\n this.$imageChanged.next(this.imageSrc());\n this.$imageOriginal.next(this.imageSrc());\n this.loadImage.set(true);\n this.noEdit.set(true); // Deshabilitar edición para videos\n };\n reader.readAsDataURL(file);\n } else {\n // Procesamiento original para imágenes\n if (file?.type?.indexOf('png') !== -1) {\n this.format.setValue('png');\n } else if (file?.type?.indexOf('webp') !== -1) {\n this.format.setValue('webp');\n } else {\n this.format.setValue('jpeg');\n }\n\n this.imageName.set(file?.name?.split('.')[0]);\n this.urlImage = `data:${file?.type};base64,`;\n this.noEdit.set(false);\n\n if (files && file) {\n const reader: any = new FileReader();\n reader.onload = this.handleReaderLoaded.bind(this);\n reader.readAsBinaryString(file);\n }\n }\n }\n }\n\n public onCloseEditPanel(): void {\n if (this.observer instanceof ResizeObserver) {\n let imageCropper: any = document.getElementById('image-cropper');\n let imageFull: any = document.getElementById('image-full');\n this.observer.unobserve(imageCropper);\n this.observer.unobserve(imageFull);\n }\n this.showCrop.setValue(false);\n this.showEditPanel.set(false);\n }\n\n public async onChangeQuality(): Promise<void> {\n const qualityItem: number = this.quality.value / 100;\n this.maxHeight = this.maxHeight ?? 2000;\n this.maxWidth = this.maxWidth ?? 2000;\n\n await this.wait(250);\n try {\n const input: ImageConverterInput = {\n height: this.maxHeight,\n width: this.maxWidth,\n dataType: this.format.value,\n quality: qualityItem,\n maintainRatio: this.maintainAspectRatio.value,\n };\n\n this.imageSrc.set(await this.resizeDataURL(this.originImageSrc, input));\n this.$imageChanged.next(this.imageSrc());\n this.loadImage.set(true);\n } catch (error) {\n this.loadImage.set(true);\n }\n }\n\n public async onChangeFormat(): Promise<void> {\n let qualityItem: number = this.quality.value / 100;\n this.maxHeight = this.maxHeight ?? 2000;\n this.maxWidth = this.maxWidth ?? 2000;\n\n await this.wait(250);\n try {\n let input: ImageConverterInput = {\n height: this.maxHeight,\n width: this.maxWidth,\n dataType: this.format.value,\n quality: qualityItem,\n maintainRatio: this.maintainAspectRatio.value,\n };\n this.imageSrc.set(await this.resizeDataURL(this.originImageSrc, input));\n this.$imageChanged.next(this.imageSrc());\n this.loadImage.set(true);\n } catch (error) {\n this.loadImage.set(true);\n }\n }\n\n public async onChangeSize(changeWidth?: any, changeHeight?: any): Promise<void> {\n let qualityItem: number = this.quality.value / 100;\n this.maxHeight = this.maxHeight ?? 2000;\n this.maxWidth = this.maxWidth ?? 2000;\n\n await this.wait(500);\n\n try {\n let input: ImageConverterInput = {\n height: this.maxHeight,\n width: this.maxWidth,\n dataType: this.format.value,\n quality: qualityItem,\n maintainRatio: this.maintainAspectRatio.value,\n changeHeight: changeHeight,\n changeWidth: changeWidth,\n };\n this.imageSrc.set(await this.resizeDataURL(this.originImageSrc, input));\n this.$imageChanged.next(this.imageSrc());\n this.loadImage.set(true);\n } catch (error) {\n this.loadImage.set(true);\n }\n }\n\n public onChangeCrop(): void {\n const cropper: any = document.getElementById('image-cropper');\n cropper.style.width = this.cropWidth.value + 'px';\n cropper.style.height = this.cropHeight.value + 'px';\n }\n\n public onCropStateChange(): void {\n const cropper: HTMLElement = document.getElementById('image-cropper');\n const fullImage: HTMLElement = document.getElementById('image-full');\n const aspectRatio: number = fullImage.offsetWidth / fullImage.offsetHeight;\n\n if (this.showCrop.value) {\n cropper.style.opacity = '1.0';\n this.dragElement(cropper);\n this.observer = new ResizeObserver((entries: ResizeObserverEntry[]): void => {\n entries.forEach((entry: ResizeObserverEntry): void => {\n if (this.showEditPanel()) {\n const elementCropper: HTMLElement = document.getElementById('image-cropper');\n const elementFull: HTMLElement = document.getElementById('image-full');\n\n const rectHolder: DOMRect = elementFull.getBoundingClientRect();\n const rectElement: DOMRect = elementCropper.getBoundingClientRect();\n\n const maxWidth: number = rectHolder.x + rectHolder.width - rectElement.x - 4;\n const maxHeight: number = rectHolder.y + rectHolder.height - rectElement.y - 4;\n\n // Obtener el tamaño del área de recorte seleccionada por el usuario\n const cropWidth: number = elementCropper.offsetWidth;\n const cropHeight: number = elementCropper.offsetHeight;\n\n // Calcular el ancho y el alto del área de recorte manteniendo la relación de aspecto de la imagen original\n let newWidth: number = cropWidth;\n let newHeight: number = cropHeight;\n\n if (this.maintainAspectRatio.value) {\n if (cropWidth / cropHeight > aspectRatio) {\n newHeight = cropWidth / aspectRatio;\n } else {\n newWidth = cropHeight * aspectRatio;\n }\n }\n\n // Ajustar el ancho y el alto del área de recorte si supera los límites\n newWidth = Math.min(newWidth, maxWidth);\n newHeight = Math.min(newHeight, maxHeight);\n\n // Establecer el tamaño y la posición del área de recorte\n elementCropper.style.width = `${newWidth}px`;\n elementCropper.style.height = `${newHeight}px`;\n\n this.cropWidth.setValue(rectElement.width);\n this.cropHeight.setValue(rectElement.height);\n\n if (entry.target.id == 'image-full') {\n if (rectHolder.top > 0) {\n elementCropper.style.top = rectHolder.top + 4 + 'px';\n }\n elementCropper.style.left = rectHolder.left + 4 + 'px';\n }\n }\n });\n });\n this.observer.observe(document.getElementById('image-cropper'));\n this.observer.observe(document.getElementById('image-full'));\n } else {\n cropper.style.opacity = '0.0';\n if (this.observer instanceof ResizeObserver) {\n const elementCropper: HTMLElement = document.getElementById('image-cropper');\n const elementFull: HTMLElement = document.getElementById('image-full');\n this.observer.unobserve(elementCropper);\n this.observer.unobserve(elementFull);\n }\n }\n }\n\n public onCrop(type?: any): void {\n type = type ?? this.format.value;\n const cropper: HTMLElement = document.getElementById('image-cropper');\n const elementFull: HTMLElement = document.getElementById('image-full');\n const rectCropper: DOMRect = cropper.getBoundingClientRect();\n const dataHolderRect: DOMRect = elementFull.getBoundingClientRect();\n const canvas: HTMLCanvasElement = document.createElement('canvas');\n new Promise((resolve, reject): void => {\n let ctx: CanvasRenderingContext2D | null = canvas.getContext('2d');\n let image: HTMLImageElement = new Image();\n image.src = this.imageSrc();\n image.onload = (): void => {\n let ratio: number = image.height / dataHolderRect.height;\n let newWidth: number = rectCropper.width * ratio;\n let newHeight: number = rectCropper.height * ratio;\n canvas.width = newWidth;\n canvas.height = newHeight;\n ctx?.drawImage(\n image,\n Math.abs(rectCropper.x * ratio) - Math.abs(dataHolderRect.x * ratio),\n Math.abs(rectCropper.y * ratio) - Math.abs(dataHolderRect.y * ratio),\n newWidth,\n newHeight,\n 0,\n 0,\n newWidth,\n newHeight,\n );\n\n resolve(canvas.toDataURL(`image/${type}`, this.quality.value));\n };\n image.onerror = (e: string | Event): void => {\n reject(e);\n };\n })\n .then((dataUri: any): void => {\n this.imageSrc.set(dataUri);\n this.showCrop.setValue(false);\n this.onCropStateChange();\n this.maxWidth = canvas?.width;\n this.maxHeight = canvas?.height;\n this.lastOriginSrc = this.originImageSrc + '';\n this.originImageSrc = dataUri;\n this.$imageChanged.next(this.imageSrc());\n })\n .catch((e): void => {\n console.log(e);\n });\n }\n\n public onRestore(): void {\n if (this.arrayCopiedImages.length) {\n let lastState = this.arrayCopiedImages.pop();\n this.imageSrc.set(lastState.lastImage);\n this.maxWidth = lastState.width;\n this.maxHeight = lastState.height;\n this.originImageSrc = this.lastOriginSrc + '';\n this.noEdit.set(false);\n } else {\n this.imageSrc.set(this.lastOriginSrc);\n this.originImageSrc = this.lastOriginSrc + '';\n this.noEdit.set(false);\n }\n\n this.$imageChanged.next(this.imageSrc());\n }\n\n public onRemove(): void {\n this.imageSrc.set(null);\n this.originImageSrc = null;\n this.loadImage.set(false);\n this.arrayCopiedImages = [];\n this.lastOriginSrc = null;\n this.$imageOriginal.next(null);\n this.$imageChanged.next(null);\n this.format.setValue(null);\n this.maxHeight = 2000;\n this.maxWidth = 2000;\n this.cropHeight.setValue(150);\n this.cropWidth.setValue(150);\n this.maintainAspectRatio.setValue(true);\n this.showEditPanel.set(false);\n this.noEdit.set(false);\n this.isVideo.set(false);\n this.imageRemoved.emit();\n }\n\n /**\n * Detecta si el contenido es un video basándose en:\n * 1. Data URL que comienza con data:video/\n * 2. Extensión de archivo (.mp4, .webm, .ogg, .mov, etc.)\n */\n private isVideoContent(src: string): boolean {\n if (!src) return false;\n\n // Verificar si es un data URL de video\n if (src.startsWith('data:video/')) {\n return true;\n }\n\n // Verificar extensiones de video comunes\n const videoExtensions = ['.mp4', '.webm', '.ogg', '.mov', '.avi', '.mkv', '.flv', '.wmv'];\n const lowerSrc = src.toLowerCase();\n\n return videoExtensions.some(ext => {\n // Verificar si termina con la extensión o si la tiene antes de parámetros de query\n return lowerSrc.endsWith(ext) || lowerSrc.includes(ext + '?');\n });\n }\n}\n","@if (!loadImage()) {\n <div class='place-image'>\n <div class='image-holder'\n [ngStyle]='{ width: config()?.width,height: config()?.height,borderRadius: config()?.borderRadius}'>\n <button [matTooltip]=\"'UPLOAD_A_IMAGE' | i18n: config()?.language\" class='image-upload-btn' mat-icon-button\n (click)='onUpload($event)'>\n <mat-icon class='mat-18'>add_a_photo</mat-icon>\n </button>\n <input #imagePicker type='file' class='d-none' [id]=\"'filePicker-' + uuidFilePicker\"\n (change)='handleFileSelect($event)' [accept]='imagesAllowed'>\n </div>\n </div>\n}\n\n\n@if (loadImage()) {\n <div class='place-image'>\n <div class='image-holder-loaded'\n [ngStyle]='{width: config()?.width,height: config()?.height,borderRadius: config()?.borderRadius}'>\n @if (isVideo()) {\n <video\n [src]='imageSrc()'\n controls\n preload=\"metadata\"\n [ngStyle]='{ borderRadius: config()?.borderRadius, width: \"100%\", height: \"100%\", objectFit: \"cover\" }'>\n Tu navegador no soporta la reproducción de video.\n </video>\n } @else {\n <img [src]='imageSrc()' alt='image-loaded' [ngStyle]='{ borderRadius: config()?.borderRadius }'>\n }\n <input #imagePicker type='file' class='d-none' [id]=\"'filePicker-' + uuidFilePicker\"\n (change)='handleFileSelect($event)' [accept]='imagesAllowed'>\n </div>\n @if (imageSrc()?.length) {\n <p class='mat-caption image-caption' [class.warn]='(imageSrc()?.length | calculateSize) > 200'\n [class.fw-600]='(imageSrc()?.length | calculateSize) > 200'>\n @if (!noEdit()) {\n {{\"SIZE\" | i18n: currentLanguage()}}: {{ (imageSrc()?.length | calculateSize) }}Kb &nbsp; {{ format.value }}\n } @else {\n @if (isVideo()) {\n {{\"FORMAT\" | i18n: currentLanguage()}}: video\n } @else {\n {{\"FORMAT\" | i18n: currentLanguage()}}: {{ format.value }}\n }\n }\n </p>\n }\n\n <div class='editing-bar-btn'>\n @if (!config()?.hideAddBtn) {\n <button id='upload-img' mat-icon-button (click)='onUpload($event)'\n [matTooltip]=\"'UPLOAD_A_IMAGE' | i18n: config()?.language\">\n <mat-icon class='mat-18'>add_a_photo</mat-icon>\n </button>\n }\n @if (!config()?.hideEditBtn && !noEdit()) {\n <button id='edit-img' mat-icon-button (click)='showEditPanel.set(true)'\n [matTooltip]=\"'OPEN_EDITOR_PANEL' | i18n: config()?.language\">\n <mat-icon class='mat-18'>edit</mat-icon>\n </button>\n }\n @if (!config()?.hideDownloadBtn) {\n <a id='download-img' [matTooltip]=\"'DOWNLOAD' | i18n: config()?.language\"\n [href]='imageSrc()' mat-icon-button [download]='imageName()'>\n <mat-icon class='mat-18'>cloud_download</mat-icon>\n </a>\n }\n @if (!config()?.hideDeleteBtn) {\n <button id='delete-img' mat-icon-button (click)='onRemove()'\n [matTooltip]=\"'REMOVE' | i18n: config()?.language\">\n <mat-icon class='mat-18'>delete</mat-icon>\n </button>\n }\n\n\n\n\n </div>\n </div>\n}\n\n@if (showEditPanel()) {\n <div id='popup' class='popup'>\n <div class='popup-clear'>\n <button mat-icon-button (click)='onCloseEditPanel()'>\n <mat-icon class='mat-18'>clear</mat-icon>\n </button>\n </div>\n\n <div class='image-container'>\n <div class='image-holder-full'>\n <img id='image-full' [src]='imageSrc()' alt=''>\n <div id='image-cropper' class='image-cropper'>\n <div id='image-cropper-header'>\n <mat-icon>drag_indicator</mat-icon>\n </div>\n </div>\n </div>\n\n <div class='control-panel'>\n <p class='item-panel fw-600'>{{ 'QUALITY' | i18n: config()?.language }}</p>\n <div class='quality-container'>\n <mat-slider ngDefaultControl [color]='color' class='w-100 mw-100' (change)='onChangeQuality()'\n [max]='100' [min]='0' [step]='1' [discrete]='true' [showTickMarks]='true'>\n <input matSliderThumb [formControl]='quality'>\n </mat-slider>\n </div>\n\n <div class='item-panel'>\n <span class='fw-600'>{{ 'MAX_DIMENSIONS' | i18n: config()?.language }}</span>\n <mat-checkbox class='float-right' [formControl]='maintainAspectRatio' [color]='color'>\n <span>{{ 'ASPECT_RATIO' | i18n: config()?.language }}</span>\n </mat-checkbox>\n </div>\n\n <div class='max-dimension-container'>\n <mat-form-field class='w-48' [appearance]='appearance' [color]='color'>\n <mat-label>{{ 'MAX_WIDTH_PX' | i18n: config()?.language }}</mat-label>\n <input (change)='onChangeSize(true, false)' matInput [placeholder]=\"'MAX_WIDTH_PX' | i18n: config()?.language\"\n [(ngModel)]='maxWidth' type='number' [min]='0' [max]='2000'>\n </mat-form-field>\n\n <mat-form-field class='w-48' [appearance]='appearance' [color]='color'>\n <mat-label>{{ 'MAX_HEIGHT_PX' | i18n: config()?.language }}</mat-label>\n <input (change)='onChangeSize(false, true)' matInput [placeholder]=\"'MAX_HEIGHT_PX' | i18n: config()?.language\"\n [(ngModel)]='maxHeight' type='number' [min]='0' [max]='2000'>\n </mat-form-field>\n </div>\n\n <p class='item-panel fw-600'>{{ 'FORMAT' | i18n: config()?.language }}</p>\n <div class='formats-selection'>\n <mat-form-field class='w-100 mw-100' [appearance]='appearance' [color]='color'>\n <mat-select [formControl]='format' (selectionChange)='onChangeFormat()'>\n @for (format of allFormats; track format) {\n <mat-option [value]='format'>\n {{ format }}\n </mat-option>\n }\n\n </mat-select>\n </mat-form-field>\n </div>\n\n <div class='refresh-container'>\n <mat-checkbox (change)='onCropStateChange()' [formControl]='showCrop' [color]='color'>\n <p class='item-panel fw-600'>{{ 'CROP' | i18n: config()?.language }}</p>\n </mat-checkbox>\n <div class='d-flex '>\n <button class='float-right' mat-icon-button [color]='color' (click)='onRestore()'>\n <mat-icon>refresh</mat-icon>\n </button>\n @if (showCrop.value) {\n <p>\n <button mat-icon-button [color]='color' (click)='onCrop()'>\n <mat-icon>crop</mat-icon>\n </button>\n </p>\n }\n\n </div>\n </div>\n @if (showCrop.value) {\n <ng-container>\n <div class='dimension-container'>\n <mat-form-field class='w-48 mw-48' [appearance]='appearance' [color]='color'>\n <mat-label>{{ 'WIDTH_PX' | i18n: config()?.language }}</mat-label>\n <input (change)='onChangeCrop()' matInput [placeholder]=\"'WIDTH_PX' | i18n: config()?.language\"\n [formControl]='cropWidth' type='number' [min]='0' [max]='2000'>\n </mat-form-field>\n <mat-form-field class='w-48 mw-48' [appearance]='appearance' [color]='color'>\n <mat-label>{{ 'HEIGHT_PX' | i18n: config()?.language }}</mat-label>\n <input (change)='onChangeCrop()' matInput [placeholder]=\"'HEIGHT_PX' | i18n: config()?.language\"\n [formControl]='cropHeight' type='number' [min]='0' [max]='2000'>\n </mat-form-field>\n </div>\n </ng-container>\n }\n\n\n <div class='save-container'>\n <button mat-flat-button (click)='onCloseEditPanel()' [color]='color' class='save-button'>\n {{ 'SAVE' | i18n: config()?.language}}\n </button>\n\n @if (imageSrc()?.length) {\n <p class='mat-caption image-caption'\n [class.warn]='(imageSrc()?.length | calculateSize) > 200'\n [class.fw-600]='(imageSrc()?.length | calculateSize) > 200'>\n<!-- {{\"SIZE\" | i18n: currentLanguage()}}: {{ (imageSrc()?.length | calculateSize) }}Kb &nbsp; {{ format.value }}-->\n {{\"FORMAT\" | i18n: currentLanguage()}}: {{ format.value }}\n </p>\n }\n\n </div>\n </div>\n </div>\n </div>\n}\n\n","/*\n * Public API Surface of guachos-image-picker\n */\n\nexport * from './lib/guachos-image-picker.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i10.I18nPipe","i11.CalculateSizePipe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;MAMa,QAAQ,CAAA;AACX,IAAA,EAAE,GAAQ;AAChB,QAAA,cAAc,EAAE,iBAAiB;AACjC,QAAA,SAAS,EAAE,+CAA+C;AAC1D,QAAA,SAAS,EAAE,WAAW;AACtB,QAAA,iBAAiB,EAAE,uBAAuB;AAC1C,QAAA,QAAQ,EAAE,oBAAoB;AAC9B,QAAA,aAAa,EAAE,eAAe;AAC9B,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,IAAI,EAAE,MAAM;AACZ,QAAA,cAAc,EAAE,gBAAgB;AAChC,QAAA,YAAY,EAAE,cAAc;AAC5B,QAAA,YAAY,EAAE,eAAe;AAC7B,QAAA,aAAa,EAAE,gBAAgB;AAC/B,QAAA,MAAM,EAAE,QAAQ;AAChB,QAAA,IAAI,EAAE,MAAM;AACZ,QAAA,QAAQ,EAAE,WAAW;AACrB,QAAA,SAAS,EAAE,YAAY;AACvB,QAAA,MAAM,EAAE,QAAQ;AAChB,QAAA,IAAI,EAAE;KACP;AAEO,IAAA,EAAE,GAAQ;AAChB,QAAA,cAAc,EAAE,iBAAiB;AACjC,QAAA,SAAS,EAAE,gDAAgD;AAC3D,QAAA,SAAS,EAAE,YAAY;AACvB,QAAA,iBAAiB,EAAE,0BAA0B;AAC7C,QAAA,QAAQ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,CAAA,EAAA,QAAA,EAAA,yBAAyB,EAAA,eAAA,EAGlB,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC;wBACL,OAAO;wBACP,gBAAgB;wBAChB,aAAa;wBACb,WAAW;wBACX,eAAe;wBACf,eAAe;wBACf,iBAAiB;wBACjB,kBAAkB;wBAClB,cAAc;wBACd,eAAe;wBACf,WAAW;wBACX,mBAAmB;AACtB,qBAAA,EAAA,QAAA,EAAA,m2QAAA,EAAA,MAAA,EAAA,CAAA,i7LAAA,CAAA,EAAA;;sBAsCF;;sBACA;;sBACA;;sBAEA,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,aAAa,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;;sBAE1C;;sBACA;;sBACA;;sBAEA;;sBAiBA;;sBAqDA;;;AExMH;;AAEG;;ACFH;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -24,7 +24,7 @@ interface ImageConverterInput {
24
24
  changeHeight?: boolean;
25
25
  changeWidth?: boolean;
26
26
  }
27
- type ImageAllowedTypes = 'image/*' | '.webp' | '.png' | '.webp, .jpg, .jpeg' | '.webp, .png' | '.jpg, .jpeg' | '.png, .jpg, .jpeg' | '.webp, .png, .jpg, .jpeg';
27
+ type ImageAllowedTypes = 'image/*' | 'video/*' | 'image/*, video/*' | '.webp' | '.png' | '.svg' | '.webp, .jpg, .jpeg' | '.webp, .png' | '.jpg, .jpeg' | '.png, .jpg, .jpeg' | '.webp, .png, .jpg, .jpeg' | '.mp4, .webm, .ogg' | '.webp, .png, .jpg, .jpeg, .mp4, .webm, .ogg';
28
28
  declare class GuajiritosImagePicker {
29
29
  private observer;
30
30
  private originImageSrc;
@@ -48,6 +48,7 @@ declare class GuajiritosImagePicker {
48
48
  showEditPanel: WritableSignal<boolean>;
49
49
  imageName: WritableSignal<string>;
50
50
  currentLanguage: WritableSignal<string>;
51
+ isVideo: WritableSignal<boolean>;
51
52
  appearance: MatFormFieldAppearance;
52
53
  color: ThemePalette;
53
54
  imagesAllowed: ImageAllowedTypes;
@@ -75,6 +76,12 @@ declare class GuajiritosImagePicker {
75
76
  onCrop(type?: any): void;
76
77
  onRestore(): void;
77
78
  onRemove(): void;
79
+ /**
80
+ * Detecta si el contenido es un video basándose en:
81
+ * 1. Data URL que comienza con data:video/
82
+ * 2. Extensión de archivo (.mp4, .webm, .ogg, .mov, etc.)
83
+ */
84
+ private isVideoContent;
78
85
  static ɵfac: i0.ɵɵFactoryDeclaration<GuajiritosImagePicker, never>;
79
86
  static ɵcmp: i0.ɵɵComponentDeclaration<GuajiritosImagePicker, "guajiritos-image-picker", never, { "appearance": { "alias": "appearance"; "required": false; }; "color": { "alias": "color"; "required": false; }; "imagesAllowed": { "alias": "imagesAllowed"; "required": false; }; "base64Image": { "alias": "base64Image"; "required": false; }; "_imageSrc": { "alias": "_imageSrc"; "required": false; }; "_config": { "alias": "_config"; "required": false; }; }, { "$imageChanged": "$imageChanged"; "$imageOriginal": "$imageOriginal"; "imageRemoved": "imageRemoved"; }, never, never, true, never>;
80
87
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guajiritos/image-picker",
3
- "version": "20.0.0",
3
+ "version": "20.0.2",
4
4
  "author": {
5
5
  "name": "Guajiritos SRL",
6
6
  "email": "cto@guajiritos.com",
@@ -8,8 +8,8 @@
8
8
  },
9
9
  "maintainers": [
10
10
  {
11
- "name": "Alejandro Ravelo Julian",
12
- "email": "alejulian9119@gmail.com"
11
+ "name": "Carlos Alejandro Santana García",
12
+ "email": "carlosasg981212@gmail.com"
13
13
  }
14
14
  ],
15
15
  "description": "Biblioteca de angular basada en componentes de material angular para la selección, edición y compresión de imágenes en formatos png, jpeg, webp",
@@ -19,14 +19,13 @@
19
19
  },
20
20
  "homepage": "https://www.npmjs.com/package/guachos-image-picker",
21
21
  "peerDependencies": {
22
- "@angular/cdk": "^20.0.1",
23
- "@angular/common": "^20.0.0",
24
- "@angular/core": "^20.0.0",
25
- "@angular/forms": "^20.0.0",
26
- "@angular/material": "^20.0.1"
22
+ "@angular/cdk": "20.2.14",
23
+ "@angular/common": "20.3.21",
24
+ "@angular/core": "20.3.21",
25
+ "@angular/material": "20.2.14"
27
26
  },
28
27
  "dependencies": {
29
- "tslib": "^2.0.0"
28
+ "tslib": "2.0.0"
30
29
  },
31
30
  "license": "MIT",
32
31
  "keywords": [