import * as i0 from '@angular/core';
import { inject, ViewEncapsulation, Component } from '@angular/core';
import * as i1 from '@acorex/components/avatar';
import { AXAvatarModule } from '@acorex/components/avatar';
import { AXButtonModule } from '@acorex/components/button';
import { AXCheckBoxModule } from '@acorex/components/check-box';
import { AXDecoratorModule } from '@acorex/components/decorators';
import { AXFormModule } from '@acorex/components/form';
import { AXImageModule } from '@acorex/components/image';
import { AXLabelModule } from '@acorex/components/label';
import { AXLoadingModule } from '@acorex/components/loading';
import { AXTextBoxModule } from '@acorex/components/text-box';
import * as i2 from '@acorex/core/translation';
import { AXTranslationModule } from '@acorex/core/translation';
import { AXPSessionService } from '@acorex/platform/auth';
import { AXP_PLATFORM_CONFIG_TOKEN } from '@acorex/platform/common';
import { AXPLogoComponent, AXPUserAvatarComponent } from '@acorex/platform/layout/components';
import * as i1$1 from '@angular/common';
import { CommonModule } from '@angular/common';
import { Router } from '@angular/router';
import { c as AXPTenantChooserListComponent } from './acorex-modules-auth-acorex-modules-auth-9Tz_Jq63.mjs';

