import * as i0 from '@angular/core';
import { Component, Input, HostBinding, ViewChild, NgModule, InjectionToken, Inject, Directive, EventEmitter, Output } from '@angular/core';
import * as i2 from '@aztrix/components/button';
import { ButtonComponent, ButtonModule, AbstractButton } from '@aztrix/components/button';
import * as i3 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i3$1 from '@aztrix/icons';
import { IconsModule } from '@aztrix/icons';
import * as i1 from '@aztrix/components/avatar';
import { AvatarModule } from '@aztrix/components/avatar';
import * as i2$1 from '@aztrix/helpers';
import { HelperPipesModule, countryCodeRep, DEFAULT_COUNTRY, LOCALE, isInvalidPasssword, MatomoService, profileName, profileUsername, avatarUrl, PropertyFormControl, CustomValidators, isOfType } from '@aztrix/helpers';
import * as i1$1 from '@aztrix/sdk';
import { SettingsService, ProfilePropertyRepresentation, ContextTypeRepresentation, PropertyTypeRepresentation } from '@aztrix/sdk';
import * as i5 from 'rxjs';
import { first, catchError, EMPTY, shareReplay, map, BehaviorSubject, Subscription } from 'rxjs';
import { CountrySelectorModalComponent, CountrySelectorModalModule } from '@aztrix/components/country-selector-modal';
import * as i2$2 from '@aztrix/components/overlay';
import { ModalSize } from '@aztrix/components/overlay';
import * as i4 from '@angular/material/snack-bar';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { ProvidePasswordModalComponent, ProvidePasswordModalModule } from '@aztrix/components/provide-password-modal';
import { LanguageSelectorModalComponent, LanguageSelectorModalModule } from '@aztrix/components/language-selector-modal';
import { ChangeLoginValueStepperComponent } from '@aztrix/components/change-login-value-stepper';
import { __decorate, __metadata } from 'tslib';
import { UntilDestroy } from '@ngneat/until-destroy';
import * as i4$1 from '@angular/material/slide-toggle';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { ActionFinishedComponent } from '@aztrix/components/action-finished';
import { ChangePasswordModalComponent, ChangePasswordModalModule } from '@aztrix/components/change-password-modal';
import { PropertyOtpVerificationModule } from '@aztrix/components/property-otp-verification';
import { FeedbackSearchComponent } from '@aztrix/components/feedback';
import { BACKEND_URL } from '@aztrix/environment';
import { ROUTES, RouterModule } from '@angular/router';
import { ContrastModule } from '@aztrix/components/contrast';
import { ApiKeysComponent, ApiKeysModule } from '@aztrix/components/api-keys';
import { ErrorType } from '@aztrix/models';
import * as i4$2 from '@aztrix/components/property-edit';
import { PropertyEditModule } from '@aztrix/components/property-edit';
import * as i6 from '@aztrix/components/snackbar';
import { SnackbarModule } from '@aztrix/components/snackbar';
import * as i2$3 from '@aztrix/components/property-view';
import { PropertyViewModule } from '@aztrix/components/property-view';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';

class AccountButtonComponent extends ButtonComponent {
    constructor() {
        super(...arguments);
        this.color = 'white';
        this.postIcon = 'arrow-right';
    }
    get hasContent() {
        const children = Array.from(this.content?.nativeElement?.children || []);
        const contentChildren = children.filter((el) => !el.attributes.getNamedItem('remove'));
        return !!contentChildren.length;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountButtonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: AccountButtonComponent, selector: "ax-account-button", inputs: { title: "title", hint: "hint", color: "color", postIcon: "postIcon" }, host: { properties: { "class": "this.color" } }, viewQueries: [{ propertyName: "content", first: true, predicate: [".content"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<ax-button\n  class=\"button\"\n  [ngClass]=\"{outline: _outline}\"\n  [type]=\"type\"\n  [lowercase]=\"true\"\n  [url]=\"url\"\n  [ariaLabel]=\"ariaLabel\"\n  [target]=\"target\"\n>\n  <div class=\"pre\">\n    <ax-icon class=\"icon\" axContrast [name]=\"icon\"></ax-icon>\n  </div>\n  <div\n    class=\"button-content\"\n    #content\n    [ngClass]=\"{'has-icon': postIcon, 'has-hint': hint || hasContent}\"\n  >\n    <span remove class=\"title\" *ngIf=\"title || postIcon\" axContrast>{{ title }}</span>\n    <ax-icon remove *ngIf=\"postIcon\" class=\"icon\" axContrast [name]=\"postIcon\"></ax-icon>\n    <ng-content class=\"content\"></ng-content>\n    <div class=\"post\"><ng-content select=\".post\"></ng-content></div>\n    <div remove *ngIf=\"hint\" class=\"hint\">{{ hint }}</div>\n  </div>\n</ax-button>\n", styles: [":host .pre,:host .button-content{background-color:#fff;border-radius:.6rem}:host.primary .pre,:host.primary .button-content{background-color:var(--primary-color-500)}:host .button.outline .pre{background-color:transparent;border:1px solid currentColor}:host .button.outline .button-content{background-color:transparent;border:1px solid currentColor}:host ::ng-deep a.ax-button,:host ::ng-deep button.ax-button{display:grid;grid-template-columns:50px 1fr;grid-template-areas:\"button button\";align-items:flex-start;gap:.75rem;width:100%;min-width:0;height:auto;padding:0;white-space:unset;line-height:1.5}:host ::ng-deep a.ax-button:hover,:host ::ng-deep button.ax-button:hover{background-color:inherit}.pre{display:flex;align-items:center;justify-content:center;width:50px;height:50px}.button-content{display:grid;grid-template-columns:1fr max-content;grid-template-areas:\"title icon\";align-items:center;column-gap:.75rem;text-align:left;height:100%;padding:.8rem .75rem}.button-content.has-hint{grid-template-areas:\"title icon\" \"hint icon\"}.post,.icon{grid-area:icon;align-self:center;line-height:0}.hint{grid-area:hint;font-size:.875rem;line-height:1.31rem;white-space:normal;font-weight:400}.title{grid-area:title;line-height:1.5}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.ButtonComponent, selector: "ax-button", inputs: ["url", "ariaLabel", "target"] }, { kind: "component", type: i3$1.IconComponent, selector: "ax-icon", inputs: ["name", "inline"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountButtonComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-account-button', template: "<ax-button\n  class=\"button\"\n  [ngClass]=\"{outline: _outline}\"\n  [type]=\"type\"\n  [lowercase]=\"true\"\n  [url]=\"url\"\n  [ariaLabel]=\"ariaLabel\"\n  [target]=\"target\"\n>\n  <div class=\"pre\">\n    <ax-icon class=\"icon\" axContrast [name]=\"icon\"></ax-icon>\n  </div>\n  <div\n    class=\"button-content\"\n    #content\n    [ngClass]=\"{'has-icon': postIcon, 'has-hint': hint || hasContent}\"\n  >\n    <span remove class=\"title\" *ngIf=\"title || postIcon\" axContrast>{{ title }}</span>\n    <ax-icon remove *ngIf=\"postIcon\" class=\"icon\" axContrast [name]=\"postIcon\"></ax-icon>\n    <ng-content class=\"content\"></ng-content>\n    <div class=\"post\"><ng-content select=\".post\"></ng-content></div>\n    <div remove *ngIf=\"hint\" class=\"hint\">{{ hint }}</div>\n  </div>\n</ax-button>\n", styles: [":host .pre,:host .button-content{background-color:#fff;border-radius:.6rem}:host.primary .pre,:host.primary .button-content{background-color:var(--primary-color-500)}:host .button.outline .pre{background-color:transparent;border:1px solid currentColor}:host .button.outline .button-content{background-color:transparent;border:1px solid currentColor}:host ::ng-deep a.ax-button,:host ::ng-deep button.ax-button{display:grid;grid-template-columns:50px 1fr;grid-template-areas:\"button button\";align-items:flex-start;gap:.75rem;width:100%;min-width:0;height:auto;padding:0;white-space:unset;line-height:1.5}:host ::ng-deep a.ax-button:hover,:host ::ng-deep button.ax-button:hover{background-color:inherit}.pre{display:flex;align-items:center;justify-content:center;width:50px;height:50px}.button-content{display:grid;grid-template-columns:1fr max-content;grid-template-areas:\"title icon\";align-items:center;column-gap:.75rem;text-align:left;height:100%;padding:.8rem .75rem}.button-content.has-hint{grid-template-areas:\"title icon\" \"hint icon\"}.post,.icon{grid-area:icon;align-self:center;line-height:0}.hint{grid-area:hint;font-size:.875rem;line-height:1.31rem;white-space:normal;font-weight:400}.title{grid-area:title;line-height:1.5}\n"] }]
        }], propDecorators: { title: [{
                type: Input
            }], hint: [{
                type: Input
            }], color: [{
                type: HostBinding,
                args: ['class']
            }, {
                type: Input
            }], postIcon: [{
                type: Input
            }], content: [{
                type: ViewChild,
                args: ['.content']
            }] } });

class AccountButtonModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: AccountButtonModule, declarations: [AccountButtonComponent], imports: [CommonModule, ButtonModule, IconsModule], exports: [AccountButtonComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountButtonModule, imports: [CommonModule, ButtonModule, IconsModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountButtonModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [AccountButtonComponent],
                    imports: [CommonModule, ButtonModule, IconsModule],
                    exports: [AccountButtonComponent],
                }]
        }] });

class AccountHeaderComponent {
    constructor() {
        this.title = '';
        this.description = '';
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: AccountHeaderComponent, selector: "ax-account-header", inputs: { avatar: "avatar", title: "title", description: "description" }, ngImport: i0, template: "<div class=\"account-content\">\n  <ax-avatar class=\"avatar\" [source]=\"avatar\"></ax-avatar>\n  <h1 class=\"title\">{{ title }}</h1>\n  <p class=\"description\">{{ description }}</p>\n  <ng-content></ng-content>\n</div>\n", styles: [":host{display:flex;border-radius:.6rem;background-color:#fff;margin-top:40px}.account-content{margin-top:-40px;display:flex;flex-direction:column;justify-content:center;text-align:center;padding:0 1rem 1rem;width:100%}.avatar{width:80px;height:80px;margin:0 auto;border-radius:50%;background-color:#fff}.title{margin:1rem 0 0;font-size:1.125rem}.description{margin-top:.25rem;font-weight:300}\n"], dependencies: [{ kind: "component", type: i1.AvatarComponent, selector: "ax-avatar", inputs: ["source", "type", "icon", "iconColor", "badge", "badgeColor", "border", "round", "rounded"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountHeaderComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-account-header', template: "<div class=\"account-content\">\n  <ax-avatar class=\"avatar\" [source]=\"avatar\"></ax-avatar>\n  <h1 class=\"title\">{{ title }}</h1>\n  <p class=\"description\">{{ description }}</p>\n  <ng-content></ng-content>\n</div>\n", styles: [":host{display:flex;border-radius:.6rem;background-color:#fff;margin-top:40px}.account-content{margin-top:-40px;display:flex;flex-direction:column;justify-content:center;text-align:center;padding:0 1rem 1rem;width:100%}.avatar{width:80px;height:80px;margin:0 auto;border-radius:50%;background-color:#fff}.title{margin:1rem 0 0;font-size:1.125rem}.description{margin-top:.25rem;font-weight:300}\n"] }]
        }], propDecorators: { avatar: [{
                type: Input
            }], title: [{
                type: Input
            }], description: [{
                type: Input
            }] } });

const ACCOUNT_SETTINGS = new InjectionToken('ACCOUNT_SETTINGS');
const ACCOUNT_CONTACTS = new InjectionToken('ACCOUNT_CONTACTS');
const ACCOUNT_BILLING = new InjectionToken('ACCOUNT_BILLING');
const ACCOUNT_BACK = new InjectionToken('ACCOUNT_BACK');

class AccountNavigationComponent {
    constructor(_routerHistory, back) {
        this._routerHistory = _routerHistory;
        this.back = back;
    }
    goBack() {
        this._routerHistory.back('/account');
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountNavigationComponent, deps: [{ token: i2$1.RouterHistoryService }, { token: ACCOUNT_BACK }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: AccountNavigationComponent, selector: "ax-account-navigation", inputs: { title: "title" }, ngImport: i0, template: "<button *ngIf=\"back\" axButton filled [ariaLabel]=\"'label.back' | translate\" (click)=\"goBack()\">\n  <ax-icon class=\"icon\" name=\"arrow-left\"></ax-icon>\n  {{ 'label.back' | translate }}\n</button>\n<h2>{{ title }}</h2>\n<span class=\"content\"><ng-content></ng-content></span>\n", styles: [":host{display:flex;align-items:center;gap:1rem;width:100%;max-width:var(--container-max-width);margin:0 auto}h2{margin:0}.content{margin-left:auto}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.ButtonDirective, selector: "[axButton]", inputs: ["color", "labelHideMobile", "smallButton", "bigButton", "fullWidth", "filled", "outline", "icon-button", "hoverLabel", "hover", "lowercase", "disabled"] }, { kind: "component", type: i3$1.IconComponent, selector: "ax-icon", inputs: ["name", "inline"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountNavigationComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-account-navigation', template: "<button *ngIf=\"back\" axButton filled [ariaLabel]=\"'label.back' | translate\" (click)=\"goBack()\">\n  <ax-icon class=\"icon\" name=\"arrow-left\"></ax-icon>\n  {{ 'label.back' | translate }}\n</button>\n<h2>{{ title }}</h2>\n<span class=\"content\"><ng-content></ng-content></span>\n", styles: [":host{display:flex;align-items:center;gap:1rem;width:100%;max-width:var(--container-max-width);margin:0 auto}h2{margin:0}.content{margin-left:auto}\n"] }]
        }], ctorParameters: () => [{ type: i2$1.RouterHistoryService }, { type: undefined, decorators: [{
                    type: Inject,
                    args: [ACCOUNT_BACK]
                }] }], propDecorators: { title: [{
                type: Input
            }] } });

class AccountNavigationModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountNavigationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: AccountNavigationModule, declarations: [AccountNavigationComponent], imports: [CommonModule, ButtonModule, IconsModule, HelperPipesModule], exports: [AccountNavigationComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountNavigationModule, imports: [CommonModule, ButtonModule, IconsModule, HelperPipesModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountNavigationModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [AccountNavigationComponent],
                    imports: [CommonModule, ButtonModule, IconsModule, HelperPipesModule],
                    exports: [AccountNavigationComponent],
                }]
        }] });

class AbstractSettingButton extends AbstractButton {
    constructor() {
        super(...arguments);
        this.responsive = false;
        this.color = 'white';
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AbstractSettingButton, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
    static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.12", type: AbstractSettingButton, inputs: { title: "title", hint: "hint", responsive: "responsive", color: "color" }, usesInheritance: true, ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AbstractSettingButton, decorators: [{
            type: Directive
        }], propDecorators: { title: [{
                type: Input
            }], hint: [{
                type: Input
            }], responsive: [{
                type: Input
            }], color: [{
                type: Input
            }] } });

class CountrySettingButtonComponent extends AbstractSettingButton {
    constructor(_settings, _overlayService, _elementRef, _defaultCountry$, _locale$) {
        super();
        this._settings = _settings;
        this._overlayService = _overlayService;
        this._elementRef = _elementRef;
        this._defaultCountry$ = _defaultCountry$;
        this._locale$ = _locale$;
        this.settingsChange = new EventEmitter();
    }
    openCountrySelectModal() {
        this._overlayService.createModal(this._elementRef, CountrySelectorModalComponent, {
            title: 'label.country',
            init: (component) => {
                component.didSelectCountry = (country) => {
                    this._updateLanguage(country?.countryCode);
                };
            },
        });
    }
    _updateLanguage(countryCode) {
        this._settings
            .updateAccountSettings({ ...this.settings, countryCode })
            .pipe(first())
            .subscribe((settings) => {
            this.settings = settings;
            this.settingsChange.next(this.settings);
            this._defaultCountry$.next(countryCodeRep(settings.countryCode));
            this._locale$.next({
                countryCode: settings.countryCode,
                languageCode: settings.languageCode,
            });
        });
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CountrySettingButtonComponent, deps: [{ token: i1$1.SettingsService }, { token: i2$2.OverlayService }, { token: i0.ElementRef }, { token: DEFAULT_COUNTRY }, { token: LOCALE }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: CountrySettingButtonComponent, selector: "ax-country-setting-button", inputs: { settings: "settings" }, outputs: { settingsChange: "settingsChange" }, usesInheritance: true, ngImport: i0, template: "<ax-account-button\n  [title]=\"settings?.countryCode | countryCodeLabel\"\n  [hint]=\"'settings.account.locale.country.explanation' | translate\"\n  [type]=\"type\"\n  [color]=\"color\"\n  [icon]=\"'flags:' + settings?.countryCode\"\n  [loading]=\"_loading\"\n  [ariaLabel]=\"settings?.countryCode | countryCodeLabel\"\n  (click)=\"openCountrySelectModal()\"\n></ax-account-button>\n", styles: [""], dependencies: [{ kind: "component", type: AccountButtonComponent, selector: "ax-account-button", inputs: ["title", "hint", "color", "postIcon"] }, { kind: "pipe", type: i2$1.CountryCodeLabelPipe, name: "countryCodeLabel" }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CountrySettingButtonComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-country-setting-button', template: "<ax-account-button\n  [title]=\"settings?.countryCode | countryCodeLabel\"\n  [hint]=\"'settings.account.locale.country.explanation' | translate\"\n  [type]=\"type\"\n  [color]=\"color\"\n  [icon]=\"'flags:' + settings?.countryCode\"\n  [loading]=\"_loading\"\n  [ariaLabel]=\"settings?.countryCode | countryCodeLabel\"\n  (click)=\"openCountrySelectModal()\"\n></ax-account-button>\n" }]
        }], ctorParameters: () => [{ type: i1$1.SettingsService }, { type: i2$2.OverlayService }, { type: i0.ElementRef }, { type: i5.BehaviorSubject, decorators: [{
                    type: Inject,
                    args: [DEFAULT_COUNTRY]
                }] }, { type: i5.BehaviorSubject, decorators: [{
                    type: Inject,
                    args: [LOCALE]
                }] }], propDecorators: { settings: [{
                type: Input
            }], settingsChange: [{
                type: Output
            }] } });

