@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
  });
@@ -1437,9 +1441,10 @@ class AppContextService extends BaseApiService {
1437
1441
  }
1438
1442
  let now = new Date();
1439
1443
  console.log('Requesting a new AppContext at ' + now);
1440
- this.subscription = this.get('getCurrentContext', null).subscribe((data) => {
1441
- this.dataReceived(data);
1442
- }, (e) => {
1444
+ this.subscription = this.get('getCurrentContext', null).subscribe({
1445
+ next: (data) => {
1446
+ this.dataReceived(data);
1447
+ }
1443
1448
  });
1444
1449
  }
1445
1450
  updateCurrent(success = null) {
@@ -1499,13 +1504,15 @@ class IdleService {
1499
1504
  this.startDate = new Date();
1500
1505
  }
1501
1506
  startTimer() {
1502
- this.timer$ = timer(this.timeOutMilliSeconds, 1 * 1000).subscribe((res) => {
1503
- let nowDate = new Date();
1504
- let exiredDate = new Date(this.startDate.getTime() + this.timeOutMilliSeconds);
1505
- if (nowDate.getTime() >= exiredDate.getTime()) {
1506
- //console.log("nowDate: " + nowDate);
1507
- //console.log("exiredDate: " + exiredDate);
1508
- this.expired$.next(true);
1507
+ this.timer$ = timer(this.timeOutMilliSeconds, 1 * 1000).subscribe({
1508
+ next: (data) => {
1509
+ let nowDate = new Date();
1510
+ let exiredDate = new Date(this.startDate.getTime() + this.timeOutMilliSeconds);
1511
+ if (nowDate.getTime() >= exiredDate.getTime()) {
1512
+ //console.log("nowDate: " + nowDate);
1513
+ //console.log("exiredDate: " + exiredDate);
1514
+ this.expired$.next(true);
1515
+ }
1509
1516
  }
1510
1517
  });
1511
1518
  }
@@ -1516,8 +1523,10 @@ class IdleService {
1516
1523
  startWatching(timeOutSeconds) {
1517
1524
  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'));
1518
1525
  this.resetTimeCounters(timeOutSeconds);
1519
- this.idleSubscription = this.idle$.subscribe((res) => {
1520
- this.resetTimer();
1526
+ this.idleSubscription = this.idle$.subscribe({
1527
+ next: (data) => {
1528
+ this.resetTimer();
1529
+ }
1521
1530
  });
1522
1531
  this.startTimer();
1523
1532
  return this.expired$;
@@ -1630,11 +1639,13 @@ class GoogleAnalyticsService {
1630
1639
  */
1631
1640
  }
1632
1641
  subscribe() {
1633
- this.subscription = this.router.events.subscribe(event => {
1634
- if (event instanceof NavigationEnd) {
1635
- if (window.ga) {
1636
- window.ga('set', 'page', event.urlAfterRedirects);
1637
- window.ga('send', 'pageview');
1642
+ this.subscription = this.router.events.subscribe({
1643
+ next: (event) => {
1644
+ if (event instanceof NavigationEnd) {
1645
+ if (window.ga) {
1646
+ window.ga('set', 'page', event.urlAfterRedirects);
1647
+ window.ga('send', 'pageview');
1648
+ }
1638
1649
  }
1639
1650
  }
1640
1651
  });
@@ -1969,13 +1980,16 @@ class BaseGridReadService extends BehaviorSubject {
1969
1980
  url = this.baseReadUrl + `${this.serializeParams(params)}`;
1970
1981
  this.savedReadParams = params;
1971
1982
  }
1972
- this.http.get(url).pipe(map(res => res)).subscribe(data => {
1973
- super.next(data);
1974
- if (success)
1975
- success();
1976
- }, e => {
1977
- if (error)
1978
- error(e);
1983
+ this.http.get(url).pipe(map(res => res)).subscribe({
1984
+ next: (data) => {
1985
+ super.next(data);
1986
+ if (success)
1987
+ success();
1988
+ },
1989
+ error: (e) => {
1990
+ if (error)
1991
+ error(e);
1992
+ }
1979
1993
  });
1980
1994
  }
1981
1995
  }
@@ -2021,24 +2035,31 @@ class BaseGridEditService extends BaseGridReadService {
2021
2035
  save(data, isNew, sucess) {
2022
2036
  const action = isNew ? 'add' : 'update';
2023
2037
  this.reset();
2024
- this.post(action, data).subscribe(() => {
2025
- }, () => {
2026
- this.read();
2027
- }, () => {
2028
- this.read();
2029
- if (sucess)
2030
- sucess();
2038
+ this.post(action, data).subscribe({
2039
+ next: (data) => {
2040
+ },
2041
+ error: (e) => {
2042
+ this.read();
2043
+ },
2044
+ complete: () => {
2045
+ this.read();
2046
+ if (sucess)
2047
+ sucess();
2048
+ }
2031
2049
  });
2032
2050
  }
2033
2051
  delete(data, sucess) {
2034
2052
  this.reset();
2035
2053
  const url = `${this.baseUrl}/delete${this.serializeParams(data)}`;
2036
- return this.http.delete(url).subscribe(() => {
2037
- this.read();
2038
- if (sucess)
2039
- sucess();
2040
- }, () => {
2041
- this.read();
2054
+ return this.http.delete(url).subscribe({
2055
+ next: (data) => {
2056
+ this.read();
2057
+ if (sucess)
2058
+ sucess();
2059
+ },
2060
+ error: (e) => {
2061
+ this.read();
2062
+ }
2042
2063
  });
2043
2064
  }
2044
2065
  post(action, data) {
@@ -2070,8 +2091,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
2070
2091
  const Consts = {
2071
2092
  //core
2072
2093
  coreApiPath: 'api/core',
2073
- //billing
2074
- billingApiPath: 'api/billing',
2075
2094
  //emails
2076
2095
  emailsApiPath: 'api/emails',
2077
2096
  //notifications
@@ -2112,52 +2131,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
2112
2131
  }]
2113
2132
  }], ctorParameters: function () { return [{ type: i1$3.HttpClient }]; } });
2114
2133
 
2115
- /*
2116
- <file>
2117
- Project:
2118
- @osovitny/anatoly
2119
-
2120
- Authors:
2121
- Vadim Osovitny
2122
- Anatoly Osovitny
2123
-
2124
- Created:
2125
- 12 Nov 2017
2126
-
2127
- Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2128
- </file>
2129
- */
2130
- class BillingApiService extends BaseApiService {
2131
- constructor(http) {
2132
- super(http);
2133
- this.http = http;
2134
- this.baseUrl = Consts.billingApiPath;
2135
- }
2136
- requestNewSubscription(requestedPlan, success, error) {
2137
- this.postQS("requestNewSubscription", { requestedPlan: requestedPlan }).subscribe((data) => {
2138
- if (success)
2139
- success();
2140
- }, (e) => {
2141
- if (error)
2142
- error();
2143
- });
2144
- }
2145
- cancelRequestedSubscription(success, error) {
2146
- this.postQS("cancelRequestedSubscription", null).subscribe((data) => {
2147
- if (success)
2148
- success();
2149
- }, (e) => {
2150
- if (error)
2151
- error();
2152
- });
2153
- }
2154
- }
2155
- 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 });
2156
- BillingApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BillingApiService });
2157
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BillingApiService, decorators: [{
2158
- type: Injectable
2159
- }], ctorParameters: function () { return [{ type: i1$3.HttpClient }]; } });
2160
-
2161
2134
  /*
2162
2135
  <file>
2163
2136
  Project:
@@ -2180,12 +2153,17 @@ class EmailsApiService extends BaseApiService {
2180
2153
  this.baseUrl = Consts.emailsApiPath;
2181
2154
  }
2182
2155
  sendContactUs(captcha, name, email, topic, subject, message, success, error) {
2183
- return this.post('sendContactUs', { captcha, name, email, topic, subject, message }).subscribe(data => {
2184
- if (success)
2185
- success(data);
2186
- }, e => {
2187
- if (error)
2188
- error(e);
2156
+ return this.post('sendContactUs', { captcha, name, email, topic, subject, message }).subscribe({
2157
+ next: (data) => {
2158
+ if (success) {
2159
+ success(data);
2160
+ }
2161
+ },
2162
+ error: (e) => {
2163
+ if (error) {
2164
+ error(e);
2165
+ }
2166
+ }
2189
2167
  });
2190
2168
  }
2191
2169
  }
@@ -2217,13 +2195,31 @@ class CoreApiService extends BaseApiService {
2217
2195
  this.baseUrl = Consts.coreApiPath;
2218
2196
  }
2219
2197
  getTimezonesJsonFile(done) {
2220
- this.getExternalJsonFile('anatoly', 'timezones.json').subscribe(data => done(data));
2198
+ this.getExternalJsonFile('anatoly', 'timezones.json').subscribe({
2199
+ next: (data) => {
2200
+ if (done) {
2201
+ done(data);
2202
+ }
2203
+ }
2204
+ });
2221
2205
  }
2222
2206
  getUSStatesJsonFile(done) {
2223
- this.getExternalJsonFile('anatoly', 'usStates.json').subscribe(data => done(data));
2207
+ this.getExternalJsonFile('anatoly', 'usStates.json').subscribe({
2208
+ next: (data) => {
2209
+ if (done) {
2210
+ done(data);
2211
+ }
2212
+ }
2213
+ });
2224
2214
  }
2225
2215
  getCountriesJsonFile(done) {
2226
- this.getExternalJsonFile('anatoly', 'countries.json').subscribe(data => done(data));
2216
+ this.getExternalJsonFile('anatoly', 'countries.json').subscribe({
2217
+ next: (data) => {
2218
+ if (done) {
2219
+ done(data);
2220
+ }
2221
+ }
2222
+ });
2227
2223
  }
2228
2224
  }
2229
2225
  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 });
@@ -2508,16 +2504,12 @@ class BuyAccessButtonComponent {
2508
2504
  this.appContext = appContext;
2509
2505
  this.contextUpdated = false;
2510
2506
  this.isUserSignedIn = false;
2511
- this.currentPlan = 0;
2507
+ this.currentPlan = -1;
2512
2508
  this.currentPlanTitle = '';
2513
2509
  this.visibleIfUserSignedIn = false;
2514
2510
  this.buy = new EventEmitter();
2515
2511
  }
2516
2512
  ngOnInit() {
2517
- if (!this.appContext.isUserSignedIn()) {
2518
- this.contextUpdated = true;
2519
- return;
2520
- }
2521
2513
  this.appContext.getCurrent((current) => {
2522
2514
  this.isUserSignedIn = current.isUserSignedIn;
2523
2515
  if (this.isUserSignedIn) {
@@ -2529,29 +2521,17 @@ class BuyAccessButtonComponent {
2529
2521
  }
2530
2522
  //Events
2531
2523
  onBuyAccess() {
2532
- /*
2533
- const text = `Requested plan: ${this.plantitle} `;
2534
- const that = this;
2535
-
2536
- Alerts.areYouSure(text, 'Buying access', 'Confirm change', 'Cancel', () => {
2537
- that.api.buyAccess(that.plan, () => {
2538
- Alerts.success('Access Granted', null, null,() => {
2539
- (window as any).location.reload();
2540
- });
2541
- });
2542
- });
2543
- */
2544
2524
  this.buy.emit(this.plan);
2545
2525
  }
2546
2526
  }
2547
2527
  BuyAccessButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BuyAccessButtonComponent, deps: [{ token: AppContextService }], target: i0.ɵɵFactoryTarget.Component });
2548
- 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"] }] });
2528
+ 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"] }] });
2549
2529
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BuyAccessButtonComponent, decorators: [{
2550
2530
  type: Component,
2551
- 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" }]
2531
+ 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" }]
2552
2532
  }], ctorParameters: function () { return [{ type: AppContextService }]; }, propDecorators: { plan: [{
2553
2533
  type: Input
2554
- }], plantitle: [{
2534
+ }], planTitle: [{
2555
2535
  type: Input
2556
2536
  }], visibleIfUserSignedIn: [{
2557
2537
  type: Input
@@ -2559,50 +2539,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
2559
2539
  type: Output
2560
2540
  }] } });
2561
2541
 
2562
- /*
2563
- <file>
2564
- Project:
2565
- @osovitny/anatoly
2566
-
2567
- Authors:
2568
- Vadim Osovitny
2569
- Anatoly Osovitny
2570
-
2571
- Created:
2572
- 12 Nov 2017
2573
-
2574
- Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2575
- </file>
2576
- */
2577
- class UpgradePlanButtonComponent {
2578
- constructor(api) {
2579
- this.api = api;
2580
- }
2581
- onUpgradePlan() {
2582
- const text = `Current plan: ${this.currentplantitle} New plan: ${this.requestedplantitle}`;
2583
- const that = this;
2584
- Alerts.areYouSure(text, 'Change billing plan', 'Confirm change', 'Cancel', () => {
2585
- that.api.requestNewSubscription(that.requestedplan, () => {
2586
- Alerts.success('Your request for changing plan has been sent.', null, null, () => {
2587
- window.location.reload();
2588
- });
2589
- });
2590
- });
2591
- }
2592
- }
2593
- UpgradePlanButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: UpgradePlanButtonComponent, deps: [{ token: BillingApiService }], target: i0.ɵɵFactoryTarget.Component });
2594
- 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" });
2595
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: UpgradePlanButtonComponent, decorators: [{
2596
- type: Component,
2597
- args: [{ selector: 'anatoly-upgrade-plan-button', template: "<button class=\"btn btn-block btn-primary\" (click)=\"onUpgradePlan()\">\r\n Upgrade\r\n</button>\r\n" }]
2598
- }], ctorParameters: function () { return [{ type: BillingApiService }]; }, propDecorators: { currentplantitle: [{
2599
- type: Input
2600
- }], requestedplan: [{
2601
- type: Input
2602
- }], requestedplantitle: [{
2603
- type: Input
2604
- }] } });
2605
-
2606
2542
  /*
2607
2543
  <file>
2608
2544
  Project:
@@ -2619,22 +2555,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
2619
2555
  </file>
2620
2556
  */
