@admin-layout/demo-perplexity-browser 12.2.4-alpha.1 → 12.2.4-alpha.100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/lib/api/index.d.ts +2 -0
  2. package/lib/api/index.d.ts.map +1 -0
  3. package/lib/api/llm.d.ts +34 -0
  4. package/lib/api/llm.d.ts.map +1 -0
  5. package/lib/api/llm.js +200 -0
  6. package/lib/api/llm.js.map +1 -0
  7. package/lib/api/stt.d.ts +21 -0
  8. package/lib/api/stt.d.ts.map +1 -0
  9. package/lib/api/stt.js +111 -0
  10. package/lib/api/stt.js.map +1 -0
  11. package/lib/components/AttachmentPreview.d.ts +10 -0
  12. package/lib/components/AttachmentPreview.d.ts.map +1 -0
  13. package/lib/components/AttachmentPreview.js +50 -0
  14. package/lib/components/AttachmentPreview.js.map +1 -0
  15. package/lib/components/AudioRecorder.d.ts +8 -0
  16. package/lib/components/AudioRecorder.d.ts.map +1 -0
  17. package/lib/components/AudioRecorder.js +221 -0
  18. package/lib/components/AudioRecorder.js.map +1 -0
  19. package/lib/components/AudioVisualizer.d.ts +7 -0
  20. package/lib/components/AudioVisualizer.d.ts.map +1 -0
  21. package/lib/components/AudioVisualizer.js +116 -0
  22. package/lib/components/AudioVisualizer.js.map +1 -0
  23. package/lib/components/ChatFiles.d.ts +8 -0
  24. package/lib/components/ChatFiles.d.ts.map +1 -0
  25. package/lib/components/ChatFiles.js +76 -0
  26. package/lib/components/ChatFiles.js.map +1 -0
  27. package/lib/components/ChatScreenshot.d.ts +7 -0
  28. package/lib/components/ChatScreenshot.d.ts.map +1 -0
  29. package/lib/components/ChatScreenshot.js +113 -0
  30. package/lib/components/ChatScreenshot.js.map +1 -0
  31. package/lib/components/SearchBar.d.ts +18 -1
  32. package/lib/components/SearchBar.d.ts.map +1 -1
  33. package/lib/components/SearchBar.js +184 -240
  34. package/lib/components/SearchBar.js.map +1 -1
  35. package/lib/config/constants.d.ts +108 -0
  36. package/lib/config/constants.d.ts.map +1 -0
  37. package/lib/config/constants.js +115 -0
  38. package/lib/config/constants.js.map +1 -0
  39. package/lib/config/env.d.ts +20 -0
  40. package/lib/config/env.d.ts.map +1 -0
  41. package/lib/config/env.js +22 -0
  42. package/lib/config/env.js.map +1 -0
  43. package/lib/config/index.d.ts +4 -0
  44. package/lib/config/index.d.ts.map +1 -0
  45. package/lib/config/providers.d.ts +54 -0
  46. package/lib/config/providers.d.ts.map +1 -0
  47. package/lib/config/providers.js +65 -0
  48. package/lib/config/providers.js.map +1 -0
  49. package/lib/pages/home/HomePage.d.ts +1 -3
  50. package/lib/pages/home/HomePage.d.ts.map +1 -1
  51. package/lib/pages/home/HomePage.js +288 -4
  52. package/lib/pages/home/HomePage.js.map +1 -1
  53. package/lib/platform/browser.d.ts +18 -0
  54. package/lib/platform/browser.d.ts.map +1 -0
  55. package/lib/platform/context.d.ts +76 -0
  56. package/lib/platform/context.d.ts.map +1 -0
  57. package/lib/platform/index.d.ts +25 -0
  58. package/lib/platform/index.d.ts.map +1 -0
  59. package/lib/platform/tauri.d.ts +35 -0
  60. package/lib/platform/tauri.d.ts.map +1 -0
  61. package/lib/platform/types.d.ts +164 -0
  62. package/lib/platform/types.d.ts.map +1 -0
  63. package/lib/state/chatMachine.d.ts +148 -0
  64. package/lib/state/chatMachine.d.ts.map +1 -0
  65. package/lib/state/chatMachine.js +458 -0
  66. package/lib/state/chatMachine.js.map +1 -0
  67. package/lib/state/index.d.ts +3 -0
  68. package/lib/state/index.d.ts.map +1 -0
  69. package/lib/state/useChatWithPlatform.d.ts +43 -0
  70. package/lib/state/useChatWithPlatform.d.ts.map +1 -0
  71. package/lib/types/chat.d.ts +56 -0
  72. package/lib/types/chat.d.ts.map +1 -0
  73. package/lib/types/index.d.ts +2 -0
  74. package/lib/types/index.d.ts.map +1 -0
  75. package/lib/utils/chatStorage.d.ts +25 -0
  76. package/lib/utils/chatStorage.d.ts.map +1 -0
  77. package/lib/utils/chatStorage.js +17 -0
  78. package/lib/utils/chatStorage.js.map +1 -0
  79. package/package.json +11 -7
