khoj 1.20.5.dev15__py3-none-any.whl → 1.20.5.dev18__py3-none-any.whl

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 (38) hide show
  1. khoj/configure.py +5 -32
  2. khoj/database/adapters/__init__.py +61 -20
  3. khoj/database/admin.py +4 -2
  4. khoj/database/migrations/0057_remove_serverchatsettings_default_model_and_more.py +51 -0
  5. khoj/database/models/__init__.py +5 -4
  6. khoj/interface/compiled/404/index.html +1 -1
  7. khoj/interface/compiled/_next/static/chunks/{9178-ef3257c08d8973c8.js → 9178-b9ab3fa2e9be8287.js} +1 -1
  8. khoj/interface/compiled/_next/static/chunks/app/chat/page-c2ebc47a09abc8ae.js +1 -0
  9. khoj/interface/compiled/_next/static/chunks/app/settings/page-1a2acc46cdabaf4a.js +1 -0
  10. khoj/interface/compiled/_next/static/css/{2bfe35fbe2c97a56.css → 9369a9dea99c97e8.css} +1 -1
  11. khoj/interface/compiled/agents/index.html +1 -1
  12. khoj/interface/compiled/agents/index.txt +1 -1
  13. khoj/interface/compiled/automations/index.html +1 -1
  14. khoj/interface/compiled/automations/index.txt +1 -1
  15. khoj/interface/compiled/chat/index.html +1 -1
  16. khoj/interface/compiled/chat/index.txt +2 -2
  17. khoj/interface/compiled/factchecker/index.html +1 -1
  18. khoj/interface/compiled/factchecker/index.txt +2 -2
  19. khoj/interface/compiled/index.html +1 -1
  20. khoj/interface/compiled/index.txt +1 -1
  21. khoj/interface/compiled/search/index.html +1 -1
  22. khoj/interface/compiled/search/index.txt +1 -1
  23. khoj/interface/compiled/settings/index.html +1 -1
  24. khoj/interface/compiled/settings/index.txt +2 -2
  25. khoj/interface/compiled/share/chat/index.html +1 -1
  26. khoj/interface/compiled/share/chat/index.txt +2 -2
  27. khoj/processor/tools/online_search.py +10 -5
  28. khoj/routers/api_chat.py +22 -9
  29. khoj/routers/helpers.py +28 -12
  30. {khoj-1.20.5.dev15.dist-info → khoj-1.20.5.dev18.dist-info}/METADATA +1 -1
  31. {khoj-1.20.5.dev15.dist-info → khoj-1.20.5.dev18.dist-info}/RECORD +36 -35
  32. khoj/interface/compiled/_next/static/chunks/app/chat/page-37ff98d93e65b5a4.js +0 -1
  33. khoj/interface/compiled/_next/static/chunks/app/settings/page-b0fae6e054ca311e.js +0 -1
  34. /khoj/interface/compiled/_next/static/{K0mF1QxJRVM2LVZZQ_Edc → StJQhDfsnRaHEWnrxvjj3}/_buildManifest.js +0 -0
  35. /khoj/interface/compiled/_next/static/{K0mF1QxJRVM2LVZZQ_Edc → StJQhDfsnRaHEWnrxvjj3}/_ssgManifest.js +0 -0
  36. {khoj-1.20.5.dev15.dist-info → khoj-1.20.5.dev18.dist-info}/WHEEL +0 -0
  37. {khoj-1.20.5.dev15.dist-info → khoj-1.20.5.dev18.dist-info}/entry_points.txt +0 -0
  38. {khoj-1.20.5.dev15.dist-info → khoj-1.20.5.dev18.dist-info}/licenses/LICENSE +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: khoj
3
- Version: 1.20.5.dev15
3
+ Version: 1.20.5.dev18
4
4
  Summary: Your Second Brain
5
5
  Project-URL: Homepage, https://khoj.dev
6
6
  Project-URL: Documentation, https://docs.khoj.dev
@@ -1,5 +1,5 @@
1
1
  khoj/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- khoj/configure.py,sha256=PMK7yNTK20NXTNsvmtrTw_eup53IEBiQBnftqOGtv3k,18466
2
+ khoj/configure.py,sha256=C5xSS_1ptxgfRfabQ0zZoFteASIS4mCFMvdkdCMVvSs,17019
3
3
  khoj/main.py,sha256=58Rssq2H5AM69dA2UyGHye3vPAMp5RRS6xLcGkB_G_w,8147
4
4
  khoj/manage.py,sha256=njo6uLxGaMamTPesHjFEOIBJbpIUrz39e1V59zKj544,664
5
5
  khoj/app/README.md,sha256=PSQjKCdpU2hgszLVF8yEhV7TWhbEEb-1aYLTRuuAsKI,2832
@@ -8,10 +8,10 @@ khoj/app/asgi.py,sha256=soh3C1xazlgHt_bDgKzrfzo2TKXbNYJsckcXNEgTip8,388
8
8
  khoj/app/settings.py,sha256=M6sQUu_AdeKl3eruecBaifRBhYOBIait0KA2NPizcBM,6198
9
9
  khoj/app/urls.py,sha256=7ECnusoAPAfbO_H_b5FUzYGvnb4LLdWaRDyKNvYuBvg,869
10
10
  khoj/database/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- khoj/database/admin.py,sha256=3V23Fzl9bNPlvhu08GtGH7dwJpQdaYQxGxuUpNGQQOA,9098
11
+ khoj/database/admin.py,sha256=bYF13peHgHpugd9bkEwYzO1r-r5l9JIDjCQbdmK3tT8,9166
12
12
  khoj/database/apps.py,sha256=pM4tkX5Odw4YW_hLLKK8Nd5kqGddf1en0oMCea44RZw,153
13
13
  khoj/database/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
14
- khoj/database/adapters/__init__.py,sha256=PsE5cCNIcO4NW9IJ45KQ05ZB17EjPa_fg3Oibn2kjtM,51141
14
+ khoj/database/adapters/__init__.py,sha256=1cBuozhTjwoVynfidoBf8KzA7X68gvjRnEufEc7y650,52651
15
15
  khoj/database/management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  khoj/database/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  khoj/database/management/commands/change_generated_images_url.py,sha256=w52FwRlyOL4YRpp9O6jJUjSIuGLxVhaS2w1D7gtQgOE,2644
@@ -81,25 +81,26 @@ khoj/database/migrations/0053_agent_style_color_agent_style_icon.py,sha256=j30Fq
81
81
  khoj/database/migrations/0054_alter_agent_style_color.py,sha256=f6RnyvEMR0-Y4R2CtNWfVYHxI_y_nADnD-7o_FoISb4,1151
82
82
  khoj/database/migrations/0055_alter_agent_style_icon.py,sha256=0lkxmyDmOW_3CsnLl8iEsCI6qHi2YS9wfdFfDMNbZ4k,1218
83
83
  khoj/database/migrations/0056_searchmodelconfig_cross_encoder_model_config.py,sha256=RuR5lyAp6T_bRg2gxhOGS4dfXOWBBEQ3bAvKf4ru5Gw,430
84
+ khoj/database/migrations/0057_remove_serverchatsettings_default_model_and_more.py,sha256=q00paabxofoeWe3FXVLE901KwEn9Q3bRMW2TtAbmtUE,1608
84
85
  khoj/database/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
85
- khoj/database/models/__init__.py,sha256=ObqIHUCRsmw8gvJfxIEBuY4x5rbn2Q1W-M4yd32SHHs,19003
86
+ khoj/database/models/__init__.py,sha256=HC25ln3PL1DtjcAoPaTsOcWpb9Ley1zvBGuJwkgVbpM,19085
86
87
  khoj/interface/compiled/agents.svg,sha256=yFCRwIM-Qawa0C5ggAo3ekb-Q1ElmotBOKIGhtfIQqM,1722
87
88
  khoj/interface/compiled/automation.svg,sha256=o7L2XYwJWRSMvl8h6TBv6Pt28RTRVMHqF04EPY0AFj0,1467
88
89
  khoj/interface/compiled/chat.svg,sha256=l2JoYRRgk201adTTdvJ-buKUrc0WGfsudix5xEvtM3A,2424
89
90
  khoj/interface/compiled/close.svg,sha256=hQ2iFLkNzHk0_iyTrSbwnWAeXYlgA-c2Eof2Iqh76n4,417
90
91
  khoj/interface/compiled/copy-button-success.svg,sha256=byqWAYD3Pn9IOXRjOKudJ-TJbP2UESbQGvtLWazNGjY,829
91
92
  khoj/interface/compiled/copy-button.svg,sha256=05bKM2eRxksfBlAPT7yMaoNJEk85bZCxQg67EVrPeHo,669
92
- khoj/interface/compiled/index.html,sha256=lJY4dGt357Fht7jALAA5UH1l51ABaQ9wC3afxnq8Xxc,11912
93
- khoj/interface/compiled/index.txt,sha256=hFiomc7dWGRt9s322DYvvZwabGBdiG0jHq96qVXvqRQ,5515
93
+ khoj/interface/compiled/index.html,sha256=oAufh_bMchFpQq8GNV6Tm-mKGKnRB5MXCsQ04hF1Blc,11912
94
+ khoj/interface/compiled/index.txt,sha256=to_gH_6XD3VgdDY06dnyYbJ_twoXLPU3N-1OKcEO48c,5515
94
95
  khoj/interface/compiled/khoj.webmanifest,sha256=lsknYkvEdMbRTOUYKXPM_8krN2gamJmM4u3qj8u9lrU,1682
95
96
  khoj/interface/compiled/logo.svg,sha256=_QCKVYM4WT2Qhcf7aVFImjq_s5CwjynGXYAOgI7yf8w,8059
96
97
  khoj/interface/compiled/send.svg,sha256=VdavOWkVddcwcGcld6pdfmwfz7S91M-9O28cfeiKJkM,635
97
98
  khoj/interface/compiled/share.svg,sha256=91lwo75PvMDrgocuZQab6EQ62CxRbubh9Bhw7CWMKbg,1221
98
99
  khoj/interface/compiled/thumbs-down.svg,sha256=JGNl-DwoRmH2XFMPWwFFklmoYtKxaQbkLE3nuYKe8ZY,1019
99
100
  khoj/interface/compiled/thumbs-up.svg,sha256=yS1wxTRtiztkN-6nZciLoYQUB_KTYNPV8xFRwH2TQFw,1036