class DeleteAccountSettingButtonComponent extends AbstractSettingButton {
    constructor(_settings, _overlayService, _profileService, _translate, _snackbar, _elementRef) {
        super();
        this._settings = _settings;
        this._overlayService = _overlayService;
        this._profileService = _profileService;
        this._translate = _translate;
        this._snackbar = _snackbar;
        this._elementRef = _elementRef;
        this.logout = new EventEmitter();
    }
    openDeleteAccountModal() {
        this._profileService
            .getMeProfile()
            .pipe(first())
            .subscribe((profile) => this._overlayService.createModal(this._elementRef, ProvidePasswordModalComponent, {
            title: 'settings.account.deleteAccount.individual.button',
            init: (component) => {
                component.profile = profile;
                component.didClickConfirm = (password) => {
                    this._settings
                        .deleteAccount({ password })
                        .pipe(first(), catchError((error) => {
                        if (isInvalidPasssword(error)) {
                            component.providedWrongPassword();
                        }
                        else {
                            this._snackbar.open(this._translate.instant('error.500.body'), this._translate.instant('label.close'));
                            this._overlayService.closeModal();
                        }
                        return EMPTY;
                    }))
                        .subscribe(() => {
                        this.logout.emit();
                        this._overlayService.closeModal();
                    });
                };
            },
        }));
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DeleteAccountSettingButtonComponent, deps: [{ token: i1$1.SettingsService }, { token: i2$2.OverlayService }, { token: i1$1.ProfileService }, { token: i2$1.TranslateService }, { token: i4.MatSnackBar }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: DeleteAccountSettingButtonComponent, selector: "ax-delete-account-setting-button", outputs: { logout: "logout" }, usesInheritance: true, ngImport: i0, template: "<ax-account-button\n  [title]=\"'settings.account.deleteAccount.individual.title' | translate\"\n  [type]=\"type\"\n  [color]=\"color\"\n  icon=\"delete\"\n  [loading]=\"_loading\"\n  [ariaLabel]=\"'settings.account.deleteAccount.individual.title' | translate\"\n  (click)=\"openDeleteAccountModal()\"\n></ax-account-button>\n", styles: [""], dependencies: [{ kind: "component", type: AccountButtonComponent, selector: "ax-account-button", inputs: ["title", "hint", "color", "postIcon"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DeleteAccountSettingButtonComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-delete-account-setting-button', template: "<ax-account-button\n  [title]=\"'settings.account.deleteAccount.individual.title' | translate\"\n  [type]=\"type\"\n  [color]=\"color\"\n  icon=\"delete\"\n  [loading]=\"_loading\"\n  [ariaLabel]=\"'settings.account.deleteAccount.individual.title' | translate\"\n  (click)=\"openDeleteAccountModal()\"\n></ax-account-button>\n" }]
        }], ctorParameters: () => [{ type: i1$1.SettingsService }, { type: i2$2.OverlayService }, { type: i1$1.ProfileService }, { type: i2$1.TranslateService }, { type: i4.MatSnackBar }, { type: i0.ElementRef }], propDecorators: { logout: [{
                type: Output
            }] } });

class LanguageSettingButtonComponent extends AbstractSettingButton {
    constructor(_elementRef, _settings, _translateService, _overlayService, _locale$) {
        super();
        this._elementRef = _elementRef;
        this._settings = _settings;
        this._translateService = _translateService;
        this._overlayService = _overlayService;
        this._locale$ = _locale$;
        this.settingsChange = new EventEmitter();
    }
    openLanguageSelectModal() {
        this._overlayService.createModal(this._elementRef, LanguageSelectorModalComponent, {
            title: 'label.language',
            init: (component) => {
                component.languageCodes = this._translateService.getLangs();
                component.didSelectLanguage.subscribe((languageCode) => {
                    this._updateLanguage(languageCode);
                });
            },
        });
    }
    _updateLanguage(languageCode) {
        this._settings
            .updateAccountSettings({ ...this.settings, languageCode })
            .pipe(first())
            .subscribe((settings) => {
            this.settings = settings;
            this.settingsChange.next(this.settings);
            this._translateService.setActiveLang(languageCode);
            this._locale$.next({
                countryCode: settings.countryCode,
                languageCode: settings.languageCode,
            });
        });
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LanguageSettingButtonComponent, deps: [{ token: i0.ElementRef }, { token: i1$1.SettingsService }, { token: i2$1.TranslateService }, { token: i2$2.OverlayService }, { token: LOCALE }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LanguageSettingButtonComponent, selector: "ax-language-setting-button", inputs: { settings: "settings" }, outputs: { settingsChange: "settingsChange" }, usesInheritance: true, ngImport: i0, template: "<ax-account-button\n  [title]=\"settings?.languageCode | languageCodeLabel\"\n  [hint]=\"hint\"\n  [type]=\"type\"\n  [color]=\"color\"\n  [icon]=\"'flags:' + (settings?.languageCode | flagForLanguage)\"\n  [loading]=\"_loading\"\n  [ariaLabel]=\"settings?.languageCode | languageCodeLabel\"\n  (click)=\"openLanguageSelectModal()\"\n></ax-account-button>\n", styles: [""], dependencies: [{ kind: "component", type: AccountButtonComponent, selector: "ax-account-button", inputs: ["title", "hint", "color", "postIcon"] }, { kind: "pipe", type: i2$1.LanguageCodeLabelPipe, name: "languageCodeLabel" }, { kind: "pipe", type: i2$1.FlagForLanguagePipe, name: "flagForLanguage" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LanguageSettingButtonComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-language-setting-button', template: "<ax-account-button\n  [title]=\"settings?.languageCode | languageCodeLabel\"\n  [hint]=\"hint\"\n  [type]=\"type\"\n  [color]=\"color\"\n  [icon]=\"'flags:' + (settings?.languageCode | flagForLanguage)\"\n  [loading]=\"_loading\"\n  [ariaLabel]=\"settings?.languageCode | languageCodeLabel\"\n  (click)=\"openLanguageSelectModal()\"\n></ax-account-button>\n" }]
        }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.SettingsService }, { type: i2$1.TranslateService }, { type: i2$2.OverlayService }, { type: i5.BehaviorSubject, decorators: [{
                    type: Inject,
                    args: [LOCALE]
                }] }], propDecorators: { settings: [{
                type: Input
            }], settingsChange: [{
                type: Output
            }] } });

class LoginValueSettingButtonComponent extends AbstractSettingButton {
    constructor(_overlay, _elementRef) {
        super();
        this._overlay = _overlay;
        this._elementRef = _elementRef;
        this.settingsChange = new EventEmitter();
    }
    openPropertyVerificationModal() {
        this._overlay.createModal(this._elementRef, ChangeLoginValueStepperComponent, {
            title: 'settings.account.credentials.login.modal.button',
            shadowDOM: false,
            init: (modal) => {
                modal.currentloginValue = this.settings?.loginValue;
                modal.loginValueChanged.pipe(first()).subscribe((settings) => {
                    this.settings = settings;
                    this.settingsChange.emit(settings);
                    this._overlay.closeModal();
                });
            },
        });
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LoginValueSettingButtonComponent, deps: [{ token: i2$2.OverlayService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LoginValueSettingButtonComponent, selector: "ax-login-value-setting-button", inputs: { settings: "settings" }, outputs: { settingsChange: "settingsChange" }, usesInheritance: true, ngImport: i0, template: "<ax-account-button\n  *ngIf=\"settings\"\n  [title]=\"('property.EMAIL.label' | translate) + ': ' + settings.loginValue\"\n  [hint]=\"'settings.account.credentials.login.email' | translate\"\n  [type]=\"type\"\n  [color]=\"color\"\n  icon=\"email-lock-outline\"\n  [loading]=\"_loading\"\n  [ariaLabel]=\"'property.EMAIL.label' | translate\"\n  (click)=\"openPropertyVerificationModal()\"\n></ax-account-button>\n", styles: [""], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AccountButtonComponent, selector: "ax-account-button", inputs: ["title", "hint", "color", "postIcon"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LoginValueSettingButtonComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-login-value-setting-button', template: "<ax-account-button\n  *ngIf=\"settings\"\n  [title]=\"('property.EMAIL.label' | translate) + ': ' + settings.loginValue\"\n  [hint]=\"'settings.account.credentials.login.email' | translate\"\n  [type]=\"type\"\n  [color]=\"color\"\n  icon=\"email-lock-outline\"\n  [loading]=\"_loading\"\n  [ariaLabel]=\"'property.EMAIL.label' | translate\"\n  (click)=\"openPropertyVerificationModal()\"\n></ax-account-button>\n" }]
        }], ctorParameters: () => [{ type: i2$2.OverlayService }, { type: i0.ElementRef }], propDecorators: { settings: [{
                type: Input
            }], settingsChange: [{
                type: Output
            }] } });

let NewsletterSettingButtonComponent = class NewsletterSettingButtonComponent extends AbstractSettingButton {
    constructor(_settings) {
        super();
        this._settings = _settings;
    }
    toggle() {
        this._settings
            .updateAccountSettings({
            ...this.settings,
            newsletterAccepted: !this.settings?.newsletterAccepted,
        })
            .subscribe((settings) => {
            this.settings = settings;
        });
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NewsletterSettingButtonComponent, deps: [{ token: i1$1.SettingsService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: NewsletterSettingButtonComponent, selector: "ax-newsletter-setting-button", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: "<ax-account-button\n  [title]=\"'settings.account.description' | translate\"\n  [hint]=\"hint\"\n  [type]=\"type\"\n  [color]=\"color\"\n  [loading]=\"_loading\"\n  [postIcon]=\"''\"\n  icon=\"email-outline\"\n  (click)=\"toggle()\"\n>\n  <mat-slide-toggle\n    *ngIf=\"settings\"\n    [checked]=\"settings.newsletterAccepted\"\n    class=\"post\"\n    color=\"primary\"\n  ></mat-slide-toggle>\n</ax-account-button>\n", styles: [".post{pointer-events:none}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AccountButtonComponent, selector: "ax-account-button", inputs: ["title", "hint", "color", "postIcon"] }, { kind: "component", type: i4$1.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
};
NewsletterSettingButtonComponent = __decorate([
    UntilDestroy(),
    __metadata("design:paramtypes", [SettingsService])
], NewsletterSettingButtonComponent);
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NewsletterSettingButtonComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-newsletter-setting-button', template: "<ax-account-button\n  [title]=\"'settings.account.description' | translate\"\n  [hint]=\"hint\"\n  [type]=\"type\"\n  [color]=\"color\"\n  [loading]=\"_loading\"\n  [postIcon]=\"''\"\n  icon=\"email-outline\"\n  (click)=\"toggle()\"\n>\n  <mat-slide-toggle\n    *ngIf=\"settings\"\n    [checked]=\"settings.newsletterAccepted\"\n    class=\"post\"\n    color=\"primary\"\n  ></mat-slide-toggle>\n</ax-account-button>\n", styles: [".post{pointer-events:none}\n"] }]
        }], ctorParameters: () => [{ type: i1$1.SettingsService }], propDecorators: { settings: [{
                type: Input
            }] } });

class PasswordSettingButtonComponent extends AbstractSettingButton {
    constructor(_settings, _overlayService, _snackbar, _translateService, _elementRef) {
        super();
        this._settings = _settings;
        this._overlayService = _overlayService;
        this._snackbar = _snackbar;
        this._translateService = _translateService;
        this._elementRef = _elementRef;
    }
    openChangePasswordModal() {
        this._overlayService.createModal(this._elementRef, ChangePasswordModalComponent, {
            title: 'settings.account.credentials.password.modal.title',
            init: (passwordModal) => {
                passwordModal.didClickChange = ({ password, newPassword }) => {
                    this._settings
                        .changePassword({ password, newPassword })
                        .pipe(catchError((error) => {
                        if (isInvalidPasssword(error)) {
                            passwordModal.setPasswordInvalid();
                        }
                        else {
                            this._snackbar.open(this._translateService.instant('error.500.body'), this._translateService.instant('label.close'));
                            this._overlayService.closeModal();
                        }
                        return EMPTY;
                    }))
                        .subscribe(() => {
                        this._overlayService.closeModal();
                        this._overlayService.createModal(this._elementRef, ActionFinishedComponent, {
                            modalSize: ModalSize.DYNAMIC,
                            init: (finishedModal) => {
                                finishedModal.bodyTitle = 'modal.changePassword.succeeded.body.title';
                                finishedModal.bodyExplanation = 'modal.changePassword.succeeded.body.explanation';
                                finishedModal.didClickButton.subscribe(() => this._overlayService.closeModal());
                            },
                        });
                    });
                };
            },
        });
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PasswordSettingButtonComponent, deps: [{ token: i1$1.SettingsService }, { token: i2$2.OverlayService }, { token: i4.MatSnackBar }, { token: i2$1.TranslateService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: PasswordSettingButtonComponent, selector: "ax-password-setting-button", usesInheritance: true, ngImport: i0, template: "<ax-account-button\n  [title]=\"('label.password' | translate) + ': &bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;'\"\n  [hint]=\"'settings.account.credentials.password.explanation' | translate\"\n  [type]=\"type\"\n  [color]=\"color\"\n  [icon]=\"'lock-outline'\"\n  [loading]=\"_loading\"\n  [ariaLabel]=\"'label.password' | translate\"\n  (click)=\"openChangePasswordModal()\"\n></ax-account-button>\n", styles: [""], dependencies: [{ kind: "component", type: AccountButtonComponent, selector: "ax-account-button", inputs: ["title", "hint", "color", "postIcon"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PasswordSettingButtonComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-password-setting-button', template: "<ax-account-button\n  [title]=\"('label.password' | translate) + ': &bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;'\"\n  [hint]=\"'settings.account.credentials.password.explanation' | translate\"\n  [type]=\"type\"\n  [color]=\"color\"\n  [icon]=\"'lock-outline'\"\n  [loading]=\"_loading\"\n  [ariaLabel]=\"'label.password' | translate\"\n  (click)=\"openChangePasswordModal()\"\n></ax-account-button>\n" }]
        }], ctorParameters: () => [{ type: i1$1.SettingsService }, { type: i2$2.OverlayService }, { type: i4.MatSnackBar }, { type: i2$1.TranslateService }, { type: i0.ElementRef }] });

let AnalyticsSettingButtonComponent = class AnalyticsSettingButtonComponent extends AbstractSettingButton {
    constructor(_settings, _matomoService) {
        super();
        this._settings = _settings;
        this._matomoService = _matomoService;
    }
    toggle() {
        this._settings
            .updateAccountSettings({
            ...this.settings,
            collectAnalytics: !this.settings?.collectAnalytics,
        })
            .subscribe((settings) => {
            this.settings = settings;
            if (settings?.collectAnalytics) {
                this._matomoService.setConsentGiven();
            }
            else {
                this._matomoService.removeConsentGiven();
            }
        });
    }
    stopPropagation(event) {
        event.stopPropagation();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AnalyticsSettingButtonComponent, deps: [{ token: i1$1.SettingsService }, { token: i2$1.MatomoService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: AnalyticsSettingButtonComponent, selector: "ax-analytics-setting-button", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: "<ax-account-button\n  [title]=\"'settings.privacy.analytics.title' | translate\"\n  [hint]=\"'settings.privacy.analytics.explanation' | translate\"\n  [type]=\"type\"\n  [color]=\"color\"\n  [loading]=\"_loading\"\n  [postIcon]=\"''\"\n  icon=\"cookie-cog-outline\"\n  (click)=\"toggle()\"\n>\n  <mat-slide-toggle\n    *ngIf=\"settings\"\n    [checked]=\"settings.collectAnalytics\"\n    class=\"post\"\n    color=\"primary\"\n    (click)=\"stopPropagation($event)\"\n  ></mat-slide-toggle>\n</ax-account-button>\n", styles: [".post{pointer-events:none}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AccountButtonComponent, selector: "ax-account-button", inputs: ["title", "hint", "color", "postIcon"] }, { kind: "component", type: i4$1.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
};
AnalyticsSettingButtonComponent = __decorate([
    UntilDestroy(),
    __metadata("design:paramtypes", [SettingsService,
        MatomoService])
], AnalyticsSettingButtonComponent);
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AnalyticsSettingButtonComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-analytics-setting-button', template: "<ax-account-button\n  [title]=\"'settings.privacy.analytics.title' | translate\"\n  [hint]=\"'settings.privacy.analytics.explanation' | translate\"\n  [type]=\"type\"\n  [color]=\"color\"\n  [loading]=\"_loading\"\n  [postIcon]=\"''\"\n  icon=\"cookie-cog-outline\"\n  (click)=\"toggle()\"\n>\n  <mat-slide-toggle\n    *ngIf=\"settings\"\n    [checked]=\"settings.collectAnalytics\"\n    class=\"post\"\n    color=\"primary\"\n    (click)=\"stopPropagation($event)\"\n  ></mat-slide-toggle>\n</ax-account-button>\n", styles: [".post{pointer-events:none}\n"] }]
        }], ctorParameters: () => [{ type: i1$1.SettingsService }, { type: i2$1.MatomoService }], propDecorators: { settings: [{
                type: Input
            }] } });

class AccountSettingsComponent {
    constructor(_settings, _matomoService) {
        this._settings = _settings;
        this._matomoService = _matomoService;
        this.logout = new EventEmitter();
        this._settings
            .getAccountSettings()
            .pipe(first())
            .subscribe((settings) => {
            this.settings = settings;
            if (settings.collectAnalytics) {
                this._matomoService.setConsentGiven();
            }
            else {
                this._matomoService.removeConsentGiven();
            }
        });
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountSettingsComponent, deps: [{ token: i1$1.SettingsService }, { token: i2$1.MatomoService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: AccountSettingsComponent, selector: "ax-account-settings", outputs: { logout: "logout" }, ngImport: i0, template: "<ax-account-navigation [title]=\"'label.settings' | translate\"></ax-account-navigation>\n\n<p>{{ 'label.language' | translate }}</p>\n<ax-language-setting-button [(settings)]=\"settings\"></ax-language-setting-button>\n<p>{{ 'settings.account.locale.country.title' | translate }}</p>\n<ax-country-setting-button [(settings)]=\"settings\"></ax-country-setting-button>\n<p>{{ 'settings.account.credentials.title' | translate }}</p>\n<div class=\"group\">\n  <ax-login-value-setting-button [(settings)]=\"settings\"></ax-login-value-setting-button>\n  <ax-password-setting-button></ax-password-setting-button>\n</div>\n\n<p>{{ 'settings.account.newsletter' | translate }}</p>\n<ax-newsletter-setting-button [settings]=\"settings\"></ax-newsletter-setting-button>\n\n<ng-content></ng-content>\n\n<p>{{ 'settings.privacy.analytics' | translate }}</p>\n<ax-analytics-setting-button [settings]=\"settings\"></ax-analytics-setting-button>\n\n<p>{{ 'me.account.profile.title' | translate }}</p>\n<ax-delete-account-setting-button (logout)=\"logout.emit()\"></ax-delete-account-setting-button>\n", styles: [":host{display:block;max-width:var(--container-max-width);width:100%;margin:0 auto;padding:1rem}.group{display:flex;flex-direction:column;justify-content:center;gap:1rem}\n"], dependencies: [{ kind: "component", type: CountrySettingButtonComponent, selector: "ax-country-setting-button", inputs: ["settings"], outputs: ["settingsChange"] }, { kind: "component", type: DeleteAccountSettingButtonComponent, selector: "ax-delete-account-setting-button", outputs: ["logout"] }, { kind: "component", type: LanguageSettingButtonComponent, selector: "ax-language-setting-button", inputs: ["settings"], outputs: ["settingsChange"] }, { kind: "component", type: LoginValueSettingButtonComponent, selector: "ax-login-value-setting-button", inputs: ["settings"], outputs: ["settingsChange"] }, { kind: "component", type: NewsletterSettingButtonComponent, selector: "ax-newsletter-setting-button", inputs: ["settings"] }, { kind: "component", type: PasswordSettingButtonComponent, selector: "ax-password-setting-button" }, { kind: "component", type: AnalyticsSettingButtonComponent, selector: "ax-analytics-setting-button", inputs: ["settings"] }, { kind: "component", type: AccountNavigationComponent, selector: "ax-account-navigation", inputs: ["title"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountSettingsComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-account-settings', template: "<ax-account-navigation [title]=\"'label.settings' | translate\"></ax-account-navigation>\n\n<p>{{ 'label.language' | translate }}</p>\n<ax-language-setting-button [(settings)]=\"settings\"></ax-language-setting-button>\n<p>{{ 'settings.account.locale.country.title' | translate }}</p>\n<ax-country-setting-button [(settings)]=\"settings\"></ax-country-setting-button>\n<p>{{ 'settings.account.credentials.title' | translate }}</p>\n<div class=\"group\">\n  <ax-login-value-setting-button [(settings)]=\"settings\"></ax-login-value-setting-button>\n  <ax-password-setting-button></ax-password-setting-button>\n</div>\n\n<p>{{ 'settings.account.newsletter' | translate }}</p>\n<ax-newsletter-setting-button [settings]=\"settings\"></ax-newsletter-setting-button>\n\n<ng-content></ng-content>\n\n<p>{{ 'settings.privacy.analytics' | translate }}</p>\n<ax-analytics-setting-button [settings]=\"settings\"></ax-analytics-setting-button>\n\n<p>{{ 'me.account.profile.title' | translate }}</p>\n<ax-delete-account-setting-button (logout)=\"logout.emit()\"></ax-delete-account-setting-button>\n", styles: [":host{display:block;max-width:var(--container-max-width);width:100%;margin:0 auto;padding:1rem}.group{display:flex;flex-direction:column;justify-content:center;gap:1rem}\n"] }]
        }], ctorParameters: () => [{ type: i1$1.SettingsService }, { type: i2$1.MatomoService }], propDecorators: { logout: [{
                type: Output
            }] } });

class AnalyticsSettingButtonModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AnalyticsSettingButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: AnalyticsSettingButtonModule, declarations: [AnalyticsSettingButtonComponent], imports: [CommonModule,
            IconsModule,
            HelperPipesModule,
            AccountButtonModule,
            MatSlideToggleModule], exports: [AnalyticsSettingButtonComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AnalyticsSettingButtonModule, imports: [CommonModule,
            IconsModule,
            HelperPipesModule,
            AccountButtonModule,
            MatSlideToggleModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AnalyticsSettingButtonModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [AnalyticsSettingButtonComponent],
                    imports: [
                        CommonModule,
                        IconsModule,
                        HelperPipesModule,
                        AccountButtonModule,
                        MatSlideToggleModule,
                    ],
                    exports: [AnalyticsSettingButtonComponent],
                }]
        }] });

class CountrySettingButtonModule extends AbstractSettingButton {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CountrySettingButtonModule, deps: null, target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: CountrySettingButtonModule, declarations: [CountrySettingButtonComponent], imports: [CommonModule, HelperPipesModule, AccountButtonModule, CountrySelectorModalModule], exports: [CountrySettingButtonComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CountrySettingButtonModule, imports: [CommonModule, HelperPipesModule, AccountButtonModule, CountrySelectorModalModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CountrySettingButtonModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [CountrySettingButtonComponent],
                    imports: [CommonModule, HelperPipesModule, AccountButtonModule, CountrySelectorModalModule],
                    exports: [CountrySettingButtonComponent],
                }]
        }] });

class DeleteAccountSettingButtonModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DeleteAccountSettingButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: DeleteAccountSettingButtonModule, declarations: [DeleteAccountSettingButtonComponent], imports: [CommonModule, AccountButtonModule, ProvidePasswordModalModule, HelperPipesModule], exports: [DeleteAccountSettingButtonComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DeleteAccountSettingButtonModule, imports: [CommonModule, AccountButtonModule, ProvidePasswordModalModule, HelperPipesModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DeleteAccountSettingButtonModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [DeleteAccountSettingButtonComponent],
                    imports: [CommonModule, AccountButtonModule, ProvidePasswordModalModule, HelperPipesModule],
                    exports: [DeleteAccountSettingButtonComponent],
                }]
        }] });

