@osovitny/anatoly 3.19.7 → 3.19.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, EventEmitter, Component, Output, Input, Inject, Pipe, Injector, APP_INITIALIZER, NgModule, Directive, ChangeDetectionStrategy, ViewChild, ViewEncapsulation, HostListener, HostBinding, Optional, SkipSelf } from '@angular/core';
2
+ import { Injectable, EventEmitter, Component, Output, Input, Inject, Pipe, provideAppInitializer, inject, NgModule, Directive, ChangeDetectionStrategy, ViewChild, ViewEncapsulation, HostListener, HostBinding, Optional, SkipSelf } from '@angular/core';
3
3
  import { BehaviorSubject, Subject, filter, takeUntil, map as map$1, catchError, of, merge, forkJoin, timer, fromEvent, firstValueFrom } from 'rxjs';
4
4
  import { map, tap, mergeMap } from 'rxjs/operators';
5
5
  import * as i1 from '@angular/common/http';
6
- import { HttpResponse, HttpClientModule, HttpClient, HTTP_INTERCEPTORS } from '@angular/common/http';
6
+ import { HttpResponse, HttpClient, provideHttpClient, withFetch, HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
7
7
  import * as i1$1 from '@angular/common';
8
- import { LOCATION_INITIALIZED, DOCUMENT, CommonModule } from '@angular/common';
8
+ import { DOCUMENT, CommonModule } from '@angular/common';
9
9
  import js_beautify from 'js-beautify';
10
10
  import * as i1$2 from '@angular/router';
11
11
  import { NavigationEnd, NavigationStart, NavigationCancel, NavigationError, RouterModule } from '@angular/router';
@@ -2781,7 +2781,6 @@ class Subs {
2781
2781
 
2782
2782
  Authors:
2783
2783
  Vadim Osovitny vadim.osovitny@osovitny.com
2784
- Anatoly Osovitny anatoly.osovitny@osovitny.com
2785
2784
 
2786
2785
  Created:
2787
2786
  05 May 2020
@@ -2811,22 +2810,25 @@ class LocalizationService {
2811
2810
  }
2812
2811
  format(str, args) {
2813
2812
  return str.replace(/{(\d+)}/g, function (match, number) {
2814
- return typeof args[number] != 'undefined'
2815
- ? args[number]
2816
- : match;
2813
+ return typeof args[number] != 'undefined' ? args[number] : match;
2817
2814
  });
2818
2815
  }
2819
2816
  ;
2820
2817
  configureSettings(translate) {
2821
- //i10n
2822
- const browserLang = translate.getBrowserLang();
2823
- const lang = browserLang.match(/en|ru|es/) ? browserLang : this.defaultLanguage;
2824
- //dates
2825
- this.dateFnsLocale = { locale: enUS };
2826
- this.subs.sink = this.translate.onLangChange.subscribe((event) => {
2827
- console.log('Language Changed');
2828
- this.langchange.emit(event.lang);
2829
- });
2818
+ let lang = this.defaultLanguage;
2819
+ try {
2820
+ //i10n
2821
+ const browserLang = translate.getBrowserLang();
2822
+ lang = browserLang.match(/en|ru|es/) ? browserLang : this.defaultLanguage;
2823
+ //dates
2824
+ this.dateFnsLocale = { locale: enUS };
2825
+ this.subs.sink = this.translate.onLangChange.subscribe((event) => {
2826
+ console.log('Language Changed');
2827
+ this.langchange.emit(event.lang);
2828
+ });
2829
+ }
2830
+ catch {
2831
+ }
2830
2832
  return lang;
2831
2833
  }
2832
2834
  //Languages
@@ -2932,10 +2934,9 @@ class LocalizationService {
2932
2934
 
2933
2935
  Authors:
2934
2936
  Vadim Osovitny vadim.osovitny@osovitny.com
2935
- Anatoly Osovitny anatoly.osovitny@osovitny.com
2936
2937
 
2937
2938
  Created:
2938
- 10 May 2020
2939
+ 10 May 2020
2939
2940
 
2940
2941
  Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
2941
2942
  </file>
@@ -3013,33 +3014,14 @@ class LocalizePipe {
3013
3014
 
3014
3015
  Authors:
3015
3016
  Vadim Osovitny vadim.osovitny@osovitny.com
3016
- Anatoly Osovitny anatoly.osovitny@osovitny.com
3017
3017
 
3018
3018
  Created:
3019
- 05 May 2020
3019
+ 05 May 2020
3020
3020
 
3021
3021
  Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
3022
3022
  </file>
3023
3023
  */
3024
3024
  //Node
3025
- function localizationInitializerFactory(translate, localizationService, injector) {
3026
- return () => new Promise((resolve) => {
3027
- let locationInitialized = injector.get(LOCATION_INITIALIZED, Promise.resolve(null));
3028
- locationInitialized.then(() => {
3029
- let languageToSet = localizationService.configureSettings(translate);
3030
- translate.use(languageToSet).subscribe({
3031
- next: (data) => {
3032
- },
3033
- error: (e) => {
3034
- resolve(null);
3035
- },
3036
- complete: () => {
3037
- resolve(null);
3038
- }
3039
- });
3040
- });
3041
- });
3042
- }
3043
3025
  function translateLoaderFactory(httpClient) {
3044
3026
  let url = AppCoreSettings.assetsL10NUrl;
3045
3027
  let isCDNEnabled = AppCoreSettings.cdn.enabled;
@@ -3049,23 +3031,31 @@ function translateLoaderFactory(httpClient) {
3049
3031
  }
3050
3032
  return new TranslateHttpLoader(httpClient, `${url}/`, `.json?v=${AppVersion}`);
3051
3033
  }
3052
- let LocalizationInjectorInstance;
3034
+ let _localizationInjectorInstance;
3035
+ function getLocalizationInjector() {
3036
+ if (!_localizationInjectorInstance) {
3037
+ throw new Error('LocalizationInjector is not initialized.');
3038
+ }
3039
+ return _localizationInjectorInstance;
3040
+ }
3053
3041
  class LocalizationSettingsModule {
3054
3042
  constructor(injector) {
3055
3043
  this.injector = injector;
3056
- LocalizationInjectorInstance = this.injector;
3044
+ _localizationInjectorInstance = this.injector;
3057
3045
  }
3058
3046
  static { this.ɵfac = function LocalizationSettingsModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LocalizationSettingsModule)(i0.ɵɵinject(i0.Injector)); }; }
3059
3047
  static { this.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: LocalizationSettingsModule }); }
3060
3048
  static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
3061
- {
3062
- provide: APP_INITIALIZER,
3063
- useFactory: localizationInitializerFactory,
3064
- deps: [TranslateService, LocalizationService, Injector],
3065
- multi: true
3066
- }
3067
- ], imports: [HttpClientModule,
3068
- TranslateModule.forRoot({
3049
+ TranslateService,
3050
+ LocalizationService,
3051
+ provideHttpClient(withFetch()),
3052
+ provideAppInitializer(() => {
3053
+ const translate = inject(TranslateService);
3054
+ const localizationService = inject(LocalizationService);
3055
+ const lang = localizationService.configureSettings(translate);
3056
+ return translate.use(lang);
3057
+ })
3058
+ ], imports: [TranslateModule.forRoot({
3069
3059
  loader: {
3070
3060
  provide: TranslateLoader,
3071
3061
  useFactory: translateLoaderFactory,
@@ -3077,7 +3067,6 @@ class LocalizationSettingsModule {
3077
3067
  type: NgModule,
3078
3068
  args: [{
3079
3069
  imports: [
3080
- HttpClientModule,
3081
3070
  TranslateModule.forRoot({
3082
3071
  loader: {
3083
3072
  provide: TranslateLoader,
@@ -3087,17 +3076,20 @@ class LocalizationSettingsModule {
3087
3076
  })
3088
3077
  ],
3089
3078
  providers: [
3090
- {
3091
- provide: APP_INITIALIZER,
3092
- useFactory: localizationInitializerFactory,
3093
- deps: [TranslateService, LocalizationService, Injector],
3094
- multi: true
3095
- }
3079
+ TranslateService,
3080
+ LocalizationService,
3081
+ provideHttpClient(withFetch()),
3082
+ provideAppInitializer(() => {
3083
+ const translate = inject(TranslateService);
3084
+ const localizationService = inject(LocalizationService);
3085
+ const lang = localizationService.configureSettings(translate);
3086
+ return translate.use(lang);
3087
+ })
3096
3088
  ],
3097
3089
  exports: []
3098
3090
  }]
3099
3091
  }], () => [{ type: i0.Injector }], null); })();
3100
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(LocalizationSettingsModule, { imports: [HttpClientModule, i1$3.TranslateModule] }); })();
3092
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(LocalizationSettingsModule, { imports: [i1$3.TranslateModule] }); })();
3101
3093
 