100
- khoj/interface/compiled/404/index.html,sha256=oKh618dPf6jgjIqqEv19UovbiNsJNn4ZR_2lotqNIF0,11947
101
- khoj/interface/compiled/_next/static/K0mF1QxJRVM2LVZZQ_Edc/_buildManifest.js,sha256=6I9QUstNpJnhe3leR2Daw0pSXwzcbBscv6h2jmmPpms,224
102
- khoj/interface/compiled/_next/static/K0mF1QxJRVM2LVZZQ_Edc/_ssgManifest.js,sha256=Z49s4suAsf5y_GfnQSvm4qtq2ggxEbZPfEDTXjy6XgA,80
101
+ khoj/interface/compiled/404/index.html,sha256=-WqSYQK43xJ3cvxBjBqOz-9ls6yL8Z9QwPKVnPcQn-s,11947
102
+ khoj/interface/compiled/_next/static/StJQhDfsnRaHEWnrxvjj3/_buildManifest.js,sha256=6I9QUstNpJnhe3leR2Daw0pSXwzcbBscv6h2jmmPpms,224
103
+ khoj/interface/compiled/_next/static/StJQhDfsnRaHEWnrxvjj3/_ssgManifest.js,sha256=Z49s4suAsf5y_GfnQSvm4qtq2ggxEbZPfEDTXjy6XgA,80
103
104
  khoj/interface/compiled/_next/static/chunks/1603-fb2d80ae73990df3.js,sha256=CCbOXifiixbhMf7lgTG96225tP1Pou72Wb0Zh6KC1Rs,71007
104
105
  khoj/interface/compiled/_next/static/chunks/2614-7cf01576d4457a75.js,sha256=aUjhjyxNPrZr4bLKzGkGgHH8K4J6g9dfiRjabnmvSDc,1104737
105
106
  khoj/interface/compiled/_next/static/chunks/3062-a42d847c919a9ea4.js,sha256=9UDsx_sY4b4x6jjR_A0AymC9rjBCoCcEpGR4U-0Ej3g,256170
@@ -113,7 +114,7 @@ khoj/interface/compiled/_next/static/chunks/743-1a64254447cda71f.js,sha256=YH4bE
113
114
  khoj/interface/compiled/_next/static/chunks/8423-898d821eaab634af.js,sha256=W8aFQibnAqcbhPYoD_WzHKoMwaWt3jXdan7n_LoY4t4,10327
114
115
  khoj/interface/compiled/_next/static/chunks/9001-acbca3e19b1a5ddf.js,sha256=M2hBSe8WTnjEmUlOiOgt_zDJtv3sc4ghnubhkZyMvVA,35460
115
116
  khoj/interface/compiled/_next/static/chunks/9162-4a6d0d0dc5e27618.js,sha256=2csnvP4rJcL4oZlBAEkzeSxBJy4gwYxzAnqzeWbe9fw,149225
116
- khoj/interface/compiled/_next/static/chunks/9178-ef3257c08d8973c8.js,sha256=2wBw6-Bg4NGBNwXOEmfnlVh-lO29bg85b9sirLSxSic,17645
117
+ khoj/interface/compiled/_next/static/chunks/9178-b9ab3fa2e9be8287.js,sha256=oPlzSM8_yBFdp0iNTO1OAeHniR48SsjjZGsTlheBUVQ,17593
117
118
  khoj/interface/compiled/_next/static/chunks/9417-5d14ac74aaab2c66.js,sha256=FZ8xOLMdzrlVmwtcyuQSy8bBwd8_UZ1hH3FlL4DwXpA,17252
118
119
  khoj/interface/compiled/_next/static/chunks/9693-91b03052c5cabded.js,sha256=htVs3WyaR5jF7tXL_VBwqtPcQ53T3s9jWRazqz7DU-c,28957
119
120
  khoj/interface/compiled/_next/static/chunks/d3ac728e-a9e3522eef9b6b28.js,sha256=wK1TsLdl56xtbQG6HMRDpylzTOYXQaAnnn2xobFnX40,267216
@@ -131,22 +132,22 @@ khoj/interface/compiled/_next/static/chunks/app/agents/page-6ade083d5e27a023.js,
131
132
  khoj/interface/compiled/_next/static/chunks/app/automations/layout-27c28e923c9b1ff0.js,sha256=d2vJ_lVB0pfeFXNUPzHAe1ca5NzdNowHPh___SPqugM,5143
132
133
  khoj/interface/compiled/_next/static/chunks/app/automations/page-559111e9b97f158d.js,sha256=N1QwonT08ZsX2okhC0121yNaFe2lHhvjy1I29rf1ssY,33986
133
134
  khoj/interface/compiled/_next/static/chunks/app/chat/layout-8102549127db3067.js,sha256=YIoA3fqOBt8nKWw5iQAwA_avg2t1Q5Afn65IA5PBOz4,374
134
- khoj/interface/compiled/_next/static/chunks/app/chat/page-37ff98d93e65b5a4.js,sha256=_FzCaSZxsbEjhWg09tPBR00KTyd5dLhJuXBj0dnhfq8,10163
135
+ khoj/interface/compiled/_next/static/chunks/app/chat/page-c2ebc47a09abc8ae.js,sha256=0F6OpWjZzEvwrpYZEg9bx0SzmafZm2A1Vwrhum9pIVI,10335
135
136
  khoj/interface/compiled/_next/static/chunks/app/factchecker/layout-7b30c541c05fb904.js,sha256=yub2AuBKHKSCqrHRFnkZv9JXLmLJLOB99iiaD3DtZQM,170
136
137
  khoj/interface/compiled/_next/static/chunks/app/factchecker/page-6ca723a9ff0dfd70.js,sha256=haLJ9WVP9f8IEdmUiFaoVEV6nax1d2pKHArqzQxTecw,13988
137
138
  khoj/interface/compiled/_next/static/chunks/app/search/layout-3720f1362310bebb.js,sha256=Smpa4MQaw5ItashtspsDKsOvRa6sOXH_lv4jIfWIbNI,170
138
139
  khoj/interface/compiled/_next/static/chunks/app/search/page-fa15807b1ad7e30b.js,sha256=st3BmeRoT8a_lJrTrUhOTVUuaZQJjC60_lE_GmreLeQ,6954
139
140
  khoj/interface/compiled/_next/static/chunks/app/settings/layout-6f9314b0d7a26046.js,sha256=ikl3vCXnp81sa24uPSuRbgvgDtpHGWfhxEs4OAOYXIM,5347
140
- khoj/interface/compiled/_next/static/chunks/app/settings/page-b0fae6e054ca311e.js,sha256=AXnv2j64la18kzxbzLWmKNp0VHHP9ovHJXjL0IV4Rj8,31742
141
+ khoj/interface/compiled/_next/static/chunks/app/settings/page-1a2acc46cdabaf4a.js,sha256=UlzlVKjA8EnaxxT5XzKSJN3lJCF8Psa671mQ6LWapDE,31895
141
142
  khoj/interface/compiled/_next/static/chunks/app/share/chat/layout-39f03f9e32399f0f.js,sha256=ClS8wrj6HOsRL4VX8DMiqX_MlQDsi_3CA-AQt4m7vuA,373
142
143
  khoj/interface/compiled/_next/static/chunks/app/share/chat/page-0ae8f5b868af65c1.js,sha256=jBRWhFfU0GMqlh1MKHZiyG_sv__d6eO8-WuNnwCKm5M,10147
143
144
  khoj/interface/compiled/_next/static/chunks/pages/_app-f870474a17b7f2fd.js,sha256=eqdFPAN_XFyMUzZ9qwFk-_rhMWZrU7lgNVt1foVUANo,286
144
145
  khoj/interface/compiled/_next/static/chunks/pages/_error-c66a4e8afc46f17b.js,sha256=vjERjtMAbVk-19LyPf1Jc-H6TMcrSznSz6brzNqbqf8,253
145
146
  khoj/interface/compiled/_next/static/css/1538cedb321e3a97.css,sha256=-qLZhPN-wA3kcrVODVTaG1sN0pmuzRCqNH12gs5_qYc,2569
146
147
  khoj/interface/compiled/_next/static/css/2272c73fc7a3b571.css,sha256=1fHKFd8zLOHosAHx-kxv4b9lVSqHag_E71WkV3dXx2Y,26940
147
- khoj/interface/compiled/_next/static/css/2bfe35fbe2c97a56.css,sha256=ll38Skm4kA29LtqLUkDtUMT-6ua0ihpXJUJZh-HppCI,7371
148
148
  khoj/interface/compiled/_next/static/css/553f9cdcc7a2bcd6.css,sha256=JpjOOwmqP9Hba-w_8Lx9jWW0ZD0kD3wR0HvdPGDyUPo,2134
149
149
  khoj/interface/compiled/_next/static/css/592ca99f5122e75a.css,sha256=BSqRkeb9vBh0phx5GkAlZirTFZintbyggGaUkuOBfaU,914
150
+ khoj/interface/compiled/_next/static/css/9369a9dea99c97e8.css,sha256=Qer_pzGXgla5E9MVNA-6CMt0VrYqngQGeR278TbfUqI,7371
150
151
  khoj/interface/compiled/_next/static/css/9d5b867ec04494a6.css,sha256=X2BihvGWIRM1KI7iFgwUf6QAQh-_M_gBbcR-ZS66nEs,1880998
151
152
  khoj/interface/compiled/_next/static/css/a22d83f18a32957e.css,sha256=kgAD2DQYH2WF2wqL759i62nR093yU_UfFClMKkAue6U,17709
152
153
  khoj/interface/compiled/_next/static/css/a3530ec58b0b660f.css,sha256=2fpX695nzJ6sNaNZbX_3Z0o-IA5kRlyN0ByIIXRgmtg,1570
@@ -223,8 +224,8 @@ khoj/interface/compiled/_next/static/media/flags.3afdda2f.webp,sha256=M2AW_HLpBn
223
224
  khoj/interface/compiled/_next/static/media/flags@2x.5fbe9fc1.webp,sha256=BBeRPBZkxY3-aKkMnYv5TSkxmbeMbyUH4VRIPfrWg1E,137406
224
225
  khoj/interface/compiled/_next/static/media/globe.98e105ca.webp,sha256=g3ofb8-W9GM75zIhlvQhaS8I2py9TtrovOKR3_7Jf04,514