class LanguageSettingButtonModule extends AbstractSettingButton {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LanguageSettingButtonModule, deps: null, target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: LanguageSettingButtonModule, declarations: [LanguageSettingButtonComponent], imports: [CommonModule,
            IconsModule,
            HelperPipesModule,
            AccountButtonModule,
            LanguageSelectorModalModule], exports: [LanguageSettingButtonComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LanguageSettingButtonModule, imports: [CommonModule,
            IconsModule,
            HelperPipesModule,
            AccountButtonModule,
            LanguageSelectorModalModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LanguageSettingButtonModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [LanguageSettingButtonComponent],
                    imports: [
                        CommonModule,
                        IconsModule,
                        HelperPipesModule,
                        AccountButtonModule,
                        LanguageSelectorModalModule,
                    ],
                    exports: [LanguageSettingButtonComponent],
                }]
        }] });

class LoginValueSettingButtonModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LoginValueSettingButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: LoginValueSettingButtonModule, declarations: [LoginValueSettingButtonComponent], imports: [CommonModule, HelperPipesModule, AccountButtonModule, PropertyOtpVerificationModule], exports: [LoginValueSettingButtonComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LoginValueSettingButtonModule, imports: [CommonModule, HelperPipesModule, AccountButtonModule, PropertyOtpVerificationModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LoginValueSettingButtonModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [LoginValueSettingButtonComponent],
                    imports: [CommonModule, HelperPipesModule, AccountButtonModule, PropertyOtpVerificationModule],
                    exports: [LoginValueSettingButtonComponent],
                }]
        }] });

class NewsletterSettingButtonModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NewsletterSettingButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: NewsletterSettingButtonModule, declarations: [NewsletterSettingButtonComponent], imports: [CommonModule,
            IconsModule,
            HelperPipesModule,
            AccountButtonModule,
            MatSlideToggleModule], exports: [NewsletterSettingButtonComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NewsletterSettingButtonModule, imports: [CommonModule,
            IconsModule,
            HelperPipesModule,
            AccountButtonModule,
            MatSlideToggleModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NewsletterSettingButtonModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [NewsletterSettingButtonComponent],
                    imports: [
                        CommonModule,
                        IconsModule,
                        HelperPipesModule,
                        AccountButtonModule,
                        MatSlideToggleModule,
                    ],
                    exports: [NewsletterSettingButtonComponent],
                }]
        }] });

class PasswordSettingButtonModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PasswordSettingButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: PasswordSettingButtonModule, declarations: [PasswordSettingButtonComponent], imports: [CommonModule,
            HelperPipesModule,
            AccountButtonModule,
            ChangePasswordModalModule,
            MatSnackBarModule], exports: [PasswordSettingButtonComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PasswordSettingButtonModule, imports: [CommonModule,
            HelperPipesModule,
            AccountButtonModule,
            ChangePasswordModalModule,
            MatSnackBarModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PasswordSettingButtonModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [PasswordSettingButtonComponent],
                    imports: [
                        CommonModule,
                        HelperPipesModule,
                        AccountButtonModule,
                        ChangePasswordModalModule,
                        MatSnackBarModule,
                    ],
                    exports: [PasswordSettingButtonComponent],
                }]
        }] });

class AccountSettingsModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountSettingsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: AccountSettingsModule, declarations: [AccountSettingsComponent], imports: [CommonModule,
            HelperPipesModule,
            CountrySettingButtonModule,
            DeleteAccountSettingButtonModule,
            LanguageSettingButtonModule,
            LoginValueSettingButtonModule,
            NewsletterSettingButtonModule,
            PasswordSettingButtonModule,
            AnalyticsSettingButtonModule,
            AccountNavigationModule], exports: [AccountSettingsComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountSettingsModule, imports: [CommonModule,
            HelperPipesModule,
            CountrySettingButtonModule,
            DeleteAccountSettingButtonModule,
            LanguageSettingButtonModule,
            LoginValueSettingButtonModule,
            NewsletterSettingButtonModule,
            PasswordSettingButtonModule,
            AnalyticsSettingButtonModule,
            AccountNavigationModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountSettingsModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [AccountSettingsComponent],
                    imports: [
                        CommonModule,
                        HelperPipesModule,
                        CountrySettingButtonModule,
                        DeleteAccountSettingButtonModule,
                        LanguageSettingButtonModule,
                        LoginValueSettingButtonModule,
                        NewsletterSettingButtonModule,
                        PasswordSettingButtonModule,
                        AnalyticsSettingButtonModule,
                        AccountNavigationModule,
                    ],
                    exports: [AccountSettingsComponent],
                }]
        }] });

class AccountComponent {
    constructor(billing, contacts, settings, backendUrl, _elementRef, _overlay, _profile) {
        this.billing = billing;
        this.contacts = contacts;
        this.settings = settings;
        this.backendUrl = backendUrl;
        this._elementRef = _elementRef;
        this._overlay = _overlay;
        this._profile = _profile;
        this.logout = new EventEmitter();
        this.myProfile$ = this._profile.getMeProfile('FULL').pipe(shareReplay(1));
        this.title$ = this.myProfile$.pipe(map((profile) => profileName(profile)));
        this.description$ = this.myProfile$.pipe(map((profile) => profileUsername(profile)));
        this.avatar$ = this.myProfile$.pipe(map((profile) => avatarUrl(profile)));
    }
    openFeedbackModal() {
        this._overlay.createModal(this._elementRef, FeedbackSearchComponent, {});
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountComponent, deps: [{ token: ACCOUNT_BILLING }, { token: ACCOUNT_CONTACTS }, { token: ACCOUNT_SETTINGS }, { token: BACKEND_URL }, { token: i0.ElementRef }, { token: i2$2.OverlayService }, { token: i1$1.ProfileService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: AccountComponent, selector: "ax-account", outputs: { logout: "logout" }, ngImport: i0, template: "<div class=\"route content\">\n  <ax-account-header\n    [avatar]=\"(avatar$ | async) || undefined\"\n    [title]=\"(title$ | async) || undefined\"\n    [description]=\"(description$ | async) || undefined\"\n  >\n    <ax-account-button\n      *ngIf=\"billing\"\n      class=\"tier-button\"\n      icon=\"lightning-bolt-outline\"\n      [title]=\"'tiers.upgrade' | translate\"\n      [url]=\"'/account/billing/tiers'\"\n      color=\"primary\"\n    ></ax-account-button>\n  </ax-account-header>\n\n  <div class=\"body\">\n    <ax-account-button\n      icon=\"account-outline\"\n      [title]=\"'me.account.profile.title' | translate\"\n      [url]=\"'/account/my-account'\"\n      spacing=\"MEDIUM\"\n    ></ax-account-button>\n\n    <ax-account-button\n      *ngIf=\"settings\"\n      icon=\"cog-outline\"\n      [title]=\"'label.settings' | translate\"\n      [url]=\"'/account/settings'\"\n    ></ax-account-button>\n\n    <ax-account-button\n      *ngIf=\"contacts\"\n      icon=\"account-group-outline\"\n      [title]=\"'label.contacts' | translate\"\n      [url]=\"'/account/contacts'\"\n    ></ax-account-button>\n\n    <ax-account-button\n      *ngIf=\"billing\"\n      icon=\"receipt-text-outline\"\n      [title]=\"'settings.payment.title' | translate\"\n      [url]=\"'/account/billing'\"\n    ></ax-account-button>\n\n    <ng-content></ng-content>\n\n    <ax-account-button\n      icon=\"xml\"\n      [title]=\"'settings.account.organisation.developer.title' | translate\"\n      [url]=\"'/account/developer'\"\n      spacing=\"MEDIUM\"\n    ></ax-account-button>\n\n    <ax-account-button\n      icon=\"gavel\"\n      [title]=\"'label.policies' | translate\"\n      [url]=\"backendUrl.value + '/policy'\"\n      target=\"_blank\"\n    ></ax-account-button>\n\n    <ax-account-button\n      icon=\"help-circle-outline\"\n      [title]=\"'label.feedback' | translate\"\n      (click)=\"openFeedbackModal()\"\n    ></ax-account-button>\n\n    <ax-account-button\n      icon=\"logout\"\n      outline\n      color=\"grey\"\n      [title]=\"'label.logout' | translate\"\n      (click)=\"logout.emit()\"\n    ></ax-account-button>\n  </div>\n</div>\n", styles: [":host{display:block;max-width:var(--container-max-width);width:100%;margin:0 auto;padding:1rem}.content,.body{display:flex;flex-direction:column;gap:.75rem}.tier-button{margin-top:1rem}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AccountButtonComponent, selector: "ax-account-button", inputs: ["title", "hint", "color", "postIcon"] }, { kind: "component", type: AccountHeaderComponent, selector: "ax-account-header", inputs: ["avatar", "title", "description"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-account', template: "<div class=\"route content\">\n  <ax-account-header\n    [avatar]=\"(avatar$ | async) || undefined\"\n    [title]=\"(title$ | async) || undefined\"\n    [description]=\"(description$ | async) || undefined\"\n  >\n    <ax-account-button\n      *ngIf=\"billing\"\n      class=\"tier-button\"\n      icon=\"lightning-bolt-outline\"\n      [title]=\"'tiers.upgrade' | translate\"\n      [url]=\"'/account/billing/tiers'\"\n      color=\"primary\"\n    ></ax-account-button>\n  </ax-account-header>\n\n  <div class=\"body\">\n    <ax-account-button\n      icon=\"account-outline\"\n      [title]=\"'me.account.profile.title' | translate\"\n      [url]=\"'/account/my-account'\"\n      spacing=\"MEDIUM\"\n    ></ax-account-button>\n\n    <ax-account-button\n      *ngIf=\"settings\"\n      icon=\"cog-outline\"\n      [title]=\"'label.settings' | translate\"\n      [url]=\"'/account/settings'\"\n    ></ax-account-button>\n\n    <ax-account-button\n      *ngIf=\"contacts\"\n      icon=\"account-group-outline\"\n      [title]=\"'label.contacts' | translate\"\n      [url]=\"'/account/contacts'\"\n    ></ax-account-button>\n\n    <ax-account-button\n      *ngIf=\"billing\"\n      icon=\"receipt-text-outline\"\n      [title]=\"'settings.payment.title' | translate\"\n      [url]=\"'/account/billing'\"\n    ></ax-account-button>\n\n    <ng-content></ng-content>\n\n    <ax-account-button\n      icon=\"xml\"\n      [title]=\"'settings.account.organisation.developer.title' | translate\"\n      [url]=\"'/account/developer'\"\n      spacing=\"MEDIUM\"\n    ></ax-account-button>\n\n    <ax-account-button\n      icon=\"gavel\"\n      [title]=\"'label.policies' | translate\"\n      [url]=\"backendUrl.value + '/policy'\"\n      target=\"_blank\"\n    ></ax-account-button>\n\n    <ax-account-button\n      icon=\"help-circle-outline\"\n      [title]=\"'label.feedback' | translate\"\n      (click)=\"openFeedbackModal()\"\n    ></ax-account-button>\n\n    <ax-account-button\n      icon=\"logout\"\n      outline\n      color=\"grey\"\n      [title]=\"'label.logout' | translate\"\n      (click)=\"logout.emit()\"\n    ></ax-account-button>\n  </div>\n</div>\n", styles: [":host{display:block;max-width:var(--container-max-width);width:100%;margin:0 auto;padding:1rem}.content,.body{display:flex;flex-direction:column;gap:.75rem}.tier-button{margin-top:1rem}\n"] }]
        }], ctorParameters: () => [{ type: undefined, decorators: [{
                    type: Inject,
                    args: [ACCOUNT_BILLING]
                }] }, { type: undefined, decorators: [{
                    type: Inject,
                    args: [ACCOUNT_CONTACTS]
                }] }, { type: undefined, decorators: [{
                    type: Inject,
                    args: [ACCOUNT_SETTINGS]
                }] }, { type: i5.BehaviorSubject, decorators: [{
                    type: Inject,
                    args: [BACKEND_URL]
                }] }, { type: i0.ElementRef }, { type: i2$2.OverlayService }, { type: i1$1.ProfileService }], propDecorators: { logout: [{
                type: Output
            }] } });

