@seekora-ai/ui-sdk-angular 1.0.0

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.
package/dist/index.js ADDED
@@ -0,0 +1,2550 @@
1
+ 'use strict';
2
+
3
+ var core = require('@angular/core');
4
+ var uiSdkCore = require('@seekora-ai/ui-sdk-core');
5
+ var rxjs = require('rxjs');
6
+ var operators = require('rxjs/operators');
7
+
8
+ /******************************************************************************
9
+ Copyright (c) Microsoft Corporation.
10
+
11
+ Permission to use, copy, modify, and/or distribute this software for any
12
+ purpose with or without fee is hereby granted.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
15
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
16
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
17
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
18
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
19
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20
+ PERFORMANCE OF THIS SOFTWARE.
21
+ ***************************************************************************** */
22
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
23
+
24
+
25
+ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
26
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
27
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
28
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
29
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
30
+ var _, done = false;
31
+ for (var i = decorators.length - 1; i >= 0; i--) {
32
+ var context = {};
33
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
34
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
35
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
36
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
37
+ if (kind === "accessor") {
38
+ if (result === void 0) continue;
39
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
40
+ if (_ = accept(result.get)) descriptor.get = _;
41
+ if (_ = accept(result.set)) descriptor.set = _;
42
+ if (_ = accept(result.init)) initializers.unshift(_);
43
+ }
44
+ else if (_ = accept(result)) {
45
+ if (kind === "field") initializers.unshift(_);
46
+ else descriptor[key] = _;
47
+ }
48
+ }
49
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
50
+ done = true;
51
+ }
52
+ function __runInitializers(thisArg, initializers, value) {
53
+ var useValue = arguments.length > 2;
54
+ for (var i = 0; i < initializers.length; i++) {
55
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
56
+ }
57
+ return useValue ? value : void 0;
58
+ }
59
+ function __setFunctionName(f, name, prefix) {
60
+ if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
61
+ return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
62
+ }
63
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
64
+ var e = new Error(message);
65
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
66
+ };
67
+
68
+ /**
69
+ * Default Theme
70
+ */
71
+ const defaultTheme = {
72
+ colors: {
73
+ primary: '#007bff',
74
+ secondary: '#6c757d',
75
+ background: '#ffffff',
76
+ surface: '#f8f9fa',
77
+ text: '#212529',
78
+ textSecondary: '#6c757d',
79
+ border: '#dee2e6',
80
+ hover: '#f8f9fa',
81
+ focus: '#007bff',
82
+ error: '#dc3545',
83
+ success: '#28a745',
84
+ warning: '#ffc107',
85
+ },
86
+ typography: {
87
+ fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
88
+ fontSize: {
89
+ small: '0.875rem',
90
+ medium: '1rem',
91
+ large: '1.25rem',
92
+ },
93
+ fontWeight: {
94
+ normal: 400,
95
+ medium: 500,
96
+ semibold: 600,
97
+ bold: 700,
98
+ },
99
+ lineHeight: {
100
+ tight: 1.25,
101
+ normal: 1.5,
102
+ relaxed: 1.75,
103
+ },
104
+ },
105
+ spacing: {
106
+ small: '0.5rem',
107
+ medium: '1rem',
108
+ large: '1.5rem',
109
+ },
110
+ borderRadius: {
111
+ none: '0',
112
+ small: '0.25rem',
113
+ medium: '0.375rem',
114
+ large: '0.5rem',
115
+ full: '9999px',
116
+ },
117
+ shadows: {
118
+ small: '0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24)',
119
+ medium: '0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23)',
120
+ large: '0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23)',
121
+ },
122
+ transitions: {
123
+ fast: '150ms ease-in-out',
124
+ normal: '250ms ease-in-out',
125
+ slow: '350ms ease-in-out',
126
+ },
127
+ breakpoints: {
128
+ sm: '640px',
129
+ md: '768px',
130
+ lg: '1024px',
131
+ xl: '1280px',
132
+ },
133
+ zIndex: {
134
+ dropdown: 1000,
135
+ modal: 2000,
136
+ tooltip: 3000,
137
+ },
138
+ };
139
+
140
+ /**
141
+ * createTheme utility
142
+ *
143
+ * Creates a complete theme from a partial theme configuration
144
+ */
145
+ const createTheme = (config) => {
146
+ return uiSdkCore.createTheme(config, defaultTheme);
147
+ };
148
+
149
+ /**
150
+ * SearchContext Service
151
+ *
152
+ * Provides search context (client, theme, etc.) to Angular components
153
+ */
154
+ const SEEKORA_CLIENT = new core.InjectionToken('SEEKORA_CLIENT');
155
+ const SEEKORA_THEME_CONFIG = new core.InjectionToken('SEEKORA_THEME_CONFIG');
156
+ let SearchContextService = (() => {
157
+ let _classDecorators = [core.Injectable({
158
+ providedIn: 'root',
159
+ })];
160
+ let _classDescriptor;
161
+ let _classExtraInitializers = [];
162
+ let _classThis;
163
+ _classThis = class {
164
+ constructor(client, themeConfig, enableAnalytics = true, autoTrackSearch = true) {
165
+ uiSdkCore.log.verbose('SearchContextService: Initializing', {
166
+ hasTheme: !!themeConfig,
167
+ enableAnalytics,
168
+ autoTrackSearch,
169
+ });
170
+ this.client = client;
171
+ this.theme = themeConfig ? createTheme(themeConfig) : defaultTheme;
172
+ this.enableAnalytics = enableAnalytics;
173
+ this.autoTrackSearch = autoTrackSearch;
174
+ uiSdkCore.log.info('SearchContextService: Initialized successfully');
175
+ }
176
+ };
177
+ __setFunctionName(_classThis, "SearchContextService");
178
+ (() => {
179
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
180
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
181
+ _classThis = _classDescriptor.value;
182
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
183
+ __runInitializers(_classThis, _classExtraInitializers);
184
+ })();
185
+ return _classThis;
186
+ })();
187
+
188
+ /**
189
+ * SeekoraSearch Service
190
+ *
191
+ * Service for performing searches with the Seekora SDK
192
+ */
193
+ let SeekoraSearchService = (() => {
194
+ let _classDecorators = [core.Injectable({
195
+ providedIn: 'root',
196
+ })];
197
+ let _classDescriptor;
198
+ let _classExtraInitializers = [];
199
+ let _classThis;
200
+ _classThis = class {
201
+ constructor(searchContext) {
202
+ this.searchContext = searchContext;
203
+ this.searchStateSubject = new rxjs.BehaviorSubject({
204
+ results: null,
205
+ loading: false,
206
+ error: null,
207
+ context: null,
208
+ });
209
+ this.searchState$ = this.searchStateSubject.asObservable();
210
+ }
211
+ search(options) {
212
+ const query = options.q || '';
213
+ uiSdkCore.log.verbose('SeekoraSearchService: Starting search', { query, options });
214
+ this.searchStateSubject.next({
215
+ ...this.searchStateSubject.value,
216
+ loading: true,
217
+ error: null,
218
+ });
219
+ const { q, ...restOptions } = options;
220
+ const searchPromise = this.searchContext.client.search(q, restOptions);
221
+ return rxjs.from(searchPromise).pipe(operators.map((response) => {
222
+ uiSdkCore.log.info('SeekoraSearchService: Search completed', {
223
+ query,
224
+ resultsCount: response?.results?.length || 0,
225
+ hasContext: !!response?.context,
226
+ });
227
+ this.searchStateSubject.next({
228
+ results: response,
229
+ loading: false,
230
+ error: null,
231
+ context: response.context || null,
232
+ });
233
+ return response;
234
+ }), operators.catchError((err) => {
235
+ const error = err instanceof Error ? err : new Error(String(err));
236
+ uiSdkCore.log.error('SeekoraSearchService: Search failed', {
237
+ query,
238
+ error: error.message,
239
+ stack: error.stack,
240
+ });
241
+ this.searchStateSubject.next({
242
+ results: null,
243
+ loading: false,
244
+ error,
245
+ context: null,
246
+ });
247
+ throw error;
248
+ }));
249
+ }
250
+ clearResults() {
251
+ this.searchStateSubject.next({
252
+ results: null,
253
+ loading: false,
254
+ error: null,
255
+ context: null,
256
+ });
257
+ }
258
+ getCurrentState() {
259
+ return this.searchStateSubject.value;
260
+ }
261
+ };
262
+ __setFunctionName(_classThis, "SeekoraSearchService");
263
+ (() => {
264
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
265
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
266
+ _classThis = _classDescriptor.value;
267
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
268
+ __runInitializers(_classThis, _classExtraInitializers);
269
+ })();
270
+ return _classThis;
271
+ })();
272
+
273
+ /**
274
+ * QuerySuggestions Service
275
+ *
276
+ * Service for fetching query suggestions with debouncing
277
+ */
278
+ let QuerySuggestionsService = (() => {
279
+ let _classDecorators = [core.Injectable({
280
+ providedIn: 'root',
281
+ })];
282
+ let _classDescriptor;
283
+ let _classExtraInitializers = [];
284
+ let _classThis;
285
+ _classThis = class {
286
+ constructor(searchContext, debounceMs = 300, maxSuggestions = 10) {
287
+ this.searchContext = searchContext;
288
+ this.debounceMs = debounceMs;
289
+ this.maxSuggestions = maxSuggestions;
290
+ this.querySubject = new rxjs.BehaviorSubject('');
291
+ this.suggestionsStateSubject = new rxjs.BehaviorSubject({
292
+ suggestions: [],
293
+ loading: false,
294
+ error: null,
295
+ });
296
+ this.suggestionsState$ = this.suggestionsStateSubject.asObservable();
297
+ this.querySubject.pipe(operators.debounceTime(300), operators.distinctUntilChanged(), operators.switchMap((query) => {
298
+ if (!query.trim()) {
299
+ this.suggestionsStateSubject.next({
300
+ suggestions: [],
301
+ loading: false,
302
+ error: null,
303
+ });
304
+ return rxjs.from(Promise.resolve([]));
305
+ }
306
+ this.suggestionsStateSubject.next({
307
+ ...this.suggestionsStateSubject.value,
308
+ loading: true,
309
+ error: null,
310
+ });
311
+ return rxjs.from(this.searchContext.client.getSuggestions(query, 10)).pipe(operators.map((response) => {
312
+ const rawSuggestions = Array.isArray(response) ? response : [];
313
+ const suggestionItems = rawSuggestions.map((suggestion) => {
314
+ const suggestionQuery = suggestion.query || suggestion.text || suggestion;
315
+ const count = suggestion.popularity !== undefined
316
+ ? suggestion.popularity
317
+ : (suggestion.count !== undefined ? suggestion.count : undefined);
318
+ return {
319
+ query: typeof suggestionQuery === 'string' ? suggestionQuery : String(suggestionQuery),
320
+ count: typeof count === 'number' ? count : undefined,
321
+ metadata: suggestion,
322
+ };
323
+ });
324
+ this.suggestionsStateSubject.next({
325
+ suggestions: suggestionItems,
326
+ loading: false,
327
+ error: null,
328
+ });
329
+ uiSdkCore.log.verbose('QuerySuggestionsService: Suggestions fetched', {
330
+ query,
331
+ count: suggestionItems.length,
332
+ });
333
+ return suggestionItems;
334
+ }), operators.catchError((err) => {
335
+ const error = err instanceof Error ? err : new Error(String(err));
336
+ uiSdkCore.log.error('QuerySuggestionsService: Failed to fetch suggestions', {
337
+ query,
338
+ error: error.message,
339
+ stack: error.stack,
340
+ });
341
+ this.suggestionsStateSubject.next({
342
+ suggestions: [],
343
+ loading: false,
344
+ error,
345
+ });
346
+ return rxjs.from(Promise.resolve([]));
347
+ }));
348
+ })).subscribe();
349
+ }
350
+ setQuery(query) {
351
+ this.querySubject.next(query);
352
+ }
353
+ getCurrentState() {
354
+ return this.suggestionsStateSubject.value;
355
+ }
356
+ };
357
+ __setFunctionName(_classThis, "QuerySuggestionsService");
358
+ (() => {
359
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
360
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
361
+ _classThis = _classDescriptor.value;
362
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
363
+ __runInitializers(_classThis, _classExtraInitializers);
364
+ })();
365
+ return _classThis;
366
+ })();
367
+
368
+ /**
369
+ * SearchProvider Component
370
+ *
371
+ * Provides Seekora client and context to child components
372
+ */
373
+ let SearchProviderComponent = (() => {
374
+ let _classDecorators = [core.Component({
375
+ selector: 'seekora-search-provider',
376
+ template: '<ng-content></ng-content>',
377
+ providers: [
378
+ {
379
+ provide: SEEKORA_CLIENT,
380
+ useFactory: (component) => component.client,
381
+ deps: [SearchProviderComponent],
382
+ },
383
+ {
384
+ provide: SEEKORA_THEME_CONFIG,
385
+ useFactory: (component) => component.theme,
386
+ deps: [SearchProviderComponent],
387
+ },
388
+ SearchContextService,
389
+ ],
390
+ })];
391
+ let _classDescriptor;
392
+ let _classExtraInitializers = [];
393
+ let _classThis;
394
+ let _client_decorators;
395
+ let _client_initializers = [];
396
+ let _client_extraInitializers = [];
397
+ let _theme_decorators;
398
+ let _theme_initializers = [];
399
+ let _theme_extraInitializers = [];
400
+ let _enableAnalytics_decorators;
401
+ let _enableAnalytics_initializers = [];
402
+ let _enableAnalytics_extraInitializers = [];
403
+ let _autoTrackSearch_decorators;
404
+ let _autoTrackSearch_initializers = [];
405
+ let _autoTrackSearch_extraInitializers = [];
406
+ var SearchProviderComponent = _classThis = class {
407
+ constructor(injector) {
408
+ this.injector = injector;
409
+ this.client = __runInitializers(this, _client_initializers, void 0);
410
+ this.theme = (__runInitializers(this, _client_extraInitializers), __runInitializers(this, _theme_initializers, void 0));
411
+ this.enableAnalytics = (__runInitializers(this, _theme_extraInitializers), __runInitializers(this, _enableAnalytics_initializers, true));
412
+ this.autoTrackSearch = (__runInitializers(this, _enableAnalytics_extraInitializers), __runInitializers(this, _autoTrackSearch_initializers, true));
413
+ __runInitializers(this, _autoTrackSearch_extraInitializers);
414
+ this.injector = injector;
415
+ }
416
+ ngOnInit() {
417
+ if (!this.client) {
418
+ throw new Error('SearchProvider: client is required');
419
+ }
420
+ }
421
+ ngOnDestroy() {
422
+ // Cleanup if needed
423
+ }
424
+ };
425
+ __setFunctionName(_classThis, "SearchProviderComponent");
426
+ (() => {
427
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
428
+ _client_decorators = [core.Input()];
429
+ _theme_decorators = [core.Input()];
430
+ _enableAnalytics_decorators = [core.Input()];
431
+ _autoTrackSearch_decorators = [core.Input()];
432
+ __esDecorate(null, null, _client_decorators, { kind: "field", name: "client", static: false, private: false, access: { has: obj => "client" in obj, get: obj => obj.client, set: (obj, value) => { obj.client = value; } }, metadata: _metadata }, _client_initializers, _client_extraInitializers);
433
+ __esDecorate(null, null, _theme_decorators, { kind: "field", name: "theme", static: false, private: false, access: { has: obj => "theme" in obj, get: obj => obj.theme, set: (obj, value) => { obj.theme = value; } }, metadata: _metadata }, _theme_initializers, _theme_extraInitializers);
434
+ __esDecorate(null, null, _enableAnalytics_decorators, { kind: "field", name: "enableAnalytics", static: false, private: false, access: { has: obj => "enableAnalytics" in obj, get: obj => obj.enableAnalytics, set: (obj, value) => { obj.enableAnalytics = value; } }, metadata: _metadata }, _enableAnalytics_initializers, _enableAnalytics_extraInitializers);
435
+ __esDecorate(null, null, _autoTrackSearch_decorators, { kind: "field", name: "autoTrackSearch", static: false, private: false, access: { has: obj => "autoTrackSearch" in obj, get: obj => obj.autoTrackSearch, set: (obj, value) => { obj.autoTrackSearch = value; } }, metadata: _metadata }, _autoTrackSearch_initializers, _autoTrackSearch_extraInitializers);
436
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
437
+ SearchProviderComponent = _classThis = _classDescriptor.value;
438
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
439
+ __runInitializers(_classThis, _classExtraInitializers);
440
+ })();
441
+ return SearchProviderComponent = _classThis;
442
+ })();
443
+
444
+ /**
445
+ * SearchBar Component
446
+ *
447
+ * Interactive search input component with query suggestions support
448
+ */
449
+ let SearchBarComponent = (() => {
450
+ let _classDecorators = [core.Component({
451
+ selector: 'seekora-search-bar',
452
+ template: `
453
+ <div [style.position]="'relative'">
454
+ <input
455
+ #searchInput
456
+ type="text"
457
+ [value]="query"
458
+ (input)="onInputChange($event)"
459
+ (focus)="onFocus()"
460
+ (blur)="onBlur()"
461
+ (keydown)="onKeyDown($event)"
462
+ [placeholder]="placeholder"
463
+ [style]="getInputStyle()"
464
+ />
465
+
466
+ <div
467
+ *ngIf="showSuggestionsList"
468
+ [style]="getSuggestionsStyle()"
469
+ >
470
+ <div *ngIf="suggestionsLoading" [style]="loadingStyle">
471
+ Loading suggestions...
472
+ </div>
473
+
474
+ <div
475
+ *ngFor="let suggestion of displayedSuggestions; let i = index"
476
+ (click)="selectSuggestion(suggestion.query)"
477
+ (mouseenter)="selectedIndex = i"
478
+ [style]="getSuggestionStyle(i)"
479
+ >
480
+ {{ suggestion.query }}
481
+ </div>
482
+
483
+ <div *ngIf="!suggestionsLoading && displayedSuggestions.length === 0 && query.length >= minQueryLength" [style]="emptyStyle">
484
+ No suggestions found
485
+ </div>
486
+ </div>
487
+ </div>
488
+ `,
489
+ })];
490
+ let _classDescriptor;
491
+ let _classExtraInitializers = [];
492
+ let _classThis;
493
+ let _placeholder_decorators;
494
+ let _placeholder_initializers = [];
495
+ let _placeholder_extraInitializers = [];
496
+ let _showSuggestions_decorators;
497
+ let _showSuggestions_initializers = [];
498
+ let _showSuggestions_extraInitializers = [];
499
+ let _minQueryLength_decorators;
500
+ let _minQueryLength_initializers = [];
501
+ let _minQueryLength_extraInitializers = [];
502
+ let _maxSuggestions_decorators;
503
+ let _maxSuggestions_initializers = [];
504
+ let _maxSuggestions_extraInitializers = [];
505
+ let _debounceMs_decorators;
506
+ let _debounceMs_initializers = [];
507
+ let _debounceMs_extraInitializers = [];
508
+ let _searchOptions_decorators;
509
+ let _searchOptions_initializers = [];
510
+ let _searchOptions_extraInitializers = [];
511
+ let _search_decorators;
512
+ let _search_initializers = [];
513
+ let _search_extraInitializers = [];
514
+ let _suggestionSelect_decorators;
515
+ let _suggestionSelect_initializers = [];
516
+ let _suggestionSelect_extraInitializers = [];
517
+ let _queryChange_decorators;
518
+ let _queryChange_initializers = [];
519
+ let _queryChange_extraInitializers = [];
520
+ let _searchStateChange_decorators;
521
+ let _searchStateChange_initializers = [];
522
+ let _searchStateChange_extraInitializers = [];
523
+ let _searchInput_decorators;
524
+ let _searchInput_initializers = [];
525
+ let _searchInput_extraInitializers = [];
526
+ _classThis = class {
527
+ constructor(searchContext, searchService, suggestionsService) {
528
+ this.searchContext = searchContext;
529
+ this.searchService = searchService;
530
+ this.suggestionsService = suggestionsService;
531
+ this.placeholder = __runInitializers(this, _placeholder_initializers, 'Search...');
532
+ this.showSuggestions = (__runInitializers(this, _placeholder_extraInitializers), __runInitializers(this, _showSuggestions_initializers, true));
533
+ this.minQueryLength = (__runInitializers(this, _showSuggestions_extraInitializers), __runInitializers(this, _minQueryLength_initializers, 1));
534
+ this.maxSuggestions = (__runInitializers(this, _minQueryLength_extraInitializers), __runInitializers(this, _maxSuggestions_initializers, 10));
535
+ this.debounceMs = (__runInitializers(this, _maxSuggestions_extraInitializers), __runInitializers(this, _debounceMs_initializers, 300));
536
+ this.searchOptions = (__runInitializers(this, _debounceMs_extraInitializers), __runInitializers(this, _searchOptions_initializers, void 0));
537
+ this.search = (__runInitializers(this, _searchOptions_extraInitializers), __runInitializers(this, _search_initializers, new core.EventEmitter()));
538
+ this.suggestionSelect = (__runInitializers(this, _search_extraInitializers), __runInitializers(this, _suggestionSelect_initializers, new core.EventEmitter()));
539
+ this.queryChange = (__runInitializers(this, _suggestionSelect_extraInitializers), __runInitializers(this, _queryChange_initializers, new core.EventEmitter()));
540
+ this.searchStateChange = (__runInitializers(this, _queryChange_extraInitializers), __runInitializers(this, _searchStateChange_initializers, new core.EventEmitter()));
541
+ this.searchInput = (__runInitializers(this, _searchStateChange_extraInitializers), __runInitializers(this, _searchInput_initializers, void 0));
542
+ this.query = (__runInitializers(this, _searchInput_extraInitializers), '');
543
+ this.isFocused = false;
544
+ this.selectedIndex = -1;
545
+ this.suggestions = [];
546
+ this.suggestionsLoading = false;
547
+ this.querySubject = new rxjs.Subject();
548
+ this.subscriptions = new rxjs.Subscription();
549
+ }
550
+ ngOnInit() {
551
+ // Subscribe to query changes for suggestions
552
+ const querySub = this.querySubject.pipe(operators.debounceTime(this.debounceMs), operators.distinctUntilChanged()).subscribe(query => {
553
+ if (this.showSuggestions && query.length >= this.minQueryLength) {
554
+ this.suggestionsService.setQuery(query);
555
+ }
556
+ });
557
+ // Subscribe to suggestions state
558
+ const suggestionsSub = this.suggestionsService.suggestionsState$.subscribe(state => {
559
+ this.suggestions = state.suggestions;
560
+ this.suggestionsLoading = state.loading;
561
+ });
562
+ // Subscribe to search state
563
+ const searchSub = this.searchService.searchState$.subscribe(state => {
564
+ this.searchStateChange.emit({
565
+ results: state.results,
566
+ loading: state.loading,
567
+ error: state.error,
568
+ });
569
+ });
570
+ this.subscriptions.add(querySub);
571
+ this.subscriptions.add(suggestionsSub);
572
+ this.subscriptions.add(searchSub);
573
+ }
574
+ ngOnDestroy() {
575
+ this.subscriptions.unsubscribe();
576
+ }
577
+ get displayedSuggestions() {
578
+ return this.suggestions.slice(0, this.maxSuggestions);
579
+ }
580
+ get showSuggestionsList() {
581
+ return this.isFocused && this.showSuggestions && this.query.length >= this.minQueryLength;
582
+ }
583
+ onInputChange(event) {
584
+ const target = event.target;
585
+ this.query = target.value;
586
+ this.selectedIndex = -1;
587
+ this.querySubject.next(this.query);
588
+ this.queryChange.emit(this.query);
589
+ }
590
+ onFocus() {
591
+ this.isFocused = true;
592
+ }
593
+ onBlur() {
594
+ setTimeout(() => {
595
+ this.isFocused = false;
596
+ this.selectedIndex = -1;
597
+ }, 100);
598
+ }
599
+ onKeyDown(event) {
600
+ switch (event.key) {
601
+ case 'ArrowDown':
602
+ event.preventDefault();
603
+ if (this.showSuggestions && this.displayedSuggestions.length > 0) {
604
+ this.selectedIndex = this.selectedIndex < this.displayedSuggestions.length - 1
605
+ ? this.selectedIndex + 1
606
+ : this.selectedIndex;
607
+ }
608
+ break;
609
+ case 'ArrowUp':
610
+ event.preventDefault();
611
+ if (this.showSuggestions && this.displayedSuggestions.length > 0) {
612
+ this.selectedIndex = this.selectedIndex > 0 ? this.selectedIndex - 1 : -1;
613
+ }
614
+ break;
615
+ case 'Enter':
616
+ event.preventDefault();
617
+ if (this.showSuggestions && this.displayedSuggestions.length > 0 &&
618
+ this.selectedIndex >= 0 && this.selectedIndex < this.displayedSuggestions.length) {
619
+ this.selectSuggestion(this.displayedSuggestions[this.selectedIndex].query);
620
+ }
621
+ else {
622
+ // Search with "*" if query is empty
623
+ this.performSearch();
624
+ }
625
+ break;
626
+ case 'Escape':
627
+ this.isFocused = false;
628
+ this.selectedIndex = -1;
629
+ this.searchInput?.nativeElement.blur();
630
+ break;
631
+ }
632
+ }
633
+ selectSuggestion(suggestion) {
634
+ uiSdkCore.log.verbose('SearchBar: Suggestion selected', { suggestion });
635
+ this.query = suggestion;
636
+ this.selectedIndex = -1;
637
+ this.isFocused = false;
638
+ this.searchInput?.nativeElement.blur();
639
+ this.suggestionSelect.emit(suggestion);
640
+ this.performSearch();
641
+ }
642
+ performSearch() {
643
+ const query = this.query.trim() || '';
644
+ if (!query) {
645
+ uiSdkCore.log.verbose('SearchBar: Empty query, skipping search');
646
+ return;
647
+ }
648
+ uiSdkCore.log.info('SearchBar: Performing search', { query });
649
+ this.searchService.search({
650
+ q: query,
651
+ ...this.searchOptions,
652
+ }).subscribe({
653
+ next: (results) => {
654
+ if (results) {
655
+ this.search.emit({ query, results });
656
+ }
657
+ },
658
+ error: (err) => {
659
+ const error = err instanceof Error ? err : new Error(String(err));
660
+ uiSdkCore.log.error('SearchBar: Search failed', {
661
+ query,
662
+ error: error.message,
663
+ });
664
+ // Error is handled by searchStateChange
665
+ },
666
+ });
667
+ }
668
+ getInputStyle() {
669
+ const theme = this.searchContext.theme;
670
+ return {
671
+ width: '100%',
672
+ padding: theme.spacing.medium,
673
+ fontSize: theme.typography.fontSize.medium,
674
+ borderWidth: '1px',
675
+ borderStyle: 'solid',
676
+ borderColor: this.isFocused ? theme.colors.focus : theme.colors.border,
677
+ borderRadius: typeof theme.borderRadius === 'string'
678
+ ? theme.borderRadius
679
+ : theme.borderRadius.medium,
680
+ outline: 'none',
681
+ ...(this.isFocused && {
682
+ boxShadow: theme.shadows.small,
683
+ }),
684
+ };
685
+ }
686
+ getSuggestionsStyle() {
687
+ const theme = this.searchContext.theme;
688
+ return {
689
+ position: 'absolute',
690
+ top: '100%',
691
+ left: 0,
692
+ right: 0,
693
+ marginTop: theme.spacing.small,
694
+ backgroundColor: theme.colors.background,
695
+ border: `1px solid ${theme.colors.border}`,
696
+ borderRadius: typeof theme.borderRadius === 'string'
697
+ ? theme.borderRadius
698
+ : theme.borderRadius.medium,
699
+ boxShadow: theme.shadows.medium,
700
+ maxHeight: '400px',
701
+ overflowY: 'auto',
702
+ zIndex: 1000,
703
+ };
704
+ }
705
+ get loadingStyle() {
706
+ const theme = this.searchContext.theme;
707
+ return {
708
+ padding: theme.spacing.medium,
709
+ textAlign: 'center',
710
+ };
711
+ }
712
+ get emptyStyle() {
713
+ const theme = this.searchContext.theme;
714
+ return {
715
+ padding: theme.spacing.medium,
716
+ textAlign: 'center',
717
+ color: theme.colors.text,
718
+ };
719
+ }
720
+ getSuggestionStyle(index) {
721
+ const theme = this.searchContext.theme;
722
+ return {
723
+ padding: theme.spacing.medium,
724
+ cursor: 'pointer',
725
+ backgroundColor: index === this.selectedIndex ? theme.colors.hover : 'transparent',
726
+ };
727
+ }
728
+ };
729
+ __setFunctionName(_classThis, "SearchBarComponent");
730
+ (() => {
731
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
732
+ _placeholder_decorators = [core.Input()];
733
+ _showSuggestions_decorators = [core.Input()];
734
+ _minQueryLength_decorators = [core.Input()];
735
+ _maxSuggestions_decorators = [core.Input()];
736
+ _debounceMs_decorators = [core.Input()];
737
+ _searchOptions_decorators = [core.Input()];
738
+ _search_decorators = [core.Output()];
739
+ _suggestionSelect_decorators = [core.Output()];
740
+ _queryChange_decorators = [core.Output()];
741
+ _searchStateChange_decorators = [core.Output()];
742
+ _searchInput_decorators = [core.ViewChild('searchInput')];
743
+ __esDecorate(null, null, _placeholder_decorators, { kind: "field", name: "placeholder", static: false, private: false, access: { has: obj => "placeholder" in obj, get: obj => obj.placeholder, set: (obj, value) => { obj.placeholder = value; } }, metadata: _metadata }, _placeholder_initializers, _placeholder_extraInitializers);
744
+ __esDecorate(null, null, _showSuggestions_decorators, { kind: "field", name: "showSuggestions", static: false, private: false, access: { has: obj => "showSuggestions" in obj, get: obj => obj.showSuggestions, set: (obj, value) => { obj.showSuggestions = value; } }, metadata: _metadata }, _showSuggestions_initializers, _showSuggestions_extraInitializers);
745
+ __esDecorate(null, null, _minQueryLength_decorators, { kind: "field", name: "minQueryLength", static: false, private: false, access: { has: obj => "minQueryLength" in obj, get: obj => obj.minQueryLength, set: (obj, value) => { obj.minQueryLength = value; } }, metadata: _metadata }, _minQueryLength_initializers, _minQueryLength_extraInitializers);
746
+ __esDecorate(null, null, _maxSuggestions_decorators, { kind: "field", name: "maxSuggestions", static: false, private: false, access: { has: obj => "maxSuggestions" in obj, get: obj => obj.maxSuggestions, set: (obj, value) => { obj.maxSuggestions = value; } }, metadata: _metadata }, _maxSuggestions_initializers, _maxSuggestions_extraInitializers);
747
+ __esDecorate(null, null, _debounceMs_decorators, { kind: "field", name: "debounceMs", static: false, private: false, access: { has: obj => "debounceMs" in obj, get: obj => obj.debounceMs, set: (obj, value) => { obj.debounceMs = value; } }, metadata: _metadata }, _debounceMs_initializers, _debounceMs_extraInitializers);
748
+ __esDecorate(null, null, _searchOptions_decorators, { kind: "field", name: "searchOptions", static: false, private: false, access: { has: obj => "searchOptions" in obj, get: obj => obj.searchOptions, set: (obj, value) => { obj.searchOptions = value; } }, metadata: _metadata }, _searchOptions_initializers, _searchOptions_extraInitializers);
749
+ __esDecorate(null, null, _search_decorators, { kind: "field", name: "search", static: false, private: false, access: { has: obj => "search" in obj, get: obj => obj.search, set: (obj, value) => { obj.search = value; } }, metadata: _metadata }, _search_initializers, _search_extraInitializers);
750
+ __esDecorate(null, null, _suggestionSelect_decorators, { kind: "field", name: "suggestionSelect", static: false, private: false, access: { has: obj => "suggestionSelect" in obj, get: obj => obj.suggestionSelect, set: (obj, value) => { obj.suggestionSelect = value; } }, metadata: _metadata }, _suggestionSelect_initializers, _suggestionSelect_extraInitializers);
751
+ __esDecorate(null, null, _queryChange_decorators, { kind: "field", name: "queryChange", static: false, private: false, access: { has: obj => "queryChange" in obj, get: obj => obj.queryChange, set: (obj, value) => { obj.queryChange = value; } }, metadata: _metadata }, _queryChange_initializers, _queryChange_extraInitializers);
752
+ __esDecorate(null, null, _searchStateChange_decorators, { kind: "field", name: "searchStateChange", static: false, private: false, access: { has: obj => "searchStateChange" in obj, get: obj => obj.searchStateChange, set: (obj, value) => { obj.searchStateChange = value; } }, metadata: _metadata }, _searchStateChange_initializers, _searchStateChange_extraInitializers);
753
+ __esDecorate(null, null, _searchInput_decorators, { kind: "field", name: "searchInput", static: false, private: false, access: { has: obj => "searchInput" in obj, get: obj => obj.searchInput, set: (obj, value) => { obj.searchInput = value; } }, metadata: _metadata }, _searchInput_initializers, _searchInput_extraInitializers);
754
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
755
+ _classThis = _classDescriptor.value;
756
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
757
+ __runInitializers(_classThis, _classExtraInitializers);
758
+ })();
759
+ return _classThis;
760
+ })();
761
+
762
+ /**
763
+ * SearchResults Component
764
+ *
765
+ * Displays search results with customizable rendering
766
+ */
767
+ let SearchResultsComponent = (() => {
768
+ let _classDecorators = [core.Component({
769
+ selector: 'seekora-search-results',
770
+ template: `
771
+ <div *ngIf="loading" [style]="containerStyle">
772
+ <div [style]="loadingStyle">Loading results...</div>
773
+ </div>
774
+
775
+ <div *ngIf="error && !loading" [style]="containerStyle">
776
+ <div [style]="errorStyle">Error: {{ error.message }}</div>
777
+ </div>
778
+
779
+ <div *ngIf="!loading && !error && displayedResults.length === 0" [style]="containerStyle">
780
+ <div [style]="emptyStyle">No results found</div>
781
+ </div>
782
+
783
+ <div *ngIf="!loading && !error && displayedResults.length > 0" [style]="getContainerStyle()">
784
+ <div
785
+ *ngFor="let result of displayedResults; let i = index"
786
+ (click)="onResultClick(result, i)"
787
+ [style]="getResultStyle()"
788
+ >
789
+ <div *ngIf="extractedFields(result).image" [style]="imageStyle">
790
+ <img [src]="extractedFields(result).image" [alt]="extractedFields(result).title" [style]="imageImgStyle" />
791
+ </div>
792
+ <div>
793
+ <h3 [style]="titleStyle">{{ extractedFields(result).title }}</h3>
794
+ <p *ngIf="extractedFields(result).description" [style]="descriptionStyle">
795
+ {{ extractedFields(result).description }}
796
+ </p>
797
+ <div *ngIf="extractedFields(result).price" [style]="priceStyle">
798
+ {{ extractedFields(result).price }}
799
+ </div>
800
+ </div>
801
+ </div>
802
+ </div>
803
+ `,
804
+ })];
805
+ let _classDescriptor;
806
+ let _classExtraInitializers = [];
807
+ let _classThis;
808
+ let _results_decorators;
809
+ let _results_initializers = [];
810
+ let _results_extraInitializers = [];
811
+ let _loading_decorators;
812
+ let _loading_initializers = [];
813
+ let _loading_extraInitializers = [];
814
+ let _error_decorators;
815
+ let _error_initializers = [];
816
+ let _error_extraInitializers = [];
817
+ let _viewMode_decorators;
818
+ let _viewMode_initializers = [];
819
+ let _viewMode_extraInitializers = [];
820
+ let _fieldMapping_decorators;
821
+ let _fieldMapping_initializers = [];
822
+ let _fieldMapping_extraInitializers = [];
823
+ let _itemsPerPage_decorators;
824
+ let _itemsPerPage_initializers = [];
825
+ let _itemsPerPage_extraInitializers = [];
826
+ let _resultClick_decorators;
827
+ let _resultClick_initializers = [];
828
+ let _resultClick_extraInitializers = [];
829
+ _classThis = class {
830
+ constructor(searchContext, searchService) {
831
+ this.searchContext = searchContext;
832
+ this.searchService = searchService;
833
+ this.results = __runInitializers(this, _results_initializers, void 0);
834
+ this.loading = (__runInitializers(this, _results_extraInitializers), __runInitializers(this, _loading_initializers, false));
835
+ this.error = (__runInitializers(this, _loading_extraInitializers), __runInitializers(this, _error_initializers, void 0));
836
+ this.viewMode = (__runInitializers(this, _error_extraInitializers), __runInitializers(this, _viewMode_initializers, 'list'));
837
+ this.fieldMapping = (__runInitializers(this, _viewMode_extraInitializers), __runInitializers(this, _fieldMapping_initializers, void 0));
838
+ this.itemsPerPage = (__runInitializers(this, _fieldMapping_extraInitializers), __runInitializers(this, _itemsPerPage_initializers, 10));
839
+ this.resultClick = (__runInitializers(this, _itemsPerPage_extraInitializers), __runInitializers(this, _resultClick_initializers, new core.EventEmitter()));
840
+ this.subscriptions = (__runInitializers(this, _resultClick_extraInitializers), new rxjs.Subscription());
841
+ }
842
+ ngOnInit() {
843
+ const searchSub = this.searchService.searchState$.subscribe(state => {
844
+ // Component can react to search state changes if needed
845
+ });
846
+ this.subscriptions.add(searchSub);
847
+ }
848
+ ngOnDestroy() {
849
+ this.subscriptions.unsubscribe();
850
+ }
851
+ extractResults(results) {
852
+ if (!results)
853
+ return [];
854
+ if (Array.isArray(results))
855
+ return results;
856
+ if (results.results && Array.isArray(results.results))
857
+ return results.results;
858
+ if (results.data) {
859
+ if (Array.isArray(results.data))
860
+ return results.data;
861
+ if (results.data.results && Array.isArray(results.data.results))
862
+ return results.data.results;
863
+ if (results.data.data?.results && Array.isArray(results.data.data.results)) {
864
+ return results.data.data.results;
865
+ }
866
+ }
867
+ return [];
868
+ }
869
+ get displayedResults() {
870
+ const allResults = this.extractResults(this.results);
871
+ return this.itemsPerPage > 0 ? allResults.slice(0, this.itemsPerPage) : allResults;
872
+ }
873
+ extractedFields(item) {
874
+ const mapping = this.fieldMapping || {};
875
+ return {
876
+ id: uiSdkCore.extractField(item, mapping.id) || String(item.id || ''),
877
+ title: uiSdkCore.extractField(item, mapping.title) || uiSdkCore.extractField(item, mapping.primaryText) || 'Untitled',
878
+ description: uiSdkCore.extractField(item, mapping.description) || uiSdkCore.extractField(item, mapping.secondaryText),
879
+ image: uiSdkCore.extractField(item, mapping.image) || uiSdkCore.extractField(item, mapping.imageUrl),
880
+ price: mapping.price ? uiSdkCore.formatPrice(uiSdkCore.extractField(item, mapping.price)) : undefined,
881
+ url: uiSdkCore.extractField(item, mapping.url),
882
+ metadata: item,
883
+ };
884
+ }
885
+ onResultClick(result, index) {
886
+ this.resultClick.emit({ result, index });
887
+ }
888
+ get containerStyle() {
889
+ return {};
890
+ }
891
+ get loadingStyle() {
892
+ const theme = this.searchContext.theme;
893
+ return {
894
+ padding: theme.spacing.large,
895
+ textAlign: 'center',
896
+ color: theme.colors.text,
897
+ };
898
+ }
899
+ get errorStyle() {
900
+ const theme = this.searchContext.theme;
901
+ return {
902
+ padding: theme.spacing.large,
903
+ textAlign: 'center',
904
+ color: theme.colors.error,
905
+ };
906
+ }
907
+ get emptyStyle() {
908
+ const theme = this.searchContext.theme;
909
+ return {
910
+ padding: theme.spacing.large,
911
+ textAlign: 'center',
912
+ color: theme.colors.textSecondary || theme.colors.text,
913
+ };
914
+ }
915
+ getContainerStyle() {
916
+ return {};
917
+ }
918
+ getResultStyle() {
919
+ const theme = this.searchContext.theme;
920
+ const baseStyle = {
921
+ cursor: 'pointer',
922
+ };
923
+ if (this.viewMode === 'list') {
924
+ return {
925
+ ...baseStyle,
926
+ padding: theme.spacing.medium,
927
+ borderBottom: `1px solid ${theme.colors.border}`,
928
+ };
929
+ }
930
+ else if (this.viewMode === 'card') {
931
+ return {
932
+ ...baseStyle,
933
+ padding: theme.spacing.medium,
934
+ border: `1px solid ${theme.colors.border}`,
935
+ borderRadius: typeof theme.borderRadius === 'string'
936
+ ? theme.borderRadius
937
+ : theme.borderRadius.medium,
938
+ marginBottom: theme.spacing.medium,
939
+ boxShadow: theme.shadows.small,
940
+ };
941
+ }
942
+ return baseStyle;
943
+ }
944
+ get imageStyle() {
945
+ return {
946
+ float: 'left',
947
+ marginRight: this.searchContext.theme.spacing.medium,
948
+ };
949
+ }
950
+ get imageImgStyle() {
951
+ const theme = this.searchContext.theme;
952
+ return {
953
+ width: '100px',
954
+ height: '100px',
955
+ objectFit: 'cover',
956
+ borderRadius: typeof theme.borderRadius === 'string'
957
+ ? theme.borderRadius
958
+ : theme.borderRadius.medium,
959
+ };
960
+ }
961
+ get titleStyle() {
962
+ const theme = this.searchContext.theme;
963
+ return {
964
+ fontSize: theme.typography.fontSize.large,
965
+ fontWeight: 'bold',
966
+ margin: 0,
967
+ marginBottom: theme.spacing.small,
968
+ color: theme.colors.text,
969
+ };
970
+ }
971
+ get descriptionStyle() {
972
+ const theme = this.searchContext.theme;
973
+ return {
974
+ fontSize: theme.typography.fontSize.medium,
975
+ color: theme.colors.text,
976
+ margin: 0,
977
+ marginBottom: theme.spacing.small,
978
+ opacity: 0.8,
979
+ };
980
+ }
981
+ get priceStyle() {
982
+ const theme = this.searchContext.theme;
983
+ return {
984
+ fontSize: theme.typography.fontSize.medium,
985
+ fontWeight: 'bold',
986
+ color: theme.colors.primary,
987
+ };
988
+ }
989
+ };
990
+ __setFunctionName(_classThis, "SearchResultsComponent");
991
+ (() => {
992
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
993
+ _results_decorators = [core.Input()];
994
+ _loading_decorators = [core.Input()];
995
+ _error_decorators = [core.Input()];
996
+ _viewMode_decorators = [core.Input()];
997
+ _fieldMapping_decorators = [core.Input()];
998
+ _itemsPerPage_decorators = [core.Input()];
999
+ _resultClick_decorators = [core.Output()];
1000
+ __esDecorate(null, null, _results_decorators, { kind: "field", name: "results", static: false, private: false, access: { has: obj => "results" in obj, get: obj => obj.results, set: (obj, value) => { obj.results = value; } }, metadata: _metadata }, _results_initializers, _results_extraInitializers);
1001
+ __esDecorate(null, null, _loading_decorators, { kind: "field", name: "loading", static: false, private: false, access: { has: obj => "loading" in obj, get: obj => obj.loading, set: (obj, value) => { obj.loading = value; } }, metadata: _metadata }, _loading_initializers, _loading_extraInitializers);
1002
+ __esDecorate(null, null, _error_decorators, { kind: "field", name: "error", static: false, private: false, access: { has: obj => "error" in obj, get: obj => obj.error, set: (obj, value) => { obj.error = value; } }, metadata: _metadata }, _error_initializers, _error_extraInitializers);
1003
+ __esDecorate(null, null, _viewMode_decorators, { kind: "field", name: "viewMode", static: false, private: false, access: { has: obj => "viewMode" in obj, get: obj => obj.viewMode, set: (obj, value) => { obj.viewMode = value; } }, metadata: _metadata }, _viewMode_initializers, _viewMode_extraInitializers);
1004
+ __esDecorate(null, null, _fieldMapping_decorators, { kind: "field", name: "fieldMapping", static: false, private: false, access: { has: obj => "fieldMapping" in obj, get: obj => obj.fieldMapping, set: (obj, value) => { obj.fieldMapping = value; } }, metadata: _metadata }, _fieldMapping_initializers, _fieldMapping_extraInitializers);
1005
+ __esDecorate(null, null, _itemsPerPage_decorators, { kind: "field", name: "itemsPerPage", static: false, private: false, access: { has: obj => "itemsPerPage" in obj, get: obj => obj.itemsPerPage, set: (obj, value) => { obj.itemsPerPage = value; } }, metadata: _metadata }, _itemsPerPage_initializers, _itemsPerPage_extraInitializers);
1006
+ __esDecorate(null, null, _resultClick_decorators, { kind: "field", name: "resultClick", static: false, private: false, access: { has: obj => "resultClick" in obj, get: obj => obj.resultClick, set: (obj, value) => { obj.resultClick = value; } }, metadata: _metadata }, _resultClick_initializers, _resultClick_extraInitializers);
1007
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1008
+ _classThis = _classDescriptor.value;
1009
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1010
+ __runInitializers(_classThis, _classExtraInitializers);
1011
+ })();
1012
+ return _classThis;
1013
+ })();
1014
+
1015
+ /**
1016
+ * QuerySuggestions Component
1017
+ *
1018
+ * Standalone component for displaying query suggestions
1019
+ */
1020
+ let QuerySuggestionsComponent = (() => {
1021
+ let _classDecorators = [core.Component({
1022
+ selector: 'seekora-query-suggestions',
1023
+ template: `
1024
+ <div
1025
+ *ngIf="query.length >= minQueryLength"
1026
+ [style]="getContainerStyle()"
1027
+ >
1028
+ <div
1029
+ *ngIf="showTitle"
1030
+ [style]="getTitleStyle()"
1031
+ >
1032
+ {{ title }}
1033
+ </div>
1034
+
1035
+ <div *ngIf="suggestionsLoading">
1036
+ <ng-content select="[loading]">
1037
+ <div [style]="getLoadingStyle()">
1038
+ Loading suggestions...
1039
+ </div>
1040
+ </ng-content>
1041
+ </div>
1042
+
1043
+ <div *ngIf="!suggestionsLoading && (error || displayedSuggestions.length === 0)">
1044
+ <ng-content select="[empty]">
1045
+ <div [style]="getEmptyStyle()">
1046
+ No suggestions available
1047
+ </div>
1048
+ </ng-content>
1049
+ </div>
1050
+
1051
+ <div *ngIf="!suggestionsLoading && !error && displayedSuggestions.length > 0">
1052
+ <div
1053
+ *ngFor="let suggestion of displayedSuggestions; let i = index"
1054
+ [style]="getSuggestionStyle(i)"
1055
+ (click)="onSuggestionClick(suggestion)"
1056
+ (mouseenter)="selectedIndex = i"
1057
+ (mouseleave)="selectedIndex = -1"
1058
+ >
1059
+ <ng-content select="[suggestion]">
1060
+ <span>{{ suggestion.query }}</span>
1061
+ <span *ngIf="suggestion.count !== undefined" [style]="getCountStyle()">
1062
+ ({{ suggestion.count }})
1063
+ </span>
1064
+ </ng-content>
1065
+ </div>
1066
+ </div>
1067
+ </div>
1068
+ `,
1069
+ })];
1070
+ let _classDescriptor;
1071
+ let _classExtraInitializers = [];
1072
+ let _classThis;
1073
+ let _query_decorators;
1074
+ let _query_initializers = [];
1075
+ let _query_extraInitializers = [];
1076
+ let _maxSuggestions_decorators;
1077
+ let _maxSuggestions_initializers = [];
1078
+ let _maxSuggestions_extraInitializers = [];
1079
+ let _debounceMs_decorators;
1080
+ let _debounceMs_initializers = [];
1081
+ let _debounceMs_extraInitializers = [];
1082
+ let _minQueryLength_decorators;
1083
+ let _minQueryLength_initializers = [];
1084
+ let _minQueryLength_extraInitializers = [];
1085
+ let _showTitle_decorators;
1086
+ let _showTitle_initializers = [];
1087
+ let _showTitle_extraInitializers = [];
1088
+ let _title_decorators;
1089
+ let _title_initializers = [];
1090
+ let _title_extraInitializers = [];
1091
+ let _className_decorators;
1092
+ let _className_initializers = [];
1093
+ let _className_extraInitializers = [];
1094
+ let _style_decorators;
1095
+ let _style_initializers = [];
1096
+ let _style_extraInitializers = [];
1097
+ let _suggestionClick_decorators;
1098
+ let _suggestionClick_initializers = [];
1099
+ let _suggestionClick_extraInitializers = [];
1100
+ _classThis = class {
1101
+ constructor(searchContext) {
1102
+ this.searchContext = searchContext;
1103
+ this.query = __runInitializers(this, _query_initializers, '');
1104
+ this.maxSuggestions = (__runInitializers(this, _query_extraInitializers), __runInitializers(this, _maxSuggestions_initializers, 10));
1105
+ this.debounceMs = (__runInitializers(this, _maxSuggestions_extraInitializers), __runInitializers(this, _debounceMs_initializers, 300));
1106
+ this.minQueryLength = (__runInitializers(this, _debounceMs_extraInitializers), __runInitializers(this, _minQueryLength_initializers, 2));
1107
+ this.showTitle = (__runInitializers(this, _minQueryLength_extraInitializers), __runInitializers(this, _showTitle_initializers, false));
1108
+ this.title = (__runInitializers(this, _showTitle_extraInitializers), __runInitializers(this, _title_initializers, 'Suggestions'));
1109
+ this.className = (__runInitializers(this, _title_extraInitializers), __runInitializers(this, _className_initializers, void 0));
1110
+ this.style = (__runInitializers(this, _className_extraInitializers), __runInitializers(this, _style_initializers, void 0));
1111
+ this.suggestionClick = (__runInitializers(this, _style_extraInitializers), __runInitializers(this, _suggestionClick_initializers, new core.EventEmitter()));
1112
+ this.displayedSuggestions = (__runInitializers(this, _suggestionClick_extraInitializers), []);
1113
+ this.suggestionsLoading = false;
1114
+ this.error = null;
1115
+ this.selectedIndex = -1;
1116
+ this.querySubject = new rxjs.Subject();
1117
+ }
1118
+ ngOnInit() {
1119
+ // Debounce query changes
1120
+ this.subscription = this.querySubject
1121
+ .pipe(operators.debounceTime(this.debounceMs), operators.distinctUntilChanged())
1122
+ .subscribe(query => {
1123
+ if (query.length >= this.minQueryLength) {
1124
+ this.loadSuggestions(query);
1125
+ }
1126
+ else {
1127
+ this.displayedSuggestions = [];
1128
+ this.suggestionsLoading = false;
1129
+ this.error = null;
1130
+ }
1131
+ });
1132
+ // Initial load if query is provided
1133
+ if (this.query.length >= this.minQueryLength) {
1134
+ this.querySubject.next(this.query);
1135
+ }
1136
+ }
1137
+ ngOnDestroy() {
1138
+ this.subscription?.unsubscribe();
1139
+ this.suggestionsSubscription?.unsubscribe();
1140
+ }
1141
+ ngOnChanges() {
1142
+ if (this.query !== undefined) {
1143
+ this.querySubject.next(this.query);
1144
+ }
1145
+ }
1146
+ loadSuggestions(query) {
1147
+ this.suggestionsLoading = true;
1148
+ this.error = null;
1149
+ this.suggestionsSubscription = this.searchContext.client
1150
+ .getSuggestions(query, this.maxSuggestions)
1151
+ .then((response) => {
1152
+ const rawSuggestions = Array.isArray(response) ? response : [];
1153
+ const suggestionItems = rawSuggestions.map((suggestion) => {
1154
+ const suggestionQuery = suggestion.query || suggestion.text || suggestion;
1155
+ const count = suggestion.popularity !== undefined
1156
+ ? suggestion.popularity
1157
+ : (suggestion.count !== undefined ? suggestion.count : undefined);
1158
+ return {
1159
+ query: typeof suggestionQuery === 'string' ? suggestionQuery : String(suggestionQuery),
1160
+ count: typeof count === 'number' ? count : undefined,
1161
+ metadata: suggestion,
1162
+ };
1163
+ });
1164
+ this.displayedSuggestions = suggestionItems.slice(0, this.maxSuggestions);
1165
+ this.suggestionsLoading = false;
1166
+ })
1167
+ .catch((err) => {
1168
+ this.error = err instanceof Error ? err : new Error(String(err));
1169
+ this.suggestionsLoading = false;
1170
+ });
1171
+ }
1172
+ onSuggestionClick(suggestion) {
1173
+ this.suggestionClick.emit(suggestion.query);
1174
+ }
1175
+ get theme() {
1176
+ return this.searchContext.theme;
1177
+ }
1178
+ getContainerStyle() {
1179
+ return {
1180
+ ...this.style,
1181
+ };
1182
+ }
1183
+ getTitleStyle() {
1184
+ return {
1185
+ fontSize: this.theme.typography.fontSize.large,
1186
+ fontWeight: 'bold',
1187
+ marginBottom: this.theme.spacing.medium,
1188
+ color: this.theme.colors.text,
1189
+ };
1190
+ }
1191
+ getLoadingStyle() {
1192
+ return {
1193
+ padding: this.theme.spacing.medium,
1194
+ textAlign: 'center',
1195
+ color: this.theme.colors.text,
1196
+ };
1197
+ }
1198
+ getEmptyStyle() {
1199
+ return {
1200
+ padding: this.theme.spacing.medium,
1201
+ textAlign: 'center',
1202
+ color: this.theme.colors.text,
1203
+ opacity: 0.6,
1204
+ };
1205
+ }
1206
+ getSuggestionStyle(index) {
1207
+ const borderRadius = typeof this.theme.borderRadius === 'string'
1208
+ ? this.theme.borderRadius
1209
+ : this.theme.borderRadius.medium;
1210
+ return {
1211
+ padding: this.theme.spacing.medium,
1212
+ cursor: 'pointer',
1213
+ borderRadius,
1214
+ transition: this.theme.transitions?.fast || '150ms ease-in-out',
1215
+ backgroundColor: index === this.selectedIndex ? this.theme.colors.hover : 'transparent',
1216
+ marginBottom: index < this.displayedSuggestions.length - 1 ? this.theme.spacing.small : 0,
1217
+ };
1218
+ }
1219
+ getCountStyle() {
1220
+ return {
1221
+ opacity: 0.6,
1222
+ marginLeft: this.theme.spacing.small,
1223
+ };
1224
+ }
1225
+ };
1226
+ __setFunctionName(_classThis, "QuerySuggestionsComponent");
1227
+ (() => {
1228
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
1229
+ _query_decorators = [core.Input()];
1230
+ _maxSuggestions_decorators = [core.Input()];
1231
+ _debounceMs_decorators = [core.Input()];
1232
+ _minQueryLength_decorators = [core.Input()];
1233
+ _showTitle_decorators = [core.Input()];
1234
+ _title_decorators = [core.Input()];
1235
+ _className_decorators = [core.Input()];
1236
+ _style_decorators = [core.Input()];
1237
+ _suggestionClick_decorators = [core.Output()];
1238
+ __esDecorate(null, null, _query_decorators, { kind: "field", name: "query", static: false, private: false, access: { has: obj => "query" in obj, get: obj => obj.query, set: (obj, value) => { obj.query = value; } }, metadata: _metadata }, _query_initializers, _query_extraInitializers);
1239
+ __esDecorate(null, null, _maxSuggestions_decorators, { kind: "field", name: "maxSuggestions", static: false, private: false, access: { has: obj => "maxSuggestions" in obj, get: obj => obj.maxSuggestions, set: (obj, value) => { obj.maxSuggestions = value; } }, metadata: _metadata }, _maxSuggestions_initializers, _maxSuggestions_extraInitializers);
1240
+ __esDecorate(null, null, _debounceMs_decorators, { kind: "field", name: "debounceMs", static: false, private: false, access: { has: obj => "debounceMs" in obj, get: obj => obj.debounceMs, set: (obj, value) => { obj.debounceMs = value; } }, metadata: _metadata }, _debounceMs_initializers, _debounceMs_extraInitializers);
1241
+ __esDecorate(null, null, _minQueryLength_decorators, { kind: "field", name: "minQueryLength", static: false, private: false, access: { has: obj => "minQueryLength" in obj, get: obj => obj.minQueryLength, set: (obj, value) => { obj.minQueryLength = value; } }, metadata: _metadata }, _minQueryLength_initializers, _minQueryLength_extraInitializers);
1242
+ __esDecorate(null, null, _showTitle_decorators, { kind: "field", name: "showTitle", static: false, private: false, access: { has: obj => "showTitle" in obj, get: obj => obj.showTitle, set: (obj, value) => { obj.showTitle = value; } }, metadata: _metadata }, _showTitle_initializers, _showTitle_extraInitializers);
1243
+ __esDecorate(null, null, _title_decorators, { kind: "field", name: "title", static: false, private: false, access: { has: obj => "title" in obj, get: obj => obj.title, set: (obj, value) => { obj.title = value; } }, metadata: _metadata }, _title_initializers, _title_extraInitializers);
1244
+ __esDecorate(null, null, _className_decorators, { kind: "field", name: "className", static: false, private: false, access: { has: obj => "className" in obj, get: obj => obj.className, set: (obj, value) => { obj.className = value; } }, metadata: _metadata }, _className_initializers, _className_extraInitializers);
1245
+ __esDecorate(null, null, _style_decorators, { kind: "field", name: "style", static: false, private: false, access: { has: obj => "style" in obj, get: obj => obj.style, set: (obj, value) => { obj.style = value; } }, metadata: _metadata }, _style_initializers, _style_extraInitializers);
1246
+ __esDecorate(null, null, _suggestionClick_decorators, { kind: "field", name: "suggestionClick", static: false, private: false, access: { has: obj => "suggestionClick" in obj, get: obj => obj.suggestionClick, set: (obj, value) => { obj.suggestionClick = value; } }, metadata: _metadata }, _suggestionClick_initializers, _suggestionClick_extraInitializers);
1247
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1248
+ _classThis = _classDescriptor.value;
1249
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1250
+ __runInitializers(_classThis, _classExtraInitializers);
1251
+ })();
1252
+ return _classThis;
1253
+ })();
1254
+
1255
+ /**
1256
+ * Stats Component
1257
+ *
1258
+ * Displays search statistics
1259
+ */
1260
+ let StatsComponent = (() => {
1261
+ let _classDecorators = [core.Component({
1262
+ selector: 'seekora-stats',
1263
+ template: `
1264
+ <div *ngIf="loading" [style]="containerStyle">
1265
+ <span [style]="textStyle">Loading...</span>
1266
+ </div>
1267
+ <div *ngIf="!loading && hasResults" [style]="containerStyle">
1268
+ <span [style]="textStyle">
1269
+ {{ resultsText }}
1270
+ <span *ngIf="showProcessingTime && processingTime !== undefined">
1271
+ {{ processingTimeText }}
1272
+ </span>
1273
+ </span>
1274
+ </div>
1275
+ `,
1276
+ })];
1277
+ let _classDescriptor;
1278
+ let _classExtraInitializers = [];
1279
+ let _classThis;
1280
+ let _results_decorators;
1281
+ let _results_initializers = [];
1282
+ let _results_extraInitializers = [];
1283
+ let _loading_decorators;
1284
+ let _loading_initializers = [];
1285
+ let _loading_extraInitializers = [];
1286
+ let _showProcessingTime_decorators;
1287
+ let _showProcessingTime_initializers = [];
1288
+ let _showProcessingTime_extraInitializers = [];
1289
+ let _showQuery_decorators;
1290
+ let _showQuery_initializers = [];
1291
+ let _showQuery_extraInitializers = [];
1292
+ let _labels_decorators;
1293
+ let _labels_initializers = [];
1294
+ let _labels_extraInitializers = [];
1295
+ _classThis = class {
1296
+ constructor(searchContext) {
1297
+ this.searchContext = searchContext;
1298
+ this.results = __runInitializers(this, _results_initializers, void 0);
1299
+ this.loading = (__runInitializers(this, _results_extraInitializers), __runInitializers(this, _loading_initializers, false));
1300
+ this.showProcessingTime = (__runInitializers(this, _loading_extraInitializers), __runInitializers(this, _showProcessingTime_initializers, true));
1301
+ this.showQuery = (__runInitializers(this, _showProcessingTime_extraInitializers), __runInitializers(this, _showQuery_initializers, false));
1302
+ this.labels = (__runInitializers(this, _showQuery_extraInitializers), __runInitializers(this, _labels_initializers, void 0));
1303
+ __runInitializers(this, _labels_extraInitializers);
1304
+ this.searchContext = searchContext;
1305
+ }
1306
+ get totalResults() {
1307
+ if (!this.results)
1308
+ return 0;
1309
+ return this.results.totalResults || this.results.data?.total_results || 0;
1310
+ }
1311
+ get processingTime() {
1312
+ if (!this.results)
1313
+ return undefined;
1314
+ return this.results.processingTimeMs || this.results.data?.processing_time_ms;
1315
+ }
1316
+ get hasResults() {
1317
+ return this.totalResults > 0;
1318
+ }
1319
+ get resultsText() {
1320
+ const defaultLabel = (total) => `${total} results found`;
1321
+ const labelFn = this.labels?.resultsFound || defaultLabel;
1322
+ return labelFn(this.totalResults);
1323
+ }
1324
+ get processingTimeText() {
1325
+ if (this.processingTime === undefined)
1326
+ return '';
1327
+ const defaultLabel = (time) => `in ${time} ms`;
1328
+ const labelFn = this.labels?.processingTime || defaultLabel;
1329
+ return ` ${labelFn(this.processingTime)}`;
1330
+ }
1331
+ get containerStyle() {
1332
+ return {};
1333
+ }
1334
+ get textStyle() {
1335
+ const theme = this.searchContext.theme;
1336
+ return {
1337
+ color: theme.colors.text,
1338
+ fontSize: theme.typography.fontSize.medium,
1339
+ };
1340
+ }
1341
+ };
1342
+ __setFunctionName(_classThis, "StatsComponent");
1343
+ (() => {
1344
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
1345
+ _results_decorators = [core.Input()];
1346
+ _loading_decorators = [core.Input()];
1347
+ _showProcessingTime_decorators = [core.Input()];
1348
+ _showQuery_decorators = [core.Input()];
1349
+ _labels_decorators = [core.Input()];
1350
+ __esDecorate(null, null, _results_decorators, { kind: "field", name: "results", static: false, private: false, access: { has: obj => "results" in obj, get: obj => obj.results, set: (obj, value) => { obj.results = value; } }, metadata: _metadata }, _results_initializers, _results_extraInitializers);
1351
+ __esDecorate(null, null, _loading_decorators, { kind: "field", name: "loading", static: false, private: false, access: { has: obj => "loading" in obj, get: obj => obj.loading, set: (obj, value) => { obj.loading = value; } }, metadata: _metadata }, _loading_initializers, _loading_extraInitializers);
1352
+ __esDecorate(null, null, _showProcessingTime_decorators, { kind: "field", name: "showProcessingTime", static: false, private: false, access: { has: obj => "showProcessingTime" in obj, get: obj => obj.showProcessingTime, set: (obj, value) => { obj.showProcessingTime = value; } }, metadata: _metadata }, _showProcessingTime_initializers, _showProcessingTime_extraInitializers);
1353
+ __esDecorate(null, null, _showQuery_decorators, { kind: "field", name: "showQuery", static: false, private: false, access: { has: obj => "showQuery" in obj, get: obj => obj.showQuery, set: (obj, value) => { obj.showQuery = value; } }, metadata: _metadata }, _showQuery_initializers, _showQuery_extraInitializers);
1354
+ __esDecorate(null, null, _labels_decorators, { kind: "field", name: "labels", static: false, private: false, access: { has: obj => "labels" in obj, get: obj => obj.labels, set: (obj, value) => { obj.labels = value; } }, metadata: _metadata }, _labels_initializers, _labels_extraInitializers);
1355
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1356
+ _classThis = _classDescriptor.value;
1357
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1358
+ __runInitializers(_classThis, _classExtraInitializers);
1359
+ })();
1360
+ return _classThis;
1361
+ })();
1362
+
1363
+ /**
1364
+ * Pagination Component
1365
+ *
1366
+ * Displays pagination controls for search results
1367
+ */
1368
+ let PaginationComponent = (() => {
1369
+ let _classDecorators = [core.Component({
1370
+ selector: 'seekora-pagination',
1371
+ template: `
1372
+ <div *ngIf="totalPages > 1" [style]="containerStyle">
1373
+ <button
1374
+ *ngIf="showFirstLast"
1375
+ [disabled]="currentPage === 1"
1376
+ (click)="handlePageChange(1)"
1377
+ [style]="getButtonStyle(1)"
1378
+ >
1379
+ First
1380
+ </button>
1381
+
1382
+ <button
1383
+ *ngIf="showPrevNext"
1384
+ [disabled]="currentPage === 1"
1385
+ (click)="handlePageChange(currentPage - 1)"
1386
+ [style]="getButtonStyle(currentPage - 1)"
1387
+ >
1388
+ Previous
1389
+ </button>
1390
+
1391
+ <button
1392
+ *ngFor="let page of visiblePages"
1393
+ [disabled]="page === currentPage"
1394
+ (click)="handlePageChange(page)"
1395
+ [style]="getButtonStyle(page, page === currentPage)"
1396
+ >
1397
+ {{ page }}
1398
+ </button>
1399
+
1400
+ <button
1401
+ *ngIf="showPrevNext"
1402
+ [disabled]="currentPage === totalPages"
1403
+ (click)="handlePageChange(currentPage + 1)"
1404
+ [style]="getButtonStyle(currentPage + 1)"
1405
+ >
1406
+ Next
1407
+ </button>
1408
+
1409
+ <button
1410
+ *ngIf="showFirstLast"
1411
+ [disabled]="currentPage === totalPages"
1412
+ (click)="handlePageChange(totalPages)"
1413
+ [style]="getButtonStyle(totalPages)"
1414
+ >
1415
+ Last
1416
+ </button>
1417
+ </div>
1418
+ `,
1419
+ })];
1420
+ let _classDescriptor;
1421
+ let _classExtraInitializers = [];
1422
+ let _classThis;
1423
+ let _results_decorators;
1424
+ let _results_initializers = [];
1425
+ let _results_extraInitializers = [];
1426
+ let _currentPage_decorators;
1427
+ let _currentPage_initializers = [];
1428
+ let _currentPage_extraInitializers = [];
1429
+ let _itemsPerPage_decorators;
1430
+ let _itemsPerPage_initializers = [];
1431
+ let _itemsPerPage_extraInitializers = [];
1432
+ let _maxVisiblePages_decorators;
1433
+ let _maxVisiblePages_initializers = [];
1434
+ let _maxVisiblePages_extraInitializers = [];
1435
+ let _showFirstLast_decorators;
1436
+ let _showFirstLast_initializers = [];
1437
+ let _showFirstLast_extraInitializers = [];
1438
+ let _showPrevNext_decorators;
1439
+ let _showPrevNext_initializers = [];
1440
+ let _showPrevNext_extraInitializers = [];
1441
+ let _pageChange_decorators;
1442
+ let _pageChange_initializers = [];
1443
+ let _pageChange_extraInitializers = [];
1444
+ _classThis = class {
1445
+ constructor(searchContext) {
1446
+ this.searchContext = searchContext;
1447
+ this.results = __runInitializers(this, _results_initializers, void 0);
1448
+ this.currentPage = (__runInitializers(this, _results_extraInitializers), __runInitializers(this, _currentPage_initializers, 1));
1449
+ this.itemsPerPage = (__runInitializers(this, _currentPage_extraInitializers), __runInitializers(this, _itemsPerPage_initializers, 10));
1450
+ this.maxVisiblePages = (__runInitializers(this, _itemsPerPage_extraInitializers), __runInitializers(this, _maxVisiblePages_initializers, 5));
1451
+ this.showFirstLast = (__runInitializers(this, _maxVisiblePages_extraInitializers), __runInitializers(this, _showFirstLast_initializers, false));
1452
+ this.showPrevNext = (__runInitializers(this, _showFirstLast_extraInitializers), __runInitializers(this, _showPrevNext_initializers, true));
1453
+ this.pageChange = (__runInitializers(this, _showPrevNext_extraInitializers), __runInitializers(this, _pageChange_initializers, new core.EventEmitter()));
1454
+ __runInitializers(this, _pageChange_extraInitializers);
1455
+ this.searchContext = searchContext;
1456
+ }
1457
+ get totalResults() {
1458
+ if (!this.results)
1459
+ return 0;
1460
+ return this.results.totalResults || this.results.data?.total_results || 0;
1461
+ }
1462
+ get totalPages() {
1463
+ return Math.ceil(this.totalResults / this.itemsPerPage);
1464
+ }
1465
+ get visiblePages() {
1466
+ const pages = [];
1467
+ const maxVisible = this.maxVisiblePages || 5;
1468
+ const half = Math.floor(maxVisible / 2);
1469
+ let start = Math.max(1, this.currentPage - half);
1470
+ let end = Math.min(this.totalPages, start + maxVisible - 1);
1471
+ if (end - start < maxVisible - 1) {
1472
+ start = Math.max(1, end - maxVisible + 1);
1473
+ }
1474
+ for (let i = start; i <= end; i++) {
1475
+ pages.push(i);
1476
+ }
1477
+ return pages;
1478
+ }
1479
+ handlePageChange(page) {
1480
+ if (page < 1 || page > this.totalPages)
1481
+ return;
1482
+ this.pageChange.emit(page);
1483
+ }
1484
+ get containerStyle() {
1485
+ const theme = this.searchContext.theme;
1486
+ return {
1487
+ display: 'flex',
1488
+ gap: theme.spacing.small,
1489
+ justifyContent: 'center',
1490
+ alignItems: 'center',
1491
+ };
1492
+ }
1493
+ getButtonStyle(page, isActive = false) {
1494
+ const theme = this.searchContext.theme;
1495
+ return {
1496
+ padding: `${theme.spacing.small} ${theme.spacing.medium}`,
1497
+ border: `1px solid ${theme.colors.border}`,
1498
+ borderRadius: typeof theme.borderRadius === 'string'
1499
+ ? theme.borderRadius
1500
+ : theme.borderRadius.medium,
1501
+ backgroundColor: isActive ? theme.colors.primary : theme.colors.background,
1502
+ color: isActive ? '#fff' : theme.colors.text,
1503
+ cursor: 'pointer',
1504
+ fontSize: theme.typography.fontSize.small,
1505
+ };
1506
+ }
1507
+ };
1508
+ __setFunctionName(_classThis, "PaginationComponent");
1509
+ (() => {
1510
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
1511
+ _results_decorators = [core.Input()];
1512
+ _currentPage_decorators = [core.Input()];
1513
+ _itemsPerPage_decorators = [core.Input()];
1514
+ _maxVisiblePages_decorators = [core.Input()];
1515
+ _showFirstLast_decorators = [core.Input()];
1516
+ _showPrevNext_decorators = [core.Input()];
1517
+ _pageChange_decorators = [core.Output()];
1518
+ __esDecorate(null, null, _results_decorators, { kind: "field", name: "results", static: false, private: false, access: { has: obj => "results" in obj, get: obj => obj.results, set: (obj, value) => { obj.results = value; } }, metadata: _metadata }, _results_initializers, _results_extraInitializers);
1519
+ __esDecorate(null, null, _currentPage_decorators, { kind: "field", name: "currentPage", static: false, private: false, access: { has: obj => "currentPage" in obj, get: obj => obj.currentPage, set: (obj, value) => { obj.currentPage = value; } }, metadata: _metadata }, _currentPage_initializers, _currentPage_extraInitializers);
1520
+ __esDecorate(null, null, _itemsPerPage_decorators, { kind: "field", name: "itemsPerPage", static: false, private: false, access: { has: obj => "itemsPerPage" in obj, get: obj => obj.itemsPerPage, set: (obj, value) => { obj.itemsPerPage = value; } }, metadata: _metadata }, _itemsPerPage_initializers, _itemsPerPage_extraInitializers);
1521
+ __esDecorate(null, null, _maxVisiblePages_decorators, { kind: "field", name: "maxVisiblePages", static: false, private: false, access: { has: obj => "maxVisiblePages" in obj, get: obj => obj.maxVisiblePages, set: (obj, value) => { obj.maxVisiblePages = value; } }, metadata: _metadata }, _maxVisiblePages_initializers, _maxVisiblePages_extraInitializers);
1522
+ __esDecorate(null, null, _showFirstLast_decorators, { kind: "field", name: "showFirstLast", static: false, private: false, access: { has: obj => "showFirstLast" in obj, get: obj => obj.showFirstLast, set: (obj, value) => { obj.showFirstLast = value; } }, metadata: _metadata }, _showFirstLast_initializers, _showFirstLast_extraInitializers);
1523
+ __esDecorate(null, null, _showPrevNext_decorators, { kind: "field", name: "showPrevNext", static: false, private: false, access: { has: obj => "showPrevNext" in obj, get: obj => obj.showPrevNext, set: (obj, value) => { obj.showPrevNext = value; } }, metadata: _metadata }, _showPrevNext_initializers, _showPrevNext_extraInitializers);
1524
+ __esDecorate(null, null, _pageChange_decorators, { kind: "field", name: "pageChange", static: false, private: false, access: { has: obj => "pageChange" in obj, get: obj => obj.pageChange, set: (obj, value) => { obj.pageChange = value; } }, metadata: _metadata }, _pageChange_initializers, _pageChange_extraInitializers);
1525
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1526
+ _classThis = _classDescriptor.value;
1527
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1528
+ __runInitializers(_classThis, _classExtraInitializers);
1529
+ })();
1530
+ return _classThis;
1531
+ })();
1532
+
1533
+ /**
1534
+ * SortBy Component
1535
+ *
1536
+ * Displays sort options for search results
1537
+ */
1538
+ let SortByComponent = (() => {
1539
+ let _classDecorators = [core.Component({
1540
+ selector: 'seekora-sort-by',
1541
+ template: `
1542
+ <div [style]="containerStyle">
1543
+ <label *ngIf="label" [style]="labelStyle">{{ label }}</label>
1544
+ <select
1545
+ [value]="value"
1546
+ (change)="handleChange($event)"
1547
+ [style]="selectStyle"
1548
+ >
1549
+ <option
1550
+ *ngFor="let option of options"
1551
+ [value]="option.value"
1552
+ >
1553
+ {{ option.label }}
1554
+ </option>
1555
+ </select>
1556
+ </div>
1557
+ `,
1558
+ })];
1559
+ let _classDescriptor;
1560
+ let _classExtraInitializers = [];
1561
+ let _classThis;
1562
+ let _options_decorators;
1563
+ let _options_initializers = [];
1564
+ let _options_extraInitializers = [];
1565
+ let _value_decorators;
1566
+ let _value_initializers = [];
1567
+ let _value_extraInitializers = [];
1568
+ let _label_decorators;
1569
+ let _label_initializers = [];
1570
+ let _label_extraInitializers = [];
1571
+ let _sortChange_decorators;
1572
+ let _sortChange_initializers = [];
1573
+ let _sortChange_extraInitializers = [];
1574
+ _classThis = class {
1575
+ constructor(searchContext) {
1576
+ this.searchContext = searchContext;
1577
+ this.options = __runInitializers(this, _options_initializers, []);
1578
+ this.value = (__runInitializers(this, _options_extraInitializers), __runInitializers(this, _value_initializers, ''));
1579
+ this.label = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _label_initializers, void 0));
1580
+ this.sortChange = (__runInitializers(this, _label_extraInitializers), __runInitializers(this, _sortChange_initializers, new core.EventEmitter()));
1581
+ __runInitializers(this, _sortChange_extraInitializers);
1582
+ this.searchContext = searchContext;
1583
+ }
1584
+ handleChange(event) {
1585
+ const target = event.target;
1586
+ this.sortChange.emit(target.value);
1587
+ }
1588
+ get containerStyle() {
1589
+ const theme = this.searchContext.theme;
1590
+ return {
1591
+ display: 'flex',
1592
+ alignItems: 'center',
1593
+ gap: theme.spacing.small,
1594
+ };
1595
+ }
1596
+ get labelStyle() {
1597
+ const theme = this.searchContext.theme;
1598
+ return {
1599
+ fontSize: theme.typography.fontSize.medium,
1600
+ color: theme.colors.text,
1601
+ fontWeight: theme.typography.fontWeight?.medium || 500,
1602
+ };
1603
+ }
1604
+ get selectStyle() {
1605
+ const theme = this.searchContext.theme;
1606
+ return {
1607
+ padding: theme.spacing.small,
1608
+ fontSize: theme.typography.fontSize.medium,
1609
+ border: `1px solid ${theme.colors.border}`,
1610
+ borderRadius: typeof theme.borderRadius === 'string'
1611
+ ? theme.borderRadius
1612
+ : theme.borderRadius.medium,
1613
+ backgroundColor: theme.colors.background,
1614
+ color: theme.colors.text,
1615
+ cursor: 'pointer',
1616
+ outline: 'none',
1617
+ };
1618
+ }
1619
+ };
1620
+ __setFunctionName(_classThis, "SortByComponent");
1621
+ (() => {
1622
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
1623
+ _options_decorators = [core.Input()];
1624
+ _value_decorators = [core.Input()];
1625
+ _label_decorators = [core.Input()];
1626
+ _sortChange_decorators = [core.Output()];
1627
+ __esDecorate(null, null, _options_decorators, { kind: "field", name: "options", static: false, private: false, access: { has: obj => "options" in obj, get: obj => obj.options, set: (obj, value) => { obj.options = value; } }, metadata: _metadata }, _options_initializers, _options_extraInitializers);
1628
+ __esDecorate(null, null, _value_decorators, { kind: "field", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
1629
+ __esDecorate(null, null, _label_decorators, { kind: "field", name: "label", static: false, private: false, access: { has: obj => "label" in obj, get: obj => obj.label, set: (obj, value) => { obj.label = value; } }, metadata: _metadata }, _label_initializers, _label_extraInitializers);
1630
+ __esDecorate(null, null, _sortChange_decorators, { kind: "field", name: "sortChange", static: false, private: false, access: { has: obj => "sortChange" in obj, get: obj => obj.sortChange, set: (obj, value) => { obj.sortChange = value; } }, metadata: _metadata }, _sortChange_initializers, _sortChange_extraInitializers);
1631
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1632
+ _classThis = _classDescriptor.value;
1633
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1634
+ __runInitializers(_classThis, _classExtraInitializers);
1635
+ })();
1636
+ return _classThis;
1637
+ })();
1638
+
1639
+ /**
1640
+ * Facets Component
1641
+ *
1642
+ * Displays facet filters for search results
1643
+ */
1644
+ let FacetsComponent = (() => {
1645
+ let _classDecorators = [core.Component({
1646
+ selector: 'seekora-facets',
1647
+ template: `
1648
+ <div
1649
+ *ngFor="let facet of facets"
1650
+ [style]="containerStyle"
1651
+ >
1652
+ <h3 [style]="titleStyle">{{ facet.field_name }}</h3>
1653
+ <div
1654
+ *ngFor="let count of visibleCounts(facet); let i = index"
1655
+ [style]="getFacetItemStyle(facet.field_name, count.value)"
1656
+ (click)="handleFacetClick(facet.field_name, count.value)"
1657
+ >
1658
+ <input
1659
+ type="checkbox"
1660
+ [checked]="isSelected(facet.field_name, count.value)"
1661
+ (change)="handleFacetChange(facet.field_name, count.value, !isSelected(facet.field_name, count.value))"
1662
+ [style]="checkboxStyle"
1663
+ />
1664
+ <span [style]="labelStyle">{{ count.value }}</span>
1665
+ <span [style]="countStyle">({{ count.count }})</span>
1666
+ </div>
1667
+ <button
1668
+ *ngIf="facet.counts.length > maxItems"
1669
+ (click)="toggleShowMore(facet.field_name)"
1670
+ [style]="showMoreStyle"
1671
+ >
1672
+ {{ getShowMoreLabel(facet) }}
1673
+ </button>
1674
+ </div>
1675
+ `,
1676
+ })];
1677
+ let _classDescriptor;
1678
+ let _classExtraInitializers = [];
1679
+ let _classThis;
1680
+ let _results_decorators;
1681
+ let _results_initializers = [];
1682
+ let _results_extraInitializers = [];
1683
+ let _maxItems_decorators;
1684
+ let _maxItems_initializers = [];
1685
+ let _maxItems_extraInitializers = [];
1686
+ let _showMore_decorators;
1687
+ let _showMore_initializers = [];
1688
+ let _showMore_extraInitializers = [];
1689
+ let _selectedFacets_decorators;
1690
+ let _selectedFacets_initializers = [];
1691
+ let _selectedFacets_extraInitializers = [];
1692
+ let _facetChange_decorators;
1693
+ let _facetChange_initializers = [];
1694
+ let _facetChange_extraInitializers = [];
1695
+ _classThis = class {
1696
+ constructor(searchContext) {
1697
+ this.searchContext = searchContext;
1698
+ this.results = __runInitializers(this, _results_initializers, void 0);
1699
+ this.maxItems = (__runInitializers(this, _results_extraInitializers), __runInitializers(this, _maxItems_initializers, 5));
1700
+ this.showMore = (__runInitializers(this, _maxItems_extraInitializers), __runInitializers(this, _showMore_initializers, true));
1701
+ this.selectedFacets = (__runInitializers(this, _showMore_extraInitializers), __runInitializers(this, _selectedFacets_initializers, {}));
1702
+ this.facetChange = (__runInitializers(this, _selectedFacets_extraInitializers), __runInitializers(this, _facetChange_initializers, new core.EventEmitter()));
1703
+ this.expandedFacets = (__runInitializers(this, _facetChange_extraInitializers), {});
1704
+ }
1705
+ get facets() {
1706
+ if (!this.results)
1707
+ return [];
1708
+ const facetsData = this.results.facets || this.results.data?.facets || [];
1709
+ return Array.isArray(facetsData) ? facetsData : [];
1710
+ }
1711
+ visibleCounts(facet) {
1712
+ const isExpanded = this.expandedFacets[facet.field_name];
1713
+ if (isExpanded || !this.showMore) {
1714
+ return facet.counts;
1715
+ }
1716
+ return facet.counts.slice(0, this.maxItems);
1717
+ }
1718
+ isSelected(field, value) {
1719
+ const selected = this.selectedFacets?.[field] || [];
1720
+ return selected.includes(value);
1721
+ }
1722
+ toggleShowMore(field) {
1723
+ this.expandedFacets[field] = !this.expandedFacets[field];
1724
+ }
1725
+ handleFacetClick(field, value) {
1726
+ this.handleFacetChange(field, value, !this.isSelected(field, value));
1727
+ }
1728
+ handleFacetChange(field, value, selected) {
1729
+ this.facetChange.emit({ field, value, selected });
1730
+ }
1731
+ get containerStyle() {
1732
+ const theme = this.searchContext.theme;
1733
+ return {
1734
+ marginBottom: theme.spacing.large,
1735
+ };
1736
+ }
1737
+ get titleStyle() {
1738
+ const theme = this.searchContext.theme;
1739
+ return {
1740
+ fontSize: theme.typography.fontSize.medium,
1741
+ fontWeight: theme.typography.fontWeight?.bold || 700,
1742
+ marginBottom: theme.spacing.small,
1743
+ color: theme.colors.text,
1744
+ };
1745
+ }
1746
+ getFacetItemStyle(field, value) {
1747
+ const theme = this.searchContext.theme;
1748
+ return {
1749
+ display: 'flex',
1750
+ alignItems: 'center',
1751
+ gap: theme.spacing.small,
1752
+ padding: theme.spacing.small,
1753
+ cursor: 'pointer',
1754
+ backgroundColor: this.isSelected(field, value) ? theme.colors.hover : 'transparent',
1755
+ borderRadius: typeof theme.borderRadius === 'string'
1756
+ ? theme.borderRadius
1757
+ : theme.borderRadius.small,
1758
+ };
1759
+ }
1760
+ get checkboxStyle() {
1761
+ return {
1762
+ cursor: 'pointer',
1763
+ };
1764
+ }
1765
+ get labelStyle() {
1766
+ const theme = this.searchContext.theme;
1767
+ return {
1768
+ flex: 1,
1769
+ fontSize: theme.typography.fontSize.small,
1770
+ color: theme.colors.text,
1771
+ };
1772
+ }
1773
+ get countStyle() {
1774
+ const theme = this.searchContext.theme;
1775
+ return {
1776
+ fontSize: theme.typography.fontSize.small,
1777
+ color: theme.colors.textSecondary || theme.colors.text,
1778
+ opacity: 0.7,
1779
+ };
1780
+ }
1781
+ get showMoreStyle() {
1782
+ const theme = this.searchContext.theme;
1783
+ return {
1784
+ marginTop: theme.spacing.small,
1785
+ padding: theme.spacing.small,
1786
+ backgroundColor: 'transparent',
1787
+ border: 'none',
1788
+ color: theme.colors.primary,
1789
+ cursor: 'pointer',
1790
+ fontSize: theme.typography.fontSize.small,
1791
+ textDecoration: 'underline',
1792
+ };
1793
+ }
1794
+ isExpanded(field) {
1795
+ return this.expandedFacets[field] || false;
1796
+ }
1797
+ getShowMoreLabel(facet) {
1798
+ if (this.isExpanded(facet.field_name)) {
1799
+ return 'Show Less';
1800
+ }
1801
+ return `Show More (${facet.counts.length - this.maxItems})`;
1802
+ }
1803
+ };
1804
+ __setFunctionName(_classThis, "FacetsComponent");
1805
+ (() => {
1806
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
1807
+ _results_decorators = [core.Input()];
1808
+ _maxItems_decorators = [core.Input()];
1809
+ _showMore_decorators = [core.Input()];
1810
+ _selectedFacets_decorators = [core.Input()];
1811
+ _facetChange_decorators = [core.Output()];
1812
+ __esDecorate(null, null, _results_decorators, { kind: "field", name: "results", static: false, private: false, access: { has: obj => "results" in obj, get: obj => obj.results, set: (obj, value) => { obj.results = value; } }, metadata: _metadata }, _results_initializers, _results_extraInitializers);
1813
+ __esDecorate(null, null, _maxItems_decorators, { kind: "field", name: "maxItems", static: false, private: false, access: { has: obj => "maxItems" in obj, get: obj => obj.maxItems, set: (obj, value) => { obj.maxItems = value; } }, metadata: _metadata }, _maxItems_initializers, _maxItems_extraInitializers);
1814
+ __esDecorate(null, null, _showMore_decorators, { kind: "field", name: "showMore", static: false, private: false, access: { has: obj => "showMore" in obj, get: obj => obj.showMore, set: (obj, value) => { obj.showMore = value; } }, metadata: _metadata }, _showMore_initializers, _showMore_extraInitializers);
1815
+ __esDecorate(null, null, _selectedFacets_decorators, { kind: "field", name: "selectedFacets", static: false, private: false, access: { has: obj => "selectedFacets" in obj, get: obj => obj.selectedFacets, set: (obj, value) => { obj.selectedFacets = value; } }, metadata: _metadata }, _selectedFacets_initializers, _selectedFacets_extraInitializers);
1816
+ __esDecorate(null, null, _facetChange_decorators, { kind: "field", name: "facetChange", static: false, private: false, access: { has: obj => "facetChange" in obj, get: obj => obj.facetChange, set: (obj, value) => { obj.facetChange = value; } }, metadata: _metadata }, _facetChange_initializers, _facetChange_extraInitializers);
1817
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1818
+ _classThis = _classDescriptor.value;
1819
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1820
+ __runInitializers(_classThis, _classExtraInitializers);
1821
+ })();
1822
+ return _classThis;
1823
+ })();
1824
+
1825
+ /**
1826
+ * CurrentRefinements Component
1827
+ *
1828
+ * Displays currently active filters/refinements with ability to clear them
1829
+ */
1830
+ let CurrentRefinementsComponent = (() => {
1831
+ let _classDecorators = [core.Component({
1832
+ selector: 'seekora-current-refinements',
1833
+ template: `
1834
+ <div *ngIf="refinements.length > 0" [style]="containerStyle">
1835
+ <div *ngIf="showLabel" [style]="labelStyle">{{ label }}</div>
1836
+ <div [style]="refinementsStyle">
1837
+ <div
1838
+ *ngFor="let refinement of refinements; let i = index"
1839
+ [style]="refinementStyle"
1840
+ >
1841
+ <span [style]="refinementTextStyle">
1842
+ {{ getRefinementLabel(refinement) }}
1843
+ </span>
1844
+ <button
1845
+ (click)="handleClear(refinement.field, refinement.value)"
1846
+ [style]="clearButtonStyle"
1847
+ >
1848
+ ×
1849
+ </button>
1850
+ </div>
1851
+ <button
1852
+ *ngIf="showClearAll"
1853
+ (click)="handleClearAll()"
1854
+ [style]="clearAllStyle"
1855
+ >
1856
+ Clear All
1857
+ </button>
1858
+ </div>
1859
+ </div>
1860
+ `,
1861
+ })];
1862
+ let _classDescriptor;
1863
+ let _classExtraInitializers = [];
1864
+ let _classThis;
1865
+ let _refinements_decorators;
1866
+ let _refinements_initializers = [];
1867
+ let _refinements_extraInitializers = [];
1868
+ let _showLabel_decorators;
1869
+ let _showLabel_initializers = [];
1870
+ let _showLabel_extraInitializers = [];
1871
+ let _label_decorators;
1872
+ let _label_initializers = [];
1873
+ let _label_extraInitializers = [];
1874
+ let _showClearAll_decorators;
1875
+ let _showClearAll_initializers = [];
1876
+ let _showClearAll_extraInitializers = [];
1877
+ let _refinementClear_decorators;
1878
+ let _refinementClear_initializers = [];
1879
+ let _refinementClear_extraInitializers = [];
1880
+ let _clearAll_decorators;
1881
+ let _clearAll_initializers = [];
1882
+ let _clearAll_extraInitializers = [];
1883
+ _classThis = class {
1884
+ constructor(searchContext) {
1885
+ this.searchContext = searchContext;
1886
+ this.refinements = __runInitializers(this, _refinements_initializers, []);
1887
+ this.showLabel = (__runInitializers(this, _refinements_extraInitializers), __runInitializers(this, _showLabel_initializers, true));
1888
+ this.label = (__runInitializers(this, _showLabel_extraInitializers), __runInitializers(this, _label_initializers, 'Active Filters'));
1889
+ this.showClearAll = (__runInitializers(this, _label_extraInitializers), __runInitializers(this, _showClearAll_initializers, true));
1890
+ this.refinementClear = (__runInitializers(this, _showClearAll_extraInitializers), __runInitializers(this, _refinementClear_initializers, new core.EventEmitter()));
1891
+ this.clearAll = (__runInitializers(this, _refinementClear_extraInitializers), __runInitializers(this, _clearAll_initializers, new core.EventEmitter()));
1892
+ __runInitializers(this, _clearAll_extraInitializers);
1893
+ this.searchContext = searchContext;
1894
+ }
1895
+ getRefinementLabel(refinement) {
1896
+ if (refinement.label)
1897
+ return refinement.label;
1898
+ return `${refinement.field}: ${refinement.value}`;
1899
+ }
1900
+ handleClear(field, value) {
1901
+ this.refinementClear.emit({ field, value });
1902
+ }
1903
+ handleClearAll() {
1904
+ this.clearAll.emit();
1905
+ }
1906
+ get containerStyle() {
1907
+ const theme = this.searchContext.theme;
1908
+ return {
1909
+ marginBottom: theme.spacing.medium,
1910
+ };
1911
+ }
1912
+ get labelStyle() {
1913
+ const theme = this.searchContext.theme;
1914
+ return {
1915
+ fontSize: theme.typography.fontSize.medium,
1916
+ fontWeight: theme.typography.fontWeight?.semibold || 600,
1917
+ marginBottom: theme.spacing.small,
1918
+ color: theme.colors.text,
1919
+ };
1920
+ }
1921
+ get refinementsStyle() {
1922
+ const theme = this.searchContext.theme;
1923
+ return {
1924
+ display: 'flex',
1925
+ flexWrap: 'wrap',
1926
+ gap: theme.spacing.small,
1927
+ alignItems: 'center',
1928
+ };
1929
+ }
1930
+ get refinementStyle() {
1931
+ const theme = this.searchContext.theme;
1932
+ return {
1933
+ display: 'flex',
1934
+ alignItems: 'center',
1935
+ gap: theme.spacing.small,
1936
+ padding: `${theme.spacing.small} ${theme.spacing.medium}`,
1937
+ backgroundColor: theme.colors.hover,
1938
+ border: `1px solid ${theme.colors.border}`,
1939
+ borderRadius: typeof theme.borderRadius === 'string'
1940
+ ? theme.borderRadius
1941
+ : theme.borderRadius.medium,
1942
+ };
1943
+ }
1944
+ get refinementTextStyle() {
1945
+ const theme = this.searchContext.theme;
1946
+ return {
1947
+ fontSize: theme.typography.fontSize.small,
1948
+ color: theme.colors.text,
1949
+ };
1950
+ }
1951
+ get clearButtonStyle() {
1952
+ const theme = this.searchContext.theme;
1953
+ return {
1954
+ backgroundColor: 'transparent',
1955
+ border: 'none',
1956
+ color: theme.colors.text,
1957
+ cursor: 'pointer',
1958
+ fontSize: theme.typography.fontSize.large,
1959
+ lineHeight: 1,
1960
+ padding: 0,
1961
+ marginLeft: theme.spacing.small,
1962
+ };
1963
+ }
1964
+ get clearAllStyle() {
1965
+ const theme = this.searchContext.theme;
1966
+ return {
1967
+ padding: `${theme.spacing.small} ${theme.spacing.medium}`,
1968
+ backgroundColor: theme.colors.primary,
1969
+ color: '#fff',
1970
+ border: 'none',
1971
+ borderRadius: typeof theme.borderRadius === 'string'
1972
+ ? theme.borderRadius
1973
+ : theme.borderRadius.medium,
1974
+ cursor: 'pointer',
1975
+ fontSize: theme.typography.fontSize.small,
1976
+ fontWeight: theme.typography.fontWeight?.medium || 500,
1977
+ };
1978
+ }
1979
+ };
1980
+ __setFunctionName(_classThis, "CurrentRefinementsComponent");
1981
+ (() => {
1982
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
1983
+ _refinements_decorators = [core.Input()];
1984
+ _showLabel_decorators = [core.Input()];
1985
+ _label_decorators = [core.Input()];
1986
+ _showClearAll_decorators = [core.Input()];
1987
+ _refinementClear_decorators = [core.Output()];
1988
+ _clearAll_decorators = [core.Output()];
1989
+ __esDecorate(null, null, _refinements_decorators, { kind: "field", name: "refinements", static: false, private: false, access: { has: obj => "refinements" in obj, get: obj => obj.refinements, set: (obj, value) => { obj.refinements = value; } }, metadata: _metadata }, _refinements_initializers, _refinements_extraInitializers);
1990
+ __esDecorate(null, null, _showLabel_decorators, { kind: "field", name: "showLabel", static: false, private: false, access: { has: obj => "showLabel" in obj, get: obj => obj.showLabel, set: (obj, value) => { obj.showLabel = value; } }, metadata: _metadata }, _showLabel_initializers, _showLabel_extraInitializers);
1991
+ __esDecorate(null, null, _label_decorators, { kind: "field", name: "label", static: false, private: false, access: { has: obj => "label" in obj, get: obj => obj.label, set: (obj, value) => { obj.label = value; } }, metadata: _metadata }, _label_initializers, _label_extraInitializers);
1992
+ __esDecorate(null, null, _showClearAll_decorators, { kind: "field", name: "showClearAll", static: false, private: false, access: { has: obj => "showClearAll" in obj, get: obj => obj.showClearAll, set: (obj, value) => { obj.showClearAll = value; } }, metadata: _metadata }, _showClearAll_initializers, _showClearAll_extraInitializers);
1993
+ __esDecorate(null, null, _refinementClear_decorators, { kind: "field", name: "refinementClear", static: false, private: false, access: { has: obj => "refinementClear" in obj, get: obj => obj.refinementClear, set: (obj, value) => { obj.refinementClear = value; } }, metadata: _metadata }, _refinementClear_initializers, _refinementClear_extraInitializers);
1994
+ __esDecorate(null, null, _clearAll_decorators, { kind: "field", name: "clearAll", static: false, private: false, access: { has: obj => "clearAll" in obj, get: obj => obj.clearAll, set: (obj, value) => { obj.clearAll = value; } }, metadata: _metadata }, _clearAll_initializers, _clearAll_extraInitializers);
1995
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1996
+ _classThis = _classDescriptor.value;
1997
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1998
+ __runInitializers(_classThis, _classExtraInitializers);
1999
+ })();
2000
+ return _classThis;
2001
+ })();
2002
+
2003
+ /**
2004
+ * RangeInput Component
2005
+ *
2006
+ * Displays a range input for filtering numeric values (e.g., price range)
2007
+ */
2008
+ let RangeInputComponent = (() => {
2009
+ let _classDecorators = [core.Component({
2010
+ selector: 'seekora-range-input',
2011
+ template: `
2012
+ <div [style]="getContainerStyle()">
2013
+ <label *ngIf="label" [style]="getLabelStyle()">
2014
+ {{ label }}
2015
+ </label>
2016
+ <div [style]="getInputGroupStyle()">
2017
+ <input
2018
+ type="number"
2019
+ [min]="min"
2020
+ [max]="max"
2021
+ [step]="step"
2022
+ [value]="currentMin !== undefined ? currentMin : ''"
2023
+ (input)="onMinChange($event)"
2024
+ [placeholder]="placeholder?.min || 'Min'"
2025
+ [style]="getInputStyle()"
2026
+ />
2027
+ <span [style]="getSeparatorStyle()">to</span>
2028
+ <input
2029
+ type="number"
2030
+ [min]="min"
2031
+ [max]="max"
2032
+ [step]="step"
2033
+ [value]="currentMax !== undefined ? currentMax : ''"
2034
+ (input)="onMaxChange($event)"
2035
+ [placeholder]="placeholder?.max || 'Max'"
2036
+ [style]="getInputStyle()"
2037
+ />
2038
+ <button
2039
+ *ngIf="showApplyButton"
2040
+ type="button"
2041
+ (click)="onApply()"
2042
+ [style]="getApplyButtonStyle()"
2043
+ >
2044
+ Apply
2045
+ </button>
2046
+ <button
2047
+ *ngIf="hasValue()"
2048
+ type="button"
2049
+ (click)="onReset()"
2050
+ [style]="getResetButtonStyle()"
2051
+ >
2052
+ Reset
2053
+ </button>
2054
+ </div>
2055
+ </div>
2056
+ `,
2057
+ })];
2058
+ let _classDescriptor;
2059
+ let _classExtraInitializers = [];
2060
+ let _classThis;
2061
+ let _field_decorators;
2062
+ let _field_initializers = [];
2063
+ let _field_extraInitializers = [];
2064
+ let _label_decorators;
2065
+ let _label_initializers = [];
2066
+ let _label_extraInitializers = [];
2067
+ let _min_decorators;
2068
+ let _min_initializers = [];
2069
+ let _min_extraInitializers = [];
2070
+ let _max_decorators;
2071
+ let _max_initializers = [];
2072
+ let _max_extraInitializers = [];
2073
+ let _step_decorators;
2074
+ let _step_initializers = [];
2075
+ let _step_extraInitializers = [];
2076
+ let _currentMin_decorators;
2077
+ let _currentMin_initializers = [];
2078
+ let _currentMin_extraInitializers = [];
2079
+ let _currentMax_decorators;
2080
+ let _currentMax_initializers = [];
2081
+ let _currentMax_extraInitializers = [];
2082
+ let _showApplyButton_decorators;
2083
+ let _showApplyButton_initializers = [];
2084
+ let _showApplyButton_extraInitializers = [];
2085
+ let _placeholder_decorators;
2086
+ let _placeholder_initializers = [];
2087
+ let _placeholder_extraInitializers = [];
2088
+ let _className_decorators;
2089
+ let _className_initializers = [];
2090
+ let _className_extraInitializers = [];
2091
+ let _style_decorators;
2092
+ let _style_initializers = [];
2093
+ let _style_extraInitializers = [];
2094
+ let _rangeChange_decorators;
2095
+ let _rangeChange_initializers = [];
2096
+ let _rangeChange_extraInitializers = [];
2097
+ _classThis = class {
2098
+ constructor(searchContext) {
2099
+ this.searchContext = searchContext;
2100
+ this.field = __runInitializers(this, _field_initializers, void 0);
2101
+ this.label = (__runInitializers(this, _field_extraInitializers), __runInitializers(this, _label_initializers, void 0));
2102
+ this.min = (__runInitializers(this, _label_extraInitializers), __runInitializers(this, _min_initializers, void 0));
2103
+ this.max = (__runInitializers(this, _min_extraInitializers), __runInitializers(this, _max_initializers, void 0));
2104
+ this.step = (__runInitializers(this, _max_extraInitializers), __runInitializers(this, _step_initializers, 1));
2105
+ this.currentMin = (__runInitializers(this, _step_extraInitializers), __runInitializers(this, _currentMin_initializers, void 0));
2106
+ this.currentMax = (__runInitializers(this, _currentMin_extraInitializers), __runInitializers(this, _currentMax_initializers, void 0));
2107
+ this.showApplyButton = (__runInitializers(this, _currentMax_extraInitializers), __runInitializers(this, _showApplyButton_initializers, true));
2108
+ this.placeholder = (__runInitializers(this, _showApplyButton_extraInitializers), __runInitializers(this, _placeholder_initializers, void 0));
2109
+ this.className = (__runInitializers(this, _placeholder_extraInitializers), __runInitializers(this, _className_initializers, void 0));
2110
+ this.style = (__runInitializers(this, _className_extraInitializers), __runInitializers(this, _style_initializers, void 0));
2111
+ this.rangeChange = (__runInitializers(this, _style_extraInitializers), __runInitializers(this, _rangeChange_initializers, new core.EventEmitter()));
2112
+ this.internalMin = __runInitializers(this, _rangeChange_extraInitializers);
2113
+ }
2114
+ ngOnInit() {
2115
+ this.internalMin = this.currentMin;
2116
+ this.internalMax = this.currentMax;
2117
+ this.appliedMin = this.currentMin;
2118
+ this.appliedMax = this.currentMax;
2119
+ }
2120
+ get theme() {
2121
+ return this.searchContext.theme;
2122
+ }
2123
+ get effectiveMin() {
2124
+ return this.currentMin !== undefined ? this.currentMin : this.internalMin;
2125
+ }
2126
+ get effectiveMax() {
2127
+ return this.currentMax !== undefined ? this.currentMax : this.internalMax;
2128
+ }
2129
+ hasValue() {
2130
+ return this.effectiveMin !== undefined || this.effectiveMax !== undefined;
2131
+ }
2132
+ onMinChange(event) {
2133
+ const target = event.target;
2134
+ const value = target.value === '' ? undefined : parseFloat(target.value);
2135
+ this.internalMin = value;
2136
+ if (!this.showApplyButton) {
2137
+ this.rangeChange.emit({ min: value, max: this.effectiveMax });
2138
+ }
2139
+ }
2140
+ onMaxChange(event) {
2141
+ const target = event.target;
2142
+ const value = target.value === '' ? undefined : parseFloat(target.value);
2143
+ this.internalMax = value;
2144
+ if (!this.showApplyButton) {
2145
+ this.rangeChange.emit({ min: this.effectiveMin, max: value });
2146
+ }
2147
+ }
2148
+ onApply() {
2149
+ this.appliedMin = this.internalMin;
2150
+ this.appliedMax = this.internalMax;
2151
+ this.rangeChange.emit({ min: this.internalMin, max: this.internalMax });
2152
+ }
2153
+ onReset() {
2154
+ this.internalMin = undefined;
2155
+ this.internalMax = undefined;
2156
+ this.appliedMin = undefined;
2157
+ this.appliedMax = undefined;
2158
+ this.rangeChange.emit({ min: undefined, max: undefined });
2159
+ }
2160
+ getContainerStyle() {
2161
+ return {
2162
+ ...this.style,
2163
+ };
2164
+ }
2165
+ getLabelStyle() {
2166
+ return {
2167
+ fontSize: this.theme.typography.fontSize.medium,
2168
+ color: this.theme.colors.text,
2169
+ fontWeight: this.theme.typography.fontWeight?.medium || 500,
2170
+ marginBottom: this.theme.spacing.small,
2171
+ display: 'block',
2172
+ };
2173
+ }
2174
+ getInputGroupStyle() {
2175
+ return {
2176
+ display: 'flex',
2177
+ alignItems: 'center',
2178
+ gap: this.theme.spacing.small,
2179
+ flexWrap: 'wrap',
2180
+ };
2181
+ }
2182
+ getInputStyle() {
2183
+ const borderRadius = typeof this.theme.borderRadius === 'string'
2184
+ ? this.theme.borderRadius
2185
+ : this.theme.borderRadius.medium;
2186
+ return {
2187
+ padding: this.theme.spacing.small,
2188
+ fontSize: this.theme.typography.fontSize.medium,
2189
+ border: `1px solid ${this.theme.colors.border}`,
2190
+ borderRadius,
2191
+ backgroundColor: this.theme.colors.background,
2192
+ color: this.theme.colors.text,
2193
+ outline: 'none',
2194
+ flex: 1,
2195
+ minWidth: '80px',
2196
+ };
2197
+ }
2198
+ getSeparatorStyle() {
2199
+ return {
2200
+ color: this.theme.colors.textSecondary || this.theme.colors.text,
2201
+ fontSize: this.theme.typography.fontSize.medium,
2202
+ };
2203
+ }
2204
+ getApplyButtonStyle() {
2205
+ const borderRadius = typeof this.theme.borderRadius === 'string'
2206
+ ? this.theme.borderRadius
2207
+ : this.theme.borderRadius.medium;
2208
+ return {
2209
+ padding: `${this.theme.spacing.small} ${this.theme.spacing.medium}`,
2210
+ fontSize: this.theme.typography.fontSize.medium,
2211
+ backgroundColor: this.theme.colors.primary,
2212
+ color: '#ffffff',
2213
+ border: 'none',
2214
+ borderRadius,
2215
+ cursor: 'pointer',
2216
+ transition: this.theme.transitions?.fast || '150ms ease-in-out',
2217
+ };
2218
+ }
2219
+ getResetButtonStyle() {
2220
+ const borderRadius = typeof this.theme.borderRadius === 'string'
2221
+ ? this.theme.borderRadius
2222
+ : this.theme.borderRadius.medium;
2223
+ return {
2224
+ padding: `${this.theme.spacing.small} ${this.theme.spacing.medium}`,
2225
+ fontSize: this.theme.typography.fontSize.medium,
2226
+ backgroundColor: 'transparent',
2227
+ color: this.theme.colors.text,
2228
+ border: `1px solid ${this.theme.colors.border}`,
2229
+ borderRadius,
2230
+ cursor: 'pointer',
2231
+ transition: this.theme.transitions?.fast || '150ms ease-in-out',
2232
+ };
2233
+ }
2234
+ };
2235
+ __setFunctionName(_classThis, "RangeInputComponent");
2236
+ (() => {
2237
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
2238
+ _field_decorators = [core.Input()];
2239
+ _label_decorators = [core.Input()];
2240
+ _min_decorators = [core.Input()];
2241
+ _max_decorators = [core.Input()];
2242
+ _step_decorators = [core.Input()];
2243
+ _currentMin_decorators = [core.Input()];
2244
+ _currentMax_decorators = [core.Input()];
2245
+ _showApplyButton_decorators = [core.Input()];
2246
+ _placeholder_decorators = [core.Input()];
2247
+ _className_decorators = [core.Input()];
2248
+ _style_decorators = [core.Input()];
2249
+ _rangeChange_decorators = [core.Output()];
2250
+ __esDecorate(null, null, _field_decorators, { kind: "field", name: "field", static: false, private: false, access: { has: obj => "field" in obj, get: obj => obj.field, set: (obj, value) => { obj.field = value; } }, metadata: _metadata }, _field_initializers, _field_extraInitializers);
2251
+ __esDecorate(null, null, _label_decorators, { kind: "field", name: "label", static: false, private: false, access: { has: obj => "label" in obj, get: obj => obj.label, set: (obj, value) => { obj.label = value; } }, metadata: _metadata }, _label_initializers, _label_extraInitializers);
2252
+ __esDecorate(null, null, _min_decorators, { kind: "field", name: "min", static: false, private: false, access: { has: obj => "min" in obj, get: obj => obj.min, set: (obj, value) => { obj.min = value; } }, metadata: _metadata }, _min_initializers, _min_extraInitializers);
2253
+ __esDecorate(null, null, _max_decorators, { kind: "field", name: "max", static: false, private: false, access: { has: obj => "max" in obj, get: obj => obj.max, set: (obj, value) => { obj.max = value; } }, metadata: _metadata }, _max_initializers, _max_extraInitializers);
2254
+ __esDecorate(null, null, _step_decorators, { kind: "field", name: "step", static: false, private: false, access: { has: obj => "step" in obj, get: obj => obj.step, set: (obj, value) => { obj.step = value; } }, metadata: _metadata }, _step_initializers, _step_extraInitializers);
2255
+ __esDecorate(null, null, _currentMin_decorators, { kind: "field", name: "currentMin", static: false, private: false, access: { has: obj => "currentMin" in obj, get: obj => obj.currentMin, set: (obj, value) => { obj.currentMin = value; } }, metadata: _metadata }, _currentMin_initializers, _currentMin_extraInitializers);
2256
+ __esDecorate(null, null, _currentMax_decorators, { kind: "field", name: "currentMax", static: false, private: false, access: { has: obj => "currentMax" in obj, get: obj => obj.currentMax, set: (obj, value) => { obj.currentMax = value; } }, metadata: _metadata }, _currentMax_initializers, _currentMax_extraInitializers);
2257
+ __esDecorate(null, null, _showApplyButton_decorators, { kind: "field", name: "showApplyButton", static: false, private: false, access: { has: obj => "showApplyButton" in obj, get: obj => obj.showApplyButton, set: (obj, value) => { obj.showApplyButton = value; } }, metadata: _metadata }, _showApplyButton_initializers, _showApplyButton_extraInitializers);
2258
+ __esDecorate(null, null, _placeholder_decorators, { kind: "field", name: "placeholder", static: false, private: false, access: { has: obj => "placeholder" in obj, get: obj => obj.placeholder, set: (obj, value) => { obj.placeholder = value; } }, metadata: _metadata }, _placeholder_initializers, _placeholder_extraInitializers);
2259
+ __esDecorate(null, null, _className_decorators, { kind: "field", name: "className", static: false, private: false, access: { has: obj => "className" in obj, get: obj => obj.className, set: (obj, value) => { obj.className = value; } }, metadata: _metadata }, _className_initializers, _className_extraInitializers);
2260
+ __esDecorate(null, null, _style_decorators, { kind: "field", name: "style", static: false, private: false, access: { has: obj => "style" in obj, get: obj => obj.style, set: (obj, value) => { obj.style = value; } }, metadata: _metadata }, _style_initializers, _style_extraInitializers);
2261
+ __esDecorate(null, null, _rangeChange_decorators, { kind: "field", name: "rangeChange", static: false, private: false, access: { has: obj => "rangeChange" in obj, get: obj => obj.rangeChange, set: (obj, value) => { obj.rangeChange = value; } }, metadata: _metadata }, _rangeChange_initializers, _rangeChange_extraInitializers);
2262
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2263
+ _classThis = _classDescriptor.value;
2264
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2265
+ __runInitializers(_classThis, _classExtraInitializers);
2266
+ })();
2267
+ return _classThis;
2268
+ })();
2269
+
2270
+ /**
2271
+ * SearchLayout Component
2272
+ *
2273
+ * Provides a layout structure for search interfaces with sidebar and main content
2274
+ */
2275
+ let SearchLayoutComponent = (() => {
2276
+ let _classDecorators = [core.Component({
2277
+ selector: 'seekora-search-layout',
2278
+ template: `
2279
+ <div [style]="getContainerStyle()">
2280
+ <header
2281
+ *ngIf="header || headerTemplate"
2282
+ [style]="getHeaderStyle()"
2283
+ >
2284
+ <ng-container *ngTemplateOutlet="headerTemplate || defaultHeaderTemplate"></ng-container>
2285
+ <ng-template #defaultHeaderTemplate>
2286
+ <ng-content select="[header]"></ng-content>
2287
+ </ng-template>
2288
+ </header>
2289
+
2290
+ <div [style]="getContentStyle()">
2291
+ <aside
2292
+ *ngIf="sidebar || sidebarTemplate"
2293
+ [style]="getSidebarStyle()"
2294
+ [class]="getSidebarClass()"
2295
+ >
2296
+ <ng-container *ngTemplateOutlet="sidebarTemplate || defaultSidebarTemplate"></ng-container>
2297
+ <ng-template #defaultSidebarTemplate>
2298
+ <ng-content select="[sidebar]"></ng-content>
2299
+ </ng-template>
2300
+ </aside>
2301
+
2302
+ <main [style]="getMainStyle()">
2303
+ <ng-content></ng-content>
2304
+ </main>
2305
+ </div>
2306
+
2307
+ <footer
2308
+ *ngIf="footer || footerTemplate"
2309
+ [style]="getFooterStyle()"
2310
+ >
2311
+ <ng-container *ngTemplateOutlet="footerTemplate || defaultFooterTemplate"></ng-container>
2312
+ <ng-template #defaultFooterTemplate>
2313
+ <ng-content select="[footer]"></ng-content>
2314
+ </ng-template>
2315
+ </footer>
2316
+ </div>
2317
+ `,
2318
+ styles: [`
2319
+ @media (max-width: 768px) {
2320
+ .search-layout-sidebar-hidden-mobile {
2321
+ display: none;
2322
+ }
2323
+ }
2324
+ `]
2325
+ })];
2326
+ let _classDescriptor;
2327
+ let _classExtraInitializers = [];
2328
+ let _classThis;
2329
+ let _sidebar_decorators;
2330
+ let _sidebar_initializers = [];
2331
+ let _sidebar_extraInitializers = [];
2332
+ let _header_decorators;
2333
+ let _header_initializers = [];
2334
+ let _header_extraInitializers = [];
2335
+ let _footer_decorators;
2336
+ let _footer_initializers = [];
2337
+ let _footer_extraInitializers = [];
2338
+ let _sidebarWidth_decorators;
2339
+ let _sidebarWidth_initializers = [];
2340
+ let _sidebarWidth_extraInitializers = [];
2341
+ let _showSidebarOnMobile_decorators;
2342
+ let _showSidebarOnMobile_initializers = [];
2343
+ let _showSidebarOnMobile_extraInitializers = [];
2344
+ let _className_decorators;
2345
+ let _className_initializers = [];
2346
+ let _className_extraInitializers = [];
2347
+ let _style_decorators;
2348
+ let _style_initializers = [];
2349
+ let _style_extraInitializers = [];
2350
+ let _headerTemplate_decorators;
2351
+ let _headerTemplate_initializers = [];
2352
+ let _headerTemplate_extraInitializers = [];
2353
+ let _sidebarTemplate_decorators;
2354
+ let _sidebarTemplate_initializers = [];
2355
+ let _sidebarTemplate_extraInitializers = [];
2356
+ let _footerTemplate_decorators;
2357
+ let _footerTemplate_initializers = [];
2358
+ let _footerTemplate_extraInitializers = [];
2359
+ _classThis = class {
2360
+ constructor(searchContext) {
2361
+ this.searchContext = searchContext;
2362
+ this.sidebar = __runInitializers(this, _sidebar_initializers, void 0);
2363
+ this.header = (__runInitializers(this, _sidebar_extraInitializers), __runInitializers(this, _header_initializers, void 0));
2364
+ this.footer = (__runInitializers(this, _header_extraInitializers), __runInitializers(this, _footer_initializers, void 0));
2365
+ this.sidebarWidth = (__runInitializers(this, _footer_extraInitializers), __runInitializers(this, _sidebarWidth_initializers, '300px'));
2366
+ this.showSidebarOnMobile = (__runInitializers(this, _sidebarWidth_extraInitializers), __runInitializers(this, _showSidebarOnMobile_initializers, false));
2367
+ this.className = (__runInitializers(this, _showSidebarOnMobile_extraInitializers), __runInitializers(this, _className_initializers, void 0));
2368
+ this.style = (__runInitializers(this, _className_extraInitializers), __runInitializers(this, _style_initializers, void 0));
2369
+ this.headerTemplate = (__runInitializers(this, _style_extraInitializers), __runInitializers(this, _headerTemplate_initializers, void 0));
2370
+ this.sidebarTemplate = (__runInitializers(this, _headerTemplate_extraInitializers), __runInitializers(this, _sidebarTemplate_initializers, void 0));
2371
+ this.footerTemplate = (__runInitializers(this, _sidebarTemplate_extraInitializers), __runInitializers(this, _footerTemplate_initializers, void 0));
2372
+ __runInitializers(this, _footerTemplate_extraInitializers);
2373
+ this.searchContext = searchContext;
2374
+ }
2375
+ get theme() {
2376
+ return this.searchContext.theme;
2377
+ }
2378
+ getContainerStyle() {
2379
+ return {
2380
+ display: 'flex',
2381
+ flexDirection: 'column',
2382
+ minHeight: '100vh',
2383
+ backgroundColor: this.theme.colors.background,
2384
+ ...this.style,
2385
+ };
2386
+ }
2387
+ getHeaderStyle() {
2388
+ return {
2389
+ padding: this.theme.spacing.medium,
2390
+ borderBottom: `1px solid ${this.theme.colors.border}`,
2391
+ backgroundColor: this.theme.colors.background,
2392
+ };
2393
+ }
2394
+ getContentStyle() {
2395
+ return {
2396
+ display: 'flex',
2397
+ flex: 1,
2398
+ gap: this.theme.spacing.large,
2399
+ padding: this.theme.spacing.medium,
2400
+ };
2401
+ }
2402
+ getSidebarStyle() {
2403
+ return {
2404
+ width: this.sidebarWidth,
2405
+ minWidth: this.sidebarWidth,
2406
+ };
2407
+ }
2408
+ getSidebarClass() {
2409
+ return this.showSidebarOnMobile ? '' : 'search-layout-sidebar-hidden-mobile';
2410
+ }
2411
+ getMainStyle() {
2412
+ return {
2413
+ flex: 1,
2414
+ minWidth: 0,
2415
+ };
2416
+ }
2417
+ getFooterStyle() {
2418
+ return {
2419
+ padding: this.theme.spacing.medium,
2420
+ borderTop: `1px solid ${this.theme.colors.border}`,
2421
+ backgroundColor: this.theme.colors.background,
2422
+ };
2423
+ }
2424
+ };
2425
+ __setFunctionName(_classThis, "SearchLayoutComponent");
2426
+ (() => {
2427
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
2428
+ _sidebar_decorators = [core.Input()];
2429
+ _header_decorators = [core.Input()];
2430
+ _footer_decorators = [core.Input()];
2431
+ _sidebarWidth_decorators = [core.Input()];
2432
+ _showSidebarOnMobile_decorators = [core.Input()];
2433
+ _className_decorators = [core.Input()];
2434
+ _style_decorators = [core.Input()];
2435
+ _headerTemplate_decorators = [core.ContentChild('headerTemplate')];
2436
+ _sidebarTemplate_decorators = [core.ContentChild('sidebarTemplate')];
2437
+ _footerTemplate_decorators = [core.ContentChild('footerTemplate')];
2438
+ __esDecorate(null, null, _sidebar_decorators, { kind: "field", name: "sidebar", static: false, private: false, access: { has: obj => "sidebar" in obj, get: obj => obj.sidebar, set: (obj, value) => { obj.sidebar = value; } }, metadata: _metadata }, _sidebar_initializers, _sidebar_extraInitializers);
2439
+ __esDecorate(null, null, _header_decorators, { kind: "field", name: "header", static: false, private: false, access: { has: obj => "header" in obj, get: obj => obj.header, set: (obj, value) => { obj.header = value; } }, metadata: _metadata }, _header_initializers, _header_extraInitializers);
2440
+ __esDecorate(null, null, _footer_decorators, { kind: "field", name: "footer", static: false, private: false, access: { has: obj => "footer" in obj, get: obj => obj.footer, set: (obj, value) => { obj.footer = value; } }, metadata: _metadata }, _footer_initializers, _footer_extraInitializers);
2441
+ __esDecorate(null, null, _sidebarWidth_decorators, { kind: "field", name: "sidebarWidth", static: false, private: false, access: { has: obj => "sidebarWidth" in obj, get: obj => obj.sidebarWidth, set: (obj, value) => { obj.sidebarWidth = value; } }, metadata: _metadata }, _sidebarWidth_initializers, _sidebarWidth_extraInitializers);
2442
+ __esDecorate(null, null, _showSidebarOnMobile_decorators, { kind: "field", name: "showSidebarOnMobile", static: false, private: false, access: { has: obj => "showSidebarOnMobile" in obj, get: obj => obj.showSidebarOnMobile, set: (obj, value) => { obj.showSidebarOnMobile = value; } }, metadata: _metadata }, _showSidebarOnMobile_initializers, _showSidebarOnMobile_extraInitializers);
2443
+ __esDecorate(null, null, _className_decorators, { kind: "field", name: "className", static: false, private: false, access: { has: obj => "className" in obj, get: obj => obj.className, set: (obj, value) => { obj.className = value; } }, metadata: _metadata }, _className_initializers, _className_extraInitializers);
2444
+ __esDecorate(null, null, _style_decorators, { kind: "field", name: "style", static: false, private: false, access: { has: obj => "style" in obj, get: obj => obj.style, set: (obj, value) => { obj.style = value; } }, metadata: _metadata }, _style_initializers, _style_extraInitializers);
2445
+ __esDecorate(null, null, _headerTemplate_decorators, { kind: "field", name: "headerTemplate", static: false, private: false, access: { has: obj => "headerTemplate" in obj, get: obj => obj.headerTemplate, set: (obj, value) => { obj.headerTemplate = value; } }, metadata: _metadata }, _headerTemplate_initializers, _headerTemplate_extraInitializers);
2446
+ __esDecorate(null, null, _sidebarTemplate_decorators, { kind: "field", name: "sidebarTemplate", static: false, private: false, access: { has: obj => "sidebarTemplate" in obj, get: obj => obj.sidebarTemplate, set: (obj, value) => { obj.sidebarTemplate = value; } }, metadata: _metadata }, _sidebarTemplate_initializers, _sidebarTemplate_extraInitializers);
2447
+ __esDecorate(null, null, _footerTemplate_decorators, { kind: "field", name: "footerTemplate", static: false, private: false, access: { has: obj => "footerTemplate" in obj, get: obj => obj.footerTemplate, set: (obj, value) => { obj.footerTemplate = value; } }, metadata: _metadata }, _footerTemplate_initializers, _footerTemplate_extraInitializers);
2448
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2449
+ _classThis = _classDescriptor.value;
2450
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2451
+ __runInitializers(_classThis, _classExtraInitializers);
2452
+ })();
2453
+ return _classThis;
2454
+ })();
2455
+
2456
+ /**
2457
+ * Dark Theme
2458
+ */
2459
+ const darkTheme = {
2460
+ colors: {
2461
+ primary: '#0d6efd',
2462
+ secondary: '#6c757d',
2463
+ background: '#1a1a1a',
2464
+ text: '#ffffff',
2465
+ border: '#333333',
2466
+ hover: '#2a2a2a',
2467
+ focus: '#0d6efd',
2468
+ error: '#dc3545',
2469
+ },
2470
+ typography: {
2471
+ fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
2472
+ fontSize: {
2473
+ small: '0.875rem',
2474
+ medium: '1rem',
2475
+ large: '1.25rem',
2476
+ },
2477
+ },
2478
+ spacing: {
2479
+ small: '0.5rem',
2480
+ medium: '1rem',
2481
+ large: '1.5rem',
2482
+ },
2483
+ borderRadius: '0.25rem',
2484
+ shadows: {
2485
+ small: '0 1px 3px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.7)',
2486
+ medium: '0 3px 6px rgba(0, 0, 0, 0.6), 0 3px 6px rgba(0, 0, 0, 0.8)',
2487
+ large: '0 10px 20px rgba(0, 0, 0, 0.7), 0 6px 6px rgba(0, 0, 0, 0.9)',
2488
+ },
2489
+ };
2490
+
2491
+ /**
2492
+ * Minimal Theme
2493
+ */
2494
+ const minimalTheme = {
2495
+ colors: {
2496
+ primary: '#000000',
2497
+ secondary: '#666666',
2498
+ background: '#ffffff',
2499
+ text: '#000000',
2500
+ border: '#e0e0e0',
2501
+ hover: '#f5f5f5',
2502
+ focus: '#000000',
2503
+ error: '#cc0000',
2504
+ },
2505
+ typography: {
2506
+ fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
2507
+ fontSize: {
2508
+ small: '0.875rem',
2509
+ medium: '1rem',
2510
+ large: '1.125rem',
2511
+ },
2512
+ },
2513
+ spacing: {
2514
+ small: '0.5rem',
2515
+ medium: '0.75rem',
2516
+ large: '1rem',
2517
+ },
2518
+ borderRadius: '0',
2519
+ shadows: {
2520
+ small: 'none',
2521
+ medium: 'none',
2522
+ large: 'none',
2523
+ },
2524
+ };
2525
+
2526
+ Object.defineProperty(exports, "mergeThemes", {
2527
+ enumerable: true,
2528
+ get: function () { return uiSdkCore.mergeThemes; }
2529
+ });
2530
+ exports.CurrentRefinementsComponent = CurrentRefinementsComponent;
2531
+ exports.FacetsComponent = FacetsComponent;
2532
+ exports.PaginationComponent = PaginationComponent;
2533
+ exports.QuerySuggestionsComponent = QuerySuggestionsComponent;
2534
+ exports.QuerySuggestionsService = QuerySuggestionsService;
2535
+ exports.RangeInputComponent = RangeInputComponent;
2536
+ exports.SEEKORA_CLIENT = SEEKORA_CLIENT;
2537
+ exports.SEEKORA_THEME_CONFIG = SEEKORA_THEME_CONFIG;
2538
+ exports.SearchBarComponent = SearchBarComponent;
2539
+ exports.SearchContextService = SearchContextService;
2540
+ exports.SearchLayoutComponent = SearchLayoutComponent;
2541
+ exports.SearchProviderComponent = SearchProviderComponent;
2542
+ exports.SearchResultsComponent = SearchResultsComponent;
2543
+ exports.SeekoraSearchService = SeekoraSearchService;
2544
+ exports.SortByComponent = SortByComponent;
2545
+ exports.StatsComponent = StatsComponent;
2546
+ exports.createTheme = createTheme;
2547
+ exports.darkTheme = darkTheme;
2548
+ exports.defaultTheme = defaultTheme;
2549
+ exports.minimalTheme = minimalTheme;
2550
+ //# sourceMappingURL=index.js.map