@osovitny/anatoly 2.14.38 → 2.14.40

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.
Files changed (34) hide show
  1. package/esm2020/lib/core/localization/localizationSettings.module.mjs +10 -6
  2. package/esm2020/lib/core/services/appcontext.service.mjs +5 -4
  3. package/esm2020/lib/core/services/google-analytics.service.mjs +8 -6
  4. package/esm2020/lib/core/services/idle.service.mjs +14 -10
  5. package/esm2020/lib/data/base/grid/base-grid-edit.service.mjs +21 -14
  6. package/esm2020/lib/data/base/grid/base-grid-read.service.mjs +11 -8
  7. package/esm2020/lib/data/consts.mjs +1 -3
  8. package/esm2020/lib/data/data.module.mjs +1 -4
  9. package/esm2020/lib/data/index.mjs +1 -2
  10. package/esm2020/lib/data/services/core-api.service.mjs +22 -4
  11. package/esm2020/lib/data/services/emails-api.service.mjs +12 -7
  12. package/esm2020/lib/ui/components/billing/buyaccess-button.component.mjs +5 -21
  13. package/esm2020/lib/ui/components/billing/subscribe-plan-button.component.mjs +18 -16
  14. package/esm2020/lib/ui/components/index.mjs +4 -4
  15. package/esm2020/lib/ui/components/spinners/loading/loading.component.mjs +5 -3
  16. package/esm2020/lib/ui/components/spinners/pagespinner/pagespinner.component.mjs +13 -10
  17. package/esm2020/lib/ui/forms/components/urlslug/urlslug.component.mjs +12 -8
  18. package/esm2020/lib/ui/ui.module.mjs +44 -79
  19. package/fesm2015/osovitny-anatoly.mjs +184 -272
  20. package/fesm2015/osovitny-anatoly.mjs.map +1 -1
  21. package/fesm2020/osovitny-anatoly.mjs +184 -272
  22. package/fesm2020/osovitny-anatoly.mjs.map +1 -1
  23. package/lib/data/consts.d.ts +0 -1
  24. package/lib/data/index.d.ts +0 -1
  25. package/lib/ui/components/billing/buyaccess-button.component.d.ts +2 -2
  26. package/lib/ui/components/billing/subscribe-plan-button.component.d.ts +7 -5
  27. package/lib/ui/components/index.d.ts +0 -1
  28. package/lib/ui/components/spinners/pagespinner/pagespinner.component.d.ts +2 -2
  29. package/lib/ui/ui.module.d.ts +33 -34
  30. package/package.json +1 -1
  31. package/esm2020/lib/data/services/billing-api.service.mjs +0 -53
  32. package/esm2020/lib/ui/components/billing/upgrade-plan-button.component.mjs +0 -49
  33. package/lib/data/services/billing-api.service.d.ts +0 -11
  34. package/lib/ui/components/billing/upgrade-plan-button.component.d.ts +0 -12
