-
Notifications
You must be signed in to change notification settings - Fork 21
/
index.html
2280 lines (1763 loc) · 126 KB
/
index.html
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
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!--<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="viewport" content="viewport-fit=cover,initial-scale=1, maximum-scale=1" />-->
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no,interactive-widget=resizes-content">
<meta name="color-scheme" content="light dark">
<title data-i18n="page_title">Papeg.ai</title>
<!--
<meta http-equiv="x-dns-prefetch-control" content="off">
-->
<meta name="referrer" content="no-referrer"> <!-- Protecting privacy //-->
<meta name="keywords" content="AI, chat, privacy, browser, LLM, research, writing, summarize, proofread, translation, story, characters, tools">
<meta name="description" content="Chat and write with AI, with 100% privacy">
<meta name="author" content="Tijmen Schep">
<meta property="og:title" content="Papeg.ai">
<meta name="twitter:card" content="summary">
<meta property="og:type" content="website">
<meta property="og:url" content="https://papeg.ai">
<meta property="og:image" content="https://papeg.ai/images/preview.png">
<meta property="og:description" content="Chat and write with AI, 100% privacy">
<meta name="application-name" content="Papeg.ai">
<meta content="summary_large_image" name="twitter:card">
<meta content="@tijmenschep" name="twitter:site">
<meta content="@tijmenschep" name="twitter:creator">
<meta content="Papeg.ai" name="twitter:title">
<meta content="Chat and write using AI, with 100% privacy" name="twitter:description">
<meta content="https://papeg.ai/images/preview.png" name="twitter:image">
<meta content="1630" property="og:image:width">
<meta content="1200" property="og:image:height">
<link rel="apple-touch-icon" sizes="180x180" href="./apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="./favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="./favicon-16x16.png">
<link rel="manifest" href="./site.webmanifest">
<script>
// Cobbled together by Tijmen Schep, 2024
// For Fleur, Levien, Dirk, Linde and Denise
// THE CODE IS VERY MESSY. It's an experiment that became a prototype that became a project.. #cargocult
// If you'd like to inspect the code, you can also find it on Github: https://www.github.com/flatsiedatsie/papeg_ai
// SETTINGS
window.testing = false;
window.timers = [];
window.timer_index = 0;
window.first_run = false;
window.cached_urls = [];
window.first_assistant = 'danube_3_500m';
window.task_counter = 0;
//window.prompt_responded_counter = 0;
window.task_queue = [];
window.last_chat_response = null;
window.current_task = null; // what the selected AI is working on // Deprecated in favour of:
window.current_tasks = {}; // what the selected AI is working on
window.settings = {
'for':'papeg.ai',
'version':null, // will be set by the service worker
// Assistants
'assistant':'developer',
'assistants':{
'developer':{'selected':true},
//'speaker':{'selected':true},
//'musicgen':{'selected':true},
'text_to_image':{'selected':true},
'scribe':{'selected':true,'privacy_level':'Medium','add_timestamps':'Minutes','transcription_quality':'High','continuous_mic':'Detect_slow'},
'translator':{'selected':true,'add_both_languages_to_documents':false,'force_webgpu':false, 'prefered_voice_gender':'female'},
'fast_mistral':{'selected':true},
'mistral':{'selected':true},
'fast_phi3_mini':{'selected':false},
'phi3_mini':{'selected':false},
'fast_llama3_1b':{'selected':true},
'llama3_1b':{'selected':true},
'fast_llama3_3b':{'selected':true},
'llama3_3b':{'selected':true},
'fast_gemma_2_2b_it':{'selected':false},
'gemma_2_2b_it':{'selected':false},
'fast_tiny_llama':{'selected':false},
'tiny_llama':{'selected':false},
'danube':{'selected':false},
'danube_3_500m':{'selected':true},
// Specialized
'medical6':{'selected':true},
'mental6':{'selected':true},
},
'last_loaded_text_ai':window.first_assistant,
'limit_memory':0, // 0 = auto
// UI state
'language':'en',
'types':{'generic':{'last_loaded':window.first_assistant}}, // TODO is this still used?
'settings_complexity':'normal',
'left_sidebar_open':false,
'left_sidebar':'chat',
'left_sidebar_settings_tab':'settings',
'brightness':null, // dark or light theme
'chat_shrink':true,
'received_an_ai':false,
'show_notifications':false,
'maximum_recent_files':5,
'docs':{
'open':null,
'recent':[]
},
// Tutorials done
'tutorial':{
'add_assistants_hint_shown':false,
'model_tutorial_done':false,
'document_tutorial_done':false,
'voice_tutorial_done':false,
'ask_voice_consent':false,
'first_task_slow_explanation':false,
},
// Audio
'voice':'default',
'voice_gender':'female',
'interrupt_speaking':'Auto',
// Image
'continuous_ocr_scan':true,
'ocr_scan_intensity':1, // take multiple OCR pictures and try to merge the text together
'continuous_ocr_scan_intensity':1,
'save_ocr_scan':false, // whether to auto-append it to a document
'continuous_image_to_text_scan':true,
'save_image_to_text_scan':false, // whether to auto-append it to a document
// Translation
'favourite_translation_languages':[],
'input_language':'en',
'output_language':'nl',
'auto_detect_input_language':true,
'auto_detect_proofread_input_language':true,
// Rewrite
'summarize_tags':{
'en':[['short','very_short'],'bullet_points'],
'nl':[['kort','heel_kort'],'opsomming'],
},
'rewrite_tags':{
'en':[['formal','casual'],['rational','emotional'],['mature','youthful'],['concise','detailed'],'persuasive','inspiring','romantic','funny','readable','less_repetitive','friendly'],
'nl':[['formeel','informeel'],['rationeel','emotioneel'],['volwassen','jeugdig'],['kort','gedetaileerd'],'overtuigend','inspirerend','grappig','leersbaar','minder herhalend','vriendelijk']
},
'recent_rewrite_prompts':[],
// Prompts
'proofread_prompt':'',
'summarize_prompt':'',
'rewrite_prompt':'',
'question_prompt':'',
'rag_search_prompt':'',
'image_to_text_prompt':'',
'prompt_at_line':'',
}
</script>
<style>
:root {
--body-bg:#1a1924;
--main-bg-color: #151515;
--body-weaker-bg:#2a2934;
--body-even-weaker-bg: #444;
--chat-bg:#242424;
--chat-section-bg:#1c1c1c;
--chat-header-bg: #333333;
--chat-footer-bg: #333333;
--chat-bubble-text-color:#fafafa;
--user-chat-bubble-bg:rgb(49 165 66);
--median-bg:#888;
--chat-messages-bg:#1c1c1c;
--selected-tag-bg:#292929;
--editor-bg:#222;
--editor-header-bg:#222;
--weak-semi-transparent-bg:rgba(255,255,255,.1);
--inverted-main-bg-color:#d7d7d7;
--text-color: #ddd;
--light-text-color:#ccc;
--strong-text-color:#eee;
--strongest-text-color:#fff;
--inverted-text-color:#222;
--inverted-strongest-text-color:#000;
--green-bg:#3b7708;
--green-text-color:#028d45;
--assistant-status-text-color: #00B37E;
--sidebar-bg: rgb(43 43 43);
--sidebar-header-bg: #333;
--dialog-bg: #666;
--files-bg: rgb(54, 54, 54);
--highlight-bg: #151546;
--selected-bg:#282c7b;
--dropdown-bg:#5e5e5e;
--developer-bubble-bg:#444;
--assistant-bubble-bg:#633BBC;
--assistant-bubble-text-color:white;
--user-bubble-bg:#0e9130;
--user-bubble-text-color:white;
--input-bg: #1c212c;
--input-focus-bg:#0c111c;
--input-color: #ddd;
--item-hover-bg:rgb(40,40,40);
--button-blue-bg: #0e5981;
--button-bg: #0e5981;
--button-text-color:#bbb;
--button-hover-bg:#027fc0;
--button-hover-color:#fff;
--button-warning-bg:#ad6201;
--thin-border-color:transparent;
--thick-border-color:#666;
--indent-marker-bg-color: #6495ed;
--tools-bg:#444;
--light-selected-bg:#777;
--code-statements:#b6b6b6;
--code-functions:#b4b4fa;
--code-parameters:#d486d8;
--code-comments:#d4ce6b;
--code-values:#CB8F5B;
--code-strings:#b883bf;
/* universal */
--orange:#b35a03;
--orange-bg:#e69603;
--red-bg:red;
}
.light {
--body-bg:#ddd;
--main-bg-color: #eee;
--body-weaker-bg: #ccc;
--body-even-weaker-bg: #bbb;
--chat-bg:#ccc;
--chat-section-bg: #b6b6b6;/*#240030;*/
--selected-tag-bg:#dcdcdc;
--editor-bg:#ddd;
--editor-header-bg:#d6d6d6;
--weak-semi-transparent-bg:rgba(0,0,0,.1);
--inverted-main-bg-color:#000;
--sidebar-bg: #d6d6d6;
--sidebar-header-bg: #bfbfbf;
--chat-header-bg: #bfbfbf;
--chat-footer-bg: #bfbfbf;
--tools-bg:#ccc;
--dialog-bg: #666;
--files-bg: #c7c7c7;
--text-color: #222;
--light-text-color:#333;
--strong-text-color:#111;
--strongest-text-color:#000;
--inverted-text-color:#ddd;
--inverted-strongest-text-color:#fff;
--highlight-bg: #e7e7e7;
--selected-bg:rgba(0,0,0,.3);
--dropdown-bg:#a09e9e;
--dropdown-bg:#888;
--developer-bubble-bg:#e6e6e6;
--assistant-bubble-bg:#633BBC;
--user-bubble-bg:#07847e;
--input-bg: #e3ded3;
--input-focus-bg:#f3eee3;
--input-color: #222;
--item-hover-bg:#eee;
--button-bg: #0e5981; /*#0172ad;*/
--button-blue-bg: #0e5981;
--button-text-color:#ddd;
--button-hover-bg:#027fc0;
--button-hover-color:#fff;
--button-warning-bg:#ad6201;
--thin-border-color:#bbb;
--thick-border-color:#666;
--indent-marker-bg-color: #6495ed;
--light-selected-bg:#999;
--code-statements:#896E4B;
--code-functions:#4949ea;
--code-parameters:#c128ca;
--code-comments:#b05206;
--code-values:#CB8F5B;
--code-strings:#b883bf;
--chat-messages-bg:#aaa;
color:#1b1a0e;
}
*{
padding: 0;
margin: 0;
background: none;
color: inherit;
border: none;
appearance: none;
outline: none;
box-sizing:border-box;
}
html,body{
height:100%;
letter-spacing: .2px;
font-weight:300;
overflow:hidden;
overscroll-behavior-y: none;
}
body{
position:relative;
}
.hide-if-loading{
transition: opacity linear .3s;
}
body.loading .hide-if-loading{
opacity:0.1;
pointer-events:none;
}
.center{
display:flex;
align-items:center;
justify-content:center;
}
.align-right{
text-align:right;
}
body.update-available .show-if-update-downloading,
body:not(.update-available) .show-if-update-available,
body:not(.many-files) .show-if-many-files,
body.serverless .hide-if-serverless{
display:none!important;
}
#musicgen-prompt-settings-container,
#speaker-voice-buttons-container{
display:none;
}
@media only screen and (max-width: 641px) {
.hide-if-mobile{
display:none;
}
}
/*body.mobile .hide-if-mobile,*/
.hide-if-empty:empty,
body:not(.mobile) .show-if-mobile,
body:not(.idle) .show-if-idle,
body:not(.doing-summarize) .show-if-summarize,
body:not(.doing-rewrite) .show-if-rewrite,
body:not(.doing-continue) .show-if-continue,
body:not(.doing-translation) .show-if-translation{
display:none;
}
.cm-gutters{
background-color:transparent!important;
border-right:none!important;
}
body.web-gpu .hide-if-web-gpu,
body.web-gpu32 .hide-if-web-gpu{
display:none
}
.file-loading-warning-container,
.files-loading-warning-container{
background-color:var(--median-bg);
color:var(--inverted-text-color);
}
body
.file-loading-warning-container{
display:none;
}
body.loading-file #content-container .file-loading-warning-container{
display:flex;
}
#content-container{
display:flex;
height:100%;
max-height:100%;
width:100%;
max-width:100vw;
position:fixed;
top:0;
}
#playground-sidebar{
width:0;
overflow-x:hidden;
transition: 0.1s left ease;
position:relative;
}
.sidebar #playground-sidebar{
width:300px;
min-width:200px;
display:flex;
flex-direction:column;
}
#do-pip-button{
display:none;
}
#tutorial-menu{
height:50px;
max-height:50px;
padding:0;
overflow:visible;
position:relative;
}
#tutorial-menu-inner{
height:50px;
}
</style>
<link rel="stylesheet" href="./css/early.css">
<link rel="stylesheet" href="./css/chat_style.css">
<link rel="stylesheet" href="./css/style.css">
<!--
<link rel="stylesheet" href="./codemirror/codemirror.css">
<link rel="stylesheet" href="./codemirror/codemirror_dialog.css">
<link rel="stylesheet" href="./pcss/context_menu_kali_dark.css">
<link rel="stylesheet" href="codemirror/dracula.css">
-->
<!--
<script src="vex/js/vex.combined.min.js"></script>
<link rel="stylesheet" href="vex/css/vex.css">
<link rel="stylesheet" href="vex/css/vex-theme-top.css">
-->
<link rel="stylesheet" href="./pcss/playground.css">
<link rel="stylesheet" href="./css/combo.css">
<style id="css-output"></style>
</head>
<body id="assistant-developer" class="loading sidebar-chat busy-restoring-files no-files-in-folder web-gpu intro serverless no-text-ai-loaded unknown-language idle chat-shrink chat-message-form-minimum-height first-run">
<div id="flash-message" style="background-color:green"></div>
<img src="images/papegai_logo.svg" alt="Logo" height="50" width="50" style="display:none">
<div id="bad-browser" class="fixed-hint" data-i18n="sorry_bad_browser" style="display:none">⚠️ Sorry, your browser (or at least the current version) is not supported</div>
<button id="open-sidebar-button" class="hide-if-loading"><img class="toggle-secion-chevron" src="images/chat_shrink_arrow.svg" width="22" height="22" alt="Close"></button><!--<span class="hamburger-icon hamburger-icon-open">≡</span>-->
<div id="content-container">
<div id="sidebars">
<div id="sidebars-header-wrapper">
<div id="sidebars-header">
<div id="sidebar-header-tab-buttons"> <!-- 📄 💬 ⚙️ -->
<span
id="sidebar-header-docs-button" data-tab="documents" class="svg-icon"><img class="sidebar-header-icon" width="30" height="30" alt="documents icon" src="images/document.svg"></span><span
id="sidebar-header-chat-button" data-tab="chat" class="svg-icon"><img class="sidebar-header-icon" width="30" height="30" alt="chat icon" src="images/chat.svg"></span><span
id="sidebar-header-settings-button" data-tab="settings" title="Open settings" class="svg-icon"><span id="sidebar-header-settings-button-update-indicator" class="show-if-update-available">🔔</span><img class="sidebar-header-icon" width="36" height="36" alt="settings icon" src="images/settings.svg"></span>
</div>
<div id="rewrite-results-ready-container">
<div id="rewrite-results-ready-hint" class="center"><span class="unicode-icon">✏️</span><span id="rewrite-results-ready-counter"></span></div>
</div>
<div id="close-sidebar-button"><img class="toggle-secion-chevron" src="images/chat_shrink_arrow.svg" width="22" height="22" alt="Close"></div><!--<span class="hamburger-icon hamburger-icon-close">≡</span>-->
</div>
</div>
<div id="sidebars-content">
<div id="file-drag-overlay" data-i18n="Drop_here_to_open">Drop<br>here<br><br>to<br>open</div>
<div id="sidebar-filter-container">
<div class="flex">
<input id="sidebar-filter-input" type="search" value="" placeholder="Filter" data-i18n-placeholder="Filter" >
</div>
</div>
<div id="select-assistants-button-wrapper" class="hide-if-loading">
<div id="create-custom-assistant-button-container">
<button id="add-custom-assistant-button" ><span data-i18n="Custom_AI">Custom AI</span></button>
</div>
<span></span>
<div class="flex">
<div id="add-assistants-hint-container">
<span id="add-assistants-hint" data-i18n="Add_more_AIs">Add more AI's</span>
</div>
<div id="select-assistants-button">
<div class="circle-square-button">
<div class="btn-stage plus-icon"> </div>
<span class="btn-stage">Save</span>
</div>
</div>
</div>
</div>
<div id="chat-sidebar-container" class="chat">
<div id="chat-sidebar" class="chat-sidebar">
<div class="contacts">
<div id="contacts-list">
<div id="generated-contacts-list">
<div class="selected-ai">
<div class="contact-item">
<img src="images/developer.png" alt="The developer">
<div class="contact">
<div class="name">Loading</div>
<div class="message" data-i18n="developer_description">One moment..</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="playground-sidebar">
<div class="files-loading-warning-container center">
<div class="files-loading-warning center">
<span class="spinner rotating"> </span> <span data-i18n="Loading_files">Loading files</span>
</div>
</div>
<div id="folder-select-container" class="space-between"></div>
<div id="sidebar-tabs">
<div id="file-manager" class="file-pane">
<div id="file-upload-progress-container"></div>
<ul id="file-manager-files-list" class="files"></ul>
<div id="load-all-files-button" class="save button hide-if-serverless file-manager-button" title="Load all real file data into browser storage" data-i18n="Load_all_files">
Load all files
</div>
<div class="padding5 space-between">
<div></div>
<div id="save-all-files-button" class="save button show-if-modified file-manager-button" data-i18n="Save_all">
Save all
</div>
<div id="download-all-files-button" class="save button center show-if-many-files file-manager-button">
<img src="data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" data-src="images/download.svg" class="svg-icon" width="20" height="20" alt="Download" title="Download"> <span data-i18n="Download_all">Download all</span>
</div>
<div></div>
</div>
<div class="padding5 space-between" id="selective-files-management-buttons">
<div></div>
<!--
<div id="save-all-files-button" class="save button file-manager-button" data-i18n="Save_selected">
Save selected
</div>
-->
<div id="delete-selected-files-button" class="save button center show-if-many-files file-manager-button">
<img src="data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" data-src="images/delete.svg" class="svg-icon" width="20" height="20" alt="Delete selected" title="Delete selected"> <span data-i18n="Delete_selected">Delete selected</span>
</div>
<div></div>
</div>
<div class="padding5 space-between show-if-developer">
<div></div>
<div id="take-snapshot-button" class="save button file-manager-button" onclick="take_snapshot()" data-i18n="Take_snapshot">
Take snapshot
</div>
<div id="restore-snapshot-button" class="save button show-if-snapshot file-manager-button" onclick="choose_snapshot()" data-i18n="Restore_snapshot">
Restore snapshot
</div>
<div></div>
</div>
</div>
<div id="function-index-list"></div>
<div id="sidebar-rag-search-container">
<div id="sidebar-rag-header" class="centered-space-between"><span id="sidebar-rag-select-all-button" class="grey-button" data-i18n="Select_all">Select_all</span><span></span><div id="sidebar-rag-close-button" class="center" aria-label="close"><div class="round-button close-button-cross bg-icon"></div></div></div> <!-- × --><!-- <span class="bg-icon"></span> -->
<div id="rag-info-container"></div>
<div class="search-input-container">
<textarea id="rag-search-prompt" name="rag-search-prompt" class="prompt" placeholder=""></textarea>
</div>
</div>
</div>
<div id="sidebar-footer">
<div id="sidebar-new-file-and-folder-container">
<div id="new-folder-button" class="new button add-icon" onclick="create_folder()" title="Create new folder">
<span class="unicode-icon">📁</span>
</div>
<div id="new-file-button" class="new button add-icon" onclick="create_file()" title="Create new empty document">
<span class="unicode-icon">📄</span>
</div>
<div id="start-ocr-button" class="new button add-icon" title="Start the camera to scan text">
<img class="" width="26" height="26" alt="Camera icon" src="data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" data-src="images/camera.svg">
</div>
<div id="sidebar-upload-container">
<label class="file-input-label-container">
<input id="upload-file-input" type="file" multiple="multiple" name="upload-file-input" aria-label="file browser">
</label>
</div>
</div>
<div id="sidebar-right-container" class="center">
<div id="start-rag-search-button" class="start-search-button-container center"><div id="start-rag-search-inner-button" class="center"><img class="submit-prompt-button-image" src="data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" data-src="images/submit_rag_search.png" alt="submit"></div></div>
</div>
</div>
</div>
<div id="settings-sidebar">
<div id="settings-sidebar-tabs-buttons-container">
<div id="settings-sidebar-tasks-button" data-i18n="tasks" class="capitalize-first-letter">Tasks</div>
<div id="settings-sidebar-settings-button" data-i18n="Settings" class="capitalize-first-letter">Settings</div>
</div>
<div id="settings-sidebar-tabs-container">
<div id="settings-sidebar-tabs-settings">
<ul>
<li class="flex-space-between flex-align-center settings-select-item">
<span data-i18n='language'>Language</span>
<select id="settings-tab-language-dropdown" class="settings-dropdown">
<option value='en' selected data-i18n="English">English</option>
<option value='nl' data-i18n="Dutch">Dutch</option>
<option value='fr' data-i18n="French">French</option>
<option value='de' data-i18n="German">German</option>
<option value='es' data-i18n="Spanish">Spanish</option>
<option value='it' data-i18n="Italian">Italian</option>
<option value='pt' data-i18n="Portugese">Portugese</option>
<option value='gr' data-i18n="Greek">Greek</option>
<option value='pl' data-i18n="Polish">Polish</option>
<option value='hu' data-i18n="Hungarian">Hungarian</option>
<option value='uk' data-i18n="Ukranian">Ukranian</option>
<option value='ru' data-i18n="Russian">Russian</option>
</select>
</li>
<li id="speaker-voice-select-container" class="flex-space-between flex-align-center settings-select-item">
<span data-i18n='voice'>Voice</span>
<select id="speaker-voice-select" class="settings-dropdown"><option value="default" data-i18n="Automatic" selected>Automatic</option><option value="basic">📢 Basic</option><option value="US female 1">🇺🇸 US female 1</option><option value="US female 2">🇺🇸 US female 2</option><option value="US male 1">🇺🇸 US male 1</option><option value="US male 2">🇺🇸 US male 2</option><option value="Canadian male">🇨🇦 Canadian male</option><option value="Scottish male">🏴 Scottish male</option><option value="Indian male">🇮🇳 Indian male</option></select>
</li>
<li id="interrupt-speaking-select-container" class="flex-space-between flex-align-center settings-select-item">
<span><img class="invert-if-light" src="images/microphone_icon.svg" width="12" height="12" alt="🎤"> <span data-i18n='Interrupt_speaking'>Interrupt speaking</span></span>
<select id="interrupt-speaking-select" class="settings-dropdown"><option value="Auto" data-i18n="Automatic" selected>Auto</option><option data-i18n="Yes" value="Yes">Yes</option><option value="No" data-i18n="No">No</option></select>
</li>
<li id="settings-complexity-select-container" class="flex-space-between flex-align-center settings-select-item">
<span data-i18n="Options">Options</span>
<select id="settings-complexity-select" class="settings-dropdown"><option value="normal" data-i18n='Normal' selected>Normal</option><option value="advanced" data-i18n='Advanced'>Advanced</option><option value="developer" data-i18n='Developer'>Developer</option></select>
</li>
<li id="settings-brightnes-select-container" class="flex-space-between flex-align-center settings-select-item">
<span data-i18n="Brightness">Brightness</span>
<select id="settings-brightness-select" class="settings-dropdown"><option value="default" data-i18n="Automatic" selected>Automatic</option><option value="dark" data-i18n='Dark'>Dark</option><option value="light" data-i18n="Light">Light</option></select>
</li>
<li id="settings-disk-space-select-container" class="flex-space-between flex-align-center">
<span data-i18n="Disk_space">Disk space</span>
<span id="total-disk-space-used"></span>
<button id="show-models-list-button" data-i18n="Manage">Manage</button>
</li>
<li id="settings-save-backup-select-container" class="flex-space-between flex-align-center show-if-advanced">
<span data-i18n="Backup settings">Backup settings</span>
<button id="save-settings-backup-button" data-i18n="Save">Save</button>
</li>
<li id="enable-notifications-container" class="flex-space-between flex-align-center">
<span data-i18n="Notifications">Notifications</span>
<!--<button id="enable-notifications-button" class="always-blue-button" data-i18n="Enable">Enable</button>-->
<div id="enable-notifications-checkbox-container"><input id="enable-notifications-checkbox" class="toggle" type="checkbox"></div>
</li>
<li id="settings-update-progress-container" class="show-if-update-downloading">
<span class="flex-between"><span data-i18n="Downloading_update">Downloading update</span> <span id="update-download-version"></span></span>
<progress id="update-download-progress">
</li>
<li id="settings-update-container" class="flex-space-between flex-align-center show-if-update-available">
<span data-i18n="Update">New version</span>
<button id="apply-update-button" class="always-blue-button" data-i18n="Update">Update</button>
</li>
</ul>
<ul id="scary-settings">
<li id="papegai-cross-origin-result-container" class="flex-space-between flex-align-center settings-button-item show-if-developer">
<span>Cross origin isolated</span>
<div id="cross-origin-isolated-checkbox-container"></div>
</li>
<li id="papegai-test-container" class="flex-space-between flex-align-center settings-button-item show-if-developer">
<span>Debug</span>
<span><button onclick="test();">DEBUG</button> <button onclick="pause_interval();">⏸️</button></span>
</li>
<li id="papegai-limit-memory-use-container" class="flex-space-between flex-align-center settings-button-item show-if-advanced">
<span>Limit memory use (<span id="limited-ram"></span>)</span>
<select id="settings-limit-memory-use-select" class="settings-dropdown" style="min-width:50px"><option value="0" selected>Auto</option><option value="2000">2GB</option><option value="4000">4GB</option><option value="8000">8GB</option><option value="16000">16GB</option></select>
</li>
<li id="papegai-unregister-service-container" class="flex-space-between flex-align-center settings-button-item show-if-developer">
<span>Serviceworker</span>
<button onclick="unregister_serviceworkers();">Unregister</button>
</li>
<li id="papegai-reset-container" class="flex-space-between flex-align-center settings-button-item show-if-advanced">
<span>Papeg.ai <span id="papegai-version"></span></span>
<button id="clear-site-cache-button" data-i18n="Reload">RELOAD</button>
</li>
<li id="settings-reset-container" class="flex-space-between flex-align-center settings-button-item">
<button id="clear-local-storage-button" data-i18n="Delete_settings">CLEAR SETTINGS</button>
</li>
<li id="data-reset-container" class="flex-space-between flex-align-center settings-button-item">
<button id="clear-data-button" data-i18n="Delete_my_files">DELETE MY FILES</button>
</li>
<li id="clear-everything-container" class="flex-space-between flex-align-center settings-button-item show-if-developer">
<button id="clear-everything-button">☢️ FULL RESET</button>
</li>
</ul>
</div>
<div id="settings-sidebar-tabs-tasks">
<div id="settings-used-memory-container" class="flex-space-between flex-align-center show-if-advanced">
<span data-i18n="Memory_use">Memory use</span>
<span>
<span id="used-memory">?</span><span class="gigabytes-span">GB</span>
<span id="total-memory-wrapper">/<span id="total-memory"></span></span>
</span>
</div>
<div id="running-tasks-list-container" class="show-if-advanced"></div>
<div id="simple-tasks-list-container"></div>
<div id="clear-tasks-button-container" class="center">
<button id="clear-tasks-button" data-i18n="Clear" class="small-button">Clear</button>
</div>
</div>
<div id="simple-task-list-play-button-container">
<div id="simple-task-list-play-button">▶️</div>
</div>
</div>
</div>
</div>
</div>
<div id="main-chat" class="chat">
<div id="chat-content" class="content">
<div id="message-header-container">
<div class="message-header">
<div id="back-button-container">
<img id="back-button" src="images/left_arrow.svg" alt="⬅️">
</div>
<div id="user-info-wrapper">
<div class="user-info">
<div id="chat-header-icon-container" class="center">
<div id="chat-header-emoji-icon-container" class="center"></div>
<img id="chat-header-icon" src="images/developer.png" alt="Current AI icon">
</div>
<div class="user">
<div id="chat-header-name" class="name capitalize-first-letter"></div>
<div class="time user-status show-if-model-loaded"><span data-i18n="online">online</span></div>
<div class="time user-status show-if-model-not-loaded" data-i18n="offline">offline</div>
</div>
</div>
</div>
<div id="chat-header-actions" class="actions">
<div class="action-item center" id="clear-assistant-button"><span class="unicode-icon">♻️</span></div>
<div class="action-item" id="stop-assistant-button"><div id="stop-assistant-button-slide-wrapper"><div id="stop-assistant-button-assistant-icon-container" class="center"><img id="stop-assistant-button-assistant-icon" class="assistant-icon-img" src="images/developer.png" alt="AI"></div><div id="stop-assistant-button-translator-icon-container" class="center"><img id="stop-assistant-button-translator-icon" class="assistant-icon-img" src="data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" data-src="images/translator.png" alt="Translator"></div><div id="stop-assistant-interrupt-button" class="center"><span class="unicode-icon">🛑<span class="unicode-icon-overlay">✋</span></span></div></div></div>
<div class="action-item center" id="mobile-back-to-document-button"><img width="25" height="25" alt="documents icon" src="images/document.svg"></div>
<div class="action-item center" id="shrink-assistant-button"><img class="toggle-secion-chevron" src="images/chat_shrink_arrow.svg" width="22" height="22" alt="Close"></div>
</div>
</div>
<div id="chat-recording-warning" class="warning-section">
<div class="recording-warning"><span class="warning-unicode-icon">🎙️</span><span data-i18n="Recording_audio">Audio is being recorded</span></div>
</div>
</div>
<div id="model-info-container"></div>
<div id="message-content-container">
<div id="pane-content-developer" class="message-content-wrapper"><div id="pane-content-developer-reverser" class="message-content-reverser"><div id="pane-content-developer-chats" class="message-content"></div></div><div id="pane-content-developer-status" class="message-status-container"><div class="message-status1"></div><div class="message-status2"></div></div></div>
<div id="pane-content-translator" class="message-content-wrapper"><div id="pane-content-translator-reverser" class="message-content-reverser"><div id="pane-content-translator-chats" class="message-content"></div></div><div id="pane-content-translator-status" class="message-status-container"><div class="message-status1"></div><div class="message-status2"></div></div></div>
<div id="pane-content-scribe" class="message-content-wrapper"><div id="pane-content-scribe-reverser" class="message-content-reverser"><div id="pane-content-scribe-chats" class="message-content"></div></div><div id="pane-content-scribe-status" class="message-status-container"><div class="message-status1"></div><div class="message-status2"></div></div></div>
<div id="pane-content-text_to_image" class="message-content-wrapper"><div id="pane-content-text_to_image-reverser" class="message-content-reverser"><div id="pane-content-text_to_image-chats" class="message-content"></div></div><div id="pane-content-text_to_image-status" class="message-status-container"><div class="message-status1"></div><div class="message-status2"></div></div></div>
<div id="pane-content-fast_llama3_1b" class="message-content-wrapper"><div id="pane-content-fast_llama3_1b-reverser" class="message-content-reverser"><div id="pane-content-fast_llama3_1b-chats" class="message-content"></div></div><div id="pane-content-fast_llama3_1b-status" class="message-status-container"><div class="message-status1"></div><div class="message-status2"></div></div></div>
<div id="pane-content-llama3_1b" class="message-content-wrapper"><div id="pane-content-llama3_1b-reverser" class="message-content-reverser"><div id="pane-content-llama3_1b-chats" class="message-content"></div></div><div id="pane-content-llama3_1b-status" class="message-status-container"><div class="message-status1"></div><div class="message-status2"></div></div></div>
<div id="pane-content-fast_llama3_3b" class="message-content-wrapper selected-pane"><div id="pane-content-fast_llama3_3b-reverser" class="message-content-reverser"><div id="pane-content-fast_llama3_3b-chats" class="message-content"></div></div><div id="pane-content-fast_llama3_3b-status" class="message-status-container"><div class="message-status1"></div><div class="message-status2"></div></div></div>
<div id="pane-content-llama3_3b" class="message-content-wrapper"><div id="pane-content-llama3_3b-reverser" class="message-content-reverser"><div id="pane-content-llama3_3b-chats" class="message-content"></div></div><div id="pane-content-llama3_3b-status" class="message-status-container"><div class="message-status1"></div><div class="message-status2"></div></div></div>
<div id="pane-content-fast_mistral" class="message-content-wrapper"><div id="pane-content-fast_mistral-reverser" class="message-content-reverser"><div id="pane-content-fast_mistral-chats" class="message-content"></div></div><div id="pane-content-fast_mistral-status" class="message-status-container"><div class="message-status1"></div><div class="message-status2"></div></div></div>
<div id="pane-content-mistral" class="message-content-wrapper"><div id="pane-content-mistral-reverser" class="message-content-reverser"><div id="pane-content-mistral-chats" class="message-content"></div></div><div id="pane-content-mistral-status" class="message-status-container"><div class="message-status1"></div><div class="message-status2"></div></div></div>
<div id="pane-content-danube_3_500m" class="message-content-wrapper"><div id="pane-content-danube_3_500m-reverser" class="message-content-reverser"><div id="pane-content-danube_3_500m-chats" class="message-content"></div></div><div id="pane-content-danube_3_500m-status" class="message-status-container"><div class="message-status1"></div><div class="message-status2"></div></div></div>
<div id="pane-content-medical6" class="message-content-wrapper"><div id="pane-content-medical6-reverser" class="message-content-reverser"><div id="pane-content-medical6-chats" class="message-content"></div></div><div id="pane-content-medical6-status" class="message-status-container"><div class="message-status1"></div><div class="message-status2"></div></div></div>
<div id="pane-content-mental6" class="message-content-wrapper"><div id="pane-content-mental6-reverser" class="message-content-reverser"><div id="pane-content-mental6-chats" class="message-content"></div></div><div id="pane-content-mental6-status" class="message-status-container"><div class="message-status1"></div><div class="message-status2"></div></div></div>
</div>
<div id="message-downloads-container"></div>
<div id="tools">
<div id="stop-camera-button" class="circular-corner-close-button center" aria-label="close"><div class="center close-button-cross bg-icon"><span class="bg-icon"></span></div></div> <!-- × -->
<div id="close-tools-button" class="circular-corner-close-button center" aria-label="close"><div class="center close-button-cross bg-icon"><span class="bg-icon"></span></div></div>
<div id="yet-another-tools-wrapper">
<div id="tools-content">
<div id="camera-container">
<div id="video-sources-select-container" class="center">
<select id="video-sources-select"></select>
</div>
<div id="camera-video-wrapper">
<video id="camera-video" width="640" height="240" autoplay playsinline></video>
<div id="camera-overlay-canvas-container">
<canvas id="camera-overlay-canvas" width="1920" height="1080"></canvas>
</div>
<div id="camera-overlay-scan-hint-container"></div>
<div id="camera-overlay-svg-container"></div>
<div id="camera-video-flasher"></div>
</div>
<div id="video-buttons">
<button id="camera-take-picture-button" onclick="window.take_picture()"><span class="unicode-icon">📸</span><!-- <span id="live-camera-take-picture-hint" class="hide-if-advanced" data-i18n="Take_picture">Take picture</span>--></button>
<button id="camera-ocr-scan-button"><span class="img-icon"><img src="data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" data-src="images/image_to_text_ocr_thumb.png" width="20" height="20" alt="Document scanner icon"></span><!--<span class="unicode-icon">🧾</span>--> <span data-i18n="Scan">Scan</span> <span id="doing-ocr-scan-counter"></span></button>
<button id="camera-image_to_text-describe-button"><span class="img-icon"><img src="data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" data-src="images/image_to_text_thumb.png" width="20" height="20" alt="Describe image icon"></span><!--<span class="unicode-icon">🧾</span>--> <span data-i18n="Describe">Describe</span></button>
</div>
<details id="camera-do-ocr-details" class="tools-details">
<summary class="summary-button" id="camera-do-ocr-summary-button">
<span class="h3" id="camera-ocr-scan-dialog-title"><span class="img-icon"><img src="data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" data-src="images/image_to_text_ocr_thumb.png" width="20" height="20" alt="Document scanner icon"></span> <span data-i18n="image_to_text_ocr_name">Document scanner</span></span>
</summary>
<div class="details-content">
<div class="camera-sleeping-hint center"><div class="flex"><span class="spinner rotating"> </span> <span data-i18n="Waiting_to_scan_again">Waiting to scan again...</span></div></div>
<div id="live-ocr-scans-say-scan-hint" class="hint-area"><p data-i18n="Say_scan_the_document">If you use voice control, then say 'scan' or 'scan the document'.</p></div>
<div id="live-ocr-scans-container" class="flex-between"></div>
<div id="live-ocr-output-container" class="flex-between">
<textarea id="live-ocr-output" placeholder=""></textarea>
<div class="bubble-buttons-container"><div id="camera-ocr-insert-button" class="bubble-insert-into-doc-button bubble-doc-button">📄</div><div id="camera-ocr-new-document-button" class="bubble-new-doc-button bubble-doc-button add-icon">📄</div></div>
</div>
<progress id="camera-ocr-scan-progress" value="0"></progress>
<div id="camera-ocr-footer-buttons-container"><button id="camera-ocr-improve-button" data-i18n="Improve">Improve</button></div>
<div id="camera-ocr-scan-intensity-container" class="range-setting-container">
<label for="camera-ocr-scan-intensity-input" class="simple-input-label" data-i18n="Scan_intensity">Scan intensity</label>
<input id="camera-ocr-scan-intensity-input" type="range" min="1" max="5" step="1" value="1">
</div>
<div id="camera-ocr-auto-scan-container" class="checkbox-setting-container">
<input id="camera-ocr-auto-scan-input" type="checkbox"><label for="camera-ocr-auto-scan-input" class="simple-input-label" data-i18n="Continuous_scanning">Continuous scanning</label>
</div>
<div id="camera-ocr-save-scan-container" class="checkbox-setting-container">
<input id="camera-ocr-save-scan-input" type="checkbox" checked><label for="camera-ocr-save-scan-input" class="simple-input-label" data-i18n="Save_to_document">Save to document</label>
</div>
</div>
</details>
<details id="camera-image-to-text-details" class="tools-details">
<summary role="button" id="camera-image_to_text-summary-button">
<span class="h3" id="camera-image_to_text-scan-dialog-title"><span class="img-icon"><img src="data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" data-src="images/image_to_text_thumb.png" width="20" height="20" alt="Describe icon"></span> <span data-i18n="image_to_text_name">Image describer</span></span>
</summary>
<div class="details-content">
<div id="live-image_to_text-prompt-container" class="flex-between">
<div id="live-image_to_text-thumbnail-container"></div>
<textarea id="live-image_to_text-prompt" class="prompt" placeholder=""></textarea>
</div>
<div id="live-image_to_text-output-container" class="flex-between">
<textarea id="live-image_to_text-output" class="prompt" placeholder="."></textarea>
<div class="bubble-buttons-container"><div id="camera-image_to_text-insert-button" class="bubble-insert-into-doc-button bubble-doc-button">📄</div><div id="camera-image_to_text-new-document-button" class="bubble-new-doc-button bubble-doc-button add-icon">📄</div></div>
</div>
<progress id="camera-image_to_text-scan-progress" value="0"></progress>
<div id="camera-image_to_text-auto-scan-container" class="checkbox-setting-container">
<input id="camera-image_to_text-auto-scan-input" type="checkbox"><label for="camera-image_to_text-auto-scan-input" class="simple-input-label" data-i18n="Continuous_scanning">Continuous scanning</label>
</div>
<div id="camera-image_to_text-save-auto-scan-container" class="checkbox-setting-container">
<input id="camera-image_to_text-save-auto-scan-input" type="checkbox" checked><label for="camera-image_to_text-save-auto-scan-input" class="simple-input-label" data-i18n="Save_to_document">Save to document</label>
</div>
</div>
</details>
<canvas id="video-canvas" width="1920" height="1080"></canvas>
</div>
<div id="tools-rewrite-container">
<div id="rewrite-dialog-header-wrapper">
<div id="rewrite-dialog-header">
<button id="close-rewrite-dialog-button" class="corner-close-button close-button-cross bg-icon" name="close-rewrite-tools-button" aria-label="close" type="button"></button><!-- × -->
</div>
</div>
<div id="rewrite-dialog">
<div id="tools-header" class="flex-between">
<div id="rewrite-dialog-selected-text-container">
<div id="rewrite-dialog-selected-text"></div>
<div id="rewrite-dialog-selected-text-overlay"></div>
</div>
<span></span>
</div>
<details id="proofread-details" class="tools-details">
<summary>
<span class="h3" id="proofread-dialog-title"><span class="svg-icon"><img src="images/glasses.svg" width="25" height="25" alt="👓"></span> <span data-i18n="Proofread">Proofread</span></span>
</summary>
<div class="details-content">
<div id="proofread-dialog-content-toggles-and-tags-container">
<div id="proofread-dialog-content-toggles-container"></div>
<div id="proofread-dialog-content-tags-container"></div>