@@ -0,0 +1,115 @@
1
+ /**
2
+ * Perplexity Demo Module Configuration
3
+ */
4
+ // ============= Storage Keys =============
5
+ // ============= File Constraints =============
6
+ // Max number of files that can be attached to a message
7
+ const MAX_FILES = 6;
8
+ // Max file size in bytes (15MB)
9
+ const MAX_FILE_SIZE_BYTES = 15 * 1024 * 1024;
10
+ // Accepted file types
11
+ const ACCEPTED_FILE_TYPES = {
12
+ DOCUMENTS: ['.pdf', '.doc', '.docx', '.txt', '.md'],
13
+ IMAGES: ['.png', '.jpg', '.jpeg', '.gif', '.webp']
14
+ };
15
+ // Combined accepted file types for file input
16
+ const ACCEPTED_FILE_TYPES_STRING = [...ACCEPTED_FILE_TYPES.DOCUMENTS, ...ACCEPTED_FILE_TYPES.IMAGES].join(',');
17
+ // ============= LLM Configuration =============
18
+ /**
19
+ * Centralized LLM Provider Configuration
20
+ * All API endpoints, models, and provider settings
21
+ */
22
+ const LLM_CONFIG = {
23
+ // API Endpoints
24
+ ENDPOINTS: {
25
+ GROQ_BASE: 'https://api.groq.com/openai/v1',
26
+ GROQ_STT: 'https://api.groq.com/openai/v1/audio/transcriptions',
27
+ OPENROUTER_BASE: 'https://openrouter.ai/api/v1',
28
+ TOGETHER_BASE: 'https://api.together.xyz/v1'
29
+ },
30
+ // Environment Variable Keys
31
+ ENV_KEYS: {
32
+ GROQ_API_KEY: 'GROQ_API_KEY',
33
+ OPENROUTER_API_KEY: 'OPENROUTER_API_KEY',
34
+ TOGETHER_API_KEY: 'TOGETHER_API_KEY'
35
+ },
36
+ // Models
37
+ MODELS: {
38
+ // Groq Models
39
+ GROQ_VISION_SCOUT: {
40
+ id: 'meta-llama/llama-4-scout-17b-16e-instruct',
41
+ name: 'Meta Llama 4 Scout 17B (Vision)',
42
+ contextWindow: 128000,
43
+ supportsVision: true,
44
+ description: 'Vision-capable model for image and file processing'
45
+ },
46
+ GROQ_GPT_OSS: {
47
+ id: 'openai/gpt-oss-120B',
48
+ name: 'GPT OSS 120B',
49
+ contextWindow: 128000,
50
+ supportsVision: false,
51
+ description: 'Best quality text-only model'
52
+ },
53
+ // OpenRouter Models
54
+ OPENROUTER_LLAMA_8B: {
55
+ id: 'meta-llama/llama-3.1-8b-instruct:free',
56
+ name: 'Llama 3.1 8B (Free)',
57
+ contextWindow: 131072,
58
+ supportsVision: false,
59
+ description: 'Free tier model'
60
+ },
61
+ OPENROUTER_GEMMA_9B: {
62
+ id: 'google/gemma-2-9b-it:free',
63
+ name: 'Gemma 2 9B (Free)',
64
+ contextWindow: 8192,
65
+ supportsVision: false,
66
+ description: 'Free tier model'
67
+ },
68
+ OPENROUTER_MISTRAL_7B: {
69
+ id: 'mistralai/mistral-7b-instruct:free',
70
+ name: 'Mistral 7B (Free)',
71
+ contextWindow: 32768,
72
+ supportsVision: false,
73
+ description: 'Free tier model'
74
+ },
75
+ OPENROUTER_QWEN_7B: {
76
+ id: 'qwen/qwen-2-7b-instruct:free',
77
+ name: 'Qwen 2 7B (Free)',
78
+ contextWindow: 32768,
79
+ supportsVision: false,
80
+ description: 'Free tier model'
81
+ },
82
+ // Together.ai Models
83
+ TOGETHER_LLAMA_8B: {
84
+ id: 'meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo',
85
+ name: 'Llama 3.1 8B Turbo',
86
+ contextWindow: 131072,
87
+ supportsVision: false,
88
+ description: 'Fast and efficient'
89
+ },
90
+ TOGETHER_LLAMA_70B: {
91
+ id: 'meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo',
92
+ name: 'Llama 3.1 70B Turbo',
93
+ contextWindow: 131072,
94
+ supportsVision: false,
95
+ description: 'Best quality'
96
+ },
97
+ TOGETHER_MIXTRAL: {
98
+ id: 'mistralai/Mixtral-8x7B-Instruct-v0.1',
99
+ name: 'Mixtral 8x7B',
100
+ contextWindow: 32768,
101
+ supportsVision: false,
102
+ description: 'Good balance'
103
+ }
104
+ },
105
+ // Speech-to-Text Configuration
106
+ STT: {
107
+ MODEL: 'whisper-large-v3-turbo',
108
+ DEFAULT_LANGUAGE: 'en'
109
+ },
110
+ // Default Provider Configuration
111
+ DEFAULTS: {
112
+ PROVIDER_ID: 'groq',
113
+ MODEL_ID: 'openai/gpt-oss-120B' // Default to fast text model
114
+ }
115
+ };export{ACCEPTED_FILE_TYPES,ACCEPTED_FILE_TYPES_STRING,LLM_CONFIG,MAX_FILES,MAX_FILE_SIZE_BYTES};//# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sources":["../../src/config/constants.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;AAEG;AAEH;AAUA;AAEA;AACO,MAAM,SAAS,GAAG;AAEzB;MACa,mBAAmB,GAAG,EAAE,GAAG,IAAI,GAAG;AAE/C;AACO,MAAM,mBAAmB,GAAG;WAC/B,EAAS,CAAA,MAAG,EAAM,MAAE,EAAM,OAAE,EAAO,MAAE,EAAM,KAAE,CAAA;QAC7C,EAAM,CAAA,MAAG,EAAM,MAAE,EAAM,OAAE,EAAO,MAAE,EAAM,OAAE;;AAG9C;MACa,0BAA0B,GAAG,CAAC,GAAG,mBAAmB,CAAC,SAAS,EAAE,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG;AAEpH;AAEA;;;AAGG;AACI,MAAM,UAAU,GAAG;;AAEtB,EAAA,SAAA,EAAS;AACL,IAAA,SAAA,EAAA,gCAAW;AACX,IAAA,QAAA,EAAA,qDAAU;AACV,IAAA,eAAA,EAAA,8BAAiB;AACjB,IAAA,aAAA,EAAA;AACH,GAAA;;AAGD,EAAA,QAAA,EAAQ;AACJ,IAAA,YAAA,EAAA,cAAc;AACd,IAAA,kBAAA,EAAA,oBAAoB;AACpB,IAAA,gBAAA,EAAA;AACH,GAAA;;AAGD,EAAA,MAAA,EAAM;;AAEF,IAAA,iBAAA,EAAA;AACI,MAAA,EAAA,EAAA,2CAAI;AACJ,MAAA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A,MAAe;AACf,MAAA,cAAA,EAAA;AACA,MAAA,WAAA,EAAA;AACH,KAAA;AACD,IAAA,gBAAA,EAAA;AACI,MAAA,EAAA,EAAA,sCAAI;AACJ,MAAA,IAAA,EAAA,cAAM;AACN,MAAA,aAAA,EAAA;AACA,MAAA,cAAA,EAAA;AACA,MAAA,WAAA,EAAA;AACH;AACJ,GAAA;;AAGD,EAAA,GAAA,EAAG;AACC,IAAA,KAAA,EAAA,wBAAO;AACP,IAAA,gBAAA,EAAA;AACH,GAAA;;AAGD,EAAA,QAAA,EAAQ;AACJ,IAAA,WAAA,EAAA,MAAa;YACb,EAAA,qBAAU;AACb;"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Environment variable access utilities for perplexity-demo module
3
+ * Provides access to build-time env variables
4
+ */
5
+ /**
6
+ * Get environment variable from window.__ENV__ (injected at build time)
7
+ */
8
+ export declare function getEnvVar(key: string): string | undefined;
9
+ /**
10
+ * Get API key from environment variable
11
+ *
12
+ * @param envKey - The environment variable name (e.g., 'GROQ_API_KEY')
13
+ * @returns The API key or empty string if not found
14
+ */
15
+ export declare function getApiKey(envKey: string): string;
16
+ /**
17
+ * Check if API key is available
18
+ */
19
+ export declare function hasApiKey(envKey: string): boolean;
20
+ //# sourceMappingURL=env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/config/env.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKzD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEjD"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Environment variable access utilities for perplexity-demo module
3
+ * Provides access to build-time env variables
4
+ */
5
+ /**
6
+ * Get environment variable from window.__ENV__ (injected at build time)
7
+ */
8
+ function getEnvVar(key) {
9
+ if (typeof window !== 'undefined') {
10
+ return window.__ENV__?.[key];
11
+ }
12
+ return undefined;
13
+ }
14
+ /**
15
+ * Get API key from environment variable
16
+ *
17
+ * @param envKey - The environment variable name (e.g., 'GROQ_API_KEY')
18
+ * @returns The API key or empty string if not found
19
+ */
20
+ function getApiKey(envKey) {
21
+ return getEnvVar(envKey) || '';
22
+ }export{getApiKey,getEnvVar};//# sourceMappingURL=env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.js","sources":["../../src/config/env.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;AAGG;AAEH;;AAEG;AACG,SAAU,SAAS,CAAC,GAAW,EAAA;AACjC,EAAA,IAAA,OAAI,MAAO,KAAM,WAAK,EAAW;AAC7B,IAAA,OAAA,cAAuB,GAAA,GAAS,CAAC;;AAErC,EAAA,OAAA;AACJ;AAEA;;;;;AAKG;AACG,SAAU,SAAS,CAAC,MAAc,EAAA;AACpC,EAAA,OAAA,gBAAiB,CAAA,IAAO,EAAI;AAChC"}
@@ -0,0 +1,4 @@
1
+ export * from './constants';
2
+ export * from './providers';
3
+ export * from './env';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC"}
@@ -0,0 +1,54 @@
1
+ export interface LLMProvider {
2
+ id: string;
3
+ name: string;
4
+ baseUrl: string;
5
+ defaultModel: string;
6
+ models: LLMModel[];
7
+ envKey: string;
8
+ description?: string;
9
+ }
10
+ export interface LLMModel {
11
+ id: string;
12
+ name: string;
13
+ contextWindow?: number;
14
+ supportsVision?: boolean;
15
+ description?: string;
16
+ }
17
+ export interface SelectedProviderConfig {
18
+ providerId: string;
19
+ modelId: string;
20
+ }
21
+ export declare const DEFAULT_PROVIDERS: LLMProvider[];
22
+ /**
23
+ * Get all available providers
24
+ */
25
+ export declare function getAllProviders(): LLMProvider[];
26
+ /**
27
+ * Get a specific provider by ID
28
+ */
29
+ export declare function getProviderById(providerId: string): LLMProvider | undefined;
30
+ /**
31
+ * Get the default provider configuration (Groq with vision model)
32
+ */
33
+ export declare function getSelectedProviderConfig(): SelectedProviderConfig;
34
+ /**
35
+ * Get the API key for a specific provider from env
36
+ */
37
+ export declare function getProviderApiKey(providerId: string): string;
38
+ /**
39
+ * Check if a provider has a valid API key configured
40
+ */
41
+ export declare function isProviderConfigured(providerId: string): boolean;
42
+ /**
43
+ * Get the default provider (Groq) with its API key from env
44
+ */
45
+ export declare function getCurrentProviderWithKey(): {
46
+ provider: LLMProvider;
47
+ model: LLMModel;
48
+ apiKey: string;
49
+ } | null;
50
+ /**
51
+ * Get list of providers that have API keys configured in env
52
+ */
53
+ export declare function getConfiguredProviders(): LLMProvider[];
54
+ //# sourceMappingURL=providers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/config/providers.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,QAAQ,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,QAAQ;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,sBAAsB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACnB;AAID,eAAO,MAAM,iBAAiB,EAAE,WAAW,EAqC1C,CAAC;AAIF;;GAEG;AACH,wBAAgB,eAAe,IAAI,WAAW,EAAE,CAE/C;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAE3E;AAED;;GAEG;AACH,wBAAgB,yBAAyB,IAAI,sBAAsB,CAMlE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAK5D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAEhE;AAED;;GAEG;AACH,wBAAgB,yBAAyB,IAAI;IACzC,QAAQ,EAAE,WAAW,CAAC;IACtB,KAAK,EAAE,QAAQ,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,CAUP;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,WAAW,EAAE,CAEtD"}
@@ -0,0 +1,65 @@
1
+ import {getApiKey}from'./env.js';import {LLM_CONFIG}from'./constants.js';// ============= Default Providers =============
2
+ const DEFAULT_PROVIDERS = [{
3
+ id: 'groq',
4
+ name: 'Groq',
5
+ baseUrl: LLM_CONFIG.ENDPOINTS.GROQ_BASE,
6
+ defaultModel: LLM_CONFIG.DEFAULTS.MODEL_ID,
7
+ envKey: LLM_CONFIG.ENV_KEYS.GROQ_API_KEY,
8
+ description: 'Fast inference with Llama models including vision support',
9
+ models: [LLM_CONFIG.MODELS.GROQ_VISION_SCOUT, LLM_CONFIG.MODELS.GROQ_GPT_OSS]
10
+ }, {
11
+ id: 'openrouter',
12
+ name: 'OpenRouter',
13
+ baseUrl: LLM_CONFIG.ENDPOINTS.OPENROUTER_BASE,
14
+ defaultModel: LLM_CONFIG.MODELS.OPENROUTER_LLAMA_8B.id,
15
+ envKey: LLM_CONFIG.ENV_KEYS.OPENROUTER_API_KEY,
16
+ description: 'Access to multiple providers with free models available',
17
+ models: [LLM_CONFIG.MODELS.OPENROUTER_LLAMA_8B, LLM_CONFIG.MODELS.OPENROUTER_GEMMA_9B, LLM_CONFIG.MODELS.OPENROUTER_MISTRAL_7B, LLM_CONFIG.MODELS.OPENROUTER_QWEN_7B]
18
+ }, {
19
+ id: 'together',
20
+ name: 'Together.ai',
21
+ baseUrl: LLM_CONFIG.ENDPOINTS.TOGETHER_BASE,
22
+ defaultModel: LLM_CONFIG.MODELS.TOGETHER_LLAMA_8B.id,
23
+ envKey: LLM_CONFIG.ENV_KEYS.TOGETHER_API_KEY,
24
+ description: 'Fast inference with various open models',
25
+ models: [LLM_CONFIG.MODELS.TOGETHER_LLAMA_8B, LLM_CONFIG.MODELS.TOGETHER_LLAMA_70B, LLM_CONFIG.MODELS.TOGETHER_MIXTRAL]
26
+ }];
27
+ /**
28
+ * Get a specific provider by ID
29
+ */
30
+ function getProviderById(providerId) {
31
+ return DEFAULT_PROVIDERS.find(p => p.id === providerId);
32
+ }
33
+ /**
34
+ * Get the default provider configuration (Groq with vision model)
35
+ */
36
+ function getSelectedProviderConfig() {
37
+ // Default to Groq with llama-4-scout-17b (vision model)
38
+ return {
39
+ providerId: LLM_CONFIG.DEFAULTS.PROVIDER_ID,
40
+ modelId: LLM_CONFIG.DEFAULTS.MODEL_ID
41
+ };
42
+ }
43
+ /**
44
+ * Get the API key for a specific provider from env
45
+ */
46
+ function getProviderApiKey(providerId) {
47
+ const provider = getProviderById(providerId);
48
+ if (!provider) return '';
49
+ return getApiKey(provider.envKey);
50
+ }
51
+ /**
52
+ * Get the default provider (Groq) with its API key from env
53
+ */
54
+ function getCurrentProviderWithKey() {
55
+ const config = getSelectedProviderConfig();
56
+ const provider = getProviderById(config.providerId);
57
+ if (!provider) return null;
58
+ const apiKey = getProviderApiKey(provider.id);
59
+ const model = provider.models.find(m => m.id === config.modelId) || provider.models[0];
60
+ return {
61
+ provider,
62
+ model,
63
+ apiKey
64
+ };
65
+ }export{DEFAULT_PROVIDERS,getCurrentProviderWithKey,getProviderApiKey,getProviderById,getSelectedProviderConfig};//# sourceMappingURL=providers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"providers.js","sources":["../../src/config/providers.ts"],"sourcesContent":[null],"names":[],"mappings":"yEA0BA;AAEO,MAAM,iBAAiB,GAAkB,CAAA;AAC5C,EAAA,EAAA,EAAA,MAAA;AACI,EAAA,IAAA,EAAA,MAAI;AACJ,EAAA,OAAA,EAAA,UAAY,CAAA,SAAA,CAAA,SAAA;AACZ,EAAA,YAAA,EAAO,UAAE,CAAU,QAAC,CAAA,QAAU;AAC9B,EAAA,MAAA,EAAA,UAAY,CAAA,QAAE,CAAA,YAAoB;AAClC,EAAA,WAAA,EAAM,2DAAkC;AACxC,EAAA,MAAA,EAAA,CAAA,UAAa,CAAA,MAAA,CAAA,iBAAA,EAAA,UAAA,CAAA,MAAA,CAAA,YAAA;AACb,CAAA,EAAA;AACH,EAAA,EAAA,EAAA,YAAA;AACD,EAAA,IAAA,EAAA,YAAA;AACI,EAAA,OAAA,YAAI,CAAA,SAAY,CAAA,eAAA;AAChB,EAAA,YAAM,EAAA,UAAY,CAAA,MAAA,CAAA,mBAAA,CAAA,EAAA;AAClB,EAAA,MAAA,EAAA,UAAS,CAAA,QAAW,CAAA,kBAAU;AAC9B,EAAA,WAAA,EAAA,yDAAsD;AACtD,EAAA,MAAA,EAAA,CAAA,UAAQ,CAAA,MAAW,CAAA,mBAAS,EAAA,UAAkB,CAAA,MAAA,CAAA,mBAAA,EAAA,UAAA,CAAA,MAAA,CAAA,qBAAA,EAAA,UAAA,CAAA,MAAA,CAAA,kBAAA;AAC9C,CAAA,EAAA;AACA,EAAA,EAAA,EAAA,UAAQ;qBACJ;qBACA,CAAU,SAAQ,CAAA,aAAA;cAClB,EAAA,UAAW,CAAA,MAAO,CAAA,iBAAqB,CAAA,EAAA;oBACvC,CAAA,QAAiB,CAAC,gBAAA;AACrB,EAAA,WAAA,EAAA,yCAAA;AACJ,EAAA,MAAA,EAAA,CAAA,UAAA,CAAA,MAAA,CAAA,iBAAA,EAAA,UAAA,CAAA,MAAA,CAAA,kBAAA,EAAA,UAAA,CAAA,MAAA,CAAA,gBAAA;AACD,CAAA;;;;AAWK,SAAA,eAAA,CAAA,UAAA,EAAA;AACJ,EAAA,OAAA,iBAAA,CAAA,IAAA,CAAA,CAAA,IAAA,CAAA,CAAA,EAAA,KAAA,UAAA,CAAA;;AAGL;AAEA;;AAEG,SAAA,yBAAA,GAAA;AACH;AACI,EAAA,OAAA;AACJ,IAAC,UAAA,EAAA,UAAA,CAAA,QAAA,CAAA,WAAA;AAED,IAAA,OAAA,EAAA,UAAA,CAAA,QAAA,CAAA;;AAEG;AACH;AACI;AACJ;AAEA,SAAA,iBAAA,CAAA,UAAA,EAAA;;AAEG,EAAA,IAAA,CAAA,QAAA,EAAA,OAAA,EAAA;AACH,EAAA,gBAAgB,CAAA,QAAA,CAAA,MAAA,CAAA;;;AAUb;AACH;AACI,kCAAiC,GAAA;AACjC,EAAA,MAAI,MAAC,GAAQ,yBAAA,EAAA;AAAE,EAAA,MAAA,WAAU,eAAA,CAAA,MAAA,CAAA,UAAA,CAAA;AAEzB,EAAA,IAAA,CAAA,iBAAiB,IAAA;AACrB,EAAC,MAAA,MAAA,GAAA,iBAAA,CAAA,QAAA,CAAA,EAAA,CAAA;AAED,EAAA,MAAA,KAAA,GAAA,QAAA,CAAA,MAAA,CAAA,IAAA,CAAA,CAAA,IAAA,CAAA,CAAA,EAAA,KAAA,MAAA,CAAA,OAAA,CAAA,IAAA,QAAA,CAAA,MAAA,CAAA,CAAA,CAAA;;AAEG,IAAA,QAAA;AACH,IAAA,KAAM;AACF,IAAA;AACJ,GAAC;AAED"}
@@ -1,4 +1,2 @@
1
- import React from 'react';
2
- declare const HomePage: React.FC;
3
- export default HomePage;
1
+ export default function HomePage(): import("react/jsx-runtime").JSX.Element;
4
2
  //# sourceMappingURL=HomePage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../../src/pages/home/HomePage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAMrB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../../src/pages/home/HomePage.tsx"],"names":[],"mappings":"AA4JA,MAAM,CAAC,OAAO,UAAU,QAAQ,4CA8K/B"}
