@ethlete/core 0.2.0-next.1 → 0.2.0-next.11

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 (149) hide show
  1. package/esm2020/lib/components/public-api.mjs +2 -0
  2. package/esm2020/lib/components/structured-data/public-api.mjs +2 -0
  3. package/esm2020/lib/components/structured-data/structured-data.component.mjs +37 -0
  4. package/esm2020/lib/decorators/index.mjs +2 -0
  5. package/esm2020/lib/decorators/memo/memo.decorator.mjs +2 -2
  6. package/esm2020/lib/directives/click-outside/click-outside.directive.mjs +37 -0
  7. package/esm2020/lib/directives/click-outside/public-api.mjs +2 -0
  8. package/esm2020/lib/directives/cursor-drag-scroll/cursor-drag-scroll.constants.mjs +3 -0
  9. package/esm2020/lib/directives/cursor-drag-scroll/cursor-drag-scroll.directive.mjs +147 -0
  10. package/esm2020/lib/directives/cursor-drag-scroll/public-api.mjs +2 -0
  11. package/esm2020/lib/directives/let/let.directive.mjs +8 -8
  12. package/esm2020/lib/directives/observe-content/observe-content.directive.mjs +68 -0
  13. package/esm2020/lib/directives/observe-content/public-api.mjs +2 -0
  14. package/esm2020/lib/directives/observe-resize/observe-resize.directive.mjs +68 -0
  15. package/esm2020/lib/directives/observe-resize/public-api.mjs +2 -0
  16. package/esm2020/lib/directives/observe-scroll-state/observe-scroll-state.constants.mjs +3 -0
  17. package/esm2020/lib/directives/observe-scroll-state/observe-scroll-state.directive.mjs +171 -0
  18. package/esm2020/lib/directives/observe-scroll-state/observe-scroll-state.types.mjs +2 -0
  19. package/esm2020/lib/directives/observe-scroll-state/public-api.mjs +3 -0
  20. package/esm2020/lib/directives/public-api.mjs +10 -1
  21. package/esm2020/lib/directives/repeat/repeat.directive.mjs +10 -11
  22. package/esm2020/lib/directives/scroll-observer-first-element/index.mjs +2 -0
  23. package/esm2020/lib/directives/scroll-observer-first-element/public-api.mjs +2 -0
  24. package/esm2020/lib/directives/scroll-observer-first-element/scroll-observer-first-element.directive.mjs +31 -0
  25. package/esm2020/lib/directives/scroll-observer-ignore-target/index.mjs +2 -0
  26. package/esm2020/lib/directives/scroll-observer-ignore-target/public-api.mjs +2 -0
  27. package/esm2020/lib/directives/scroll-observer-ignore-target/scroll-observer-ignore-target.directive.mjs +18 -0
  28. package/esm2020/lib/directives/scroll-observer-last-element/index.mjs +2 -0
  29. package/esm2020/lib/directives/scroll-observer-last-element/public-api.mjs +2 -0
  30. package/esm2020/lib/directives/scroll-observer-last-element/scroll-observer-last-element.directive.mjs +34 -0
  31. package/esm2020/lib/directives/seo/public-api.mjs +5 -0
  32. package/esm2020/lib/directives/seo/seo.directive.constants.mjs +3 -0
  33. package/esm2020/lib/directives/seo/seo.directive.mjs +166 -0
  34. package/esm2020/lib/directives/seo/seo.directive.types.mjs +2 -0
  35. package/esm2020/lib/directives/seo/seo.directive.utils.mjs +7 -0
  36. package/esm2020/lib/pipes/normalize-game-result-type/normalize-game-result-type.pipe.mjs +15 -0
  37. package/esm2020/lib/pipes/normalize-game-result-type/normalize-game-result-type.types.mjs +2 -0
  38. package/esm2020/lib/pipes/normalize-game-result-type/normalize-game-result-type.util.mjs +34 -0
  39. package/esm2020/lib/pipes/normalize-game-result-type/public-api.mjs +4 -0
  40. package/esm2020/lib/pipes/normalize-match-participants/normalize-match-participants.pipe.mjs +15 -0
  41. package/esm2020/lib/pipes/normalize-match-participants/normalize-match-participants.types.mjs +2 -0
  42. package/esm2020/lib/pipes/normalize-match-participants/normalize-match-participants.util.mjs +47 -0
  43. package/esm2020/lib/pipes/normalize-match-participants/public-api.mjs +4 -0
  44. package/esm2020/lib/pipes/normalize-match-score/normalize-match-score.pipe.mjs +15 -0
  45. package/esm2020/lib/pipes/normalize-match-score/normalize-match-score.types.mjs +2 -0
  46. package/esm2020/lib/pipes/normalize-match-score/normalize-match-score.util.mjs +126 -0
  47. package/esm2020/lib/pipes/normalize-match-score/public-api.mjs +4 -0
  48. package/esm2020/lib/pipes/normalize-match-state/index.mjs +2 -0
  49. package/esm2020/lib/pipes/normalize-match-state/normalize-match-state.constants.mjs +2 -0
  50. package/esm2020/lib/pipes/normalize-match-state/normalize-match-state.pipe.mjs +15 -0
  51. package/esm2020/lib/pipes/normalize-match-state/normalize-match-state.util.mjs +19 -0
  52. package/esm2020/lib/pipes/normalize-match-state/public-api.mjs +4 -0
  53. package/esm2020/lib/pipes/normalize-match-type/normalize-match-type.pipe.mjs +15 -0
  54. package/esm2020/lib/pipes/normalize-match-type/normalize-match-type.util.mjs +38 -0
  55. package/esm2020/lib/pipes/normalize-match-type/public-api.mjs +3 -0
  56. package/esm2020/lib/pipes/public-api.mjs +6 -1
  57. package/esm2020/lib/pipes/to-array/to-array.pipe.mjs +3 -3
  58. package/esm2020/lib/public-api.mjs +2 -1
  59. package/esm2020/lib/services/click-observer.service.mjs +73 -0
  60. package/esm2020/lib/services/content-observer.service.mjs +79 -0
  61. package/esm2020/lib/services/destroy.service.mjs +19 -0
  62. package/esm2020/lib/services/focus-visible.service.mjs +7 -7
  63. package/esm2020/lib/services/index.mjs +2 -0
  64. package/esm2020/lib/services/public-api.mjs +6 -2
  65. package/esm2020/lib/services/resize-observer.service.mjs +75 -0
  66. package/esm2020/lib/services/viewport.service.mjs +43 -18
  67. package/esm2020/lib/types/i18n.types.mjs +2 -0
  68. package/esm2020/lib/types/public-api.mjs +3 -2
  69. package/esm2020/lib/utils/index.mjs +2 -0
  70. package/esm2020/lib/utils/public-api.mjs +4 -2
  71. package/esm2020/lib/utils/reactive-binding.util.mjs +67 -0
  72. package/esm2020/lib/utils/scrollable.utils.mjs +5 -0
  73. package/fesm2015/ethlete-core.mjs +1514 -119
  74. package/fesm2015/ethlete-core.mjs.map +1 -1
  75. package/fesm2020/ethlete-core.mjs +1511 -119
  76. package/fesm2020/ethlete-core.mjs.map +1 -1
  77. package/lib/components/public-api.d.ts +1 -0
  78. package/lib/components/structured-data/public-api.d.ts +1 -0
  79. package/lib/components/structured-data/structured-data.component.d.ts +11 -0
  80. package/lib/decorators/index.d.ts +1 -0
  81. package/lib/directives/click-outside/click-outside.directive.d.ts +12 -0
  82. package/lib/directives/click-outside/public-api.d.ts +1 -0
  83. package/lib/directives/cursor-drag-scroll/cursor-drag-scroll.constants.d.ts +2 -0
  84. package/lib/directives/cursor-drag-scroll/cursor-drag-scroll.directive.d.ts +27 -0
  85. package/lib/directives/cursor-drag-scroll/public-api.d.ts +1 -0
  86. package/lib/directives/let/let.directive.d.ts +1 -1
  87. package/lib/directives/observe-content/observe-content.directive.d.ts +22 -0
  88. package/lib/directives/observe-content/public-api.d.ts +1 -0
  89. package/lib/directives/observe-resize/observe-resize.directive.d.ts +22 -0
  90. package/lib/directives/observe-resize/public-api.d.ts +1 -0
  91. package/lib/directives/observe-scroll-state/observe-scroll-state.constants.d.ts +3 -0
  92. package/lib/directives/observe-scroll-state/observe-scroll-state.directive.d.ts +31 -0
  93. package/lib/directives/observe-scroll-state/observe-scroll-state.types.d.ts +6 -0
  94. package/lib/directives/observe-scroll-state/public-api.d.ts +3 -0
  95. package/lib/directives/public-api.d.ts +9 -0
  96. package/lib/directives/repeat/repeat.directive.d.ts +3 -4
  97. package/lib/directives/scroll-observer-first-element/index.d.ts +1 -0
  98. package/lib/directives/scroll-observer-first-element/public-api.d.ts +1 -0
  99. package/lib/directives/scroll-observer-first-element/scroll-observer-first-element.directive.d.ts +10 -0
  100. package/lib/directives/scroll-observer-ignore-target/index.d.ts +1 -0
  101. package/lib/directives/scroll-observer-ignore-target/public-api.d.ts +1 -0
  102. package/lib/directives/scroll-observer-ignore-target/scroll-observer-ignore-target.directive.d.ts +6 -0
  103. package/lib/directives/scroll-observer-last-element/index.d.ts +1 -0
  104. package/lib/directives/scroll-observer-last-element/public-api.d.ts +1 -0
  105. package/lib/directives/scroll-observer-last-element/scroll-observer-last-element.directive.d.ts +10 -0
  106. package/lib/directives/seo/public-api.d.ts +4 -0
  107. package/lib/directives/seo/seo.directive.constants.d.ts +3 -0
  108. package/lib/directives/seo/seo.directive.d.ts +21 -0
  109. package/lib/directives/seo/seo.directive.types.d.ts +51 -0
  110. package/lib/directives/seo/seo.directive.utils.d.ts +2 -0
  111. package/lib/pipes/normalize-game-result-type/normalize-game-result-type.pipe.d.ts +7 -0
  112. package/lib/pipes/normalize-game-result-type/normalize-game-result-type.types.d.ts +4 -0
  113. package/lib/pipes/normalize-game-result-type/normalize-game-result-type.util.d.ts +2 -0
  114. package/lib/pipes/normalize-game-result-type/public-api.d.ts +3 -0
  115. package/lib/pipes/normalize-match-participants/normalize-match-participants.pipe.d.ts +7 -0
  116. package/lib/pipes/normalize-match-participants/normalize-match-participants.types.d.ts +21 -0
  117. package/lib/pipes/normalize-match-participants/normalize-match-participants.util.d.ts +4 -0
  118. package/lib/pipes/normalize-match-participants/public-api.d.ts +3 -0
  119. package/lib/pipes/normalize-match-score/normalize-match-score.pipe.d.ts +7 -0
  120. package/lib/pipes/normalize-match-score/normalize-match-score.types.d.ts +12 -0
  121. package/lib/pipes/normalize-match-score/normalize-match-score.util.d.ts +27 -0
  122. package/lib/pipes/normalize-match-score/public-api.d.ts +3 -0
  123. package/lib/pipes/normalize-match-state/index.d.ts +1 -0
  124. package/lib/pipes/normalize-match-state/normalize-match-state.constants.d.ts +7 -0
  125. package/lib/pipes/normalize-match-state/normalize-match-state.pipe.d.ts +7 -0
  126. package/lib/pipes/normalize-match-state/normalize-match-state.util.d.ts +3 -0
  127. package/lib/pipes/normalize-match-state/public-api.d.ts +3 -0
  128. package/lib/pipes/normalize-match-type/normalize-match-type.pipe.d.ts +7 -0
  129. package/lib/pipes/normalize-match-type/normalize-match-type.util.d.ts +3 -0
  130. package/lib/pipes/normalize-match-type/public-api.d.ts +2 -0
  131. package/lib/pipes/public-api.d.ts +5 -0
  132. package/lib/public-api.d.ts +1 -0
  133. package/lib/services/click-observer.service.d.ts +21 -0
  134. package/lib/services/content-observer.service.d.ts +21 -0
  135. package/lib/services/destroy.service.d.ts +9 -0
  136. package/lib/services/index.d.ts +1 -0
  137. package/lib/services/public-api.d.ts +5 -1
  138. package/lib/services/resize-observer.service.d.ts +21 -0
  139. package/lib/services/viewport.service.d.ts +3 -0
  140. package/lib/services/viewport.types.d.ts +1 -1
  141. package/lib/types/angular.types.d.ts +1 -1
  142. package/lib/types/i18n.types.d.ts +4 -0
  143. package/lib/types/public-api.d.ts +2 -1
  144. package/lib/types/viewport.types.d.ts +2 -2
  145. package/lib/utils/index.d.ts +1 -0
  146. package/lib/utils/public-api.d.ts +3 -1
  147. package/lib/utils/reactive-binding.util.d.ts +14 -0
  148. package/lib/utils/scrollable.utils.d.ts +1 -0
  149. package/package.json +8 -6