@@ -683,11 +683,15 @@ function localizationInitializerFactory(translate, localizationService, injector
683
683
  let locationInitialized = injector.get(LOCATION_INITIALIZED, Promise.resolve(null));
684
684
  locationInitialized.then(() => {
685
685
  let languageToSet = localizationService.configureTranslationSettings(translate);
686
- translate.use(languageToSet).subscribe(() => {
687
- }, () => {
688
- resolve(null);
689
- }, () => {
690
- resolve(null);
686
+ translate.use(languageToSet).subscribe({
687
+ next: (data) => {
688
+ },
689
+ error: (e) => {
690
+ resolve(null);
691
+ },
692
+ complete: () => {
693
+ resolve(null);
694
+ }
691
695
  });
692
696
  });
693
697
  });
@@ -1421,9 +1425,10 @@ class AppContextService extends BaseApiService {
1421
1425
  }
1422
1426
  let now = new Date();
1423
1427
  console.log('Requesting a new AppContext at ' + now);
1424
- this.subscription = this.get('getCurrentContext', null).subscribe((data) => {
1425
- this.dataReceived(data);
1426
- }, (e) => {
1428
+ this.subscription = this.get('getCurrentContext', null).subscribe({
1429
+ next: (data) => {
1430
+ this.dataReceived(data);
1431
+ }
1427
1432
  });
1428
1433
  }
1429
1434
  updateCurrent(success = null) {
@@ -1483,13 +1488,15 @@ class IdleService {
1483
1488
  this.startDate = new Date();
1484
1489
  }
1485
1490
  startTimer() {
1486
- this.timer$ = timer(this.timeOutMilliSeconds, 1 * 1000).subscribe((res) => {
1487
- let nowDate = new Date();
1488
- let exiredDate = new Date(this.startDate.getTime() + this.timeOutMilliSeconds);
1489
- if (nowDate.getTime() >= exiredDate.getTime()) {
1490
- //console.log("nowDate: " + nowDate);
1491
- //console.log("exiredDate: " + exiredDate);
1492
- this.expired$.next(true);
1491
+ this.timer$ = timer(this.timeOutMilliSeconds, 1 * 1000).subscribe({
1492
+ next: (data) => {
1493
+ let nowDate = new Date();
1494
+ let exiredDate = new Date(this.startDate.getTime() + this.timeOutMilliSeconds);
1495
+ if (nowDate.getTime() >= exiredDate.getTime()) {
1496
+ //console.log("nowDate: " + nowDate);
1497
+ //console.log("exiredDate: " + exiredDate);
1498
+ this.expired$.next(true);
1499
+ }
1493
1500
  }
1494
1501
  });
1495
1502
  }
@@ -1500,8 +1507,10 @@ class IdleService {
1500
1507
  startWatching(timeOutSeconds) {
1501
1508
  this.idle$ = merge(fromEvent(document, 'mousemove'), fromEvent(document, 'click'), fromEvent(document, 'mousedown'), fromEvent(document, 'keypress'), fromEvent(document, 'DOMMouseScroll'), fromEvent(document, 'mousewheel'), fromEvent(document, 'touchmove'), fromEvent(document, 'MSPointerMove'), fromEvent(window, 'mousemove'), fromEvent(window, 'resize'));
1502
1509
  this.resetTimeCounters(timeOutSeconds);
1503
- this.idleSubscription = this.idle$.subscribe((res) => {
1504
- this.resetTimer();
1510
+ this.idleSubscription = this.idle$.subscribe({
1511
+ next: (data) => {
1512
+ this.resetTimer();
1513
+ }
1505
1514
  });
1506
1515
  this.startTimer();
1507
1516
  return this.expired$;
@@ -1616,11 +1625,13 @@ class GoogleAnalyticsService {
1616
1625
  */
1617
1626
  }
1618
1627
  subscribe() {
1619
- this.subscription = this.router.events.subscribe(event => {
1620
- if (event instanceof NavigationEnd) {
1621
- if (window.ga) {
1622
- window.ga('set', 'page', event.urlAfterRedirects);
1623
- window.ga('send', 'pageview');
1628
+ this.subscription = this.router.events.subscribe({
1629
+ next: (event) => {
1630
+ if (event instanceof NavigationEnd) {
1631
+ if (window.ga) {
1632
+ window.ga('set', 'page', event.urlAfterRedirects);
1633
+ window.ga('send', 'pageview');
1634
+ }
1624
1635
  }
1625
1636
  }
1626
1637
  });
@@ -1955,13 +1966,16 @@ class BaseGridReadService extends BehaviorSubject {
1955
1966
  url = this.baseReadUrl + `${this.serializeParams(params)}`;
1956
1967
  this.savedReadParams = params;
1957
1968
  }
1958
- this.http.get(url).pipe(map(res => res)).subscribe(data => {
1959
- super.next(data);
1960
- if (success)
1961
- success();
1962
- }, e => {
1963
- if (error)
1964
- error(e);
1969
+ this.http.get(url).pipe(map(res => res)).subscribe({
1970
+ next: (data) => {
1971
+ super.next(data);
1972
+ if (success)
1973
+ success();
1974
+ },
1975
+ error: (e) => {
1976
+ if (error)
1977
+ error(e);
1978
+ }
1965
1979
  });
1966
1980
  }
1967
1981
  }
@@ -2007,24 +2021,31 @@ class BaseGridEditService extends BaseGridReadService {
2007
2021
  save(data, isNew, sucess) {
2008
2022
  const action = isNew ? 'add' : 'update';
2009
2023
  this.reset();
2010
- this.post(action, data).subscribe(() => {
2011
- }, () => {
2012
- this.read();
2013
- }, () => {
2014
- this.read();
2015
- if (sucess)
2016
- sucess();
2024
+ this.post(action, data).subscribe({
2025
+ next: (data) => {
2026
+ },
2027
+ error: (e) => {
2028
+ this.read();
2029
+ },
2030
+ complete: () => {
2031
+ this.read();
2032
+ if (sucess)
2033
+ sucess();
2034
+ }
2017
2035
  });
2018
2036
  }
2019
2037
  delete(data, sucess) {
2020
2038
  this.reset();
2021
2039
  const url = `${this.baseUrl}/delete${this.serializeParams(data)}`;
2022
- return this.http.delete(url).subscribe(() => {
2023
- this.read();
2024
- if (sucess)
2025
- sucess();
2026
- }, () => {
2027
- this.read();
2040
+ return this.http.delete(url).subscribe({
2041
+ next: (data) => {
2042
+ this.read();
2043
+ if (sucess)
2044
+ sucess();
2045
+ },
2046
+ error: (e) => {
2047
+ this.read();
2048
+ }
2028
2049
  });
2029
2050
  }
2030
2051
  post(action, data) {
@@ -2056,8 +2077,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
2056
2077
  const Consts = {
2057
2078
  //core
2058
2079
  coreApiPath: 'api/core',
2059
- //billing
2060
- billingApiPath: 'api/billing',
2061
2080
  //emails
2062
2081
  emailsApiPath: 'api/emails',
2063
2082
  //notifications
@@ -2098,52 +2117,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
2098
2117
  }]
2099
2118
  }], ctorParameters: function () { return [{ type: i1$3.HttpClient }]; } });
2100
2119
 
2101
- /*
2102
- <file>
2103
- Project:
2104
- @osovitny/anatoly
2105
-
2106
- Authors:
2107
- Vadim Osovitny
2108
- Anatoly Osovitny
2109
-
2110
- Created:
2111
- 12 Nov 2017
2112
-
2113
- Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2114
- </file>
2115
- */
2116
- class BillingApiService extends BaseApiService {
2117
- constructor(http) {
2118
- super(http);
2119
- this.http = http;
2120
- this.baseUrl = Consts.billingApiPath;
2121
- }
2122
- requestNewSubscription(requestedPlan, success, error) {
2123
- this.postQS("requestNewSubscription", { requestedPlan: requestedPlan }).subscribe((data) => {
2124
- if (success)
2125
- success();
2126
- }, (e) => {
2127
- if (error)
2128
- error();
2129
- });
2130
- }
2131
- cancelRequestedSubscription(success, error) {
2132
- this.postQS("cancelRequestedSubscription", null).subscribe((data) => {
2133
- if (success)
2134
- success();
2135
- }, (e) => {
2136
- if (error)
2137
- error();
2138
- });
2139
- }
2140
- }
2141
- BillingApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BillingApiService, deps: [{ token: i1$3.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
2142
- BillingApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BillingApiService });
2143
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BillingApiService, decorators: [{
2144
- type: Injectable
2145
- }], ctorParameters: function () { return [{ type: i1$3.HttpClient }]; } });
2146
-
2147
2120
  /*
2148
2121
  <file>
2149
2122
  Project:
@@ -2166,12 +2139,17 @@ class EmailsApiService extends BaseApiService {
2166
2139
  this.baseUrl = Consts.emailsApiPath;
2167
2140
  }
2168
2141
  sendContactUs(captcha, name, email, topic, subject, message, success, error) {
2169
- return this.post('sendContactUs', { captcha, name, email, topic, subject, message }).subscribe(data => {
2170
- if (success)
2171
- success(data);
2172
- }, e => {
2173
- if (error)
2174
- error(e);
2142
+ return this.post('sendContactUs', { captcha, name, email, topic, subject, message }).subscribe({
2143
+ next: (data) => {
2144
+ if (success) {
2145
+ success(data);
2146
+ }
2147
+ },
2148
+ error: (e) => {
2149
+ if (error) {
2150
+ error(e);
2151
+ }
2152
+ }
2175
2153
  });
2176
2154
  }
2177
2155
  }
@@ -2203,13 +2181,31 @@ class CoreApiService extends BaseApiService {
2203
2181
  this.baseUrl = Consts.coreApiPath;
2204
2182
  }
2205
2183
  getTimezonesJsonFile(done) {
2206
- this.getExternalJsonFile('anatoly', 'timezones.json').subscribe(data => done(data));
2184
+ this.getExternalJsonFile('anatoly', 'timezones.json').subscribe({
2185
+ next: (data) => {
2186
+ if (done) {
2187
+ done(data);
2188
+ }
2189
+ }
2190
+ });
2207
2191
  }
2208
2192
  getUSStatesJsonFile(done) {
2209
- this.getExternalJsonFile('anatoly', 'usStates.json').subscribe(data => done(data));
2193
+ this.getExternalJsonFile('anatoly', 'usStates.json').subscribe({
2194
+ next: (data) => {
2195
+ if (done) {
2196
+ done(data);
2197
+ }
2198
+ }
2199
+ });
2210
2200
  }
2211
2201
  getCountriesJsonFile(done) {
2212
- this.getExternalJsonFile('anatoly', 'countries.json').subscribe(data => done(data));
2202
+ this.getExternalJsonFile('anatoly', 'countries.json').subscribe({
2203
+ next: (data) => {
2204
+ if (done) {
2205
+ done(data);
2206
+ }
2207
+ }
2208
+ });
2213
2209
  }
2214
2210
  }
2215
2211
  CoreApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: CoreApiService, deps: [{ token: i1$3.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
@@ -2496,16 +2492,12 @@ class BuyAccessButtonComponent {
2496
2492
  this.appContext = appContext;
2497
2493
  this.contextUpdated = false;
2498
2494
  this.isUserSignedIn = false;
2499
- this.currentPlan = 0;
2495
+ this.currentPlan = -1;
2500
2496
  this.currentPlanTitle = '';
2501
2497
  this.visibleIfUserSignedIn = false;
2502
2498
  this.buy = new EventEmitter();
2503
2499
  }
2504
2500
  ngOnInit() {
2505
- if (!this.appContext.isUserSignedIn()) {
2506
- this.contextUpdated = true;
2507
- return;
2508
- }
2509
2501
  this.appContext.getCurrent((current) => {
2510
2502
  this.isUserSignedIn = current.isUserSignedIn;
2511
2503
  if (this.isUserSignedIn) {
@@ -2517,29 +2509,17 @@ class BuyAccessButtonComponent {
2517
2509
  }
2518
2510
  //Events
2519
2511
  onBuyAccess() {
2520
- /*
2521
- const text = `Requested plan: ${this.plantitle} `;
2522
- const that = this;
2523
-
2524
- Alerts.areYouSure(text, 'Buying access', 'Confirm change', 'Cancel', () => {
2525
- that.api.buyAccess(that.plan, () => {
2526
- Alerts.success('Access Granted', null, null,() => {
2527
- (window as any).location.reload();
2528
- });
2529
- });
2530
- });
2531
- */
2532
2512
  this.buy.emit(this.plan);
2533
2513
  }
2534
2514
  }
2535
2515
  BuyAccessButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BuyAccessButtonComponent, deps: [{ token: AppContextService }], target: i0.ɵɵFactoryTarget.Component });
2536
- BuyAccessButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: BuyAccessButtonComponent, selector: "anatoly-buyaccess-button", inputs: { plan: "plan", plantitle: "plantitle", visibleIfUserSignedIn: "visibleIfUserSignedIn" }, outputs: { buy: "buy" }, ngImport: i0, template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn && visibleIfUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" \r\n *ngIf=\"plan != currentPlan && currentPlan == 1\" \r\n (click)=\"onBuyAccess()\">\r\n Buy Now\r\n </button>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i1$5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SignUpButtonComponent, selector: "anatoly-signup-button", inputs: ["classbtn"] }] });
2516
+ BuyAccessButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: BuyAccessButtonComponent, selector: "anatoly-buyaccess-button", inputs: { plan: "plan", planTitle: "planTitle", visibleIfUserSignedIn: "visibleIfUserSignedIn" }, outputs: { buy: "buy" }, ngImport: i0, template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn && visibleIfUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" \r\n *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" \r\n *ngIf=\"plan != currentPlan && currentPlan == 1\" \r\n (click)=\"onBuyAccess()\">\r\n Buy Now\r\n </button>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i1$5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SignUpButtonComponent, selector: "anatoly-signup-button", inputs: ["classbtn"] }] });
2537
2517
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BuyAccessButtonComponent, decorators: [{
2538
2518
  type: Component,
2539
- args: [{ selector: 'anatoly-buyaccess-button', template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn && visibleIfUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" \r\n *ngIf=\"plan != currentPlan && currentPlan == 1\" \r\n (click)=\"onBuyAccess()\">\r\n Buy Now\r\n </button>\r\n </div>\r\n</div>\r\n" }]
2519
+ args: [{ selector: 'anatoly-buyaccess-button', template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn && visibleIfUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" \r\n *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" \r\n *ngIf=\"plan != currentPlan && currentPlan == 1\" \r\n (click)=\"onBuyAccess()\">\r\n Buy Now\r\n </button>\r\n </div>\r\n</div>\r\n" }]
2540
2520
  }], ctorParameters: function () { return [{ type: AppContextService }]; }, propDecorators: { plan: [{
2541
2521
  type: Input
2542
- }], plantitle: [{
2522
+ }], planTitle: [{
2543
2523
  type: Input
2544
2524
  }], visibleIfUserSignedIn: [{
2545
2525
  type: Input
@@ -2547,50 +2527,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
2547
2527
  type: Output
2548
2528
  }] } });
2549
2529
 
2550
- /*
2551
- <file>
2552
- Project:
2553
- @osovitny/anatoly
2554
-
2555
- Authors:
2556
- Vadim Osovitny
2557
- Anatoly Osovitny
2558
-
2559
- Created:
2560
- 12 Nov 2017
2561
-
2562
- Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2563
- </file>
2564
- */
2565
- class UpgradePlanButtonComponent {
2566
- constructor(api) {
2567
- this.api = api;
2568
- }
2569
- onUpgradePlan() {
2570
- const text = `Current plan: ${this.currentplantitle} New plan: ${this.requestedplantitle}`;
2571
- const that = this;
2572
- Alerts.areYouSure(text, 'Change billing plan', 'Confirm change', 'Cancel', () => {
2573
- that.api.requestNewSubscription(that.requestedplan, () => {
2574
- Alerts.success('Your request for changing plan has been sent.', null, null, () => {
2575
- window.location.reload();
2576
- });
2577
- });
2578
- });
2579
- }
2580
- }
2581
- UpgradePlanButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: UpgradePlanButtonComponent, deps: [{ token: BillingApiService }], target: i0.ɵɵFactoryTarget.Component });
2582
- UpgradePlanButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: UpgradePlanButtonComponent, selector: "anatoly-upgrade-plan-button", inputs: { currentplantitle: "currentplantitle", requestedplan: "requestedplan", requestedplantitle: "requestedplantitle" }, ngImport: i0, template: "<button class=\"btn btn-block btn-primary\" (click)=\"onUpgradePlan()\">\r\n Upgrade\r\n</button>\r\n" });
2583
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: UpgradePlanButtonComponent, decorators: [{
2584
- type: Component,
2585
- args: [{ selector: 'anatoly-upgrade-plan-button', template: "<button class=\"btn btn-block btn-primary\" (click)=\"onUpgradePlan()\">\r\n Upgrade\r\n</button>\r\n" }]
2586
- }], ctorParameters: function () { return [{ type: BillingApiService }]; }, propDecorators: { currentplantitle: [{
2587
- type: Input
2588
- }], requestedplan: [{
2589
- type: Input
2590
- }], requestedplantitle: [{
2591
- type: Input
2592
- }] } });
2593
-
2594
2530
  /*
2595
2531
  <file>
2596
2532
  Project:
@@ -2607,22 +2543,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
2607
2543
  </file>
2608
2544
  */
2609
2545
  class SubscribePlanButtonComponent {
2610
- constructor(appcontext) {
2611
- this.appcontext = appcontext;
2546
+ constructor(appContext) {
2547
+ this.appContext = appContext;
2612
2548
  this.contextUpdated = false;
2613
2549
  this.isUserSignedIn = false;
2614
- this.currentPlan = 0;
2550
+ this.currentPlan = -1;
2615
2551
  this.currentPlanTitle = "";
2616
- this.requestedPlan = 0;
2552
+ this.requestedPlan = -1;
2617
2553
  this.requestedPlanTitle = "";
2618
2554
  this.visibleIfUserSignedIn = false;
2555
+ this.subscribe = new EventEmitter();
2619
2556
  }
2620
2557
  ngOnInit() {
2621
- if (!this.appcontext.isUserSignedIn()) {
2622
- this.contextUpdated = true;
2623
- return;
2624
- }
2625
- this.appcontext.getCurrent((current) => {
2558
+ this.appContext.getCurrent((current) => {
2626
2559
  this.isUserSignedIn = current.isUserSignedIn;
2627
2560
  if (this.isUserSignedIn) {
2628
2561
  this.currentPlan = current.account.billingPlan;
@@ -2633,18 +2566,24 @@ class SubscribePlanButtonComponent {
2633
2566
  this.contextUpdated = true;
2634
2567
  });
2635
2568
  }
2569
+ //Events
2570
+ onSubscribe() {
2571
+ this.subscribe.emit(this.plan);
2572
+ }
2636
2573
  }
2637
2574
  SubscribePlanButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SubscribePlanButtonComponent, deps: [{ token: AppContextService }], target: i0.ɵɵFactoryTarget.Component });
2638
- SubscribePlanButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: SubscribePlanButtonComponent, selector: "anatoly-subscribe-plan-button", inputs: { plan: "plan", plantitle: "plantitle", visibleIfUserSignedIn: "visibleIfUserSignedIn" }, ngImport: i0, template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn && visibleIfUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" *ngIf=\"requestedPlan != null && requestedPlan != 0 && plan == requestedPlan\">\r\n Requested\r\n </button>\r\n\r\n <anatoly-upgrade-plan-button *ngIf=\"plan != currentPlan && plan != requestedPlan\"\r\n [currentplantitle]=\"currentPlanTitle\"\r\n [requestedplan]=plan\r\n [requestedplantitle]=\"plantitle\">\r\n </anatoly-upgrade-plan-button>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i1$5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: UpgradePlanButtonComponent, selector: "anatoly-upgrade-plan-button", inputs: ["currentplantitle", "requestedplan", "requestedplantitle"] }, { kind: "component", type: SignUpButtonComponent, selector: "anatoly-signup-button", inputs: ["classbtn"] }] });
2575
+ SubscribePlanButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: SubscribePlanButtonComponent, selector: "anatoly-subscribe-plan-button", inputs: { plan: "plan", planTitle: "planTitle", visibleIfUserSignedIn: "visibleIfUserSignedIn" }, outputs: { subscribe: "subscribe" }, ngImport: i0, template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn && visibleIfUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" \r\n *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" \r\n *ngIf=\"plan == requestedPlan\">\r\n Requested\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" \r\n *ngIf=\"plan != currentPlan && plan != requestedPlan\" \r\n (click)=\"onSubscribe()\">\r\n Subscribe\r\n </button>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i1$5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SignUpButtonComponent, selector: "anatoly-signup-button", inputs: ["classbtn"] }] });
2639
2576
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SubscribePlanButtonComponent, decorators: [{
2640
2577
  type: Component,
2641
- args: [{ selector: "anatoly-subscribe-plan-button", template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn && visibleIfUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" *ngIf=\"requestedPlan != null && requestedPlan != 0 && plan == requestedPlan\">\r\n Requested\r\n </button>\r\n\r\n <anatoly-upgrade-plan-button *ngIf=\"plan != currentPlan && plan != requestedPlan\"\r\n [currentplantitle]=\"currentPlanTitle\"\r\n [requestedplan]=plan\r\n [requestedplantitle]=\"plantitle\">\r\n </anatoly-upgrade-plan-button>\r\n </div>\r\n</div>\r\n" }]
2578
+ args: [{ selector: "anatoly-subscribe-plan-button", template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn && visibleIfUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" \r\n *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" \r\n *ngIf=\"plan == requestedPlan\">\r\n Requested\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" \r\n *ngIf=\"plan != currentPlan && plan != requestedPlan\" \r\n (click)=\"onSubscribe()\">\r\n Subscribe\r\n </button>\r\n </div>\r\n</div>\r\n" }]
2642
2579
  }], ctorParameters: function () { return [{ type: AppContextService }]; }, propDecorators: { plan: [{
2643
2580
  type: Input
2644
- }], plantitle: [{
2581
+ }], planTitle: [{
2645
2582
  type: Input
2646
2583
  }], visibleIfUserSignedIn: [{
2647
2584
  type: Input
2585
+ }], subscribe: [{
2586
+ type: Output
2648
2587
  }] } });
2649
2588
 
2650
2589
  /*
@@ -3221,8 +3160,10 @@ class LoadingComponent {
3221
3160
  this.show = false;
3222
3161
  }
3223
3162
  ngOnInit() {
3224
- this.subs.sink = this.loadingService.subscribe((state) => {
3225
- this.show = state;
3163
+ this.subs.sink = this.loadingService.subscribe({
3164
+ next: (data) => {
3165
+ this.show = data;
3166
+ }
3226
3167
  });
3227
3168
  }
3228
3169
  ngOnDestroy() {
@@ -3267,19 +3208,22 @@ class PageSpinnerComponent {
3267
3208
  constructor(router, document) {
3268
3209
  this.router = router;
3269
3210
  this.document = document;
3270
- this.backgroundColor = '#2196f3';
3271
- this.spinner = Spinkit.skLine;
3272
3211
  this.isSpinnerVisible = true;
3273
3212
  this.Spinkit = Spinkit;
3274
- this.router.events.subscribe(event => {
3275
- if (event instanceof NavigationStart) {
3276
- this.isSpinnerVisible = true;
3277
- }
3278
- else if (event instanceof NavigationEnd || event instanceof NavigationCancel || event instanceof NavigationError) {
3213
+ this.backgroundColor = '#2196f3';
3214
+ this.spinner = Spinkit.skLine;
3215
+ this.router.events.subscribe({
3216
+ next: (event) => {
3217
+ if (event instanceof NavigationStart) {
3218
+ this.isSpinnerVisible = true;
3219
+ }
3220
+ else if (event instanceof NavigationEnd || event instanceof NavigationCancel || event instanceof NavigationError) {
3221
+ this.isSpinnerVisible = false;
3222
+ }
3223
+ },
3224
+ error: (e) => {
3279
3225
  this.isSpinnerVisible = false;
3280
3226
  }
3281
- }, () => {
3282
- this.isSpinnerVisible = false;
3283
3227
  });
3284
3228
  }
3285
3229
  ngOnDestroy() {
@@ -3913,15 +3857,19 @@ class UrlSlugComponent extends BaseEditComponent {
3913
3857
  this.setFormValue(this.controlName, event.urlSlug);
3914
3858
  }
3915
3859
  startWatching() {
3916
- this.subs.sink = this.formGroup.get(this.watchedControlName).valueChanges.subscribe(value => {
3917
- if (this.firstValue) {
3918
- this.firstValue = false;
3919
- return;
3860
+ this.subs.sink = this.formGroup.get(this.watchedControlName).valueChanges.subscribe({
3861
+ next: (value) => {
3862
+ if (this.firstValue) {
3863
+ this.firstValue = false;
3864
+ return;
3865
+ }
3866
+ this.generateUrlSlug(value);
3920
3867
  }
3921
- this.generateUrlSlug(value);
3922
3868
  });
3923
- this.subs.sink = this.formGroup.get(this.controlName).valueChanges.subscribe(value => {
3924
- this.hrefGo = value;
3869
+ this.subs.sink = this.formGroup.get(this.controlName).valueChanges.subscribe({
3870
+ next: (value) => {
3871
+ this.hrefGo = value;
3872
+ }
3925
3873
  });
3926
3874
  }
3927
3875
  //Events
@@ -4250,7 +4198,6 @@ AnatolyDataModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", versio
4250
4198
  AnatolyDataModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: AnatolyDataModule, imports: [CommonModule] });
4251
4199
  AnatolyDataModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyDataModule, providers: [
4252
4200
  CoreApiService,
4253
- BillingApiService,
4254
4201
  EmailsApiService
4255
4202
  ], imports: [CommonModule] });
4256
4203
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyDataModule, decorators: [{
@@ -4261,7 +4208,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
4261
4208
  ],
4262
4209
  providers: [
4263
4210
  CoreApiService,
4264
- BillingApiService,
4265
4211
  EmailsApiService
4266
4212
  ]
4267
4213
  }]
@@ -4290,12 +4236,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
4290
4236
  */
4291
4237
  const FroalaEditorModuleWithProviders = FroalaEditorModule.forRoot();
4292
4238
  const FroalaViewModuleWithProviders = FroalaViewModule.forRoot();
4239
+ const COMPONENTS = [
4240
+ BuyAccessButtonComponent,
4241
+ SubscribePlanButtonComponent,
4242
+ SignInButtonComponent,
4243
+ SignUpButtonComponent,
4244
+ SignOutButtonComponent,
4245
+ NodataComponent,
4246
+ //Spinners
4247
+ PageSpinnerComponent,
4248
+ LoadingComponent,
4249
+ //Cards
4250
+ CardComponent,
4251
+ CardHeaderComponent,
4252
+ CardBodyComponent,
4253
+ CardFooterComponent,
4254
+ //HtmlEditor
4255
+ HtmlEditorComponent,
4256
+ FormsHtmlEditorComponent,
4257
+ //Directives
4258
+ NativeElementDirective,
4259
+ //Forms
4260
+ AddressComponent,
4261
+ CompanyComponent,
4262
+ UrlSlugComponent,
4263
+ TimezoneDropdownlist,
4264
+ ContactUsForm,
4265
+ //Dialogs
4266
+ ContactUsDialog,
4267
+ //Pipes
4268
+ SafeHtmlPipe,
4269
+ ReplaceTextPipe,
4270
+ FileSizePipe,
4271
+ //Validation
4272
+ FormValidationSummaryComponent,
4273
+ ItemValidationSummaryComponent
4274
+ ];
4293
4275
  class AnatolyUIModule {
4294
4276
  }
4295
4277
  AnatolyUIModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyUIModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4296
- AnatolyUIModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: AnatolyUIModule, declarations: [SubscribePlanButtonComponent,
4297
- UpgradePlanButtonComponent,
4298
- BuyAccessButtonComponent,
4278
+ AnatolyUIModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: AnatolyUIModule, declarations: [BuyAccessButtonComponent,
4279
+ SubscribePlanButtonComponent,
4299
4280
  SignInButtonComponent,
4300
4281
  SignUpButtonComponent,
4301
4282
  SignOutButtonComponent,
@@ -4332,9 +4313,8 @@ AnatolyUIModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version
4332
4313
  CommonModule,
4333
4314
  ReactiveFormsModule,
4334
4315
  FormsModule,
4335
- NgxCaptchaModule, i1$7.FroalaEditorModule, i1$7.FroalaViewModule], exports: [SubscribePlanButtonComponent,
4336
- UpgradePlanButtonComponent,
4337
- BuyAccessButtonComponent,
4316
+ NgxCaptchaModule, i1$7.FroalaEditorModule, i1$7.FroalaViewModule], exports: [BuyAccessButtonComponent,
4317
+ SubscribePlanButtonComponent,
4338
4318
  SignInButtonComponent,
4339
4319
  SignUpButtonComponent,
4340
4320
  SignOutButtonComponent,
@@ -4389,78 +4369,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
4389
4369
  FroalaViewModuleWithProviders,
4390
4370
  ],
4391
4371
  exports: [
4392
- SubscribePlanButtonComponent,
4393
- UpgradePlanButtonComponent,
4394
- BuyAccessButtonComponent,
4395
- SignInButtonComponent,
4396
- SignUpButtonComponent,
4397
- SignOutButtonComponent,
4398
- NodataComponent,
4399
- //Spinners
4400
- PageSpinnerComponent,
4401
- LoadingComponent,
4402
- //Cards
4403
- CardComponent,
4404
- CardHeaderComponent,
4405
- CardBodyComponent,
4406
- CardFooterComponent,
4407
- //HtmlEditor
4408
- HtmlEditorComponent,
4409
- FormsHtmlEditorComponent,
4410
- //Directives
4411
- NativeElementDirective,
4412
- //Forms
4413
- AddressComponent,
4414
- CompanyComponent,
4415
- UrlSlugComponent,
4416
- TimezoneDropdownlist,
4417
- ContactUsForm,
4418
- //Dialogs
4419
- ContactUsDialog,
4420
- //Pipes
4421
- SafeHtmlPipe,
4422
- ReplaceTextPipe,
4423
- FileSizePipe,
4424
- //Validation
4425
- FormValidationSummaryComponent,
4426
- ItemValidationSummaryComponent,
4372
+ ...COMPONENTS
4427
4373
  ],
4428
4374
  declarations: [
4429
- SubscribePlanButtonComponent,
4430
- UpgradePlanButtonComponent,
4431
- BuyAccessButtonComponent,
4432
- SignInButtonComponent,
4433
- SignUpButtonComponent,
4434
- SignOutButtonComponent,
4435
- NodataComponent,
4436
- //Spinners
4437
- PageSpinnerComponent,
4438
- LoadingComponent,
4439
- //Cards
4440
- CardComponent,
4441
- CardHeaderComponent,
4442
- CardBodyComponent,
4443
- CardFooterComponent,
4444
- //HtmlEditor
4445
- HtmlEditorComponent,
4446
- FormsHtmlEditorComponent,
4447
- //Directives
4448
- NativeElementDirective,
4449
- //Forms
4450
- AddressComponent,
4451
- CompanyComponent,
4452
- UrlSlugComponent,
4453
- TimezoneDropdownlist,
4454
- ContactUsForm,
4455
- //Dialogs
4456
- ContactUsDialog,
4457
- //Pipes
4458
- SafeHtmlPipe,
4459
- ReplaceTextPipe,
4460
- FileSizePipe,
4461
- //Validation
4462
- FormValidationSummaryComponent,
4463
- ItemValidationSummaryComponent,
4375
+ ...COMPONENTS
4464
4376
  ]
4465
4377
  }]
4466
4378
  }] });