@@ -1,6 +1,290 @@
1
- import {jsx}from'react/jsx-runtime';import {PerplexitySearch}from'../../components/SearchBar.js';const HomePage = () => {
1
+ import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useMachine}from'@xstate/react';import {Trash2,Radio,Loader2,AlertCircle,RefreshCw}from'lucide-react';import {useRef,useState,useCallback,useEffect,memo,useMemo}from'react';import {marked}from'marked';import {CHANNELS,ChannelBar}from'@admin-layout/tailwind-ui';import {AttachmentPreview}from'../../components/AttachmentPreview.js';import {PerplexitySearch}from'../../components/SearchBar.js';import {chatMachine}from'../../state/chatMachine.js';import {loadChat}from'../../utils/chatStorage.js';import {cn}from'../../utils/index.js';// Sample inbound messages used by the demo "Simulate inbound" button to mimic
2
+ // a real `gatewayInboundMessage` subscription firing when a paired channel
3
+ // (Telegram, Discord, Slack, …) sends a message bound to this chat session.
4
+ const DEMO_INBOUND_TEXTS = ['Build me a Pomodoro timer with dark mode', 'Summarize the last 5 emails I received today', 'Draft a friendly reply: "thanks, let\'s ship it Friday"', 'Create a chess game with React and Tailwind', 'Plan a 3-day trip to Lisbon under $800'];
5
+ const MessageBubble = memo(function MessageBubble({
6
+ role,
7
+ content,
8
+ attachments
9
+ }) {
10
+ const isUser = role === 'user';
11
+ const hasAttachments = attachments && attachments.length > 0;
12
+ // Parse markdown for assistant messages (completed messages only)
13
+ const htmlContent = useMemo(() => {
14
+ if (isUser) return null;
15
+ return marked.parse(content, {
16
+ async: false
17
+ });
18
+ }, [content, isUser]);
19
+ return jsxs("div", {
20
+ className: cn('flex gap-4', isUser ? 'justify-end' : 'justify-start'),
21
+ children: [!isUser && jsx("div", {
22
+ className: "flex-shrink-0 w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center text-primary font-semibold text-xs",
23
+ children: "AI"
24
+ }), jsxs("div", {
25
+ className: cn('rounded-2xl px-4 py-3', isUser ? 'bg-primary text-primary-foreground' : 'bg-muted'),
26
+ children: [hasAttachments && jsx("div", {
27
+ className: "flex flex-wrap gap-2 mb-2",
28
+ children: attachments.map(attachment => jsx(AttachmentPreview, {
29
+ attachment: attachment,
30
+ isCancellable: false,
31
+ showPreview: !!attachments && attachments.length === 1 && !!attachments[0].dataUrl && attachments[0].dataUrl.startsWith('data:image/')
32
+ }, attachment.id))
33
+ }), isUser ? jsx("div", {
34
+ className: "text-sm whitespace-pre-wrap break-words leading-relaxed",
35
+ children: content
36
+ }) : jsx("div", {
37
+ className: "text-sm prose prose-sm dark:prose-invert max-w-none leading-relaxed prose-p:my-2 prose-pre:my-2 prose-ul:my-2 prose-ol:my-2",
38
+ dangerouslySetInnerHTML: {
39
+ __html: htmlContent || ''
40
+ }
41
+ })]
42
+ }), isUser && jsx("div", {
43
+ className: "flex-shrink-0 w-8 h-8 rounded-full bg-primary flex items-center justify-center text-primary-foreground font-semibold text-xs",
44
+ children: "You"
45
+ })]
46
+ });
47
+ });
48
+ // Using shared AttachmentPreview component for chats (isCancellable=false)
49
+ const StreamingMessage = memo(function StreamingMessage({
50
+ content
51
+ }) {
52
+ // During streaming, show plain text to avoid blocking the main thread
53
+ // Markdown parsing is expensive and causes UI freezes with rapid updates
54
+ // The final message will be parsed when it's added to the messages array
55
+ return jsxs("div", {
56
+ className: "flex gap-4 justify-start",
57
+ children: [jsx("div", {
58
+ className: "flex-shrink-0 w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center text-primary font-semibold text-xs",
59
+ children: "AI"
60
+ }), jsx("div", {
61
+ className: "rounded-2xl px-4 py-3 bg-muted",
62
+ children: jsxs("div", {
63
+ className: "text-sm max-w-none leading-relaxed",
64
+ children: [jsx("div", {
65
+ className: "whitespace-pre-wrap break-words",
66
+ children: content
67
+ }), jsx("span", {
68
+ className: "inline-block w-2 h-4 bg-primary/50 ml-1 animate-pulse"
69
+ })]
70
+ })
71
+ })]
72
+ });
73
+ });
74
+ const LoadingIndicator = memo(function LoadingIndicator() {
75
+ return jsxs("div", {
76
+ className: "flex gap-4 justify-start",
77
+ children: [jsx("div", {
78
+ className: "flex-shrink-0 w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center text-primary font-semibold text-xs",
79
+ children: "AI"
80
+ }), jsx("div", {
81
+ className: "rounded-2xl px-4 py-3 bg-muted",
82
+ children: jsxs("div", {
83
+ className: "flex items-center gap-2 text-sm text-muted-foreground",
84
+ children: [jsx(Loader2, {
85
+ className: "h-4 w-4 animate-spin"
86
+ }), jsx("span", {
87
+ children: "Thinking..."
88
+ })]
89
+ })
90
+ })]
91
+ });
92
+ });
93
+ const ErrorMessage = memo(function ErrorMessage({
94
+ error,
95
+ onRetry
96
+ }) {
2
97
  return jsx("div", {
3
- className: "flex min-h-screen flex-col items-center justify-center bg-background",
4
- children: jsx(PerplexitySearch, {})
98
+ className: "rounded-2xl px-4 py-3 bg-destructive/10 border border-destructive/50",
99
+ children: jsxs("div", {
100
+ className: "flex items-start justify-between gap-3",
101
+ children: [jsxs("div", {
102
+ className: "flex items-start gap-2",
103
+ children: [jsx(AlertCircle, {
104
+ className: "h-5 w-5 text-destructive flex-shrink-0 mt-0.5"
105
+ }), jsxs("div", {
106
+ className: "flex-1",
107
+ children: [jsx("p", {
108
+ className: "text-sm font-medium text-destructive mb-1",
109
+ children: "Something went wrong"
110
+ }), jsx("p", {
111
+ className: "text-sm text-destructive/80",
112
+ children: error
113
+ })]
114
+ })]
115
+ }), jsxs("button", {
116
+ onClick: onRetry,
117
+ className: "flex items-center gap-1 px-3 py-1.5 text-sm rounded-lg border border-destructive/50 text-destructive hover:bg-destructive/10 transition-colors",
118
+ children: [jsx(RefreshCw, {
119
+ className: "h-4 w-4"
120
+ }), "Retry"]
121
+ })]
122
+ })
123
+ });
124
+ });
125
+ function HomePage() {
126
+ const [state, send] = useMachine(chatMachine);
127
+ const scrollRef = useRef(null);
128
+ const hasLoadedRef = useRef(false);
129
+ // --- Demo channel-bar wiring --------------------------------------------
130
+ // In the real app, `connectedChannelIds` comes from `gatewayListBindings`
131
+ // and inbound messages arrive via the `gatewayInboundMessage` subscription.
132
+ // Here we just mock the flow so the UX is identical.
133
+ const [connectedChannelIds, setConnectedChannelIds] = useState([]);
134
+ const [prefill, setPrefill] = useState();
135
+ const handleChannelConnect = useCallback(async channel => {
136
+ // Real wrapper would call `useGeneratePairingToken().generateToken(...)`.
137
+ const token = `demo-${channel.id}-${Date.now().toString(36)}`;
138
+ // Auto-"complete" the pairing 2.5s later so the demo flows on its own.
139
+ setTimeout(() => {
140
+ setConnectedChannelIds(prev => prev.includes(channel.id) ? prev : [...prev, channel.id]);
141
+ }, 2500);
142
+ return {
143
+ token,
144
+ deepLink: `https://example.com/pair?channel=${channel.id}&token=${token}`,
145
+ expiresAt: Date.now() + 5 * 60_000
146
+ };
147
+ }, []);
148
+ const handleChannelDisconnect = useCallback(channel => {
149
+ setConnectedChannelIds(prev => prev.filter(id => id !== channel.id));
150
+ }, []);
151
+ const handleSimulateInbound = useCallback(() => {
152
+ if (connectedChannelIds.length === 0) return;
153
+ const channelId = connectedChannelIds[Math.floor(Math.random() * connectedChannelIds.length)];
154
+ const channel = CHANNELS.find(c => c.id === channelId);
155
+ const sample = DEMO_INBOUND_TEXTS[Math.floor(Math.random() * DEMO_INBOUND_TEXTS.length)];
156
+ const text = channel ? `[${channel.name}] ${sample}` : sample;
157
+ setPrefill({
158
+ text,
159
+ nonce: Date.now()
160
+ });
161
+ }, [connectedChannelIds]);
162
+ // -----------------------------------------------------------------------
163
+ const {
164
+ messages,
165
+ response,
166
+ isStreaming,
167
+ error
168
+ } = state.context;
169
+ const hasMessages = messages.length > 0 || response;
170
+ const isLoading = state.matches('sending');
171
+ // Load persisted messages on mount (once)
172
+ useEffect(() => {
173
+ if (hasLoadedRef.current) return;
174
+ hasLoadedRef.current = true;
175
+ loadChat().then(storedMessages => {
176
+ if (storedMessages && storedMessages.length > 0) {
177
+ send({
178
+ type: 'LOAD_MESSAGES',
179
+ messages: storedMessages
180
+ });
181
+ }
182
+ });
183
+ }, [send]);
184
+ // Auto-scroll to bottom when messages update
185
+ useEffect(() => {
186
+ if (scrollRef.current) {
187
+ scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
188
+ }
189
+ }, [messages, response]);
190
+ const handleSubmit = useCallback((query, mode, attachments) => {
191
+ console.log('📤 [CHAT] Submitting query:', query, 'mode:', mode, 'attachments:', attachments?.length ?? 0);
192
+ // Convert attachments to message format
193
+ const messageAttachments = attachments?.map(a => ({
194
+ id: a.id,
195
+ name: a.name,
196
+ // Map mime types and 'screenshot' marker to UI-level 'file'|'screenshot'
197
+ type: a.type === 'screenshot' ? 'screenshot' : 'file',
198
+ dataUrl: a.dataUrl
199
+ }));
200
+ send({
201
+ type: 'SEND_MESSAGE',
202
+ content: query,
203
+ attachments: messageAttachments
204
+ });
205
+ }, [send]);
206
+ const handleClear = useCallback(() => {
207
+ send({
208
+ type: 'CLEAR_MESSAGES'
209
+ });
210
+ }, [send]);
211
+ const handleRetry = useCallback(() => {
212
+ send({
213
+ type: 'RETRY'
214
+ });
215
+ }, [send]);
216
+ return jsxs("div", {
217
+ className: "flex h-screen flex-col bg-background overflow-hidden",
218
+ children: [hasMessages && jsx("div", {
219
+ className: "absolute top-4 left-4 z-10",
220
+ children: jsx("button", {
221
+ onClick: handleClear,
222
+ className: "p-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",
223
+ title: "Clear conversation",
224
+ children: jsx(Trash2, {
225
+ className: "h-4 w-4"
226
+ })
227
+ })
228
+ }), !hasMessages && jsxs("div", {
229
+ className: "flex-1 flex flex-col items-center justify-center px-6",
230
+ children: [jsx("header", {
231
+ className: "text-center mb-8",
232
+ children: jsx("p", {
233
+ className: "text-balance text-3xl font-semibold tracking-tight text-foreground",
234
+ children: "perplexity"
235
+ })
236
+ }), jsxs("div", {
237
+ className: "w-full max-w-[38rem]",
238
+ children: [jsx(PerplexitySearch, {
239
+ onSubmit: handleSubmit,
240
+ isLoading: isLoading,
241
+ prefill: prefill
242
+ }), jsx(ChannelBar, {
243
+ connectedChannelIds: connectedChannelIds,
244
+ onConnect: handleChannelConnect,
245
+ onDisconnect: handleChannelDisconnect,
246
+ className: "mt-4"
247
+ }), connectedChannelIds.length > 0 && jsx("div", {
248
+ className: "mt-3 flex justify-center",
249
+ children: jsxs("button", {
250
+ type: "button",
251
+ onClick: handleSimulateInbound,
252
+ className: "inline-flex items-center gap-2 rounded-full border border-primary/40 bg-card px-3 py-1.5 text-xs font-medium text-primary hover:bg-primary/10 transition-colors",
253
+ title: "Simulate an inbound message from a connected channel",
254
+ children: [jsx(Radio, {
255
+ className: "h-3.5 w-3.5"
256
+ }), "Simulate inbound message"]
257
+ })
258
+ })]
259
+ })]
260
+ }), hasMessages && jsxs(Fragment, {
261
+ children: [jsx("div", {
262
+ className: "flex-1 overflow-y-auto px-6 pt-16 pb-4",
263
+ ref: scrollRef,
264
+ children: jsxs("div", {
265
+ className: "max-w-[46rem] mx-auto space-y-6",
266
+ children: [messages.map((message, index) => jsx(MessageBubble, {
267
+ role: message.role,
268
+ content: message.content,
269
+ attachments: message.attachments
270
+ }, index)), response && isLoading && jsx(StreamingMessage, {
271
+ content: response
272
+ }), isLoading && !response && jsx(LoadingIndicator, {}), state.matches('error') && error && jsx(ErrorMessage, {
273
+ error: error,
274
+ onRetry: handleRetry
275
+ })]
276
+ })
277
+ }), jsx("div", {
278
+ className: "shrink-0 bg-card px-6 py-4",
279
+ children: jsx("div", {
280
+ className: "max-w-[46rem] mx-auto",
281
+ children: jsx(PerplexitySearch, {
282
+ onSubmit: handleSubmit,
283
+ isLoading: isLoading,
284
+ prefill: prefill
285
+ })
286
+ })
287
+ })]
288
+ })]
5
289
  });
6
- };export{HomePage as default};//# sourceMappingURL=HomePage.js.map
290
+ }export{HomePage as default};//# sourceMappingURL=HomePage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HomePage.js","sources":["../../../src/pages/home/HomePage.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":"iGAGA,MAAM,QAAQ,GAAa,MAAK;SAC5BA,GACI,CAAA,KAAA,EAAA;AAIR,IAAE,SAAA,EAAA,sEAAA;AAEF,IAAA,QAAA,EAAAA,oBAAwB,EAAA,EAAA;;"}
1
+ {"version":3,"file":"HomePage.js","sources":["../../../src/pages/home/HomePage.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":"8kBAYA;AACA;AACA;AACA,MAAM,kBAAkB,GAAG,CAAA,0CAAA,EAAA,8CAAA,EAAA,yDAAA,EAAA,6CAAA,EAAA,wCAAA,CAAA;MACvB,aAAA,GAAA,IAAA,CAAA,SAAA,aAA0C,CAAA;MAC1C;SACA;;;EAGF,MAAA,MAAA,GAAA,IAAA,KAAA,MAAA;AAqBF,EAAA,MAAM,cAAgB,GAAA,WAAc,IAAA,WAAc,CAAE,MAAM,GAAA,CAAA;AACtD;QACA,WAAM,GAAA,OAAiB,CAAA,MAAA;IAEvB,IAAA,MAAA,EAAA,OAAA,IAAA;AACA,IAAA,OAAM,MAAA,CAAA,KAAW,CAAG,OAAO;AACvB,MAAA,KAAA,EAAI;AAAQ,KAAA,CAAA;AACZ,EAAA,CAAA,EAAA,CAAA,OAAA,EAAO,MAAM,CAAC,CAAA;AAClB,EAAA,OAAIA,IAAA,CAAO,KAAE,EAAA;AAEb,IAAA,SACI,EAAA,EAAA,CAAA,YAAK,EAAA,MAAW,GAAG,aAAY,GAAE,eAAS,CAAA;mCAiBd,EAAA;AACA,MAAA,SAAA,EAAA,sHAAwB;AACx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,GAAMC,GAAA,CAAA,GAAA,EAAA;AACjB,YAAQ,SAAG,EAAA,2CAAA;AAEX,YAAM,QAAA,EAAW;AACb,WAAA,CAAI,EAACA,GAAE,CAAI,GAAE,EAAA;AACjB,YAAQ,SAAG,EAAA,6BAAA;AAEX,YACI,QAAA,EAAA;AAoFR,WAAC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Browser Platform Services Implementation
3
+ *
4
+ * This module provides browser-specific implementations for storage, screenshot,
5
+ * and microphone functionality using Web APIs (IndexedDB, MediaDevices, etc.)
6
+ */
7
+ import type { IPlatformServices, IStorageService, IScreenshotService, IMicrophoneService, PlatformInfo } from './types';
8
+ export declare class BrowserPlatformServices implements IPlatformServices {
9
+ readonly platform: PlatformInfo;
10
+ readonly storage: IStorageService;
11
+ readonly screenshot: IScreenshotService;
12
+ readonly microphone: IMicrophoneService;
13
+ constructor();
14
+ initialize(): Promise<void>;
15
+ dispose(): Promise<void>;
16
+ }
17
+ export declare function getBrowserPlatformServices(): BrowserPlatformServices;
18
+ //# sourceMappingURL=browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/platform/browser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EACR,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EAQf,MAAM,SAAS,CAAC;AA2UjB,qBAAa,uBAAwB,YAAW,iBAAiB;IAC7D,SAAgB,QAAQ,EAAE,YAAY,CAGpC;IAEF,SAAgB,OAAO,EAAE,eAAe,CAAC;IACzC,SAAgB,UAAU,EAAE,kBAAkB,CAAC;IAC/C,SAAgB,UAAU,EAAE,kBAAkB,CAAC;;IAQzC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAKjC;AAKD,wBAAgB,0BAA0B,IAAI,uBAAuB,CAKpE"}