-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopup.html
More file actions
507 lines (493 loc) · 18 KB
/
Copy pathpopup.html
File metadata and controls
507 lines (493 loc) · 18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
<!doctype html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>AI Chat Pro Client</title>
<script>
(function () {
var t = localStorage.getItem("ai-chat-theme") || "dark";
document.documentElement.className = "theme-" + t;
document.addEventListener("DOMContentLoaded", function () {
document.body.className = "theme-" + t;
});
})();
</script>
<link rel="stylesheet" href="popup.css" />
<script src="../shared/i18n.js"></script>
<script src="../shared/storage.js"></script>
<script src="../shared/announcement.js"></script>
</head>
<body>
<div id="app" class="theme-dark">
<!-- Sidebar -->
<aside id="sidebar" class="sidebar">
<div class="sidebar-header">
<div class="logo">
<svg
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path
d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"
></path>
</svg>
<span data-i18n="app.name">AI Chat Pro Client</span>
</div>
<button id="btn-new-chat" class="btn-icon" data-i18n-title="sidebar.newChat" title="New Chat">
<svg
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
</button>
</div>
<div class="sidebar-search">
<svg
width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg>
<input
type="text"
id="search-chats"
data-i18n-placeholder="sidebar.searchPlaceholder"
placeholder="Search chats..."
/>
</div>
<div id="conversation-list" class="conversation-list"></div>
<div class="sidebar-footer">
<button id="btn-settings" class="btn-sidebar" data-i18n-title="sidebar.settings" title="Settings">
<svg
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="12" cy="12" r="3"></circle>
<path
d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"
></path>
</svg>
<span data-i18n="sidebar.settings">Settings</span>
</button>
<button
id="btn-open-tab"
class="btn-sidebar"
data-i18n-title="sidebar.openInTab"
title="Open in tab"
>
<svg
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path
d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"
></path>
<polyline points="15 3 21 3 21 9"></polyline>
<line x1="10" y1="14" x2="21" y2="3"></line>
</svg>
<span data-i18n="sidebar.openInTab">Open in tab</span>
</button>
</div>
</aside>
<!-- Main Content -->
<main class="main">
<!-- Header -->
<header class="header">
<button
id="btn-toggle-sidebar"
class="btn-icon"
data-i18n-title="sidebar.toggleSidebar"
title="Toggle sidebar"
>
<svg
width="18"
height="18"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
</svg>
</button>
<div class="header-title">
<span id="chat-title" data-i18n="header.newChat">New Chat</span>
<button
id="btn-edit-title"
class="btn-icon-sm"
data-i18n-title="header.editTitle"
title="Edit title"
>
<svg
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path
d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"
></path>
<path
d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"
></path>
</svg>
</button>
</div>
<div class="header-actions">
<span id="model-badge" class="badge">sonar</span>
<button id="btn-export" class="btn-icon" data-i18n-title="header.exportChat" title="Export chat">
<svg
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
<polyline points="7 10 12 15 17 10"></polyline>
<line x1="12" y1="15" x2="12" y2="3"></line>
</svg>
</button>
<button id="btn-clear-chat" class="btn-icon" data-i18n-title="header.clearChat" title="Clear chat">
<svg
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<polyline points="3 6 5 6 21 6"></polyline>
<path
d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"
></path>
</svg>
</button>
</div>
</header>
<!-- Remote Announcement Banner -->
<div id="announcement-container" class="announcement-container hidden"></div>
<!-- Chat Area -->
<div id="chat-area" class="chat-area">
<!-- Welcome Screen -->
<div id="welcome-screen" class="welcome-screen">
<div class="welcome-icon">
<svg
width="48"
height="48"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
>
<path
d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"
></path>
</svg>
</div>
<h2 data-i18n="welcome.title">Welcome to AI Chat Pro Client</h2>
<p data-i18n="welcome.subtitle">Ask a question or start a conversation with the AI.</p>
<div class="welcome-suggestions">
<button
class="suggestion-chip"
data-i18n-prompt="welcome.quantumPrompt"
data-prompt="Explain quantum computing in simple terms"
>
<svg
width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
>
<circle cx="12" cy="12" r="10" />
<path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" />
<line x1="12" y1="17" x2="12.01" y2="17" />
</svg>
<span data-i18n="welcome.quantum">Explain quantum computing</span>
</button>
<button
class="suggestion-chip"
data-i18n-prompt="welcome.codePrompt"
data-prompt="Write me a Python function that calculates Fibonacci numbers"
>
<svg
width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
>
<polyline points="16 18 22 12 16 6" />
<polyline points="8 6 2 12 8 18" />
</svg>
<span data-i18n="welcome.code">Write Python code</span>
</button>
<button
class="suggestion-chip"
data-i18n-prompt="welcome.aitrendsPrompt"
data-prompt="What are the latest trends in AI development?"
>
<svg
width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
>
<path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z" />
<path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z" />
</svg>
<span data-i18n="welcome.aitrends">AI Trends 2025</span>
</button>
<button
class="suggestion-chip"
data-i18n-prompt="welcome.resumePrompt"
data-prompt="Help me create a professional resume"
>
<svg
width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
>
<path
d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"
/>
<polyline points="14 2 14 8 20 8" />
</svg>
<span data-i18n="welcome.resume">Create a CV</span>
</button>
</div>
</div>
<!-- Messages Container -->
<div id="messages" class="messages"></div>
<!-- Typing Indicator -->
<div id="typing-indicator" class="typing-indicator hidden">
<div class="typing-avatar">
<svg
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
>
<path
d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"
></path>
</svg>
</div>
<div class="typing-dots">
<span></span><span></span><span></span>
</div>
</div>
</div>
<!-- Input Area -->
<div class="input-area">
<div class="input-container">
<textarea
id="message-input"
data-i18n-placeholder="input.placeholder"
placeholder="Enter message..."
rows="1"
autofocus
></textarea>
<div class="input-actions">
<span id="char-count" class="char-count"></span>
<button
id="btn-send"
class="btn-send"
title="Senden (Enter)"
disabled
>
<svg
width="18"
height="18"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<line x1="22" y1="2" x2="11" y2="13"></line>
<polygon points="22 2 15 22 11 13 2 9 22 2"></polygon>
</svg>
</button>
</div>
</div>
<div class="input-hint">
<span id="input-hint-text" data-i18n="input.hint"
>Enter to send, Shift+Enter for new line</span
>
</div>
</div>
</main>
<!-- Export Modal -->
<div id="export-modal" class="modal hidden">
<div class="modal-backdrop"></div>
<div class="modal-content">
<div class="modal-header">
<h3 data-i18n="export.title">Export chat</h3>
<button class="btn-icon modal-close">
<svg
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
>
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</button>
</div>
<div class="modal-body">
<button id="export-md" class="export-option">
<svg
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
>
<path
d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"
/>
<polyline points="14 2 14 8 20 8" />
</svg>
<div>
<strong data-i18n="export.md">Markdown (.md)</strong>
<span data-i18n="export.mdDesc">Formatted text with code blocks</span>
</div>
</button>
<button id="export-json" class="export-option">
<svg
width="20"
height="20"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
>
<polyline points="16 18 22 12 16 6" />
<polyline points="8 6 2 12 8 18" />
</svg>
<div>
<strong data-i18n="export.json">JSON (.json)</strong>
<span data-i18n="export.jsonDesc">Structured data for import</span>
</div>
</button>
</div>
</div>
</div>
<!-- Delete Confirm Modal -->
<div id="delete-modal" class="modal hidden">
<div class="modal-backdrop"></div>
<div class="modal-content modal-sm">
<div class="modal-header">
<h3 data-i18n="delete.title">Delete chat?</h3>
</div>
<div class="modal-body">
<p data-i18n="delete.body">
Do you really want to delete this chat? This action cannot be undone.
</p>
</div>
<div class="modal-footer">
<button class="btn btn-secondary modal-close" data-i18n="delete.cancel">Cancel</button>
<button id="confirm-delete" class="btn btn-danger" data-i18n="delete.confirm">Delete</button>
</div>
</div>
</div>
<!-- Rename Modal -->
<div id="rename-modal" class="modal hidden">
<div class="modal-backdrop"></div>
<div class="modal-content modal-sm">
<div class="modal-header">
<h3 data-i18n="rename.title">Rename chat</h3>
<button class="btn-icon modal-close">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</button>
</div>
<div class="modal-body">
<input
type="text"
id="rename-input"
class="input"
data-i18n-placeholder="rename.placeholder"
placeholder="Chat title"
maxlength="80"
/>
</div>
<div class="modal-footer">
<button class="btn btn-secondary modal-close" data-i18n="rename.cancel">Cancel</button>
<button id="confirm-rename" class="btn btn-primary" data-i18n="rename.confirm">Rename</button>
</div>
</div>
</div>
<!-- Toast Container -->
<div id="toast-container" class="toast-container"></div>
</div>
<script src="popup.js"></script>
</body>
</html>