2621
2557
  class SubscribePlanButtonComponent {
2622
- constructor(appcontext) {
2623
- this.appcontext = appcontext;
2558
+ constructor(appContext) {
2559
+ this.appContext = appContext;
2624
2560
  this.contextUpdated = false;
2625
2561
  this.isUserSignedIn = false;
2626
- this.currentPlan = 0;
2562
+ this.currentPlan = -1;
2627
2563
  this.currentPlanTitle = "";
2628
- this.requestedPlan = 0;
2564
+ this.requestedPlan = -1;
2629
2565
  this.requestedPlanTitle = "";
2630
2566
  this.visibleIfUserSignedIn = false;
2567
+ this.subscribe = new EventEmitter();
2631
2568
  }
2632
2569
  ngOnInit() {
2633
- if (!this.appcontext.isUserSignedIn()) {
2634
- this.contextUpdated = true;
2635
- return;
2636
- }
2637
- this.appcontext.getCurrent((current) => {
2570
+ this.appContext.getCurrent((current) => {
2638
2571
  this.isUserSignedIn = current.isUserSignedIn;
2639
2572
  if (this.isUserSignedIn) {
2640
2573
  this.currentPlan = current.account.billingPlan;
@@ -2645,18 +2578,24 @@ class SubscribePlanButtonComponent {
2645
2578
  this.contextUpdated = true;
2646
2579
  });
2647
2580
  }
2581
+ //Events
2582
+ onSubscribe() {
2583
+ this.subscribe.emit(this.plan);
2584
+ }
2648
2585
  }
2649
2586
  SubscribePlanButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SubscribePlanButtonComponent, deps: [{ token: AppContextService }], target: i0.ɵɵFactoryTarget.Component });
2650
- 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"] }] });
2587
+ 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"] }] });
2651
2588
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SubscribePlanButtonComponent, decorators: [{
2652
2589
  type: Component,
2653
- 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" }]
2590
+ 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" }]
2654
2591
  }], ctorParameters: function () { return [{ type: AppContextService }]; }, propDecorators: { plan: [{
2655
2592
  type: Input
2656
- }], plantitle: [{
2593
+ }], planTitle: [{
2657
2594
  type: Input
2658
2595
  }], visibleIfUserSignedIn: [{
2659
2596
  type: Input
2597
+ }], subscribe: [{
2598
+ type: Output
2660
2599
  }] } });
2661
2600
 
2662
2601
  /*
@@ -3232,8 +3171,10 @@ class LoadingComponent {
3232
3171
  this.show = false;
3233
3172
  }
3234
3173
  ngOnInit() {
3235
- this.subs.sink = this.loadingService.subscribe((state) => {
3236
- this.show = state;
3174
+ this.subs.sink = this.loadingService.subscribe({
3175
+ next: (data) => {
3176
+ this.show = data;
3177
+ }
3237
3178
  });
3238
3179
  }
3239
3180
  ngOnDestroy() {
@@ -3278,19 +3219,22 @@ class PageSpinnerComponent {
3278
3219
  constructor(router, document) {
3279
3220
  this.router = router;
3280
3221
  this.document = document;
3281
- this.backgroundColor = '#2196f3';
3282
- this.spinner = Spinkit.skLine;
3283
3222
  this.isSpinnerVisible = true;
3284
3223
  this.Spinkit = Spinkit;
3285
- this.router.events.subscribe(event => {
3286
- if (event instanceof NavigationStart) {
3287
- this.isSpinnerVisible = true;
3288
- }
3289
- else if (event instanceof NavigationEnd || event instanceof NavigationCancel || event instanceof NavigationError) {
3224
+ this.backgroundColor = '#2196f3';
3225
+ this.spinner = Spinkit.skLine;
3226
+ this.router.events.subscribe({
3227
+ next: (event) => {
3228
+ if (event instanceof NavigationStart) {
3229
+ this.isSpinnerVisible = true;
3230
+ }
3231
+ else if (event instanceof NavigationEnd || event instanceof NavigationCancel || event instanceof NavigationError) {
3232
+ this.isSpinnerVisible = false;
3233
+ }
3234
+ },
3235
+ error: (e) => {
3290
3236
  this.isSpinnerVisible = false;
3291
3237
  }
3292
- }, () => {
3293
- this.isSpinnerVisible = false;
3294
3238
  });
3295
3239
  }
3296
3240
  ngOnDestroy() {
@@ -3921,15 +3865,19 @@ class UrlSlugComponent extends BaseEditComponent {
3921
3865
  this.setFormValue(this.controlName, event.urlSlug);
3922
3866
  }
3923
3867
  startWatching() {
3924
- this.subs.sink = this.formGroup.get(this.watchedControlName).valueChanges.subscribe(value => {
3925
- if (this.firstValue) {
3926
- this.firstValue = false;
3927
- return;
3868
+ this.subs.sink = this.formGroup.get(this.watchedControlName).valueChanges.subscribe({
3869
+ next: (value) => {
3870
+ if (this.firstValue) {
3871
+ this.firstValue = false;
3872
+ return;
3873
+ }
3874
+ this.generateUrlSlug(value);
3928
3875
  }
3929
- this.generateUrlSlug(value);
3930
3876
  });
3931
- this.subs.sink = this.formGroup.get(this.controlName).valueChanges.subscribe(value => {
3932
- this.hrefGo = value;
3877
+ this.subs.sink = this.formGroup.get(this.controlName).valueChanges.subscribe({
3878
+ next: (value) => {
3879
+ this.hrefGo = value;
3880
+ }
3933
3881
  });
3934
3882
  }
3935
3883
  //Events
@@ -4255,7 +4203,6 @@ AnatolyDataModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", versio
4255
4203
  AnatolyDataModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: AnatolyDataModule, imports: [CommonModule] });
4256
4204
  AnatolyDataModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyDataModule, providers: [
4257
4205
  CoreApiService,
4258
- BillingApiService,
4259
4206
  EmailsApiService
4260
4207
  ], imports: [CommonModule] });
4261
4208
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyDataModule, decorators: [{
@@ -4266,7 +4213,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
4266
4213
  ],
4267
4214
  providers: [
4268
4215
  CoreApiService,
4269
- BillingApiService,
4270
4216
  EmailsApiService
4271
4217
  ]
4272
4218
  }]
@@ -4293,12 +4239,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
4293
4239
  */
4294
4240
  const FroalaEditorModuleWithProviders = FroalaEditorModule.forRoot();
4295
4241
  const FroalaViewModuleWithProviders = FroalaViewModule.forRoot();
4242
+ const COMPONENTS = [
4243
+ BuyAccessButtonComponent,
4244
+ SubscribePlanButtonComponent,
4245
+ SignInButtonComponent,
4246
+ SignUpButtonComponent,
4247
+ SignOutButtonComponent,
4248
+ NodataComponent,
4249
+ //Spinners
4250
+ PageSpinnerComponent,
4251
+ LoadingComponent,
4252
+ //Cards
4253
+ CardComponent,
4254
+ CardHeaderComponent,
4255
+ CardBodyComponent,
4256
+ CardFooterComponent,
4257
+ //HtmlEditor
4258
+ HtmlEditorComponent,
4259
+ FormsHtmlEditorComponent,
4260
+ //Directives
4261
+ NativeElementDirective,
4262
+ //Forms
4263
+ AddressComponent,
4264
+ CompanyComponent,
4265
+ UrlSlugComponent,
4266
+ TimezoneDropdownlist,
4267
+ ContactUsForm,
4268
+ //Dialogs
4269
+ ContactUsDialog,
4270
+ //Pipes
4271
+ SafeHtmlPipe,
4272
+ ReplaceTextPipe,
4273
+ FileSizePipe,
4274
+ //Validation
4275
+ FormValidationSummaryComponent,
4276
+ ItemValidationSummaryComponent
4277
+ ];
4296
4278
  class AnatolyUIModule {
4297
4279
  }
4298
4280
  AnatolyUIModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyUIModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4299
- AnatolyUIModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: AnatolyUIModule, declarations: [SubscribePlanButtonComponent,
4300
- UpgradePlanButtonComponent,
4301
- BuyAccessButtonComponent,
4281
+ AnatolyUIModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: AnatolyUIModule, declarations: [BuyAccessButtonComponent,
4282
+ SubscribePlanButtonComponent,
4302
4283
  SignInButtonComponent,
4303
4284
  SignUpButtonComponent,
4304
4285
  SignOutButtonComponent,
@@ -4335,9 +4316,8 @@ AnatolyUIModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version
4335
4316
  CommonModule,
4336
4317
  ReactiveFormsModule,
4337
4318
  FormsModule,
4338
- NgxCaptchaModule, i1$7.FroalaEditorModule, i1$7.FroalaViewModule], exports: [SubscribePlanButtonComponent,
4339
- UpgradePlanButtonComponent,
4340
- BuyAccessButtonComponent,
4319
+ NgxCaptchaModule, i1$7.FroalaEditorModule, i1$7.FroalaViewModule], exports: [BuyAccessButtonComponent,
4320
+ SubscribePlanButtonComponent,
4341
4321
  SignInButtonComponent,
4342
4322
  SignUpButtonComponent,
4343
4323
  SignOutButtonComponent,
@@ -4392,78 +4372,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
4392
4372
  FroalaViewModuleWithProviders,
4393
4373
  ],
4394
4374
  exports: [
4395
- SubscribePlanButtonComponent,
4396
- UpgradePlanButtonComponent,
4397
- BuyAccessButtonComponent,
4398
- SignInButtonComponent,
4399
- SignUpButtonComponent,
4400
- SignOutButtonComponent,
4401
- NodataComponent,
4402
- //Spinners
4403
- PageSpinnerComponent,
4404
- LoadingComponent,
4405
- //Cards
4406
- CardComponent,
4407
- CardHeaderComponent,
4408
- CardBodyComponent,
4409
- CardFooterComponent,
4410
- //HtmlEditor
4411
- HtmlEditorComponent,
4412
- FormsHtmlEditorComponent,
4413
- //Directives
4414
- NativeElementDirective,
4415
- //Forms
4416
- AddressComponent,
4417
- CompanyComponent,
4418
- UrlSlugComponent,
4419
- TimezoneDropdownlist,
4420
- ContactUsForm,
4421
- //Dialogs
4422
- ContactUsDialog,
4423
- //Pipes
4424
- SafeHtmlPipe,
4425
- ReplaceTextPipe,
4426
- FileSizePipe,
4427
- //Validation
4428
- FormValidationSummaryComponent,
4429
- ItemValidationSummaryComponent,
4375
+ ...COMPONENTS
4430
4376
  ],
4431
4377
  declarations: [
4432
- SubscribePlanButtonComponent,
4433
- UpgradePlanButtonComponent,
4434
- BuyAccessButtonComponent,
4435
- SignInButtonComponent,
4436
- SignUpButtonComponent,
4437
- SignOutButtonComponent,
4438
- NodataComponent,
4439
- //Spinners
4440
- PageSpinnerComponent,
4441
- LoadingComponent,
4442
- //Cards
4443
- CardComponent,
4444
- CardHeaderComponent,
4445
- CardBodyComponent,
4446
- CardFooterComponent,
4447
- //HtmlEditor
4448
- HtmlEditorComponent,
4449
- FormsHtmlEditorComponent,
4450
- //Directives
4451
- NativeElementDirective,
4452
- //Forms
4453
- AddressComponent,
4454
- CompanyComponent,
4455
- UrlSlugComponent,
4456
- TimezoneDropdownlist,
4457
- ContactUsForm,
4458
- //Dialogs
4459
- ContactUsDialog,
4460
- //Pipes
4461
- SafeHtmlPipe,
4462
- ReplaceTextPipe,
4463
- FileSizePipe,
4464
- //Validation
4465
- FormValidationSummaryComponent,
4466
- ItemValidationSummaryComponent,
4378
+ ...COMPONENTS
4467
4379
  ]
4468
4380
  }]
4469
4381
  }] });
@@ -4476,5 +4388,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImpor
4476
4388
  * Generated bundle index. Do not edit.
4477
4389
  */
4478
4390
 
4479
- 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 };
4391
+ 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 };
4480
4392
  //# sourceMappingURL=osovitny-anatoly.mjs.map