@@ -1,10 +1,46 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, Directive, Input, Pipe, Injectable, Inject, Optional, inject } from '@angular/core';
3
- import { coerceNumberProperty } from '@angular/cdk/coercion';
2
+ import { inject, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding, InjectionToken, Injectable, Inject, Optional, ElementRef, EventEmitter, Directive, Output, NgZone, Pipe } from '@angular/core';
3
+ import { DomSanitizer, Meta, Title } from '@angular/platform-browser';
4
+ import { coerceElement, coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
5
+ import { fromEvent, Observable, Subject, BehaviorSubject, combineLatest, map, shareReplay, takeUntil, distinctUntilChanged, startWith, debounceTime, tap, take } from 'rxjs';
6
+ import { DOCUMENT } from '@angular/common';
4
7
  import { __decorate, __metadata } from 'tslib';
5
- import { BehaviorSubject, map, shareReplay } from 'rxjs';
6
8
  import * as i1 from '@angular/cdk/layout';
7
- import { DOCUMENT } from '@angular/common';
9
+ import { debounceTime as debounceTime$1 } from 'rxjs/operators';
10
+
11
+ class StructuredDataComponent {
12
+ constructor() {
13
+ this._sanitizer = inject(DomSanitizer);
14
+ }
15
+ set data(currentValue) {
16
+ this.jsonLD = this.getSafeHTML(currentValue);
17
+ }
18
+ getSafeHTML(value) {
19
+ const json = value ? JSON.stringify(value, null, 2).replace(/<\/script>/g, '<\\/script>') : '';
20
+ const html = `<script type="application/ld+json">${json}</script>`;
21
+ return this._sanitizer.bypassSecurityTrustHtml(html);
22
+ }
23
+ }
24
+ StructuredDataComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: StructuredDataComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
25
+ StructuredDataComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.0", type: StructuredDataComponent, isStandalone: true, selector: "et-structured-data", inputs: { data: "data" }, host: { properties: { "innerHTML": "this.jsonLD" }, styleAttribute: "display: none" }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
26
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: StructuredDataComponent, decorators: [{
27
+ type: Component,
28
+ args: [{
29
+ selector: 'et-structured-data',
30
+ standalone: true,
31
+ template: '',
32
+ changeDetection: ChangeDetectionStrategy.OnPush,
33
+ encapsulation: ViewEncapsulation.None,
34
+ host: {
35
+ style: 'display: none',
36
+ },
37
+ }]
38
+ }], propDecorators: { data: [{
39
+ type: Input
40
+ }], jsonLD: [{
41
+ type: HostBinding,
42
+ args: ['innerHTML']
43
+ }] } });
8
44
 
9
45
  const VIEWPORT_CONFIG = new InjectionToken('ViewportConfig');