3102
3094
  /*
3103
3095
  <file>
@@ -3106,10 +3098,9 @@ class LocalizationSettingsModule {
3106
3098
 
3107
3099
  Authors:
3108
3100
  Vadim Osovitny vadim.osovitny@osovitny.com
3109
- Anatoly Osovitny anatoly.osovitny@osovitny.com
3110
3101
 
3111
3102
  Created:
3112
- 12 May 2020
3103
+ 12 May 2020
3113
3104
 
3114
3105
  Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
3115
3106
  </file>
@@ -3150,7 +3141,6 @@ class LocalizationModule {
3150
3141
 
3151
3142
  Authors:
3152
3143
  Vadim Osovitny vadim.osovitny@osovitny.com
3153
- Anatoly Osovitny anatoly.osovitny@osovitny.com
3154
3144
 
3155
3145
  Created:
3156
3146
  2 July 2020
@@ -3161,7 +3151,7 @@ class LocalizationModule {
3161
3151
  //App
3162
3152
  class L10nUtils {
3163
3153
  static get localizationService() {
3164
- const ns = LocalizationInjectorInstance.get(LocalizationService);
3154
+ const ns = getLocalizationInjector().get(LocalizationService);
3165
3155
  return ns;
3166
3156
  }
3167
3157
  static getLocalizedValue(key, params, defaultKey) {
@@ -11028,5 +11018,5 @@ class AnatolyModule {
11028
11018
  * Generated bundle index. Do not edit.
11029
11019
  */