class ApiKeysButtonComponent {
    constructor(_elementRef, _overlayService) {
        this._elementRef = _elementRef;
        this._overlayService = _overlayService;
    }
    OpenApiSettings() {
        this._overlayService.createModal(this._elementRef, ApiKeysComponent, {
            title: 'settings.account.organisation.developer.apiKeys.title',
        });
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ApiKeysButtonComponent, deps: [{ token: i0.ElementRef }, { token: i2$2.OverlayService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ApiKeysButtonComponent, selector: "ax-api-keys-button", ngImport: i0, template: "<ax-account-button\n  icon=\"api\"\n  [title]=\"'settings.account.organisation.developer.apiKeys.title' | translate\"\n  [ariaLabel]=\"'settings.account.organisation.developer.apiKeys.title' | translate\"\n  (click)=\"OpenApiSettings()\"\n></ax-account-button>\n", styles: [""], dependencies: [{ kind: "component", type: AccountButtonComponent, selector: "ax-account-button", inputs: ["title", "hint", "color", "postIcon"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ApiKeysButtonComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-api-keys-button', template: "<ax-account-button\n  icon=\"api\"\n  [title]=\"'settings.account.organisation.developer.apiKeys.title' | translate\"\n  [ariaLabel]=\"'settings.account.organisation.developer.apiKeys.title' | translate\"\n  (click)=\"OpenApiSettings()\"\n></ax-account-button>\n" }]
        }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i2$2.OverlayService }] });

class AccountDeveloperComponent {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountDeveloperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: AccountDeveloperComponent, selector: "ax-account-developer", ngImport: i0, template: "<ax-account-navigation\n  [title]=\"'settings.account.organisation.developer.title' | translate\"\n></ax-account-navigation>\n\n<ax-api-keys-button></ax-api-keys-button>\n", styles: [":host{display:flex;flex-direction:column;gap:1rem;max-width:var(--container-max-width);width:100%;margin:0 auto;padding:1rem}\n"], dependencies: [{ kind: "component", type: AccountNavigationComponent, selector: "ax-account-navigation", inputs: ["title"] }, { kind: "component", type: ApiKeysButtonComponent, selector: "ax-api-keys-button" }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountDeveloperComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-account-developer', template: "<ax-account-navigation\n  [title]=\"'settings.account.organisation.developer.title' | translate\"\n></ax-account-navigation>\n\n<ax-api-keys-button></ax-api-keys-button>\n", styles: [":host{display:flex;flex-direction:column;gap:1rem;max-width:var(--container-max-width);width:100%;margin:0 auto;padding:1rem}\n"] }]
        }] });

class ApiKeysButtonModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ApiKeysButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: ApiKeysButtonModule, declarations: [ApiKeysButtonComponent], imports: [CommonModule, AccountButtonModule, HelperPipesModule, ApiKeysModule], exports: [ApiKeysButtonComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ApiKeysButtonModule, imports: [CommonModule, AccountButtonModule, HelperPipesModule, ApiKeysModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ApiKeysButtonModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [ApiKeysButtonComponent],
                    imports: [CommonModule, AccountButtonModule, HelperPipesModule, ApiKeysModule],
                    exports: [ApiKeysButtonComponent],
                }]
        }] });

class AccountDeveloperModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountDeveloperModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: AccountDeveloperModule, declarations: [AccountDeveloperComponent], imports: [CommonModule, HelperPipesModule, AccountNavigationModule, ApiKeysButtonModule], exports: [AccountDeveloperComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountDeveloperModule, imports: [CommonModule, HelperPipesModule, AccountNavigationModule, ApiKeysButtonModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountDeveloperModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [AccountDeveloperComponent],
                    imports: [CommonModule, HelperPipesModule, AccountNavigationModule, ApiKeysButtonModule],
                    exports: [AccountDeveloperComponent],
                }]
        }] });

class EditAccountPropertyComponent {
    constructor(_propertiesService, _settingsService, _translateService, _overlayService) {
        this._propertiesService = _propertiesService;
        this._settingsService = _settingsService;
        this._translateService = _translateService;
        this._overlayService = _overlayService;
        this.propertyChanged = new EventEmitter();
    }
    ngOnInit() {
        this.propertyForm = (PropertyFormControl.create(this.property, [
            CustomValidators.propertyRequired,
            CustomValidators.propertyValid,
        ]));
    }
    saveProperty() {
        this._saveObservable$()
            .pipe(first())
            .subscribe({
            next: () => {
                this.propertyChanged.emit(this.propertyForm.value);
            },
            error: (error) => {
                this._handleError(error, this.property.type);
            },
        });
    }
    _handleError(errorResponse, propertyType) {
        switch (errorResponse?.error) {
            case ErrorType.PROPERTY_NOT_VALID:
                this.error = this._translateService.instant('property.validation.invalid', {
                    propertyType: this._translateService
                        .instant(`property.${propertyType?.toUpperCase()}.label`)
                        .toLowerCase(),
                });
                break;
            case ErrorType.USERNAME_NOT_AVAILABLE:
                this.error = this._translateService.instant('username.error.title');
                break;
            default:
                this.error = this._translateService.instant('error.default.title');
                break;
        }
    }
    _saveObservable$() {
        let saveObservable;
        const property = this.propertyForm.value;
        if (property.type === ProfilePropertyRepresentation.TypeEnum.USERNAME) {
            saveObservable = this._settingsService
                .setUsername(property.value)
                .pipe(map(() => property));
        }
        else {
            saveObservable = this._propertiesService.updateProperty(property.id, property);
        }
        return saveObservable;
    }
    cancel() {
        this._overlayService.closeModal();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: EditAccountPropertyComponent, deps: [{ token: i1$1.PropertiesService }, { token: i1$1.SettingsService }, { token: i2$1.TranslateService }, { token: i2$2.OverlayService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: EditAccountPropertyComponent, selector: "ax-edit-account-property", inputs: { property: "property" }, outputs: { propertyChanged: "propertyChanged" }, ngImport: i0, template: "<ax-snackbar [open]=\"!!error\" color=\"red\" (didClose)=\"error = undefined\">{{ error }}</ax-snackbar>\n<ax-property-edit [form]=\"propertyForm\" [required]=\"true\"></ax-property-edit>\n\n<div class=\"h-button-wrapper\">\n  <button axButton class=\"button\" (click)=\"cancel()\">\n    {{ 'label.cancel' | translate }}\n  </button>\n  <button\n    axButton\n    filled\n    class=\"button\"\n    color=\"primary\"\n    [disabled]=\"propertyForm.invalid\"\n    (click)=\"saveProperty()\"\n  >\n    {{ 'label.save' | translate }}\n  </button>\n</div>\n", styles: [":host{display:block;padding:1rem}.button.ax-button{border-radius:var(--border-radius-button, 20px)}\n"], dependencies: [{ kind: "component", type: i4$2.PropertyEditComponent, selector: "ax-property-edit", inputs: ["isIndividual", "isProposalSubscribeForm"] }, { kind: "directive", type: i2.ButtonDirective, selector: "[axButton]", inputs: ["color", "labelHideMobile", "smallButton", "bigButton", "fullWidth", "filled", "outline", "icon-button", "hoverLabel", "hover", "lowercase", "disabled"] }, { kind: "component", type: i6.SnackbarComponent, selector: "ax-snackbar", inputs: ["type", "timeout", "dismissible", "open", "icon", "color"], outputs: ["didClose"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: EditAccountPropertyComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-edit-account-property', template: "<ax-snackbar [open]=\"!!error\" color=\"red\" (didClose)=\"error = undefined\">{{ error }}</ax-snackbar>\n<ax-property-edit [form]=\"propertyForm\" [required]=\"true\"></ax-property-edit>\n\n<div class=\"h-button-wrapper\">\n  <button axButton class=\"button\" (click)=\"cancel()\">\n    {{ 'label.cancel' | translate }}\n  </button>\n  <button\n    axButton\n    filled\n    class=\"button\"\n    color=\"primary\"\n    [disabled]=\"propertyForm.invalid\"\n    (click)=\"saveProperty()\"\n  >\n    {{ 'label.save' | translate }}\n  </button>\n</div>\n", styles: [":host{display:block;padding:1rem}.button.ax-button{border-radius:var(--border-radius-button, 20px)}\n"] }]
        }], ctorParameters: () => [{ type: i1$1.PropertiesService }, { type: i1$1.SettingsService }, { type: i2$1.TranslateService }, { type: i2$2.OverlayService }], propDecorators: { property: [{
                type: Input
            }], propertyChanged: [{
                type: Output
            }] } });

class PropertyButtonComponent {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PropertyButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: PropertyButtonComponent, selector: "ax-property-button", inputs: { property: "property", ariaLabel: "ariaLabel" }, ngImport: i0, template: "<ax-account-button\n  [title]=\"property | propertyTypeLabel\"\n  [icon]=\"property | propertyIcon\"\n  [ariaLabel]=\"ariaLabel\"\n>\n  <ax-property-value-view class=\"data\" [property]=\"property\"></ax-property-value-view>\n</ax-account-button>\n", styles: [".data{font-weight:400}\n"], dependencies: [{ kind: "component", type: AccountButtonComponent, selector: "ax-account-button", inputs: ["title", "hint", "color", "postIcon"] }, { kind: "component", type: i2$3.PropertyValueViewComponent, selector: "ax-property-value-view", inputs: ["property", "showVerificationLabel", "clickable", "isIndividual", "params"] }, { kind: "pipe", type: i2$1.PropertyTypeLabelPipe, name: "propertyTypeLabel" }, { kind: "pipe", type: i2$1.PropertyIconPipe, name: "propertyIcon" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PropertyButtonComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-property-button', template: "<ax-account-button\n  [title]=\"property | propertyTypeLabel\"\n  [icon]=\"property | propertyIcon\"\n  [ariaLabel]=\"ariaLabel\"\n>\n  <ax-property-value-view class=\"data\" [property]=\"property\"></ax-property-value-view>\n</ax-account-button>\n", styles: [".data{font-weight:400}\n"] }]
        }], propDecorators: { property: [{
                type: Input
            }], ariaLabel: [{
                type: Input
            }] } });

class MyAccountComponent {
    constructor(_profileService, _overlayService, _elementRef) {
        this._profileService = _profileService;
        this._overlayService = _overlayService;
        this._elementRef = _elementRef;
        this.properties$ = new BehaviorSubject([]);
        this.subscriptions = new Subscription();
    }
    ngOnInit() {
        this.subscriptions.add(this._profileService.getMeProfile('FULL').subscribe((profile) => {
            const properties = profile.propertyContexts
                ?.filter((context) => !isOfType(context, ContextTypeRepresentation.NameEnum.GROUP, ContextTypeRepresentation.NameEnum.PROPOSAL, ContextTypeRepresentation.NameEnum.MISC))
                .filter((property) => property.type !== PropertyTypeRepresentation.NameEnum.USERNAME)
                .flatMap((c) => c.properties)
                .filter((p) => p);
            this.properties$.next(properties);
        }));
    }
    ngOnDestroy() {
        this.subscriptions.unsubscribe();
    }
    propertyEdit(property) {
        this._overlayService.createModal(this._elementRef, EditAccountPropertyComponent, {
            init: (component) => {
                component.property = property;
                component.propertyChanged.pipe(first()).subscribe((property) => {
                    const currentProperties = this.properties$.value;
                    const foundPropertyIndex = currentProperties.findIndex((p) => p.id === property.id);
                    if (foundPropertyIndex !== -1) {
                        currentProperties.splice(foundPropertyIndex, 1, property);
                        this.properties$.next(currentProperties);
                    }
                    this._overlayService.closeModal();
                });
            },
        });
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MyAccountComponent, deps: [{ token: i1$1.ProfileService }, { token: i2$2.OverlayService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: MyAccountComponent, selector: "ax-my-account", ngImport: i0, template: "<ax-account-navigation [title]=\"'label.properties' | translate\"></ax-account-navigation>\n\n<ng-container *ngFor=\"let property of properties$ | async\">\n  <ax-property-button\n    [property]=\"property\"\n    [ariaLabel]=\"(property | propertyTypeLabel) + ' ' + (property | propertyDisplayValue)\"\n    (click)=\"propertyEdit(property)\"\n  ></ax-property-button>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;gap:1rem;max-width:var(--container-max-width);width:100%;margin:0 auto;padding:1rem}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: AccountNavigationComponent, selector: "ax-account-navigation", inputs: ["title"] }, { kind: "component", type: PropertyButtonComponent, selector: "ax-property-button", inputs: ["property", "ariaLabel"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.PropertyDisplayValuePipe, name: "propertyDisplayValue" }, { kind: "pipe", type: i2$1.PropertyTypeLabelPipe, name: "propertyTypeLabel" }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MyAccountComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-my-account', template: "<ax-account-navigation [title]=\"'label.properties' | translate\"></ax-account-navigation>\n\n<ng-container *ngFor=\"let property of properties$ | async\">\n  <ax-property-button\n    [property]=\"property\"\n    [ariaLabel]=\"(property | propertyTypeLabel) + ' ' + (property | propertyDisplayValue)\"\n    (click)=\"propertyEdit(property)\"\n  ></ax-property-button>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;gap:1rem;max-width:var(--container-max-width);width:100%;margin:0 auto;padding:1rem}\n"] }]
        }], ctorParameters: () => [{ type: i1$1.ProfileService }, { type: i2$2.OverlayService }, { type: i0.ElementRef }] });

class EditAccountPropertyModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: EditAccountPropertyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: EditAccountPropertyModule, declarations: [EditAccountPropertyComponent], imports: [CommonModule,
            PropertyEditModule,
            FormsModule,
            ReactiveFormsModule,
            ButtonModule,
            HelperPipesModule,
            SnackbarModule], exports: [EditAccountPropertyComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: EditAccountPropertyModule, imports: [CommonModule,
            PropertyEditModule,
            FormsModule,
            ReactiveFormsModule,
            ButtonModule,
            HelperPipesModule,
            SnackbarModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: EditAccountPropertyModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [EditAccountPropertyComponent],
                    imports: [
                        CommonModule,
                        PropertyEditModule,
                        FormsModule,
                        ReactiveFormsModule,
                        ButtonModule,
                        HelperPipesModule,
                        SnackbarModule,
                    ],
                    exports: [EditAccountPropertyComponent],
                }]
        }] });

class MyAccountModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MyAccountModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: MyAccountModule, declarations: [MyAccountComponent, PropertyButtonComponent], imports: [CommonModule,
            HelperPipesModule,
            AccountButtonModule,
            PropertyViewModule,
            EditAccountPropertyModule,
            AccountNavigationModule] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MyAccountModule, imports: [CommonModule,
            HelperPipesModule,
            AccountButtonModule,
            PropertyViewModule,
            EditAccountPropertyModule,
            AccountNavigationModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MyAccountModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [MyAccountComponent, PropertyButtonComponent],
                    imports: [
                        CommonModule,
                        HelperPipesModule,
                        AccountButtonModule,
                        PropertyViewModule,
                        EditAccountPropertyModule,
                        AccountNavigationModule,
                    ],
                }]
        }] });

class AccountModule {
    static forChild({ account, settings, contacts, billing, childRoutes, back = true, }) {
        const routes = [
            {
                path: '',
                ...account,
            },
            {
                path: 'my-account',
                component: MyAccountComponent,
            },
            ...(childRoutes || []),
        ];
        if (settings) {
            routes.push({ path: 'settings', ...settings });
        }
        if (contacts) {
            routes.push({ path: 'contacts', ...contacts });
        }
        if (billing) {
            routes.push({ path: 'billing', ...billing });
        }
        routes.push({ path: 'developer', component: AccountDeveloperComponent });
        return {
            ngModule: AccountModule,
            providers: [
                { provide: ROUTES, multi: true, useValue: routes },
                {
                    provide: ACCOUNT_SETTINGS,
                    useValue: !!settings,
                },
                {
                    provide: ACCOUNT_CONTACTS,
                    useValue: !!contacts,
                },
                {
                    provide: ACCOUNT_BILLING,
                    useValue: !!billing,
                },
                {
                    provide: ACCOUNT_BACK,
                    useValue: back,
                },
            ],
        };
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: AccountModule, declarations: [AccountComponent, AccountHeaderComponent], imports: [CommonModule,
            RouterModule,
            AvatarModule,
            IconsModule,
            ButtonModule,
            HelperPipesModule,
            ContrastModule,
            MyAccountModule,
            AccountDeveloperModule,
            AccountButtonModule], exports: [AccountComponent,
            AccountHeaderComponent,
            AccountButtonModule,
            AccountSettingsModule,
            AccountNavigationModule] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountModule, imports: [CommonModule,
            RouterModule,
            AvatarModule,
            IconsModule,
            ButtonModule,
            HelperPipesModule,
            ContrastModule,
            MyAccountModule,
            AccountDeveloperModule,
            AccountButtonModule, AccountButtonModule,
            AccountSettingsModule,
            AccountNavigationModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [AccountComponent, AccountHeaderComponent],
                    imports: [
                        CommonModule,
                        RouterModule,
                        AvatarModule,
                        IconsModule,
                        ButtonModule,
                        HelperPipesModule,
                        ContrastModule,
                        MyAccountModule,
                        AccountDeveloperModule,
                        AccountButtonModule,
                    ],
                    exports: [
                        AccountComponent,
                        AccountHeaderComponent,
                        AccountButtonModule,
                        AccountSettingsModule,
                        AccountNavigationModule,
                    ],
                }]
        }] });

/**
 * Generated bundle index. Do not edit.
 */

export { AccountButtonComponent, AccountButtonModule, AccountComponent, AccountHeaderComponent, AccountModule, AccountNavigationComponent, AccountNavigationModule, AccountSettingsComponent, AccountSettingsModule };
//# sourceMappingURL=aztrix-components-account.mjs.map