10
46
  /**
@@ -37,7 +73,7 @@ function memoize(func, resolver, cache) {
37
73
  memoized.cache = cache;
38
74
  return memoized;
39
75
  }
40
- const defaultResolver = (...args) => args[0];
76
+ const defaultResolver = (...args) => args.join('-');
41
77
  const Memo = (config = {}) => (_, __, descriptor) => {
42
78
  var _a, _b;
43
79
  if (typeof descriptor.value !== 'function') {
@@ -49,115 +85,269 @@ const Memo = (config = {}) => (_, __, descriptor) => {
49
85
  return descriptor;
50
86
  };
51
87
 
52
- class LetContext {
53
- constructor() {
54
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
55
- this.$implicit = null;
56
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
57
- this.etLet = null;
88
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
89
+ class ClickObserverFactory {
90
+ create() {
91
+ return fromEvent(document, 'click');
92
+ }
93
+ }
94
+ ClickObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ClickObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
95
+ ClickObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ClickObserverFactory, providedIn: 'root' });
96
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ClickObserverFactory, decorators: [{
97
+ type: Injectable,
98
+ args: [{ providedIn: 'root' }]
99
+ }] });
100
+ class ClickObserverService {
101
+ constructor(_clickObserverFactory) {
102
+ this._clickObserverFactory = _clickObserverFactory;
103
+ this._observedElements = new Map();
104
+ }
105
+ ngOnDestroy() {
106
+ this._observedElements.forEach((_, element) => this._cleanupObserver(element));
107
+ }
108
+ observe(elementOrRef) {
109
+ const element = coerceElement(elementOrRef);
110
+ return new Observable((observer) => {
111
+ const stream = this._observeElement(element);
112
+ const subscription = stream.subscribe(observer);
113
+ return () => {
114
+ subscription.unsubscribe();
115
+ this._unobserveElement(element);
116
+ };
117
+ });
118
+ }
119
+ _observeElement(element) {
120
+ if (!this._observedElements.has(element)) {
121
+ const stream = new Subject();
122
+ const observer = this._clickObserverFactory.create();
123
+ const sub = observer.subscribe((event) => stream.next(event));
124
+ this._observedElements.set(element, { observer: sub, stream, count: 1 });
125
+ }
126
+ else {
127
+ this._observedElements.get(element).count++;
128
+ }
129
+ return this._observedElements.get(element).stream;
130
+ }
131
+ _unobserveElement(element) {
132
+ if (this._observedElements.has(element)) {
133
+ this._observedElements.get(element).count--;
134
+ if (!this._observedElements.get(element).count) {
135
+ this._cleanupObserver(element);
136
+ }
137
+ }
138
+ }
139
+ _cleanupObserver(element) {
140
+ if (this._observedElements.has(element)) {
141
+ const { observer, stream } = this._observedElements.get(element);
142
+ if (observer) {
143
+ observer.unsubscribe();
144
+ }
145
+ stream.complete();
146
+ this._observedElements.delete(element);
147
+ }
58
148
  }
59
149
  }
150
+ ClickObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ClickObserverService, deps: [{ token: ClickObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
151
+ ClickObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ClickObserverService, providedIn: 'root' });
152
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ClickObserverService, decorators: [{
153
+ type: Injectable,
154
+ args: [{ providedIn: 'root' }]
155
+ }], ctorParameters: function () { return [{ type: ClickObserverFactory }]; } });
60
156
 
61
- class LetDirective {
62
- constructor(_viewContainer, templateRef) {
63
- this._viewContainer = _viewContainer;
64
- this._context = new LetContext();
65
- this._templateRef = null;
66
- this._viewRef = null;
67
- this._templateRef = templateRef;
157
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
158
+ class MutationObserverFactory {
159
+ create(callback) {
160
+ return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);
68
161
  }
69
- set etLet(value) {
70
- this._context.$implicit = this._context.etLet = value;
71
- this._updateView();
162
+ }
163
+ MutationObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: MutationObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
164
+ MutationObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: MutationObserverFactory, providedIn: 'root' });
165
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: MutationObserverFactory, decorators: [{
166
+ type: Injectable,
167
+ args: [{ providedIn: 'root' }]
168
+ }] });
169
+ class ContentObserverService {
170
+ constructor(_mutationObserverFactory) {
171
+ this._mutationObserverFactory = _mutationObserverFactory;
172
+ this._observedElements = new Map();
72
173
  }
73
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
74
- static ngTemplateContextGuard(dir, ctx) {
75
- return true;
174
+ ngOnDestroy() {
175
+ this._observedElements.forEach((_, element) => this._cleanupObserver(element));
76
176
  }
77
- _updateView() {
78
- if (!this._viewRef) {
79
- this._viewContainer.clear();
80
- if (this._templateRef) {
81
- this._viewRef = this._viewContainer.createEmbeddedView(this._templateRef, this._context);
177
+ observe(elementOrRef) {
178
+ const element = coerceElement(elementOrRef);
179
+ return new Observable((observer) => {
180
+ const stream = this._observeElement(element);
181
+ const subscription = stream.subscribe(observer);
182
+ return () => {
183
+ subscription.unsubscribe();
184
+ this._unobserveElement(element);
185
+ };
186
+ });
187
+ }
188
+ _observeElement(element) {
189
+ if (!this._observedElements.has(element)) {
190
+ const stream = new Subject();
191
+ const observer = this._mutationObserverFactory.create((mutations) => stream.next(mutations));
192
+ if (observer) {
193
+ observer.observe(element, {
194
+ characterData: true,
195
+ childList: true,
196
+ subtree: true,
197
+ });
198
+ }
199
+ this._observedElements.set(element, { observer, stream, count: 1 });
200
+ }
201
+ else {
202
+ this._observedElements.get(element).count++;
203
+ }
204
+ return this._observedElements.get(element).stream;
205
+ }
206
+ _unobserveElement(element) {
207
+ if (this._observedElements.has(element)) {
208
+ this._observedElements.get(element).count--;
209
+ if (!this._observedElements.get(element).count) {
210
+ this._cleanupObserver(element);
211
+ }
212
+ }
213
+ }
214
+ _cleanupObserver(element) {
215
+ if (this._observedElements.has(element)) {
216
+ const { observer, stream } = this._observedElements.get(element);
217
+ if (observer) {
218
+ observer.disconnect();
82
219
  }
220
+ stream.complete();
221
+ this._observedElements.delete(element);
83
222
  }
84
223
  }
85
224
  }
86
- LetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: LetDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
87
- LetDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.6", type: LetDirective, isStandalone: true, selector: "[etLet]", inputs: { etLet: "etLet" }, ngImport: i0 });
88
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: LetDirective, decorators: [{
89
- type: Directive,
90
- args: [{
91
- selector: '[etLet]',
92
- standalone: true,
93
- }]
94
- }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }]; }, propDecorators: { etLet: [{
95
- type: Input
96
- }] } });
225
+ ContentObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ContentObserverService, deps: [{ token: MutationObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
226
+ ContentObserverServiceprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ContentObserverService, providedIn: 'root' });
227
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ContentObserverService, decorators: [{
228
+ type: Injectable,
229
+ args: [{ providedIn: 'root' }]
230
+ }], ctorParameters: function () { return [{ type: MutationObserverFactory }]; } });
97
231
 
98
- class RepeatDirective {
99
- constructor(_mainTemplateRef, _viewContainerRef) {
100
- this._mainTemplateRef = _mainTemplateRef;
101
- this._viewContainerRef = _viewContainerRef;
102
- this._repeatCount = 2;
232
+ class DestroyService {
233
+ constructor() {
234
+ this._destroy$ = new Subject();
235
+ this.destroy$ = this._destroy$.asObservable();
103
236
  }
104
- get repeatCount() {
105
- return this._repeatCount;
237
+ ngOnDestroy() {
238
+ this._destroy$.next(true);
239
+ this._destroy$.unsubscribe();
106
240
  }
107
- set repeatCount(value) {
108
- this._repeatCount = coerceNumberProperty(value);
241
+ }
242
+ DestroyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: DestroyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
243
+ DestroyService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: DestroyService });
244
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: DestroyService, decorators: [{
245
+ type: Injectable
246
+ }] });
247
+
248
+ class FocusVisibleService {
249
+ get isFocusVisible() {
250
+ return this._hadKeyboardEvent;
109
251
  }
110
- ngOnInit() {
111
- this._render();
252
+ constructor() {
253
+ this._document = inject(DOCUMENT);
254
+ this._hadKeyboardEvent = false;
255
+ this._document.addEventListener('keydown', this.onKeyDown.bind(this), true);
256
+ this._document.addEventListener('mousedown', this.onPointerDown.bind(this), true);
257
+ this._document.addEventListener('pointerdown', this.onPointerDown.bind(this), true);
258
+ this._document.addEventListener('touchstart', this.onPointerDown.bind(this), true);
112
259
  }
113
- _render() {
114
- for (let i = 0; i < this.repeatCount; i++) {
115
- this._viewContainerRef.createEmbeddedView(this._mainTemplateRef);
260
+ onKeyDown(e) {
261
+ if (e.metaKey || e.altKey || e.ctrlKey) {
262
+ return;
116
263
  }
264
+ this._hadKeyboardEvent = true;
265
+ }
266
+ onPointerDown() {
267
+ this._hadKeyboardEvent = false;
117
268
  }
118
269
  }
119
- RepeatDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: RepeatDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
120
- RepeatDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.6", type: RepeatDirective, isStandalone: true, selector: "[etRepeat]", inputs: { repeatCount: ["etRepeat", "repeatCount"] }, ngImport: i0 });
121
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: RepeatDirective, decorators: [{
122
- type: Directive,
270
+ FocusVisibleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: FocusVisibleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
271
+ FocusVisibleServiceprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: FocusVisibleService, providedIn: 'root' });
272
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: FocusVisibleService, decorators: [{
273
+ type: Injectable,
123
274
  args: [{
124
- selector: '[etRepeat]',
125
- standalone: true,
275
+ providedIn: 'root',
126
276
  }]
127
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { repeatCount: [{
128
- type: Input,
129
- args: ['etRepeat']
130
- }] } });
131
-
132
- const toArray = (value) => {
133
- return Array.from({ length: value }, (_, i) => i);
134
- };
135
- const toArrayTrackByFn = (_, item) => item;
277
+ }], ctorParameters: function () { return []; } });
136
278
 
137
- class ToArrayPipe {
138
- constructor() {
139
- this.transform = toArray;
279
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
280
+ class ResizeObserverFactory {
281
+ create(callback) {
282
+ return typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(callback);
140
283
  }
141
284
  }
142
- ToArrayPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: ToArrayPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
143
- ToArrayPipepipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.6", ngImport: i0, type: ToArrayPipe, isStandalone: true, name: "toArray" });
144
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: ToArrayPipe, decorators: [{
145
- type: Pipe,
146
- args: [{ name: 'toArray', standalone: true }]
285
+ ResizeObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ResizeObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
286
+ ResizeObserverFactoryprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ResizeObserverFactory, providedIn: 'root' });
287
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ResizeObserverFactory, decorators: [{
288
+ type: Injectable,
289
+ args: [{ providedIn: 'root' }]
147
290
  }] });
291
+ class ResizeObserverService {
292
+ constructor(_mutationObserverFactory) {
293
+ this._mutationObserverFactory = _mutationObserverFactory;
294
+ this._observedElements = new Map();
295
+ }
296
+ ngOnDestroy() {
297
+ this._observedElements.forEach((_, element) => this._cleanupObserver(element));
298
+ }
299
+ observe(elementOrRef) {
300
+ const element = coerceElement(elementOrRef);
301
+ return new Observable((observer) => {
302
+ const stream = this._observeElement(element);
303
+ const subscription = stream.subscribe(observer);
304
+ return () => {
305
+ subscription.unsubscribe();
306
+ this._unobserveElement(element);
307
+ };
308
+ });
309
+ }
310
+ _observeElement(element) {
311
+ if (!this._observedElements.has(element)) {
312
+ const stream = new Subject();
313
+ const observer = this._mutationObserverFactory.create((resizes) => stream.next(resizes));
314
+ if (observer) {
315
+ observer.observe(element);
316
+ }
317
+ this._observedElements.set(element, { observer, stream, count: 1 });
318
+ }
319
+ else {
320
+ this._observedElements.get(element).count++;
321
+ }
322
+ return this._observedElements.get(element).stream;
323
+ }
324
+ _unobserveElement(element) {
325
+ if (this._observedElements.has(element)) {
326
+ this._observedElements.get(element).count--;
327
+ if (!this._observedElements.get(element).count) {
328
+ this._cleanupObserver(element);
329
+ }
330
+ }
331
+ }
332
+ _cleanupObserver(element) {
333
+ if (this._observedElements.has(element)) {
334
+ const { observer, stream } = this._observedElements.get(element);
335
+ if (observer) {
336
+ observer.disconnect();
337
+ }
338
+ stream.complete();
339
+ this._observedElements.delete(element);
340
+ }
341
+ }
342
+ }
343
+ ResizeObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ResizeObserverService, deps: [{ token: ResizeObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
344
+ ResizeObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ResizeObserverService, providedIn: 'root' });
345
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ResizeObserverService, decorators: [{
346
+ type: Injectable,
347
+ args: [{ providedIn: 'root' }]
348
+ }], ctorParameters: function () { return [{ type: ResizeObserverFactory }]; } });
148
349
 
149
350
  class ViewportService {
150
- constructor(_viewportConfig, _breakpointObserver) {
151
- this._breakpointObserver = _breakpointObserver;
152
- this._isXs$ = new BehaviorSubject(false);
153
- this._isSm$ = new BehaviorSubject(false);
154
- this._isMd$ = new BehaviorSubject(false);
155
- this._isLg$ = new BehaviorSubject(false);
156
- this._isXl$ = new BehaviorSubject(false);
157
- this._is2Xl$ = new BehaviorSubject(false);
158
- this._viewportConfig = _viewportConfig || DEFAULT_VIEWPORT_CONFIG;
159
- this._observeDefaultBreakpoints();
160
- }
161
351
  get isXs$() {
162
352
  return this._isXs$.asObservable();
163
353
  }
@@ -194,6 +384,21 @@ class ViewportService {
194
384
  get is2Xl() {
195
385
  return this._is2Xl$.value;
196
386
  }
387
+ get currentViewport() {
388
+ return this.getCurrentViewport([this.isXs, this.isSm, this.isMd, this.isLg, this.isXl, this.is2Xl]);
389
+ }
390
+ constructor(_viewportConfig, _breakpointObserver) {
391
+ this._breakpointObserver = _breakpointObserver;
392
+ this._isXs$ = new BehaviorSubject(false);
393
+ this._isSm$ = new BehaviorSubject(false);
394
+ this._isMd$ = new BehaviorSubject(false);
395
+ this._isLg$ = new BehaviorSubject(false);
396
+ this._isXl$ = new BehaviorSubject(false);
397
+ this._is2Xl$ = new BehaviorSubject(false);
398
+ this.currentViewport$ = combineLatest([this.isXs$, this.isSm$, this.isMd$, this.isLg$, this.isXl$, this.is2Xl$]).pipe(map((val) => this.getCurrentViewport(val)), shareReplay());
399
+ this._viewportConfig = _viewportConfig || DEFAULT_VIEWPORT_CONFIG;
400
+ this._observeDefaultBreakpoints();
401
+ }
197
402
  observe(options) {
198
403
  const mediaQuery = this._buildMediaQuery(options);
199
404
  return this._breakpointObserver.observe(mediaQuery).pipe(map((x) => x.matches), shareReplay());
@@ -222,7 +427,7 @@ class ViewportService {
222
427
  // Due to scaling, the actual size of the viewport may be a decimal number.
223
428
  // Eg. on Windows 11 with 150% scaling, the viewport size may be 1535.33px
224
429
  // and thus not matching any of the default breakpoints.
225
- return size + 0.9999;
430
+ return size + 0.9;
226
431
  }
227
432
  _buildMediaQuery(options) {
228
433
  if (!options.min && !options.max) {
@@ -250,9 +455,30 @@ class ViewportService {
250
455
  }
251
456
  return mediaQueryParts.join(' ');
252
457
  }
458
+ getCurrentViewport([isXs, isSm, isMd, isLg, isXl, is2Xl]) {
459
+ if (isXs) {
460
+ return 'xs';
461
+ }
462
+ else if (isSm) {
463
+ return 'sm';
464
+ }
465
+ else if (isMd) {
466
+ return 'md';
467
+ }
468
+ else if (isLg) {
469
+ return 'lg';
470
+ }
471
+ else if (isXl) {
472
+ return 'xl';
473
+ }
474
+ else if (is2Xl) {
475
+ return '2xl';
476
+ }
477
+ return 'xs';
478
+ }
253
479
  }
254
- ViewportService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: ViewportService, deps: [{ token: VIEWPORT_CONFIG, optional: true }, { token: i1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable });
255
- ViewportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: ViewportService, providedIn: 'root' });
480
+ ViewportService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ViewportService, deps: [{ token: VIEWPORT_CONFIG, optional: true }, { token: i1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable });
481
+ ViewportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ViewportService, providedIn: 'root' });
256
482
  __decorate([
257
483
  Memo(),
258
484
  __metadata("design:type", Function),
@@ -270,7 +496,7 @@ __decorate([
270
496
  __metadata("design:paramtypes", [Object]),
271
497
  __metadata("design:returntype", void 0)
272
498
  ], ViewportService.prototype, "_buildMediaQuery", null);
273
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: ViewportService, decorators: [{
499
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ViewportService, decorators: [{
274
500
  type: Injectable,
275
501
  args: [{
276
502
  providedIn: 'root',
@@ -284,48 +510,1217 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
284
510
  }] }, { type: i1.BreakpointObserver }];
285
511
  }, propDecorators: { _getViewportSize: [], _buildMediaQuery: [] } });
286
512
 
287
- class FocusVisibleService {
513
+ class ClickOutsideDirective {
288
514
  constructor() {
289
- this._document = inject(DOCUMENT);
290
- this._hadKeyboardEvent = false;
291
- this._document.addEventListener('keydown', this.onKeyDown.bind(this), true);
292
- this._document.addEventListener('mousedown', this.onPointerDown.bind(this), true);
293
- this._document.addEventListener('pointerdown', this.onPointerDown.bind(this), true);
294
- this._document.addEventListener('touchstart', this.onPointerDown.bind(this), true);
295
- }
296
- get isFocusVisible() {
297
- return this._hadKeyboardEvent;
515
+ this._elementRef = inject(ElementRef);
516
+ this._clickObserverService = inject(ClickObserverService);
517
+ this._subscription = null;
518
+ this.etClickOutside = new EventEmitter();
298
519
  }
299
- onKeyDown(e) {
300
- if (e.metaKey || e.altKey || e.ctrlKey) {
301
- return;
302
- }
303
- this._hadKeyboardEvent = true;
520
+ ngOnInit() {
521
+ setTimeout(() => {
522
+ this._subscription = this._clickObserverService.observe(this._elementRef.nativeElement).subscribe((event) => {
523
+ const activeElement = event.target;
524
+ const isInside = this._elementRef.nativeElement.contains(activeElement);
525
+ if (!isInside) {
526
+ this.etClickOutside.emit(event);
527
+ }
528
+ });
529
+ });
304
530
  }
305
- onPointerDown() {
306
- this._hadKeyboardEvent = false;
531
+ ngOnDestroy() {
532
+ var _a;
533
+ (_a = this._subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
307
534
  }
308
535
  }
309
- FocusVisibleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: FocusVisibleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
310
- FocusVisibleServiceprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: FocusVisibleService, providedIn: 'root' });
311
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: FocusVisibleService, decorators: [{
312
- type: Injectable,
536
+ ClickOutsideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ClickOutsideDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
537
+ ClickOutsideDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", type: ClickOutsideDirective, isStandalone: true, selector: "[etClickOutside]", outputs: { etClickOutside: "etClickOutside" }, ngImport: i0 });
538
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ClickOutsideDirective, decorators: [{
539
+ type: Directive,
313
540
  args: [{
314
- providedIn: 'root',
541
+ selector: '[etClickOutside]',
542
+ standalone: true,
315
543
  }]
316
- }], ctorParameters: function () { return []; } });
544
+ }], propDecorators: { etClickOutside: [{
545
+ type: Output
546
+ }] } });
547
+
548
+ const clamp = (value, min = 0, max = 100) => {
549
+ return Math.max(min, Math.min(max, value));
550
+ };
551
+
552
+ const createReactiveBindings = (...values) => {
553
+ const elementRef = inject(ElementRef);
554
+ const destroy$ = inject(DestroyService).destroy$;
555
+ const subscriptions = [];
556
+ const pushedAttributes = [];
557
+ const defaults = {};
558
+ const push = (value) => {
559
+ const { attribute, observable } = value;
560
+ const attributes = Array.isArray(attribute) ? attribute : [attribute];
561
+ pushedAttributes.push(attributes);
562
+ for (const attribute of attributes) {
563
+ if (!defaults[attribute]) {
564
+ defaults[attribute] = elementRef.nativeElement.getAttribute(attribute) || undefined;
565
+ }
566
+ }
567
+ const subscription = observable
568
+ .pipe(takeUntil(destroy$), distinctUntilChanged((a, b) => a.render === b.render && a.value === b.value))
569
+ .subscribe((value) => {
570
+ const currentAttributes = pushedAttributes.find((s) => s.some((current) => attributes.includes(current))) || [];
571
+ for (const attribute of currentAttributes) {
572
+ if (!value.render) {
573
+ elementRef.nativeElement.removeAttribute(attribute);
574
+ }
575
+ else {
576
+ elementRef.nativeElement.setAttribute(attribute, `${value.value}`);
577
+ }
578
+ }
579
+ });
580
+ subscriptions.push({ attributes, subscription });
581
+ };
582
+ const remove = (...attributes) => {
583
+ for (const attribute of attributes) {
584
+ const sub = subscriptions.find((s) => s.attributes.includes(attribute));
585
+ const attributeStack = pushedAttributes.find((a) => a.includes(attribute));
586
+ if (sub) {
587
+ sub.attributes = sub.attributes.filter((a) => a !== attribute);
588
+ attributeStack === null || attributeStack === void 0 ? void 0 : attributeStack.splice(attributeStack.indexOf(attribute), 1);
589
+ if (sub.attributes.length === 0) {
590
+ sub.subscription.unsubscribe();
591
+ subscriptions.splice(subscriptions.indexOf(sub), 1);
592
+ }
593
+ }
594
+ }
595
+ };
596
+ const reset = () => {
597
+ for (const attribute in defaults) {
598
+ if (defaults[attribute] === undefined) {
599
+ elementRef.nativeElement.removeAttribute(attribute);
600
+ }
601
+ else {
602
+ elementRef.nativeElement.setAttribute(attribute, defaults[attribute]);
603
+ }
604
+ }
605
+ };
606
+ for (const value of values) {
607
+ push(value);
608
+ }
609
+ return {
610
+ push,
611
+ remove,
612
+ reset,
613
+ };
614
+ };
615
+
616
+ const elementCanScroll = (element) => {
617
+ const { scrollHeight, clientHeight, scrollWidth, clientWidth } = element;
618
+ return scrollHeight > clientHeight || scrollWidth > clientWidth;
619
+ };
317
620
 
318
621
  const provideViewportConfig = (viewportConfig) => {
319
622
  return { provide: VIEWPORT_CONFIG, useValue: viewportConfig };
320
623
  };
321
624
 
322
- const clamp = (value, min = 0, max = 100) => {
323
- return Math.max(min, Math.min(max, value));
324
- };
625
+ const CURSOR_DRAG_SCROLLING_CLASS = 'et-cursor-drag-scroll--scrolling';
626
+ const CURSOR_DRAG_SCROLLING_PREPARED_CLASS = 'et-cursor-drag-scroll--prepared';
627
+
628
+ class CursorDragScrollDirective {
629
+ constructor() {
630
+ this._subscriptions = [];
631
+ this._destroy$ = inject(DestroyService).destroy$;
632
+ this._elementRef = inject(ElementRef);
633
+ this._contentObserverService = inject(ContentObserverService);
634
+ this._resizeObserverService = inject(ResizeObserverService);
635
+ this._bufferUntilScroll = 5;
636
+ this._mouseUp$ = new Subject();
637
+ this._isScrolling = false;
638
+ this._canScroll = false;
639
+ this._currentScrollState = {
640
+ top: 0,
641
+ left: 0,
642
+ x: 0,
643
+ y: 0,
644
+ };
645
+ this._enabled = false;
646
+ }
647
+ get enabled() {
648
+ return this._enabled;
649
+ }
650
+ set enabled(value) {
651
+ this._enabled = coerceBooleanProperty(value);
652
+ if (this._enabled) {
653
+ this._enableCursorDragScroll();
654
+ }
655
+ else {
656
+ this._disableCursorDragScroll();
657
+ }
658
+ }
659
+ ngAfterViewInit() {
660
+ if (this.enabled) {
661
+ this._enableCursorDragScroll();
662
+ }
663
+ else {
664
+ this._disableCursorDragScroll();
665
+ }
666
+ }
667
+ _enableCursorDragScroll() {
668
+ const contentResizeSub = combineLatest([
669
+ this._contentObserverService.observe(this._elementRef.nativeElement).pipe(startWith(null)),
670
+ this._resizeObserverService.observe(this._elementRef.nativeElement).pipe(startWith(null)),
671
+ ])
672
+ .pipe(debounceTime(25), tap(() => this._updateCanScrollState()), takeUntil(this._destroy$))
673
+ .subscribe();
674
+ const mousedownSub = fromEvent(this._elementRef.nativeElement, 'mousedown')
675
+ .pipe(tap((e) => this._onMouseDown(e)), takeUntil(this._destroy$))
676
+ .subscribe();
677
+ this._subscriptions.push(contentResizeSub, mousedownSub);
678
+ this._updateCanScrollState();
679
+ }
680
+ _disableCursorDragScroll() {
681
+ this._subscriptions.forEach((sub) => sub.unsubscribe());
682
+ this._subscriptions.length = 0;
683
+ this._elementRef.nativeElement.style.cursor = 'default';
684
+ }
685
+ _onMouseDown(e) {
686
+ var _a;
687
+ if (!((_a = this._elementRef) === null || _a === void 0 ? void 0 : _a.nativeElement) || !this._canScroll) {
688
+ return;
689
+ }
690
+ const element = this._elementRef.nativeElement;
691
+ element.classList.add(CURSOR_DRAG_SCROLLING_PREPARED_CLASS);
692
+ this._elementRef.nativeElement.style.scrollSnapType = 'none';
693
+ this._elementRef.nativeElement.style.scrollBehavior = 'unset';
694
+ this._currentScrollState = {
695
+ left: this._elementRef.nativeElement.scrollLeft,
696
+ top: this._elementRef.nativeElement.scrollTop,
697
+ x: e.clientX,
698
+ y: e.clientY,
699
+ };
700
+ fromEvent(document, 'mousemove')
701
+ .pipe(tap((e) => this._mouseMoveHandler(e)), takeUntil(this._mouseUp$), takeUntil(this._destroy$))
702
+ .subscribe();
703
+ fromEvent(document, 'mouseup')
704
+ .pipe(tap(() => this._mouseUpHandler()), take(1), takeUntil(this._destroy$))
705
+ .subscribe();
706
+ }
707
+ _mouseMoveHandler(e) {
708
+ var _a;
709
+ e.preventDefault();
710
+ if (!((_a = this._elementRef) === null || _a === void 0 ? void 0 : _a.nativeElement)) {
711
+ return;
712
+ }
713
+ const dx = e.clientX - this._currentScrollState.x;
714
+ const dy = e.clientY - this._currentScrollState.y;
715
+ if (Math.abs(dx) > this._bufferUntilScroll || Math.abs(dy) > this._bufferUntilScroll) {
716
+ const element = this._elementRef.nativeElement;
717
+ if (!this._isScrolling) {
718
+ this._isScrolling = true;
719
+ element.style.cursor = 'grabbing';
720
+ element.classList.add(CURSOR_DRAG_SCROLLING_CLASS);
721
+ element.scroll({
722
+ top: this._currentScrollState.top - dy,
723
+ left: this._currentScrollState.left - dx,
724
+ behavior: 'smooth',
725
+ });
726
+ }
727
+ else {
728
+ element.scrollTop = this._currentScrollState.top - dy;
729
+ element.scrollLeft = this._currentScrollState.left - dx;
730
+ }
731
+ }
732
+ }
733
+ _mouseUpHandler() {
734
+ var _a;
735
+ this._mouseUp$.next(true);
736
+ this._isScrolling = false;
737
+ if (!((_a = this._elementRef) === null || _a === void 0 ? void 0 : _a.nativeElement)) {
738
+ return;
739
+ }
740
+ this._elementRef.nativeElement.style.scrollSnapType = '';
741
+ this._elementRef.nativeElement.style.scrollBehavior = '';
742
+ this._elementRef.nativeElement.style.cursor = 'grab';
743
+ this._elementRef.nativeElement.classList.remove(CURSOR_DRAG_SCROLLING_CLASS);
744
+ this._elementRef.nativeElement.classList.remove(CURSOR_DRAG_SCROLLING_PREPARED_CLASS);
745
+ }
746
+ _updateCanScrollState() {
747
+ this._canScroll = elementCanScroll(this._elementRef.nativeElement);
748
+ if (this._canScroll) {
749
+ this._elementRef.nativeElement.style.cursor = 'grab';
750
+ }
751
+ else {
752
+ this._elementRef.nativeElement.style.cursor = 'default';
753
+ }
754
+ }
755
+ }
756
+ CursorDragScrollDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CursorDragScrollDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
757
+ CursorDragScrollDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", type: CursorDragScrollDirective, isStandalone: true, selector: "[etCursorDragScroll]", inputs: { enabled: ["etCursorDragScroll", "enabled"] }, providers: [DestroyService], exportAs: ["etCursorDragScroll"], ngImport: i0 });
758
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CursorDragScrollDirective, decorators: [{
759
+ type: Directive,
760
+ args: [{
761
+ selector: '[etCursorDragScroll]',
762
+ exportAs: 'etCursorDragScroll',
763
+ standalone: true,
764
+ providers: [DestroyService],
765
+ }]
766
+ }], propDecorators: { enabled: [{
767
+ type: Input,
768
+ args: ['etCursorDragScroll']
769
+ }] } });
770
+
771
+ class LetContext {
772
+ constructor() {
773
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
774
+ this.$implicit = null;
775
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
776
+ this.etLet = null;
777
+ }
778
+ }
779
+
780
+ class LetDirective {
781
+ set etLet(value) {
782
+ this._context.$implicit = this._context.etLet = value;
783
+ this._updateView();
784
+ }
785
+ constructor(_viewContainer, templateRef) {
786
+ this._viewContainer = _viewContainer;
787
+ this._context = new LetContext();
788
+ this._templateRef = null;
789
+ this._viewRef = null;
790
+ this._templateRef = templateRef;
791
+ }
792
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
793
+ static ngTemplateContextGuard(dir, ctx) {
794
+ return true;
795
+ }
796
+ _updateView() {
797
+ if (!this._viewRef) {
798
+ this._viewContainer.clear();
799
+ if (this._templateRef) {
800
+ this._viewRef = this._viewContainer.createEmbeddedView(this._templateRef, this._context);
801
+ }
802
+ }
803
+ }
804
+ }
805
+ LetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: LetDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
806
+ LetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", type: LetDirective, isStandalone: true, selector: "[etLet]", inputs: { etLet: "etLet" }, ngImport: i0 });
807
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: LetDirective, decorators: [{
808
+ type: Directive,
809
+ args: [{
810
+ selector: '[etLet]',
811
+ standalone: true,
812
+ }]
813
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }]; }, propDecorators: { etLet: [{
814
+ type: Input
815
+ }] } });
816
+
817
+ class ObserveContentDirective {
818
+ constructor() {
819
+ this._contentObserver = inject(ContentObserverService);
820
+ this._elementRef = inject(ElementRef);
821
+ this._ngZone = inject(NgZone);
822
+ this.event = new EventEmitter();
823
+ this._disabled = false;
824
+ this._debounce = null;
825
+ this._currentSubscription = null;
826
+ }
827
+ get disabled() {
828
+ return this._disabled;
829
+ }
830
+ set disabled(value) {
831
+ this._disabled = coerceBooleanProperty(value);
832
+ this._disabled ? this._unsubscribe() : this._subscribe();
833
+ }
834
+ get debounce() {
835
+ return this._debounce;
836
+ }
837
+ set debounce(value) {
838
+ this._debounce = coerceNumberProperty(value);
839
+ this._subscribe();
840
+ }
841
+ ngAfterContentInit() {
842
+ if (!this._currentSubscription && !this.disabled) {
843
+ this._subscribe();
844
+ }
845
+ }
846
+ ngOnDestroy() {
847
+ this._unsubscribe();
848
+ }
849
+ _subscribe() {
850
+ this._unsubscribe();
851
+ const stream = this._contentObserver.observe(this._elementRef);
852
+ this._ngZone.runOutsideAngular(() => {
853
+ this._currentSubscription = (this.debounce ? stream.pipe(debounceTime$1(this.debounce)) : stream).subscribe(this.event);
854
+ });
855
+ }
856
+ _unsubscribe() {
857
+ var _a;
858
+ (_a = this._currentSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
859
+ }
860
+ }
861
+ ObserveContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ObserveContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
862
+ ObserveContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", type: ObserveContentDirective, isStandalone: true, selector: "[etObserveContent]", inputs: { disabled: ["etObserveContentDisabled", "disabled"], debounce: ["etObserveContentDebounce", "debounce"] }, outputs: { event: "etObserveContent" }, exportAs: ["etObserveContent"], ngImport: i0 });
863
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ObserveContentDirective, decorators: [{
864
+ type: Directive,
865
+ args: [{
866
+ selector: '[etObserveContent]',
867
+ exportAs: 'etObserveContent',
868
+ standalone: true,
869
+ }]
870
+ }], propDecorators: { event: [{
871
+ type: Output,
872
+ args: ['etObserveContent']
873
+ }], disabled: [{
874
+ type: Input,
875
+ args: ['etObserveContentDisabled']
876
+ }], debounce: [{
877
+ type: Input,
878
+ args: ['etObserveContentDebounce']
879
+ }] } });
880
+
881
+ class ObserveResizeDirective {
882
+ constructor() {
883
+ this._resizeObserver = inject(ResizeObserverService);
884
+ this._elementRef = inject(ElementRef);
885
+ this._ngZone = inject(NgZone);
886
+ this.event = new EventEmitter();
887
+ this._disabled = false;
888
+ this._debounce = null;
889
+ this._currentSubscription = null;
890
+ }
891
+ get disabled() {
892
+ return this._disabled;
893
+ }
894
+ set disabled(value) {
895
+ this._disabled = coerceBooleanProperty(value);
896
+ this._disabled ? this._unsubscribe() : this._subscribe();
897
+ }
898
+ get debounce() {
899
+ return this._debounce;
900
+ }
901
+ set debounce(value) {
902
+ this._debounce = coerceNumberProperty(value);
903
+ this._subscribe();
904
+ }
905
+ ngAfterContentInit() {
906
+ if (!this._currentSubscription && !this.disabled) {
907
+ this._subscribe();
908
+ }
909
+ }
910
+ ngOnDestroy() {
911
+ this._unsubscribe();
912
+ }
913
+ _subscribe() {
914
+ this._unsubscribe();
915
+ const stream = this._resizeObserver.observe(this._elementRef);
916
+ this._ngZone.runOutsideAngular(() => {
917
+ this._currentSubscription = (this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream).subscribe(this.event);
918
+ });
919
+ }
920
+ _unsubscribe() {
921
+ var _a;
922
+ (_a = this._currentSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
923
+ }
924
+ }
925
+ ObserveResizeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ObserveResizeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
926
+ ObserveResizeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", type: ObserveResizeDirective, isStandalone: true, selector: "[etObserveResize]", inputs: { disabled: ["etObserveResizeDisabled", "disabled"], debounce: ["etObserveResizeDebounce", "debounce"] }, outputs: { event: "etObserveResize" }, exportAs: ["etObserveResize"], ngImport: i0 });
927
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ObserveResizeDirective, decorators: [{
928
+ type: Directive,
929
+ args: [{
930
+ selector: '[etObserveResize]',
931
+ exportAs: 'etObserveResize',
932
+ standalone: true,
933
+ }]
934
+ }], propDecorators: { event: [{
935
+ type: Output,
936
+ args: ['etObserveResize']
937
+ }], disabled: [{
938
+ type: Input,
939
+ args: ['etObserveResizeDisabled']
940
+ }], debounce: [{
941
+ type: Input,
942
+ args: ['etObserveResizeDebounce']
943
+ }] } });
944
+
945
+ const SCROLL_OBSERVER_FIRST_ELEMENT_CLASS = 'et-scroll-observer-first-element';
946
+ class ScrollObserverFirstElementDirective {
947
+ constructor() {
948
+ this._isFirstElement = false;
949
+ }
950
+ get isFirstElement() {
951
+ return this._isFirstElement;
952
+ }
953
+ set isFirstElement(value) {
954
+ this._isFirstElement = coerceBooleanProperty(value);
955
+ }
956
+ }
957
+ ScrollObserverFirstElementDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ScrollObserverFirstElementDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
958
+ ScrollObserverFirstElementDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", type: ScrollObserverFirstElementDirective, isStandalone: true, selector: "[etScrollObserverFirstElement]", inputs: { isFirstElement: ["etScrollObserverFirstElement", "isFirstElement"] }, host: { properties: { "class.et-scroll-observer-first-element": "this.isFirstElement" } }, ngImport: i0 });
959
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ScrollObserverFirstElementDirective, decorators: [{
960
+ type: Directive,
961
+ args: [{
962
+ selector: '[etScrollObserverFirstElement]',
963
+ standalone: true,
964
+ }]
965
+ }], propDecorators: { isFirstElement: [{
966
+ type: Input,
967
+ args: ['etScrollObserverFirstElement']
968
+ }, {
969
+ type: HostBinding,
970
+ args: [`class.${SCROLL_OBSERVER_FIRST_ELEMENT_CLASS}`]
971
+ }] } });
972
+
973
+ const SCROLL_OBSERVER_IGNORE_TARGET_CLASS = 'et-scroll-observer-ignore-target';
974
+ class ScrollObserverIgnoreTargetDirective {
975
+ }
976
+ ScrollObserverIgnoreTargetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ScrollObserverIgnoreTargetDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
977
+ ScrollObserverIgnoreTargetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", type: ScrollObserverIgnoreTargetDirective, isStandalone: true, selector: "[etScrollObserverIgnoreTarget]", host: { classAttribute: "et-scroll-observer-ignore-target" }, ngImport: i0 });
978
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ScrollObserverIgnoreTargetDirective, decorators: [{
979
+ type: Directive,
980
+ args: [{
981
+ selector: '[etScrollObserverIgnoreTarget]',
982
+ standalone: true,
983
+ host: {
984
+ class: SCROLL_OBSERVER_IGNORE_TARGET_CLASS,
985
+ },
986
+ }]
987
+ }] });
988
+
989
+ const SCROLL_OBSERVER_LAST_ELEMENT_CLASS = 'et-scroll-observer-last-element';
990
+ class ScrollObserverLastElementDirective {
991
+ constructor() {
992
+ this._isLastElement = false;
993
+ }
994
+ get isLastElement() {
995
+ return this._isLastElement;
996
+ }
997
+ set isLastElement(value) {
998
+ this._isLastElement = coerceBooleanProperty(value);
999
+ }
1000
+ }
1001
+ ScrollObserverLastElementDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ScrollObserverLastElementDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1002
+ ScrollObserverLastElementDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", type: ScrollObserverLastElementDirective, isStandalone: true, selector: "[etScrollObserverLastElement]", inputs: { isLastElement: ["etScrollObserverLastElement", "isLastElement"] }, host: { properties: { "class.et-scroll-observer-last-element": "this.isLastElement" }, classAttribute: "et-scroll-observer-last-element" }, ngImport: i0 });
1003
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ScrollObserverLastElementDirective, decorators: [{
1004
+ type: Directive,
1005
+ args: [{
1006
+ selector: '[etScrollObserverLastElement]',
1007
+ standalone: true,
1008
+ host: {
1009
+ class: SCROLL_OBSERVER_LAST_ELEMENT_CLASS,
1010
+ },
1011
+ }]
1012
+ }], propDecorators: { isLastElement: [{
1013
+ type: Input,
1014
+ args: ['etScrollObserverLastElement']
1015
+ }, {
1016
+ type: HostBinding,
1017
+ args: [`class.${SCROLL_OBSERVER_LAST_ELEMENT_CLASS}`]
1018
+ }] } });
1019
+
1020
+ const OBSERVE_SCROLL_STATE = new InjectionToken('OBSERVE_SCROLL_STATE');
1021
+
1022
+ class ObserveScrollStateDirective {
1023
+ constructor() {
1024
+ this._destroy$ = inject(DestroyService).destroy$;
1025
+ this._elementRef = inject(ElementRef);
1026
+ this._contentObserverService = inject(ContentObserverService);
1027
+ this._resizeObserverService = inject(ResizeObserverService);
1028
+ this._observedChildren = {
1029
+ first: this._firstCurrentChild,
1030
+ last: this._lastCurrentChild,
1031
+ };
1032
+ this._rootMargin = 0;
1033
+ this._threshold = 1;
1034
+ this._intersectionObserver = null;
1035
+ this.etObserveScrollState = new EventEmitter();
1036
+ }
1037
+ get _firstCurrentChild() {
1038
+ const explicitFirstElement = this._elementRef.nativeElement.querySelector(`.${SCROLL_OBSERVER_FIRST_ELEMENT_CLASS}`);
1039
+ if (explicitFirstElement) {
1040
+ return explicitFirstElement;
1041
+ }
1042
+ const element = this._elementRef.nativeElement.children[0];
1043
+ return this._getNonIgnoredChild(element, 'next');
1044
+ }
1045
+ get _lastCurrentChild() {
1046
+ const explicitLastElement = this._elementRef.nativeElement.querySelector(`.${SCROLL_OBSERVER_LAST_ELEMENT_CLASS}`);
1047
+ if (explicitLastElement) {
1048
+ return explicitLastElement;
1049
+ }
1050
+ const element = this._elementRef.nativeElement.children[this._elementRef.nativeElement.children.length - 1];
1051
+ return this._getNonIgnoredChild(element, 'previous');
1052
+ }
1053
+ get observerRootMargin() {
1054
+ return this._rootMargin;
1055
+ }
1056
+ set observerRootMargin(value) {
1057
+ this._rootMargin = coerceNumberProperty(value);
1058
+ }
1059
+ get observerThreshold() {
1060
+ return this._threshold;
1061
+ }
1062
+ set observerThreshold(value) {
1063
+ this._threshold = coerceNumberProperty(value);
1064
+ }
1065
+ ngOnInit() {
1066
+ this._contentObserverService
1067
+ .observe(this._elementRef.nativeElement)
1068
+ .pipe(tap(() => this._checkChildren()), takeUntil(this._destroy$))
1069
+ .subscribe();
1070
+ this._resizeObserverService
1071
+ .observe(this._elementRef.nativeElement)
1072
+ .pipe(debounceTime(25), tap(() => {
1073
+ const canScroll = elementCanScroll(this._elementRef.nativeElement);
1074
+ if ((!this._intersectionObserver && canScroll) || (this._intersectionObserver && !canScroll)) {
1075
+ this._checkChildren();
1076
+ }
1077
+ }), takeUntil(this._destroy$))
1078
+ .subscribe();
1079
+ this._checkChildren();
1080
+ }
1081
+ ngOnDestroy() {
1082
+ this._clearIntersectionObserver();
1083
+ }
1084
+ _checkChildren() {
1085
+ this._clearIntersectionObserver();
1086
+ if (this._firstCurrentChild === this._lastCurrentChild ||
1087
+ !this._firstCurrentChild ||
1088
+ !this._lastCurrentChild ||
1089
+ !elementCanScroll(this._elementRef.nativeElement)) {
1090
+ this._unobserveChild('first');
1091
+ this._unobserveChild('last');
1092
+ this.etObserveScrollState.emit({
1093
+ isAtStart: true,
1094
+ isAtEnd: true,
1095
+ canScroll: false,
1096
+ });
1097
+ }
1098
+ else {
1099
+ this._intersectionObserver = this._initiateIntersectionObserver();
1100
+ this._observeChild('first', this._firstCurrentChild);
1101
+ this._observeChild('last', this._lastCurrentChild);
1102
+ }
1103
+ }
1104
+ _initiateIntersectionObserver() {
1105
+ const observer = new IntersectionObserver((entries) => {
1106
+ var _a, _b, _c, _d;
1107
+ const { first, last } = this._observedChildren;
1108
+ const isAtStart = (_b = (_a = entries.find((entry) => entry.target === first)) === null || _a === void 0 ? void 0 : _a.isIntersecting) !== null && _b !== void 0 ? _b : false;
1109
+ const isAtEnd = (_d = (_c = entries.find((entry) => entry.target === last)) === null || _c === void 0 ? void 0 : _c.isIntersecting) !== null && _d !== void 0 ? _d : false;
1110
+ this.etObserveScrollState.emit({
1111
+ isAtStart,
1112
+ isAtEnd,
1113
+ canScroll: !isAtStart || !isAtEnd,
1114
+ });
1115
+ }, {
1116
+ root: this._elementRef.nativeElement,
1117
+ rootMargin: `${this._rootMargin}px`,
1118
+ threshold: this._threshold,
1119
+ });
1120
+ return observer;
1121
+ }
1122
+ _observeChild(child, element) {
1123
+ var _a;
1124
+ (_a = this._intersectionObserver) === null || _a === void 0 ? void 0 : _a.observe(element);
1125
+ this._observedChildren[child] = element;
1126
+ element.classList.add(`et-scroll-observer-observing-${child}-element`);
1127
+ }
1128
+ _unobserveChild(child) {
1129
+ var _a;
1130
+ const observedChild = this._observedChildren[child];
1131
+ if (!observedChild) {
1132
+ return;
1133
+ }
1134
+ observedChild.classList.remove('et-scroll-observer-observing-first-element', 'et-scroll-observer-observing-last-element');
1135
+ (_a = this._intersectionObserver) === null || _a === void 0 ? void 0 : _a.unobserve(observedChild);
1136
+ this._observedChildren[child] = null;
1137
+ }
1138
+ _clearIntersectionObserver() {
1139
+ var _a;
1140
+ (_a = this._intersectionObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
1141
+ this._intersectionObserver = null;
1142
+ }
1143
+ _getNonIgnoredChild(element, direction) {
1144
+ if (!element) {
1145
+ return null;
1146
+ }
1147
+ if (element === null || element === void 0 ? void 0 : element.classList.contains(SCROLL_OBSERVER_IGNORE_TARGET_CLASS)) {
1148
+ const nextElement = element[`${direction}ElementSibling`];
1149
+ if (!nextElement) {
1150
+ return null;
1151
+ }
1152
+ return this._getNonIgnoredChild(nextElement, direction);
1153
+ }
1154
+ return element;
1155
+ }
1156
+ }
1157
+ ObserveScrollStateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ObserveScrollStateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1158
+ ObserveScrollStateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", type: ObserveScrollStateDirective, isStandalone: true, selector: "[etObserveScrollState]", inputs: { observerRootMargin: "observerRootMargin", observerThreshold: "observerThreshold" }, outputs: { etObserveScrollState: "etObserveScrollState" }, providers: [
1159
+ {
1160
+ provide: OBSERVE_SCROLL_STATE,
1161
+ useExisting: ObserveScrollStateDirective,
1162
+ },
1163
+ DestroyService,
1164
+ ], exportAs: ["etObserveScrollState"], ngImport: i0 });
1165
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ObserveScrollStateDirective, decorators: [{
1166
+ type: Directive,
1167
+ args: [{
1168
+ selector: '[etObserveScrollState]',
1169
+ exportAs: 'etObserveScrollState',
1170
+ standalone: true,
1171
+ providers: [
1172
+ {
1173
+ provide: OBSERVE_SCROLL_STATE,
1174
+ useExisting: ObserveScrollStateDirective,
1175
+ },
1176
+ DestroyService,
1177
+ ],
1178
+ }]
1179
+ }], propDecorators: { observerRootMargin: [{
1180
+ type: Input
1181
+ }], observerThreshold: [{
1182
+ type: Input
1183
+ }], etObserveScrollState: [{
1184
+ type: Output
1185
+ }] } });
1186
+
1187
+ class RepeatDirective {
1188
+ get repeatCount() {
1189
+ return this._repeatCount;
1190
+ }
1191
+ set repeatCount(value) {
1192
+ this._repeatCount = coerceNumberProperty(value);
1193
+ this._render();
1194
+ }
1195
+ constructor(_mainTemplateRef, _viewContainerRef) {
1196
+ this._mainTemplateRef = _mainTemplateRef;
1197
+ this._viewContainerRef = _viewContainerRef;
1198
+ this._repeatCount = 2;
1199
+ }
1200
+ _render() {
1201
+ this._viewContainerRef.clear();
1202
+ for (let i = 0; i < this.repeatCount; i++) {
1203
+ this._viewContainerRef.createEmbeddedView(this._mainTemplateRef);
1204
+ }
1205
+ }
1206
+ }
1207
+ RepeatDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: RepeatDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
1208
+ RepeatDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", type: RepeatDirective, isStandalone: true, selector: "[etRepeat]", inputs: { repeatCount: ["etRepeat", "repeatCount"] }, ngImport: i0 });
1209
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: RepeatDirective, decorators: [{
1210
+ type: Directive,
1211
+ args: [{
1212
+ selector: '[etRepeat]',
1213
+ standalone: true,
1214
+ }]
1215
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { repeatCount: [{
1216
+ type: Input,
1217
+ args: ['etRepeat']
1218
+ }] } });
1219
+
1220
+ const SEO_DIRECTIVE_TOKEN = new InjectionToken('SEO_DIRECTIVE_TOKEN');
1221
+
1222
+ const mergeSeoConfig = (config, parentConfig) => {
1223
+ return Object.assign(Object.assign({}, parentConfig), config);
1224
+ };
1225
+
1226
+ class SeoDirective {
1227
+ constructor() {
1228
+ this._metaService = inject(Meta);
1229
+ this._titleService = inject(Title);
1230
+ this._onDeactivate$ = new Subject();
1231
+ this._isDeactivated = false;
1232
+ this.parent = inject(SEO_DIRECTIVE_TOKEN, { optional: true, skipSelf: true });
1233
+ this._config = {};
1234
+ }
1235
+ get config() {
1236
+ return this._config;
1237
+ }
1238
+ ngOnInit() {
1239
+ var _a;
1240
+ (_a = this.parent) === null || _a === void 0 ? void 0 : _a._deactivate();
1241
+ }
1242
+ ngOnDestroy() {
1243
+ var _a;
1244
+ this._deactivate();
1245
+ this._cleanUp();
1246
+ (_a = this.parent) === null || _a === void 0 ? void 0 : _a._activate();
1247
+ }
1248
+ // TODO(TRB): This should get split up into multiple methods to make it more readable
1249
+ // - updateTitle
1250
+ // - updateMeta
1251
+ // - updateLink
1252
+ updateConfig(config) {
1253
+ var _a;
1254
+ this._config = mergeSeoConfig(config, ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.config) || {});
1255
+ if (this._isDeactivated) {
1256
+ return;
1257
+ }
1258
+ this._deactivate();
1259
+ this._activate();
1260
+ }
1261
+ _activate() {
1262
+ this._onDeactivate$.next(false);
1263
+ this._isDeactivated = false;
1264
+ for (const [key, value] of Object.entries(this._config)) {
1265
+ if (value instanceof Observable) {
1266
+ value.pipe(takeUntil(this._onDeactivate$)).subscribe((value) => this._update(key, value));
1267
+ }
1268
+ else if (Array.isArray(value)) {
1269
+ value.forEach((value) => {
1270
+ if (value instanceof Observable) {
1271
+ value.pipe(takeUntil(this._onDeactivate$)).subscribe((value) => this._update(key, value));
1272
+ }
1273
+ else {
1274
+ this._update(key, value);
1275
+ }
1276
+ });
1277
+ }
1278
+ else if (typeof value === 'object' && value !== null) {
1279
+ for (const [subKey, subValue] of Object.entries(value)) {
1280
+ if (subValue instanceof Observable) {
1281
+ subValue.pipe(takeUntil(this._onDeactivate$)).subscribe((value) => this._update(`${key}:${subKey}`, value));
1282
+ }
1283
+ else {
1284
+ this._update(`${key}:${subKey}`, subValue);
1285
+ }
1286
+ }
1287
+ }
1288
+ else {
1289
+ this._update(key, value);
1290
+ }
1291
+ }
1292
+ }
1293
+ _deactivate() {
1294
+ this._onDeactivate$.next(true);
1295
+ this._isDeactivated = true;
1296
+ }
1297
+ _update(key, value) {
1298
+ switch (key) {
1299
+ case 'title':
1300
+ if (value && typeof value === 'string') {
1301
+ this._titleService.setTitle(value);
1302
+ }
1303
+ break;
1304
+ case 'canonical':
1305
+ {
1306
+ const link = document.querySelector(`link[rel="${key}"]`);
1307
+ if (link) {
1308
+ link.setAttribute('href', value);
1309
+ }
1310
+ else {
1311
+ const newLink = document.createElement('link');
1312
+ newLink.setAttribute('rel', key);
1313
+ newLink.setAttribute('href', value);
1314
+ document.head.appendChild(newLink);
1315
+ }
1316
+ }
1317
+ break;
1318
+ case 'alternate':
1319
+ {
1320
+ const link = document.querySelector(`link[rel="${key}"][hreflang="${value.hreflang}"]`);
1321
+ if (link) {
1322
+ link.setAttribute('href', value.href);
1323
+ }
1324
+ else {
1325
+ const newLink = document.createElement('link');
1326
+ newLink.setAttribute('rel', key);
1327
+ newLink.setAttribute('hreflang', value.hreflang);
1328
+ newLink.setAttribute('href', value.href);
1329
+ document.head.appendChild(newLink);
1330
+ }
1331
+ }
1332
+ break;
1333
+ default:
1334
+ if (value !== undefined && value !== null) {
1335
+ const val = Array.isArray(value) ? value.join(', ') : value;
1336
+ this._metaService.updateTag({ name: key, content: val });
1337
+ }
1338
+ else {
1339
+ this._metaService.removeTag(`name="${key}"`);
1340
+ }
1341
+ break;
1342
+ }
1343
+ }
1344
+ _cleanUp() {
1345
+ var _a, _b, _c, _d, _e;
1346
+ for (const key in this._config) {
1347
+ if (key === 'alternate') {
1348
+ const links = document.querySelectorAll(`link[rel="${key}"]`);
1349
+ links.forEach((link) => {
1350
+ link.remove();
1351
+ });
1352
+ continue;
1353
+ }
1354
+ if (key === 'canonical') {
1355
+ const link = document.querySelector(`link[rel="${key}"]`);
1356
+ if (link) {
1357
+ link.remove();
1358
+ }
1359
+ continue;
1360
+ }
1361
+ if (typeof this._config[key] === 'object' &&
1362
+ this._config[key] !== null &&
1363
+ !(this._config[key] instanceof Observable)) {
1364
+ for (const subKey in this._config[key]) {
1365
+ const parentValue = (_c = (_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b[key]) === null || _c === void 0 ? void 0 : _c[subKey];
1366
+ if (parentValue === undefined) {
1367
+ this._update(`${key}:${subKey}`, undefined);
1368
+ }
1369
+ }
1370
+ }
1371
+ else {
1372
+ const parentValue = (_e = (_d = this.parent) === null || _d === void 0 ? void 0 : _d.config) === null || _e === void 0 ? void 0 : _e[key];
1373
+ if (parentValue === undefined) {
1374
+ this._update(key, null);
1375
+ }
1376
+ }
1377
+ }
1378
+ }
1379
+ }
1380
+ SeoDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: SeoDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1381
+ SeoDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0", type: SeoDirective, isStandalone: true, providers: [{ provide: SEO_DIRECTIVE_TOKEN, useExisting: SeoDirective }], ngImport: i0 });
1382
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: SeoDirective, decorators: [{
1383
+ type: Directive,
1384
+ args: [{
1385
+ standalone: true,
1386
+ providers: [{ provide: SEO_DIRECTIVE_TOKEN, useExisting: SeoDirective }],
1387
+ }]
1388
+ }] });
1389
+
1390
+ // TODO(TRB): Add correct type once provided by API
1391
+ const normalizeGameResultType = (type) => {
1392
+ if (!type) {
1393
+ return null;
1394
+ }
1395
+ switch (type) {
1396
+ case 'extra_time':
1397
+ return {
1398
+ i18n: 'game-result-type.extra-time',
1399
+ shortCode: 'AET',
1400
+ text: 'After Extra Time',
1401
+ };
1402
+ case 'penalty':
1403
+ return {
1404
+ i18n: 'game-result-type.penalty',
1405
+ shortCode: 'PSO',
1406
+ text: 'Penalty shootout',
1407
+ };
1408
+ case 'golden_goal':
1409
+ return {
1410
+ i18n: 'game-result-type.golden-goal',
1411
+ shortCode: 'GG',
1412
+ text: 'Golden Goal',
1413
+ };
1414
+ case 'default':
1415
+ default:
1416
+ return {
1417
+ i18n: 'game-result-type.full-time',
1418
+ shortCode: 'FT',
1419
+ text: 'Full Time',
1420
+ };
1421
+ }
1422
+ };
1423
+
1424
+ class NormalizeGameResultTypePipe {
1425
+ constructor() {
1426
+ this.transform = normalizeGameResultType;
1427
+ }
1428
+ }
1429
+ NormalizeGameResultTypePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NormalizeGameResultTypePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1430
+ NormalizeGameResultTypePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: NormalizeGameResultTypePipe, isStandalone: true, name: "etNormalizeGameResultType" });
1431
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NormalizeGameResultTypePipe, decorators: [{
1432
+ type: Pipe,
1433
+ args: [{ name: 'etNormalizeGameResultType', standalone: true }]
1434
+ }] });
1435
+
1436
+ const normalizeMatchState = (match) => {
1437
+ if (match === null || match === void 0 ? void 0 : match.isCompletedByReferee) {
1438
+ return "autoWin" /* MatchStateType.AUTO_WIN */;
1439
+ }
1440
+ else if ((match === null || match === void 0 ? void 0 : match.status) === 'preparing') {
1441
+ return "preMatch" /* MatchStateType.PRE_MATCH */;
1442
+ }
1443
+ else if ((match === null || match === void 0 ? void 0 : match.status) === 'started') {
1444
+ return "live" /* MatchStateType.LIVE */;
1445
+ }
1446
+ else if ((match === null || match === void 0 ? void 0 : match.status) === 'published' || (match === null || match === void 0 ? void 0 : match.status) === 'finished') {
1447
+ return "postMatch" /* MatchStateType.POST_MATCH */;
1448
+ }
1449
+ else if ((match === null || match === void 0 ? void 0 : match.round.state) !== 'preparing') {
1450
+ return "preparingRound" /* MatchStateType.PREPARING_ROUND */;
1451
+ }
1452
+ return null;
1453
+ };
1454
+
1455
+ class NormalizeMatchStatePipe {
1456
+ constructor() {
1457
+ this.transform = normalizeMatchState;
1458
+ }
1459
+ }
1460
+ NormalizeMatchStatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NormalizeMatchStatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1461
+ NormalizeMatchStatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: NormalizeMatchStatePipe, isStandalone: true, name: "etNormalizeMatchState" });
1462
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NormalizeMatchStatePipe, decorators: [{
1463
+ type: Pipe,
1464
+ args: [{ name: 'etNormalizeMatchState', standalone: true }]
1465
+ }] });
1466
+
1467
+ const normalizeMatchParticipants = (match) => {
1468
+ const matchState = normalizeMatchState(match);
1469
+ if (!match || !matchState) {
1470
+ return null;
1471
+ }
1472
+ return {
1473
+ home: normalizeMatchParticipant(match, 'home'),
1474
+ away: normalizeMatchParticipant(match, 'away'),
1475
+ };
1476
+ };
1477
+ const normalizeMatchParticipant = (match, side) => {
1478
+ var _a, _b, _c, _d;
1479
+ const matchState = normalizeMatchState(match);
1480
+ if (!match || !matchState) {
1481
+ return null;
1482
+ }
1483
+ const participant = match[side];
1484
+ const participantType = (_d = (_b = (_a = match.home) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : (_c = match.away) === null || _c === void 0 ? void 0 : _c.type) !== null && _d !== void 0 ? _d : 'unknown';
1485
+ if (!participant) {
1486
+ if (matchState === "postMatch" /* MatchStateType.POST_MATCH */ || matchState === "autoWin" /* MatchStateType.AUTO_WIN */) {
1487
+ return {
1488
+ participantType,
1489
+ type: 'none',
1490
+ i18n: 'match-participant.none',
1491
+ text: 'No opponent',
1492
+ data: participant,
1493
+ };
1494
+ }
1495
+ else {
1496
+ return {
1497
+ participantType,
1498
+ type: 'tbd',
1499
+ i18n: 'match-participant.tbd',
1500
+ text: 'TBD',
1501
+ data: participant,
1502
+ };
1503
+ }
1504
+ }
1505
+ else {
1506
+ return {
1507
+ participantType,
1508
+ type: 'participant',
1509
+ data: participant,
1510
+ };
1511
+ }
1512
+ };
1513
+
1514
+ class NormalizeMatchParticipantsPipe {
1515
+ constructor() {
1516
+ this.transform = normalizeMatchParticipants;
1517
+ }
1518
+ }
1519
+ NormalizeMatchParticipantsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NormalizeMatchParticipantsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1520
+ NormalizeMatchParticipantsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: NormalizeMatchParticipantsPipe, isStandalone: true, name: "etNormalizeMatchParticipants" });
1521
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NormalizeMatchParticipantsPipe, decorators: [{
1522
+ type: Pipe,
1523
+ args: [{ name: 'etNormalizeMatchParticipants', standalone: true }]
1524
+ }] });
1525
+
1526
+ const EMPTY_SCORE = {
1527
+ home: { score: 'match-score.placeholder', isWinner: false },
1528
+ away: { score: 'match-score.placeholder', isWinner: false },
1529
+ isNumeric: false,
1530
+ subLine: null,
1531
+ };
1532
+ const normalizeMatchScore = (match) => {
1533
+ var _a, _b;
1534
+ if (!match) {
1535
+ return null;
1536
+ }
1537
+ const matchState = normalizeMatchState(match);
1538
+ const subLine = getMatchScoreSubLine(match);
1539
+ if (!match.homeScore && !match.awayScore) {
1540
+ return Object.assign(Object.assign({}, EMPTY_SCORE), { subLine, isNumeric: false });
1541
+ }
1542
+ if (isKnockoutMatch(match)) {
1543
+ if (matchState === "preMatch" /* MatchStateType.PRE_MATCH */ || matchState === "live" /* MatchStateType.LIVE */) {
1544
+ return Object.assign(Object.assign({}, EMPTY_SCORE), { subLine, isNumeric: false });
1545
+ }
1546
+ return {
1547
+ home: {
1548
+ score: getKnockoutMatchScore(match.homeScore),
1549
+ isWinner: ((_a = match.homeScore) === null || _a === void 0 ? void 0 : _a.status) === 'won',
1550
+ },
1551
+ away: {
1552
+ score: getKnockoutMatchScore(match.awayScore),
1553
+ isWinner: ((_b = match.awayScore) === null || _b === void 0 ? void 0 : _b.status) === 'won',
1554
+ },
1555
+ subLine,
1556
+ isNumeric: false,
1557
+ };
1558
+ }
1559
+ else if (isGroupMatch(match)) {
1560
+ if (match.games.length === 1) {
1561
+ // Return the score if only one game has been played
1562
+ return Object.assign(Object.assign({}, getGroupMatchScore(match)), { subLine, isNumeric: true });
1563
+ }
1564
+ else {
1565
+ return Object.assign(Object.assign({}, getGroupMatchPoints(match)), { subLine, isNumeric: true });
1566
+ }
1567
+ }
1568
+ else {
1569
+ return Object.assign(Object.assign({}, getGroupMatchScore(match)), { subLine, isNumeric: true });
1570
+ }
1571
+ };
1572
+ const isKnockoutMatch = (match) => {
1573
+ if (!match) {
1574
+ return false;
1575
+ }
1576
+ return (match.matchType === 'single_elimination' ||
1577
+ match.matchType === 'double_elimination' ||
1578
+ match.matchType === 'fifa_swiss');
1579
+ };
1580
+ const isGroupMatch = (match) => {
1581
+ if (!match) {
1582
+ return false;
1583
+ }
1584
+ return match.matchType === 'groups' || match.matchType === 'league';
1585
+ };
1586
+ const getKnockoutMatchScore = (score) => {
1587
+ if ((score === null || score === void 0 ? void 0 : score.status) === 'won') {
1588
+ return 'match-score.knockout.won';
1589
+ }
1590
+ else if ((score === null || score === void 0 ? void 0 : score.status) === 'lost') {
1591
+ return 'match-score.knockout.lost';
1592
+ }
1593
+ else if ((score === null || score === void 0 ? void 0 : score.status) === 'tie') {
1594
+ return 'match-score.knockout.tie';
1595
+ }
1596
+ return null;
1597
+ };
1598
+ const getMatchScoreSubLine = (match) => {
1599
+ if (isKnockoutMatch(match)) {
1600
+ return null;
1601
+ }
1602
+ else if (isGroupMatch(match)) {
1603
+ return 'match-score.groups.sub-line';
1604
+ }
1605
+ else {
1606
+ return null;
1607
+ }
1608
+ };
1609
+ const getGroupMatchScore = (match) => {
1610
+ var _a, _b, _c, _d;
1611
+ if (!match) {
1612
+ return null;
1613
+ }
1614
+ return {
1615
+ home: {
1616
+ score: ((_a = match.homeScore) === null || _a === void 0 ? void 0 : _a.ownPoints) || 0,
1617
+ isWinner: ((_b = match.homeScore) === null || _b === void 0 ? void 0 : _b.status) === 'won',
1618
+ },
1619
+ away: {
1620
+ score: ((_c = match.awayScore) === null || _c === void 0 ? void 0 : _c.ownPoints) || 0,
1621
+ isWinner: ((_d = match.awayScore) === null || _d === void 0 ? void 0 : _d.status) === 'won',
1622
+ },
1623
+ };
1624
+ };
1625
+ const getGroupMatchPoints = (match) => {
1626
+ var _a, _b, _c, _d;
1627
+ if (!match) {
1628
+ return null;
1629
+ }
1630
+ return {
1631
+ home: {
1632
+ score: ((_a = match.homeScore) === null || _a === void 0 ? void 0 : _a.score) || 0,
1633
+ isWinner: ((_b = match.homeScore) === null || _b === void 0 ? void 0 : _b.status) === 'won',
1634
+ },
1635
+ away: {
1636
+ score: ((_c = match.awayScore) === null || _c === void 0 ? void 0 : _c.score) || 0,
1637
+ isWinner: ((_d = match.awayScore) === null || _d === void 0 ? void 0 : _d.status) === 'won',
1638
+ },
1639
+ };
1640
+ };
1641
+
1642
+ class NormalizeMatchScorePipe {
1643
+ constructor() {
1644
+ this.transform = normalizeMatchScore;
1645
+ }
1646
+ }
1647
+ NormalizeMatchScorePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NormalizeMatchScorePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1648
+ NormalizeMatchScorePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: NormalizeMatchScorePipe, isStandalone: true, name: "etNormalizeMatchScore" });
1649
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NormalizeMatchScorePipe, decorators: [{
1650
+ type: Pipe,
1651
+ args: [{ name: 'etNormalizeMatchScore', standalone: true }]
1652
+ }] });
1653
+
1654
+ const normalizeMatchType = (matchType) => {
1655
+ if (!matchType) {
1656
+ return null;
1657
+ }
1658
+ switch (matchType) {
1659
+ case 'double_elimination':
1660
+ return {
1661
+ i18n: 'match-type.double-elimination',
1662
+ text: 'Double Elimination',
1663
+ };
1664
+ case 'single_elimination':
1665
+ return {
1666
+ i18n: 'match-type.single-elimination',
1667
+ text: 'Single Elimination',
1668
+ };
1669
+ case 'fifa_swiss':
1670
+ return {
1671
+ i18n: 'match-type.fifa-swiss',
1672
+ text: 'FIFA Swiss',
1673
+ };
1674
+ case 'groups':
1675
+ return {
1676
+ i18n: 'match-type.groups',
1677
+ text: 'Groups',
1678
+ };
1679
+ case 'league':
1680
+ return {
1681
+ i18n: 'match-type.league',
1682
+ text: 'League',
1683
+ };
1684
+ case 'pools':
1685
+ return {
1686
+ i18n: 'match-type.pools',
1687
+ text: 'Pools',
1688
+ };
1689
+ }
1690
+ };
1691
+
1692
+ class NormalizeMatchTypePipe {
1693
+ constructor() {
1694
+ this.transform = normalizeMatchType;
1695
+ }
1696
+ }
1697
+ NormalizeMatchTypePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NormalizeMatchTypePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1698
+ NormalizeMatchTypePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: NormalizeMatchTypePipe, isStandalone: true, name: "etNormalizeMatchType" });
1699
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NormalizeMatchTypePipe, decorators: [{
1700
+ type: Pipe,
1701
+ args: [{ name: 'etNormalizeMatchType', standalone: true }]
1702
+ }] });
1703
+
1704
+ const toArray = (value) => {
1705
+ return Array.from({ length: value }, (_, i) => i);
1706
+ };
1707
+ const toArrayTrackByFn = (_, item) => item;
1708
+
1709
+ class ToArrayPipe {
1710
+ constructor() {
1711
+ this.transform = toArray;
1712
+ }
1713
+ }
1714
+ ToArrayPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ToArrayPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1715
+ ToArrayPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: ToArrayPipe, isStandalone: true, name: "toArray" });
1716
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: ToArrayPipe, decorators: [{
1717
+ type: Pipe,
1718
+ args: [{ name: 'toArray', standalone: true }]
1719
+ }] });
325
1720
 