11030
11020
 
11031
- export { AReplacerDirective, AddressComponent, AdminGuard, Alerts, AnatolyBillingModule, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyIAMModule, AnatolyIAMPagesModule, AnatolyModule, AnatolyUIModule, ApiServiceBase, ApiUrl, AppContextService, AppCoreSettings, AppName, AppSettings, AppVersion, AppsGoServiceBase, AuthService, AuthenticationGuard, BillingUtils, BraintreeDialog, Browser, BuyAccessButtonComponent, CardBodyComponent, CardComponent, CardFooterComponent, CardHeaderComponent, CheckIconComponent, ClientApps, CompanyComponent, ComponentBase, ContactUsDialog, ContactUsForm, ControlPanelComponent, Convert, Copy2ClipboardComponent, CoreApiService, CountryDropdownlist, CurrenciesApiService, CurrenciesStorageService, DOM, DataPagerComponent, DataViewType, DateConvert, DefaultEditorOptions, DialogBase, DigitalMarketingService, DiscountCodeStatus, DiscountCodeType, DiscountCodesApiService, EditComponentBase, EditPageBase, EmailsApiService, EnumEditComponentBase, FeatureWillBeReadyComponent, FileSizePipe, FormValidationSummaryComponent, GABillingEvents, GAEvents, GlobalErrorHandler, GoServiceBase, GoogleAnalyticsService, GridEditServiceBase, GridReadServiceBase, Guid, HoveringDirective, HtmlEditorComponent, HtmlEditorComponentBase, IdleService, ImageReplacerDirective, InjectorInstance, IsDevMode, IsProdMode, ItemValidationSummaryComponent, L10nUtils, ListBase, LoadingComponent, LoadingService, LocalStorageService, LocalizationInjectorInstance, LocalizationModule, LocalizationService, LocalizationSettingsModule, LocalizePipe, LoggingService, MSALUtils, ModerationStatus, ModerationStatusDropdownlist, NativeElementDirective, NoMobileSupportComponent, NodataComponent, NotificationService, OrderSummaryComponent, PageBase, PageSpinnerComponent, PagedPageBase, PayPalComponent, PayPalScriptService, PaymentMethod, PaymentMethodsComponent, PaymentOptionsComponent, PaymentStage, PaymentType, PaymentsApiService, PaymentsService, PaypalButtonComponent, PaypalSubscribeButtonComponent, PublishStatus, PublishStatusDropdownlist, QSUtils, ReplaceTextPipe, SafeHtmlPipe, ScriptService, SessionStorageService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, StarterGuard, StarterService, Stopwatch, StripeDialog, Subs, SubscribePlanButtonComponent, SubscriptionProvider, SubscriptionsApiService, TimezoneDropdownlist, TransactionsApiService, UrlSlugComponent, Utils, ValidationSummaryComponent, XmlFormatter, YouAgreeToOurTermsComponent, dateFormats, dateTimeFormats, getAppSettingsById, getAppSettingsByName, getCurrentApp, is, localizationInitializerFactory, throwIfAlreadyLoaded, timeFormats, translateLoaderFactory };
11021
+ export { AReplacerDirective, AddressComponent, AdminGuard, Alerts, AnatolyBillingModule, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyIAMModule, AnatolyIAMPagesModule, AnatolyModule, AnatolyUIModule, ApiServiceBase, ApiUrl, AppContextService, AppCoreSettings, AppName, AppSettings, AppVersion, AppsGoServiceBase, AuthService, AuthenticationGuard, BillingUtils, BraintreeDialog, Browser, BuyAccessButtonComponent, CardBodyComponent, CardComponent, CardFooterComponent, CardHeaderComponent, CheckIconComponent, ClientApps, CompanyComponent, ComponentBase, ContactUsDialog, ContactUsForm, ControlPanelComponent, Convert, Copy2ClipboardComponent, CoreApiService, CountryDropdownlist, CurrenciesApiService, CurrenciesStorageService, DOM, DataPagerComponent, DataViewType, DateConvert, DefaultEditorOptions, DialogBase, DigitalMarketingService, DiscountCodeStatus, DiscountCodeType, DiscountCodesApiService, EditComponentBase, EditPageBase, EmailsApiService, EnumEditComponentBase, FeatureWillBeReadyComponent, FileSizePipe, FormValidationSummaryComponent, GABillingEvents, GAEvents, GlobalErrorHandler, GoServiceBase, GoogleAnalyticsService, GridEditServiceBase, GridReadServiceBase, Guid, HoveringDirective, HtmlEditorComponent, HtmlEditorComponentBase, IdleService, ImageReplacerDirective, InjectorInstance, IsDevMode, IsProdMode, ItemValidationSummaryComponent, L10nUtils, ListBase, LoadingComponent, LoadingService, LocalStorageService, LocalizationModule, LocalizationService, LocalizationSettingsModule, LocalizePipe, LoggingService, MSALUtils, ModerationStatus, ModerationStatusDropdownlist, NativeElementDirective, NoMobileSupportComponent, NodataComponent, NotificationService, OrderSummaryComponent, PageBase, PageSpinnerComponent, PagedPageBase, PayPalComponent, PayPalScriptService, PaymentMethod, PaymentMethodsComponent, PaymentOptionsComponent, PaymentStage, PaymentType, PaymentsApiService, PaymentsService, PaypalButtonComponent, PaypalSubscribeButtonComponent, PublishStatus, PublishStatusDropdownlist, QSUtils, ReplaceTextPipe, SafeHtmlPipe, ScriptService, SessionStorageService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, StarterGuard, StarterService, Stopwatch, StripeDialog, Subs, SubscribePlanButtonComponent, SubscriptionProvider, SubscriptionsApiService, TimezoneDropdownlist, TransactionsApiService, UrlSlugComponent, Utils, ValidationSummaryComponent, XmlFormatter, YouAgreeToOurTermsComponent, dateFormats, dateTimeFormats, getAppSettingsById, getAppSettingsByName, getCurrentApp, getLocalizationInjector, is, throwIfAlreadyLoaded, timeFormats, translateLoaderFactory };
11032
11022
  //# sourceMappingURL=osovitny-anatoly.mjs.map