@@ -4473,5 +4385,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
4473
4385
  * Generated bundle index. Do not edit.
4474
4386
  */
4475
4387
 
4476
- export { AddressComponent, Alerts, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyUIModule, AppContextService, AppCoreSettings, BaseApiService, BaseComponent, BaseDialog, BaseEditComponent, BaseGoService, BaseGridEditService, BaseGridReadService, BaseHtmlEditorComponent, BillingApiService, BuyAccessButtonComponent, CardBodyComponent, CardComponent, CardFooterComponent, CardHeaderComponent, CompanyComponent, ContactUsDialog, ContactUsForm, ContextInitState, Convert, CoreApiService, DOM, DefaultEditorOptions, DigitalMarketingService, EmailsApiService, FileSizePipe, FormValidationSummaryComponent, FormsHtmlEditorComponent, FroalaEditorModuleWithProviders, FroalaViewModuleWithProviders, GlobalErrorHandler, GoogleAnalyticsService, Guid, HtmlEditorComponent, IdleService, InjectorInstance, ItemValidationSummaryComponent, LoadingComponent, LoadingService, LocalStorageService, LocalizationInjectorInstance, LocalizationModule, LocalizationService, LocalizationSettingsModule, LocalizePipe, LoggingService, NativeElementDirective, NodataComponent, NotificationService, NotificationsApiService, PageSpinnerComponent, ReplaceTextPipe, SafeHtmlPipe, SessionStorageService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, Subs, SubscribePlanButtonComponent, TimezoneDropdownlist, TranslateModuleAtRoot, UpgradePlanButtonComponent, UrlSlugComponent, Urls, Utils, ValidationSummaryComponent, customTranslateLoaderFactory, localizationInitializerFactory, throwIfAlreadyLoaded };
4388
+ export { AddressComponent, Alerts, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyUIModule, AppContextService, AppCoreSettings, BaseApiService, BaseComponent, BaseDialog, BaseEditComponent, BaseGoService, BaseGridEditService, BaseGridReadService, BaseHtmlEditorComponent, BuyAccessButtonComponent, CardBodyComponent, CardComponent, CardFooterComponent, CardHeaderComponent, CompanyComponent, ContactUsDialog, ContactUsForm, ContextInitState, Convert, CoreApiService, DOM, DefaultEditorOptions, DigitalMarketingService, EmailsApiService, FileSizePipe, FormValidationSummaryComponent, FormsHtmlEditorComponent, FroalaEditorModuleWithProviders, FroalaViewModuleWithProviders, GlobalErrorHandler, GoogleAnalyticsService, Guid, HtmlEditorComponent, IdleService, InjectorInstance, ItemValidationSummaryComponent, LoadingComponent, LoadingService, LocalStorageService, LocalizationInjectorInstance, LocalizationModule, LocalizationService, LocalizationSettingsModule, LocalizePipe, LoggingService, NativeElementDirective, NodataComponent, NotificationService, NotificationsApiService, PageSpinnerComponent, ReplaceTextPipe, SafeHtmlPipe, SessionStorageService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, Subs, SubscribePlanButtonComponent, TimezoneDropdownlist, TranslateModuleAtRoot, UrlSlugComponent, Urls, Utils, ValidationSummaryComponent, customTranslateLoaderFactory, localizationInitializerFactory, throwIfAlreadyLoaded };
4477
4389
  //# sourceMappingURL=osovitny-anatoly.mjs.map