225
226
  khoj/interface/compiled/_next/static/media/globe@2x.974df6f8.webp,sha256=I_N7Yke3IOoS-0CC6XD8o0IUWG8PdPbrHmf6lpgWlZY,1380
226
- khoj/interface/compiled/agents/index.html,sha256=6upW-KAzeKcBr5QLsg3PteJnTwwwNegnZj6S10CvGaQ,12699
227
- khoj/interface/compiled/agents/index.txt,sha256=SFLyYLSfMN-Ara3Es49cL0JQf4CdJpgOtu_cclXuxKE,6075
227
+ khoj/interface/compiled/agents/index.html,sha256=VBK7BnYVjNTvIWwl2_qOXH5RNyzANjAOb1wWmejJnUA,12699
228
+ khoj/interface/compiled/agents/index.txt,sha256=WFvKqiIAjXwXnv5DQOhEeJ-mWYeCEMynnO2Ykph6_Ck,6075
228
229
  khoj/interface/compiled/assets/icons/khoj_lantern.ico,sha256=eggu-B_v3z1R53EjOFhIqqPnICBGdoaw1xnc0NrzHck,174144
229
230
  khoj/interface/compiled/assets/icons/khoj_lantern_128x128.png,sha256=aTxivDb3CYyThkVZWz8A19xl_dNut5DbkXhODWF3A9Q,5640
230
231
  khoj/interface/compiled/assets/icons/khoj_lantern_256x256.png,sha256=xPCMLHiaL7lYOdQLZrKwWE-Qjn5ZaysSZB0ScYv4UZU,12312
@@ -235,18 +236,18 @@ khoj/interface/compiled/assets/samples/desktop-remember-plan-sample.png,sha256=i
235
236
  khoj/interface/compiled/assets/samples/phone-browse-draw-sample.png,sha256=Dd4fPwtFl6BWqnHjeb1mCK_ND0hhHsWtx8sNE7EiMuE,406179
236
237
  khoj/interface/compiled/assets/samples/phone-plain-chat-sample.png,sha256=DEDaNRCkfEWUeh3kYZWIQDTVK1a6KKnYdwj5ZWisN_Q,82985
237
238
  khoj/interface/compiled/assets/samples/phone-remember-plan-sample.png,sha256=Ma3blirRmq3X4oYSsDbbT7MDn29rymDrjwmUfA9BMuM,236285
238
- khoj/interface/compiled/automations/index.html,sha256=chIJwGeHu2vvSRdsQT0hEQXSPpmu9nFtRDEw-fRwfK8,30500
239
- khoj/interface/compiled/automations/index.txt,sha256=XblegzZBZDnQywYqrU5pC_O3SnindLa8tl2Ii1EypoI,5447
240
- khoj/interface/compiled/chat/index.html,sha256=9eNRABzaU4dHCOgGbbVWh1QI8vffvI6vHZ9jSkbO65A,13566
241
- khoj/interface/compiled/chat/index.txt,sha256=ELNzbuEcXO9-08TedJdwHsXFjsEb_2ZeG1mv55zqONo,6421
242
- khoj/interface/compiled/factchecker/index.html,sha256=e9QPAk3Ve9R9nnRsPLQpNO4U2mk2_rRA5ZxdSXz6XuA,29839
243
- khoj/interface/compiled/factchecker/index.txt,sha256=dv3JNVaO4cTi4gqSxMU5R2195aBo87eTtFW2Y7luEFQ,5735
244
- khoj/interface/compiled/search/index.html,sha256=FaqzQhxYSe8UewSouj9ka1Su88gtDeTJYjmI0Quj5go,30154
245
- khoj/interface/compiled/search/index.txt,sha256=sfzyoz47YgIwWwc0pAMxV49YgjONADnkPhczAM61gyI,5249
246
- khoj/interface/compiled/settings/index.html,sha256=9zA5u2MVp4rCHDRkZuPE6RTYmRLImDzXwFmdx8CZres,12827
247
- khoj/interface/compiled/settings/index.txt,sha256=LMQtigNnW-DQf4ioxJ_4cUWJ5ItBYrzquKsh9qzCvEc,6073
248
- khoj/interface/compiled/share/chat/index.html,sha256=RjA3hlLr2O00lcyoa5rDzhUgiZx3966Lrs2SuNuO-ig,14896
249
- khoj/interface/compiled/share/chat/index.txt,sha256=vfQbHb_nbXWbV0FjLR9mDlRaj3y5ZC5kJt9nNsgeLew,7239
239
+ khoj/interface/compiled/automations/index.html,sha256=6jqzh5RO0j7bKiXgKsMX_0-T0p9cJnuXxez0Q9wGwiM,30500
240
+ khoj/interface/compiled/automations/index.txt,sha256=K_MKFlgTMeghPilVa2ovbL32jG4YmUOK6RoBdhyJrjc,5447
241
+ khoj/interface/compiled/chat/index.html,sha256=OejTWDBcwFzNrn7vQq7ys2FH9UQnluXIFTQBR85ptqs,13566
242
+ khoj/interface/compiled/chat/index.txt,sha256=wYQJEA4GPLxLZoC46NYWEN8MURTNNnO7ZUBK3WdZHOQ,6421
243
+ khoj/interface/compiled/factchecker/index.html,sha256=K2figgXH9Y_2G-bp3fIeBB1GlPG2n7Fo2Ii39LcAuBQ,29839
244
+ khoj/interface/compiled/factchecker/index.txt,sha256=vN1A_kFlrTssLEuh8Ql9onurgMiOWDReHWdzyZXWxpU,5735
245
+ khoj/interface/compiled/search/index.html,sha256=9b4m1c_NiFe6QLUhlE0cqdDEq8fHgvzNbMiEUUK99YI,30154
246
+ khoj/interface/compiled/search/index.txt,sha256=Lt67juJcNdZ9bdYYXVjIAlU-YWc5zT037za2gK7F8d8,5249
247
+ khoj/interface/compiled/settings/index.html,sha256=5OsVBoJJCpLMg-9BLxFnTOr5f1w-_HCm33SrdVzdVZA,12827
248
+ khoj/interface/compiled/settings/index.txt,sha256=TCtZ18XUC9SPSc91yQF8VC3MsJOzLOknUdt3EvL7bSA,6073
249
+ khoj/interface/compiled/share/chat/index.html,sha256=-fO2eM7TXMvxdCsPF_0u2AdKkUTvBBMrKdD76iVAWeI,14896
250
+ khoj/interface/compiled/share/chat/index.txt,sha256=o9DmLzm4wGEoHT5os9H-UUfsIujHUjGKggPpBwMsMJ0,7239
250
251
  khoj/interface/email/feedback.html,sha256=xksuPFamx4hGWyTTxZKRgX_eiYQQEuv-eK9Xmkt-nwU,1216
251
252
  khoj/interface/email/magic_link.html,sha256=jXY_2hD3o15Ns5UDzbjLT8FHBnZiS7jo38YkYXIS-4w,947
252
253
  khoj/interface/email/task.html,sha256=yXywzC-5P4nXbhqvgCmwcCpTRbD5eWuDXMpgYSotztM,3311
@@ -313,17 +314,17 @@ khoj/processor/conversation/openai/whisper.py,sha256=RuwDtxSJrVWYdZz4aVnk0XiMQy9
313
314
  khoj/processor/speech/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
314
315
  khoj/processor/speech/text_to_speech.py,sha256=Q7sapi5Hv6woXOumtrGqR0t6izZrFBkWXFOGrHM6dJ4,1929
315
316
  khoj/processor/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
316
- khoj/processor/tools/online_search.py,sha256=0FcUwGbD91bhfBgIbEvW-kRflisbG-cZyZlznlSYI5w,9727
317
+ khoj/processor/tools/online_search.py,sha256=G7W_g4ZmdyMhsxREpPAnaXt5OA0N4QoKdQBZp-qTdR0,9895
317
318
  khoj/routers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
318
319
  khoj/routers/api.py,sha256=I-mQ6FSXw99yIRGMNDB_YQbqN82YE69WImnKjdeRvpM,25619
319
320
  khoj/routers/api_agents.py,sha256=ks8QzjmZiio6j1QGi6xFtDmVxd9lvC6LPB-WcDPnF8o,1525
320
- khoj/routers/api_chat.py,sha256=ii-eeS9vYvX2kc4_5Ss7F5hrH0JQD-UVO9Jg_2adF8Q,35503
321
+ khoj/routers/api_chat.py,sha256=g0qQHlSQVZil4uF5u03sT2OGMYnqBojIowORXrENIvQ,35972
321
322
  khoj/routers/api_content.py,sha256=OfY05ggRmg0FuVWzodBfV_5Gc6UbGCfchiIk8eqKA2o,17387
322
323
  khoj/routers/api_model.py,sha256=5m7JWwgd9jILiLivRu7NEyY2E-tUkqoEkGg6j6uM1g0,4646
323
324
  khoj/routers/api_phone.py,sha256=p9yfc4WeMHDC0hg3aQk60a2VBy8rZPdEnz9wdJ7DzkU,2208
324
325
  khoj/routers/auth.py,sha256=pCOLSRihJWcn097DRPxLjPdlejsjHJFRs9jHIzLujZU,6247
325
326
  khoj/routers/email.py,sha256=jA4jDTrYHUpY7mFHL4himeRlTBLRQmQKHqC91Dw1Zu0,3730
326
- khoj/routers/helpers.py,sha256=9N6Pgh1BPKBKsD_2Hnvdy_M7Z40e4_ci6lpnqo1cZKw,63307
327
+ khoj/routers/helpers.py,sha256=n_OEREg-hDRFqcRZkcXN4L56GdlAuo6J2VfNfvevS-A,63828
327
328
  khoj/routers/notion.py,sha256=0iG_DPVjg8n_LBWGHA8M6eHnJJDL-isARSEHTYStz6c,2809
328
329
  khoj/routers/storage.py,sha256=9ZfBsr_omxdFV-Lcj6p30xTQcF_7wwCZ9XFJukzjITE,1429
329
330
  khoj/routers/subscription.py,sha256=qEyV7m7mrY6MGtaij8W3v61tpzX2a7ydm2B-E8h_R-M,4285
