@tilde-nlp/ngx-common 8.1.36 → 8.1.38
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, EventEmitter, Component, Input, ViewChild, Output, NgModule, Optional, Inject, Pipe, inject, Directive, HostListener, HostBinding, ViewChildren, input, effect, ElementRef, ContentChild, ContentChildren, InjectionToken, signal, output, computed } from '@angular/core';
|
|
2
|
+
import { Injectable, EventEmitter, Component, Input, ViewChild, Output, NgModule, Optional, Inject, Pipe, inject, Directive, HostListener, HostBinding, ViewChildren, input, effect, ElementRef, ContentChild, ContentChildren, InjectionToken, signal, output, computed, makeEnvironmentProviders } from '@angular/core';
|
|
3
3
|
import * as i2 from '@angular/material/icon';
|
|
4
4
|
import { MatIconModule, MatIcon } from '@angular/material/icon';
|
|
5
5
|
import * as i2$1 from '@angular/platform-browser';
|
|
@@ -3132,7 +3132,7 @@ class FileUploadComponent {
|
|
|
3132
3132
|
} if (rf & 2) {
|
|
3133
3133
|
let _t;
|
|
3134
3134
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.fileInput = _t.first);
|
|
3135
|
-
} }, inputs: { accept: "accept", useCompactUpload: "useCompactUpload", maxSize: "maxSize", multiple: "multiple", filePreviewProgress: "filePreviewProgress", allowEmpty: "allowEmpty", disabled: "disabled", dragZoneLabel: "dragZoneLabel", uploadIconName: "uploadIconName", uploadButtonLabel: "uploadButtonLabel", openExtensionPopupLabel: "openExtensionPopupLabel", minSupportedFormatCount: "minSupportedFormatCount", hideDefaultLimitsLabel: "hideDefaultLimitsLabel", extendedAcceptList: "extendedAcceptList" }, outputs: { fileChange: "fileChange", errorEvent: "errorEvent" }, standalone: false, ngContentSelectors: _c2$3, decls: 7, vars: 9, consts: [["regularUpload", ""], ["fileInput", ""], ["inputButton", ""], [1, "file-upload", 3, "ngClass.lt-sm"], ["color", "primary", "class", "tld-file-upload-progress", 3, "value", 4, "ngIf"], [4, "ngIf", "ngIfElse"], ["type", "file", "name", "files", 1, "native-file-input", 3, "change", "accept", "multiple", "disabled"], ["color", "primary", 1, "tld-file-upload-progress", 3, "value"], ["tldDragAndDrop", "", "mat-button", "", "type", "button", 1, "upload-button", "text-l", 3, "fileDropped", "click", "disabled"], [4, "ngIf"], ["tldDragAndDrop", "", 1, "upload-zone", 3, "fileDropped"], ["svgIcon", "file_upload_icon"], [1, "upload-zone-labels"], ["color", "accent", 1, "file-upload--btn", 3, "click"], ["fxHide.lt-sm", "", 1, "upload-label", 3, "innerHTML"], [1, "upload-zone-formats"], [4, "ngFor", "ngForOf"], [3, "innerHTML", 4, "ngIf"], [1, "supported-formats-btn"], [3, "innerHTML"], [1, "supported-formats-btn", 3, "click"]], template: function FileUploadComponent_Template(rf, ctx) { if (rf & 1) {
|
|
3135
|
+
} }, inputs: { accept: "accept", useCompactUpload: "useCompactUpload", maxSize: "maxSize", multiple: "multiple", filePreviewProgress: "filePreviewProgress", allowEmpty: "allowEmpty", disabled: "disabled", dragZoneLabel: "dragZoneLabel", uploadIconName: "uploadIconName", uploadButtonLabel: "uploadButtonLabel", openExtensionPopupLabel: "openExtensionPopupLabel", minSupportedFormatCount: "minSupportedFormatCount", hideDefaultLimitsLabel: "hideDefaultLimitsLabel", extendedAcceptList: "extendedAcceptList" }, outputs: { fileChange: "fileChange", errorEvent: "errorEvent" }, standalone: false, ngContentSelectors: _c2$3, decls: 7, vars: 9, consts: [["regularUpload", ""], ["fileInput", ""], ["inputButton", ""], [1, "file-upload", 3, "ngClass.lt-sm"], ["color", "primary", "class", "tld-file-upload-progress", 3, "value", 4, "ngIf"], [4, "ngIf", "ngIfElse"], ["testId", "input-file-upload", "type", "file", "name", "files", 1, "native-file-input", 3, "change", "accept", "multiple", "disabled"], ["color", "primary", 1, "tld-file-upload-progress", 3, "value"], ["tldDragAndDrop", "", "mat-button", "", "type", "button", 1, "upload-button", "text-l", 3, "fileDropped", "click", "disabled"], [4, "ngIf"], ["tldDragAndDrop", "", 1, "upload-zone", 3, "fileDropped"], ["svgIcon", "file_upload_icon"], [1, "upload-zone-labels"], ["color", "accent", 1, "file-upload--btn", 3, "click"], ["fxHide.lt-sm", "", 1, "upload-label", 3, "innerHTML"], [1, "upload-zone-formats"], [4, "ngFor", "ngForOf"], [3, "innerHTML", 4, "ngIf"], [1, "supported-formats-btn"], [3, "innerHTML"], [1, "supported-formats-btn", 3, "click"]], template: function FileUploadComponent_Template(rf, ctx) { if (rf & 1) {
|
|
3136
3136
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
3137
3137
|
i0.ɵɵprojectionDef(_c1$5);
|
|
3138
3138
|
i0.ɵɵelementStart(0, "div", 3);
|
|
@@ -3154,7 +3154,7 @@ class FileUploadComponent {
|
|
|
3154
3154
|
}
|
|
3155
3155
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FileUploadComponent, [{
|
|
3156
3156
|
type: Component,
|
|
3157
|
-
args: [{ selector: 'lib-file-upload', standalone: false, template: "<div class=\"file-upload\" [ngClass.lt-sm]=\"'file-upload-mobile'\" [class.disabled]=\"disabled\">\r\n <mat-progress-bar \r\n *ngIf=\"filePreviewProgress\"\r\n color=\"primary\" \r\n class=\"tld-file-upload-progress\" \r\n [value]=\"filePreviewProgress\"\r\n >\r\n </mat-progress-bar>\r\n\r\n <ng-container *ngIf=\"useCompactUpload; else regularUpload\">\r\n <button tldDragAndDrop #inputButton mat-button (fileDropped)=\"onFileDrop($event)\" [disabled]=\"disabled\" type=\"button\"\r\n (click)=\"fileInput.click()\" class=\"upload-button text-l\"\r\n >\r\n <mat-icon *ngIf=\"uploadIconName\">{{uploadIconName}}</mat-icon>\r\n <ng-content></ng-content>\r\n </button>\r\n </ng-container>\r\n\r\n <ng-template #regularUpload>\r\n <div class=\"upload-zone\" tldDragAndDrop (fileDropped)=\"onFileDrop($event)\" [class.disabled-upload-zone]=\"disabled\">\r\n <mat-icon svgIcon=\"file_upload_icon\"></mat-icon>\r\n\r\n \r\n <div class=\"upload-zone-labels\">\r\n <a color=\"accent\" class=\"file-upload--btn\" (click)=\"fileInput.click()\">{{ uploadButtonLabel }}</a>\r\n \r\n <span fxHide.lt-sm class=\"upload-label\" [innerHTML]=\"dragZoneLabel\"></span>\r\n \r\n <p class=\"upload-zone-formats\">\r\n (<span *ngFor=\"let format of accept; let i = index\"\r\n >{{ format\r\n }}{{ accept.length - 1 === i ? \".\" : \", \" }}</span\r\n >\r\n\r\n <span *ngIf=\"maxSize && !hideDefaultLimitsLabel\" [innerHTML]=\"'FILE_UPLOAD.LIMITS_MB' | translate: { maxSize: maxSizeLabel }\"></span>)\r\n </p>\r\n\r\n <ng-content select=\"[customLimits]\"></ng-content>\r\n \r\n @if (accept.length > minSupportedFormatCount) {\r\n <a class=\"supported-formats-btn\" (click)=\"openSupportedFormatModal()\">{{openExtensionPopupLabel}}</a>\r\n }\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<input \r\n #fileInput \r\n type=\"file\" \r\n name=\"files\" \r\n class=\"native-file-input\"\r\n [accept]=\"allowedExtensions\" \r\n [multiple]=\"multiple\" \r\n [disabled]=\"disabled\"\r\n (change)=\"handleFileInput($event)\" \r\n/>\r\n", styles: [":host{width:100%}.file-upload{display:flex;flex-direction:column;justify-content:center;text-align:center}.file-upload .upload-button,.file-upload .upload-zone{display:flex;border-radius:16px;border:1px dashed var(--base-65)}.file-upload .upload-button{justify-content:start;min-height:52px;overflow:hidden;padding:16px!important}.file-upload .upload-zone{flex-direction:column;justify-content:center;align-items:center;width:100%;padding:42px 0}.file-upload .upload-zone-labels{margin-top:10px;font-size:1rem;font-weight:600;line-height:24px;text-align:center}.file-upload .upload-zone-labels .upload-zone-formats{font-weight:400}.file-upload .supported-formats-btn{cursor:pointer;color:var(--accent);font-weight:400}.file-upload .disabled-upload-zone{cursor:not-allowed}.file-upload .file-upload--btn,.file-upload .upload-label:not(.file-upload-mobile){margin-top:10px}.file-upload .file-upload--btn{cursor:pointer;align-self:center;max-width:fit-content;color:var(--accent)}.file-upload .file-upload--btn:hover{text-decoration:underline}.file-upload .upload-zone-formats{margin:10px 0 4px;color:var(--base-40)}.disabled .file-upload--btn{pointer-events:none!important;text-decoration:none!important;color:var(--base-40)}.native-file-input{display:none}\n"] }]
|
|
3157
|
+
args: [{ selector: 'lib-file-upload', standalone: false, template: "<div class=\"file-upload\" [ngClass.lt-sm]=\"'file-upload-mobile'\" [class.disabled]=\"disabled\">\r\n <mat-progress-bar \r\n *ngIf=\"filePreviewProgress\"\r\n color=\"primary\" \r\n class=\"tld-file-upload-progress\" \r\n [value]=\"filePreviewProgress\"\r\n >\r\n </mat-progress-bar>\r\n\r\n <ng-container *ngIf=\"useCompactUpload; else regularUpload\">\r\n <button tldDragAndDrop #inputButton mat-button (fileDropped)=\"onFileDrop($event)\" [disabled]=\"disabled\" type=\"button\"\r\n (click)=\"fileInput.click()\" class=\"upload-button text-l\"\r\n >\r\n <mat-icon *ngIf=\"uploadIconName\">{{uploadIconName}}</mat-icon>\r\n <ng-content></ng-content>\r\n </button>\r\n </ng-container>\r\n\r\n <ng-template #regularUpload>\r\n <div class=\"upload-zone\" tldDragAndDrop (fileDropped)=\"onFileDrop($event)\" [class.disabled-upload-zone]=\"disabled\">\r\n <mat-icon svgIcon=\"file_upload_icon\"></mat-icon>\r\n\r\n \r\n <div class=\"upload-zone-labels\">\r\n <a color=\"accent\" class=\"file-upload--btn\" (click)=\"fileInput.click()\">{{ uploadButtonLabel }}</a>\r\n \r\n <span fxHide.lt-sm class=\"upload-label\" [innerHTML]=\"dragZoneLabel\"></span>\r\n \r\n <p class=\"upload-zone-formats\">\r\n (<span *ngFor=\"let format of accept; let i = index\"\r\n >{{ format\r\n }}{{ accept.length - 1 === i ? \".\" : \", \" }}</span\r\n >\r\n\r\n <span *ngIf=\"maxSize && !hideDefaultLimitsLabel\" [innerHTML]=\"'FILE_UPLOAD.LIMITS_MB' | translate: { maxSize: maxSizeLabel }\"></span>)\r\n </p>\r\n\r\n <ng-content select=\"[customLimits]\"></ng-content>\r\n \r\n @if (accept.length > minSupportedFormatCount) {\r\n <a class=\"supported-formats-btn\" (click)=\"openSupportedFormatModal()\">{{openExtensionPopupLabel}}</a>\r\n }\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<input \r\n testId=\"input-file-upload\"\r\n #fileInput \r\n type=\"file\" \r\n name=\"files\" \r\n class=\"native-file-input\"\r\n [accept]=\"allowedExtensions\" \r\n [multiple]=\"multiple\" \r\n [disabled]=\"disabled\"\r\n (change)=\"handleFileInput($event)\" \r\n/>\r\n", styles: [":host{width:100%}.file-upload{display:flex;flex-direction:column;justify-content:center;text-align:center}.file-upload .upload-button,.file-upload .upload-zone{display:flex;border-radius:16px;border:1px dashed var(--base-65)}.file-upload .upload-button{justify-content:start;min-height:52px;overflow:hidden;padding:16px!important}.file-upload .upload-zone{flex-direction:column;justify-content:center;align-items:center;width:100%;padding:42px 0}.file-upload .upload-zone-labels{margin-top:10px;font-size:1rem;font-weight:600;line-height:24px;text-align:center}.file-upload .upload-zone-labels .upload-zone-formats{font-weight:400}.file-upload .supported-formats-btn{cursor:pointer;color:var(--accent);font-weight:400}.file-upload .disabled-upload-zone{cursor:not-allowed}.file-upload .file-upload--btn,.file-upload .upload-label:not(.file-upload-mobile){margin-top:10px}.file-upload .file-upload--btn{cursor:pointer;align-self:center;max-width:fit-content;color:var(--accent)}.file-upload .file-upload--btn:hover{text-decoration:underline}.file-upload .upload-zone-formats{margin:10px 0 4px;color:var(--base-40)}.disabled .file-upload--btn{pointer-events:none!important;text-decoration:none!important;color:var(--base-40)}.native-file-input{display:none}\n"] }]
|
|
3158
3158
|
}], () => [], { fileInput: [{
|
|
3159
3159
|
type: ViewChild,
|
|
3160
3160
|
args: ['fileInput']
|
|
@@ -4539,7 +4539,7 @@ class ConfirmationModalComponent {
|
|
|
4539
4539
|
this.confirmation = Confirmation;
|
|
4540
4540
|
}
|
|
4541
4541
|
static { this.ɵfac = function ConfirmationModalComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ConfirmationModalComponent)(i0.ɵɵdirectiveInject(i1$3.MatDialogRef), i0.ɵɵdirectiveInject(MAT_DIALOG_DATA)); }; }
|
|
4542
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ConfirmationModalComponent, selectors: [["lib-confirmation-modal"]], standalone: false, decls: 15, vars: 15, consts: [["mat-dialog-title", ""], ["mat-dialog-content", ""], [1, "confirmation-description"], [4, "ngIf"], ["align", "end"], ["mat-button", "", 3, "mat-dialog-close"], ["mat-flat-button", "", "color", "accent", 3, "mat-dialog-close"], [4, "ngFor", "ngForOf"]], template: function ConfirmationModalComponent_Template(rf, ctx) { if (rf & 1) {
|
|
4542
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ConfirmationModalComponent, selectors: [["lib-confirmation-modal"]], standalone: false, decls: 15, vars: 15, consts: [["mat-dialog-title", ""], ["mat-dialog-content", ""], [1, "confirmation-description"], [4, "ngIf"], ["align", "end"], ["testId", "button-reject", "mat-button", "", 3, "mat-dialog-close"], ["testId", "button-confirm", "mat-flat-button", "", "color", "accent", 3, "mat-dialog-close"], [4, "ngFor", "ngForOf"]], template: function ConfirmationModalComponent_Template(rf, ctx) { if (rf & 1) {
|
|
4543
4543
|
i0.ɵɵelementStart(0, "h1", 0);
|
|
4544
4544
|
i0.ɵɵtext(1);
|
|
4545
4545
|
i0.ɵɵpipe(2, "translate");
|
|
@@ -4577,7 +4577,7 @@ class ConfirmationModalComponent {
|
|
|
4577
4577
|
}
|
|
4578
4578
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ConfirmationModalComponent, [{
|
|
4579
4579
|
type: Component,
|
|
4580
|
-
args: [{ selector: 'lib-confirmation-modal', standalone: false, template: "<h1 mat-dialog-title>{{ data.title | translate }}</h1>\r\n<div mat-dialog-content>\r\n <p class=\"confirmation-description\">{{ data.descriptioon | translate }}</p>\r\n \r\n <ul *ngIf=\"data.details\">\r\n <li *ngFor=\"let extraData of data.details\">\r\n {{ extraData }}\r\n </li>\r\n </ul>\r\n</div>\r\n<mat-dialog-actions align=\"end\">\r\n <button mat-button [mat-dialog-close]=\"confirmation.SECONDARY\">\r\n {{ data.rejectionText | translate }}\r\n </button>\r\n <button mat-flat-button color=\"accent\" [mat-dialog-close]=\"confirmation.PRIMARY\">\r\n {{ data.confirmationText | translate }}\r\n </button>\r\n</mat-dialog-actions>\r\n", styles: [".confirmation-description{color:var(--base-40)}.confirmation-description{margin-top:4px}\n"] }]
|
|
4580
|
+
args: [{ selector: 'lib-confirmation-modal', standalone: false, template: "<h1 mat-dialog-title>{{ data.title | translate }}</h1>\r\n<div mat-dialog-content>\r\n <p class=\"confirmation-description\">{{ data.descriptioon | translate }}</p>\r\n \r\n <ul *ngIf=\"data.details\">\r\n <li *ngFor=\"let extraData of data.details\">\r\n {{ extraData }}\r\n </li>\r\n </ul>\r\n</div>\r\n<mat-dialog-actions align=\"end\">\r\n <button testId=\"button-reject\" mat-button [mat-dialog-close]=\"confirmation.SECONDARY\">\r\n {{ data.rejectionText | translate }}\r\n </button>\r\n <button testId=\"button-confirm\" mat-flat-button color=\"accent\" [mat-dialog-close]=\"confirmation.PRIMARY\">\r\n {{ data.confirmationText | translate }}\r\n </button>\r\n</mat-dialog-actions>\r\n", styles: [".confirmation-description{color:var(--base-40)}.confirmation-description{margin-top:4px}\n"] }]
|
|
4581
4581
|
}], () => [{ type: i1$3.MatDialogRef }, { type: undefined, decorators: [{
|
|
4582
4582
|
type: Inject,
|
|
4583
4583
|
args: [MAT_DIALOG_DATA]
|
|
@@ -6930,7 +6930,7 @@ class LLMTextareaComponent {
|
|
|
6930
6930
|
} if (rf & 2) {
|
|
6931
6931
|
let _t;
|
|
6932
6932
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.textarea = _t.first);
|
|
6933
|
-
} }, inputs: { text: "text", disabled: "disabled", actionButtonsDisabled: "actionButtonsDisabled" }, outputs: { textEditEvent: "textEditEvent", dislikeEvent: "dislikeEvent", copyEvent: "copyEvent" }, standalone: false, features: [i0.ɵɵNgOnChangesFeature], decls: 18, vars: 13, consts: [["textarea", ""], [1, "llm-wrapper", 3, "ngClass.gt-lg"], [1, "llm-textarea-wrapper"], [1, "llm-textarea", 3, "formControl"], [1, "llm-textarea-actions"], [1, "material-icons-outlined", "llm-eu-data-tooltip", 3, "matTooltip"], ["mat-icon-button", "", 3, "click", "matTooltip", "disabled"], [1, "material-icons-outlined", "copy"], ["mat-icon-button", "", 3, "click", "disabled", "matTooltip"], [1, "material-icons-outlined", "dislike"]], template: function LLMTextareaComponent_Template(rf, ctx) { if (rf & 1) {
|
|
6933
|
+
} }, inputs: { text: "text", disabled: "disabled", actionButtonsDisabled: "actionButtonsDisabled" }, outputs: { textEditEvent: "textEditEvent", dislikeEvent: "dislikeEvent", copyEvent: "copyEvent" }, standalone: false, features: [i0.ɵɵNgOnChangesFeature], decls: 18, vars: 13, consts: [["textarea", ""], [1, "llm-wrapper", 3, "ngClass.gt-lg"], [1, "llm-textarea-wrapper"], ["testId", "textarea-llm-text", 1, "llm-textarea", 3, "formControl"], [1, "llm-textarea-actions"], [1, "material-icons-outlined", "llm-eu-data-tooltip", 3, "matTooltip"], ["testId", "button-llm-dislike", "mat-icon-button", "", 3, "click", "matTooltip", "disabled"], [1, "material-icons-outlined", "copy"], ["testId", "button-llm-copy", "mat-icon-button", "", 3, "click", "disabled", "matTooltip"], [1, "material-icons-outlined", "dislike"]], template: function LLMTextareaComponent_Template(rf, ctx) { if (rf & 1) {
|
|
6934
6934
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
6935
6935
|
i0.ɵɵelementStart(0, "div", 1)(1, "div", 2)(2, "textarea", 3, 0);
|
|
6936
6936
|
i0.ɵɵtext(4, " ");
|
|
@@ -6965,7 +6965,7 @@ class LLMTextareaComponent {
|
|
|
6965
6965
|
}
|
|
6966
6966
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LLMTextareaComponent, [{
|
|
6967
6967
|
type: Component,
|
|
6968
|
-
args: [{ selector: 'lib-llm-textarea', standalone: false, template: "<div [ngClass.gt-lg]=\"'desktop'\" class=\"llm-wrapper\">\r\n <div class=\"llm-textarea-wrapper\">\r\n <textarea\r\n #textarea\r\n class=\"llm-textarea\"\r\n [formControl]=\"textareaControl\"\r\n >\r\n </textarea>\r\n\r\n <div class=\"llm-textarea-actions\">\r\n <mat-icon [matTooltip]=\"'LLM.EU_DATA_TOOLTIP' | translate\" class=\"material-icons-outlined llm-eu-data-tooltip\"> gpp_maybe </mat-icon>\r\n\r\n <div>\r\n <button [matTooltip]=\"'TOOLTIPS.DISLIKE' | translate\" (click)=\"dislike()\" mat-icon-button [disabled]=\"actionButtonsDisabled || !textareaControl.value\">\r\n <mat-icon class=\"material-icons-outlined copy\"> thumb_down </mat-icon>\r\n </button>\r\n \r\n <button\r\n mat-icon-button\r\n [disabled]=\"actionButtonsDisabled || !textareaControl.value\"\r\n [matTooltip]=\"'TOOLTIPS.COPY' | translate\"\r\n (click)=\"copy()\"\r\n >\r\n <mat-icon class=\"material-icons-outlined dislike\"> content_copy </mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".llm-wrapper{position:relative;border:1px solid var(--base-65);border-radius:8px;overflow-y:auto}.llm-textarea-wrapper{position:relative}.llm-textarea{min-width:100%;min-height:310px;padding:8px 16px;resize:none;background:none;border-radius:8px;margin-bottom:46px}.desktop .llm-textarea{min-height:490px}.llm-textarea-actions{position:absolute;display:flex;justify-content:space-between;align-items:center;width:100%;bottom:4px}.llm-eu-data-tooltip{margin-left:16px}\n"] }]
|
|
6968
|
+
args: [{ selector: 'lib-llm-textarea', standalone: false, template: "<div [ngClass.gt-lg]=\"'desktop'\" class=\"llm-wrapper\">\r\n <div class=\"llm-textarea-wrapper\">\r\n <textarea testId=\"textarea-llm-text\"\r\n #textarea\r\n class=\"llm-textarea\"\r\n [formControl]=\"textareaControl\"\r\n >\r\n </textarea>\r\n\r\n <div class=\"llm-textarea-actions\">\r\n <mat-icon [matTooltip]=\"'LLM.EU_DATA_TOOLTIP' | translate\" class=\"material-icons-outlined llm-eu-data-tooltip\"> gpp_maybe </mat-icon>\r\n\r\n <div>\r\n <button testId=\"button-llm-dislike\" [matTooltip]=\"'TOOLTIPS.DISLIKE' | translate\" (click)=\"dislike()\" mat-icon-button [disabled]=\"actionButtonsDisabled || !textareaControl.value\">\r\n <mat-icon class=\"material-icons-outlined copy\"> thumb_down </mat-icon>\r\n </button>\r\n \r\n <button testId=\"button-llm-copy\"\r\n mat-icon-button\r\n [disabled]=\"actionButtonsDisabled || !textareaControl.value\"\r\n [matTooltip]=\"'TOOLTIPS.COPY' | translate\"\r\n (click)=\"copy()\"\r\n >\r\n <mat-icon class=\"material-icons-outlined dislike\"> content_copy </mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".llm-wrapper{position:relative;border:1px solid var(--base-65);border-radius:8px;overflow-y:auto}.llm-textarea-wrapper{position:relative}.llm-textarea{min-width:100%;min-height:310px;padding:8px 16px;resize:none;background:none;border-radius:8px;margin-bottom:46px}.desktop .llm-textarea{min-height:490px}.llm-textarea-actions{position:absolute;display:flex;justify-content:space-between;align-items:center;width:100%;bottom:4px}.llm-eu-data-tooltip{margin-left:16px}\n"] }]
|
|
6969
6969
|
}], () => [{ type: i1$5.Clipboard }], { textarea: [{
|
|
6970
6970
|
type: ViewChild,
|
|
6971
6971
|
args: ['textarea']
|
|
@@ -7241,7 +7241,7 @@ class LLMTextareaWithActionsComponent {
|
|
|
7241
7241
|
};
|
|
7242
7242
|
}
|
|
7243
7243
|
static { this.ɵfac = function LLMTextareaWithActionsComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LLMTextareaWithActionsComponent)(i0.ɵɵdirectiveInject(i1$4.LLMService), i0.ɵɵdirectiveInject(LLMHelperService), i0.ɵɵdirectiveInject(MAT_DIALOG_DATA)); }; }
|
|
7244
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LLMTextareaWithActionsComponent, selectors: [["lib-llm-textarea-with-actions"]], standalone: false, decls: 20, vars: 22, consts: [["closeButton", ""], ["rephraseAction", ""], ["mat-dialog-title", ""], ["mat-dialog-content", ""], [3, "innerHTML"], [3, "message", "closeClicked", 4, "ngFor", "ngForOf"], ["color", "accent", "class", "w-full llm-writing-style-select", "appearance", "outline", 4, "ngIf"], [3, "textEditEvent", "copyEvent", "dislikeEvent", "text", "disabled", "actionButtonsDisabled"], ["mat-dialog-actions", "", 1, "llm-actions-wrapper"], ["class", "quota-left-message", 3, "innerHTML", 4, "ngIf"], [1, "llm-actions"], ["mat-button", "", "color", "accent", 3, "click", 4, "ngIf", "ngIfElse"], ["mat-flat-button", "", "color", "accent", 3, "click", "disabled"], [4, "ngIf", "ngIfElse"], ["color", "primary-accent-darker", 3, "diameter", 4, "ngIf"], [3, "closeClicked", "message"], ["color", "accent", "appearance", "outline", 1, "w-full", "llm-writing-style-select"], [3, "ngModelChange", "disabled", "ngModel"], [3, "value"], [1, "quota-left-message", 3, "innerHTML"], ["mat-button", "", "color", "accent", 3, "click"], ["mat-button", "", "color", "accent", 3, "mat-dialog-close"], ["color", "primary-accent-darker", 3, "diameter"]], template: function LLMTextareaWithActionsComponent_Template(rf, ctx) { if (rf & 1) {
|
|
7244
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LLMTextareaWithActionsComponent, selectors: [["lib-llm-textarea-with-actions"]], standalone: false, decls: 20, vars: 22, consts: [["closeButton", ""], ["rephraseAction", ""], ["mat-dialog-title", ""], ["mat-dialog-content", ""], [3, "innerHTML"], [3, "message", "closeClicked", 4, "ngFor", "ngForOf"], ["color", "accent", "class", "w-full llm-writing-style-select", "appearance", "outline", 4, "ngIf"], [3, "textEditEvent", "copyEvent", "dislikeEvent", "text", "disabled", "actionButtonsDisabled"], ["mat-dialog-actions", "", 1, "llm-actions-wrapper"], ["class", "quota-left-message", 3, "innerHTML", 4, "ngIf"], [1, "llm-actions"], ["testId", "button-llm-cancel", "mat-button", "", "color", "accent", 3, "click", 4, "ngIf", "ngIfElse"], ["testId", "button-llm-generate", "mat-flat-button", "", "color", "accent", 3, "click", "disabled"], [4, "ngIf", "ngIfElse"], ["color", "primary-accent-darker", 3, "diameter", 4, "ngIf"], [3, "closeClicked", "message"], ["color", "accent", "appearance", "outline", 1, "w-full", "llm-writing-style-select"], ["testId", "select-use-case", 3, "ngModelChange", "disabled", "ngModel"], [3, "value"], [1, "quota-left-message", 3, "innerHTML"], ["testId", "button-llm-cancel", "mat-button", "", "color", "accent", 3, "click"], ["testId", "button-llm-close", "mat-button", "", "color", "accent", 3, "mat-dialog-close"], ["color", "primary-accent-darker", 3, "diameter"]], template: function LLMTextareaWithActionsComponent_Template(rf, ctx) { if (rf & 1) {
|
|
7245
7245
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
7246
7246
|
i0.ɵɵelementStart(0, "h1", 2);
|
|
7247
7247
|
i0.ɵɵtext(1);
|
|
@@ -7292,7 +7292,7 @@ class LLMTextareaWithActionsComponent {
|
|
|
7292
7292
|
}
|
|
7293
7293
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LLMTextareaWithActionsComponent, [{
|
|
7294
7294
|
type: Component,
|
|
7295
|
-
args: [{ selector: 'lib-llm-textarea-with-actions', standalone: false, template: "<h1 mat-dialog-title>{{ localizationKey + \"TITLE\" | translate }}</h1>\r\n<div mat-dialog-content>\r\n <p [innerHTML]=\"localizationKey + 'DESCRIPTION' | translate\"></p>\r\n\r\n <lib-tld-notification-message *ngFor=\"let message of messages\" [message]=\"message\" (closeClicked)=\"closeMessage(message)\"></lib-tld-notification-message>\r\n\r\n <mat-form-field
|
|
7295
|
+
args: [{ selector: 'lib-llm-textarea-with-actions', standalone: false, template: "<h1 mat-dialog-title>{{ localizationKey + \"TITLE\" | translate }}</h1>\r\n<div mat-dialog-content>\r\n <p [innerHTML]=\"localizationKey + 'DESCRIPTION' | translate\"></p>\r\n\r\n <lib-tld-notification-message *ngFor=\"let message of messages\" [message]=\"message\" (closeClicked)=\"closeMessage(message)\"></lib-tld-notification-message>\r\n\r\n <mat-form-field *ngIf=\"showUseCase\" color=\"accent\" class=\"w-full llm-writing-style-select\" appearance=\"outline\">\r\n <mat-label>{{ 'LLM.USE_CASES_LABEL' | translate }}</mat-label>\r\n <mat-select testId=\"select-use-case\" [disabled]=\"isLoading\" [(ngModel)]=\"selectedUseCase\">\r\n @for (useCase of useCases; track $index) {\r\n\r\n <mat-option [value]=\"useCase\">\r\n {{ 'LLM.USE_CASE.' + (useCase | uppercase) | translate }}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n\r\n\r\n <lib-llm-textarea [class.rephrase]=\"llmActionType === llmActions.REPHRASE\" [text]=\"editedText !== '' ? editedText : initialText\" [disabled]=\"isLoading || !quotaLeft\" [actionButtonsDisabled]=\"!isEdited\" (textEditEvent)=\"textEditEvent($event)\" (copyEvent)=\"copyPlausibleEvent()\" (dislikeEvent)=\"dislikePlausibleEvent()\"></lib-llm-textarea>\r\n</div>\r\n<div class=\"llm-actions-wrapper\" mat-dialog-actions>\r\n <div *ngIf=\"remainingQuotaMessageVisible\" class=\"quota-left-message\" [innerHTML]=\"localizationKey + 'LIMIT' | translate: { limit: quotaLeft, subscriptionUrl: subscriptionUrl }\"></div>\r\n\r\n <div [class.w-full]=\"!remainingQuotaMessageVisible\" class=\"llm-actions\">\r\n <button testId=\"button-llm-cancel\" *ngIf=\"isLoading; else closeButton\" mat-button color=\"accent\" (click)=\"cancel()\">\r\n {{ localizationKey + \"CANCEL\" | translate }}\r\n </button>\r\n\r\n <ng-template #closeButton>\r\n <button testId=\"button-llm-close\" mat-button color=\"accent\" [mat-dialog-close]=\"null\">\r\n {{ localizationKey + \"CLOSE\" | translate }}\r\n </button>\r\n </ng-template>\r\n\r\n <button\r\n testId=\"button-llm-generate\"\r\n mat-flat-button\r\n color=\"accent\"\r\n (click)=\"getEditedText()\"\r\n [disabled]=\"isDisabled\"\r\n >\r\n <span *ngIf=\"llmActionType === llmActions.SUMMARY; else rephraseAction\">\r\n {{\r\n (!isSummarized\r\n ? \"LLM.SUMMARY_MODAL.ACTION\"\r\n : \"LLM.SUMMARY_MODAL.REGENERATE\"\r\n ) | translate\r\n }}\r\n </span>\r\n\r\n <ng-template #rephraseAction>\r\n {{ localizationKey + \"ACTION\" | translate }}\r\n </ng-template>\r\n <mat-spinner *ngIf=\"isLoading\" [diameter]=\"20\" color=\"primary-accent-darker\"></mat-spinner>\r\n </button>\r\n </div>\r\n</div>\r\n", styles: [".info-icon{font-size:1rem;margin-left:5px}:host ::ng-deep .message-body{margin:0 2.25rem 0 0!important;font-size:.875rem}:host ::ng-deep .notification-message-container{margin:0 0 16px;padding:.9em 1em!important;align-items:center!important}:host ::ng-deep .text-container{margin-right:0!important}:host ::ng-deep tld-close-button{top:1px!important}::ng-deep .multiline-tooltip{white-space:pre;min-width:fit-content}::ng-deep .multiline-tooltip .mdc-tooltip__surface{max-width:none!important}:host ::ng-deep .llm-textarea{min-height:240px!important}:host ::ng-deep .rephrase .llm-textarea{min-height:100px!important}:host ::ng-deep .desktop .llm-textarea{min-height:460px!important}:host ::ng-deep .rephrase .desktop .llm-textarea{min-height:330px!important}.llm-writing-style-select{margin-top:1.25rem}.llm-writing-style{display:flex;align-items:center;margin-bottom:.25rem}.llm-actions-wrapper{display:flex;justify-content:space-between;margin:0 1rem .5rem}.llm-actions{display:flex;justify-content:end}.w-full{width:100%}:host ::ng-deep .mdc-button__label{display:flex!important;align-items:center!important}mat-spinner{margin-left:.5rem}.quota-left-message{margin-bottom:12px}\n"] }]
|
|
7296
7296
|
}], () => [{ type: i1$4.LLMService }, { type: LLMHelperService }, { type: undefined, decorators: [{
|
|
7297
7297
|
type: Inject,
|
|
7298
7298
|
args: [MAT_DIALOG_DATA]
|
|
@@ -7491,7 +7491,7 @@ class LLMSummaryComponent {
|
|
|
7491
7491
|
this.openModalEvent.emit(LLMActions.SUMMARY);
|
|
7492
7492
|
}
|
|
7493
7493
|
static { this.ɵfac = function LLMSummaryComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LLMSummaryComponent)(); }; }
|
|
7494
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LLMSummaryComponent, selectors: [["lib-llm-summary"]], inputs: { isTextSummarizable: "isTextSummarizable", newFeatureLocalStorageKey: "newFeatureLocalStorageKey" }, outputs: { openModalEvent: "openModalEvent" }, standalone: false, decls: 6, vars: 12, consts: [["summarizeFeature", ""], ["mat-stroked-button", "", "color", "accent", 1, "llm-summary", 3, "click", "disabled"], [3, "svgIcon"], [3, "titleLocalizationKey", "descriptionLocalizationKey", "closeLocalizationKey", "featureClassName", "featureLocalStorageKey"]], template: function LLMSummaryComponent_Template(rf, ctx) { if (rf & 1) {
|
|
7494
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LLMSummaryComponent, selectors: [["lib-llm-summary"]], inputs: { isTextSummarizable: "isTextSummarizable", newFeatureLocalStorageKey: "newFeatureLocalStorageKey" }, outputs: { openModalEvent: "openModalEvent" }, standalone: false, decls: 6, vars: 12, consts: [["summarizeFeature", ""], ["testId", "button-summarize", "mat-stroked-button", "", "color", "accent", 1, "llm-summary", 3, "click", "disabled"], [3, "svgIcon"], [3, "titleLocalizationKey", "descriptionLocalizationKey", "closeLocalizationKey", "featureClassName", "featureLocalStorageKey"]], template: function LLMSummaryComponent_Template(rf, ctx) { if (rf & 1) {
|
|
7495
7495
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
7496
7496
|
i0.ɵɵelementStart(0, "button", 1);
|
|
7497
7497
|
i0.ɵɵlistener("click", function LLMSummaryComponent_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.openModal()); });
|
|
@@ -7514,7 +7514,7 @@ class LLMSummaryComponent {
|
|
|
7514
7514
|
}
|
|
7515
7515
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LLMSummaryComponent, [{
|
|
7516
7516
|
type: Component,
|
|
7517
|
-
args: [{ selector: 'lib-llm-summary', standalone: false, template: "<button\r\n\tmat-stroked-button\r\n\tclass=\"llm-summary\"\r\n\tcolor=\"accent\"\r\n\t[disabled]=\"!isTextSummarizable\"\r\n\t[class.summarize-feature-active]=\"summarizeFeature?.featureActive()\"\r\n\t(click)=\"openModal()\"\r\n>\r\n\t<mat-icon [svgIcon]=\"'summarize'\"></mat-icon>\r\n\t{{ \"LLM.SUMMARY\" | translate }}\r\n</button>\r\n\r\n<lib-new-feature-dialog-wrapper\r\n\t#summarizeFeature\r\n\t[titleLocalizationKey]=\"'LLM.SUMMARY_NEW_FEATURE.TITLE'\"\r\n\t[descriptionLocalizationKey]=\"'LLM.SUMMARY_NEW_FEATURE.DESCRIPTION'\"\r\n\t[closeLocalizationKey]=\"'LLM.SUMMARY_NEW_FEATURE.CLOSE'\"\r\n\t[featureClassName]=\"'llm-summary'\"\r\n\t[featureLocalStorageKey]=\"'summary' + newFeatureLocalStorageKey\"\r\n></lib-new-feature-dialog-wrapper>\r\n", styles: ["::ng-deep .summarize-feature-active{z-index:1001!important;background-color:#fff!important}\n"] }]
|
|
7517
|
+
args: [{ selector: 'lib-llm-summary', standalone: false, template: "<button testId=\"button-summarize\"\r\n\tmat-stroked-button\r\n\tclass=\"llm-summary\"\r\n\tcolor=\"accent\"\r\n\t[disabled]=\"!isTextSummarizable\"\r\n\t[class.summarize-feature-active]=\"summarizeFeature?.featureActive()\"\r\n\t(click)=\"openModal()\"\r\n>\r\n\t<mat-icon [svgIcon]=\"'summarize'\"></mat-icon>\r\n\t{{ \"LLM.SUMMARY\" | translate }}\r\n</button>\r\n\r\n<lib-new-feature-dialog-wrapper\r\n\t#summarizeFeature\r\n\t[titleLocalizationKey]=\"'LLM.SUMMARY_NEW_FEATURE.TITLE'\"\r\n\t[descriptionLocalizationKey]=\"'LLM.SUMMARY_NEW_FEATURE.DESCRIPTION'\"\r\n\t[closeLocalizationKey]=\"'LLM.SUMMARY_NEW_FEATURE.CLOSE'\"\r\n\t[featureClassName]=\"'llm-summary'\"\r\n\t[featureLocalStorageKey]=\"'summary' + newFeatureLocalStorageKey\"\r\n></lib-new-feature-dialog-wrapper>\r\n", styles: ["::ng-deep .summarize-feature-active{z-index:1001!important;background-color:#fff!important}\n"] }]
|
|
7518
7518
|
}], null, { isTextSummarizable: [{
|
|
7519
7519
|
type: Input
|
|
7520
7520
|
}], newFeatureLocalStorageKey: [{
|
|
@@ -7532,7 +7532,7 @@ class LLMRephraseComponent {
|
|
|
7532
7532
|
this.openModalEvent.emit(LLMActions.REPHRASE);
|
|
7533
7533
|
}
|
|
7534
7534
|
static { this.ɵfac = function LLMRephraseComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LLMRephraseComponent)(); }; }
|
|
7535
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LLMRephraseComponent, selectors: [["lib-llm-rephrase"]], inputs: { isTargetLanguageRephrasable: "isTargetLanguageRephrasable", newFeatureLocalStorageKey: "newFeatureLocalStorageKey" }, outputs: { openModalEvent: "openModalEvent" }, standalone: false, decls: 6, vars: 13, consts: [["rephraseFeature", ""], ["mat-stroked-button", "", "color", "accent", 1, "llm-rephrase", 3, "click", "disabled"], [3, "svgIcon"], [3, "titleLocalizationKey", "descriptionLocalizationKey", "closeLocalizationKey", "featureClassName", "featureLocalStorageKey", "maxWidth"]], template: function LLMRephraseComponent_Template(rf, ctx) { if (rf & 1) {
|
|
7535
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LLMRephraseComponent, selectors: [["lib-llm-rephrase"]], inputs: { isTargetLanguageRephrasable: "isTargetLanguageRephrasable", newFeatureLocalStorageKey: "newFeatureLocalStorageKey" }, outputs: { openModalEvent: "openModalEvent" }, standalone: false, decls: 6, vars: 13, consts: [["rephraseFeature", ""], ["testId", "button-rephrase", "mat-stroked-button", "", "color", "accent", 1, "llm-rephrase", 3, "click", "disabled"], [3, "svgIcon"], [3, "titleLocalizationKey", "descriptionLocalizationKey", "closeLocalizationKey", "featureClassName", "featureLocalStorageKey", "maxWidth"]], template: function LLMRephraseComponent_Template(rf, ctx) { if (rf & 1) {
|
|
7536
7536
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
7537
7537
|
i0.ɵɵelementStart(0, "button", 1);
|
|
7538
7538
|
i0.ɵɵlistener("click", function LLMRephraseComponent_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.openModal()); });
|
|
@@ -7555,7 +7555,7 @@ class LLMRephraseComponent {
|
|
|
7555
7555
|
}
|
|
7556
7556
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LLMRephraseComponent, [{
|
|
7557
7557
|
type: Component,
|
|
7558
|
-
args: [{ selector: 'lib-llm-rephrase', standalone: false, template: "<button\r\n\tmat-stroked-button\r\n\tclass=\"llm-rephrase\"\r\n\tcolor=\"accent\"\r\n\t[disabled]=\"!isTargetLanguageRephrasable\"\r\n\t[class.rephrase-feature-active]=\"rephraseFeature?.featureActive()\"\r\n\t(click)=\"openModal()\"\r\n>\r\n\t<mat-icon [svgIcon]=\"'rephrase'\"></mat-icon>\r\n\t{{ \"LLM.REPHRASE\" | translate }}\r\n</button>\r\n\r\n<lib-new-feature-dialog-wrapper\r\n\t#rephraseFeature\r\n\t[titleLocalizationKey]=\"'LLM.REPHRASE_NEW_FEATURE.TITLE'\"\r\n\t[descriptionLocalizationKey]=\"'LLM.REPHRASE_NEW_FEATURE.DESCRIPTION'\"\r\n\t[closeLocalizationKey]=\"'LLM.REPHRASE_NEW_FEATURE.CLOSE'\"\r\n\t[featureClassName]=\"'llm-rephrase'\"\r\n\t[featureLocalStorageKey]=\"'rephrase' + newFeatureLocalStorageKey\"\r\n\t[maxWidth]=\"400\"\r\n></lib-new-feature-dialog-wrapper>\r\n", styles: ["::ng-deep .rephrase-feature-active{z-index:1001!important;background-color:#fff!important}\n"] }]
|
|
7558
|
+
args: [{ selector: 'lib-llm-rephrase', standalone: false, template: "<button testId=\"button-rephrase\"\r\n\tmat-stroked-button\r\n\tclass=\"llm-rephrase\"\r\n\tcolor=\"accent\"\r\n\t[disabled]=\"!isTargetLanguageRephrasable\"\r\n\t[class.rephrase-feature-active]=\"rephraseFeature?.featureActive()\"\r\n\t(click)=\"openModal()\"\r\n>\r\n\t<mat-icon [svgIcon]=\"'rephrase'\"></mat-icon>\r\n\t{{ \"LLM.REPHRASE\" | translate }}\r\n</button>\r\n\r\n<lib-new-feature-dialog-wrapper\r\n\t#rephraseFeature\r\n\t[titleLocalizationKey]=\"'LLM.REPHRASE_NEW_FEATURE.TITLE'\"\r\n\t[descriptionLocalizationKey]=\"'LLM.REPHRASE_NEW_FEATURE.DESCRIPTION'\"\r\n\t[closeLocalizationKey]=\"'LLM.REPHRASE_NEW_FEATURE.CLOSE'\"\r\n\t[featureClassName]=\"'llm-rephrase'\"\r\n\t[featureLocalStorageKey]=\"'rephrase' + newFeatureLocalStorageKey\"\r\n\t[maxWidth]=\"400\"\r\n></lib-new-feature-dialog-wrapper>\r\n", styles: ["::ng-deep .rephrase-feature-active{z-index:1001!important;background-color:#fff!important}\n"] }]
|
|
7559
7559
|
}], null, { isTargetLanguageRephrasable: [{
|
|
7560
7560
|
type: Input
|
|
7561
7561
|
}], newFeatureLocalStorageKey: [{
|
|
@@ -9020,6 +9020,42 @@ class CustomTranslateLoader {
|
|
|
9020
9020
|
type: Injectable
|
|
9021
9021
|
}], () => [{ type: i1$2.HttpClient }], null); })();
|
|
9022
9022
|
|
|
9023
|
+
const USER_CONFIG_STORAGE = new InjectionToken('USER_CONFIG_STORAGE');
|
|
9024
|
+
|
|
9025
|
+
class MatomoService {
|
|
9026
|
+
setCookies() {
|
|
9027
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9028
|
+
window['_paq'].push(['setCookieConsentGiven']);
|
|
9029
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9030
|
+
window['_paq'].push(['rememberCookieConsentGiven']);
|
|
9031
|
+
}
|
|
9032
|
+
static { this.ɵfac = function MatomoService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MatomoService)(); }; }
|
|
9033
|
+
static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: MatomoService, factory: MatomoService.ɵfac, providedIn: 'root' }); }
|
|
9034
|
+
}
|
|
9035
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MatomoService, [{
|
|
9036
|
+
type: Injectable,
|
|
9037
|
+
args: [{
|
|
9038
|
+
providedIn: 'root',
|
|
9039
|
+
}]
|
|
9040
|
+
}], null, null); })();
|
|
9041
|
+
|
|
9042
|
+
class AnalyticsService {
|
|
9043
|
+
#matomo = inject(MatomoService);
|
|
9044
|
+
cookieConsentGiven(approved) {
|
|
9045
|
+
if (approved) {
|
|
9046
|
+
this.#matomo.setCookies();
|
|
9047
|
+
}
|
|
9048
|
+
}
|
|
9049
|
+
static { this.ɵfac = function AnalyticsService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AnalyticsService)(); }; }
|
|
9050
|
+
static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AnalyticsService, factory: AnalyticsService.ɵfac, providedIn: 'root' }); }
|
|
9051
|
+
}
|
|
9052
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AnalyticsService, [{
|
|
9053
|
+
type: Injectable,
|
|
9054
|
+
args: [{
|
|
9055
|
+
providedIn: 'root',
|
|
9056
|
+
}]
|
|
9057
|
+
}], null, null); })();
|
|
9058
|
+
|
|
9023
9059
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9024
9060
|
const translations = {
|
|
9025
9061
|
lv: {
|
|
@@ -9106,40 +9142,6 @@ const translations = {
|
|
|
9106
9142
|
},
|
|
9107
9143
|
};
|
|
9108
9144
|
|
|
9109
|
-
class MatomoService {
|
|
9110
|
-
setCookies() {
|
|
9111
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9112
|
-
window['_paq'].push(['setCookieConsentGiven']);
|
|
9113
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9114
|
-
window['_paq'].push(['rememberCookieConsentGiven']);
|
|
9115
|
-
}
|
|
9116
|
-
static { this.ɵfac = function MatomoService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MatomoService)(); }; }
|
|
9117
|
-
static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: MatomoService, factory: MatomoService.ɵfac, providedIn: 'root' }); }
|
|
9118
|
-
}
|
|
9119
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MatomoService, [{
|
|
9120
|
-
type: Injectable,
|
|
9121
|
-
args: [{
|
|
9122
|
-
providedIn: 'root',
|
|
9123
|
-
}]
|
|
9124
|
-
}], null, null); })();
|
|
9125
|
-
|
|
9126
|
-
class AnalyticsService {
|
|
9127
|
-
#matomo = inject(MatomoService);
|
|
9128
|
-
cookieConsentGiven(approved) {
|
|
9129
|
-
if (approved) {
|
|
9130
|
-
this.#matomo.setCookies();
|
|
9131
|
-
}
|
|
9132
|
-
}
|
|
9133
|
-
static { this.ɵfac = function AnalyticsService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AnalyticsService)(); }; }
|
|
9134
|
-
static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AnalyticsService, factory: AnalyticsService.ɵfac, providedIn: 'root' }); }
|
|
9135
|
-
}
|
|
9136
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AnalyticsService, [{
|
|
9137
|
-
type: Injectable,
|
|
9138
|
-
args: [{
|
|
9139
|
-
providedIn: 'root',
|
|
9140
|
-
}]
|
|
9141
|
-
}], null, null); })();
|
|
9142
|
-
|
|
9143
9145
|
function CookieConsentComponent_Conditional_0_Conditional_19_Template(rf, ctx) { if (rf & 1) {
|
|
9144
9146
|
i0.ɵɵelementStart(0, "mat-icon", 9);
|
|
9145
9147
|
i0.ɵɵtext(1);
|
|
@@ -9421,32 +9423,17 @@ class CookieConsentComponent {
|
|
|
9421
9423
|
constructor() {
|
|
9422
9424
|
this.#analytics = inject(AnalyticsService);
|
|
9423
9425
|
this.#translate = inject(TranslateService);
|
|
9426
|
+
this.#storage = inject(USER_CONFIG_STORAGE, { optional: true });
|
|
9424
9427
|
this.isClosed = false;
|
|
9425
9428
|
this.isDetailsVisible = false;
|
|
9426
|
-
this.#COOKIE_CONSENT_ACCEPTED_KEY = 'cookie-consent-accepted';
|
|
9427
|
-
this.#COOKIE_CONSENT_DECLINED_KEY = 'cookie-consent-declined';
|
|
9428
9429
|
this.destroy = new Subject();
|
|
9429
9430
|
}
|
|
9430
9431
|
#analytics;
|
|
9431
9432
|
#translate;
|
|
9432
|
-
#
|
|
9433
|
-
#COOKIE_CONSENT_DECLINED_KEY;
|
|
9433
|
+
#storage;
|
|
9434
9434
|
ngOnInit() {
|
|
9435
|
-
|
|
9436
|
-
|
|
9437
|
-
script.defer = true;
|
|
9438
|
-
script.innerHTML = this.script;
|
|
9439
|
-
document.body.appendChild(script);
|
|
9440
|
-
if (this.isCookieConsentConfigured()) {
|
|
9441
|
-
this.isClosed = true;
|
|
9442
|
-
return;
|
|
9443
|
-
}
|
|
9444
|
-
const currentLang = this.#translate.getCurrentLang();
|
|
9445
|
-
this.#translate.setTranslation(currentLang, translations[currentLang.split('-')[0]], true);
|
|
9446
|
-
this.#translate.onLangChange.pipe(takeUntil(this.destroy)).subscribe((langChangeEvent) => {
|
|
9447
|
-
const newLang = langChangeEvent.lang;
|
|
9448
|
-
this.#translate.setTranslation(newLang, translations[newLang.split('-')[0]], true);
|
|
9449
|
-
});
|
|
9435
|
+
this.injectConsentScript();
|
|
9436
|
+
this.resolveInitialConsentState();
|
|
9450
9437
|
}
|
|
9451
9438
|
ngOnDestroy() {
|
|
9452
9439
|
this.removeListeners();
|
|
@@ -9456,25 +9443,98 @@ class CookieConsentComponent {
|
|
|
9456
9443
|
}
|
|
9457
9444
|
accept() {
|
|
9458
9445
|
this.#analytics.cookieConsentGiven(true);
|
|
9459
|
-
|
|
9446
|
+
this.persistConsent(true);
|
|
9460
9447
|
this.removeListeners();
|
|
9461
9448
|
}
|
|
9462
9449
|
decline() {
|
|
9463
|
-
|
|
9450
|
+
this.persistConsent(false);
|
|
9464
9451
|
this.removeListeners();
|
|
9465
9452
|
}
|
|
9466
9453
|
removeListeners() {
|
|
9454
|
+
if (this.isClosed) {
|
|
9455
|
+
return;
|
|
9456
|
+
}
|
|
9467
9457
|
this.isClosed = true;
|
|
9468
9458
|
this.destroy.next();
|
|
9469
9459
|
this.destroy.complete();
|
|
9470
9460
|
}
|
|
9461
|
+
resolveInitialConsentState() {
|
|
9462
|
+
const configured = this.isCookieConsentConfigured();
|
|
9463
|
+
if (this.isPromise(configured)) {
|
|
9464
|
+
configured.then((isConfigured) => {
|
|
9465
|
+
if (isConfigured) {
|
|
9466
|
+
this.isClosed = true;
|
|
9467
|
+
return;
|
|
9468
|
+
}
|
|
9469
|
+
this.setupTranslations();
|
|
9470
|
+
});
|
|
9471
|
+
return;
|
|
9472
|
+
}
|
|
9473
|
+
if (configured) {
|
|
9474
|
+
this.isClosed = true;
|
|
9475
|
+
return;
|
|
9476
|
+
}
|
|
9477
|
+
this.setupTranslations();
|
|
9478
|
+
}
|
|
9479
|
+
injectConsentScript() {
|
|
9480
|
+
if (!this.script || typeof document === 'undefined') {
|
|
9481
|
+
return;
|
|
9482
|
+
}
|
|
9483
|
+
const script = document.createElement('script');
|
|
9484
|
+
script.async = true;
|
|
9485
|
+
script.defer = true;
|
|
9486
|
+
script.innerHTML = this.script;
|
|
9487
|
+
document.body.appendChild(script);
|
|
9488
|
+
}
|
|
9489
|
+
setupTranslations() {
|
|
9490
|
+
const currentLang = this.#translate.getCurrentLang();
|
|
9491
|
+
this.#translate.setTranslation(currentLang, translations[this.translationKey(currentLang)], true);
|
|
9492
|
+
this.#translate.onLangChange
|
|
9493
|
+
.pipe(takeUntil(this.destroy))
|
|
9494
|
+
.subscribe((langChangeEvent) => {
|
|
9495
|
+
const newLang = langChangeEvent.lang;
|
|
9496
|
+
this.#translate.setTranslation(newLang, translations[this.translationKey(newLang)], true);
|
|
9497
|
+
});
|
|
9498
|
+
}
|
|
9499
|
+
translationKey(locale) {
|
|
9500
|
+
const key = (locale?.split('-')[0] ?? 'en');
|
|
9501
|
+
return translations[key] ? key : 'en';
|
|
9502
|
+
}
|
|
9471
9503
|
isCookieConsentConfigured() {
|
|
9472
|
-
const
|
|
9473
|
-
|
|
9474
|
-
|
|
9475
|
-
|
|
9504
|
+
const snapshot = this.#storage?.snapshot();
|
|
9505
|
+
if (snapshot) {
|
|
9506
|
+
return this.applyStoredConsent(snapshot);
|
|
9507
|
+
}
|
|
9508
|
+
const stored = this.#storage?.read();
|
|
9509
|
+
if (this.isPromise(stored)) {
|
|
9510
|
+
return stored.then((config) => this.applyStoredConsent(config));
|
|
9511
|
+
}
|
|
9512
|
+
return this.applyStoredConsent(stored ?? null);
|
|
9513
|
+
}
|
|
9514
|
+
applyStoredConsent(config) {
|
|
9515
|
+
const consent = config?.cookieConsent;
|
|
9516
|
+
if (!consent?.updatedAt) {
|
|
9517
|
+
return false;
|
|
9518
|
+
}
|
|
9519
|
+
if (consent.accepted) {
|
|
9520
|
+
this.#analytics.cookieConsentGiven(true);
|
|
9476
9521
|
}
|
|
9477
|
-
return
|
|
9522
|
+
return true;
|
|
9523
|
+
}
|
|
9524
|
+
persistConsent(accepted) {
|
|
9525
|
+
this.writeConsent(accepted);
|
|
9526
|
+
}
|
|
9527
|
+
writeConsent(accepted) {
|
|
9528
|
+
const now = new Date().toISOString();
|
|
9529
|
+
this.#storage?.write({
|
|
9530
|
+
cookieConsent: {
|
|
9531
|
+
accepted,
|
|
9532
|
+
updatedAt: now,
|
|
9533
|
+
},
|
|
9534
|
+
});
|
|
9535
|
+
}
|
|
9536
|
+
isPromise(value) {
|
|
9537
|
+
return !!value && typeof value.then === 'function';
|
|
9478
9538
|
}
|
|
9479
9539
|
static { this.ɵfac = function CookieConsentComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CookieConsentComponent)(); }; }
|
|
9480
9540
|
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CookieConsentComponent, selectors: [["lib-cookie-consent"]], inputs: { script: "script", privacyPolicyUrl: "privacyPolicyUrl" }, decls: 1, vars: 1, consts: [[1, "cookie-consent-container"], [1, "cookie-consent-content"], [1, "cookie-consent-description", 3, "innerHTML"], [1, "cookie-consent-actions"], ["mat-flat-button", "", 3, "click"], ["mat-stroked-button", "", 3, "click"], [1, "cookie-consent-info"], [1, "cookie-consent-info--privacy", 3, "href"], [1, "cookie-consent-info--details", 3, "click"], [1, "spin"], [1, "cookie-consent--details"]], template: function CookieConsentComponent_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -9491,7 +9551,319 @@ class CookieConsentComponent {
|
|
|
9491
9551
|
}], privacyPolicyUrl: [{
|
|
9492
9552
|
type: Input
|
|
9493
9553
|
}] }); })();
|
|
9494
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CookieConsentComponent, { className: "CookieConsentComponent", filePath: "lib/analytics/cookie-consent/cookie-consent.component.ts", lineNumber:
|
|
9554
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CookieConsentComponent, { className: "CookieConsentComponent", filePath: "lib/analytics/cookie-consent/cookie-consent.component.ts", lineNumber: 18 }); })();
|
|
9555
|
+
|
|
9556
|
+
const DEFAULT_ACCESSIBILITY_PREFERENCES = {
|
|
9557
|
+
fontSizeIndex: 0,
|
|
9558
|
+
contrast: AccessibilityContrasts.BASE,
|
|
9559
|
+
textMagnifierEnabled: false,
|
|
9560
|
+
screenMaskEnabled: false,
|
|
9561
|
+
};
|
|
9562
|
+
|
|
9563
|
+
const DEFAULT_COOKIE_CONSENT_PREFERENCES = {
|
|
9564
|
+
accepted: false,
|
|
9565
|
+
};
|
|
9566
|
+
|
|
9567
|
+
const USER_CONFIG_VERSION = 1;
|
|
9568
|
+
const createMetadata = (updatedAt = new Date().toISOString()) => ({
|
|
9569
|
+
version: USER_CONFIG_VERSION,
|
|
9570
|
+
updatedAt,
|
|
9571
|
+
});
|
|
9572
|
+
|
|
9573
|
+
const DEFAULT_USER_CONFIG = {
|
|
9574
|
+
accessibility: DEFAULT_ACCESSIBILITY_PREFERENCES,
|
|
9575
|
+
cookieConsent: DEFAULT_COOKIE_CONSENT_PREFERENCES,
|
|
9576
|
+
language: {
|
|
9577
|
+
locale: null,
|
|
9578
|
+
},
|
|
9579
|
+
metadata: {
|
|
9580
|
+
version: USER_CONFIG_VERSION,
|
|
9581
|
+
updatedAt: new Date(0).toISOString(),
|
|
9582
|
+
},
|
|
9583
|
+
};
|
|
9584
|
+
|
|
9585
|
+
var UserConfigStrategy;
|
|
9586
|
+
(function (UserConfigStrategy) {
|
|
9587
|
+
UserConfigStrategy["Local"] = "local";
|
|
9588
|
+
UserConfigStrategy["Iframe"] = "iframe";
|
|
9589
|
+
})(UserConfigStrategy || (UserConfigStrategy = {}));
|
|
9590
|
+
|
|
9591
|
+
const USER_CONFIG_IFRAME_NAME = 'ngx-user-config-bridge';
|
|
9592
|
+
const DEFAULT_USER_CONFIG_IFRAME_URL = '/assets/static-files/user-config-bridge.html';
|
|
9593
|
+
const USER_CONFIG_IFRAME_TARGET_ORIGIN = '*';
|
|
9594
|
+
const USER_CONFIG_MESSAGE_SNAPSHOT = 'ngx-user-config:snapshot';
|
|
9595
|
+
const USER_CONFIG_MESSAGE_REQUEST = 'ngx-user-config:request';
|
|
9596
|
+
const USER_CONFIG_MESSAGE_UPDATE = 'ngx-user-config:update';
|
|
9597
|
+
|
|
9598
|
+
const DEFAULT_USER_CONFIG_OPTIONS = {
|
|
9599
|
+
strategy: UserConfigStrategy.Local,
|
|
9600
|
+
iframeUrl: DEFAULT_USER_CONFIG_IFRAME_URL,
|
|
9601
|
+
};
|
|
9602
|
+
|
|
9603
|
+
const USER_CONFIG_STORAGE_KEY = 'ngx_common_user_config';
|
|
9604
|
+
|
|
9605
|
+
const USER_CONFIG_OPTIONS = new InjectionToken('USER_CONFIG_OPTIONS');
|
|
9606
|
+
|
|
9607
|
+
class IframeStorageStrategy {
|
|
9608
|
+
#dom;
|
|
9609
|
+
#options;
|
|
9610
|
+
#iframe;
|
|
9611
|
+
#messageHandler;
|
|
9612
|
+
constructor() {
|
|
9613
|
+
this.#dom = inject(DOMService);
|
|
9614
|
+
this.#options = inject(USER_CONFIG_OPTIONS);
|
|
9615
|
+
this.snapshot = signal(null, ...(ngDevMode ? [{ debugName: "snapshot" }] : []));
|
|
9616
|
+
this.#ensureIframe();
|
|
9617
|
+
const win = this.#dom.window;
|
|
9618
|
+
if (!win) {
|
|
9619
|
+
return;
|
|
9620
|
+
}
|
|
9621
|
+
this.#messageHandler = (event) => this.#handleMessage(event);
|
|
9622
|
+
win.addEventListener('message', this.#messageHandler);
|
|
9623
|
+
const cached = this.#readCache();
|
|
9624
|
+
if (cached) {
|
|
9625
|
+
this.snapshot.set(cached);
|
|
9626
|
+
}
|
|
9627
|
+
}
|
|
9628
|
+
read() {
|
|
9629
|
+
return this.#readCache();
|
|
9630
|
+
}
|
|
9631
|
+
write(config) {
|
|
9632
|
+
const merged = this.#mergeWithBase(config);
|
|
9633
|
+
this.#writeCache(merged);
|
|
9634
|
+
this.#postToBridge({ type: USER_CONFIG_MESSAGE_UPDATE, payload: merged });
|
|
9635
|
+
this.snapshot.set(merged);
|
|
9636
|
+
}
|
|
9637
|
+
ngOnDestroy() {
|
|
9638
|
+
if (this.#messageHandler && this.#dom.window) {
|
|
9639
|
+
this.#dom.window.removeEventListener('message', this.#messageHandler);
|
|
9640
|
+
}
|
|
9641
|
+
}
|
|
9642
|
+
#ensureIframe() {
|
|
9643
|
+
if (this.#iframe) {
|
|
9644
|
+
return;
|
|
9645
|
+
}
|
|
9646
|
+
const win = this.#dom.window;
|
|
9647
|
+
const doc = win?.document;
|
|
9648
|
+
if (!doc) {
|
|
9649
|
+
return;
|
|
9650
|
+
}
|
|
9651
|
+
const iframe = doc.createElement('iframe');
|
|
9652
|
+
iframe.style.display = 'none';
|
|
9653
|
+
iframe.name = USER_CONFIG_IFRAME_NAME;
|
|
9654
|
+
iframe.src = this.#options?.iframeUrl ?? DEFAULT_USER_CONFIG_IFRAME_URL;
|
|
9655
|
+
iframe.setAttribute('aria-hidden', 'true');
|
|
9656
|
+
iframe.addEventListener('load', () => this.#postToBridge({ type: USER_CONFIG_MESSAGE_REQUEST }));
|
|
9657
|
+
doc.body?.appendChild(iframe);
|
|
9658
|
+
this.#iframe = iframe;
|
|
9659
|
+
}
|
|
9660
|
+
#handleMessage(event) {
|
|
9661
|
+
if (!this.#iframe || event.source !== this.#iframe.contentWindow) {
|
|
9662
|
+
return;
|
|
9663
|
+
}
|
|
9664
|
+
const data = event.data;
|
|
9665
|
+
if (data?.type === USER_CONFIG_MESSAGE_SNAPSHOT && data.payload) {
|
|
9666
|
+
const snapshot = data.payload;
|
|
9667
|
+
this.#writeCache(snapshot);
|
|
9668
|
+
this.snapshot.set(snapshot);
|
|
9669
|
+
}
|
|
9670
|
+
}
|
|
9671
|
+
#postToBridge(message) {
|
|
9672
|
+
if (!this.#iframe?.contentWindow) {
|
|
9673
|
+
return;
|
|
9674
|
+
}
|
|
9675
|
+
this.#iframe.contentWindow.postMessage(message, USER_CONFIG_IFRAME_TARGET_ORIGIN);
|
|
9676
|
+
}
|
|
9677
|
+
#readCache() {
|
|
9678
|
+
const store = this.#dom.localStorage;
|
|
9679
|
+
if (!store) {
|
|
9680
|
+
return null;
|
|
9681
|
+
}
|
|
9682
|
+
return this.#parse(store.getItem(USER_CONFIG_STORAGE_KEY));
|
|
9683
|
+
}
|
|
9684
|
+
#writeCache(config) {
|
|
9685
|
+
const store = this.#dom.localStorage;
|
|
9686
|
+
if (!store) {
|
|
9687
|
+
return;
|
|
9688
|
+
}
|
|
9689
|
+
try {
|
|
9690
|
+
store.setItem(USER_CONFIG_STORAGE_KEY, JSON.stringify(config));
|
|
9691
|
+
}
|
|
9692
|
+
catch {
|
|
9693
|
+
/* noop */
|
|
9694
|
+
}
|
|
9695
|
+
}
|
|
9696
|
+
#parse(raw) {
|
|
9697
|
+
if (!raw) {
|
|
9698
|
+
return null;
|
|
9699
|
+
}
|
|
9700
|
+
try {
|
|
9701
|
+
return JSON.parse(raw);
|
|
9702
|
+
}
|
|
9703
|
+
catch {
|
|
9704
|
+
return DEFAULT_USER_CONFIG;
|
|
9705
|
+
}
|
|
9706
|
+
}
|
|
9707
|
+
#mergeWithBase(update) {
|
|
9708
|
+
const base = this.snapshot() ?? this.read() ?? DEFAULT_USER_CONFIG;
|
|
9709
|
+
const mergedMetadata = {
|
|
9710
|
+
...base.metadata,
|
|
9711
|
+
...update.metadata,
|
|
9712
|
+
updatedAt: new Date().toISOString(),
|
|
9713
|
+
};
|
|
9714
|
+
return {
|
|
9715
|
+
accessibility: {
|
|
9716
|
+
...base.accessibility,
|
|
9717
|
+
...update.accessibility,
|
|
9718
|
+
},
|
|
9719
|
+
cookieConsent: {
|
|
9720
|
+
...base.cookieConsent,
|
|
9721
|
+
...update.cookieConsent,
|
|
9722
|
+
},
|
|
9723
|
+
language: {
|
|
9724
|
+
...base.language,
|
|
9725
|
+
...update.language,
|
|
9726
|
+
},
|
|
9727
|
+
metadata: mergedMetadata,
|
|
9728
|
+
};
|
|
9729
|
+
}
|
|
9730
|
+
static { this.ɵfac = function IframeStorageStrategy_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IframeStorageStrategy)(); }; }
|
|
9731
|
+
static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: IframeStorageStrategy, factory: IframeStorageStrategy.ɵfac, providedIn: 'root' }); }
|
|
9732
|
+
}
|
|
9733
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IframeStorageStrategy, [{
|
|
9734
|
+
type: Injectable,
|
|
9735
|
+
args: [{ providedIn: 'root' }]
|
|
9736
|
+
}], () => [], null); })();
|
|
9737
|
+
|
|
9738
|
+
class LocalStorageStrategy {
|
|
9739
|
+
#dom;
|
|
9740
|
+
#storageListener;
|
|
9741
|
+
constructor() {
|
|
9742
|
+
this.#dom = inject(DOMService);
|
|
9743
|
+
this.snapshot = signal(null, ...(ngDevMode ? [{ debugName: "snapshot" }] : []));
|
|
9744
|
+
const win = this.#dom.window;
|
|
9745
|
+
if (!win) {
|
|
9746
|
+
return;
|
|
9747
|
+
}
|
|
9748
|
+
this.#storageListener = (event) => {
|
|
9749
|
+
if (event.key !== USER_CONFIG_STORAGE_KEY || !event.newValue) {
|
|
9750
|
+
return;
|
|
9751
|
+
}
|
|
9752
|
+
const parsed = this.#parse(event.newValue);
|
|
9753
|
+
if (parsed) {
|
|
9754
|
+
this.snapshot.set(parsed);
|
|
9755
|
+
}
|
|
9756
|
+
};
|
|
9757
|
+
win.addEventListener('storage', this.#storageListener);
|
|
9758
|
+
const current = this.read();
|
|
9759
|
+
if (current) {
|
|
9760
|
+
this.snapshot.set(current);
|
|
9761
|
+
}
|
|
9762
|
+
}
|
|
9763
|
+
read() {
|
|
9764
|
+
const store = this.#dom.localStorage;
|
|
9765
|
+
if (!store) {
|
|
9766
|
+
return null;
|
|
9767
|
+
}
|
|
9768
|
+
return this.#parse(store.getItem(USER_CONFIG_STORAGE_KEY));
|
|
9769
|
+
}
|
|
9770
|
+
write(config) {
|
|
9771
|
+
const store = this.#dom.localStorage;
|
|
9772
|
+
if (!store) {
|
|
9773
|
+
return;
|
|
9774
|
+
}
|
|
9775
|
+
const merged = this.#mergeWithBase(config);
|
|
9776
|
+
try {
|
|
9777
|
+
store.setItem(USER_CONFIG_STORAGE_KEY, JSON.stringify(merged));
|
|
9778
|
+
this.snapshot.set(merged);
|
|
9779
|
+
}
|
|
9780
|
+
catch {
|
|
9781
|
+
/* noop */
|
|
9782
|
+
}
|
|
9783
|
+
}
|
|
9784
|
+
ngOnDestroy() {
|
|
9785
|
+
if (this.#storageListener && this.#dom.window) {
|
|
9786
|
+
this.#dom.window.removeEventListener('storage', this.#storageListener);
|
|
9787
|
+
}
|
|
9788
|
+
}
|
|
9789
|
+
#parse(raw) {
|
|
9790
|
+
if (!raw) {
|
|
9791
|
+
return null;
|
|
9792
|
+
}
|
|
9793
|
+
try {
|
|
9794
|
+
return JSON.parse(raw);
|
|
9795
|
+
}
|
|
9796
|
+
catch {
|
|
9797
|
+
return DEFAULT_USER_CONFIG;
|
|
9798
|
+
}
|
|
9799
|
+
}
|
|
9800
|
+
#mergeWithBase(update) {
|
|
9801
|
+
const base = this.snapshot() ?? this.read() ?? DEFAULT_USER_CONFIG;
|
|
9802
|
+
const mergedMetadata = {
|
|
9803
|
+
...base.metadata,
|
|
9804
|
+
...update.metadata,
|
|
9805
|
+
updatedAt: new Date().toISOString(),
|
|
9806
|
+
};
|
|
9807
|
+
return {
|
|
9808
|
+
accessibility: {
|
|
9809
|
+
...base.accessibility,
|
|
9810
|
+
...update.accessibility,
|
|
9811
|
+
},
|
|
9812
|
+
cookieConsent: {
|
|
9813
|
+
...base.cookieConsent,
|
|
9814
|
+
...update.cookieConsent,
|
|
9815
|
+
},
|
|
9816
|
+
language: {
|
|
9817
|
+
...base.language,
|
|
9818
|
+
...update.language,
|
|
9819
|
+
},
|
|
9820
|
+
metadata: mergedMetadata,
|
|
9821
|
+
};
|
|
9822
|
+
}
|
|
9823
|
+
static { this.ɵfac = function LocalStorageStrategy_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LocalStorageStrategy)(); }; }
|
|
9824
|
+
static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: LocalStorageStrategy, factory: LocalStorageStrategy.ɵfac, providedIn: 'root' }); }
|
|
9825
|
+
}
|
|
9826
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LocalStorageStrategy, [{
|
|
9827
|
+
type: Injectable,
|
|
9828
|
+
args: [{ providedIn: 'root' }]
|
|
9829
|
+
}], () => [], null); })();
|
|
9830
|
+
|
|
9831
|
+
function userConfigStorageFactory(options) {
|
|
9832
|
+
return options.strategy === UserConfigStrategy.Iframe
|
|
9833
|
+
? inject(IframeStorageStrategy)
|
|
9834
|
+
: inject(LocalStorageStrategy);
|
|
9835
|
+
}
|
|
9836
|
+
|
|
9837
|
+
function isUserConfigOptionsFactoryProvider(input) {
|
|
9838
|
+
return typeof input === 'object' && input !== null && 'useFactory' in input;
|
|
9839
|
+
}
|
|
9840
|
+
|
|
9841
|
+
function provideUserConfig(options = {}) {
|
|
9842
|
+
const optionsProvider = isUserConfigOptionsFactoryProvider(options)
|
|
9843
|
+
? {
|
|
9844
|
+
provide: USER_CONFIG_OPTIONS,
|
|
9845
|
+
useFactory: (...deps) => ({
|
|
9846
|
+
...DEFAULT_USER_CONFIG_OPTIONS,
|
|
9847
|
+
...options.useFactory(...deps),
|
|
9848
|
+
}),
|
|
9849
|
+
deps: options.deps
|
|
9850
|
+
}
|
|
9851
|
+
: {
|
|
9852
|
+
provide: USER_CONFIG_OPTIONS,
|
|
9853
|
+
useValue: {
|
|
9854
|
+
...DEFAULT_USER_CONFIG_OPTIONS,
|
|
9855
|
+
...options,
|
|
9856
|
+
},
|
|
9857
|
+
};
|
|
9858
|
+
return makeEnvironmentProviders([
|
|
9859
|
+
optionsProvider,
|
|
9860
|
+
{
|
|
9861
|
+
provide: USER_CONFIG_STORAGE,
|
|
9862
|
+
useFactory: userConfigStorageFactory,
|
|
9863
|
+
deps: [USER_CONFIG_OPTIONS],
|
|
9864
|
+
},
|
|
9865
|
+
]);
|
|
9866
|
+
}
|
|
9495
9867
|
|
|
9496
9868
|
/*
|
|
9497
9869
|
* Public API Surface of ngx-common
|
|
@@ -9501,5 +9873,5 @@ class CookieConsentComponent {
|
|
|
9501
9873
|
* Generated bundle index. Do not edit.
|
|
9502
9874
|
*/
|
|
9503
9875
|
|
|
9504
|
-
export { ALERT_CONFIGURATION_TOKEN, AccessibilityContrasts, AccessibilityDialogComponent, AccessibilityFontSizes, AccessibilityService, AccessibilityTextMagnifierService, AlertService, AnalyticsService, AuthHeadersHelper, COLLECTIONS_MENU, CUSTOM_TITLE_CONFIGURATION_TOKEN, ClickOutsideDirective, ClickOutsideModule, CloseButtonComponent, CloseButtonModule, CombinedCollection, CombinedCollectionTooltipKey, CompanyProductComponent, CompanyProductModule, Confirmation, ConfirmationModalComponent, ConfirmationModalModule, ConfirmationService, ConversionHelper, CookieConsentComponent, CustomPaginatorInernationalizationHelper, CustomTitleStrategyService, CustomTranslateLoader, DISABLE_EXPORT_ATTRIBUTE_NAME, DOMService, DateAgoModule, DateAgoPipe, DomainTranslatePipe, DragAndDropDirective, DragAndDropModule, ERROR_CODES, EngineTermApiService, EngineTermCollectionScope, EngineTermCollectionSource, EngineTermCollectionStatus, EngineTermCollectionSubStatus, ExportFormat, ExtensionDialogComponent, ExtensionDialogModule, ExtensionDialogService, FILE_SIZE_UNIT, FileCategories, FileExtensionHelper, FileExtensions, FileSizeLabelPipe, FileTypeIcons, FileTypes, FileUploadComponent, FileUploadErrorTypeEnum, FileUploadModule, FilterBarComponent, FilterBarModule, FilterWithHighlightModule, FilterWithHighlightPipe, FooterComponent, FooterModule, GlobalMessageComponent, HashHelper, HtmlElementParseHelper, HtmlHelper, IconService, InlineMessageComponent, InlineMessageIconPosition, InlineMessageModule, InlineMessageType, LAST_USED_SYSTEM_LOCAL_STORAGE_KEY, LLMActions, LLMComponent, LLMModule, LLM_CONFIGURATION_TOKEN, LanguageTranslateModule, LanguageTranslatePipe, LanguageTranslateService, MatButtonLoadingDirective, MatButtonLoadingModule, MatomoService, MissingTranslationHandlerService, MissingTranslationHelper, MtCollectionStatus, MultiFunctionalTableComponent, MultiFunctionalTableModule, NewFeatureDialogWrapperComponent, NotificationMessageComponent, NotificationMessageModule, NotificationMessageType, NotificationService, OPEN_CLOSE_BTN_ICONS_TOKEN, ObjectLengthModule, ObjectLengthPipe, OpenCloseButtonComponent, OpenCloseButtonModule, OpenExtensionDialogComponent, Operations, PlausibleEventDirective, PlausibleHelper, PlausibleModule, ResolutionHelper, SCREEN_SIZE, SaveFileHelper, SelectLanguageDialogComponent, SidebarComponent, SidebarService, SortAlphabeticallyModule, SortAlphabeticallyPipe, SortByNumberPipe, SortDomainsPipe, SortHelper, SortLanguageListPipe, SortTranslationsByPropertyModule, SortTranslationsByPropertyPipe, SortTranslationsModule, SortTranslationsPipe, StatusDisplayComponent, StatusDisplayModule, SubscriptionComponent, SubscriptionPlan, SystemService, TerminologyApiService, TerminologyCollectionService, TerminologyComponent, TerminologyConfigService, TerminologyCreateCollectionComponent, TerminologyModule, TerminologyService, TextToSpeechComponent, TldLoaderComponent, TldLoaderModule, ToastComponent, ToastService, getFileSizeLabel, provideCustomTitleStrategy };
|
|
9876
|
+
export { ALERT_CONFIGURATION_TOKEN, AccessibilityContrasts, AccessibilityDialogComponent, AccessibilityFontSizes, AccessibilityService, AccessibilityTextMagnifierService, AlertService, AnalyticsService, AuthHeadersHelper, COLLECTIONS_MENU, CUSTOM_TITLE_CONFIGURATION_TOKEN, ClickOutsideDirective, ClickOutsideModule, CloseButtonComponent, CloseButtonModule, CombinedCollection, CombinedCollectionTooltipKey, CompanyProductComponent, CompanyProductModule, Confirmation, ConfirmationModalComponent, ConfirmationModalModule, ConfirmationService, ConversionHelper, CookieConsentComponent, CustomPaginatorInernationalizationHelper, CustomTitleStrategyService, CustomTranslateLoader, DEFAULT_ACCESSIBILITY_PREFERENCES, DEFAULT_COOKIE_CONSENT_PREFERENCES, DEFAULT_USER_CONFIG, DEFAULT_USER_CONFIG_IFRAME_URL, DEFAULT_USER_CONFIG_OPTIONS, DISABLE_EXPORT_ATTRIBUTE_NAME, DOMService, DateAgoModule, DateAgoPipe, DomainTranslatePipe, DragAndDropDirective, DragAndDropModule, ERROR_CODES, EngineTermApiService, EngineTermCollectionScope, EngineTermCollectionSource, EngineTermCollectionStatus, EngineTermCollectionSubStatus, ExportFormat, ExtensionDialogComponent, ExtensionDialogModule, ExtensionDialogService, FILE_SIZE_UNIT, FileCategories, FileExtensionHelper, FileExtensions, FileSizeLabelPipe, FileTypeIcons, FileTypes, FileUploadComponent, FileUploadErrorTypeEnum, FileUploadModule, FilterBarComponent, FilterBarModule, FilterWithHighlightModule, FilterWithHighlightPipe, FooterComponent, FooterModule, GlobalMessageComponent, HashHelper, HtmlElementParseHelper, HtmlHelper, IconService, InlineMessageComponent, InlineMessageIconPosition, InlineMessageModule, InlineMessageType, LAST_USED_SYSTEM_LOCAL_STORAGE_KEY, LLMActions, LLMComponent, LLMModule, LLM_CONFIGURATION_TOKEN, LanguageTranslateModule, LanguageTranslatePipe, LanguageTranslateService, MatButtonLoadingDirective, MatButtonLoadingModule, MatomoService, MissingTranslationHandlerService, MissingTranslationHelper, MtCollectionStatus, MultiFunctionalTableComponent, MultiFunctionalTableModule, NewFeatureDialogWrapperComponent, NotificationMessageComponent, NotificationMessageModule, NotificationMessageType, NotificationService, OPEN_CLOSE_BTN_ICONS_TOKEN, ObjectLengthModule, ObjectLengthPipe, OpenCloseButtonComponent, OpenCloseButtonModule, OpenExtensionDialogComponent, Operations, PlausibleEventDirective, PlausibleHelper, PlausibleModule, ResolutionHelper, SCREEN_SIZE, SaveFileHelper, SelectLanguageDialogComponent, SidebarComponent, SidebarService, SortAlphabeticallyModule, SortAlphabeticallyPipe, SortByNumberPipe, SortDomainsPipe, SortHelper, SortLanguageListPipe, SortTranslationsByPropertyModule, SortTranslationsByPropertyPipe, SortTranslationsModule, SortTranslationsPipe, StatusDisplayComponent, StatusDisplayModule, SubscriptionComponent, SubscriptionPlan, SystemService, TerminologyApiService, TerminologyCollectionService, TerminologyComponent, TerminologyConfigService, TerminologyCreateCollectionComponent, TerminologyModule, TerminologyService, TextToSpeechComponent, TldLoaderComponent, TldLoaderModule, ToastComponent, ToastService, USER_CONFIG_IFRAME_NAME, USER_CONFIG_IFRAME_TARGET_ORIGIN, USER_CONFIG_MESSAGE_REQUEST, USER_CONFIG_MESSAGE_SNAPSHOT, USER_CONFIG_MESSAGE_UPDATE, USER_CONFIG_OPTIONS, USER_CONFIG_STORAGE, USER_CONFIG_STORAGE_KEY, USER_CONFIG_VERSION, UserConfigStrategy, createMetadata, getFileSizeLabel, isUserConfigOptionsFactoryProvider, provideCustomTitleStrategy, provideUserConfig, userConfigStorageFactory };
|
|
9505
9877
|
//# sourceMappingURL=tilde-nlp-ngx-common.mjs.map
|