326
1721
  /**
327
1722
  * Generated bundle index. Do not edit.
328
1723
  */
329
1724
 
330
- export { DEFAULT_VIEWPORT_CONFIG, FocusVisibleService, LetContext, LetDirective, Memo, RepeatDirective, ToArrayPipe, VIEWPORT_CONFIG, ViewportService, clamp, provideViewportConfig, toArray, toArrayTrackByFn };
1725
+ export { ClickObserverFactory, ClickObserverService, ClickOutsideDirective, ContentObserverService, CursorDragScrollDirective, DEFAULT_VIEWPORT_CONFIG, DestroyService, FocusVisibleService, LetContext, LetDirective, Memo, MutationObserverFactory, NormalizeGameResultTypePipe, NormalizeMatchParticipantsPipe, NormalizeMatchScorePipe, NormalizeMatchStatePipe, NormalizeMatchTypePipe, OBSERVE_SCROLL_STATE, ObserveContentDirective, ObserveResizeDirective, ObserveScrollStateDirective, RepeatDirective, ResizeObserverFactory, ResizeObserverService, SCROLL_OBSERVER_FIRST_ELEMENT_CLASS, SCROLL_OBSERVER_IGNORE_TARGET_CLASS, SCROLL_OBSERVER_LAST_ELEMENT_CLASS, SEO_DIRECTIVE_TOKEN, ScrollObserverFirstElementDirective, ScrollObserverIgnoreTargetDirective, ScrollObserverLastElementDirective, SeoDirective, StructuredDataComponent, ToArrayPipe, VIEWPORT_CONFIG, ViewportService, clamp, createReactiveBindings, elementCanScroll, getGroupMatchPoints, getGroupMatchScore, getKnockoutMatchScore, getMatchScoreSubLine, isGroupMatch, isKnockoutMatch, mergeSeoConfig, normalizeGameResultType, normalizeMatchParticipant, normalizeMatchParticipants, normalizeMatchScore, normalizeMatchState, normalizeMatchType, provideViewportConfig, toArray, toArrayTrackByFn };
331
1726
  //# sourceMappingURL=ethlete-core.mjs.map