class AXPAuthTenantChooserComponent {
    constructor() {
        this.router = inject(Router);
        this.platformConfig = inject(AXP_PLATFORM_CONFIG_TOKEN);
        this.sessionService = inject(AXPSessionService);
        this.user = this.sessionService.user;
    }
    async handleSignout() {
        await this.sessionService.signout();
        this.router.navigate(['/auth/login']);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AXPAuthTenantChooserComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: AXPAuthTenantChooserComponent, isStandalone: true, selector: "axp-auth-tenant-chooser", ngImport: i0, template: "<main *translate=\"let t\"\n  class=\"ax-w-full ax-space-y-10 ax-h-[100vh] ax-flex ax-flex-col ax-items-center ax-justify-center ax-bg-lightest md:ax-bg-default\">\n  <section>\n    <axp-logo [source]=\"platformConfig.logo?.full\" [attr.alt]=\"platformConfig.title\"\n      class=\"ax-w-36 ax-mx-auto ax-text-2xl ax-font-bold\"></axp-logo>\n  </section>\n  <section class=\"ax-flex ax-justify-center\">\n    <div\n      class=\"ax-flex ax-gap-2 ax-justify-center ax-text-center ax-flex-col ax-items-center ax-border ax-rounded-lg ax-shadow-lg ax-p-6 lg:ax-w-[45vw] xl:ax-w-[25vw] ax-w-[90vw]\">\n      <ax-avatar class=\"ax-rounded-full\" [size]=\"72\">\n        @if (user?.avatar) {\n        <!-- <ax-image [src]=\"user?.avatar\"></ax-image> -->\n        <axp-user-avatar [size]=\"72\" [userId]=\"user?.id!\"></axp-user-avatar>\n        }\n      </ax-avatar>\n      <h2 class=\"md:ax-text-lg ax-font-medium\">{{ '@auth:welcome.message' | translate | async }}, {{ user?.title }}</h2>\n      <p class=\"ax-text-neutral-500 ax-text-sm md:ax-text-base ax-font-medium\">\n        {{ '@auth:tenant-chooser.description' | translate | async }}\n      </p>\n      <div class=\"ax-mt-3 ax-w-full\">\n        <axp-tenant-chooser-list></axp-tenant-chooser-list>\n      </div>\n    </div>\n  </section>\n  <section>\n    <p class=\"ax-text-neutral-400 ax-text-sm\">\n      {{ '@auth:tenant-chooser.footer' | translate | async }}\n      <a (click)=\"handleSignout()\" class=\"ax-text-primary ax-cursor-pointer hover:ax-underline ax-font-medium\">\n        {{ '@auth:backLogin' | translate | async }}\n      </a>\n    </p>\n  </section>\n</main>", styles: [":host{display:contents}.gradient{background:-webkit-linear-gradient(var(--ax-current-v1),var(--ax-current-v2));background-clip:text;-webkit-text-fill-color:transparent}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXFormModule }, { kind: "ngmodule", type: AXTextBoxModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "ngmodule", type: AXLabelModule }, { kind: "ngmodule", type: AXCheckBoxModule }, { kind: "ngmodule", type: AXAvatarModule }, { kind: "component", type: i1.AXAvatarComponent, selector: "ax-avatar", inputs: ["color", "size", "shape", "look"], outputs: ["sizeChange"] }, { kind: "ngmodule", type: AXImageModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: AXPLogoComponent, selector: "axp-logo", inputs: ["source"] }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "directive", type: i2.AXTranslatorDirective, selector: "[translate]" }, { kind: "component", type: AXPUserAvatarComponent, selector: "axp-user-avatar", inputs: ["size", "userId"] }, { kind: "component", type: AXPTenantChooserListComponent, selector: "axp-tenant-chooser-list", inputs: ["simple"], outputs: ["tenantChosen"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.AXTranslatorPipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AXPAuthTenantChooserComponent, decorators: [{
            type: Component,
            args: [{ selector: 'axp-auth-tenant-chooser', imports: [
                        CommonModule,
                        AXFormModule,
                        AXTextBoxModule,
                        AXButtonModule,
                        AXLabelModule,
                        AXCheckBoxModule,
                        AXAvatarModule,
                        AXImageModule,
                        AXDecoratorModule,
                        AXPLogoComponent,
                        AXLoadingModule,
                        AXTranslationModule,
                        AXPUserAvatarComponent,
                        AXPTenantChooserListComponent,
                    ], encapsulation: ViewEncapsulation.None, template: "<main *translate=\"let t\"\n  class=\"ax-w-full ax-space-y-10 ax-h-[100vh] ax-flex ax-flex-col ax-items-center ax-justify-center ax-bg-lightest md:ax-bg-default\">\n  <section>\n    <axp-logo [source]=\"platformConfig.logo?.full\" [attr.alt]=\"platformConfig.title\"\n      class=\"ax-w-36 ax-mx-auto ax-text-2xl ax-font-bold\"></axp-logo>\n  </section>\n  <section class=\"ax-flex ax-justify-center\">\n    <div\n      class=\"ax-flex ax-gap-2 ax-justify-center ax-text-center ax-flex-col ax-items-center ax-border ax-rounded-lg ax-shadow-lg ax-p-6 lg:ax-w-[45vw] xl:ax-w-[25vw] ax-w-[90vw]\">\n      <ax-avatar class=\"ax-rounded-full\" [size]=\"72\">\n        @if (user?.avatar) {\n        <!-- <ax-image [src]=\"user?.avatar\"></ax-image> -->\n        <axp-user-avatar [size]=\"72\" [userId]=\"user?.id!\"></axp-user-avatar>\n        }\n      </ax-avatar>\n      <h2 class=\"md:ax-text-lg ax-font-medium\">{{ '@auth:welcome.message' | translate | async }}, {{ user?.title }}</h2>\n      <p class=\"ax-text-neutral-500 ax-text-sm md:ax-text-base ax-font-medium\">\n        {{ '@auth:tenant-chooser.description' | translate | async }}\n      </p>\n      <div class=\"ax-mt-3 ax-w-full\">\n        <axp-tenant-chooser-list></axp-tenant-chooser-list>\n      </div>\n    </div>\n  </section>\n  <section>\n    <p class=\"ax-text-neutral-400 ax-text-sm\">\n      {{ '@auth:tenant-chooser.footer' | translate | async }}\n      <a (click)=\"handleSignout()\" class=\"ax-text-primary ax-cursor-pointer hover:ax-underline ax-font-medium\">\n        {{ '@auth:backLogin' | translate | async }}\n      </a>\n    </p>\n  </section>\n</main>", styles: [":host{display:contents}.gradient{background:-webkit-linear-gradient(var(--ax-current-v1),var(--ax-current-v2));background-clip:text;-webkit-text-fill-color:transparent}\n"] }]
        }] });

export { AXPAuthTenantChooserComponent };
//# sourceMappingURL=acorex-modules-auth-tenant-chooser.component-DFJoSg_2.mjs.map
