{"version":3,"file":"acorex-platform-themes-default-error-401.component-B1nsdpTY.mjs","sources":["../../../../libs/platform/themes/default/src/lib/pages/errors/error-401/error-401.component.ts","../../../../libs/platform/themes/default/src/lib/pages/errors/error-401/error-401.component.html"],"sourcesContent":["import { AXButtonModule } from '@acorex/components/button';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { AXPSessionService } from '@acorex/platform/auth';\nimport { AXPHomePageService } from '@acorex/platform/common';\nimport { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { Router } from '@angular/router';\n\n@Component({\n  selector: 'axp-error-401',\n  templateUrl: './error-401.component.html',\n  styleUrls: ['./error-401.component.scss'],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  imports: [CommonModule, AXButtonModule, AXTranslationModule],\n})\nexport class AXPError401Component {\n  //#region ----   Services & Dependencies   ----\n\n  private readonly sessionService = inject(AXPSessionService);\n  private readonly homePageService = inject(AXPHomePageService);\n  private readonly router = inject(Router);\n\n  //#endregion\n\n  //#region ----   State   ----\n\n  protected readonly isAuthorized$ = this.sessionService.isAuthorized$;\n\n  //#endregion\n\n  //#region ----   UI Handlers   ----\n\n  protected async goHome(): Promise<void> {\n    if (this.sessionService.tenant?.id == null) {\n      await this.router.navigate(['/auth/account/tenant-chooser']);\n      return;\n    }\n\n    if (this.sessionService.application?.id == null) {\n      await this.router.navigate(['/auth/account/app-chooser']);\n      return;\n    }\n\n    await this.homePageService.navigateTo();\n  }\n\n  protected async signIn(): Promise<void> {\n    await this.router.navigate(['/auth/login']);\n  }\n\n  //#endregion\n}\n","<div\n  class=\"axp-error-401 ax-h-full ax-flex ax-flex-col ax-gap-8 ax-items-center ax-justify-center ax-bg-lightest dark:ax-bg-darkest\"\n>\n  <img\n    class=\"axp-error-401__image ax-w-3/4 md:ax-w-1/2 lg:ax-w-1/3 xl:ax-w-1/4\"\n    src=\"/assets/images/error/error-401.svg\"\n    [attr.alt]=\"'@general:errors.401.image-alt' | translate | async\"\n  />\n  <div class=\"ax-flex ax-flex-col ax-items-center ax-gap-2 md:ax-gap-4 ax-text-center ax-px-4\">\n    <h1 class=\"ax-font-bold ax-text-2xl md:ax-text-4xl ax-text-neutral-900 dark:ax-text-neutral-50\">\n      {{ '@general:errors.401.title' | translate | async }}\n    </h1>\n    <p class=\"md:ax-text-lg ax-text-neutral-500 dark:ax-text-neutral-300\">\n      {{ '@general:errors.401.description' | translate | async }}\n    </p>\n  </div>\n  <div class=\"ax-flex ax-flex-col ax-gap-2 md:ax-gap-4 md:ax-flex-row\">\n    @if (isAuthorized$ | async) {\n      <ax-button\n        (onClick)=\"goHome()\"\n        class=\"ax-px-4\"\n        color=\"primary\"\n        [text]=\"'@general:errors.401.actions.go-home.title' | translate | async\"\n      ></ax-button>\n    } @else {\n      <ax-button\n        (onClick)=\"signIn()\"\n        class=\"ax-px-4\"\n        color=\"primary\"\n        [text]=\"'@general:errors.401.actions.sign-in.title' | translate | async\"\n      ></ax-button>\n    }\n  </div>\n</div>\n"],"names":["i2","i3"],"mappings":";;;;;;;;;;;;MAea,oBAAoB,CAAA;AAPjC,IAAA,WAAA,GAAA;;AAUmB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAC5C,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;;;AAMrB,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,aAAa;AAyBrE,IAAA;;;AAnBW,IAAA,MAAM,MAAM,GAAA;QACpB,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,IAAI,IAAI,EAAE;YAC1C,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,8BAA8B,CAAC,CAAC;YAC5D;QACF;QAEA,IAAI,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,EAA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