khoj 1.26.2__py3-none-any.whl → 1.26.5.dev34__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.
- khoj/configure.py +3 -3
- khoj/database/adapters/__init__.py +40 -8
- khoj/database/migrations/0070_alter_agent_input_tools_alter_agent_output_modes.py +46 -0
- khoj/database/migrations/0071_subscription_enabled_trial_at_and_more.py +32 -0
- khoj/database/models/__init__.py +8 -3
- khoj/interface/compiled/404/index.html +1 -1
- khoj/interface/compiled/_next/static/chunks/1210.132a7e1910006bbb.js +1 -0
- khoj/interface/compiled/_next/static/chunks/1279-f37ee4a388ebf544.js +1 -0
- khoj/interface/compiled/_next/static/chunks/1459.690bf20e7d7b7090.js +1 -0
- khoj/interface/compiled/_next/static/chunks/1603-b9d95833e0e025e8.js +1 -0
- khoj/interface/compiled/_next/static/chunks/1970-1d6d0c1b00b4f343.js +1 -0
- khoj/interface/compiled/_next/static/chunks/2697-61fcba89fd87eab4.js +1 -0
- khoj/interface/compiled/_next/static/chunks/3423-8e9c420574a9fbe3.js +1 -0
- khoj/interface/compiled/_next/static/chunks/394-6bcb8c429f168f21.js +3 -0
- khoj/interface/compiled/_next/static/chunks/4602-8eeb4b76385ad159.js +1 -0
- khoj/interface/compiled/_next/static/chunks/5512-94c7c2bbcf58c19d.js +1 -0
- khoj/interface/compiled/_next/static/chunks/7113-f2e114d7034a0835.js +1 -0
- khoj/interface/compiled/_next/static/chunks/{4086-2c74808ba38a5a0f.js → 8840-b8d7b9f0923c6651.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/9417-759984ad62caa3dc.js +1 -0
- khoj/interface/compiled/_next/static/chunks/9479-4b443fdcc99141c9.js +1 -0
- khoj/interface/compiled/_next/static/chunks/94ca1967.5584df65931cfe83.js +1 -0
- khoj/interface/compiled/_next/static/chunks/964ecbae.ea4eab2a3a835ffe.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/agents/page-2beaba7c9bb750bd.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/automations/{page-5480731341f34450.js → page-9b5c77e0b0dd772c.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/chat/page-151232d8417a1ea1.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/factchecker/{page-e7b34316ec6f44de.js → page-798904432c2417c4.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/{page-10a5aad6e04f3cf8.js → page-db4e38a5255af7ad.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/search/{page-d56541c746fded7d.js → page-ab2995529ece3140.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/settings/page-3e9cf5ed5ace4310.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/share/chat/page-6a01e07fb244c10c.js +1 -0
- khoj/interface/compiled/_next/static/chunks/webpack-313247d7eb764923.js +1 -0
- khoj/interface/compiled/_next/static/css/{c808691c459e3887.css → 3cf13271869a4aeb.css} +1 -1
- khoj/interface/compiled/_next/static/css/76d55eb435962b19.css +25 -0
- khoj/interface/compiled/_next/static/css/{3e1f1fdd70775091.css → 80bd6301fc657983.css} +1 -1
- khoj/interface/compiled/_next/static/css/{2de69f0be774c768.css → b70402177a7c3207.css} +1 -1
- khoj/interface/compiled/agents/index.html +1 -1
- khoj/interface/compiled/agents/index.txt +2 -2
- khoj/interface/compiled/automations/index.html +1 -1
- khoj/interface/compiled/automations/index.txt +2 -2
- khoj/interface/compiled/chat/index.html +1 -1
- khoj/interface/compiled/chat/index.txt +2 -2
- khoj/interface/compiled/factchecker/index.html +1 -1
- khoj/interface/compiled/factchecker/index.txt +2 -2
- khoj/interface/compiled/index.html +1 -1
- khoj/interface/compiled/index.txt +2 -2
- khoj/interface/compiled/search/index.html +1 -1
- khoj/interface/compiled/search/index.txt +2 -2
- khoj/interface/compiled/settings/index.html +1 -1
- khoj/interface/compiled/settings/index.txt +2 -2
- khoj/interface/compiled/share/chat/index.html +1 -1
- khoj/interface/compiled/share/chat/index.txt +2 -2
- khoj/processor/conversation/google/gemini_chat.py +28 -13
- khoj/processor/conversation/google/utils.py +34 -12
- khoj/processor/conversation/openai/gpt.py +4 -4
- khoj/processor/conversation/prompts.py +144 -0
- khoj/processor/conversation/utils.py +22 -13
- khoj/processor/image/generate.py +5 -5
- khoj/processor/tools/online_search.py +4 -4
- khoj/routers/api.py +13 -4
- khoj/routers/api_agents.py +41 -20
- khoj/routers/api_chat.py +85 -46
- khoj/routers/{subscription.py → api_subscription.py} +21 -3
- khoj/routers/auth.py +2 -2
- khoj/routers/helpers.py +235 -30
- khoj/routers/web_client.py +0 -11
- khoj/utils/helpers.py +7 -3
- {khoj-1.26.2.dist-info → khoj-1.26.5.dev34.dist-info}/METADATA +2 -2
- {khoj-1.26.2.dist-info → khoj-1.26.5.dev34.dist-info}/RECORD +73 -66
- khoj/interface/compiled/_next/static/chunks/121-7024f479c297aef0.js +0 -1
- khoj/interface/compiled/_next/static/chunks/1603-fa3ee48860b9dc5c.js +0 -1
- khoj/interface/compiled/_next/static/chunks/2697-a38d01981ad3bdf8.js +0 -1
- khoj/interface/compiled/_next/static/chunks/4051-2cf66369d6ca0f1d.js +0 -3
- khoj/interface/compiled/_next/static/chunks/477-ec86e93db10571c1.js +0 -1
- khoj/interface/compiled/_next/static/chunks/51-e8f5bdb69b5ea421.js +0 -1
- khoj/interface/compiled/_next/static/chunks/7762-79f2205740622b5c.js +0 -1
- khoj/interface/compiled/_next/static/chunks/9178-899fe9a6b754ecfe.js +0 -1
- khoj/interface/compiled/_next/static/chunks/9417-46ed3aaa639c85ef.js +0 -1
- khoj/interface/compiled/_next/static/chunks/9479-ea776e73f549090c.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/agents/page-88aa3042711107b7.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/chat/page-702057ccbcf27881.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/settings/page-e044a999468a7c5d.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/share/chat/page-fbbd66a4d4633438.js +0 -1
- khoj/interface/compiled/_next/static/chunks/webpack-64dc39af85cd2625.js +0 -1
- khoj/interface/compiled/_next/static/css/b9a6bf04305d98d7.css +0 -25
- /khoj/interface/compiled/_next/static/{eim4XajTfG4ub4ft5AEkJ → 7viHIza-WalEOzloM67l4}/_buildManifest.js +0 -0
- /khoj/interface/compiled/_next/static/{eim4XajTfG4ub4ft5AEkJ → 7viHIza-WalEOzloM67l4}/_ssgManifest.js +0 -0
- {khoj-1.26.2.dist-info → khoj-1.26.5.dev34.dist-info}/WHEEL +0 -0
- {khoj-1.26.2.dist-info → khoj-1.26.5.dev34.dist-info}/entry_points.txt +0 -0
- {khoj-1.26.2.dist-info → khoj-1.26.5.dev34.dist-info}/licenses/LICENSE +0 -0
@@ -1 +0,0 @@
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9479],{59479:function(e,t,a){"use strict";a.d(t,{Z:function(){return eL}});var r=a(57437),n=a(37649),l=a.n(n),o=a(2265),s=a(11838),i=a.n(s);a(7395);var c=a(52195);let d=new Map([["bold",o.createElement(o.Fragment,null,o.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",o.createElement(o.Fragment,null,o.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),o.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",o.createElement(o.Fragment,null,o.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",o.createElement(o.Fragment,null,o.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",o.createElement(o.Fragment,null,o.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",o.createElement(o.Fragment,null,o.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]);var u=Object.defineProperty,m=Object.defineProperties,h=Object.getOwnPropertyDescriptors,p=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable,b=(e,t,a)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,x=(e,t)=>{for(var a in t||(t={}))f.call(t,a)&&b(e,a,t[a]);if(p)for(var a of p(t))g.call(t,a)&&b(e,a,t[a]);return e},j=(e,t)=>m(e,h(t));let v=(0,o.forwardRef)((e,t)=>o.createElement(c.Z,j(x({ref:t},e),{weights:d})));v.displayName="X";let y=new Map([["bold",o.createElement(o.Fragment,null,o.createElement("path",{d:"M212.48,136.49l-82.06,82a60,60,0,0,1-84.85-84.88l98.16-97.89a40,40,0,0,1,56.56,56.59l-.17.16-95.8,92.22a12,12,0,1,1-16.64-17.3l95.71-92.12a16,16,0,0,0-22.7-22.56L62.53,150.57a36,36,0,0,0,50.93,50.91l82.06-82a12,12,0,0,1,17,17Z"}))],["duotone",o.createElement(o.Fragment,null,o.createElement("path",{d:"M180.75,104.75,204,128l-82.06,81.94a48,48,0,0,1-67.88-67.88L153.37,41.37a32,32,0,0,1,45.26,45.26Z",opacity:"0.2"}),o.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["fill",o.createElement(o.Fragment,null,o.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,50.34a8,8,0,0,0-11.32,0L87.09,143A24,24,0,1,0,121,177l49.32-50.32a8,8,0,1,1,11.42,11.2l-49.37,50.38a40,40,0,1,1-56.62-56.51L143,63.09A24,24,0,1,1,177,97L109.71,165.6a8,8,0,1,1-11.42-11.2L165.6,85.71a8,8,0,0,0,.06-11.37Z"}))],["light",o.createElement(o.Fragment,null,o.createElement("path",{d:"M208.25,123.76a6,6,0,0,1,0,8.49l-82.06,82a54,54,0,0,1-76.36-76.39L149.1,37.14a38,38,0,1,1,53.77,53.72L103.59,191.54a22,22,0,1,1-31.15-31.09l83.28-84.67a6,6,0,0,1,8.56,8.42L81,168.91a10,10,0,1,0,14.11,14.18L194.35,82.4a26,26,0,1,0-36.74-36.8L58.33,146.28a42,42,0,1,0,59.37,59.44l82.06-82A6,6,0,0,1,208.25,123.76Z"}))],["regular",o.createElement(o.Fragment,null,o.createElement("path",{d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"}))],["thin",o.createElement(o.Fragment,null,o.createElement("path",{d:"M206.83,125.17a4,4,0,0,1,0,5.66l-82.06,82a52,52,0,0,1-73.54-73.55L150.52,38.55a36,36,0,1,1,50.94,50.9l-99.3,100.69a20,20,0,1,1-28.3-28.27l83.29-84.68a4,4,0,1,1,5.7,5.61L79.54,167.5a12,12,0,1,0,16.95,17L195.78,83.81A28,28,0,1,0,156.2,44.18L56.91,144.87a44,44,0,1,0,62.21,62.26l82-82A4,4,0,0,1,206.83,125.17Z"}))]]);var w=Object.defineProperty,E=Object.defineProperties,L=Object.getOwnPropertyDescriptors,A=Object.getOwnPropertySymbols,Z=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,M=(e,t,a)=>t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,V=(e,t)=>{for(var a in t||(t={}))Z.call(t,a)&&M(e,a,t[a]);if(A)for(var a of A(t))O.call(t,a)&&M(e,a,t[a]);return e},N=(e,t)=>E(e,L(t));let F=(0,o.forwardRef)((e,t)=>o.createElement(c.Z,N(V({ref:t},e),{weights:y})));F.displayName="Paperclip";let k=new Map([["bold",o.createElement(o.Fragment,null,o.createElement("path",{d:"M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,160H60V60H196Z"}))],["duotone",o.createElement(o.Fragment,null,o.createElement("path",{d:"M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z",opacity:"0.2"}),o.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z"}))],["fill",o.createElement(o.Fragment,null,o.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z"}))],["light",o.createElement(o.Fragment,null,o.createElement("path",{d:"M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,158a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2Z"}))],["regular",o.createElement(o.Fragment,null,o.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z"}))],["thin",o.createElement(o.Fragment,null,o.createElement("path",{d:"M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,156a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4Z"}))]]);var H=Object.defineProperty,C=Object.defineProperties,P=Object.getOwnPropertyDescriptors,D=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable,T=(e,t,a)=>t in e?H(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,I=(e,t)=>{for(var a in t||(t={}))S.call(t,a)&&T(e,a,t[a]);if(D)for(var a of D(t))R.call(t,a)&&T(e,a,t[a]);return e},z=(e,t)=>C(e,P(t));let _=(0,o.forwardRef)((e,t)=>o.createElement(c.Z,z(I({ref:t},e),{weights:k})));_.displayName="Stop";let U=new Map([["bold",o.createElement(o.Fragment,null,o.createElement("path",{d:"M128,180a52.06,52.06,0,0,0,52-52V64A52,52,0,0,0,76,64v64A52.06,52.06,0,0,0,128,180ZM100,64a28,28,0,0,1,56,0v64a28,28,0,0,1-56,0Zm40,155.22V240a12,12,0,0,1-24,0V219.22A92.14,92.14,0,0,1,36,128a12,12,0,0,1,24,0,68,68,0,0,0,136,0,12,12,0,0,1,24,0A92.14,92.14,0,0,1,140,219.22Z"}))],["duotone",o.createElement(o.Fragment,null,o.createElement("path",{d:"M168,64v64a40,40,0,0,1-40,40h0a40,40,0,0,1-40-40V64a40,40,0,0,1,40-40h0A40,40,0,0,1,168,64Z",opacity:"0.2"}),o.createElement("path",{d:"M128,176a48.05,48.05,0,0,0,48-48V64a48,48,0,0,0-96,0v64A48.05,48.05,0,0,0,128,176ZM96,64a32,32,0,0,1,64,0v64a32,32,0,0,1-64,0Zm40,143.6V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64,64,0,0,0,128,0,8,8,0,0,1,16,0A80.11,80.11,0,0,1,136,207.6Z"}))],["fill",o.createElement(o.Fragment,null,o.createElement("path",{d:"M80,128V64a48,48,0,0,1,96,0v64a48,48,0,0,1-96,0Zm128,0a8,8,0,0,0-16,0,64,64,0,0,1-128,0,8,8,0,0,0-16,0,80.11,80.11,0,0,0,72,79.6V240a8,8,0,0,0,16,0V207.6A80.11,80.11,0,0,0,208,128Z"}))],["light",o.createElement(o.Fragment,null,o.createElement("path",{d:"M128,174a46.06,46.06,0,0,0,46-46V64a46,46,0,0,0-92,0v64A46.06,46.06,0,0,0,128,174ZM94,64a34,34,0,0,1,68,0v64a34,34,0,0,1-68,0Zm40,141.75V240a6,6,0,0,1-12,0V205.75A78.09,78.09,0,0,1,50,128a6,6,0,0,1,12,0,66,66,0,0,0,132,0,6,6,0,0,1,12,0A78.09,78.09,0,0,1,134,205.75Z"}))],["regular",o.createElement(o.Fragment,null,o.createElement("path",{d:"M128,176a48.05,48.05,0,0,0,48-48V64a48,48,0,0,0-96,0v64A48.05,48.05,0,0,0,128,176ZM96,64a32,32,0,0,1,64,0v64a32,32,0,0,1-64,0Zm40,143.6V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64,64,0,0,0,128,0,8,8,0,0,1,16,0A80.11,80.11,0,0,1,136,207.6Z"}))],["thin",o.createElement(o.Fragment,null,o.createElement("path",{d:"M128,172a44.05,44.05,0,0,0,44-44V64a44,44,0,0,0-88,0v64A44.05,44.05,0,0,0,128,172ZM92,64a36,36,0,0,1,72,0v64a36,36,0,0,1-72,0Zm40,139.89V240a4,4,0,0,1-8,0V203.89A76.09,76.09,0,0,1,52,128a4,4,0,0,1,8,0,68,68,0,0,0,136,0,4,4,0,0,1,8,0A76.09,76.09,0,0,1,132,203.89Z"}))]]);var Y=Object.defineProperty,W=Object.defineProperties,$=Object.getOwnPropertyDescriptors,J=Object.getOwnPropertySymbols,K=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable,X=(e,t,a)=>t in e?Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,q=(e,t)=>{for(var a in t||(t={}))K.call(t,a)&&X(e,a,t[a]);if(J)for(var a of J(t))B.call(t,a)&&X(e,a,t[a]);return e},G=(e,t)=>W(e,$(t));let Q=(0,o.forwardRef)((e,t)=>o.createElement(c.Z,G(q({ref:t},e),{weights:U})));Q.displayName="Microphone";let ee=new Map([["bold",o.createElement(o.Fragment,null,o.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",o.createElement(o.Fragment,null,o.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),o.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",o.createElement(o.Fragment,null,o.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",o.createElement(o.Fragment,null,o.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",o.createElement(o.Fragment,null,o.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",o.createElement(o.Fragment,null,o.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]);var et=Object.defineProperty,ea=Object.defineProperties,er=Object.getOwnPropertyDescriptors,en=Object.getOwnPropertySymbols,el=Object.prototype.hasOwnProperty,eo=Object.prototype.propertyIsEnumerable,es=(e,t,a)=>t in e?et(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,ei=(e,t)=>{for(var a in t||(t={}))el.call(t,a)&&es(e,a,t[a]);if(en)for(var a of en(t))eo.call(t,a)&&es(e,a,t[a]);return e},ec=(e,t)=>ea(e,er(t));let ed=(0,o.forwardRef)((e,t)=>o.createElement(c.Z,ec(ei({ref:t},e),{weights:ee})));ed.displayName="ArrowUp";var eu=a(42491),em=a(6780),eh=a(50495),ep=a(70571),ef=a(19573),eg=a(61485),eb=a(93146),ex=a(19666),ej=a(58575),ev=a(66820),ey=a(9557),ew=a(58485),eE=a(89417);function eL(e){let[t,a]=(0,o.useState)(""),n=(0,o.useRef)(null),[s,c]=(0,o.useState)(null),[d,u]=(0,o.useState)(null),[m,h]=(0,o.useState)(!1),[p,f]=(0,o.useState)(null),[g,b]=(0,o.useState)(!1),[x,j]=(0,o.useState)(!1),[y,w]=(0,o.useState)(!1),[E,L]=(0,o.useState)(""),[A,Z]=(0,o.useState)(null),[O,M]=(0,o.useState)(null),[V,N]=(0,o.useState)(0),[k,H]=(0,o.useState)(!1);function C(){if(y&&(w(!1),L(""),e.sendImage(A||"")),t.trim()){if(!e.isLoggedIn){f("Hey there, you need to be signed in to send messages to Khoj AI"),b(!0);return}e.sendMessage(t.trim()),a("")}}function P(t){if(!e.isLoggedIn){f("Please login to chat with your files"),b(!0);return}let a=["jpg","jpeg","png","webp"];for(let e=0;e<t.length;e++){let r=t[e],n=r.name.split(".").pop();if(a.includes(n||"")){w(!0),L(i().sanitize(URL.createObjectURL(r)));return}}(0,ey.ko)(t,c,h,u,e.setUploadedFiles,e.conversationId)}async function D(){try{let e=await navigator.mediaDevices.getUserMedia({audio:!0}),t=new MediaRecorder(e,{mimeType:"audio/webm"}),r=[];t.ondataavailable=async e=>{r.push(e.data);let t=new Blob(r,{type:"audio/webm"}),n=new FormData;n.append("file",t);try{let e=await fetch("/api/transcribe",{method:"POST",body:n});if(!e.ok)throw Error("Network response was not ok");let t=await e.json();a(t.text.trim())}catch(e){console.error("Error sending audio to server:",e)}},t.start(1500),t.onstop=async()=>{let e=new Blob(r,{type:"audio/webm"}),n=new FormData;n.append("file",e);try{let e=await fetch("/api/transcribe",{method:"POST",body:n});if(!e.ok)throw Error("Network response was not ok");let r=await e.json();t.stream.getTracks().forEach(e=>e.stop()),M(null),a(r.text.trim())}catch(e){console.error("Error sending audio to server:",e)}},M(t)}catch(e){console.error("Error getting microphone",e)}}(0,o.useEffect)(()=>{if(m||N(0),m){let e=setInterval(()=>{N(e=>{let t=e+(Math.floor(5*Math.random())+1);return t<100?t:100})},800);return()=>clearInterval(e)}},[m]),(0,o.useEffect)(()=>{async function e(){if(E){let e=await fetch(E),t=await e.blob(),a=new FileReader;a.onload=function(){Z(a.result)},a.readAsDataURL(t)}h(!1)}h(!0),e()},[E]),(0,o.useEffect)(()=>{!x&&O&&O.stop(),x&&!O&&D()},[x,O]);let S=(0,o.useRef)(null);return(0,o.useEffect)(()=>{S.current&&(S.current.style.height="auto",S.current.style.height=Math.max(S.current.scrollHeight-24,64)+"px")},[t]),(0,r.jsxs)(r.Fragment,{children:[g&&p&&(0,r.jsx)(ev.Z,{onOpenChange:b,loginRedirectMessage:p}),m&&(0,r.jsx)(em.aR,{open:m,children:(0,r.jsxs)(em._T,{children:[(0,r.jsx)(em.fY,{children:(0,r.jsx)(em.f$,{children:"Uploading data. Please wait."})}),(0,r.jsx)(em.yT,{children:(0,r.jsx)(ep.E,{indicatorColor:"bg-slate-500",className:"w-full h-2 rounded-full",value:V})}),(0,r.jsx)(em.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>h(!1),children:"Dismiss"})]})}),s&&(0,r.jsx)(em.aR,{open:null!==s,children:(0,r.jsxs)(em._T,{children:[(0,r.jsx)(em.fY,{children:(0,r.jsx)(em.f$,{children:"Data Upload Warning"})}),(0,r.jsx)(em.yT,{children:s}),(0,r.jsx)(em.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>c(null),children:"Close"})]})}),d&&(0,r.jsx)(em.aR,{open:null!==d,children:(0,r.jsxs)(em._T,{children:[(0,r.jsxs)(em.fY,{children:[(0,r.jsx)(em.f$,{children:"Oh no!"}),(0,r.jsx)(em.yT,{children:"Something went wrong while uploading your data"})]}),(0,r.jsx)(em.yT,{children:d}),(0,r.jsx)(em.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>u(null),children:"Close"})]})}),t.startsWith("/")&&1===t.split(" ").length&&(0,r.jsx)("div",{className:"flex justify-center text-center",children:(0,r.jsxs)(ef.J2,{open:t.startsWith("/"),children:[(0,r.jsx)(eg.xo,{className:"flex justify-center text-center"}),(0,r.jsx)(ef.yk,{onOpenAutoFocus:e=>e.preventDefault(),className:"".concat(e.isMobileWidth?"w-[100vw]":"w-full"," rounded-md"),children:(0,r.jsxs)(eu.mY,{className:"max-w-full",children:[(0,r.jsx)(eu.sZ,{placeholder:"Type a command or search...",value:t,className:"hidden"}),(0,r.jsxs)(eu.e8,{children:[(0,r.jsx)(eu.rb,{children:"No matching commands."}),(0,r.jsx)(eu.fu,{heading:"Agent Tools",children:e.chatOptionsData&&Object.entries(e.chatOptionsData).map(e=>{let[t,n]=e;return(0,r.jsx)(eu.di,{className:"text-md",onSelect:()=>{a("/".concat(t," "))},children:(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-1",children:[(0,r.jsxs)("div",{className:"font-bold flex items-center",children:[(0,eE.vH)(t,"h-4 w-4 mr-2"),"/",t]}),(0,r.jsx)("div",{children:n})]})},t)})}),(0,r.jsx)(eu.zz,{})]})]})})]})}),(0,r.jsxs)("div",{className:"".concat(l().actualInputArea," items-center justify-between dark:bg-neutral-700 relative ").concat(k&&"animate-pulse"),onDragOver:function(e){e.preventDefault(),H(!0)},onDragLeave:function(e){e.preventDefault(),H(!1)},onDrop:function(e){e.preventDefault(),H(!1),e.dataTransfer.files&&P(e.dataTransfer.files)},children:[y&&(0,r.jsxs)("div",{className:"absolute bottom-[80px] left-0 right-0 dark:bg-neutral-700 bg-white pt-5 pb-5 w-full rounded-lg border dark:border-none grid grid-cols-2",children:[(0,r.jsx)("div",{className:"pl-4 pr-4",children:(0,r.jsx)("img",{src:E,alt:"img",className:"w-auto max-h-[100px]"})}),(0,r.jsx)("div",{className:"pl-4 pr-4",children:(0,r.jsx)(v,{className:"w-6 h-6 float-right dark:hover:bg-[hsl(var(--background))] hover:bg-neutral-100 rounded-sm",onClick:function(){w(!1),L("")}})})]}),(0,r.jsx)("input",{type:"file",multiple:!0,ref:n,onChange:function(e){e.target.files&&P(e.target.files)},style:{display:"none"}}),(0,r.jsx)(eh.z,{variant:"ghost",className:"!bg-none p-0 m-2 h-auto text-3xl rounded-full text-gray-300 hover:text-gray-500",disabled:e.sendDisabled,onClick:function(){n.current&&n.current.click()},children:(0,r.jsx)(F,{className:"w-8 h-8"})}),(0,r.jsx)("div",{className:"grid w-full gap-1.5 relative",children:(0,r.jsx)(eb.g,{ref:S,className:"border-none w-full h-16 min-h-16 max-h-[128px] md:py-4 rounded-lg resize-none dark:bg-neutral-700 ".concat(e.isMobileWidth?"text-md":"text-lg"),placeholder:"Type / to see a list of commands",id:"message",autoFocus:!0,value:t,onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(w(!1),L(""),e.preventDefault(),C())},onChange:e=>a(e.target.value),disabled:e.sendDisabled||x})}),x?(0,r.jsx)(ex.pn,{children:(0,r.jsxs)(ex.u,{children:[(0,r.jsx)(ex.aJ,{asChild:!0,children:(0,r.jsx)(eh.z,{variant:"default",className:"".concat(!x&&"hidden"," ").concat(e.agentColor?(0,ej.tp)(e.agentColor):"bg-orange-300 hover:bg-orange-500"," rounded-full p-1 m-2 h-auto text-3xl transition transform md:hover:-translate-y-1"),onClick:()=>{j(!x)},disabled:e.sendDisabled,children:(0,r.jsx)(_,{weight:"fill",className:"w-6 h-6"})})}),(0,r.jsx)(ex._v,{children:"Click to stop recording and transcribe your voice."})]})}):O?(0,r.jsx)(ew.l,{}):(0,r.jsx)(ex.pn,{children:(0,r.jsxs)(ex.u,{children:[(0,r.jsx)(ex.aJ,{asChild:!0,children:(0,r.jsx)(eh.z,{variant:"default",className:"".concat(!t||x||"hidden"," ").concat(e.agentColor?(0,ej.tp)(e.agentColor):"bg-orange-300 hover:bg-orange-500"," rounded-full p-1 m-2 h-auto text-3xl transition transform md:hover:-translate-y-1"),onClick:()=>{a("Listening..."),j(!x)},disabled:e.sendDisabled,children:(0,r.jsx)(Q,{weight:"fill",className:"w-6 h-6"})})}),(0,r.jsx)(ex._v,{children:"Click to transcribe your message with voice."})]})}),(0,r.jsx)(eh.z,{className:"".concat((!t||x)&&"hidden"," ").concat(e.agentColor?(0,ej.tp)(e.agentColor):"bg-orange-300 hover:bg-orange-500"," rounded-full p-1 m-2 h-auto text-3xl transition transform md:hover:-translate-y-1"),onClick:C,disabled:e.sendDisabled,children:(0,r.jsx)(ed,{className:"w-6 h-6",weight:"bold"})})]})]})}},66820:function(e,t,a){"use strict";a.d(t,{Z:function(){return o}});var r=a(57437),n=a(6780),l=a(87138);function o(e){return(0,r.jsx)(n.aR,{open:!0,onOpenChange:e.onOpenChange,children:(0,r.jsxs)(n._T,{children:[(0,r.jsx)(n.fY,{children:(0,r.jsx)(n.f$,{children:"Sign in to Khoj to continue"})}),(0,r.jsxs)(n.yT,{children:[e.loginRedirectMessage,". By logging in, you agree to our"," ",(0,r.jsx)(l.default,{href:"https://khoj.dev/terms-of-service",children:"Terms of Service."})]}),(0,r.jsxs)(n.xo,{children:[(0,r.jsx)(n.le,{children:"Dismiss"}),(0,r.jsx)(n.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>{window.location.href="/login?next=".concat(encodeURIComponent(window.location.pathname))},children:(0,r.jsxs)(l.default,{href:"/login?next=".concat(encodeURIComponent(window.location.pathname)),children:[" ","Login"]})})]})]})})}},70571:function(e,t,a){"use strict";a.d(t,{E:function(){return s}});var r=a(57437),n=a(2265),l=a(52431),o=a(37440);let s=n.forwardRef((e,t)=>{let{className:a,value:n,indicatorColor:s,...i}=e;return(0,r.jsx)(l.fC,{ref:t,className:(0,o.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",a),...i,children:(0,r.jsx)(l.z$,{className:"h-full w-full flex-1 bg-primary transition-all ".concat(s),style:{transform:"translateX(-".concat(100-(n||0),"%)")}})})});s.displayName=l.fC.displayName},93146:function(e,t,a){"use strict";a.d(t,{g:function(){return o}});var r=a(57437),n=a(2265),l=a(37440);let o=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)("textarea",{className:(0,l.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a),ref:t,...n})});o.displayName="Textarea"},19666:function(e,t,a){"use strict";a.d(t,{_v:function(){return d},aJ:function(){return c},pn:function(){return s},u:function(){return i}});var r=a(57437),n=a(2265),l=a(27071),o=a(37440);let s=l.zt,i=l.fC,c=l.xz,d=n.forwardRef((e,t)=>{let{className:a,sideOffset:n=4,...s}=e;return(0,r.jsx)(l.VY,{ref:t,sideOffset:n,className:(0,o.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...s})});d.displayName=l.VY.displayName},37649:function(e){e.exports={actualInputArea:"chatInputArea_actualInputArea__Ha6cN"}}}]);
|
@@ -1 +0,0 @@
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9718],{1813:function(e,t,s){Promise.resolve().then(s.bind(s,45050))},45050:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return em}});var a=s(57437),l=s(15283),n=s.n(l),r=s(29039),i=s(2265),o=s(79306),c=s(50495),d=s(58284),u=s(5989),h=s(12275),m=s(18444),x=s(31784),f=s(20319),p=s(98750),g=s(55362),j=s(57691),v=s(68029),b=s(68131),N=s(83632),y=s(9950),w=s(35418),_=s(84120),C=s(95289),k=s(26100),S=s(26058),O=s(15780),z=s(64945),T=s(59772),I=s(36013),P=s(90837),R=s(66820),V=s(58485),M=s(48861),A=s(89417),E=s(58575),B=s(47412),Z=s(69591),q=s(32653),F=s(39343),L=s(83102),W=s(31014),D=s(93146),J=s(46294),X=s(13304),Y=s(40882);let G=Y.fC,U=Y.wy,K=Y.Fw;var $=s(37440),Q=s(42491),H=s(9557),ee=s(6780),et=s(70571),es=s(19573),ea=s(18642),el=s(19666);async function en(e,t){let s="/login?next=/agents?agent=".concat(e);if(!t){window.location.href=s;return}let a=await fetch("/api/chat/sessions?agent_slug=".concat(encodeURIComponent(e)),{method:"POST"}),l=await a.json();200==a.status?window.location.href="/chat?conversationId=".concat(l.conversation_id):403==a.status||401==a.status?window.location.href=s:alert("Failed to start chat session")}function er(e){var t;let s=(null===(t=e.text)||void 0===t?void 0:t.replace(/^\w/,e=>e.toUpperCase()))||"";return(0,a.jsx)(el.pn,{children:(0,a.jsxs)(el.u,{children:[(0,a.jsx)(el._v,{asChild:!0,children:(0,a.jsx)("div",{className:"text-sm",children:e.hoverText||s})}),(0,a.jsx)(el.aJ,{className:"cursor-text",children:(0,a.jsxs)("div",{className:"flex items-center space-x-2 rounded-full border-accent-500 border p-1.5",children:[(0,a.jsx)("div",{className:"text-muted-foreground",children:e.icon}),s&&s.length>0&&(0,a.jsx)("div",{className:"text-muted-foreground text-sm",children:s})]})})]})})}let ei=()=>window.fetch("/api/agents").then(e=>e.json()).catch(e=>console.log(e)),eo=e=>fetch(e).then(e=>e.json());function ec(e){let[t,s]=(0,i.useState)(e.agentSlug===e.data.slug),[l,r]=(0,i.useState)(!1),[o,v]=(0,i.useState)(null),b=(0,a.jsx)(d.H,{}),N="Private agents are only visible to you.";"public"===e.data.privacy_level?(b=(0,a.jsx)(u.T,{}),N="Public agents are visible to everyone."):"protected"===e.data.privacy_level&&(b=(0,a.jsx)(h.M,{}),N="Protected agents are visible to anyone with a direct link.");let y=e.userProfile,w=(0,F.cI)({resolver:(0,W.F)(ed),defaultValues:{name:e.data.name,persona:e.data.persona,color:e.data.color,icon:e.data.icon,privacy_level:e.data.privacy_level,chat_model:e.data.chat_model,files:e.data.files,input_tools:e.data.input_tools,output_modes:e.data.output_modes}});(0,i.useEffect)(()=>{w.reset({name:e.data.name,persona:e.data.persona,color:e.data.color,icon:e.data.icon,privacy_level:e.data.privacy_level,chat_model:e.data.chat_model,files:e.data.files,input_tools:e.data.input_tools,output_modes:e.data.output_modes})},[e.data]),t&&window.history.pushState({},"Khoj AI - Agent ".concat(e.data.slug),"/agents?agent=".concat(e.data.slug));let _=(0,E.oz)(e.data.color);function C(){return(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[e.editCard&&(0,a.jsx)(er,{icon:b,text:e.data.privacy_level,hoverText:N}),e.data.files&&e.data.files.length>0&&(0,a.jsx)(er,{icon:(0,a.jsx)(m.f,{}),text:"knowledge",hoverText:"The agent has a custom knowledge base with ".concat(e.data.files.length," documents. It can use them to give you answers.")}),(0,a.jsx)(er,{icon:(0,a.jsx)(x.a,{}),text:e.data.chat_model,hoverText:"The agent uses the ".concat(e.data.chat_model," model to chat with you.")}),e.data.output_modes.map(t=>(0,a.jsx)(er,{icon:(0,A.vH)(t),hoverText:"".concat(t,": ").concat(e.outputModeOptions[t])},t)),e.data.input_tools.map(t=>(0,a.jsx)(er,{icon:(0,A.vH)(t),hoverText:"".concat(t,": ").concat(e.inputToolOptions[t])},t))]})}return(0,a.jsxs)(I.Zb,{className:"shadow-sm bg-gradient-to-b from-white 20% to-".concat(e.data.color?e.data.color:"gray","-100/50 dark:from-[hsl(var(--background))] dark:to-").concat(e.data.color?e.data.color:"gray","-950/50 rounded-xl hover:shadow-md"),children:[l&&(0,a.jsx)(R.Z,{loginRedirectMessage:"Sign in to start chatting with ".concat(e.data.name),onOpenChange:r}),(0,a.jsx)(I.Ol,{children:(0,a.jsx)(I.ll,{children:(0,a.jsxs)(P.Vq,{open:t,onOpenChange:()=>{s(!t),window.history.pushState({},"Khoj AI - Agents","/agents")},children:[(0,a.jsx)(P.hg,{children:(0,a.jsxs)("div",{className:"flex items-center relative top-2",children:[(0,A.TI)(e.data.icon,e.data.color),e.data.name]})}),(0,a.jsxs)("div",{className:"flex float-right",children:[e.editCard&&(0,a.jsx)("div",{className:"float-right",children:(0,a.jsxs)(es.J2,{children:[(0,a.jsx)(es.xo,{children:(0,a.jsx)(c.z,{className:"bg-[hsl(var(--background))] w-10 h-10 p-0 rounded-xl border dark:border-neutral-700 shadow-sm hover:bg-stone-100 dark:hover:bg-neutral-900",children:(0,a.jsx)(f.F,{className:"w-6 h-6 ".concat((0,E.oz)(e.data.color))})})}),(0,a.jsxs)(es.yk,{className:"w-fit grid p-1",side:"bottom",align:"end",children:[(0,a.jsxs)(c.z,{className:"items-center justify-start",variant:"ghost",onClick:()=>s(!0),children:[(0,a.jsx)(p.z,{className:"w-4 h-4 mr-2"}),"Edit"]}),e.editCard&&"private"!==e.data.privacy_level&&(0,a.jsx)(ea.Z,{buttonTitle:"Share",title:"Share Agent",description:"Share a link to this agent with others. They'll be able to chat with it, and ask questions to all of its knowledge base.",buttonVariant:"ghost",includeIcon:!0,url:"".concat(window.location.origin,"/agents?agent=").concat(e.data.slug)}),e.data.creator===(null==y?void 0:y.username)&&(0,a.jsxs)(c.z,{className:"items-center justify-start",variant:"destructive",onClick:()=>{fetch("/api/agents/".concat(e.data.slug),{method:"DELETE"}).then(()=>{e.setAgentChangeTriggered(!0)})},children:[(0,a.jsx)(g.r,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]})}),(0,a.jsx)("div",{className:"float-right",children:e.userProfile?(0,a.jsx)(c.z,{className:"bg-[hsl(var(--background))] w-10 h-10 p-0 rounded-xl border dark:border-neutral-700 shadow-sm hover:bg-stone-100 dark:hover:bg-neutral-900",onClick:()=>en(e.data.slug,y),children:(0,a.jsx)(j.g,{className:"w-6 h-6 ".concat((0,E.oz)(e.data.color))})}):(0,a.jsx)(c.z,{className:"bg-[hsl(var(--background))] w-14 h-14 rounded-xl border dark:border-neutral-700 shadow-sm hover:bg-stone-100 dark:hover:bg-neutral-900",onClick:()=>r(!0),children:(0,a.jsx)(j.g,{className:"w-6 h-6 ".concat((0,E.oz)(e.data.color))})})})]}),e.editCard?(0,a.jsxs)(P.cZ,{className:"lg:max-w-screen-lg overflow-y-scroll max-h-screen",children:[(0,a.jsxs)(X.$N,{children:["Edit ",(0,a.jsx)("b",{children:e.data.name})]}),(0,a.jsx)(eu,{form:w,onSubmit:t=>{let a=e.editCard?"PATCH":"POST",l=t;e.editCard&&(l={...t,slug:e.data.slug}),fetch("/api/agents",{method:a,headers:{"Content-Type":"application/json"},body:JSON.stringify(l)}).then(t=>{200===t.status?(w.reset(),s(!1),v(null),e.setAgentChangeTriggered(!0)):t.json().then(e=>{console.error(e),w.clearErrors(),e.error&&v(e.error)})}).catch(e=>{console.error("Error:",e),v(e),w.clearErrors()})},create:!1,errors:o,filesOptions:e.filesOptions,modelOptions:e.modelOptions,slug:e.data.slug,inputToolOptions:e.inputToolOptions,isSubscribed:e.isSubscribed,outputModeOptions:e.outputModeOptions})]}):(0,a.jsxs)(P.cZ,{className:"whitespace-pre-line max-h-[80vh] max-w-[90vw] rounded-lg",children:[(0,a.jsx)(P.fK,{children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,A.TI)(e.data.icon,e.data.color),(0,a.jsx)("p",{className:"font-bold text-lg",children:e.data.name})]})}),(0,a.jsx)("div",{className:"max-h-[60vh] overflow-y-scroll text-neutral-500 dark:text-white",children:e.data.persona}),(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-1",children:C()}),(0,a.jsx)(P.cN,{children:(0,a.jsxs)(c.z,{className:"pt-6 pb-6 ".concat(_," bg-white dark:bg-[hsl(var(--background))] text-neutral-500 dark:text-white border-2 border-stone-100 shadow-sm rounded-xl hover:bg-stone-100 dark:hover:bg-neutral-900 dark:border-neutral-700"),onClick:()=>{en(e.data.slug,y),s(!1)},children:[(0,a.jsx)(j.g,{className:"w-6 h-6 m-2 ".concat((0,E.oz)(e.data.color))}),"Start Chatting"]})})]})]})})}),(0,a.jsx)(I.aY,{children:(0,a.jsx)("div",{className:n().agentPersonality,children:(0,a.jsx)("button",{className:"".concat(n().infoButton," text-neutral-500 dark:text-white"),onClick:()=>s(!0),children:(0,a.jsx)("p",{children:e.data.persona})})})}),(0,a.jsx)(I.eW,{children:(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-1",children:C()})})]})}let ed=T.z.object({name:T.z.string({required_error:"Name is required"}).min(1,"Name is required"),persona:T.z.string({required_error:"Personality is required"}).min(1,"Personality is required"),color:T.z.string({required_error:"Color is required"}).min(1,"Color is required"),icon:T.z.string({required_error:"Icon is required"}).min(1,"Icon is required"),privacy_level:T.z.string({required_error:"Privacy level is required"}).min(1,"Privacy level is required"),chat_model:T.z.string({required_error:"Chat model is required"}).min(1,"Chat model is required"),files:T.z.array(T.z.string()).default([]).optional(),input_tools:T.z.array(T.z.string()).default([]).optional(),output_modes:T.z.array(T.z.string()).default([]).optional()});function eu(e){let[t,s]=(0,i.useState)(!1),l=(0,A.BI)(),n=E.xF,r=(0,E.oz)(e.form.getValues("color")),[o,d]=(0,i.useState)(!1),[u,h]=(0,i.useState)(null),[m,x]=(0,i.useState)(null),[f,p]=(0,i.useState)(!1),[g,j]=(0,i.useState)(0),[z,T]=(0,i.useState)([]),[I,P]=(0,i.useState)([]),[R,V]=(0,i.useState)(0),[M,Z]=(0,i.useState)(!0),F=["public","private","protected"],W=[{fields:[{name:"name",label:"Name"},{name:"persona",label:"Personality"}],label:"Basic Settings"},{fields:[{name:"color",label:"Color"},{name:"icon",label:"Icon"},{name:"chat_model",label:"Chat Model"},{name:"privacy_level",label:"Privacy Level"}],label:"Customization & Access"},{fields:[{name:"files",label:"Knowledge Base"},{name:"input_tools",label:"Input Tools"},{name:"output_modes",label:"Output Modes"}],label:"Advanced Settings"}],X=(0,i.useRef)(null);function Y(e){e.preventDefault(),d(!0)}function ea(e){e.preventDefault(),d(!1)}function el(e){e.preventDefault(),d(!1),e.dataTransfer.files&&en(e.dataTransfer.files)}function en(e){(0,H.ko)(e,h,p,x,T)}function er(){X&&X.current&&X.current.click()}function ei(e){e.target.files&&en(e.target.files)}(0,i.useEffect)(()=>{if(f||j(0),f){let e=setInterval(()=>{j(e=>{let t=e+(Math.floor(5*Math.random())+1);return t<100?t:100})},800);return()=>clearInterval(e)}},[f]),(0,i.useEffect)(()=>{P(Array.from(new Set([...I,...e.form.getValues("files")||[],...e.filesOptions||[]])))},[]),(0,i.useEffect)(()=>{z.length>0&&(eo(z),P(e=>[...e,...z]))},[z]),(0,i.useEffect)(()=>{e.errors&&s(!1)},[e.errors]);let eo=t=>{for(let s of t){let t=e.form.getValues("files")||[],a=t.includes(s)?t.filter(e=>e!==s):[...t,s];e.form.setValue("files",a)}};if(!e.isSubscribed&&M)return(0,a.jsx)(ee.aR,{open:!0,children:(0,a.jsxs)(ee._T,{children:[(0,a.jsx)(ee.fY,{children:(0,a.jsx)(ee.f$,{children:"Upgrade to Futurist"})}),(0,a.jsxs)(ee.yT,{children:["You need to be a Futurist subscriber to create more agents."," ",(0,a.jsx)("a",{href:"/settings",children:"Upgrade now"}),"."]}),(0,a.jsxs)(ee.xo,{children:[(0,a.jsx)(ee.le,{onClick:()=>{Z(!1)},children:"Cancel"}),(0,a.jsx)(ee.OL,{onClick:()=>{window.location.href="/settings"},children:"Continue"})]})]})});let ec=t=>{switch(t){case"name":return(0,a.jsx)(q.Wi,{control:e.form.control,name:"name",render:e=>{let{field:t}=e;return(0,a.jsxs)(q.xJ,{className:"space-y-0 grid gap-2",children:[(0,a.jsx)(q.lX,{children:"Name"}),(0,a.jsx)(q.pf,{children:"What should this agent be called? Pick something descriptive & memorable."}),(0,a.jsx)(q.NI,{children:(0,a.jsx)(L.I,{placeholder:"Biologist",...t})}),(0,a.jsx)(q.zG,{})]})}},t);case"chat_model":return(0,a.jsx)(q.Wi,{control:e.form.control,name:"chat_model",render:t=>{let{field:s}=t;return(0,a.jsxs)(q.xJ,{className:"space-y-1 grid gap-2",children:[(0,a.jsx)(q.lX,{children:"Chat Model"}),(0,a.jsx)(q.pf,{children:"Which large language model should this agent use?"}),(0,a.jsxs)(J.Ph,{onValueChange:s.onChange,defaultValue:s.value,children:[(0,a.jsx)(q.NI,{children:(0,a.jsx)(J.i4,{className:"text-left",children:(0,a.jsx)(J.ki,{})})}),(0,a.jsx)(J.Bw,{className:"items-start space-y-1 inline-flex flex-col",children:e.modelOptions.map(e=>(0,a.jsx)(J.Ql,{value:e.name,children:(0,a.jsx)("div",{className:"flex items-center space-x-2",children:e.name})},e.id))})]}),(0,a.jsx)(q.zG,{})]})}},t);case"privacy_level":return(0,a.jsx)(q.Wi,{control:e.form.control,name:"privacy_level",render:e=>{let{field:t}=e;return(0,a.jsxs)(q.xJ,{className:"space-y-1 grid gap-2",children:[(0,a.jsx)(q.lX,{children:(0,a.jsx)("div",{children:"Privacy Level"})}),(0,a.jsx)(q.pf,{children:(0,a.jsxs)(es.J2,{children:[(0,a.jsx)(es.xo,{asChild:!0,children:(0,a.jsx)(c.z,{variant:"ghost",className:"p-0 h-fit",children:(0,a.jsxs)("span",{className:"items-center flex gap-1 text-sm",children:[(0,a.jsx)(v.k,{className:"inline"}),(0,a.jsx)("p",{className:"text-sm",children:"Learn more"})]})})}),(0,a.jsxs)(es.yk,{children:[(0,a.jsx)("b",{children:"Private"}),": only visible to you.",(0,a.jsx)("br",{}),(0,a.jsx)("b",{children:"Protected"}),": visible to anyone with a link.",(0,a.jsx)("br",{}),(0,a.jsx)("b",{children:"Public"}),": visible to everyone.",(0,a.jsx)("br",{}),"All public agents will be reviewed by us before they are launched."]})]})}),(0,a.jsxs)(J.Ph,{onValueChange:t.onChange,defaultValue:t.value,children:[(0,a.jsx)(q.NI,{children:(0,a.jsx)(J.i4,{className:"w-[200px]",children:(0,a.jsx)(J.ki,{placeholder:"private"})})}),(0,a.jsx)(J.Bw,{className:"items-center space-y-1 inline-flex flex-col",children:F.map(e=>(0,a.jsx)(J.Ql,{value:e,children:(0,a.jsx)("div",{className:"flex items-center space-x-2",children:e})},e))})]}),(0,a.jsx)(q.zG,{})]})}},t);case"color":return(0,a.jsx)(q.Wi,{control:e.form.control,name:"color",render:e=>{let{field:t}=e;return(0,a.jsxs)(q.xJ,{className:"space-y-3",children:[(0,a.jsx)(q.lX,{children:"Color"}),(0,a.jsx)(q.pf,{children:"Choose a color for your agent."}),(0,a.jsxs)(J.Ph,{onValueChange:t.onChange,defaultValue:t.value,children:[(0,a.jsx)(q.NI,{children:(0,a.jsx)(J.i4,{className:"w-[200px]",children:(0,a.jsx)(J.ki,{placeholder:"Color"})})}),(0,a.jsx)(J.Bw,{className:"items-center space-y-1 inline-flex flex-col",children:n.map(e=>(0,a.jsx)(J.Ql,{value:e,children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(b.C,{className:"w-6 h-6 mr-2 ".concat((0,E.oz)(e)),weight:"fill"}),e]})},e))})]}),(0,a.jsx)(q.zG,{})]})}},t);case"icon":return(0,a.jsx)(q.Wi,{control:e.form.control,name:"icon",render:t=>{let{field:s}=t;return(0,a.jsxs)(q.xJ,{className:"space-y-3",children:[(0,a.jsx)(q.lX,{children:"Icon"}),(0,a.jsx)(q.pf,{children:"Choose an icon for your agent."}),(0,a.jsxs)(J.Ph,{onValueChange:s.onChange,defaultValue:s.value,children:[(0,a.jsx)(q.NI,{children:(0,a.jsx)(J.i4,{className:"w-[200px]",children:(0,a.jsx)(J.ki,{placeholder:"Icon"})})}),(0,a.jsx)(J.Bw,{className:"items-center space-y-1 inline-flex flex-col",children:l.map(t=>(0,a.jsx)(J.Ql,{value:t,children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,A.TI)(t,e.form.getValues("color"),"w-6","h-6"),t]})},t))})]}),(0,a.jsx)(q.zG,{})]})}},t);case"persona":return(0,a.jsx)(q.Wi,{control:e.form.control,name:"persona",render:e=>{let{field:t}=e;return(0,a.jsxs)(q.xJ,{className:"space-y-1 grid gap-2",children:[(0,a.jsx)(q.lX,{children:"Personality"}),(0,a.jsx)(q.pf,{children:"What is the personality, thought process, or tuning of this agent? Get creative; this is how you can influence the agent constitution."}),(0,a.jsx)(q.NI,{children:(0,a.jsx)(D.g,{placeholder:"You are an excellent biologist, at the top of your field in marine biology.",...t})}),(0,a.jsx)(q.zG,{})]})}},t);case"files":return(0,a.jsx)(q.Wi,{control:e.form.control,name:"files",render:t=>{let{field:s}=t;return(0,a.jsxs)(q.xJ,{className:"flex flex-col gap-2",children:[(0,a.jsx)(q.lX,{children:"Knowledge Base"}),(0,a.jsxs)(q.pf,{children:["Which information should be part of its digital brain?"," ",(0,a.jsx)("a",{href:"/settings",children:"Manage data"}),"."]}),(0,a.jsxs)(G,{children:[(0,a.jsxs)(U,{className:"flex items-center justify-between text-sm gap-2",children:[(0,a.jsx)(N.K,{}),s.value&&s.value.length>0?"".concat(s.value.length," files selected"):"Select files"]}),(0,a.jsx)(K,{children:(0,a.jsxs)(Q.mY,{children:[(0,a.jsx)(ee.aR,{open:null!==u||null!=m,children:(0,a.jsxs)(ee._T,{children:[(0,a.jsx)(ee.fY,{children:(0,a.jsx)(ee.f$,{children:"Alert"})}),(0,a.jsx)(ee.yT,{children:u||m}),(0,a.jsx)(ee.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>{h(null),x(null),p(!1)},children:"Close"})]})}),(0,a.jsxs)("div",{className:"flex flex-col h-full cursor-pointer",onDragOver:Y,onDragLeave:ea,onDrop:el,onClick:er,children:[(0,a.jsx)("input",{type:"file",multiple:!0,ref:X,style:{display:"none"},onChange:ei}),(0,a.jsx)("div",{className:"flex-none p-4",children:f&&(0,a.jsx)(et.E,{indicatorColor:"bg-slate-500",className:"w-full h-2 rounded-full",value:g})}),(0,a.jsx)("div",{className:"flex-none p-4 bg-secondary border-b ".concat(o?"animate-pulse":""," rounded-lg"),children:(0,a.jsx)("div",{className:"flex items-center justify-center w-full h-16 border-2 border-dashed border-gray-300 rounded-lg",children:o?(0,a.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,a.jsx)(y.u,{className:"h-6 w-6 mr-2"}),(0,a.jsx)("span",{children:"Drop files to upload"})]}):(0,a.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,a.jsx)(w.v,{className:"h-6 w-6 mr-2"}),(0,a.jsx)("span",{children:"Drag and drop files here"})]})})})]}),(0,a.jsx)(Q.sZ,{placeholder:"Select files..."}),(0,a.jsxs)(Q.e8,{children:[(0,a.jsx)(Q.rb,{children:"No files found."}),(0,a.jsx)(Q.fu,{children:I.map(t=>(0,a.jsxs)(Q.di,{value:t,onSelect:()=>{let s=e.form.getValues("files")||[],a=s.includes(t)?s.filter(e=>e!==t):[...s,t];e.form.setValue("files",a)},children:[(0,a.jsx)(_.J,{className:(0,$.cn)("mr-2 h-4 w-4",s.value&&s.value.includes(t)?"opacity-100":"opacity-0")}),t]},t))})]})]})})]})]})}},t);case"input_tools":return(0,a.jsx)(q.Wi,{control:e.form.control,name:"input_tools",render:t=>{let{field:s}=t;return(0,a.jsxs)(q.xJ,{className:"flex flex-col gap-2",children:[(0,a.jsx)(q.lX,{children:"Restrict Input Tools"}),(0,a.jsxs)(q.pf,{children:["Which knowledge retrieval tools should this agent be limited to?",(0,a.jsx)("br",{}),(0,a.jsx)("b",{children:"Default:"})," No limitations."]}),(0,a.jsxs)(G,{children:[(0,a.jsxs)(U,{className:"flex items-center justify-between text-sm gap-2",children:[(0,a.jsx)(N.K,{}),s.value&&s.value.length>0?"".concat(s.value.length," tools selected"):"All tools"]}),(0,a.jsx)(K,{children:(0,a.jsx)(Q.mY,{children:(0,a.jsx)(Q.e8,{children:(0,a.jsx)(Q.fu,{children:Object.entries(e.inputToolOptions).map(t=>{let[l,n]=t;return(0,a.jsxs)(Q.di,{value:l,onSelect:()=>{let t=e.form.getValues("input_tools")||[],s=t.includes(l)?t.filter(e=>e!==l):[...t,l];e.form.setValue("input_tools",s)},children:[(0,a.jsx)(_.J,{className:(0,$.cn)("mr-2 h-4 w-4",s.value&&s.value.includes(l)?"opacity-100":"opacity-0")}),(0,a.jsxs)("div",{className:(0,$.cn)("flex items-center space-x-2"),children:[(0,a.jsx)("p",{children:(0,a.jsx)("b",{children:l})}),(0,a.jsx)("p",{children:n})]})]},l)})})})})})]})]})}},t);case"output_modes":return(0,a.jsx)(q.Wi,{control:e.form.control,name:"output_modes",render:t=>{let{field:s}=t;return(0,a.jsxs)(q.xJ,{className:"flex flex-col gap-2",children:[(0,a.jsx)(q.lX,{children:"Restrict Output Modes"}),(0,a.jsxs)(q.pf,{children:["Which output modes should this agent be limited to?",(0,a.jsx)("br",{}),(0,a.jsx)("b",{children:"Default:"})," No limitations."]}),(0,a.jsxs)(G,{children:[(0,a.jsxs)(U,{className:"flex items-center justify-between text-sm gap-2",children:[(0,a.jsx)(N.K,{}),s.value&&s.value.length>0?"".concat(s.value.length," modes selected"):"All modes"]}),(0,a.jsx)(K,{children:(0,a.jsx)(Q.mY,{children:(0,a.jsx)(Q.e8,{children:(0,a.jsx)(Q.fu,{children:Object.entries(e.outputModeOptions).map(t=>{let[l,n]=t;return(0,a.jsxs)(Q.di,{value:l,onSelect:()=>{let t=e.form.getValues("output_modes")||[],s=t.includes(l)?t.filter(e=>e!==l):[...t,l];e.form.setValue("output_modes",s)},children:[(0,a.jsx)(_.J,{className:(0,$.cn)("mr-2 h-4 w-4",s.value&&s.value.includes(l)?"opacity-100":"opacity-0")}),(0,a.jsxs)("div",{className:(0,$.cn)("flex items-center space-x-2"),children:[(0,a.jsx)("p",{children:(0,a.jsx)("b",{children:l})}),(0,a.jsx)("p",{children:n})]})]},l)})})})})})]})]})}},t);default:return null}};return(0,a.jsx)(q.l0,{...e.form,children:(0,a.jsxs)("form",{onSubmit:e.form.handleSubmit(t=>{e.onSubmit(t),s(!0)}),className:"space-y-6",children:[(0,a.jsx)("div",{className:"space-y-6",children:W[R].label}),R<W.length&&W[R].fields.map(e=>ec(e.name)),(0,a.jsxs)("div",{className:"flex justify-between mt-4",children:[(0,a.jsxs)(c.z,{type:"button",variant:"outline",onClick:e=>{e.preventDefault(),R>0&&V(R-1)},disabled:0===R,className:"items-center ".concat(t?"bg-stone-100 dark:bg-neutral-900":""," text-white ").concat(r),children:[(0,a.jsx)(C.X,{className:"mr-2 h-4 w-4"}),"Previous"]}),R<W.length-1?(0,a.jsxs)(c.z,{type:"button",variant:"outline",onClick:e=>{e.preventDefault(),R<W.length-1&&V(R+1)},disabled:!(t=>{try{return ed.parse(e.form.getValues()),!0}catch(s){let e=s.errors.reduce((e,t)=>(e[t.path[0]]=t.message,e),{});for(let s of t.fields)if(e[s.name])return!1;return!0}})(W[R]),className:"items-center ".concat(t?"bg-stone-100 dark:bg-neutral-900":""," text-white ").concat(r),children:["Next",(0,a.jsx)(k.o,{className:"ml-2 h-4 w-4"})]}):(0,a.jsxs)(c.z,{type:"submit",variant:"outline",disabled:t||!e.isSubscribed,className:"items-center ".concat(t?"bg-stone-100 dark:bg-neutral-900":""," text-white ").concat(r),children:[(0,a.jsx)(S.B,{className:"h-4 w-4 mr-2"}),t?"Booting...":"Save"]})]}),e.errors&&(0,a.jsx)(B.bZ,{className:"bg-secondary border-none my-4",children:(0,a.jsxs)(B.X,{className:"flex items-center gap-1",children:[(0,a.jsx)(O.f,{weight:"fill",className:"h-4 w-4 text-yellow-400 inline"}),(0,a.jsx)("span",{children:e.errors})]})})]})})}function eh(e){let[t,s]=(0,i.useState)(!1),[l,n]=(0,i.useState)(null),[r,o]=(0,i.useState)(!0),c=(0,F.cI)({resolver:(0,W.F)(ed),defaultValues:{name:e.data.name,persona:e.data.persona,color:e.data.color,icon:e.data.icon,privacy_level:e.data.privacy_level,chat_model:e.selectedChatModelOption,files:[]}});return(0,i.useEffect)(()=>{c.reset({name:e.data.name,persona:e.data.persona,color:e.data.color,icon:e.data.icon,privacy_level:e.data.privacy_level,chat_model:e.selectedChatModelOption,files:[]})},[e.selectedChatModelOption,e.data]),(0,a.jsxs)(P.Vq,{open:t,onOpenChange:s,children:[(0,a.jsx)(P.hg,{children:(0,a.jsxs)("div",{className:"flex items-center text-md gap-2",children:[(0,a.jsx)(w.v,{}),"Create Agent"]})}),(0,a.jsxs)(P.cZ,{className:"lg:max-w-screen-lg overflow-y-scroll max-h-screen",children:[(0,a.jsx)(P.fK,{children:"Create Agent"}),!e.userProfile&&r&&(0,a.jsx)(R.Z,{loginRedirectMessage:"Sign in to start chatting with a specialized agent",onOpenChange:o}),(0,a.jsx)(eu,{form:c,onSubmit:t=>{fetch("/api/agents",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then(t=>{200===t.status?(c.reset(),s(!1),n(null),e.setAgentChangeTriggered(!0)):t.json().then(e=>{console.error(e),e.error&&n(e.error)})}).catch(e=>{console.error("Error:",e),n(e)})},create:!0,errors:l,filesOptions:e.filesOptions,modelOptions:e.modelOptions,inputToolOptions:e.inputToolOptions,outputModeOptions:e.outputModeOptions,isSubscribed:e.isSubscribed})]})]})}function em(){let{data:e,error:t,mutate:s}=(0,r.ZP)("agents",ei,{revalidateOnFocus:!1}),l=(0,o.GW)(),{userConfig:c}=(0,o.h2)(!0),[d,u]=(0,i.useState)(!1),h=(0,Z.IC)(),[m,x]=(0,i.useState)([]),[f,p]=(0,i.useState)([]),[g,j]=(0,i.useState)(null),{data:v,error:b}=(0,r.ZP)(c?"/api/content/computer":null,eo),{data:N,error:y}=(0,r.ZP)("/api/agents/options",eo),[w,_]=(0,i.useState)(!1);if((0,i.useEffect)(()=>{w&&(s(),_(!1))},[w]),(0,i.useEffect)(()=>{if(e){x(e.filter(e=>e.creator===(null==l?void 0:l.username)));let t=e.filter(e=>"private"!==e.privacy_level&&e.creator!==(null==l?void 0:l.username));p(t);{let s=new URLSearchParams(window.location.search).get("agent");if(s){j(s);let a=e.find(e=>e.slug===s);a||(a=t.find(e=>e.slug===s)),a||fetch("/api/agents/".concat(s)).then(e=>{if(404===e.status)throw Error("Agent not found");return e.json()}).then(e=>{"protected"===e.privacy_level&&p(t=>[...t,e])})}}}},[e,l]),t)return(0,a.jsxs)("main",{className:n().main,children:[(0,a.jsx)("div",{className:"".concat(n().titleBar," text-5xl"),children:"Agents"}),(0,a.jsx)("div",{className:n().agentList,children:"Error loading agents"})]});if(!e)return(0,a.jsx)("main",{className:n().main,children:(0,a.jsxs)("div",{className:n().agentList,children:[(0,a.jsx)(V.l,{})," booting up your agents"]})});let C=(null==c?void 0:c.chat_model_options)||[],k=(null==c?void 0:c.selected_chat_model_config)||0,S=(null==c?void 0:c.subscription_state)&&[o.o9.SUBSCRIBED.valueOf(),o.o9.TRIAL.valueOf(),o.o9.UNSUBSCRIBED.valueOf()].includes(c.subscription_state)||!1,O=C.find(e=>e.id===k);return(0,a.jsx)("main",{className:"w-full mx-auto",children:(0,a.jsxs)("div",{className:"grid w-full mx-auto",children:[(0,a.jsx)("div",{className:"".concat(n().sidePanel," top-0"),children:(0,a.jsx)(M.ZP,{conversationId:null,uploadedFiles:[],isMobileWidth:h})}),(0,a.jsxs)("div",{className:"".concat(n().pageLayout," w-full"),children:[(0,a.jsxs)("div",{className:"pt-6 md:pt-8 flex justify-between",children:[(0,a.jsx)("h1",{className:"text-3xl flex items-center",children:"Agents"}),(0,a.jsx)("div",{className:"ml-auto float-right border p-2 pt-3 rounded-xl font-bold hover:bg-stone-100 dark:hover:bg-neutral-900",children:(0,a.jsx)(eh,{data:{slug:"",name:"",persona:"",color:"",icon:"",privacy_level:"private",managed_by_admin:!1,chat_model:"",input_tools:[],output_modes:[]},userProfile:l,isMobileWidth:h,filesOptions:v||[],modelOptions:(null==c?void 0:c.chat_model_options)||[],selectedChatModelOption:(null==O?void 0:O.name)||"",isSubscribed:S,setAgentChangeTriggered:_,inputToolOptions:(null==N?void 0:N.input_tools)||{},outputModeOptions:(null==N?void 0:N.output_modes)||{}})})]}),d&&(0,a.jsx)(R.Z,{loginRedirectMessage:"Sign in to start chatting with a specialized agent",onOpenChange:u}),(0,a.jsx)(B.bZ,{className:"bg-secondary border-none my-4",children:(0,a.jsxs)(B.X,{children:[(0,a.jsx)(z.B,{weight:"fill",className:"h-4 w-4 text-purple-400 inline"}),(0,a.jsx)("span",{className:"font-bold",children:"How it works"})," Use any of these specialized personas to tune your conversation to your needs."]})}),(0,a.jsx)("div",{className:"pt-6 md:pt-8",children:(0,a.jsx)("div",{className:"".concat(n().agentList),children:m.map(e=>(0,a.jsx)(ec,{data:e,userProfile:l,isMobileWidth:h,filesOptions:null!=v?v:[],selectedChatModelOption:(null==O?void 0:O.name)||"",isSubscribed:S,setAgentChangeTriggered:_,modelOptions:(null==c?void 0:c.chat_model_options)||[],editCard:!0,agentSlug:g||"",inputToolOptions:(null==N?void 0:N.input_tools)||{},outputModeOptions:(null==N?void 0:N.output_modes)||{}},e.slug))})}),(0,a.jsxs)("div",{className:"pt-6 md:pt-8",children:[(0,a.jsx)("h2",{className:"text-2xl",children:"Explore"}),(0,a.jsx)("div",{className:"".concat(n().agentList),children:f.map(e=>(0,a.jsx)(ec,{data:e,userProfile:l,isMobileWidth:h,editCard:!1,filesOptions:null!=v?v:[],selectedChatModelOption:(null==O?void 0:O.name)||"",isSubscribed:S,setAgentChangeTriggered:_,modelOptions:(null==c?void 0:c.chat_model_options)||[],agentSlug:g||"",inputToolOptions:(null==N?void 0:N.input_tools)||{},outputModeOptions:(null==N?void 0:N.output_modes)||{}},e.slug))})]})]})]})})}},66820:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});var a=s(57437),l=s(6780),n=s(87138);function r(e){return(0,a.jsx)(l.aR,{open:!0,onOpenChange:e.onOpenChange,children:(0,a.jsxs)(l._T,{children:[(0,a.jsx)(l.fY,{children:(0,a.jsx)(l.f$,{children:"Sign in to Khoj to continue"})}),(0,a.jsxs)(l.yT,{children:[e.loginRedirectMessage,". By logging in, you agree to our"," ",(0,a.jsx)(n.default,{href:"https://khoj.dev/terms-of-service",children:"Terms of Service."})]}),(0,a.jsxs)(l.xo,{children:[(0,a.jsx)(l.le,{children:"Dismiss"}),(0,a.jsx)(l.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>{window.location.href="/login?next=".concat(encodeURIComponent(window.location.pathname))},children:(0,a.jsxs)(n.default,{href:"/login?next=".concat(encodeURIComponent(window.location.pathname)),children:[" ","Login"]})})]})]})})}},18642:function(e,t,s){"use strict";s.d(t,{Z:function(){return c}});var a=s(57437),l=s(90837),n=s(50495),r=s(83102),i=s(67135),o=s(34797);function c(e){var t;return(0,a.jsxs)(l.Vq,{children:[(0,a.jsx)(l.hg,{asChild:!0,onClick:e.onShare,children:(0,a.jsxs)(n.z,{size:"sm",className:"".concat(e.buttonClassName||"px-3"),variant:null!==(t=e.buttonVariant)&&void 0!==t?t:"default",children:[e.includeIcon&&(0,a.jsx)(o.m,{className:"w-4 h-4 mr-2"}),e.buttonTitle]})}),(0,a.jsxs)(l.cZ,{children:[(0,a.jsxs)(l.fK,{children:[(0,a.jsx)(l.$N,{children:e.title}),(0,a.jsx)(l.Be,{children:e.description})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsxs)("div",{className:"grid flex-1 gap-2",children:[(0,a.jsx)(i._,{htmlFor:"link",className:"sr-only",children:"Link"}),(0,a.jsx)(r.I,{id:"link",defaultValue:e.url,readOnly:!0})]}),(0,a.jsx)(n.z,{type:"submit",size:"sm",className:"px-3",onClick:()=>(function(e){let t=navigator.clipboard;t&&t.writeText(e)})(e.url),children:(0,a.jsx)("span",{children:"Copy"})})]})]})]})}},47412:function(e,t,s){"use strict";s.d(t,{X:function(){return c},bZ:function(){return o}});var a=s(57437),l=s(2265),n=s(12218),r=s(37440);let i=(0,n.j)("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),o=l.forwardRef((e,t)=>{let{className:s,variant:l,...n}=e;return(0,a.jsx)("div",{ref:t,role:"alert",className:(0,r.cn)(i({variant:l}),s),...n})});o.displayName="Alert",l.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)("h5",{ref:t,className:(0,r.cn)("mb-1 font-medium leading-none tracking-tight",s),...l})}).displayName="AlertTitle";let c=l.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)("div",{ref:t,className:(0,r.cn)("text-sm [&_p]:leading-relaxed",s),...l})});c.displayName="AlertDescription"},32653:function(e,t,s){"use strict";s.d(t,{NI:function(){return p},Wi:function(){return u},l0:function(){return c},lX:function(){return f},pf:function(){return g},xJ:function(){return x},zG:function(){return j}});var a=s(57437),l=s(2265),n=s(71538),r=s(39343),i=s(37440),o=s(67135);let c=r.RV,d=l.createContext({}),u=e=>{let{...t}=e;return(0,a.jsx)(d.Provider,{value:{name:t.name},children:(0,a.jsx)(r.Qr,{...t})})},h=()=>{let e=l.useContext(d),t=l.useContext(m),{getFieldState:s,formState:a}=(0,r.Gc)(),n=s(e.name,a);if(!e)throw Error("useFormField should be used within <FormField>");let{id:i}=t;return{id:i,name:e.name,formItemId:"".concat(i,"-form-item"),formDescriptionId:"".concat(i,"-form-item-description"),formMessageId:"".concat(i,"-form-item-message"),...n}},m=l.createContext({}),x=l.forwardRef((e,t)=>{let{className:s,...n}=e,r=l.useId();return(0,a.jsx)(m.Provider,{value:{id:r},children:(0,a.jsx)("div",{ref:t,className:(0,i.cn)("space-y-2",s),...n})})});x.displayName="FormItem";let f=l.forwardRef((e,t)=>{let{className:s,...l}=e,{error:n,formItemId:r}=h();return(0,a.jsx)(o._,{ref:t,className:(0,i.cn)(n&&"text-destructive",s),htmlFor:r,...l})});f.displayName="FormLabel";let p=l.forwardRef((e,t)=>{let{...s}=e,{error:l,formItemId:r,formDescriptionId:i,formMessageId:o}=h();return(0,a.jsx)(n.g7,{ref:t,id:r,"aria-describedby":l?"".concat(i," ").concat(o):"".concat(i),"aria-invalid":!!l,...s})});p.displayName="FormControl";let g=l.forwardRef((e,t)=>{let{className:s,...l}=e,{formDescriptionId:n}=h();return(0,a.jsx)("p",{ref:t,id:n,className:(0,i.cn)("text-sm text-muted-foreground",s),...l})});g.displayName="FormDescription";let j=l.forwardRef((e,t)=>{let{className:s,children:l,...n}=e,{error:r,formMessageId:o}=h(),c=r?String(null==r?void 0:r.message):l;return c?(0,a.jsx)("p",{ref:t,id:o,className:(0,i.cn)("text-sm font-medium text-destructive",s),...n,children:c}):null});j.displayName="FormMessage"},67135:function(e,t,s){"use strict";s.d(t,{_:function(){return c}});var a=s(57437),l=s(2265),n=s(38364),r=s(12218),i=s(37440);let o=(0,r.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=l.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)(n.f,{ref:t,className:(0,i.cn)(o(),s),...l})});c.displayName=n.f.displayName},70571:function(e,t,s){"use strict";s.d(t,{E:function(){return i}});var a=s(57437),l=s(2265),n=s(52431),r=s(37440);let i=l.forwardRef((e,t)=>{let{className:s,value:l,indicatorColor:i,...o}=e;return(0,a.jsx)(n.fC,{ref:t,className:(0,r.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",s),...o,children:(0,a.jsx)(n.z$,{className:"h-full w-full flex-1 bg-primary transition-all ".concat(i),style:{transform:"translateX(-".concat(100-(l||0),"%)")}})})});i.displayName=n.fC.displayName},46294:function(e,t,s){"use strict";s.d(t,{Bw:function(){return f},Ph:function(){return d},Ql:function(){return p},i4:function(){return h},ki:function(){return u}});var a=s(57437),l=s(2265),n=s(77539),r=s(42421),i=s(14392),o=s(22468),c=s(37440);let d=n.fC;n.ZA;let u=n.B4,h=l.forwardRef((e,t)=>{let{className:s,children:l,...i}=e;return(0,a.jsxs)(n.xz,{ref:t,className:(0,c.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),...i,children:[l,(0,a.jsx)(n.JO,{asChild:!0,children:(0,a.jsx)(r.Z,{className:"h-4 w-4 opacity-50"})})]})});h.displayName=n.xz.displayName;let m=l.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)(n.u_,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",s),...l,children:(0,a.jsx)(i.Z,{className:"h-4 w-4"})})});m.displayName=n.u_.displayName;let x=l.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)(n.$G,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",s),...l,children:(0,a.jsx)(r.Z,{className:"h-4 w-4"})})});x.displayName=n.$G.displayName;let f=l.forwardRef((e,t)=>{let{className:s,children:l,position:r="popper",...i}=e;return(0,a.jsx)(n.h_,{children:(0,a.jsxs)(n.VY,{ref:t,className:(0,c.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:r,...i,children:[(0,a.jsx)(m,{}),(0,a.jsx)(n.l_,{className:(0,c.cn)("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:l}),(0,a.jsx)(x,{})]})})});f.displayName=n.VY.displayName,l.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)(n.__,{ref:t,className:(0,c.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",s),...l})}).displayName=n.__.displayName;let p=l.forwardRef((e,t)=>{let{className:s,children:l,...r}=e;return(0,a.jsxs)(n.ck,{ref:t,className:(0,c.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...r,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(n.wU,{children:(0,a.jsx)(o.Z,{className:"h-4 w-4"})})}),(0,a.jsx)(n.eT,{children:l})]})});p.displayName=n.ck.displayName,l.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)(n.Z0,{ref:t,className:(0,c.cn)("-mx-1 my-1 h-px bg-muted",s),...l})}).displayName=n.Z0.displayName},93146:function(e,t,s){"use strict";s.d(t,{g:function(){return r}});var a=s(57437),l=s(2265),n=s(37440);let r=l.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)("textarea",{className:(0,n.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),ref:t,...l})});r.displayName="Textarea"},19666:function(e,t,s){"use strict";s.d(t,{_v:function(){return d},aJ:function(){return c},pn:function(){return i},u:function(){return o}});var a=s(57437),l=s(2265),n=s(27071),r=s(37440);let i=n.zt,o=n.fC,c=n.xz,d=l.forwardRef((e,t)=>{let{className:s,sideOffset:l=4,...i}=e;return(0,a.jsx)(n.VY,{ref:t,sideOffset:l,className:(0,r.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...i})});d.displayName=n.VY.displayName},15283:function(e){e.exports={titleBar:"agents_titleBar__FzYbY",agentPersonality:"agents_agentPersonality__o0Ysz",pageLayout:"agents_pageLayout__gR3S3",sidePanel:"agents_sidePanel__wGVGc",infoButton:"agents_infoButton__NqI7E",agentList:"agents_agentList__XVx4A"}}},function(e){e.O(0,[9460,9427,9001,3062,4086,3110,51,7762,1603,9417,2971,7023,1744],function(){return e(e.s=1813)}),_N_E=e.O()}]);
|
@@ -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 p}});var a=s(57437),o=s(65104),n=s.n(o),i=s(2265),r=s(48861),c=s(82697),l=s(16463),d=s(58485),u=s(9557);s(7395);var h=s(69591),m=s(59479),g=s(79306);function f(e){let t=(0,l.useSearchParams)().get("conversationId"),[s,o]=(0,i.useState)(""),[r,d]=(0,i.useState)(null),[u,h]=(0,i.useState)(!1),[g,f]=(0,i.useState)(null),p=e.setQueryToProcess,x=e.onConversationIdChange;if((0,i.useEffect)(()=>{r&&e.setImage64(encodeURIComponent(r))},[r,e.setImage64]),(0,i.useEffect)(()=>{let t=localStorage.getItem("image");t&&(d(t),e.setImage64(encodeURIComponent(t)),localStorage.removeItem("image"));let s=localStorage.getItem("message");s&&(h(!0),p(s))},[p]),(0,i.useEffect)(()=>{s&&(h(!0),p(s))},[s,p]),(0,i.useEffect)(()=>{t&&(null==x||x(t))},[t,x]),(0,i.useEffect)(()=>{e.streamedMessages&&e.streamedMessages.length>0&&e.streamedMessages[e.streamedMessages.length-1].completed?h(!1):o("")},[e.streamedMessages]),!t){window.location.href="/";return}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:n().chatBodyFull,children:(0,a.jsx)(c.Z,{conversationId:t,setTitle:e.setTitle,setAgent:f,pendingMessage:u?s:"",incomingMessages:e.streamedMessages})}),(0,a.jsx)("div",{className:"".concat(n().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 h-fit"),children:(0,a.jsx)(m.Z,{agentColor:null==g?void 0:g.color,isLoggedIn:e.isLoggedIn,sendMessage:e=>o(e),sendImage:e=>d(e),sendDisabled:u,chatOptionsData:e.chatOptionsData,conversationId:t,isMobileWidth:e.isMobileWidth,setUploadedFiles:e.setUploadedFiles})})]})}function p(){let e="Khoj AI - Chat",[t,s]=(0,i.useState)(null),[o,c]=(0,i.useState)(!0),[l,m]=(0,i.useState)(e),[p,x]=(0,i.useState)(null),[_,y]=(0,i.useState)([]),[w,I]=(0,i.useState)(""),[S,v]=(0,i.useState)(!1),[b,j]=(0,i.useState)([]),[B,C]=(0,i.useState)(""),E=(0,h.k6)()||{timezone:Intl.DateTimeFormat().resolvedOptions().timeZone},T=(0,g.GW)(),k=(0,h.IC)();async function M(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,a="␃\uD83D\uDD1A␗",o="",n=[],i={};for(;;){let e;let{done:r,value:c}=await t.read();if(r){I(""),v(!1),C("");break}for(o+=s.decode(c,{stream:!0});-1!==(e=o.indexOf(a));){let t=o.slice(0,e);if(o=o.slice(e+a.length),t){let e=_.find(e=>!e.completed);if(!e){console.error("No current message found");return}({context:n,onlineContext:i}=(0,u.VK)(t,e,n,i)),y([..._])}}}}async function D(){if(localStorage.removeItem("message"),!w||!p)return;let e={q:w,conversation_id:p,stream:!0,...E&&{city:E.city,region:E.region,country:E.country,country_code:E.countryCode,timezone:E.timezone},...B&&{image:B}},t=await fetch("/api/chat?client=web",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});try{await M(t)}catch(s){console.error(s);let e=_.find(e=>!e.completed);if(!e)return;let t=s.message;t.includes("Error in input stream")?e.rawResponse="Woops! The connection broke while I was writing my thoughts down. Maybe try again in a bit or dislike this message if the issue persists?":e.rawResponse="Umm, not sure what just happened. I see this error message: ".concat(t,". Could you try again or dislike this message if the issue persists?"),e.completed=!0,y([..._]),I(""),v(!1)}}return((0,i.useEffect)(()=>{fetch("/api/chat/options").then(e=>e.json()).then(e=>{c(!1),e&&s(e)}).catch(e=>{console.error(e)}),(0,h.EK)()},[]),(0,i.useEffect)(()=>{if(w){let e={rawResponse:"",trainOfThought:[],context:[],onlineContext:{},completed:!1,timestamp:new Date().toISOString(),rawQuery:w||"",uploadedImageData:decodeURIComponent(B)};y(t=>[...t,e]),v(!0)}},[w]),(0,i.useEffect)(()=>{S&&D()},[S]),o)?(0,a.jsx)(d.Z,{}):(0,a.jsxs)("div",{className:"".concat(n().main," ").concat(n().chatLayout),children:[(0,a.jsx)("title",{children:"".concat(e).concat(l&&l!==e?": ".concat(l):"")}),(0,a.jsx)("div",{children:(0,a.jsx)(r.ZP,{conversationId:p,uploadedFiles:b,isMobileWidth:k})}),(0,a.jsx)("div",{className:n().chatBox,children:(0,a.jsxs)("div",{className:n().chatBoxBody,children:[!k&&p&&(0,a.jsxs)("div",{className:"".concat(n().chatTitleWrapper," text-nowrap text-ellipsis overflow-hidden max-w-screen-md grid items-top font-bold mr-8 pt-6 col-auto h-fit"),children:[l&&(0,a.jsx)("h2",{className:"text-lg text-ellipsis whitespace-nowrap overflow-x-hidden",children:l}),(0,a.jsx)(r.En,{conversationId:p,setTitle:m,sizing:"md"})]}),(0,a.jsx)(i.Suspense,{fallback:(0,a.jsx)(d.Z,{}),children:(0,a.jsx)(f,{isLoggedIn:null!==T,streamedMessages:_,chatOptionsData:t,setTitle:m,setQueryToProcess:I,setUploadedFiles:j,isMobileWidth:k,onConversationIdChange:e=>{x(e)},setImage64:C})})]})})]})}},16463:function(e,t,s){"use strict";var a=s(71169);s.o(a,"useSearchParams")&&s.d(t,{useSearchParams:function(){return a.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",chatTitleWrapper:"chat_chatTitleWrapper__6ChWq"}}},function(e){e.O(0,[7812,9427,929,3954,9001,3062,4086,121,3110,4051,1603,9417,9178,9479,2697,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),E=t(15340),F=t(84120),P=t(55362),O=t(48252),I=t(60787),A=t(26058),z=t(95616),R=t(11961),Y=t(76782),Z=t(98325),K=t(96917),M=t(10813),W=t(56194),U=t(9476),B=t(43010),L=t(72151),V=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":""," rounded-lg"),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 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)(E.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)(F.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.h2)(!0),[p,f]=(0,o.useState)(null),[w,C]=(0,o.useState)(void 0),[F,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?d.o9.UNSUBSCRIBED:d.o9.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){ep({title:"Model Update",description:"You need to be subscribed to update ".concat(e," models"),variant:"destructive"});return}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(F)try{if(!(await fetch("/api/content/notion",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:F})})).ok)throw Error("Failed to save Notion API key");p&&(p.notion_token=F,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.ZP,{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)(I.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)(A.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)(R.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)(Y.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)(Y.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)(M.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)(W.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)(U.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)(M.h,{className:"h-5 w-5 inline mr-1"}),"Manage"]})||(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(B.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)(W.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)(L.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:F||"",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)(B.F,{className:"h-5 w-5 inline mr-1"}),"Connect"]}):p.enabled_content_source.notion&&F===p.notion_token?(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:()=>ek("notion"),children:[(0,r.jsx)(V.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:F===p.notion_token,children:[(0,r.jsx)(A.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)(W.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 h-fit",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 h-fit",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 h-fit",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 h-fit",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)(E.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)(B.F,{className:"inline mr-2"}),"Setup Whatsapp"]})}),"verified"===eh&&(0,r.jsxs)(m.z,{variant:"outline",onClick:()=>eN(),children:[(0,r.jsx)(W.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()}]);
|
@@ -1 +0,0 @@
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3111],{91955:function(e,t,s){Promise.resolve().then(s.bind(s,5506))},5506:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return m}});var n=s(57437),o=s(11930),a=s.n(o),i=s(2265),r=s(48861),c=s(82697),d=s(58485);s(7395);var l=s(69591),u=s(79306),h=s(59479),g=s(9557);function p(e){let[t,s]=(0,i.useState)(""),[o,r]=(0,i.useState)(null),[d,l]=(0,i.useState)(!1),[u,g]=(0,i.useState)(null),p=e.setQueryToProcess,m=e.streamedMessages;return((0,i.useEffect)(()=>{o&&e.setImage64(encodeURIComponent(o))},[o,e.setImage64]),(0,i.useEffect)(()=>{t&&(l(!0),p(t))},[t,p]),(0,i.useEffect)(()=>{m&&m.length>0&&m[m.length-1].completed?l(!1):s("")},[m]),e.publicConversationSlug||e.conversationId)?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:a().chatBodyFull,children:(0,n.jsx)(c.Z,{publicConversationSlug:e.publicConversationSlug,conversationId:e.conversationId||"",setAgent:g,setTitle:e.setTitle,pendingMessage:d?t:"",incomingMessages:e.streamedMessages})}),(0,n.jsx)("div",{className:"".concat(a().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)(h.Z,{isLoggedIn:e.isLoggedIn,sendMessage:e=>s(e),sendImage:e=>r(e),sendDisabled:d,chatOptionsData:e.chatOptionsData,conversationId:e.conversationId,agentColor:null==u?void 0:u.color,isMobileWidth:e.isMobileWidth,setUploadedFiles:e.setUploadedFiles})})]}):(0,n.jsx)("div",{className:a().suggestions,children:"Whoops, nothing to see here!"})}function m(){let[e,t]=(0,i.useState)(null),[s,o]=(0,i.useState)(!0),[c,h]=(0,i.useState)("Khoj AI - Chat"),[m,f]=(0,i.useState)(void 0),[_,x]=(0,i.useState)([]),[y,v]=(0,i.useState)(""),[C,b]=(0,i.useState)(!1),[S,j]=(0,i.useState)([]),[I,B]=(0,i.useState)(void 0),[w,O]=(0,i.useState)(""),N=(0,l.k6)()||{timezone:Intl.DateTimeFormat().resolvedOptions().timeZone},k=(0,u.GW)(),D=(0,l.IC)();async function T(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␗",o="";for(;;){let e;let{done:a,value:i}=await t.read();if(a){v(""),b(!1),O("");break}for(o+=s.decode(i,{stream:!0});-1!==(e=o.indexOf(n));){let t=o.slice(0,e);if(o=o.slice(e+n.length),t){let e=_.find(e=>!e.completed);if(!e){console.error("No current message found");return}(0,g.VK)(t,e),x([..._])}}}}async function E(){if(!y||!m)return;let e={q:y,conversation_id:m,stream:!0,...N&&{region:N.region,country:N.country,city:N.city,country_code:N.countryCode,timezone:N.timezone},...w&&{image:w}},t=await fetch("/api/chat?client=web",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});try{await T(t)}catch(e){console.error(e)}}return((0,i.useEffect)(()=>{fetch("/api/chat/options").then(e=>e.json()).then(e=>{o(!1),e&&t(e)}).catch(e=>{console.error(e)}),(0,l.EK)(),B(window.location.pathname.split("/").pop()||"")},[]),(0,i.useEffect)(()=>{if(y&&!m){fetch("/api/chat/share/fork?public_conversation_slug=".concat(I),{method:"POST",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{f(e.conversation_id)}).catch(e=>{console.error(e)});return}if(y){let e={rawResponse:"",trainOfThought:[],context:[],onlineContext:{},completed:!1,timestamp:new Date().toISOString(),rawQuery:y||"",uploadedImageData:decodeURIComponent(w)};x(t=>[...t,e]),b(!0)}},[y,m,I]),(0,i.useEffect)(()=>{C&&E()},[C]),s)?(0,n.jsx)(d.Z,{}):I?(0,n.jsxs)("div",{className:"".concat(a().main," ").concat(a().chatLayout),children:[(0,n.jsx)("title",{children:c}),(0,n.jsx)("div",{className:a().sidePanel,children:(0,n.jsx)(r.ZP,{conversationId:null!=m?m:null,uploadedFiles:S,isMobileWidth:D})}),(0,n.jsx)("div",{className:a().chatBox,children:(0,n.jsx)("div",{className:a().chatBoxBody,children:(0,n.jsx)(i.Suspense,{fallback:(0,n.jsx)(d.Z,{}),children:(0,n.jsx)(p,{conversationId:m,streamedMessages:_,setQueryToProcess:v,isLoggedIn:null!==k,publicConversationSlug:I,chatOptionsData:e,setTitle:h,setUploadedFiles:j,isMobileWidth:D,setImage64:O})})})})]}):(0,n.jsx)("div",{className:a().suggestions,children:"Whoops, nothing to see here!"})}},11930:function(e){e.exports={main:"sharedChat_main__7Nayy",suggestions:"sharedChat_suggestions__V8kr_",inputBox:"sharedChat_inputBox__wRW5A",chatBodyFull:"sharedChat_chatBodyFull__O1MOv",chatBody:"sharedChat_chatBody__OnHDL",chatLayout:"sharedChat_chatLayout__gutlc",chatBox:"sharedChat_chatBox__PmAPg",titleBar:"sharedChat_titleBar__vOHp_",chatBoxBody:"sharedChat_chatBoxBody__ef2Nl",agentIndicator:"sharedChat_agentIndicator__ORCl4"}}},function(e){e.O(0,[7849,9427,929,3954,9001,3062,4086,121,3110,4051,1603,9417,9178,9479,2697,2971,7023,1744],function(){return e(e.s=91955)}),_N_E=e.O()}]);
|
@@ -1 +0,0 @@
|
|
1
|
-
!function(){"use strict";var e,t,n,r,o,u,i,c,f,a={},l={};function d(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}},r=!0;try{a[e].call(n.exports,n,n.exports,d),r=!1}finally{r&&delete l[e]}return n.exports}d.m=a,e=[],d.O=function(t,n,r,o){if(n){o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o];return}for(var i=1/0,u=0;u<e.length;u++){for(var n=e[u][0],r=e[u][1],o=e[u][2],c=!0,f=0;f<n.length;f++)i>=o&&Object.keys(d.O).every(function(e){return d.O[e](n[f])})?n.splice(f--,1):(c=!1,o<i&&(i=o));if(c){e.splice(u--,1);var a=r();void 0!==a&&(t=a)}}return t},d.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return d.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},d.t=function(e,r){if(1&r&&(e=this(e)),8&r||"object"==typeof e&&e&&(4&r&&e.__esModule||16&r&&"function"==typeof e.then))return e;var o=Object.create(null);d.r(o);var u={};t=t||[null,n({}),n([]),n(n)];for(var i=2&r&&e;"object"==typeof i&&!~t.indexOf(i);i=n(i))Object.getOwnPropertyNames(i).forEach(function(t){u[t]=function(){return e[t]}});return u.default=function(){return e},d.d(o,u),o},d.d=function(e,t){for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},d.f={},d.e=function(e){return Promise.all(Object.keys(d.f).reduce(function(t,n){return d.f[n](e,t),t},[]))},d.u=function(e){},d.miniCssF=function(e){},d.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},o="_N_E:",d.l=function(e,t,n,u){if(r[e]){r[e].push(t);return}if(void 0!==n)for(var i,c,f=document.getElementsByTagName("script"),a=0;a<f.length;a++){var l=f[a];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==o+n){i=l;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,d.nc&&i.setAttribute("nonce",d.nc),i.setAttribute("data-webpack",o+n),i.src=d.tu(e)),r[e]=[t];var s=function(t,n){i.onerror=i.onload=null,clearTimeout(p);var o=r[e];if(delete r[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(function(e){return e(n)}),t)return t(n)},p=setTimeout(s.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=s.bind(null,i.onerror),i.onload=s.bind(null,i.onload),c&&document.head.appendChild(i)},d.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.tt=function(){return void 0===u&&(u={createScriptURL:function(e){return e}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(u=trustedTypes.createPolicy("nextjs#bundler",u))),u},d.tu=function(e){return d.tt().createScriptURL(e)},d.p="/_next/",i={2272:0,8942:0,404:0,929:0,9427:0,9460:0,3729:0,7812:0,4003:0,6129:0,4229:0,9092:0,7849:0,492:0},d.f.j=function(e,t){var n=d.o(i,e)?i[e]:void 0;if(0!==n){if(n)t.push(n[2]);else if(/^(4(003|04|229|92)|78(12|49)|9(092|29|427|460)|(37|61)29|2272|8942)$/.test(e))i[e]=0;else{var r=new Promise(function(t,r){n=i[e]=[t,r]});t.push(n[2]=r);var o=d.p+d.u(e),u=Error();d.l(o,function(t){if(d.o(i,e)&&(0!==(n=i[e])&&(i[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;u.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",u.name="ChunkLoadError",u.type=r,u.request=o,n[1](u)}},"chunk-"+e,e)}}},d.O.j=function(e){return 0===i[e]},c=function(e,t){var n,r,o=t[0],u=t[1],c=t[2],f=0;if(o.some(function(e){return 0!==i[e]})){for(n in u)d.o(u,n)&&(d.m[n]=u[n]);if(c)var a=c(d)}for(e&&e(t);f<o.length;f++)r=o[f],d.o(i,r)&&i[r]&&i[r][0](),i[r]=0;return d.O(a)},(f=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(c.bind(null,0)),f.push=c.bind(null,f.push.bind(f)),d.nc=void 0}();
|