@@ -348,8 +349,8 @@ khoj/utils/models.py,sha256=Q5tcC9-z25sCiub048fLnvZ6_IIO1bcPNxt5payekk0,2009
348
349
  khoj/utils/rawconfig.py,sha256=luk7Vb_ODuoTdMd_IG-yVXGoyoU-RktyapBG5D1N_VI,3985
349
350
  khoj/utils/state.py,sha256=x4GTewP1YhOA6c_32N4wOjnV-3AA3xG_qbY1-wC2Uxc,1559
350
351
  khoj/utils/yaml.py,sha256=H0mfw0ZvBFUvFmCQn8pWkfxdmIebsrSykza7D8Wv6wQ,1430
351
- khoj-1.20.5.dev15.dist-info/METADATA,sha256=jcSDHIN3Tpem7ihhT_WxA7mEXYOD5UQoF8lf0W-nXV0,6876
352
- khoj-1.20.5.dev15.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
353
- khoj-1.20.5.dev15.dist-info/entry_points.txt,sha256=KBIcez5N_jCgq_ER4Uxf-e1lxTBMTE_BBjMwwfeZyAg,39
354
- khoj-1.20.5.dev15.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
355
- khoj-1.20.5.dev15.dist-info/RECORD,,
352
+ khoj-1.20.5.dev18.dist-info/METADATA,sha256=J7G56lBfb6Pr1dkikhgzL32tE2xiI6_addJyvwqmEhk,6876
353
+ khoj-1.20.5.dev18.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
354
+ khoj-1.20.5.dev18.dist-info/entry_points.txt,sha256=KBIcez5N_jCgq_ER4Uxf-e1lxTBMTE_BBjMwwfeZyAg,39
355
+ khoj-1.20.5.dev18.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
356
+ khoj-1.20.5.dev18.dist-info/RECORD,,
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1929],{39929:function(e,t,s){Promise.resolve().then(s.bind(s,38874))},38874:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return x}});var n=s(57437),a=s(65104),o=s.n(a),c=s(2265),i=s(48861),r=s(82697),l=s(16463),d=s(58485),u=s(9557);s(7395);var h=s(69591),g=s(38423),m=s(79306);function f(e){let t=(0,l.useSearchParams)().get("conversationId"),[s,a]=(0,c.useState)(""),[i,d]=(0,c.useState)(!1),[u,h]=(0,c.useState)(null),m=e.setQueryToProcess,f=e.onConversationIdChange;if((0,c.useEffect)(()=>{let e=localStorage.getItem("message");e&&(d(!0),m(e))},[m]),(0,c.useEffect)(()=>{s&&(d(!0),m(s))},[s,m]),(0,c.useEffect)(()=>{t&&(null==f||f(t))},[t,f]),(0,c.useEffect)(()=>{e.streamedMessages&&e.streamedMessages.length>0&&e.streamedMessages[e.streamedMessages.length-1].completed?d(!1):a("")},[e.streamedMessages]),!t){window.location.href="/";return}return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:o().chatBodyFull,children:(0,n.jsx)(r.Z,{conversationId:t,setTitle:e.setTitle,setAgent:h,pendingMessage:i?s:"",incomingMessages:e.streamedMessages})}),(0,n.jsx)("div",{className:"".concat(o().inputBox," p-1 md:px-2 shadow-md bg-background align-middle items-center justify-center dark:bg-neutral-700 dark:border-0 dark:shadow-sm rounded-t-2xl rounded-b-none md:rounded-xl"),children:(0,n.jsx)(g.Z,{agentColor:null==u?void 0:u.color,isLoggedIn:e.isLoggedIn,sendMessage:e=>a(e),sendDisabled:i,chatOptionsData:e.chatOptionsData,conversationId:t,isMobileWidth:e.isMobileWidth,setUploadedFiles:e.setUploadedFiles})})]})}function x(){let e="Khoj AI - Chat",[t,s]=(0,c.useState)(null),[a,r]=(0,c.useState)(!0),[l,g]=(0,c.useState)(e),[x,p]=(0,c.useState)(null),[v,_]=(0,c.useState)([]),[y,j]=(0,c.useState)(""),[b,w]=(0,c.useState)(!1),[M,C]=(0,c.useState)([]),S=(0,h.k6)(),I=(0,m.G)(),N=(0,h.IC)();async function B(e){if(!e.ok)throw Error(e.statusText);if(!e.body)throw Error("Response body is null");let t=e.body.getReader(),s=new TextDecoder,n="␃\uD83D\uDD1A␗",a="",o=[],c={};for(;;){let e;let{done:i,value:r}=await t.read();if(i){j(""),w(!1);break}for(a+=s.decode(r,{stream:!0});-1!==(e=a.indexOf(n));){let t=a.slice(0,e);if(a=a.slice(e+n.length),t){let e=v.find(e=>!e.completed);if(!e){console.error("No current message found");return}({context:o,onlineContext:c}=(0,u.VK)(t,e,o,c)),_([...v])}}}}async function T(){if(localStorage.removeItem("message"),!y||!x)return;let e="/api/chat?q=".concat(encodeURIComponent(y),"&conversation_id=").concat(x,"&stream=true&client=web");S&&(e+="&region=".concat(S.region,"&country=").concat(S.country,"&city=").concat(S.city,"&timezone=").concat(S.timezone));let t=await fetch(e);try{await B(t)}catch(e){console.log(e)}}return((0,c.useEffect)(()=>{fetch("/api/chat/options").then(e=>e.json()).then(e=>{r(!1),e&&s(e)}).catch(e=>{console.error(e)}),(0,h.EK)()},[]),(0,c.useEffect)(()=>{if(y){let e={rawResponse:"",trainOfThought:[],context:[],onlineContext:{},completed:!1,timestamp:new Date().toISOString(),rawQuery:y||""};_(t=>[...t,e]),w(!0)}},[y]),(0,c.useEffect)(()=>{b&&T()},[b]),a)?(0,n.jsx)(d.Z,{}):(0,n.jsxs)("div",{className:"".concat(o().main," ").concat(o().chatLayout),children:[(0,n.jsx)("title",{children:"".concat(e).concat(l&&l!==e?": ".concat(l):"")}),(0,n.jsx)("div",{children:(0,n.jsx)(i.Z,{conversationId:x,uploadedFiles:M,isMobileWidth:N})}),(0,n.jsx)("div",{className:o().chatBox,children:(0,n.jsxs)("div",{className:o().chatBoxBody,children:[!N&&(0,n.jsx)("div",{className:"text-nowrap text-ellipsis overflow-hidden max-w-screen-md grid items-top font-bold mr-8",children:l&&(0,n.jsx)("h2",{className:"text-lg text-ellipsis whitespace-nowrap overflow-x-hidden pt-6",children:l})}),(0,n.jsx)(c.Suspense,{fallback:(0,n.jsx)(d.Z,{}),children:(0,n.jsx)(f,{isLoggedIn:null!==I,streamedMessages:v,chatOptionsData:t,setTitle:g,setQueryToProcess:j,setUploadedFiles:C,isMobileWidth:N,onConversationIdChange:e=>{p(e)}})})]})})]})}},82697:function(e,t,s){"use strict";s.d(t,{Z:function(){return p}});var n=s(57437),a=s(15238),o=s.n(a),c=s(2265),i=s(89178),r=s(94880),l=s(58485),d=s(16288),u=s(26100),h=s(19666),g=s(50495),m=e=>{let{name:t,avatar:s,link:a,description:o}=e;return(0,n.jsx)("div",{className:"relative group flex",children:(0,n.jsx)(h.pn,{children:(0,n.jsxs)(h.u,{children:[(0,n.jsx)(h.aJ,{asChild:!0,children:(0,n.jsxs)(g.z,{variant:"ghost",className:"flex items-center justify-center",children:[s,(0,n.jsx)("div",{children:t})]})}),(0,n.jsx)(h._v,{children:(0,n.jsxs)("div",{className:"w-80 h-30",children:[(0,n.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",className:"mt-1 ml-2 block no-underline",children:(0,n.jsxs)("div",{className:"flex items-center justify-start gap-2",children:[s,(0,n.jsxs)("div",{className:"mr-2 mt-1 flex justify-center items-center text-sm font-semibold text-gray-800",children:[t,(0,n.jsx)(u.o,{weight:"bold",className:"ml-1"})]})]})}),o&&(0,n.jsx)("p",{className:"mt-2 ml-6 text-sm text-gray-600 line-clamp-2",children:o||"A Khoj agent"})]})})]})})})},f=s(89417),x=s(69591);function p(e){let[t,s]=(0,c.useState)(null),[a,u]=(0,c.useState)(0),[h,g]=(0,c.useState)(!0),p=(0,c.useRef)(null),v=(0,c.useRef)(null),_=(0,c.useRef)(null),[y,j]=(0,c.useState)(null),[b,w]=(0,c.useState)(!1),M=(0,x.IC)();(0,c.useEffect)(()=>{a<2&&((null==t?void 0:t.chat.length)||setTimeout(()=>{C()},500))},[t,a]),(0,c.useEffect)(()=>{if(!h||b)return;let n=new IntersectionObserver(n=>{n[0].isIntersecting&&h&&(w(!0),function(n){if(!h||b)return;let a=n+1,o="";if(e.conversationId)o="/api/chat/history?client=web&conversation_id=".concat(e.conversationId,"&n=").concat(10*a);else{if(!e.publicConversationSlug)return;o="/api/chat/share/history?client=web&public_conversation_slug=".concat(e.publicConversationSlug,"&n=").concat(10*a)}fetch(o).then(e=>e.json()).then(a=>{if(e.setTitle(a.response.slug),a&&a.response&&a.response.chat&&a.response.chat.length>0){if(a.response.chat.length===(null==t?void 0:t.chat.length)){g(!1),w(!1);return}e.setAgent(a.response.agent),s(a.response),n<2&&C(),w(!1)}else{if(a.response.agent&&a.response.conversation_id){let t={chat:[],agent:a.response.agent,conversation_id:a.response.conversation_id,slug:a.response.slug};e.setAgent(a.response.agent),s(t)}g(!1),w(!1)}}).catch(e=>{console.error(e),window.location.href="/"})}(a),u(e=>e+1))},{threshold:1});return _.current&&n.observe(_.current),()=>n.disconnect()},[h,a,b]),(0,c.useEffect)(()=>{g(!0),w(!1),u(0),s(null)},[e.conversationId]),(0,c.useEffect)(()=>{if(e.incomingMessages){let t=e.incomingMessages[e.incomingMessages.length-1];t&&!t.completed&&j(e.incomingMessages.length-1)}S()&&C()},[e.incomingMessages]);let C=()=>{v.current&&v.current.scrollIntoView(!1)},S=()=>{if(!v.current)return!1;let{scrollTop:e,scrollHeight:t,clientHeight:s}=v.current;return e+s>=t-25};return e.conversationId||e.publicConversationSlug?(0,n.jsx)(r.x,{className:"h-[80vh]",children:(0,n.jsx)("div",{ref:p,children:(0,n.jsxs)("div",{className:o().chatHistory,ref:v,children:[(0,n.jsx)("div",{ref:_,style:{height:"1px"},children:b&&(0,n.jsx)(l.l,{message:"Loading Conversation",className:"opacity-50"})}),t&&t.chat&&t.chat.map((e,s)=>(0,n.jsx)(i.Z,{isMobileWidth:M,chatMessage:e,customClassName:"fullHistory",borderLeftColor:"".concat(null==t?void 0:t.agent.color,"-500"),isLastMessage:s===t.chat.length-1},"".concat(s,"fullHistory"))),e.incomingMessages&&e.incomingMessages.map((e,s)=>(0,n.jsxs)(c.Fragment,{children:[(0,n.jsx)(i.Z,{isMobileWidth:M,chatMessage:{message:e.rawQuery,context:[],onlineContext:{},created:e.timestamp,by:"you",automationId:""},customClassName:"fullHistory",borderLeftColor:"".concat(null==t?void 0:t.agent.color,"-500")},"".concat(s,"outgoing")),e.trainOfThought&&function(e,t,s,a){let c=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=e.length-1;return(0,n.jsxs)("div",{className:"".concat(o().trainOfThought," shadow-sm"),children:[!c&&(0,n.jsx)(l.l,{className:"float-right"}),e.map((e,a)=>(0,n.jsx)(i.H,{message:e,primary:a===r&&t&&!c,agentColor:s},"train-".concat(a)))]},a)}(e.trainOfThought,s===y,(null==t?void 0:t.agent.color)||"orange","".concat(s,"trainOfThought"),e.completed),(0,n.jsx)(i.Z,{isMobileWidth:M,chatMessage:{message:e.rawResponse,context:e.context,onlineContext:e.onlineContext,created:e.timestamp,by:"khoj",automationId:"",rawQuery:e.rawQuery},customClassName:"fullHistory",borderLeftColor:"".concat(null==t?void 0:t.agent.color,"-500"),isLastMessage:!0},"".concat(s,"incoming"))]},"incomingMessage".concat(s))),e.pendingMessage&&(0,n.jsx)(i.Z,{isMobileWidth:M,chatMessage:{message:e.pendingMessage,context:[],onlineContext:{},created:new Date().getTime().toString(),by:"you",automationId:""},customClassName:"fullHistory",borderLeftColor:"".concat(null==t?void 0:t.agent.color,"-500"),isLastMessage:!0},"pendingMessage-".concat(e.pendingMessage.length)),t&&(0,n.jsx)("div",{className:"".concat(o().agentIndicator," pb-4"),children:(0,n.jsx)("div",{className:"relative group mx-2 cursor-pointer",children:(0,n.jsx)(m,{name:t&&t.agent&&t.agent.name?t.agent.name:"Agent",link:t&&t.agent&&t.agent.slug?"/agents?agent=".concat(t.agent.slug):"/agents",avatar:(0,f.T)(t.agent.icon,t.agent.color)||(0,n.jsx)(d.v,{}),description:t&&t.agent&&t.agent.persona?t.agent.persona:""})})})]})})}):null}},16463:function(e,t,s){"use strict";var n=s(71169);s.o(n,"useSearchParams")&&s.d(t,{useSearchParams:function(){return n.useSearchParams}})},65104:function(e){e.exports={main:"chat_main__8xQu5",suggestions:"chat_suggestions__m8n2t",inputBox:"chat_inputBox__LOFws",chatBodyFull:"chat_chatBodyFull__FfKEK",chatBody:"chat_chatBody__sS1LX",chatLayout:"chat_chatLayout__pR203",chatBox:"chat_chatBox__FBct_",titleBar:"chat_titleBar__R5QlK",chatBoxBody:"chat_chatBoxBody__qT_SC",agentIndicator:"chat_agentIndicator__8V55w"}},15238:function(e){e.exports={chatHistory:"chatHistory_chatHistory__CoaVT",chatLayout:"chatHistory_chatLayout__ABli_",agentIndicator:"chatHistory_agentIndicator__wOU1f",trainOfThought:"chatHistory_trainOfThought__mMWSR"}}},function(e){e.O(0,[7812,9427,929,3954,9001,3062,743,7071,2614,9693,1603,9417,9178,8423,2971,7023,1744],function(){return e(e.s=39929)}),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6938],{62960:function(e,s,t){Promise.resolve().then(t.bind(t,95982))},95982:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return eh}});var a,n,r=t(57437),l=t(55268),i=t.n(l);t(80541);var o=t(2265),c=t(35657),d=t(79306),h=t(69591),u=t(19748),m=t(50495),x=t(66431),p=t(32309),f=t(37440);let j=o.forwardRef((e,s)=>{let{className:t,containerClassName:a,...n}=e;return(0,r.jsx)(x.uZ,{ref:s,containerClassName:(0,f.cn)("flex items-center gap-2 has-[:disabled]:opacity-50",a),className:(0,f.cn)("disabled:cursor-not-allowed",t),...n})});j.displayName="InputOTP";let g=o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("div",{ref:s,className:(0,f.cn)("flex items-center",t),...a})});g.displayName="InputOTPGroup";let b=o.forwardRef((e,s)=>{let{index:t,className:a,...n}=e,{char:l,hasFakeCaret:i,isActive:c}=o.useContext(x.VM).slots[t];return(0,r.jsxs)("div",{ref:s,className:(0,f.cn)("relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",c&&"z-10 ring-2 ring-ring ring-offset-background",a),...n,children:[l,i&&(0,r.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:(0,r.jsx)("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})});b.displayName="InputOTPSlot",o.forwardRef((e,s)=>{let{...t}=e;return(0,r.jsx)("div",{ref:s,role:"separator",...t,children:(0,r.jsx)(p.Z,{})})}).displayName="InputOTPSeparator";var N=t(83102),y=t(36013),w=t(46910);let v=o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:"relative w-full overflow-auto",children:(0,r.jsx)("table",{ref:s,className:(0,f.cn)("w-full caption-bottom text-sm",t),...a})})});v.displayName="Table",o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("thead",{ref:s,className:(0,f.cn)("[&_tr]:border-b",t),...a})}).displayName="TableHeader";let _=o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("tbody",{ref:s,className:(0,f.cn)("[&_tr:last-child]:border-0",t),...a})});_.displayName="TableBody",o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("tfoot",{ref:s,className:(0,f.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...a})}).displayName="TableFooter";let k=o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("tr",{ref:s,className:(0,f.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...a})});k.displayName="TableRow",o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("th",{ref:s,className:(0,f.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...a})}).displayName="TableHead";let S=o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("td",{ref:s,className:(0,f.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...a})});S.displayName="TableCell",o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("caption",{ref:s,className:(0,f.cn)("mt-4 text-sm text-muted-foreground",t),...a})}).displayName="TableCaption";var C=t(42491),T=t(9950),D=t(35418),F=t(15340),E=t(84120),P=t(55362),O=t(48252),A=t(60787),I=t(26058),z=t(95616),Y=t(11961),R=t(76782),Z=t(98325),K=t(96917),W=t(10813),M=t(56194),L=t(9476),V=t(43010),U=t(72151),B=t(53876),G=t(90445),H=t(17541),J=t(63205),$=t(49806),q=t(67722),X=t(57087),Q=t(27082),ee=t(26100),es=t(48861),et=t(58485),ea=t(47947),en=t(9557),er=t(6780),el=t(70571),ei=t(87138);let eo=e=>{let{onClose:s}=e,[t,a]=(0,o.useState)([]),[n,l]=(0,o.useState)([]),[i,c]=(0,o.useState)(""),[d,h]=(0,o.useState)(!1),[u,x]=(0,o.useState)(null),[p,f]=(0,o.useState)(null),[j,g]=(0,o.useState)(!1),[b,N]=(0,o.useState)(0),[y,w]=(0,o.useState)([]),v=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(j||N(0),j){let e=setInterval(()=>{N(e=>{let s=e+(Math.floor(5*Math.random())+1);return s<100?s:100})},800);return()=>clearInterval(e)}},[j]),(0,o.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/content/computer");if(!e.ok)throw Error("Failed to fetch files");let s=await e.json();Array.isArray(s)?a(s.toSorted()):console.error("Unexpected data format from API")}catch(e){console.error("Error fetching files:",e)}})()},[y]);let _=t.filter(e=>e.toLowerCase().includes(i.toLowerCase())),k=async()=>{let e=n.length>0?n:_;if(console.log("Delete selected files",e),0===e.length){console.log("No files to delete");return}try{if(!(await fetch("/api/content/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e})})).ok)throw Error("Failed to delete files");a(s=>s.filter(s=>!e.includes(s))),l([]),console.log("Deleted files:",e)}catch(e){console.error("Error deleting files:",e)}},S=async e=>{console.log("Delete selected file",e);try{if(!(await fetch("/api/content/file?filename=".concat(encodeURIComponent(e)),{method:"DELETE",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to delete file");a(s=>s.filter(s=>s!==e)),l(s=>s.filter(s=>s!==e)),console.log("Deleted file:",e)}catch(e){console.error("Error deleting file:",e)}};function O(e){(0,en.ko)(e,x,g,f,w)}return(0,r.jsxs)(C.m5,{open:!0,onOpenChange:s,children:[(0,r.jsx)(er.aR,{open:null!==u||null!=p,children:(0,r.jsxs)(er._T,{children:[(0,r.jsx)(er.fY,{children:(0,r.jsx)(er.f$,{children:"Alert"})}),(0,r.jsx)(er.yT,{children:u||p}),(0,r.jsx)(er.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>{x(null),f(null),g(!1)},children:"Close"})]})}),(0,r.jsxs)("div",{className:"flex flex-col h-full",onDragOver:function(e){e.preventDefault(),h(!0)},onDragLeave:function(e){e.preventDefault(),h(!1)},onDrop:function(e){e.preventDefault(),h(!1),e.dataTransfer.files&&O(e.dataTransfer.files)},onClick:function(){v&&v.current&&v.current.click()},children:[(0,r.jsx)("input",{type:"file",multiple:!0,ref:v,style:{display:"none"},onChange:function(e){e.target.files&&O(e.target.files)}}),(0,r.jsxs)("div",{className:"flex-none p-4",children:["Upload files",j&&(0,r.jsx)(el.E,{indicatorColor:"bg-slate-500",className:"w-full h-2 rounded-full",value:b})]}),(0,r.jsx)("div",{className:"flex-none p-4 bg-secondary border-b ".concat(d?"animate-pulse":""),children:(0,r.jsx)("div",{className:"flex items-center justify-center w-full h-32 border-2 border-dashed border-gray-300 rounded-lg",children:d?(0,r.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,r.jsx)(T.u,{className:"h-6 w-6 mr-2"}),(0,r.jsx)("span",{children:"Drop files to upload"})]}):(0,r.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,r.jsx)(D.v,{className:"h-6 w-6 mr-2"}),(0,r.jsx)("span",{children:"Drag and drop files here"})]})})})]}),(0,r.jsxs)("div",{className:"flex flex-col h-full",children:[(0,r.jsx)("div",{className:"flex-none p-4",children:"Synced files"}),(0,r.jsx)("div",{className:"flex-none p-4 bg-background border-b",children:(0,r.jsx)(C.sZ,{placeholder:"Find synced files",value:i,onValueChange:c})}),(0,r.jsx)("div",{className:"flex-grow overflow-auto",children:(0,r.jsxs)(C.e8,{children:[(0,r.jsx)(C.rb,{children:0===t.length?(0,r.jsxs)("div",{className:"flex items-center justify-center",children:[(0,r.jsx)(F.C,{className:"h-4 w-4 mr-2",weight:"bold"}),"No files synced"]}):(0,r.jsxs)("div",{children:["Could not find a good match.",(0,r.jsx)(ei.default,{href:"/search",className:"block",children:"Need advanced search? Click here."})]})}),(0,r.jsx)(C.fu,{heading:"Synced files",children:_.map(e=>(0,r.jsx)(C.di,{value:e,onSelect:e=>{l(s=>s.includes(e)?s.filter(s=>s!==e):[...s,e])},children:(0,r.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,r.jsxs)("div",{className:"flex items-center ".concat(n.includes(e)?"font-semibold":""),children:[n.includes(e)&&(0,r.jsx)(E.J,{className:"h-4 w-4 mr-2"}),(0,r.jsx)("span",{className:"break-all",children:e})]}),(0,r.jsx)(m.z,{variant:"outline",size:"sm",onClick:()=>S(e),className:"ml-auto",children:(0,r.jsx)(P.r,{className:"h-4 w-4"})})]})},e))})]})}),(0,r.jsx)("div",{className:"flex-none p-4 bg-background border-t",children:(0,r.jsx)("div",{className:"flex justify-between",children:(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:k,className:"mr-2",children:[(0,r.jsx)(P.r,{className:"h-4 w-4 mr-2"}),n.length>0?"Delete Selected (".concat(n.length,")"):"Delete All"]})})})]})]})},ec=e=>{var s,t;let{items:a,selected:n,callbackFunc:l}=e,[i,c]=(0,o.useState)(null!==(t=null==n?void 0:n.toString())&&void 0!==t?t:"0");return!!n&&(0,r.jsx)("div",{className:"overflow-hidden shadow-md rounded-lg",children:(0,r.jsxs)(w.h_,{children:[(0,r.jsx)(w.$F,{asChild:!0,className:"w-full rounded-lg",children:(0,r.jsxs)(m.z,{variant:"outline",className:"justify-start py-6 rounded-lg",children:[null===(s=a.find(e=>e.id.toString()===i))||void 0===s?void 0:s.name," ",(0,r.jsx)(O.p,{className:"h-4 w-4 ml-auto text-muted-foreground"})]})}),(0,r.jsx)(w.AW,{children:(0,r.jsx)(w._x,{value:i,onValueChange:async e=>{c(e),await l(e)},children:a.map(e=>(0,r.jsx)(w.qB,{value:e.id.toString(),children:e.name},e.id.toString()))})})]})})},ed=()=>{let[e,s]=(0,o.useState)([]),{toast:t}=(0,c.pm)(),a=async()=>{try{let e=await fetch("/auth/token",{method:"POST",headers:{"Content-Type":"application/json"}}),t=await e.json();s(e=>[...e,t])}catch(e){console.error("Error generating API key:",e)}},n=async e=>{try{await navigator.clipboard.writeText(e),t({title:"\uD83D\uDD11 API Key",description:"Copied to clipboard"})}catch(e){console.error("Error copying API key:",e)}},r=async e=>{try{(await fetch("/auth/token?token=".concat(e),{method:"DELETE"})).ok&&s(s=>s.filter(s=>s.token!==e))}catch(e){console.error("Error deleting API key:",e)}},l=async()=>{try{let e=await fetch("/auth/token"),t=await e.json();(null==t?void 0:t.length)>0&&s(t)}catch(e){console.error("Error listing API keys:",e)}};return(0,o.useEffect)(()=>{l()},[]),{apiKeys:e,generateAPIKey:a,copyAPIKey:n,deleteAPIKey:r}};function eh(){let[e,s]=(0,o.useState)("Settings"),{apiKeys:t,generateAPIKey:a,copyAPIKey:n,deleteAPIKey:l}=ed(),{userConfig:x}=(0,d.h)(!0),[p,f]=(0,o.useState)(null),[w,C]=(0,o.useState)(void 0),[E,O]=(0,o.useState)(null),[en,er]=(0,o.useState)(void 0),[el,ei]=(0,o.useState)(""),[eh,eu]=(0,o.useState)("verified"),[em,ex]=(0,o.useState)(!1),{toast:ep}=(0,c.pm)(),ef=(0,h.IC)(),ej="w-full lg:w-1/3 grid grid-flow-column border border-gray-300 shadow-md rounded-lg bg-gradient-to-b from-background to-gray-50 dark:to-gray-950";(0,o.useEffect)(()=>{var e;f(x),er(null==x?void 0:x.phone_number),eu((null==x?void 0:x.is_phone_number_verified)?"verified":(null==x?void 0:x.phone_number)?"otp":"setup"),C(null==x?void 0:x.given_name),O(null!==(e=null==x?void 0:x.notion_token)&&void 0!==e?e:null)},[x]);let eg=async()=>{try{if(!(await fetch("/api/phone?phone_number=".concat(en),{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to send OTP");eu("verify")}catch(e){console.error("Error sending OTP:",e),ep({title:"\uD83D\uDCF1 Phone",description:"Failed to send OTP. Try again or contact us at team@khoj.dev"})}},eb=async()=>{try{if(!(await fetch("/api/phone/verify?code=".concat(el),{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to verify OTP");eu("verified"),ep({title:"\uD83D\uDCF1 Phone",description:"Phone number verified"})}catch(e){console.error("Error verifying OTP:",e),ep({title:"\uD83D\uDCF1 Phone",description:"Failed to verify OTP. Try again or contact us at team@khoj.dev"})}},eN=async()=>{try{if(!(await fetch("/api/phone",{method:"DELETE",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to disconnect phone number");er(void 0),eu("setup"),ep({title:"\uD83D\uDCF1 Phone",description:"Phone number disconnected"})}catch(e){console.error("Error disconnecting phone number:",e),ep({title:"\uD83D\uDCF1 Phone",description:"Failed to disconnect phone number. Try again or contact us at team@khoj.dev"})}},ey=async e=>{try{let s="/api/subscription?email=".concat(null==p?void 0:p.username,"&operation=").concat(e);if(!(await fetch(s,{method:"PATCH",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to change subscription");p&&(p.subscription_state="cancel"===e?"unsubscribed":"subscribed",f(p)),ep({title:"\uD83D\uDCB3 Subscription",description:(null==p?void 0:p.subscription_state)==="unsubscribed"?"Your subscription was cancelled":"Your Futurist subscription has been renewed"})}catch(s){console.error("Error changing subscription:",s),ep({title:"\uD83D\uDCB3 Subscription",description:"cancel"===e?"Failed to cancel subscription. Try again or contact us at team@khoj.dev":"Failed to renew subscription. Try again or contact us at team@khoj.dev"})}},ew=async()=>{if(w)try{if(!(await fetch("/api/user/name?name=".concat(w),{method:"PATCH",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to update name");p&&(p.given_name=w,f(p)),ep({title:"✅ Updated Profile",description:"You name has been updated to ".concat(w)})}catch(e){console.error("Error updating name:",e),ep({title:"⚠️ Failed to Update Profile",description:"Failed to update name. Try again or contact team@khoj.dev"})}},ev=e=>async s=>{if((null==p?void 0:p.is_active)||"search"===e)try{if(!(await fetch("/api/model/".concat(e,"?id=")+s,{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to update model");ep({title:"✅ Updated ".concat((0,h.LF)(e)," Model")})}catch(s){console.error("Failed to update ".concat(e," model:"),s),ep({description:"❌ Failed to update ".concat((0,h.LF)(e)," model. Try again."),variant:"destructive"})}},e_=async()=>{if(E)try{if(!(await fetch("/api/content/notion",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:E})})).ok)throw Error("Failed to save Notion API key");p&&(p.notion_token=E,f(p)),ep({title:"✅ Saved Notion Settings",description:"You Notion API key has been saved."})}catch(e){console.error("Error updating name:",e),ep({title:"⚠️ Failed to Save Notion Settings",description:"Failed to save Notion API key. Try again or contact team@khoj.dev"})}},ek=async e=>{try{if(!(await fetch("/api/content?t=".concat(e),{method:"PATCH",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to sync content from ".concat(e));ep({title:"\uD83D\uDD04 Syncing ".concat(e),description:"Your ".concat(e," content is being synced.")})}catch(s){console.error("Error syncing content:",s),ep({title:"⚠️ Failed to Sync ".concat(e),description:"Failed to sync ".concat(e," content. Try again or contact team@khoj.dev")})}},eS=async e=>{try{if(!(await fetch("/api/content/".concat(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to disconnect ".concat(e));p&&("computer"===e?p.enabled_content_source.computer=!1:"notion"===e?(p.enabled_content_source.notion=!1,p.notion_token=null,O(p.notion_token)):"github"===e&&(p.enabled_content_source.github=!1),f(p)),"computer"===e?ep({title:"✅ Deleted Synced Files",description:"Your synced documents have been deleted."}):ep({title:"✅ Disconnected ".concat(e),description:"Your ".concat(e," integration to Khoj has been disconnected.")})}catch(s){console.error("Error disconnecting ".concat(e,":"),s),ep({title:"⚠️ Failed to Disconnect ".concat(e),description:"Failed to disconnect from ".concat(e,". Try again or contact team@khoj.dev")})}};return p?(0,r.jsxs)("div",{className:i().page,children:[(0,r.jsx)("title",{children:e}),(0,r.jsx)("div",{className:i().sidePanel,children:(0,r.jsx)(es.Z,{conversationId:null,uploadedFiles:[],isMobileWidth:ef})}),(0,r.jsx)("div",{className:i().content,children:(0,r.jsx)("div",{className:"".concat(i().contentBody," mx-10 my-2"),children:(0,r.jsx)(o.Suspense,{fallback:(0,r.jsx)(et.Z,{}),children:(0,r.jsxs)("div",{id:"content",className:"grid grid-flow-column sm:grid-flow-row gap-16 m-8",children:[(0,r.jsxs)("div",{className:"section grid gap-8",children:[(0,r.jsx)("div",{className:"text-2xl",children:"Profile"}),(0,r.jsxs)("div",{className:"cards flex flex-wrap gap-16",children:[(0,r.jsxs)(y.Zb,{className:ej,children:[(0,r.jsxs)(y.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(A.Y,{className:"h-7 w-7 mr-2"}),"Name"]}),(0,r.jsxs)(y.aY,{className:"overflow-hidden",children:[(0,r.jsx)("p",{className:"pb-4 text-gray-400",children:"What should Khoj refer to you as?"}),(0,r.jsx)(N.I,{type:"text",onChange:e=>C(e.target.value),value:w,className:"w-full border border-gray-300 rounded-lg p-4 py-6"})]}),(0,r.jsx)(y.eW,{className:"flex flex-wrap gap-4",children:(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:ew,disabled:w===p.given_name,children:[(0,r.jsx)(I.B,{className:"h-5 w-5 inline mr-2"}),"Save"]})})]}),(0,r.jsxs)(y.Zb,{id:"subscription",className:ej,children:[(0,r.jsxs)(y.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(z.a,{className:"h-7 w-7 mr-2"}),"Subscription"]}),(0,r.jsxs)(y.aY,{className:"grid gap-2 overflow-hidden",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Current Plan"}),"trial"===p.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl text-primary/80",children:"Futurist (Trial)"}),(0,r.jsxs)("p",{className:"text-gray-400",children:["You are on a 14 day trial of the Khoj Futurist plan. Check"," ",(0,r.jsx)("a",{href:"https://khoj.dev/pricing",target:"_blank",children:"pricing page"})," ","to compare plans."]})]})||"subscribed"===p.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl text-primary/80",children:"Futurist"}),(0,r.jsxs)("p",{className:"text-gray-400",children:["Subscription ",(0,r.jsx)("b",{children:"renews"})," on"," ",(0,r.jsx)("b",{children:p.subscription_renewal_date})]})]})||"unsubscribed"===p.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl",children:"Futurist"}),(0,r.jsxs)("p",{className:"text-gray-400",children:["Subscription ",(0,r.jsx)("b",{children:"ends"})," on"," ",(0,r.jsx)("b",{children:p.subscription_renewal_date})]})]})||"expired"===p.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl",children:"Free Plan"}),p.subscription_renewal_date&&(0,r.jsxs)("p",{className:"text-gray-400",children:["Subscription ",(0,r.jsx)("b",{children:"expired"})," on"," ",(0,r.jsx)("b",{children:p.subscription_renewal_date})]})||(0,r.jsxs)("p",{className:"text-gray-400",children:["Check"," ",(0,r.jsx)("a",{href:"https://khoj.dev/pricing",target:"_blank",children:"pricing page"})," ","to compare plans."]})]})]}),(0,r.jsx)(y.eW,{className:"flex flex-wrap gap-4",children:"subscribed"==p.subscription_state&&(0,r.jsxs)(m.z,{variant:"outline",className:"hover:text-red-400",onClick:()=>ey("cancel"),children:[(0,r.jsx)(Y.b,{className:"h-5 w-5 mr-2"}),"Unsubscribe"]})||"unsubscribed"==p.subscription_state&&(0,r.jsxs)(m.z,{variant:"outline",className:"text-primary/80 hover:text-primary",onClick:()=>ey("resubscribe"),children:[(0,r.jsx)(R.e,{weight:"bold",className:"h-5 w-5 mr-2"}),"Resubscribe"]})||(0,r.jsxs)(m.z,{variant:"outline",className:"text-primary/80 hover:text-primary",onClick:()=>window.open("".concat(p.khoj_cloud_subscription_url,"?prefilled_email=").concat(p.username),"_blank","noopener,noreferrer"),children:[(0,r.jsx)(R.e,{weight:"bold",className:"h-5 w-5 mr-2"}),"Subscribe"]})})]})]})]}),em&&(0,r.jsx)(eo,{onClose:()=>ex(!1)}),(0,r.jsxs)("div",{className:"section grid gap-8",children:[(0,r.jsx)("div",{className:"text-2xl",children:"Content"}),(0,r.jsxs)("div",{className:"cards flex flex-wrap gap-16",children:[(0,r.jsxs)(y.Zb,{id:"computer",className:ej,children:[(0,r.jsxs)(y.Ol,{className:"flex flex-row text-2xl",children:[(0,r.jsx)(Z.I,{className:"h-8 w-8 mr-2"}),"Files",p.enabled_content_source.computer&&(0,r.jsx)(K.f,{className:"h-6 w-6 ml-auto text-green-500",weight:"fill"})]}),(0,r.jsx)(y.aY,{className:"overflow-hidden pb-12 text-gray-400",children:"Manage your synced files"}),(0,r.jsxs)(y.eW,{className:"flex flex-wrap gap-4",children:[(0,r.jsx)(m.z,{variant:"outline",size:"sm",onClick:()=>ex(!0),children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(W.h,{className:"h-5 w-5 inline mr-1"}),"Manage"]})}),(0,r.jsxs)(m.z,{variant:"outline",size:"sm",className:"".concat(p.enabled_content_source.computer||"hidden"),onClick:()=>eS("computer"),children:[(0,r.jsx)(M.u,{className:"h-5 w-5 inline mr-1"}),"Disable"]})]})]}),(0,r.jsxs)(y.Zb,{id:"github",className:"".concat(ej," hidden"),children:[(0,r.jsxs)(y.Ol,{className:"flex flex-row text-2xl",children:[(0,r.jsx)(L.b,{className:"h-8 w-8 mr-2"}),"Github"]}),(0,r.jsx)(y.aY,{className:"overflow-hidden pb-12 text-gray-400",children:"Set Github repositories to index"}),(0,r.jsxs)(y.eW,{className:"flex flex-wrap gap-4",children:[(0,r.jsx)(m.z,{variant:"outline",size:"sm",children:p.enabled_content_source.github&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(W.h,{className:"h-5 w-5 inline mr-1"}),"Manage"]})||(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.F,{className:"h-5 w-5 inline mr-1"}),"Connect"]})}),(0,r.jsxs)(m.z,{variant:"outline",size:"sm",className:"".concat(p.enabled_content_source.github||"hidden"),children:[(0,r.jsx)(M.u,{className:"h-5 w-5 inline mr-1"}),"Disable"]})]})]}),(0,r.jsxs)(y.Zb,{id:"notion",className:ej,children:[(0,r.jsxs)(y.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(U.F,{className:"h-7 w-7 mr-2"}),"Notion",p.enabled_content_source.notion&&(0,r.jsx)(K.f,{className:"h-6 w-6 ml-auto text-green-500",weight:"fill"})]}),(0,r.jsxs)(y.aY,{className:"grid gap-4",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Sync your Notion workspace."}),!p.notion_oauth_url&&(0,r.jsx)(N.I,{onChange:e=>O(e.target.value),value:E||"",placeholder:"Enter API Key of your Khoj integration on Notion",className:"w-full border border-gray-300 rounded-lg px-4 py-6"})]}),(0,r.jsxs)(y.eW,{className:"flex flex-wrap gap-4",children:[p.notion_oauth_url&&!p.enabled_content_source.notion?(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:()=>{window.open(p.notion_oauth_url)},children:[(0,r.jsx)(V.F,{className:"h-5 w-5 inline mr-1"}),"Connect"]}):p.enabled_content_source.notion&&E===p.notion_token?(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:()=>ek("notion"),children:[(0,r.jsx)(B.t,{className:"h-5 w-5 inline mr-1"}),"Sync"]}):p.notion_oauth_url?(0,r.jsx)(r.Fragment,{}):(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:e_,disabled:E===p.notion_token,children:[(0,r.jsx)(I.B,{className:"h-5 w-5 inline mr-1"}),p.enabled_content_source.notion&&"Update API Key"||"Set API Key"]}),(0,r.jsxs)(m.z,{variant:"outline",size:"sm",className:"".concat(p.notion_token||"hidden"),onClick:()=>eS("notion"),children:[(0,r.jsx)(M.u,{className:"h-5 w-5 inline mr-1"}),"Disconnect"]})]})]})]})]}),(0,r.jsxs)("div",{className:"section grid gap-8",children:[(0,r.jsx)("div",{className:"text-2xl",children:"Models"}),(0,r.jsxs)("div",{className:"cards flex flex-wrap gap-16",children:[p.chat_model_options.length>0&&(0,r.jsxs)(y.Zb,{className:ej,children:[(0,r.jsxs)(y.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(G.G,{className:"h-7 w-7 mr-2"}),"Chat"]}),(0,r.jsxs)(y.aY,{className:"overflow-hidden pb-12 grid gap-8",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Pick the chat model to generate text responses"}),(0,r.jsx)(ec,{items:p.chat_model_options,selected:p.selected_chat_model_config,callbackFunc:ev("chat")})]}),(0,r.jsx)(y.eW,{className:"flex flex-wrap gap-4",children:!p.is_active&&(0,r.jsx)("p",{className:"text-gray-400",children:"Subscribe to switch model"})})]}),p.search_model_options.length>0&&(0,r.jsxs)(y.Zb,{className:ej,children:[(0,r.jsxs)(y.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(H.r,{className:"h-7 w-7 mr-2"}),"Search"]}),(0,r.jsxs)(y.aY,{className:"overflow-hidden pb-12 grid gap-8",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Pick the search model to find your documents"}),(0,r.jsx)(ec,{items:p.search_model_options,selected:p.selected_search_model_config,callbackFunc:ev("search")})]}),(0,r.jsx)(y.eW,{className:"flex flex-wrap gap-4"})]}),p.paint_model_options.length>0&&(0,r.jsxs)(y.Zb,{className:ej,children:[(0,r.jsxs)(y.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(J.Y,{className:"h-7 w-7 mr-2"}),"Paint"]}),(0,r.jsxs)(y.aY,{className:"overflow-hidden pb-12 grid gap-8",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Pick the paint model to generate image responses"}),(0,r.jsx)(ec,{items:p.paint_model_options,selected:p.selected_paint_model_config,callbackFunc:ev("paint")})]}),(0,r.jsx)(y.eW,{className:"flex flex-wrap gap-4",children:!p.is_active&&(0,r.jsx)("p",{className:"text-gray-400",children:"Subscribe to switch model"})})]}),p.voice_model_options.length>0&&(0,r.jsxs)(y.Zb,{className:ej,children:[(0,r.jsxs)(y.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(T.u,{className:"h-7 w-7 mr-2"}),"Voice"]}),(0,r.jsxs)(y.aY,{className:"overflow-hidden pb-12 grid gap-8",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Pick the voice model to generate speech responses"}),(0,r.jsx)(ec,{items:p.voice_model_options,selected:p.selected_voice_model_config,callbackFunc:ev("voice")})]}),(0,r.jsx)(y.eW,{className:"flex flex-wrap gap-4",children:!p.is_active&&(0,r.jsx)("p",{className:"text-gray-400",children:"Subscribe to switch model"})})]})]})]}),(0,r.jsxs)("div",{className:"section grid gap-8",children:[(0,r.jsx)("div",{id:"clients",className:"text-2xl",children:"Clients"}),(0,r.jsxs)("div",{className:"cards flex flex-wrap gap-8",children:[!p.anonymous_mode&&(0,r.jsxs)(y.Zb,{className:"grid grid-flow-column border border-gray-300 shadow-md rounded-lg bg-gradient-to-b from-background to-gray-50 dark:to-gray-950",children:[(0,r.jsxs)(y.Ol,{className:"text-xl grid grid-flow-col grid-cols-[1fr_auto] pb-0",children:[(0,r.jsxs)("span",{className:"flex flex-wrap",children:[(0,r.jsx)($.s,{className:"h-7 w-7 mr-2"}),"API Keys"]}),(0,r.jsxs)(m.z,{variant:"secondary",className:"!mt-0",onClick:a,children:[(0,r.jsx)(D.v,{weight:"bold",className:"h-5 w-5 mr-2"}),"Generate Key"]})]}),(0,r.jsxs)(y.aY,{className:"overflow-hidden grid gap-6",children:[(0,r.jsxs)("p",{className:"text-md text-gray-400",children:["Access Khoj from the"," ",(0,r.jsx)("a",{href:"https://docs.khoj.dev/clients/Desktop",target:"_blank",children:"Desktop"}),","," ",(0,r.jsx)("a",{href:"https://docs.khoj.dev/clients/Obsidian",children:"Obsidian"}),","," ",(0,r.jsx)("a",{href:"https://docs.khoj.dev/clients/Emacs",children:"Emacs"})," ","apps and more."]}),(0,r.jsx)(v,{children:(0,r.jsx)(_,{children:t.map(e=>(0,r.jsxs)(k,{children:[(0,r.jsx)(S,{className:"pl-0 py-3",children:e.name}),(0,r.jsxs)(S,{className:"grid grid-flow-col grid-cols-[1fr_auto] bg-secondary rounded-xl p-3 m-1",children:[(0,r.jsx)("span",{children:"".concat(e.token.slice(0,6),"...").concat(e.token.slice(-4))}),(0,r.jsxs)("div",{className:"grid grid-flow-col",children:[(0,r.jsx)(q.C,{weight:"bold",className:"h-4 w-4 mr-2 hover:bg-primary/40",onClick:()=>{ep({title:"\uD83D\uDD11 Copied API Key: ".concat(e.name),description:"Set this API key in the Khoj apps you want to connect to this Khoj account"}),n(e.token)}}),(0,r.jsx)(P.r,{weight:"bold",className:"h-4 w-4 mr-2 md:ml-4 text-red-400 hover:bg-primary/40",onClick:()=>{ep({title:"\uD83D\uDD11 Deleted API Key: ".concat(e.name),description:"Apps using this API key will no longer connect to this Khoj account"}),l(e.token)}})]})]})]},e.token))})})]}),(0,r.jsx)(y.eW,{className:"flex flex-wrap gap-4"})]}),(0,r.jsxs)(y.Zb,{className:ej,children:[(0,r.jsxs)(y.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(X.V,{className:"h-7 w-7 mr-2"}),"Chat on Whatsapp","verified"===eh&&(0,r.jsx)(K.f,{weight:"bold",className:"h-4 w-4 ml-1 text-green-400"})||"setup"!==eh&&(0,r.jsx)(F.C,{weight:"bold",className:"h-4 w-4 ml-1 text-yellow-400"})]}),(0,r.jsxs)(y.aY,{className:"grid gap-4",children:[(0,r.jsxs)("p",{className:"text-gray-400",children:["Connect your number to chat with Khoj on WhatsApp. Learn more about the integration"," ",(0,r.jsx)("a",{href:"https://docs.khoj.dev/clients/whatsapp",children:"here"}),"."]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(ea.Z,{initialValue:en||"",onChangeNumber:er,disabled:"verify"===eh,initOptions:{separateDialCode:!0,initialCountry:"af",utilsScript:"https://assets.khoj.dev/intl-tel-input%4023.8.0_build_js_utils.js",containerClass:"".concat(i().phoneInput)}}),"verify"===eh&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{children:"Enter the OTP sent to your number: ".concat(en)}),(0,r.jsx)(j,{autoFocus:!0,maxLength:6,value:el||"",onChange:ei,onComplete:()=>eu("verify"),children:(0,r.jsxs)(g,{children:[(0,r.jsx)(b,{index:0}),(0,r.jsx)(b,{index:1}),(0,r.jsx)(b,{index:2}),(0,r.jsx)(b,{index:3}),(0,r.jsx)(b,{index:4}),(0,r.jsx)(b,{index:5})]})})]})]})]}),(0,r.jsxs)(y.eW,{className:"flex flex-wrap gap-4",children:["verify"===eh&&(0,r.jsx)(m.z,{variant:"outline",onClick:eb,children:"Verify"})||(0,r.jsx)(m.z,{variant:"outline",disabled:!en||en===p.phone_number&&"verified"===eh||!(0,u.y)(en),onClick:eg,children:p.phone_number?en&&(en!==p.phone_number||"verified"!==eh)&&(0,u.y)(en)?(0,r.jsxs)(r.Fragment,{children:["Send OTP"," ",(0,r.jsx)(ee.o,{className:"inline ml-2",weight:"bold"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Q.F,{className:"inline mr-2 text-green-400"}),"Switch Number"]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.F,{className:"inline mr-2"}),"Setup Whatsapp"]})}),"verified"===eh&&(0,r.jsxs)(m.z,{variant:"outline",onClick:()=>eN(),children:[(0,r.jsx)(M.u,{className:"h-5 w-5 mr-2"}),"Disconnect"]})]})]})]})]})]})})})})]}):(0,r.jsx)(et.Z,{})}(a=n||(n={})).Setup="setup",a.SendOTP="otp",a.VerifyOTP="verify",a.Verified="verified"},70571:function(e,s,t){"use strict";t.d(s,{E:function(){return i}});var a=t(57437),n=t(2265),r=t(52431),l=t(37440);let i=n.forwardRef((e,s)=>{let{className:t,value:n,indicatorColor:i,...o}=e;return(0,a.jsx)(r.fC,{ref:s,className:(0,l.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...o,children:(0,a.jsx)(r.z$,{className:"h-full w-full flex-1 bg-primary transition-all ".concat(i),style:{transform:"translateX(-".concat(100-(n||0),"%)")}})})});i.displayName=r.fC.displayName},35657:function(e,s,t){"use strict";t.d(s,{pm:function(){return u}});var a=t(2265);let n=0,r=new Map,l=e=>{if(r.has(e))return;let s=setTimeout(()=>{r.delete(e),d({type:"REMOVE_TOAST",toastId:e})},1e6);r.set(e,s)},i=(e,s)=>{switch(s.type){case"ADD_TOAST":return{...e,toasts:[s.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===s.toast.id?{...e,...s.toast}:e)};case"DISMISS_TOAST":{let{toastId:t}=s;return t?l(t):e.toasts.forEach(e=>{l(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===t||void 0===t?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===s.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==s.toastId)}}},o=[],c={toasts:[]};function d(e){c=i(c,e),o.forEach(e=>{e(c)})}function h(e){let{...s}=e,t=(n=(n+1)%Number.MAX_SAFE_INTEGER).toString(),a=()=>d({type:"DISMISS_TOAST",toastId:t});return d({type:"ADD_TOAST",toast:{...s,id:t,open:!0,onOpenChange:e=>{e||a()}}}),{id:t,dismiss:a,update:e=>d({type:"UPDATE_TOAST",toast:{...e,id:t}})}}function u(){let[e,s]=a.useState(c);return a.useEffect(()=>(o.push(s),()=>{let e=o.indexOf(s);e>-1&&o.splice(e,1)}),[e]),{...e,toast:h,dismiss:e=>d({type:"DISMISS_TOAST",toastId:e})}}},55268:function(e){e.exports={page:"settings_page__mP7qk",contentBody:"settings_contentBody__uZjue",phoneInput:"settings_phoneInput__j6xJN",sidePanel:"settings_sidePanel__osdez"}}},function(e){e.O(0,[4229,9427,9001,3062,3678,1603,2971,7023,1744],function(){return e(e.s=62960)}),_N_E=e.O()}]);