khoj 1.38.1.dev18__py3-none-any.whl → 1.38.1.dev20__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/interface/compiled/404/index.html +2 -2
- khoj/interface/compiled/_next/static/chunks/2327-9b55980a1895caa4.js +1 -0
- khoj/interface/compiled/_next/static/chunks/{5427-88bd2db4b3075cac.js → 5427-ec87e7fa4b0d76cb.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/{5477-ca75f51d5d37d614.js → 5477-060a89922423c280.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/{8515-010dd769c584b672.js → 8515-f305779d95dd5780.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/9636-f844be9cdb5ed1f4.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/agents/{layout-5961c3717e1d8813.js → layout-948ca256650845ce.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/agents/{page-0d31f76257d6ec11.js → page-2283250647a2f2f8.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/automations/{page-c6180af69fc9c766.js → page-6053c64e8b1b6d5a.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/chat/{layout-3e25af7224d678a0.js → layout-603285e3b1400e74.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/chat/{page-e3f298848d59803b.js → page-d273748c128b0103.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/{page-df51e61295c4a9b5.js → page-90807725cac7011b.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/search/{layout-9ccd090dcc2aa58a.js → layout-d7f7528ff387fba5.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/search/{page-098017fa7f6ba0bf.js → page-1df7b236b30620f7.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/settings/page-4f837cd629de236e.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/share/chat/{layout-9cc742afcea0b421.js → layout-246d0e8125219fff.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/share/chat/{page-61f5aa755a5d5612.js → page-33d056fbcb8ec85d.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/{webpack-2707657083ef5456.js → webpack-639e8a9d35bd5e13.js} +1 -1
- khoj/interface/compiled/_next/static/css/37a73b87f02df402.css +1 -0
- khoj/interface/compiled/_next/static/css/9c223d337a984468.css +25 -0
- khoj/interface/compiled/_next/static/css/f29752d6e1be7624.css +1 -0
- khoj/interface/compiled/_next/static/css/{0db53bacf81896f5.css → fca983d49c3dd1a3.css} +1 -1
- khoj/interface/compiled/agents/index.html +2 -2
- khoj/interface/compiled/agents/index.txt +3 -3
- khoj/interface/compiled/automations/index.html +2 -2
- khoj/interface/compiled/automations/index.txt +3 -3
- khoj/interface/compiled/chat/index.html +2 -2
- khoj/interface/compiled/chat/index.txt +3 -3
- khoj/interface/compiled/index.html +2 -2
- khoj/interface/compiled/index.txt +2 -2
- khoj/interface/compiled/search/index.html +2 -2
- khoj/interface/compiled/search/index.txt +3 -3
- khoj/interface/compiled/settings/index.html +2 -2
- khoj/interface/compiled/settings/index.txt +5 -5
- khoj/interface/compiled/share/chat/index.html +2 -2
- khoj/interface/compiled/share/chat/index.txt +3 -3
- {khoj-1.38.1.dev18.dist-info → khoj-1.38.1.dev20.dist-info}/METADATA +1 -1
- {khoj-1.38.1.dev18.dist-info → khoj-1.38.1.dev20.dist-info}/RECORD +49 -49
- khoj/interface/compiled/_next/static/chunks/1160-8e7e42e77145b712.js +0 -1
- khoj/interface/compiled/_next/static/chunks/2327-b21ecded25471e6c.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/settings/page-1ff027f4e0a5c468.js +0 -1
- khoj/interface/compiled/_next/static/css/0ddca54f48cc6850.css +0 -25
- khoj/interface/compiled/_next/static/css/bb7ea98028b368f3.css +0 -1
- khoj/interface/compiled/_next/static/css/ee66643a6a5bf71c.css +0 -1
- /khoj/interface/compiled/_next/static/chunks/{1915-1943ee8a628b893c.js → 1915-ab4353eaca76f690.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{2117-5a41630a2bd2eae8.js → 2117-1c18aa2098982bf9.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{4363-e6ac2203564d1a3b.js → 4363-4efaf12abe696251.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{4447-e038b251d626c340.js → 4447-5d44807c40355b1a.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{8667-8136f74e9a086fca.js → 8667-adbe6017a66cef10.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{9259-640fdd77408475df.js → 9259-d8bcd9da9e80c81e.js} +0 -0
- /khoj/interface/compiled/_next/static/{a8Ep1B_uDjBIIAWNMjH5_ → hSqGOMXQbPL50fGlyEXrA}/_buildManifest.js +0 -0
- /khoj/interface/compiled/_next/static/{a8Ep1B_uDjBIIAWNMjH5_ → hSqGOMXQbPL50fGlyEXrA}/_ssgManifest.js +0 -0
- {khoj-1.38.1.dev18.dist-info → khoj-1.38.1.dev20.dist-info}/WHEEL +0 -0
- {khoj-1.38.1.dev18.dist-info → khoj-1.38.1.dev20.dist-info}/entry_points.txt +0 -0
- {khoj-1.38.1.dev18.dist-info → khoj-1.38.1.dev20.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2797],{94114:function(e,a,t){Promise.resolve().then(t.bind(t,86095))},86095:function(e,a,t){"use strict";t.r(a),t.d(a,{default:function(){return eY}});var l=t(57437),s=t(95186),n=t(2265),r=t(41816),i=t.n(r),c=t(19378),o=t(66070),d=t(73925),m=t(75216),h=t(49656);let u=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M208,28H48A20,20,0,0,0,28,48V208a20,20,0,0,0,20,20H156.69a19.86,19.86,0,0,0,14.14-5.86l51.31-51.31A19.86,19.86,0,0,0,228,156.69V48A20,20,0,0,0,208,28ZM52,52H204v92H156a12,12,0,0,0-12,12v48H52ZM168,191V168h23Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,160l-56,56V160Z",opacity:"0.2"}),n.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H156.69A15.86,15.86,0,0,0,168,219.31L219.31,168A15.86,15.86,0,0,0,224,156.69V48A16,16,0,0,0,208,32ZM48,48H208V152H160a8,8,0,0,0-8,8v48H48ZM196.69,168,168,196.69V168Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H156.69A15.86,15.86,0,0,0,168,219.31L219.31,168A15.86,15.86,0,0,0,224,156.69V48A16,16,0,0,0,208,32ZM160,204.69V160h44.69Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M208,34H48A14,14,0,0,0,34,48V208a14,14,0,0,0,14,14H156.69a13.94,13.94,0,0,0,9.9-4.1l51.31-51.31a13.94,13.94,0,0,0,4.1-9.9V48A14,14,0,0,0,208,34ZM46,208V48a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2V154H160a6,6,0,0,0-6,6v50H48A2,2,0,0,1,46,208Zm120-6.49V166h35.52Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H156.69A15.86,15.86,0,0,0,168,219.31L219.31,168A15.86,15.86,0,0,0,224,156.69V48A16,16,0,0,0,208,32ZM48,48H208V152H160a8,8,0,0,0-8,8v48H48ZM196.69,168,168,196.69V168Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M208,36H48A12,12,0,0,0,36,48V208a12,12,0,0,0,12,12H156.69a11.93,11.93,0,0,0,8.48-3.51l51.32-51.32a11.93,11.93,0,0,0,3.51-8.48V48A12,12,0,0,0,208,36ZM44,208V48a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4V156H160a4,4,0,0,0-4,4v52H48A4,4,0,0,1,44,208Zm120-1.66V164h42.35Z"}))]]);var f=Object.defineProperty,p=Object.defineProperties,x=Object.getOwnPropertyDescriptors,j=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable,N=(e,a,t)=>a in e?f(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,b=(e,a)=>{for(var t in a||(a={}))g.call(a,t)&&N(e,t,a[t]);if(j)for(var t of j(a))v.call(a,t)&&N(e,t,a[t]);return e},y=(e,a)=>p(e,x(a));let w=(0,n.forwardRef)((e,a)=>n.createElement(h.Z,y(b({ref:a},e),{weights:u})));w.displayName="NoteBlank";var A=t(41648),Z=t(41317),E=t(19841),V=t(45178);let M=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M87.5,151.52l64-64a12,12,0,0,1,17,17l-64,64a12,12,0,0,1-17-17Zm131-114a60.08,60.08,0,0,0-84.87,0L103.51,67.61a12,12,0,0,0,17,17l30.07-30.06a36,36,0,0,1,50.93,50.92L171.4,135.52a12,12,0,1,0,17,17l30.08-30.06A60.09,60.09,0,0,0,218.45,37.55ZM135.52,171.4l-30.07,30.08a36,36,0,0,1-50.92-50.93l30.06-30.07a12,12,0,0,0-17-17L37.55,133.58a60,60,0,0,0,84.88,84.87l30.06-30.07a12,12,0,0,0-17-17Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M209.94,113.94l-96,96a48,48,0,0,1-67.88-67.88l96-96a48,48,0,0,1,67.88,67.88Z",opacity:"0.2"}),n.createElement("path",{d:"M165.66,90.34a8,8,0,0,1,0,11.32l-64,64a8,8,0,0,1-11.32-11.32l64-64A8,8,0,0,1,165.66,90.34ZM215.6,40.4a56,56,0,0,0-79.2,0L106.34,70.45a8,8,0,0,0,11.32,11.32l30.06-30a40,40,0,0,1,56.57,56.56l-30.07,30.06a8,8,0,0,0,11.31,11.32L215.6,119.6a56,56,0,0,0,0-79.2ZM138.34,174.22l-30.06,30.06a40,40,0,1,1-56.56-56.57l30.05-30.05a8,8,0,0,0-11.32-11.32L40.4,136.4a56,56,0,0,0,79.2,79.2l30.06-30.07a8,8,0,0,0-11.32-11.31Z"}))],["fill",n.createElement(n.Fragment,null,n.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,32ZM144.56,173.66l-21.45,21.45a44,44,0,0,1-62.22-62.22l21.45-21.46a8,8,0,0,1,11.32,11.31L72.2,144.2a28,28,0,0,0,39.6,39.6l21.45-21.46a8,8,0,0,1,11.31,11.32Zm-34.9-16a8,8,0,0,1-11.32-11.32l48-48a8,8,0,0,1,11.32,11.32Zm85.45-34.55-21.45,21.45a8,8,0,0,1-11.32-11.31L183.8,111.8a28,28,0,0,0-39.6-39.6L122.74,93.66a8,8,0,0,1-11.31-11.32l21.46-21.45a44,44,0,0,1,62.22,62.22Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M164.25,91.75a6,6,0,0,1,0,8.49l-64,64a6,6,0,0,1-8.49-8.48l64-64A6,6,0,0,1,164.25,91.75ZM214.2,41.8a54.07,54.07,0,0,0-76.38,0L107.75,71.85a6,6,0,0,0,8.49,8.49l30.07-30.06a42,42,0,0,1,59.41,59.41l-30.08,30.07a6,6,0,1,0,8.49,8.49l30.07-30.07A54,54,0,0,0,214.2,41.8ZM139.76,175.64l-30.07,30.08a42,42,0,0,1-59.41-59.41l30.06-30.07a6,6,0,0,0-8.49-8.49l-30,30.07a54,54,0,0,0,76.38,76.39l30.07-30.08a6,6,0,0,0-8.49-8.49Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M165.66,90.34a8,8,0,0,1,0,11.32l-64,64a8,8,0,0,1-11.32-11.32l64-64A8,8,0,0,1,165.66,90.34ZM215.6,40.4a56,56,0,0,0-79.2,0L106.34,70.45a8,8,0,0,0,11.32,11.32l30.06-30a40,40,0,0,1,56.57,56.56l-30.07,30.06a8,8,0,0,0,11.31,11.32L215.6,119.6a56,56,0,0,0,0-79.2ZM138.34,174.22l-30.06,30.06a40,40,0,1,1-56.56-56.57l30.05-30.05a8,8,0,0,0-11.32-11.32L40.4,136.4a56,56,0,0,0,79.2,79.2l30.06-30.07a8,8,0,0,0-11.32-11.31Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M162.84,93.16a4,4,0,0,1,0,5.66l-64,64a4,4,0,0,1-5.66-5.66l64-64A4,4,0,0,1,162.84,93.16Zm49.95-49.95a52.07,52.07,0,0,0-73.56,0L109.17,73.27a4,4,0,0,0,5.65,5.66l30.07-30.06a44,44,0,0,1,62.24,62.24l-30.07,30.06a4,4,0,0,0,5.66,5.66l30.07-30.06A52.07,52.07,0,0,0,212.79,43.21ZM141.17,177.06l-30.06,30.07a44,44,0,0,1-62.24-62.24l30.06-30.06a4,4,0,0,0-5.66-5.66L43.21,139.23a52,52,0,0,0,73.56,73.56l30.06-30.07a4,4,0,1,0-5.66-5.66Z"}))]]);var H=Object.defineProperty,S=Object.defineProperties,O=Object.getOwnPropertyDescriptors,L=Object.getOwnPropertySymbols,F=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable,T=(e,a,t)=>a in e?H(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,C=(e,a)=>{for(var t in a||(a={}))F.call(a,t)&&T(e,t,a[t]);if(L)for(var t of L(a))k.call(a,t)&&T(e,t,a[t]);return e},_=(e,a)=>S(e,O(a));let D=(0,n.forwardRef)((e,a)=>n.createElement(h.Z,_(C({ref:a},e),{weights:M})));D.displayName="LinkSimple";var P=t(2452),I=t(77168),R=t(87296),z=t(89203);let W=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M234.29,47.91A20,20,0,0,0,216,36H40A20,20,0,0,0,25.2,69.45l.12.14L92,140.75V216a20,20,0,0,0,31.1,16.64l32-21.33A20,20,0,0,0,164,194.66V140.75l66.67-71.16.12-.14A20,20,0,0,0,234.29,47.91Zm-91,79.89A12,12,0,0,0,140,136v56.52l-24,16V136a12,12,0,0,0-3.25-8.2L49.23,60H206.77Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M221.9,61.38,152,136v58.65a8,8,0,0,1-3.56,6.66l-32,21.33A8,8,0,0,1,104,216V136L34.1,61.38A8,8,0,0,1,40,48H216A8,8,0,0,1,221.9,61.38Z",opacity:"0.2"}),n.createElement("path",{d:"M230.6,49.53A15.81,15.81,0,0,0,216,40H40A16,16,0,0,0,28.19,66.76l.08.09L96,139.17V216a16,16,0,0,0,24.87,13.32l32-21.34A16,16,0,0,0,160,194.66V139.17l67.74-72.32.08-.09A15.8,15.8,0,0,0,230.6,49.53ZM40,56h0Zm106.18,74.58A8,8,0,0,0,144,136v58.66L112,216V136a8,8,0,0,0-2.16-5.47L40,56H216Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M227.81,66.76l-.08.09L160,139.17v55.49A16,16,0,0,1,152.87,208l-32,21.34A16,16,0,0,1,96,216V139.17L28.27,66.85l-.08-.09A16,16,0,0,1,40,40H216a16,16,0,0,1,11.84,26.76Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M228.77,50.34A13.8,13.8,0,0,0,216,42H40A14,14,0,0,0,29.67,65.42l.06.07L98,138.38V216a14,14,0,0,0,21.77,11.64l32-21.33A14,14,0,0,0,158,194.66V138.38l68.33-73A13.82,13.82,0,0,0,228.77,50.34Zm-11.26,6.94L147.62,131.9A6,6,0,0,0,146,136v58.66a2,2,0,0,1-.89,1.67l-32,21.33A2,2,0,0,1,110,216V136a6,6,0,0,0-1.62-4.1L38.53,57.32A2,2,0,0,1,40,54H216a1.9,1.9,0,0,1,1.83,1.19A1.86,1.86,0,0,1,217.51,57.28Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M230.6,49.53A15.81,15.81,0,0,0,216,40H40A16,16,0,0,0,28.19,66.76l.08.09L96,139.17V216a16,16,0,0,0,24.87,13.32l32-21.34A16,16,0,0,0,160,194.66V139.17l67.74-72.32.08-.09A15.8,15.8,0,0,0,230.6,49.53ZM40,56h0Zm106.18,74.58A8,8,0,0,0,144,136v58.66L112,216V136a8,8,0,0,0-2.16-5.47L40,56H216Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M227,51.15A11.85,11.85,0,0,0,216,44H40a12,12,0,0,0-8.88,20.07l.05.05L100,137.59V216a12,12,0,0,0,18.66,10l32-21.33a12,12,0,0,0,5.35-10V137.59l68.86-73.52A11.85,11.85,0,0,0,227,51.15Zm-8,7.5-69.9,74.62A4,4,0,0,0,148,136v58.65a4,4,0,0,1-1.78,3.33l-32,21.33A4,4,0,0,1,108,216V136a4,4,0,0,0-1.08-2.74L37.05,58.67A4,4,0,0,1,40,52H216a4,4,0,0,1,3,6.65Z"}))]]);var U=Object.defineProperty,Y=Object.defineProperties,B=Object.getOwnPropertyDescriptors,K=Object.getOwnPropertySymbols,G=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable,$=(e,a,t)=>a in e?U(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,q=(e,a)=>{for(var t in a||(a={}))G.call(a,t)&&$(e,t,a[t]);if(K)for(var t of K(a))X.call(a,t)&&$(e,t,a[t]);return e},J=(e,a)=>Y(e,B(a));let Q=(0,n.forwardRef)((e,a)=>n.createElement(h.Z,J(q({ref:a},e),{weights:W})));Q.displayName="Funnel";var ee=t(38513),ea=t(35099),et=t(64697);let el=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M84,224a12,12,0,0,1-12,12H56a20,20,0,0,1-20-20V184a12,12,0,0,1,24,0v28H72A12,12,0,0,1,84,224ZM220,88v48a12,12,0,0,1-24,0V104H148a12,12,0,0,1-12-12V44H120a12,12,0,0,1,0-24h32a12,12,0,0,1,8.49,3.51l56,56A12,12,0,0,1,220,88Zm-60-8h23L160,57ZM80,20H56A20,20,0,0,0,36,40V64a12,12,0,0,0,24,0V44H80a12,12,0,0,0,0-24ZM208,164a12,12,0,0,0-12,12v36h-4a12,12,0,0,0,0,24h8a20,20,0,0,0,20-20V176A12,12,0,0,0,208,164ZM48,156a12,12,0,0,0,12-12V104a12,12,0,0,0-24,0v40A12,12,0,0,0,48,156Zm104,56H112a12,12,0,0,0,0,24h40a12,12,0,0,0,0-24Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),n.createElement("path",{d:"M80,224a8,8,0,0,1-8,8H56a16,16,0,0,1-16-16V184a8,8,0,0,1,16,0v32H72A8,8,0,0,1,80,224ZM216,88v48a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H120a8,8,0,0,1,0-16h32a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-56-8h28.69L160,51.31ZM80,24H56A16,16,0,0,0,40,40V64a8,8,0,0,0,16,0V40H80a8,8,0,0,0,0-16ZM208,168a8,8,0,0,0-8,8v40h-8a8,8,0,0,0,0,16h8a16,16,0,0,0,16-16V176A8,8,0,0,0,208,168ZM48,152a8,8,0,0,0,8-8V104a8,8,0,0,0-16,0v40A8,8,0,0,0,48,152Zm104,64H112a8,8,0,0,0,0,16h40a8,8,0,0,0,0-16Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M80,224a8,8,0,0,1-8,8H56a16,16,0,0,1-16-16V184a8,8,0,0,1,16,0v32H72A8,8,0,0,1,80,224ZM213.66,82.34l-56-56A8,8,0,0,0,152,24H120a8,8,0,0,0,0,16h24V88a8,8,0,0,0,8,8h48v40a8,8,0,0,0,16,0V88A8,8,0,0,0,213.66,82.34ZM80,24H56A16,16,0,0,0,40,40V64a8,8,0,0,0,16,0V40H80a8,8,0,0,0,0-16ZM208,168a8,8,0,0,0-8,8v40h-8a8,8,0,0,0,0,16h8a16,16,0,0,0,16-16V176A8,8,0,0,0,208,168ZM48,152a8,8,0,0,0,8-8V104a8,8,0,0,0-16,0v40A8,8,0,0,0,48,152Zm104,64H112a8,8,0,0,0,0,16h40a8,8,0,0,0,0-16Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M78,224a6,6,0,0,1-6,6H56a14,14,0,0,1-14-14V184a6,6,0,0,1,12,0v32a2,2,0,0,0,2,2H72A6,6,0,0,1,78,224ZM214,88v48a6,6,0,0,1-12,0V94H152a6,6,0,0,1-6-6V38H120a6,6,0,0,1,0-12h32a6,6,0,0,1,4.24,1.76l56,56A6,6,0,0,1,214,88Zm-56-6h35.51L158,46.49ZM80,26H56A14,14,0,0,0,42,40V64a6,6,0,0,0,12,0V40a2,2,0,0,1,2-2H80a6,6,0,0,0,0-12ZM208,170a6,6,0,0,0-6,6v40a2,2,0,0,1-2,2h-8a6,6,0,0,0,0,12h8a14,14,0,0,0,14-14V176A6,6,0,0,0,208,170ZM48,150a6,6,0,0,0,6-6V104a6,6,0,0,0-12,0v40A6,6,0,0,0,48,150Zm104,68H112a6,6,0,0,0,0,12h40a6,6,0,0,0,0-12Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M80,224a8,8,0,0,1-8,8H56a16,16,0,0,1-16-16V184a8,8,0,0,1,16,0v32H72A8,8,0,0,1,80,224ZM216,88v48a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H120a8,8,0,0,1,0-16h32a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-56-8h28.69L160,51.31ZM80,24H56A16,16,0,0,0,40,40V64a8,8,0,0,0,16,0V40H80a8,8,0,0,0,0-16ZM208,168a8,8,0,0,0-8,8v40h-8a8,8,0,0,0,0,16h8a16,16,0,0,0,16-16V176A8,8,0,0,0,208,168ZM48,152a8,8,0,0,0,8-8V104a8,8,0,0,0-16,0v40A8,8,0,0,0,48,152Zm104,64H112a8,8,0,0,0,0,16h40a8,8,0,0,0,0-16Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M76,224a4,4,0,0,1-4,4H56a12,12,0,0,1-12-12V184a4,4,0,0,1,8,0v32a4,4,0,0,0,4,4H72A4,4,0,0,1,76,224ZM212,88v48a4,4,0,0,1-8,0V92H152a4,4,0,0,1-4-4V36H120a4,4,0,0,1,0-8h32a4,4,0,0,1,2.83,1.17l56,56A4,4,0,0,1,212,88Zm-56-4h42.34L156,41.66ZM80,28H56A12,12,0,0,0,44,40V64a4,4,0,0,0,8,0V40a4,4,0,0,1,4-4H80a4,4,0,0,0,0-8ZM208,172a4,4,0,0,0-4,4v40a4,4,0,0,1-4,4h-8a4,4,0,0,0,0,8h8a12,12,0,0,0,12-12V176A4,4,0,0,0,208,172ZM48,148a4,4,0,0,0,4-4V104a4,4,0,0,0-8,0v40A4,4,0,0,0,48,148Zm104,72H112a4,4,0,0,0,0,8h40a4,4,0,0,0,0-8Z"}))]]);var es=Object.defineProperty,en=Object.defineProperties,er=Object.getOwnPropertyDescriptors,ei=Object.getOwnPropertySymbols,ec=Object.prototype.hasOwnProperty,eo=Object.prototype.propertyIsEnumerable,ed=(e,a,t)=>a in e?es(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,em=(e,a)=>{for(var t in a||(a={}))ec.call(a,t)&&ed(e,t,a[t]);if(ei)for(var t of ei(a))eo.call(a,t)&&ed(e,t,a[t]);return e},eh=(e,a)=>en(e,er(a));let eu=(0,n.forwardRef)((e,a)=>n.createElement(h.Z,eh(em({ref:a},e),{weights:el})));eu.displayName="FileDashed";var ef=t(62869),ep=t(27648),ex=t(7436),ej=t(60729),eg=t(34124),ev=t(6512),eN=t(37104),eb=t(14308),ey=t(26110),ew=t(77992),eA=t(84190),eZ=t(79205);let eE=(0,eZ.Z)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);var eV=t(10407);let eM=(0,eZ.Z)("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);var eH=t(94508);let eS=e=>{let{className:a,...t}=e;return(0,l.jsx)("nav",{role:"navigation","aria-label":"pagination",className:(0,eH.cn)("mx-auto flex w-full justify-center",a),...t})};eS.displayName="Pagination";let eO=n.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,l.jsx)("ul",{ref:a,className:(0,eH.cn)("flex flex-row items-center gap-1",t),...s})});eO.displayName="PaginationContent";let eL=n.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,l.jsx)("li",{ref:a,className:(0,eH.cn)("",t),...s})});eL.displayName="PaginationItem";let eF=e=>{let{className:a,isActive:t,size:s="icon",...n}=e;return(0,l.jsx)("a",{"aria-current":t?"page":void 0,className:(0,eH.cn)((0,ef.d)({variant:t?"outline":"ghost",size:s}),"no-underline",a),...n})};eF.displayName="PaginationLink";let ek=e=>{let{className:a,...t}=e;return(0,l.jsxs)(eF,{"aria-label":"Go to previous page",size:"default",className:(0,eH.cn)("gap-1 pl-2.5",a),...t,children:[(0,l.jsx)(eE,{className:"h-4 w-4"}),(0,l.jsx)("span",{children:"Previous"})]})};ek.displayName="PaginationPrevious";let eT=e=>{let{className:a,...t}=e;return(0,l.jsxs)(eF,{"aria-label":"Go to next page",size:"default",className:(0,eH.cn)("gap-1 pr-2.5",a),...t,children:[(0,l.jsx)("span",{children:"Next"}),(0,l.jsx)(eV.Z,{className:"h-4 w-4"})]})};eT.displayName="PaginationNext";let eC=e=>{let{className:a,...t}=e;return(0,l.jsxs)("span",{"aria-hidden":!0,className:(0,eH.cn)("flex h-9 w-9 items-center justify-center",a),...t,children:[(0,l.jsx)(eM,{className:"h-4 w-4"}),(0,l.jsx)("span",{className:"sr-only",children:"More pages"})]})};eC.displayName="PaginationEllipsis";var e_=t(23518),eD=t(57054),eP=t(59199),eI=t(32759);function eR(e){let{file:a,setSelectedFile:t,setSelectedFileFullText:s,handleDownload:n,handleDelete:r,isDeleting:i,selectedFileFullText:d}=e;return(0,l.jsxs)(o.Zb,{className:"animate-fade-in-up bg-secondary h-52",children:[(0,l.jsx)(o.Ol,{className:"p-2",children:(0,l.jsxs)(o.ll,{className:"flex items-center gap-2 justify-between",title:a.file_name,children:[(0,l.jsxs)(ey.Vq,{children:[(0,l.jsx)(ey.hg,{asChild:!0,children:(0,l.jsx)("div",{className:"text-sm font-medium truncate hover:text-clip hover:whitespace-normal cursor-pointer",onClick:()=>{s(""),t(a.file_name)},children:a.file_name.split("/").pop()})}),(0,l.jsxs)(ey.cZ,{className:"max-w-fit",children:[(0,l.jsx)(ey.fK,{children:(0,l.jsx)(ey.$N,{children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[a.file_name.split("/").pop(),(0,l.jsx)(ef.z,{variant:"ghost",title:"Download as plaintext",onClick:()=>n(a.file_name,a.raw_text),children:(0,l.jsx)(A.U,{className:"h-4 w-4"})})]})})}),(0,l.jsx)(c.x,{className:"h-[50vh] w-[80vw]",children:(0,l.jsxs)("p",{className:"whitespace-pre-wrap break-words text-sm font-normal word-wrap",children:[!d&&(0,l.jsx)(eb.l,{className:"mt-4",message:"Loading",iconClassName:"h-5 w-5"}),d]})})]})]}),(0,l.jsxs)(eA.h_,{children:[(0,l.jsx)(eA.$F,{children:(0,l.jsx)(ef.z,{variant:"ghost",children:(0,l.jsx)(Z.F,{className:"h-4 w-4"})})}),(0,l.jsx)(eA.AW,{className:"flex flex-col gap-0 w-fit",children:(0,l.jsx)(eA.Xi,{className:"p-0",children:(0,l.jsxs)(ef.z,{variant:"ghost",className:"flex items-center gap-2 p-1 text-sm",onClick:()=>{r(a.file_name)},children:[(0,l.jsx)(E.r,{className:"h-4 w-4"}),(0,l.jsx)("span",{className:"text-xs",children:i?"Deleting...":"Delete"})]})})})]})]})}),(0,l.jsx)(o.aY,{className:"p-2",children:(0,l.jsx)(c.x,{className:"h-24 bg-background rounded-lg",children:(0,l.jsxs)("p",{className:"whitespace-pre-wrap break-words text-sm font-normal text-muted-foreground p-2 h-full",children:[a.raw_text.slice(0,100),"..."]})})}),(0,l.jsx)(o.eW,{className:"flex justify-end gap-2 p-2",children:(0,l.jsx)("div",{className:"text-muted-foreground text-xs",children:(0,ex.o0)(a.updated_at)})})]})}function ez(e){var a;let t=e.note,s=(t.additional.file||"").startsWith("http"),n=s?t.additional.heading:t.additional.file.split("/").pop();return(0,l.jsxs)(o.Zb,{className:"bg-secondary h-full shadow-sm rounded-lg border border-muted mb-4 animate-fade-in-up",children:[(0,l.jsx)(o.Ol,{children:(0,l.jsxs)(o.ll,{className:"inline-flex gap-2",children:["notion"===(a=t.additional.source)?(0,l.jsx)(d.F,{className:"text-muted-foreground"}):"github"===a?(0,l.jsx)(m.b,{className:"text-muted-foreground"}):(0,l.jsx)(w,{className:"text-muted-foreground"}),n]})}),(0,l.jsxs)(o.aY,{children:[(0,l.jsx)("div",{className:"line-clamp-4 text-muted-foreground",children:t.entry}),(0,l.jsxs)(ef.z,{onClick:()=>e.setFocusSearchResult(t),variant:"ghost",className:"p-0 mt-2 text-orange-400 hover:bg-inherit",children:["See content",(0,l.jsx)(V.o,{className:"inline ml-2"})]})]}),s&&(0,l.jsx)(o.eW,{children:(0,l.jsxs)("a",{href:t.additional.file,target:"_blank",className:"underline text-sm bg-muted p-1 rounded-lg text-muted-foreground",children:[(0,l.jsx)(D,{className:"inline m-2"}),t.additional.file]})})]})}let eW=e=>{let{setUploadedFiles:a}=e,[t,s]=(0,n.useState)(!1),[r,i]=(0,n.useState)(null),[c,o]=(0,n.useState)(null),[d,m]=(0,n.useState)(!1),[h,u]=(0,n.useState)(0),f=(0,n.useRef)(null);function p(e){(0,eP.ko)(e,i,m,o,a)}return(0,n.useEffect)(()=>{if(!d&&(u(0),!r&&!c)){let e=new KeyboardEvent("keydown",{key:"Escape"});document.dispatchEvent(e)}if(d){let e=setInterval(()=>{u(e=>{let a=e+(Math.floor(5*Math.random())+1);return a<100?a:100})},800);return()=>clearInterval(e)}},[d]),(0,l.jsxs)(ey.Vq,{children:[(0,l.jsx)(ey.hg,{asChild:!0,children:(0,l.jsxs)(ef.z,{variant:"secondary",className:"mt-4",children:[(0,l.jsx)(P.a,{className:"h-4 w-4 mr-2"}),"Add Documents"]})}),(0,l.jsxs)(ey.cZ,{children:[(0,l.jsxs)(ey.fK,{children:[(0,l.jsx)(ey.$N,{children:"Build Your Knowledge Base"}),(0,l.jsx)(ey.Be,{children:"Add context for your Khoj knowledge base. Quickly search and get personalized answers from your documents."})]}),(0,l.jsxs)("div",{className:"flex flex-col h-full",onDragOver:function(e){e.preventDefault(),s(!0)},onDragLeave:function(e){e.preventDefault(),s(!1)},onDrop:function(e){e.preventDefault(),s(!1),e.dataTransfer.files&&p(e.dataTransfer.files)},onClick:function(){f&&f.current&&f.current.click()},children:[(0,l.jsx)("input",{type:"file",multiple:!0,ref:f,style:{display:"none"},onChange:function(e){e.target.files&&p(e.target.files)}}),(0,l.jsx)("div",{className:"flex-none p-4",children:d&&(0,l.jsx)(eI.E,{indicatorColor:"bg-slate-500",className:"w-full h-2 rounded-full",value:h})}),r&&(0,l.jsxs)("div",{className:"flex-none p-4 border-b rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(I.v,{className:"h-6 w-6"}),(0,l.jsx)("span",{children:r})]}),(0,l.jsx)(ef.z,{onClick:()=>i(null),className:"mt-2",variant:"ghost",children:"Dismiss"})]}),c&&(0,l.jsxs)("div",{className:"flex-none p-4 border-b rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(I.v,{className:"h-6 w-6"}),(0,l.jsx)("span",{children:c})]}),(0,l.jsx)(ef.z,{onClick:()=>o(null),className:"mt-2",variant:"ghost",children:"Dismiss"})]}),(0,l.jsx)("div",{className:"flex-none p-4 border-b ".concat(t?"animate-pulse border-blue-500 bg-blue-500 bg-opacity-25":"bg-secondary"," rounded-lg"),children:(0,l.jsx)("div",{className:"flex items-center justify-center w-full h-32 border-2 border-dashed border-gray-300 rounded-lg",children:t?(0,l.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,l.jsx)(R.u,{className:"h-6 w-6 mr-2"}),(0,l.jsx)("span",{children:"Drop files to upload"})]}):(0,l.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,l.jsx)(z.v,{className:"h-6 w-6 mr-2"}),(0,l.jsx)("span",{children:"Drag and drop files here"})]})})})]})]})]})};function eU(e){let[a,t]=(0,n.useState)(!1),[s,r]=(0,n.useState)(e.inputText||""),[i,c]=(0,n.useState)(!1),[o,d]=(0,n.useState)("");return(0,n.useEffect)(()=>{e.inputText?"INITIALIZE"===e.inputText?(t(!0),d("")):(d(e.inputText),e.allFiles.includes(e.inputText)&&r(e.inputText)):d("")},[e.inputText]),(0,n.useEffect)(()=>{o&&!e.allFiles.includes(o)?(c(!0),r("")):o?(c(!1),r(o)):(c(!1),r(""))},[o,e.allFiles]),(0,n.useEffect)(()=>{a||e.onClose()},[a]),(0,l.jsxs)(eD.J2,{open:a||i&&!!o,onOpenChange:t,children:[(0,l.jsx)(eD.xo,{asChild:!0,children:(0,l.jsxs)(ef.z,{variant:"outline",role:"combobox","aria-expanded":a,className:'justify-between" '.concat(e.isMobileWidth?"w-full":"w-[200px]"),children:[s?e.isMobileWidth?"✔️":"Selected":e.isMobileWidth?" ":"Select file",(0,l.jsx)(Q,{className:"opacity-50"})]})}),(0,l.jsx)(eD.yk,{className:"w-[200px] p-0",children:(0,l.jsxs)(e_.mY,{children:[(0,l.jsx)(e_.sZ,{placeholder:"Search files...",value:o,onInput:e=>d(e.currentTarget.value)}),(0,l.jsxs)(e_.e8,{children:[(0,l.jsx)(e_.rb,{children:"No files found."}),(0,l.jsx)(e_.fu,{children:e.allFiles.map(a=>(0,l.jsxs)(e_.di,{value:a,onSelect:a=>{r(a===s?"":a),t(!1),e.onChooseFile(a)},children:[a,(0,l.jsx)(ee.J,{className:(0,eH.cn)("ml-auto",s===a?"opacity-100":"opacity-0")})]},a))})]})]})})]})}function eY(){let[e,a]=(0,n.useState)(""),[t,r]=(0,n.useState)(null),[d,m]=(0,n.useState)(!1),h=(0,n.useRef)(null),[u,f]=(0,n.useState)(null),[p,x]=(0,n.useState)([]),[j,g]=(0,n.useState)(null),[v,N]=(0,n.useState)(!0),[b,y]=(0,n.useState)([]),w=(0,n.useRef)(null),[A,Z]=(0,n.useState)(null),[E,V]=(0,n.useState)(void 0),[M,H]=(0,n.useState)(null),[S,O]=(0,n.useState)(!1),[L,F]=(0,n.useState)([]),[k,T]=(0,n.useState)(0),[C,_]=(0,n.useState)(1),{toast:P}=(0,ew.pm)(),I=(0,ex.IC)();function R(e){if(a(e),!e.trim()){r(null);return}w.current&&clearTimeout(w.current),e.trim()&&(w.current=setTimeout(()=>{z()},750))}function z(){!d&&e.trim()&&(m(!0),fetch("/api/search?q=".concat(encodeURIComponent(e),"&client=web"),{method:"GET",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{r(e),m(!1)}).catch(e=>{console.error("Error:",e)}))}(0,n.useEffect)(()=>{fetch("/api/content/computer",{method:"GET",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{y(e)}).catch(e=>{console.error("Error loading files:",e)})},[]),(0,n.useEffect)(()=>{let a=e.match(/file:([^"\s]*|"[^"]*")?/);if(a){let e=a[1],t=null==e?void 0:e.replace(/"/g,"");t?V(t):V("INITIALIZE")}},[e]);let W=async e=>{try{let a=await fetch("api/content/files?page=".concat(e));if(!a.ok)throw Error("Failed to fetch files");let t=await a.json(),l=t.files,s=t.num_pages;_(s),Array.isArray(l)&&x(l.toSorted())}catch(e){g("Failed to load files"),console.error("Error fetching files:",e)}finally{N(!1)}};(0,n.useEffect)(()=>{W(k)},[k]);let U=async e=>{try{let a=await fetch("/api/content/file?file_name=".concat(e));if(!a.ok)throw Error("Failed to fetch file");let t=await a.json();H(t.raw_text)}catch(e){g("Failed to load file"),console.error("Error fetching file:",e)}},Y=(e,a)=>{let t=new Blob([a],{type:"text/plain"}),l=window.URL.createObjectURL(t),s=document.createElement("a");s.href=l,s.download="".concat(e.split("/").pop(),".txt"),document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(l)};(0,n.useEffect)(()=>{A&&U(A)},[A]),(0,n.useEffect)(()=>{W(k)},[]),(0,n.useEffect)(()=>{L.length>0&&(T(0),W(0))},[L]);let B=async e=>{O(!0);try{if(!(await fetch("/api/content/file?filename=".concat(e),{method:"DELETE"})).ok)throw Error("Failed to delete file");P({title:"File deleted",description:"File ".concat(e," has been deleted"),variant:"default"}),W(k)}catch(a){P({title:"Error deleting file",description:"Failed to delete file ".concat(e),variant:"destructive"})}finally{O(!1)}};return(0,l.jsxs)(ej.Hn,{children:[(0,l.jsx)(eg.S,{conversationId:""}),(0,l.jsxs)(ej.kV,{children:[(0,l.jsxs)("header",{className:"flex h-16 shrink-0 items-center gap-2 border-b px-4",children:[(0,l.jsx)(ej.vP,{className:"-ml-1"}),(0,l.jsx)(ev.Z,{orientation:"vertical",className:"mr-2 h-4"}),I?(0,l.jsx)("a",{className:"p-0 no-underline",href:"/",children:(0,l.jsx)(eN.VO,{className:"h-auto w-16"})}):(0,l.jsx)("h2",{className:"text-lg",children:"Search Your Knowledge Base"})]}),(0,l.jsx)("div",{children:(0,l.jsx)("div",{className:"".concat(i().searchLayout),children:(0,l.jsx)("div",{className:"w-full md:w-5/6 mx-auto pt-6 md:pt-8",children:(0,l.jsxs)("div",{className:"p-4 w-full mx-auto",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center border-2 border-muted p-1 gap-1 rounded-lg flex-col md:flex-row",children:[(0,l.jsx)("div",{className:"relative flex-1 w-full",children:(0,l.jsx)(s.I,{autoFocus:!0,className:"border-none pl-4 focus-visible:ring-transparent focus-visible:ring-offset-transparent",onChange:e=>R(e.currentTarget.value),onKeyDown:e=>{"Enter"===e.key&&z()},ref:h,type:"search",placeholder:"Search Documents",value:e})}),(0,l.jsxs)("div",{id:"actions",className:"flex gap-2",children:[(0,l.jsx)(eU,{allFiles:b,onChooseFile:t=>(function(t){var l;let s=e.replace(/file:([^"\s]*|"[^"]*")?/i,"").trim();a('file:"'.concat(t,'" ').concat(s)),null===(l=h.current)||void 0===l||l.focus(),z()})(t),isMobileWidth:I,inputText:E,onClose:()=>{var e;return null===(e=h.current)||void 0===e?void 0:e.focus()}}),(0,l.jsxs)(ef.z,{className:"px-2 gap-2 inline-flex rounded-none items-center border-l border-gray-300 hover:text-gray-500",variant:"ghost",onClick:()=>z(),children:[(0,l.jsx)(ea.Y,{className:"h-4 w-4"}),(0,l.jsx)("span",{children:"Find"})]})]})]}),null===t&&(0,l.jsx)(eW,{setUploadedFiles:F}),d&&(0,l.jsx)("div",{className:"mt-4 flex items-center justify-center",children:(0,l.jsx)(eb.l,{className:"mt-4",message:"Searching",iconClassName:"h-5 w-5"})}),u&&(0,l.jsxs)("div",{className:"mt-4",children:[(0,l.jsxs)(ef.z,{onClick:()=>f(null),className:"mb-4",variant:"outline",children:[(0,l.jsx)(et.X,{className:"inline mr-2"}),"Back"]}),function(e){let a=(e.additional.file||"").startsWith("http"),t=a?e.additional.heading:e.additional.file.split("/").pop();return(0,l.jsxs)(o.Zb,{className:"bg-secondary h-full shadow-sm rounded-lg border border-muted mb-4 animate-fade-in-up",children:[(0,l.jsx)(o.Ol,{children:(0,l.jsx)(o.ll,{children:t})}),a&&(0,l.jsx)(o.eW,{children:(0,l.jsxs)("a",{href:e.additional.file,target:"_blank",className:"underline text-sm bg-muted p-3 rounded-lg text-muted-foreground flex items-center gap-2",children:[(0,l.jsx)(D,{className:"inline"}),e.additional.file]})}),(0,l.jsx)(o.aY,{children:(0,l.jsx)("div",{className:"text-m",children:e.entry})})]})}(u)]}),!u&&!d&&t&&t.length>0&&(0,l.jsxs)("div",{className:"mt-4 max-w-[92vw] break-all",children:[(0,l.jsxs)(ef.z,{onClick:()=>R(""),className:"mb-4",variant:"outline",children:[(0,l.jsx)(et.X,{className:"inline mr-2"}),"See All"]}),(0,l.jsx)(c.x,{className:"h-[80vh]",children:t.map((e,a)=>(0,l.jsx)(ez,{note:e,setFocusSearchResult:f},e["corpus-id"]))})]}),!d&&null===t&&!e.trim()&&(0,l.jsxs)("div",{className:"w-full mt-4",children:[v&&(0,l.jsx)("div",{className:"mt-4 flex items-center justify-center",children:(0,l.jsx)(eb.l,{className:"mt-4",message:"Loading",iconClassName:"h-5 w-5"})}),j&&(0,l.jsx)("div",{className:"text-red-500",children:j}),!t&&!v&&0===p.length&&(0,l.jsxs)(o.Zb,{className:"flex flex-col items-center justify-center border-none shadow-none",children:[(0,l.jsxs)(o.Ol,{className:"flex flex-col items-center justify-center",children:[(0,l.jsx)(o.SZ,{className:"border-muted-foreground border w-fit rounded-lg mb-2 text-center text-lg p-4",children:(0,l.jsx)(eu,{weight:"fill",className:"text-muted-foreground h-10 w-10"})}),(0,l.jsx)(o.ll,{className:"text-center",children:"Let's get started!"})]}),(0,l.jsxs)(o.aY,{children:[(0,l.jsx)("div",{className:"text-muted-foreground items-center justify-center text-center flex",children:'To use search, upload docs via the "Add Documents" button.'}),(0,l.jsx)(ep.default,{href:"https://docs.khoj.dev/data-sources/share_your_data",className:"no-underline",children:(0,l.jsx)("div",{className:"mt-4 text-center text-secondary-foreground bg-secondary w-fit m-auto p-2 rounded-lg",children:"Learn More"})})]})]}),(0,l.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:p.map((e,a)=>(0,l.jsx)(eR,{file:e,index:a,setSelectedFile:Z,setSelectedFileFullText:H,handleDownload:Y,handleDelete:B,isDeleting:S,selectedFileFullText:M},a))}),(0,l.jsx)(eS,{children:(0,l.jsxs)(eO,{className:"p-0",children:[k>0&&(0,l.jsx)(eL,{className:"list-none",children:(0,l.jsx)(ek,{onClick:()=>T(k-1)})}),k>1&&(0,l.jsx)(eL,{className:"list-none",children:(0,l.jsx)(eF,{onClick:()=>T(0),children:"1"})}),k>2&&(0,l.jsx)(eL,{className:"list-none",children:(0,l.jsx)(eC,{})}),k>0&&(0,l.jsx)(eL,{className:"list-none",children:(0,l.jsx)(eF,{onClick:()=>T(k-1),children:k})}),(0,l.jsx)(eL,{className:"list-none",children:(0,l.jsx)(eF,{isActive:!0,children:k+1})}),k<C-1&&(0,l.jsx)(eL,{className:"list-none",children:(0,l.jsx)(eF,{onClick:()=>T(k+1),children:k+2})}),k<C-3&&(0,l.jsx)(eL,{className:"list-none",children:(0,l.jsx)(eC,{})}),k<C-2&&(0,l.jsx)(eL,{className:"list-none",children:(0,l.jsx)(eF,{onClick:()=>T(C-1),children:C})}),k<C-1&&(0,l.jsx)(eL,{className:"list-none",children:(0,l.jsx)(eT,{onClick:()=>T(k+1)})})]})})]})]})})})})]})]})}},32759:function(e,a,t){"use strict";t.d(a,{E:function(){return i}});var l=t(57437),s=t(2265),n=t(60610),r=t(94508);let i=s.forwardRef((e,a)=>{let{className:t,value:s,indicatorColor:i,...c}=e;return(0,l.jsx)(n.fC,{ref:a,className:(0,r.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...c,children:(0,l.jsx)(n.z$,{className:"h-full w-full flex-1 bg-primary transition-all ".concat(i),style:{transform:"translateX(-".concat(100-(s||0),"%)")}})})});i.displayName=n.fC.displayName},77992:function(e,a,t){"use strict";t.d(a,{pm:function(){return h}});var l=t(2265);let s=0,n=new Map,r=e=>{if(n.has(e))return;let a=setTimeout(()=>{n.delete(e),d({type:"REMOVE_TOAST",toastId:e})},1e6);n.set(e,a)},i=(e,a)=>{switch(a.type){case"ADD_TOAST":return{...e,toasts:[a.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===a.toast.id?{...e,...a.toast}:e)};case"DISMISS_TOAST":{let{toastId:t}=a;return t?r(t):e.toasts.forEach(e=>{r(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===t||void 0===t?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===a.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==a.toastId)}}},c=[],o={toasts:[]};function d(e){o=i(o,e),c.forEach(e=>{e(o)})}function m(e){let{...a}=e,t=(s=(s+1)%Number.MAX_SAFE_INTEGER).toString(),l=()=>d({type:"DISMISS_TOAST",toastId:t});return d({type:"ADD_TOAST",toast:{...a,id:t,open:!0,onOpenChange:e=>{e||l()}}}),{id:t,dismiss:l,update:e=>d({type:"UPDATE_TOAST",toast:{...e,id:t}})}}function h(){let[e,a]=l.useState(o);return l.useEffect(()=>(c.push(a),()=>{let e=c.indexOf(a);e>-1&&c.splice(e,1)}),[e]),{...e,toast:m,dismiss:e=>d({type:"DISMISS_TOAST",toastId:e})}}},41816:function(e){e.exports={searchLayout:"search_searchLayout__fP3m0"}}},function(e){e.O(0,[9853,8221,7200,9259,8667,4363,5621,2327,2971,2117,1744],function(){return e(e.s=94114)}),_N_E=e.O()}]);
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2797],{94114:function(e,a,t){Promise.resolve().then(t.bind(t,86095))},86095:function(e,a,t){"use strict";t.r(a),t.d(a,{default:function(){return eY}});var l=t(57437),s=t(95186),n=t(2265),r=t(41816),i=t.n(r),c=t(19378),o=t(66070),d=t(73925),m=t(75216),h=t(49656);let u=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M208,28H48A20,20,0,0,0,28,48V208a20,20,0,0,0,20,20H156.69a19.86,19.86,0,0,0,14.14-5.86l51.31-51.31A19.86,19.86,0,0,0,228,156.69V48A20,20,0,0,0,208,28ZM52,52H204v92H156a12,12,0,0,0-12,12v48H52ZM168,191V168h23Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,160l-56,56V160Z",opacity:"0.2"}),n.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H156.69A15.86,15.86,0,0,0,168,219.31L219.31,168A15.86,15.86,0,0,0,224,156.69V48A16,16,0,0,0,208,32ZM48,48H208V152H160a8,8,0,0,0-8,8v48H48ZM196.69,168,168,196.69V168Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H156.69A15.86,15.86,0,0,0,168,219.31L219.31,168A15.86,15.86,0,0,0,224,156.69V48A16,16,0,0,0,208,32ZM160,204.69V160h44.69Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M208,34H48A14,14,0,0,0,34,48V208a14,14,0,0,0,14,14H156.69a13.94,13.94,0,0,0,9.9-4.1l51.31-51.31a13.94,13.94,0,0,0,4.1-9.9V48A14,14,0,0,0,208,34ZM46,208V48a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2V154H160a6,6,0,0,0-6,6v50H48A2,2,0,0,1,46,208Zm120-6.49V166h35.52Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H156.69A15.86,15.86,0,0,0,168,219.31L219.31,168A15.86,15.86,0,0,0,224,156.69V48A16,16,0,0,0,208,32ZM48,48H208V152H160a8,8,0,0,0-8,8v48H48ZM196.69,168,168,196.69V168Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M208,36H48A12,12,0,0,0,36,48V208a12,12,0,0,0,12,12H156.69a11.93,11.93,0,0,0,8.48-3.51l51.32-51.32a11.93,11.93,0,0,0,3.51-8.48V48A12,12,0,0,0,208,36ZM44,208V48a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4V156H160a4,4,0,0,0-4,4v52H48A4,4,0,0,1,44,208Zm120-1.66V164h42.35Z"}))]]);var f=Object.defineProperty,p=Object.defineProperties,x=Object.getOwnPropertyDescriptors,j=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable,N=(e,a,t)=>a in e?f(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,b=(e,a)=>{for(var t in a||(a={}))g.call(a,t)&&N(e,t,a[t]);if(j)for(var t of j(a))v.call(a,t)&&N(e,t,a[t]);return e},y=(e,a)=>p(e,x(a));let w=(0,n.forwardRef)((e,a)=>n.createElement(h.Z,y(b({ref:a},e),{weights:u})));w.displayName="NoteBlank";var A=t(41648),Z=t(41317),E=t(19841),V=t(45178);let M=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M87.5,151.52l64-64a12,12,0,0,1,17,17l-64,64a12,12,0,0,1-17-17Zm131-114a60.08,60.08,0,0,0-84.87,0L103.51,67.61a12,12,0,0,0,17,17l30.07-30.06a36,36,0,0,1,50.93,50.92L171.4,135.52a12,12,0,1,0,17,17l30.08-30.06A60.09,60.09,0,0,0,218.45,37.55ZM135.52,171.4l-30.07,30.08a36,36,0,0,1-50.92-50.93l30.06-30.07a12,12,0,0,0-17-17L37.55,133.58a60,60,0,0,0,84.88,84.87l30.06-30.07a12,12,0,0,0-17-17Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M209.94,113.94l-96,96a48,48,0,0,1-67.88-67.88l96-96a48,48,0,0,1,67.88,67.88Z",opacity:"0.2"}),n.createElement("path",{d:"M165.66,90.34a8,8,0,0,1,0,11.32l-64,64a8,8,0,0,1-11.32-11.32l64-64A8,8,0,0,1,165.66,90.34ZM215.6,40.4a56,56,0,0,0-79.2,0L106.34,70.45a8,8,0,0,0,11.32,11.32l30.06-30a40,40,0,0,1,56.57,56.56l-30.07,30.06a8,8,0,0,0,11.31,11.32L215.6,119.6a56,56,0,0,0,0-79.2ZM138.34,174.22l-30.06,30.06a40,40,0,1,1-56.56-56.57l30.05-30.05a8,8,0,0,0-11.32-11.32L40.4,136.4a56,56,0,0,0,79.2,79.2l30.06-30.07a8,8,0,0,0-11.32-11.31Z"}))],["fill",n.createElement(n.Fragment,null,n.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,32ZM144.56,173.66l-21.45,21.45a44,44,0,0,1-62.22-62.22l21.45-21.46a8,8,0,0,1,11.32,11.31L72.2,144.2a28,28,0,0,0,39.6,39.6l21.45-21.46a8,8,0,0,1,11.31,11.32Zm-34.9-16a8,8,0,0,1-11.32-11.32l48-48a8,8,0,0,1,11.32,11.32Zm85.45-34.55-21.45,21.45a8,8,0,0,1-11.32-11.31L183.8,111.8a28,28,0,0,0-39.6-39.6L122.74,93.66a8,8,0,0,1-11.31-11.32l21.46-21.45a44,44,0,0,1,62.22,62.22Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M164.25,91.75a6,6,0,0,1,0,8.49l-64,64a6,6,0,0,1-8.49-8.48l64-64A6,6,0,0,1,164.25,91.75ZM214.2,41.8a54.07,54.07,0,0,0-76.38,0L107.75,71.85a6,6,0,0,0,8.49,8.49l30.07-30.06a42,42,0,0,1,59.41,59.41l-30.08,30.07a6,6,0,1,0,8.49,8.49l30.07-30.07A54,54,0,0,0,214.2,41.8ZM139.76,175.64l-30.07,30.08a42,42,0,0,1-59.41-59.41l30.06-30.07a6,6,0,0,0-8.49-8.49l-30,30.07a54,54,0,0,0,76.38,76.39l30.07-30.08a6,6,0,0,0-8.49-8.49Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M165.66,90.34a8,8,0,0,1,0,11.32l-64,64a8,8,0,0,1-11.32-11.32l64-64A8,8,0,0,1,165.66,90.34ZM215.6,40.4a56,56,0,0,0-79.2,0L106.34,70.45a8,8,0,0,0,11.32,11.32l30.06-30a40,40,0,0,1,56.57,56.56l-30.07,30.06a8,8,0,0,0,11.31,11.32L215.6,119.6a56,56,0,0,0,0-79.2ZM138.34,174.22l-30.06,30.06a40,40,0,1,1-56.56-56.57l30.05-30.05a8,8,0,0,0-11.32-11.32L40.4,136.4a56,56,0,0,0,79.2,79.2l30.06-30.07a8,8,0,0,0-11.32-11.31Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M162.84,93.16a4,4,0,0,1,0,5.66l-64,64a4,4,0,0,1-5.66-5.66l64-64A4,4,0,0,1,162.84,93.16Zm49.95-49.95a52.07,52.07,0,0,0-73.56,0L109.17,73.27a4,4,0,0,0,5.65,5.66l30.07-30.06a44,44,0,0,1,62.24,62.24l-30.07,30.06a4,4,0,0,0,5.66,5.66l30.07-30.06A52.07,52.07,0,0,0,212.79,43.21ZM141.17,177.06l-30.06,30.07a44,44,0,0,1-62.24-62.24l30.06-30.06a4,4,0,0,0-5.66-5.66L43.21,139.23a52,52,0,0,0,73.56,73.56l30.06-30.07a4,4,0,1,0-5.66-5.66Z"}))]]);var H=Object.defineProperty,S=Object.defineProperties,O=Object.getOwnPropertyDescriptors,L=Object.getOwnPropertySymbols,F=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable,T=(e,a,t)=>a in e?H(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,C=(e,a)=>{for(var t in a||(a={}))F.call(a,t)&&T(e,t,a[t]);if(L)for(var t of L(a))k.call(a,t)&&T(e,t,a[t]);return e},_=(e,a)=>S(e,O(a));let D=(0,n.forwardRef)((e,a)=>n.createElement(h.Z,_(C({ref:a},e),{weights:M})));D.displayName="LinkSimple";var P=t(2452),I=t(77168),R=t(87296),z=t(89203);let W=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M234.29,47.91A20,20,0,0,0,216,36H40A20,20,0,0,0,25.2,69.45l.12.14L92,140.75V216a20,20,0,0,0,31.1,16.64l32-21.33A20,20,0,0,0,164,194.66V140.75l66.67-71.16.12-.14A20,20,0,0,0,234.29,47.91Zm-91,79.89A12,12,0,0,0,140,136v56.52l-24,16V136a12,12,0,0,0-3.25-8.2L49.23,60H206.77Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M221.9,61.38,152,136v58.65a8,8,0,0,1-3.56,6.66l-32,21.33A8,8,0,0,1,104,216V136L34.1,61.38A8,8,0,0,1,40,48H216A8,8,0,0,1,221.9,61.38Z",opacity:"0.2"}),n.createElement("path",{d:"M230.6,49.53A15.81,15.81,0,0,0,216,40H40A16,16,0,0,0,28.19,66.76l.08.09L96,139.17V216a16,16,0,0,0,24.87,13.32l32-21.34A16,16,0,0,0,160,194.66V139.17l67.74-72.32.08-.09A15.8,15.8,0,0,0,230.6,49.53ZM40,56h0Zm106.18,74.58A8,8,0,0,0,144,136v58.66L112,216V136a8,8,0,0,0-2.16-5.47L40,56H216Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M227.81,66.76l-.08.09L160,139.17v55.49A16,16,0,0,1,152.87,208l-32,21.34A16,16,0,0,1,96,216V139.17L28.27,66.85l-.08-.09A16,16,0,0,1,40,40H216a16,16,0,0,1,11.84,26.76Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M228.77,50.34A13.8,13.8,0,0,0,216,42H40A14,14,0,0,0,29.67,65.42l.06.07L98,138.38V216a14,14,0,0,0,21.77,11.64l32-21.33A14,14,0,0,0,158,194.66V138.38l68.33-73A13.82,13.82,0,0,0,228.77,50.34Zm-11.26,6.94L147.62,131.9A6,6,0,0,0,146,136v58.66a2,2,0,0,1-.89,1.67l-32,21.33A2,2,0,0,1,110,216V136a6,6,0,0,0-1.62-4.1L38.53,57.32A2,2,0,0,1,40,54H216a1.9,1.9,0,0,1,1.83,1.19A1.86,1.86,0,0,1,217.51,57.28Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M230.6,49.53A15.81,15.81,0,0,0,216,40H40A16,16,0,0,0,28.19,66.76l.08.09L96,139.17V216a16,16,0,0,0,24.87,13.32l32-21.34A16,16,0,0,0,160,194.66V139.17l67.74-72.32.08-.09A15.8,15.8,0,0,0,230.6,49.53ZM40,56h0Zm106.18,74.58A8,8,0,0,0,144,136v58.66L112,216V136a8,8,0,0,0-2.16-5.47L40,56H216Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M227,51.15A11.85,11.85,0,0,0,216,44H40a12,12,0,0,0-8.88,20.07l.05.05L100,137.59V216a12,12,0,0,0,18.66,10l32-21.33a12,12,0,0,0,5.35-10V137.59l68.86-73.52A11.85,11.85,0,0,0,227,51.15Zm-8,7.5-69.9,74.62A4,4,0,0,0,148,136v58.65a4,4,0,0,1-1.78,3.33l-32,21.33A4,4,0,0,1,108,216V136a4,4,0,0,0-1.08-2.74L37.05,58.67A4,4,0,0,1,40,52H216a4,4,0,0,1,3,6.65Z"}))]]);var U=Object.defineProperty,Y=Object.defineProperties,B=Object.getOwnPropertyDescriptors,K=Object.getOwnPropertySymbols,G=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable,$=(e,a,t)=>a in e?U(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,q=(e,a)=>{for(var t in a||(a={}))G.call(a,t)&&$(e,t,a[t]);if(K)for(var t of K(a))X.call(a,t)&&$(e,t,a[t]);return e},J=(e,a)=>Y(e,B(a));let Q=(0,n.forwardRef)((e,a)=>n.createElement(h.Z,J(q({ref:a},e),{weights:W})));Q.displayName="Funnel";var ee=t(38513),ea=t(35099),et=t(64697);let el=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M84,224a12,12,0,0,1-12,12H56a20,20,0,0,1-20-20V184a12,12,0,0,1,24,0v28H72A12,12,0,0,1,84,224ZM220,88v48a12,12,0,0,1-24,0V104H148a12,12,0,0,1-12-12V44H120a12,12,0,0,1,0-24h32a12,12,0,0,1,8.49,3.51l56,56A12,12,0,0,1,220,88Zm-60-8h23L160,57ZM80,20H56A20,20,0,0,0,36,40V64a12,12,0,0,0,24,0V44H80a12,12,0,0,0,0-24ZM208,164a12,12,0,0,0-12,12v36h-4a12,12,0,0,0,0,24h8a20,20,0,0,0,20-20V176A12,12,0,0,0,208,164ZM48,156a12,12,0,0,0,12-12V104a12,12,0,0,0-24,0v40A12,12,0,0,0,48,156Zm104,56H112a12,12,0,0,0,0,24h40a12,12,0,0,0,0-24Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),n.createElement("path",{d:"M80,224a8,8,0,0,1-8,8H56a16,16,0,0,1-16-16V184a8,8,0,0,1,16,0v32H72A8,8,0,0,1,80,224ZM216,88v48a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H120a8,8,0,0,1,0-16h32a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-56-8h28.69L160,51.31ZM80,24H56A16,16,0,0,0,40,40V64a8,8,0,0,0,16,0V40H80a8,8,0,0,0,0-16ZM208,168a8,8,0,0,0-8,8v40h-8a8,8,0,0,0,0,16h8a16,16,0,0,0,16-16V176A8,8,0,0,0,208,168ZM48,152a8,8,0,0,0,8-8V104a8,8,0,0,0-16,0v40A8,8,0,0,0,48,152Zm104,64H112a8,8,0,0,0,0,16h40a8,8,0,0,0,0-16Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M80,224a8,8,0,0,1-8,8H56a16,16,0,0,1-16-16V184a8,8,0,0,1,16,0v32H72A8,8,0,0,1,80,224ZM213.66,82.34l-56-56A8,8,0,0,0,152,24H120a8,8,0,0,0,0,16h24V88a8,8,0,0,0,8,8h48v40a8,8,0,0,0,16,0V88A8,8,0,0,0,213.66,82.34ZM80,24H56A16,16,0,0,0,40,40V64a8,8,0,0,0,16,0V40H80a8,8,0,0,0,0-16ZM208,168a8,8,0,0,0-8,8v40h-8a8,8,0,0,0,0,16h8a16,16,0,0,0,16-16V176A8,8,0,0,0,208,168ZM48,152a8,8,0,0,0,8-8V104a8,8,0,0,0-16,0v40A8,8,0,0,0,48,152Zm104,64H112a8,8,0,0,0,0,16h40a8,8,0,0,0,0-16Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M78,224a6,6,0,0,1-6,6H56a14,14,0,0,1-14-14V184a6,6,0,0,1,12,0v32a2,2,0,0,0,2,2H72A6,6,0,0,1,78,224ZM214,88v48a6,6,0,0,1-12,0V94H152a6,6,0,0,1-6-6V38H120a6,6,0,0,1,0-12h32a6,6,0,0,1,4.24,1.76l56,56A6,6,0,0,1,214,88Zm-56-6h35.51L158,46.49ZM80,26H56A14,14,0,0,0,42,40V64a6,6,0,0,0,12,0V40a2,2,0,0,1,2-2H80a6,6,0,0,0,0-12ZM208,170a6,6,0,0,0-6,6v40a2,2,0,0,1-2,2h-8a6,6,0,0,0,0,12h8a14,14,0,0,0,14-14V176A6,6,0,0,0,208,170ZM48,150a6,6,0,0,0,6-6V104a6,6,0,0,0-12,0v40A6,6,0,0,0,48,150Zm104,68H112a6,6,0,0,0,0,12h40a6,6,0,0,0,0-12Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M80,224a8,8,0,0,1-8,8H56a16,16,0,0,1-16-16V184a8,8,0,0,1,16,0v32H72A8,8,0,0,1,80,224ZM216,88v48a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H120a8,8,0,0,1,0-16h32a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-56-8h28.69L160,51.31ZM80,24H56A16,16,0,0,0,40,40V64a8,8,0,0,0,16,0V40H80a8,8,0,0,0,0-16ZM208,168a8,8,0,0,0-8,8v40h-8a8,8,0,0,0,0,16h8a16,16,0,0,0,16-16V176A8,8,0,0,0,208,168ZM48,152a8,8,0,0,0,8-8V104a8,8,0,0,0-16,0v40A8,8,0,0,0,48,152Zm104,64H112a8,8,0,0,0,0,16h40a8,8,0,0,0,0-16Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M76,224a4,4,0,0,1-4,4H56a12,12,0,0,1-12-12V184a4,4,0,0,1,8,0v32a4,4,0,0,0,4,4H72A4,4,0,0,1,76,224ZM212,88v48a4,4,0,0,1-8,0V92H152a4,4,0,0,1-4-4V36H120a4,4,0,0,1,0-8h32a4,4,0,0,1,2.83,1.17l56,56A4,4,0,0,1,212,88Zm-56-4h42.34L156,41.66ZM80,28H56A12,12,0,0,0,44,40V64a4,4,0,0,0,8,0V40a4,4,0,0,1,4-4H80a4,4,0,0,0,0-8ZM208,172a4,4,0,0,0-4,4v40a4,4,0,0,1-4,4h-8a4,4,0,0,0,0,8h8a12,12,0,0,0,12-12V176A4,4,0,0,0,208,172ZM48,148a4,4,0,0,0,4-4V104a4,4,0,0,0-8,0v40A4,4,0,0,0,48,148Zm104,72H112a4,4,0,0,0,0,8h40a4,4,0,0,0,0-8Z"}))]]);var es=Object.defineProperty,en=Object.defineProperties,er=Object.getOwnPropertyDescriptors,ei=Object.getOwnPropertySymbols,ec=Object.prototype.hasOwnProperty,eo=Object.prototype.propertyIsEnumerable,ed=(e,a,t)=>a in e?es(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,em=(e,a)=>{for(var t in a||(a={}))ec.call(a,t)&&ed(e,t,a[t]);if(ei)for(var t of ei(a))eo.call(a,t)&&ed(e,t,a[t]);return e},eh=(e,a)=>en(e,er(a));let eu=(0,n.forwardRef)((e,a)=>n.createElement(h.Z,eh(em({ref:a},e),{weights:el})));eu.displayName="FileDashed";var ef=t(62869),ep=t(27648),ex=t(7436),ej=t(60729),eg=t(34124),ev=t(6512),eN=t(37104),eb=t(14308),ey=t(26110),ew=t(77992),eA=t(84190),eZ=t(79205);let eE=(0,eZ.Z)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);var eV=t(10407);let eM=(0,eZ.Z)("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);var eH=t(94508);let eS=e=>{let{className:a,...t}=e;return(0,l.jsx)("nav",{role:"navigation","aria-label":"pagination",className:(0,eH.cn)("mx-auto flex w-full justify-center",a),...t})};eS.displayName="Pagination";let eO=n.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,l.jsx)("ul",{ref:a,className:(0,eH.cn)("flex flex-row items-center gap-1",t),...s})});eO.displayName="PaginationContent";let eL=n.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,l.jsx)("li",{ref:a,className:(0,eH.cn)("",t),...s})});eL.displayName="PaginationItem";let eF=e=>{let{className:a,isActive:t,size:s="icon",...n}=e;return(0,l.jsx)("a",{"aria-current":t?"page":void 0,className:(0,eH.cn)((0,ef.d)({variant:t?"outline":"ghost",size:s}),"no-underline",a),...n})};eF.displayName="PaginationLink";let ek=e=>{let{className:a,...t}=e;return(0,l.jsxs)(eF,{"aria-label":"Go to previous page",size:"default",className:(0,eH.cn)("gap-1 pl-2.5",a),...t,children:[(0,l.jsx)(eE,{className:"h-4 w-4"}),(0,l.jsx)("span",{children:"Previous"})]})};ek.displayName="PaginationPrevious";let eT=e=>{let{className:a,...t}=e;return(0,l.jsxs)(eF,{"aria-label":"Go to next page",size:"default",className:(0,eH.cn)("gap-1 pr-2.5",a),...t,children:[(0,l.jsx)("span",{children:"Next"}),(0,l.jsx)(eV.Z,{className:"h-4 w-4"})]})};eT.displayName="PaginationNext";let eC=e=>{let{className:a,...t}=e;return(0,l.jsxs)("span",{"aria-hidden":!0,className:(0,eH.cn)("flex h-9 w-9 items-center justify-center",a),...t,children:[(0,l.jsx)(eM,{className:"h-4 w-4"}),(0,l.jsx)("span",{className:"sr-only",children:"More pages"})]})};eC.displayName="PaginationEllipsis";var e_=t(23518),eD=t(57054),eP=t(59199),eI=t(32759);function eR(e){let{file:a,setSelectedFile:t,setSelectedFileFullText:s,handleDownload:n,handleDelete:r,isDeleting:i,selectedFileFullText:d}=e;return(0,l.jsxs)(o.Zb,{className:"animate-fade-in-up bg-secondary h-52",children:[(0,l.jsx)(o.Ol,{className:"p-2",children:(0,l.jsxs)(o.ll,{className:"flex items-center gap-2 justify-between",title:a.file_name,children:[(0,l.jsxs)(ey.Vq,{children:[(0,l.jsx)(ey.hg,{asChild:!0,children:(0,l.jsx)("div",{className:"text-sm font-medium truncate hover:text-clip hover:whitespace-normal cursor-pointer",onClick:()=>{s(""),t(a.file_name)},children:a.file_name.split("/").pop()})}),(0,l.jsxs)(ey.cZ,{className:"max-w-fit",children:[(0,l.jsx)(ey.fK,{children:(0,l.jsx)(ey.$N,{children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[a.file_name.split("/").pop(),(0,l.jsx)(ef.z,{variant:"ghost",title:"Download as plaintext",onClick:()=>n(a.file_name,a.raw_text),children:(0,l.jsx)(A.U,{className:"h-4 w-4"})})]})})}),(0,l.jsx)(c.x,{className:"h-[50vh] w-[80vw]",children:(0,l.jsxs)("p",{className:"whitespace-pre-wrap break-words text-sm font-normal word-wrap",children:[!d&&(0,l.jsx)(eb.l,{className:"mt-4",message:"Loading",iconClassName:"h-5 w-5"}),d]})})]})]}),(0,l.jsxs)(eA.h_,{children:[(0,l.jsx)(eA.$F,{children:(0,l.jsx)(ef.z,{variant:"ghost",children:(0,l.jsx)(Z.F,{className:"h-4 w-4"})})}),(0,l.jsx)(eA.AW,{className:"flex flex-col gap-0 w-fit",children:(0,l.jsx)(eA.Xi,{className:"p-0",children:(0,l.jsxs)(ef.z,{variant:"ghost",className:"flex items-center gap-2 p-1 text-sm",onClick:()=>{r(a.file_name)},children:[(0,l.jsx)(E.r,{className:"h-4 w-4"}),(0,l.jsx)("span",{className:"text-xs",children:i?"Deleting...":"Delete"})]})})})]})]})}),(0,l.jsx)(o.aY,{className:"p-2",children:(0,l.jsx)(c.x,{className:"h-24 bg-background rounded-lg",children:(0,l.jsxs)("p",{className:"whitespace-pre-wrap break-words text-sm font-normal text-muted-foreground p-2 h-full",children:[a.raw_text.slice(0,100),"..."]})})}),(0,l.jsx)(o.eW,{className:"flex justify-end gap-2 p-2",children:(0,l.jsx)("div",{className:"text-muted-foreground text-xs",children:(0,ex.o0)(a.updated_at)})})]})}function ez(e){var a;let t=e.note,s=(t.additional.file||"").startsWith("http"),n=s?t.additional.heading:t.additional.file.split("/").pop();return(0,l.jsxs)(o.Zb,{className:"bg-secondary h-full shadow-sm rounded-lg border border-muted mb-4 animate-fade-in-up",children:[(0,l.jsx)(o.Ol,{children:(0,l.jsxs)(o.ll,{className:"inline-flex gap-2",children:["notion"===(a=t.additional.source)?(0,l.jsx)(d.F,{className:"text-muted-foreground"}):"github"===a?(0,l.jsx)(m.b,{className:"text-muted-foreground"}):(0,l.jsx)(w,{className:"text-muted-foreground"}),n]})}),(0,l.jsxs)(o.aY,{children:[(0,l.jsx)("div",{className:"line-clamp-4 text-muted-foreground",children:t.entry}),(0,l.jsxs)(ef.z,{onClick:()=>e.setFocusSearchResult(t),variant:"ghost",className:"p-0 mt-2 text-orange-400 hover:bg-inherit",children:["See content",(0,l.jsx)(V.o,{className:"inline ml-2"})]})]}),s&&(0,l.jsx)(o.eW,{children:(0,l.jsxs)("a",{href:t.additional.file,target:"_blank",className:"underline text-sm bg-muted p-1 rounded-lg text-muted-foreground",children:[(0,l.jsx)(D,{className:"inline m-2"}),t.additional.file]})})]})}let eW=e=>{let{setUploadedFiles:a}=e,[t,s]=(0,n.useState)(!1),[r,i]=(0,n.useState)(null),[c,o]=(0,n.useState)(null),[d,m]=(0,n.useState)(!1),[h,u]=(0,n.useState)(0),f=(0,n.useRef)(null);function p(e){(0,eP.ko)(e,i,m,o,a)}return(0,n.useEffect)(()=>{if(!d&&(u(0),!r&&!c)){let e=new KeyboardEvent("keydown",{key:"Escape"});document.dispatchEvent(e)}if(d){let e=setInterval(()=>{u(e=>{let a=e+(Math.floor(5*Math.random())+1);return a<100?a:100})},800);return()=>clearInterval(e)}},[d]),(0,l.jsxs)(ey.Vq,{children:[(0,l.jsx)(ey.hg,{asChild:!0,children:(0,l.jsxs)(ef.z,{variant:"secondary",className:"mt-4",children:[(0,l.jsx)(P.a,{className:"h-4 w-4 mr-2"}),"Add Documents"]})}),(0,l.jsxs)(ey.cZ,{children:[(0,l.jsxs)(ey.fK,{children:[(0,l.jsx)(ey.$N,{children:"Build Your Knowledge Base"}),(0,l.jsx)(ey.Be,{children:"Add context for your Khoj knowledge base. Quickly search and get personalized answers from your documents."})]}),(0,l.jsxs)("div",{className:"flex flex-col h-full",onDragOver:function(e){e.preventDefault(),s(!0)},onDragLeave:function(e){e.preventDefault(),s(!1)},onDrop:function(e){e.preventDefault(),s(!1),e.dataTransfer.files&&p(e.dataTransfer.files)},onClick:function(){f&&f.current&&f.current.click()},children:[(0,l.jsx)("input",{type:"file",multiple:!0,ref:f,style:{display:"none"},onChange:function(e){e.target.files&&p(e.target.files)}}),(0,l.jsx)("div",{className:"flex-none p-4",children:d&&(0,l.jsx)(eI.E,{indicatorColor:"bg-slate-500",className:"w-full h-2 rounded-full",value:h})}),r&&(0,l.jsxs)("div",{className:"flex-none p-4 border-b rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(I.v,{className:"h-6 w-6"}),(0,l.jsx)("span",{children:r})]}),(0,l.jsx)(ef.z,{onClick:()=>i(null),className:"mt-2",variant:"ghost",children:"Dismiss"})]}),c&&(0,l.jsxs)("div",{className:"flex-none p-4 border-b rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(I.v,{className:"h-6 w-6"}),(0,l.jsx)("span",{children:c})]}),(0,l.jsx)(ef.z,{onClick:()=>o(null),className:"mt-2",variant:"ghost",children:"Dismiss"})]}),(0,l.jsx)("div",{className:"flex-none p-4 border-b ".concat(t?"animate-pulse border-blue-500 bg-blue-500 bg-opacity-25":"bg-secondary"," rounded-lg"),children:(0,l.jsx)("div",{className:"flex items-center justify-center w-full h-32 border-2 border-dashed border-gray-300 rounded-lg",children:t?(0,l.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,l.jsx)(R.u,{className:"h-6 w-6 mr-2"}),(0,l.jsx)("span",{children:"Drop files to upload"})]}):(0,l.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,l.jsx)(z.v,{className:"h-6 w-6 mr-2"}),(0,l.jsx)("span",{children:"Drag and drop files here"})]})})})]})]})]})};function eU(e){let[a,t]=(0,n.useState)(!1),[s,r]=(0,n.useState)(e.inputText||""),[i,c]=(0,n.useState)(!1),[o,d]=(0,n.useState)("");return(0,n.useEffect)(()=>{e.inputText?"INITIALIZE"===e.inputText?(t(!0),d("")):(d(e.inputText),e.allFiles.includes(e.inputText)&&r(e.inputText)):d("")},[e.inputText]),(0,n.useEffect)(()=>{o&&!e.allFiles.includes(o)?(c(!0),r("")):o?(c(!1),r(o)):(c(!1),r(""))},[o,e.allFiles]),(0,n.useEffect)(()=>{a||e.onClose()},[a]),(0,l.jsxs)(eD.J2,{open:a||i&&!!o,onOpenChange:t,children:[(0,l.jsx)(eD.xo,{asChild:!0,children:(0,l.jsxs)(ef.z,{variant:"outline",role:"combobox","aria-expanded":a,className:'justify-between" '.concat(e.isMobileWidth?"w-full":"w-[200px]"),children:[s?e.isMobileWidth?"✔️":"Selected":e.isMobileWidth?" ":"Select file",(0,l.jsx)(Q,{className:"opacity-50"})]})}),(0,l.jsx)(eD.yk,{className:"w-[200px] p-0",children:(0,l.jsxs)(e_.mY,{children:[(0,l.jsx)(e_.sZ,{placeholder:"Search files...",value:o,onInput:e=>d(e.currentTarget.value)}),(0,l.jsxs)(e_.e8,{children:[(0,l.jsx)(e_.rb,{children:"No files found."}),(0,l.jsx)(e_.fu,{children:e.allFiles.map(a=>(0,l.jsxs)(e_.di,{value:a,onSelect:a=>{r(a===s?"":a),t(!1),e.onChooseFile(a)},children:[a,(0,l.jsx)(ee.J,{className:(0,eH.cn)("ml-auto",s===a?"opacity-100":"opacity-0")})]},a))})]})]})})]})}function eY(){let[e,a]=(0,n.useState)(""),[t,r]=(0,n.useState)(null),[d,m]=(0,n.useState)(!1),h=(0,n.useRef)(null),[u,f]=(0,n.useState)(null),[p,x]=(0,n.useState)([]),[j,g]=(0,n.useState)(null),[v,N]=(0,n.useState)(!0),[b,y]=(0,n.useState)([]),w=(0,n.useRef)(null),[A,Z]=(0,n.useState)(null),[E,V]=(0,n.useState)(void 0),[M,H]=(0,n.useState)(null),[S,O]=(0,n.useState)(!1),[L,F]=(0,n.useState)([]),[k,T]=(0,n.useState)(0),[C,_]=(0,n.useState)(1),{toast:P}=(0,ew.pm)(),I=(0,ex.IC)();function R(e){if(a(e),!e.trim()){r(null);return}w.current&&clearTimeout(w.current),e.trim()&&(w.current=setTimeout(()=>{z()},750))}function z(){!d&&e.trim()&&(m(!0),fetch("/api/search?q=".concat(encodeURIComponent(e),"&client=web"),{method:"GET",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{r(e),m(!1)}).catch(e=>{console.error("Error:",e)}))}(0,n.useEffect)(()=>{fetch("/api/content/computer",{method:"GET",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{y(e)}).catch(e=>{console.error("Error loading files:",e)})},[]),(0,n.useEffect)(()=>{let a=e.match(/file:([^"\s]*|"[^"]*")?/);if(a){let e=a[1],t=null==e?void 0:e.replace(/"/g,"");t?V(t):V("INITIALIZE")}},[e]);let W=async e=>{try{let a=await fetch("api/content/files?page=".concat(e));if(!a.ok)throw Error("Failed to fetch files");let t=await a.json(),l=t.files,s=t.num_pages;_(s),Array.isArray(l)&&x(l.toSorted())}catch(e){g("Failed to load files"),console.error("Error fetching files:",e)}finally{N(!1)}};(0,n.useEffect)(()=>{W(k)},[k]);let U=async e=>{try{let a=await fetch("/api/content/file?file_name=".concat(e));if(!a.ok)throw Error("Failed to fetch file");let t=await a.json();H(t.raw_text)}catch(e){g("Failed to load file"),console.error("Error fetching file:",e)}},Y=(e,a)=>{let t=new Blob([a],{type:"text/plain"}),l=window.URL.createObjectURL(t),s=document.createElement("a");s.href=l,s.download="".concat(e.split("/").pop(),".txt"),document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(l)};(0,n.useEffect)(()=>{A&&U(A)},[A]),(0,n.useEffect)(()=>{W(k)},[]),(0,n.useEffect)(()=>{L.length>0&&(T(0),W(0))},[L]);let B=async e=>{O(!0);try{if(!(await fetch("/api/content/file?filename=".concat(e),{method:"DELETE"})).ok)throw Error("Failed to delete file");P({title:"File deleted",description:"File ".concat(e," has been deleted"),variant:"default"}),W(k)}catch(a){P({title:"Error deleting file",description:"Failed to delete file ".concat(e),variant:"destructive"})}finally{O(!1)}};return(0,l.jsxs)(ej.Hn,{children:[(0,l.jsx)(eg.S,{conversationId:""}),(0,l.jsxs)(ej.kV,{children:[(0,l.jsxs)("header",{className:"flex h-16 shrink-0 items-center gap-2 border-b px-4",children:[(0,l.jsx)(ej.vP,{className:"-ml-1"}),(0,l.jsx)(ev.Z,{orientation:"vertical",className:"mr-2 h-4"}),I?(0,l.jsx)("a",{className:"p-0 no-underline",href:"/",children:(0,l.jsx)(eN.VO,{className:"h-auto w-16"})}):(0,l.jsx)("h2",{className:"text-lg",children:"Search Your Knowledge Base"})]}),(0,l.jsx)("div",{children:(0,l.jsx)("div",{className:"".concat(i().searchLayout),children:(0,l.jsx)("div",{className:"w-full md:w-5/6 mx-auto pt-6 md:pt-8",children:(0,l.jsxs)("div",{className:"p-4 w-full mx-auto",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center border-2 border-muted p-1 gap-1 rounded-lg flex-col md:flex-row",children:[(0,l.jsx)("div",{className:"relative flex-1 w-full",children:(0,l.jsx)(s.I,{autoFocus:!0,className:"border-none pl-4 focus-visible:ring-transparent focus-visible:ring-offset-transparent",onChange:e=>R(e.currentTarget.value),onKeyDown:e=>{"Enter"===e.key&&z()},ref:h,type:"search",placeholder:"Search Documents",value:e})}),(0,l.jsxs)("div",{id:"actions",className:"flex gap-2",children:[(0,l.jsx)(eU,{allFiles:b,onChooseFile:t=>(function(t){var l;let s=e.replace(/file:([^"\s]*|"[^"]*")?/i,"").trim();a('file:"'.concat(t,'" ').concat(s)),null===(l=h.current)||void 0===l||l.focus(),z()})(t),isMobileWidth:I,inputText:E,onClose:()=>{var e;return null===(e=h.current)||void 0===e?void 0:e.focus()}}),(0,l.jsxs)(ef.z,{className:"px-2 gap-2 inline-flex rounded-none items-center border-l border-gray-300 hover:text-gray-500",variant:"ghost",onClick:()=>z(),children:[(0,l.jsx)(ea.Y,{className:"h-4 w-4"}),(0,l.jsx)("span",{children:"Find"})]})]})]}),null===t&&(0,l.jsx)(eW,{setUploadedFiles:F}),d&&(0,l.jsx)("div",{className:"mt-4 flex items-center justify-center",children:(0,l.jsx)(eb.l,{className:"mt-4",message:"Searching",iconClassName:"h-5 w-5"})}),u&&(0,l.jsxs)("div",{className:"mt-4",children:[(0,l.jsxs)(ef.z,{onClick:()=>f(null),className:"mb-4",variant:"outline",children:[(0,l.jsx)(et.X,{className:"inline mr-2"}),"Back"]}),function(e){let a=(e.additional.file||"").startsWith("http"),t=a?e.additional.heading:e.additional.file.split("/").pop();return(0,l.jsxs)(o.Zb,{className:"bg-secondary h-full shadow-sm rounded-lg border border-muted mb-4 animate-fade-in-up",children:[(0,l.jsx)(o.Ol,{children:(0,l.jsx)(o.ll,{children:t})}),a&&(0,l.jsx)(o.eW,{children:(0,l.jsxs)("a",{href:e.additional.file,target:"_blank",className:"underline text-sm bg-muted p-3 rounded-lg text-muted-foreground flex items-center gap-2",children:[(0,l.jsx)(D,{className:"inline"}),e.additional.file]})}),(0,l.jsx)(o.aY,{children:(0,l.jsx)("div",{className:"text-m",children:e.entry})})]})}(u)]}),!u&&!d&&t&&t.length>0&&(0,l.jsxs)("div",{className:"mt-4 max-w-[92vw] break-all",children:[(0,l.jsxs)(ef.z,{onClick:()=>R(""),className:"mb-4",variant:"outline",children:[(0,l.jsx)(et.X,{className:"inline mr-2"}),"See All"]}),(0,l.jsx)(c.x,{className:"h-[80vh]",children:t.map((e,a)=>(0,l.jsx)(ez,{note:e,setFocusSearchResult:f},e["corpus-id"]))})]}),!d&&null===t&&!e.trim()&&(0,l.jsxs)("div",{className:"w-full mt-4",children:[v&&(0,l.jsx)("div",{className:"mt-4 flex items-center justify-center",children:(0,l.jsx)(eb.l,{className:"mt-4",message:"Loading",iconClassName:"h-5 w-5"})}),j&&(0,l.jsx)("div",{className:"text-red-500",children:j}),!t&&!v&&0===p.length&&(0,l.jsxs)(o.Zb,{className:"flex flex-col items-center justify-center border-none shadow-none",children:[(0,l.jsxs)(o.Ol,{className:"flex flex-col items-center justify-center",children:[(0,l.jsx)(o.SZ,{className:"border-muted-foreground border w-fit rounded-lg mb-2 text-center text-lg p-4",children:(0,l.jsx)(eu,{weight:"fill",className:"text-muted-foreground h-10 w-10"})}),(0,l.jsx)(o.ll,{className:"text-center",children:"Let's get started!"})]}),(0,l.jsxs)(o.aY,{children:[(0,l.jsx)("div",{className:"text-muted-foreground items-center justify-center text-center flex",children:'To use search, upload docs via the "Add Documents" button.'}),(0,l.jsx)(ep.default,{href:"https://docs.khoj.dev/data-sources/share_your_data",className:"no-underline",children:(0,l.jsx)("div",{className:"mt-4 text-center text-secondary-foreground bg-secondary w-fit m-auto p-2 rounded-lg",children:"Learn More"})})]})]}),(0,l.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:p.map((e,a)=>(0,l.jsx)(eR,{file:e,index:a,setSelectedFile:Z,setSelectedFileFullText:H,handleDownload:Y,handleDelete:B,isDeleting:S,selectedFileFullText:M},a))}),(0,l.jsx)(eS,{children:(0,l.jsxs)(eO,{className:"p-0",children:[k>0&&(0,l.jsx)(eL,{className:"list-none",children:(0,l.jsx)(ek,{onClick:()=>T(k-1)})}),k>1&&(0,l.jsx)(eL,{className:"list-none",children:(0,l.jsx)(eF,{onClick:()=>T(0),children:"1"})}),k>2&&(0,l.jsx)(eL,{className:"list-none",children:(0,l.jsx)(eC,{})}),k>0&&(0,l.jsx)(eL,{className:"list-none",children:(0,l.jsx)(eF,{onClick:()=>T(k-1),children:k})}),(0,l.jsx)(eL,{className:"list-none",children:(0,l.jsx)(eF,{isActive:!0,children:k+1})}),k<C-1&&(0,l.jsx)(eL,{className:"list-none",children:(0,l.jsx)(eF,{onClick:()=>T(k+1),children:k+2})}),k<C-3&&(0,l.jsx)(eL,{className:"list-none",children:(0,l.jsx)(eC,{})}),k<C-2&&(0,l.jsx)(eL,{className:"list-none",children:(0,l.jsx)(eF,{onClick:()=>T(C-1),children:C})}),k<C-1&&(0,l.jsx)(eL,{className:"list-none",children:(0,l.jsx)(eT,{onClick:()=>T(k+1)})})]})})]})]})})})})]})]})}},32759:function(e,a,t){"use strict";t.d(a,{E:function(){return i}});var l=t(57437),s=t(2265),n=t(60610),r=t(94508);let i=s.forwardRef((e,a)=>{let{className:t,value:s,indicatorColor:i,...c}=e;return(0,l.jsx)(n.fC,{ref:a,className:(0,r.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...c,children:(0,l.jsx)(n.z$,{className:"h-full w-full flex-1 bg-primary transition-all ".concat(i),style:{transform:"translateX(-".concat(100-(s||0),"%)")}})})});i.displayName=n.fC.displayName},77992:function(e,a,t){"use strict";t.d(a,{pm:function(){return h}});var l=t(2265);let s=0,n=new Map,r=e=>{if(n.has(e))return;let a=setTimeout(()=>{n.delete(e),d({type:"REMOVE_TOAST",toastId:e})},1e6);n.set(e,a)},i=(e,a)=>{switch(a.type){case"ADD_TOAST":return{...e,toasts:[a.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===a.toast.id?{...e,...a.toast}:e)};case"DISMISS_TOAST":{let{toastId:t}=a;return t?r(t):e.toasts.forEach(e=>{r(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===t||void 0===t?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===a.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==a.toastId)}}},c=[],o={toasts:[]};function d(e){o=i(o,e),c.forEach(e=>{e(o)})}function m(e){let{...a}=e,t=(s=(s+1)%Number.MAX_SAFE_INTEGER).toString(),l=()=>d({type:"DISMISS_TOAST",toastId:t});return d({type:"ADD_TOAST",toast:{...a,id:t,open:!0,onOpenChange:e=>{e||l()}}}),{id:t,dismiss:l,update:e=>d({type:"UPDATE_TOAST",toast:{...e,id:t}})}}function h(){let[e,a]=l.useState(o);return l.useEffect(()=>(c.push(a),()=>{let e=c.indexOf(a);e>-1&&c.splice(e,1)}),[e]),{...e,toast:m,dismiss:e=>d({type:"DISMISS_TOAST",toastId:e})}}},41816:function(e){e.exports={searchLayout:"search_searchLayout__fP3m0"}}},function(e){e.O(0,[2026,2663,7200,9259,8667,4363,5621,2327,2971,2117,1744],function(){return e(e.s=94114)}),_N_E=e.O()}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6938],{62960:function(e,t,s){Promise.resolve().then(s.bind(s,31537))},31537:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return G}});var a,n,r=s(57437),i=s(917),l=s.n(i);s(97510);var o=s(2265),c=s(77992),d=s(56937),h=s(7436),u=s(62869),x=s(95186),m=s(66070),p=s(84190),f=s(37099),j=s(94508);o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("div",{className:"relative w-full overflow-auto",children:(0,r.jsx)("table",{ref:t,className:(0,j.cn)("w-full caption-bottom text-sm",s),...a})})}).displayName="Table",o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("thead",{ref:t,className:(0,j.cn)("[&_tr]:border-b",s),...a})}).displayName="TableHeader",o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("tbody",{ref:t,className:(0,j.cn)("[&_tr:last-child]:border-0",s),...a})}).displayName="TableBody",o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("tfoot",{ref:t,className:(0,j.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a})}).displayName="TableFooter",o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("tr",{ref:t,className:(0,j.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",s),...a})}).displayName="TableRow",o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("th",{ref:t,className:(0,j.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a})}).displayName="TableHead",o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("td",{ref:t,className:(0,j.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a})}).displayName="TableCell",o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("caption",{ref:t,className:(0,j.cn)("mt-4 text-sm text-muted-foreground",s),...a})}).displayName="TableCaption";var b=s(3894),g=s(37295),N=s(2049),w=s(50525),v=s(5147),_=s(80438),y=s(2452),S=s(47615),k=s(35099),T=s(22345),E=s(75216),F=s(47020),C=s(90483),D=s(73925),A=s(54271),O=s(95656),P=s(58717),I=s(87296),z=s(41648),Y=s(41184),R=s(14308),B=s(60729),U=s(34124),W=s(6512),Z=s(37104),M=s(32759),H=s(57635),K=s.n(H),V=s(12);let L=e=>{var t,s;let{items:a,selected:n,callbackFunc:i}=e,[l,c]=(0,o.useState)(null!==(s=null==n?void 0:n.toString())&&void 0!==s?s:"0");return!!n&&(0,r.jsx)("div",{className:"overflow-hidden shadow-md rounded-lg",children:(0,r.jsxs)(p.h_,{children:[(0,r.jsx)(p.$F,{asChild:!0,className:"w-full rounded-lg",children:(0,r.jsxs)(u.z,{variant:"outline",className:"justify-start py-6 rounded-lg",children:[null===(t=a.find(e=>e.id.toString()===l))||void 0===t?void 0:t.name," ",(0,r.jsx)(b.p,{className:"h-4 w-4 ml-auto text-muted-foreground"})]})}),(0,r.jsx)(p.AW,{style:{maxHeight:"200px",overflowY:"auto",minWidth:"var(--radix-dropdown-menu-trigger-width)"},children:(0,r.jsx)(p._x,{value:l,onValueChange:async e=>{c(e),await i(e)},children:a.map(e=>(0,r.jsx)(p.qB,{value:e.id.toString(),children:e.name},e.id.toString()))})})]})})};function G(){let{data:e}=(0,d.h2)(!0),[t,s]=(0,o.useState)(null),[a,n]=(0,o.useState)(void 0),[i,p]=(0,o.useState)(null),[j,b]=(0,o.useState)(void 0),[H,G]=(0,o.useState)(""),[J,$]=(0,o.useState)("verified"),[q,X]=(0,o.useState)(!1),[Q,ee]=(0,o.useState)(0),[et,es]=(0,o.useState)(0),[ea,en]=(0,o.useState)(0),{toast:er}=(0,c.pm)(),ei=(0,h.IC)(),el="w-full lg:w-5/12 grid grid-flow-column border border-gray-300 shadow-md rounded-lg border dark:border-none border-opacity-50 dark:bg-muted";(0,o.useEffect)(()=>{var t;s(e),b(null==e?void 0:e.phone_number),$((null==e?void 0:e.is_phone_number_verified)?"verified":(null==e?void 0:e.phone_number)?"otp":"setup"),n(null==e?void 0:e.given_name),p(null!==(t=null==e?void 0:e.notion_token)&&void 0!==t?t:null)},[e]);let eo=async e=>{try{if(!(await fetch("/api/subscription?operation=".concat(e),{method:"PATCH",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to change subscription");t&&(t.subscription_state="cancel"===e?d.o9.UNSUBSCRIBED:d.o9.SUBSCRIBED,s(t)),er({title:"\uD83D\uDCB3 Subscription",description:(null==t?void 0:t.subscription_state)==="unsubscribed"?"Your subscription was cancelled":"Your Futurist subscription has been renewed"})}catch(t){console.error("Error changing subscription:",t),er({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"})}},ec=async()=>{try{let e=await fetch("/api/subscription/trial",{method:"POST"});if(!e.ok)throw Error("Failed to enable free trial");if((await e.json()).trial_enabled&&t){t.subscription_state=d.o9.TRIAL;let e=new Date(Date.now()+864e5*t.length_of_free_trial);t.subscription_renewal_date=(e=>{let t=new Date(e);return new Intl.DateTimeFormat("en-US",{day:"2-digit",month:"short",year:"numeric"}).format(t)})(e),t.subscription_enabled_trial_at=new Date().toISOString(),s(t),er({title:"\uD83C\uDF89 Trial Enabled",description:"Your free trial will end on ".concat(t.subscription_renewal_date)})}}catch(e){console.error("Error enabling free trial:",e),er({title:"⚠️ Failed to Enable Free Trial",description:"Failed to enable free trial. Try again or contact us at team@khoj.dev"})}},ed=async()=>{if(a)try{if(!(await fetch("/api/user/name?name=".concat(a),{method:"PATCH",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to update name");t&&(t.given_name=a,s(t)),er({title:"✅ Updated Profile",description:"You name has been updated to ".concat(a)})}catch(e){console.error("Error updating name:",e),er({title:"⚠️ Failed to Update Profile",description:"Failed to update name. Try again or contact team@khoj.dev"})}},eh=e=>async s=>{if(!(null==t?void 0:t.is_active)){er({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");er({title:"✅ Updated ".concat((0,h.LF)(e)," Model")})}catch(t){console.error("Failed to update ".concat(e," model:"),t),er({description:"❌ Failed to update ".concat((0,h.LF)(e)," model. Try again."),variant:"destructive"})}},eu=async()=>{try{X(!0);let e=await fetch("/api/chat/stats"),t=(await e.json()).num_conversations;en(t);let s=new(K()),a=[];for(let e=0;10*e<t;e++){let s=await fetch("/api/chat/export?page=".concat(e)),n=await s.json();a.push(...n),es((e+1)*10),ee((e+1)*10/t*100)}s.file("conversations.json",JSON.stringify(a,null,2));let n=await s.generateAsync({type:"blob"});(0,V.saveAs)(n,"khoj-conversations.zip"),er({title:"Export Complete",description:"Successfully exported ".concat(a.length," conversations")})}catch(e){console.error("Error exporting chats:",e),er({title:"Export Failed",description:"Failed to export chats. Please try again.",variant:"destructive"})}finally{X(!1),ee(0),es(0),en(0)}},ex=async()=>{if(i)try{if(!(await fetch("/api/content/notion",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:i})})).ok)throw Error("Failed to save Notion API key");t&&(t.notion_token=i,s(t)),er({title:"✅ Saved Notion Settings",description:"You Notion API key has been saved."})}catch(e){console.error("Error updating name:",e),er({title:"⚠️ Failed to Save Notion Settings",description:"Failed to save Notion API key. Try again or contact team@khoj.dev"})}},em=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));er({title:"\uD83D\uDD04 Syncing ".concat(e),description:"Your ".concat(e," content is being synced.")})}catch(t){console.error("Error syncing content:",t),er({title:"⚠️ Failed to Sync ".concat(e),description:"Failed to sync ".concat(e," content. Try again or contact team@khoj.dev")})}},ep=async e=>{try{if(!(await fetch("/api/content/source/".concat(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to disconnect ".concat(e));t&&("computer"===e?t.enabled_content_source.computer=!1:"notion"===e?(t.enabled_content_source.notion=!1,t.notion_token=null,p(t.notion_token)):"github"===e&&(t.enabled_content_source.github=!1),s(t)),"computer"===e?er({title:"✅ Deleted Synced Files",description:"Your synced documents have been deleted."}):er({title:"✅ Disconnected ".concat(e),description:"Your ".concat(e," integration to Khoj has been disconnected.")})}catch(t){console.error("Error disconnecting ".concat(e,":"),t),er({title:"⚠️ Failed to Disconnect ".concat(e),description:"Failed to disconnect from ".concat(e,". Try again or contact team@khoj.dev")})}};return t?(0,r.jsxs)(B.Hn,{children:[(0,r.jsx)(U.S,{conversationId:""}),(0,r.jsxs)(B.kV,{children:[(0,r.jsxs)("header",{className:"flex h-16 shrink-0 items-center gap-2 border-b px-4",children:[(0,r.jsx)(B.vP,{className:"-ml-1"}),(0,r.jsx)(W.Z,{orientation:"vertical",className:"mr-2 h-4"}),ei?(0,r.jsx)("a",{className:"p-0 no-underline",href:"/",children:(0,r.jsx)(Z.VO,{className:"h-auto w-16"})}):(0,r.jsx)("h2",{className:"text-lg",children:"Settings"})]}),(0,r.jsxs)("div",{className:l().page,children:[(0,r.jsx)("title",{children:"Settings"}),(0,r.jsx)("div",{className:l().content,children:(0,r.jsx)("div",{className:"".concat(l().contentBody," mx-10 my-2"),children:(0,r.jsx)(o.Suspense,{fallback:(0,r.jsx)(R.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)(m.Zb,{className:el,children:[(0,r.jsxs)(m.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(g.Y,{className:"h-7 w-7 mr-2"}),"Name"]}),(0,r.jsxs)(m.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)(x.I,{type:"text",onChange:e=>n(e.target.value),value:a,className:"w-full border border-gray-300 rounded-lg p-4 py-6"})]}),(0,r.jsx)(m.eW,{className:"flex flex-wrap gap-4",children:(0,r.jsxs)(u.z,{variant:"outline",size:"sm",onClick:ed,disabled:a===t.given_name,children:[(0,r.jsx)(N.B,{className:"h-5 w-5 inline mr-2"}),"Save"]})})]}),(0,r.jsxs)(m.Zb,{id:"subscription",className:el,children:[(0,r.jsxs)(m.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(w.a,{className:"h-7 w-7 mr-2"}),"Subscription"]}),(0,r.jsxs)(m.aY,{className:"grid gap-2 overflow-hidden",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Current Plan"}),"trial"===t.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"," ",t.length_of_free_trial," ","day trial of the Khoj Futurist plan. Your trial ends on"," ",t.subscription_renewal_date,". Check"," ",(0,r.jsx)("a",{href:"https://khoj.dev/#pricing",target:"_blank",children:"pricing page"})," ","to compare plans."]})]})||"subscribed"===t.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:t.subscription_renewal_date})]})]})||"unsubscribed"===t.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:t.subscription_renewal_date})]})]})||"expired"===t.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl",children:"Humanist"}),t.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:t.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)(m.eW,{className:"flex flex-wrap gap-4",children:"subscribed"==t.subscription_state&&(0,r.jsxs)(u.z,{variant:"outline",className:"hover:text-red-400",onClick:()=>eo("cancel"),children:[(0,r.jsx)(v.b,{className:"h-5 w-5 mr-2"}),"Unsubscribe"]})||"unsubscribed"==t.subscription_state&&(0,r.jsxs)(u.z,{variant:"outline",className:"text-primary/80 hover:text-primary",onClick:()=>eo("resubscribe"),children:[(0,r.jsx)(_.e,{weight:"bold",className:"h-5 w-5 mr-2"}),"Resubscribe"]})||t.subscription_enabled_trial_at&&(0,r.jsxs)(u.z,{variant:"outline",className:"text-primary/80 hover:text-primary",onClick:()=>window.open("".concat(t.khoj_cloud_subscription_url,"?prefilled_email=").concat(t.username),"_blank","noopener,noreferrer"),children:[(0,r.jsx)(_.e,{weight:"bold",className:"h-5 w-5 mr-2"}),"Subscribe"]})||(0,r.jsxs)(u.z,{variant:"outline",className:"text-primary/80 hover:text-primary",onClick:ec,children:[(0,r.jsx)(_.e,{weight:"bold",className:"h-5 w-5 mr-2"}),"Enable Trial"]})})]})]})]}),(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)(m.Zb,{id:"computer",className:el,children:[(0,r.jsxs)(m.Ol,{className:"flex flex-row text-xl",children:[(0,r.jsx)(y.a,{className:"h-8 w-8 mr-2"}),"Knowledge Base",t.enabled_content_source.computer&&(0,r.jsx)(S.f,{className:"h-6 w-6 ml-auto text-green-500",weight:"fill"})]}),(0,r.jsx)(m.aY,{className:"overflow-hidden pb-12 text-gray-400",children:"Manage and search through your digital brain."}),(0,r.jsxs)(m.eW,{className:"flex flex-wrap gap-4",children:[(0,r.jsxs)(u.z,{variant:"outline",size:"sm",title:"Search thorugh files",onClick:()=>window.location.href="/search",children:[(0,r.jsx)(k.Y,{className:"h-5 w-5 inline mr-1"}),"Search"]}),(0,r.jsxs)(u.z,{variant:"outline",size:"sm",className:"".concat(t.enabled_content_source.computer||"hidden"),onClick:()=>ep("computer"),children:[(0,r.jsx)(T.u,{className:"h-5 w-5 inline mr-1"}),"Clear All"]})]})]}),(0,r.jsxs)(m.Zb,{id:"github",className:"".concat(el," hidden"),children:[(0,r.jsxs)(m.Ol,{className:"flex flex-row text-2xl",children:[(0,r.jsx)(E.b,{className:"h-8 w-8 mr-2"}),"Github"]}),(0,r.jsx)(m.aY,{className:"overflow-hidden pb-12 text-gray-400",children:"Set Github repositories to index"}),(0,r.jsxs)(m.eW,{className:"flex flex-wrap gap-4",children:[(0,r.jsx)(u.z,{variant:"outline",size:"sm",children:t.enabled_content_source.github&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(F.h,{className:"h-5 w-5 inline mr-1"}),"Manage"]})||(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(C.F,{className:"h-5 w-5 inline mr-1"}),"Connect"]})}),(0,r.jsxs)(u.z,{variant:"outline",size:"sm",className:"".concat(t.enabled_content_source.github||"hidden"),children:[(0,r.jsx)(T.u,{className:"h-5 w-5 inline mr-1"}),"Disable"]})]})]}),(0,r.jsxs)(m.Zb,{id:"notion",className:el,children:[(0,r.jsxs)(m.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(D.F,{className:"h-7 w-7 mr-2"}),"Notion",t.enabled_content_source.notion&&(0,r.jsx)(S.f,{className:"h-6 w-6 ml-auto text-green-500",weight:"fill"})]}),(0,r.jsxs)(m.aY,{className:"grid gap-4",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Sync your Notion workspace."}),!t.notion_oauth_url&&(0,r.jsx)(x.I,{onChange:e=>p(e.target.value),value:i||"",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)(m.eW,{className:"flex flex-wrap gap-4",children:[t.notion_oauth_url&&!t.enabled_content_source.notion?(0,r.jsxs)(u.z,{variant:"outline",size:"sm",onClick:()=>{window.open(t.notion_oauth_url)},children:[(0,r.jsx)(C.F,{className:"h-5 w-5 inline mr-1"}),"Connect"]}):t.enabled_content_source.notion&&i===t.notion_token?(0,r.jsxs)(u.z,{variant:"outline",size:"sm",onClick:()=>em("notion"),children:[(0,r.jsx)(A.t,{className:"h-5 w-5 inline mr-1"}),"Sync"]}):t.notion_oauth_url?(0,r.jsx)(r.Fragment,{}):(0,r.jsxs)(u.z,{variant:"outline",size:"sm",onClick:ex,disabled:i===t.notion_token,children:[(0,r.jsx)(N.B,{className:"h-5 w-5 inline mr-1"}),t.enabled_content_source.notion&&"Update API Key"||"Set API Key"]}),(0,r.jsxs)(u.z,{variant:"outline",size:"sm",className:"".concat(t.notion_token||"hidden"),onClick:()=>ep("notion"),children:[(0,r.jsx)(T.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:[t.chat_model_options.length>0&&(0,r.jsxs)(m.Zb,{className:el,children:[(0,r.jsxs)(m.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(O.G,{className:"h-7 w-7 mr-2"}),"Chat"]}),(0,r.jsxs)(m.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)(L,{items:t.chat_model_options,selected:t.selected_chat_model_config,callbackFunc:eh("chat")})]}),(0,r.jsx)(m.eW,{className:"flex flex-wrap gap-4",children:!t.is_active&&(0,r.jsx)("p",{className:"text-gray-400",children:"Subscribe to switch model"})})]}),t.paint_model_options.length>0&&(0,r.jsxs)(m.Zb,{className:el,children:[(0,r.jsxs)(m.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(P.Y,{className:"h-7 w-7 mr-2"}),"Paint"]}),(0,r.jsxs)(m.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)(L,{items:t.paint_model_options,selected:t.selected_paint_model_config,callbackFunc:eh("paint")})]}),(0,r.jsx)(m.eW,{className:"flex flex-wrap gap-4",children:!t.is_active&&(0,r.jsx)("p",{className:"text-gray-400",children:"Subscribe to switch model"})})]}),t.voice_model_options.length>0&&(0,r.jsxs)(m.Zb,{className:el,children:[(0,r.jsxs)(m.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(I.u,{className:"h-7 w-7 mr-2"}),"Voice"]}),(0,r.jsxs)(m.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)(L,{items:t.voice_model_options,selected:t.selected_voice_model_config,callbackFunc:eh("voice")})]}),(0,r.jsx)(m.eW,{className:"flex flex-wrap gap-4",children:!t.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:"Account"}),(0,r.jsxs)("div",{className:"cards flex flex-wrap gap-16",children:[(0,r.jsxs)(m.Zb,{className:el,children:[(0,r.jsxs)(m.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(z.U,{className:"h-7 w-7 mr-2"}),"Export Data"]}),(0,r.jsxs)(m.aY,{className:"overflow-hidden",children:[(0,r.jsx)("p",{className:"pb-4 text-gray-400",children:"Download all your chat conversations"}),Q>0&&(0,r.jsxs)("div",{className:"w-full mt-4",children:[(0,r.jsx)(M.E,{value:Q,className:"w-full"}),(0,r.jsxs)("p",{className:"text-sm text-gray-500 mt-2",children:["Exported ",et," of ",ea," conversations"]})]})]}),(0,r.jsx)(m.eW,{className:"flex flex-wrap gap-4",children:(0,r.jsxs)(u.z,{variant:"outline",onClick:eu,disabled:q,children:[(0,r.jsx)(z.U,{className:"h-5 w-5 mr-2"}),q?"Exporting...":"Export Chats"]})})]}),(0,r.jsxs)(m.Zb,{className:el,children:[(0,r.jsxs)(m.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(Y.S,{className:"h-7 w-7 mr-2 text-red-500"}),"Delete Account"]}),(0,r.jsx)(m.aY,{className:"overflow-hidden",children:(0,r.jsxs)("p",{className:"pb-4 text-gray-400",children:["This will delete all your account data, including conversations, agents, and any assets you","'","ve generated. Be sure to export before you do this if you want to keep your information."]})}),(0,r.jsx)(m.eW,{className:"flex flex-wrap gap-4",children:(0,r.jsxs)(f.aR,{children:[(0,r.jsx)(f.vW,{asChild:!0,children:(0,r.jsxs)(u.z,{variant:"outline",className:"text-red-500 hover:text-red-600 hover:bg-red-50",children:[(0,r.jsx)(Y.S,{className:"h-5 w-5 mr-2"}),"Delete Account"]})}),(0,r.jsxs)(f._T,{children:[(0,r.jsxs)(f.fY,{children:[(0,r.jsx)(f.f$,{children:"Are you absolutely sure?"}),(0,r.jsx)(f.yT,{children:"This action is irreversible. This will permanently delete your account and remove all your data from our servers."})]}),(0,r.jsxs)(f.xo,{children:[(0,r.jsx)(f.le,{children:"Cancel"}),(0,r.jsxs)(f.OL,{className:"bg-red-500 hover:bg-red-600",onClick:async()=>{try{if(!(await fetch("/api/self",{method:"DELETE"})).ok)throw Error("Failed to delete account");er({title:"Account Deleted",description:"Your account has been successfully deleted."}),window.location.href="/"}catch(e){console.error("Error deleting account:",e),er({title:"Error",description:"Failed to delete account. Please try again or contact support.",variant:"destructive"})}},children:[(0,r.jsx)(Y.S,{className:"h-5 w-5 mr-2"}),"Delete Account"]})]})]})]})})]})]})]})]})})})})]})]})]}):(0,r.jsx)(R.Z,{})}(a=n||(n={})).Setup="setup",a.SendOTP="otp",a.VerifyOTP="verify",a.Verified="verified"},32759:function(e,t,s){"use strict";s.d(t,{E:function(){return l}});var a=s(57437),n=s(2265),r=s(60610),i=s(94508);let l=n.forwardRef((e,t)=>{let{className:s,value:n,indicatorColor:l,...o}=e;return(0,a.jsx)(r.fC,{ref:t,className:(0,i.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",s),...o,children:(0,a.jsx)(r.z$,{className:"h-full w-full flex-1 bg-primary transition-all ".concat(l),style:{transform:"translateX(-".concat(100-(n||0),"%)")}})})});l.displayName=r.fC.displayName},77992:function(e,t,s){"use strict";s.d(t,{pm:function(){return u}});var a=s(2265);let n=0,r=new Map,i=e=>{if(r.has(e))return;let t=setTimeout(()=>{r.delete(e),d({type:"REMOVE_TOAST",toastId:e})},1e6);r.set(e,t)},l=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case"DISMISS_TOAST":{let{toastId:s}=t;return s?i(s):e.toasts.forEach(e=>{i(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===s||void 0===s?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===t.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},o=[],c={toasts:[]};function d(e){c=l(c,e),o.forEach(e=>{e(c)})}function h(e){let{...t}=e,s=(n=(n+1)%Number.MAX_SAFE_INTEGER).toString(),a=()=>d({type:"DISMISS_TOAST",toastId:s});return d({type:"ADD_TOAST",toast:{...t,id:s,open:!0,onOpenChange:e=>{e||a()}}}),{id:s,dismiss:a,update:e=>d({type:"UPDATE_TOAST",toast:{...e,id:s}})}}function u(){let[e,t]=a.useState(c);return a.useEffect(()=>(o.push(t),()=>{let e=o.indexOf(t);e>-1&&o.splice(e,1)}),[e]),{...e,toast:h,dismiss:e=>d({type:"DISMISS_TOAST",toastId:e})}}},917:function(e){e.exports={page:"settings_page__mP7qk",contentBody:"settings_contentBody__uZjue",phoneInput:"settings_phoneInput__j6xJN"}}},function(e){e.O(0,[6008,2663,7200,9259,8667,4363,4609,5621,9636,2327,2971,2117,1744],function(){return e(e.s=62960)}),_N_E=e.O()}]);
|
@@ -1 +1 @@
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7138,
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7138,8459,244,3317],{34780:function(e,t,n){Promise.resolve().then(n.bind(n,85147))},7436:function(e,t,n){"use strict";n.d(t,{EK:function(){return i},Gv:function(){return l},IC:function(){return _},Iy:function(){return s},LF:function(){return u},Nr:function(){return m},k6:function(){return a},o0:function(){return f},xq:function(){return d}});var r=n(2265),o=n(17200);let c=()=>window.fetch("https://ipapi.co/json").then(e=>e.json()).catch(e=>console.log(e)),u=e=>e.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase());function i(){console.log("%c %s","font-family:monospace",'\n __ __ __ __ ______ __ _____ __\n/\\ \\/ / /\\ \\_\\ \\ /\\ __ \\ /\\ \\ /\\ __ \\ /\\ \\\n\\ \\ _"-. \\ \\ __ \\ \\ \\ \\/\\ \\ _\\_\\ \\ \\ \\ __ \\ \\ \\ \\\n \\ \\_\\ \\_\\ \\ \\_\\ \\_\\ \\ \\_____\\ /\\_____\\ \\ \\_\\ \\_\\ \\ \\_\\\n \\/_/\\/_/ \\/_/\\/_/ \\/_____/ \\/_____/ \\/_/\\/_/ \\/_/\n\n\nGreetings traveller,\n\nI am ✨Khoj✨, your open-source, personal AI copilot.\n\nSee my source code at https://github.com/khoj-ai/khoj\nRead my operating manual at https://docs.khoj.dev\n')}function a(){let{data:e,error:t,isLoading:n}=(0,o.ZP)("/api/ip",c,{revalidateOnFocus:!1});return{locationData:e,locationDataError:t,locationDataLoading:n}}function _(){let[e,t]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=()=>{window.innerWidth<=768?t(!0):t(!1)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}let s=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{attributes:!0,characterData:!0,childList:!0,subtree:!0};r.useEffect(()=>{if(e.current){let r=new MutationObserver(t);return r.observe(e.current,n),()=>r.disconnect()}},[e,t,n])};function l(){let[e,t]=(0,r.useState)(!1),[n,o]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{"dark"===localStorage.getItem("theme")?(document.documentElement.classList.add("dark"),t(!0)):"light"===localStorage.getItem("theme")?(document.documentElement.classList.remove("dark"),t(!1)):window.matchMedia("(prefers-color-scheme: dark)").matches&&(document.documentElement.classList.add("dark"),t(!0)),o(!0)},[]),(0,r.useEffect)(()=>{n&&(e?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),localStorage.setItem("theme",e?"dark":"light"))},[e,n]),[e,t]}let d=e=>e<1024?"".concat(e," B"):e<1048576?"".concat((e/1024).toFixed(2)," KB"):"".concat((e/1048576).toFixed(2)," MB");function m(e,t){let[n,o]=(0,r.useState)(e);return(0,r.useEffect)(()=>{let n=setTimeout(()=>{o(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}let f=e=>{try{let t=new Date(e),n=new Date,r=Math.floor((n.getTime()-t.getTime())/6e4);if(r<1)return"just now";if(r<60)return"".concat(r," minutes ago");if(r<120)return"1 hour ago";if(r<1440)return"".concat(Math.floor(r/60)," hours ago");return new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0,timeZoneName:"short"}).format(t)}catch(t){return console.error("Error formatting date:",t),e}}},85147:function(e,t,n){"use strict";n.d(t,{ThemeProvider:function(){return c}});var r=n(57437),o=n(7436);function c(e){let{children:t}=e,[n,c]=(0,o.Gv)();return(0,r.jsx)(r.Fragment,{children:t})}}},function(e){e.O(0,[7200,2971,2117,1744],function(){return e(e.s=34780)}),_N_E=e.O()}]);
|
@@ -1 +1 @@
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3111],{91955:function(e,t,s){Promise.resolve().then(s.bind(s,41694))},41694:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return j}});var a=s(57437),o=s(22515),n=s.n(o),i=s(2265),r=s(74986),l=s(14308);s(2446);var c=s(7436),d=s(56937),h=s(5477),u=s(60729),m=s(34124),g=s(6512),x=s(37104),p=s(62869),f=s(19841);function _(e){let{slug:t,className:s}=e,o=async()=>{try{(await fetch("/api/chat/share?public_conversation_slug=".concat(t),{method:"DELETE"})).redirected?window.location.reload():console.error("Failed to unshare conversation")}catch(e){console.error("Error unsharing conversation:",e)}};return(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsx)(p.z,{className:"p-0 text-sm h-auto text-rose-500 hover:text-rose-600",variant:"ghost",title:"Unshare conversation",onClick:o,children:(0,a.jsx)(f.r,{className:"".concat(s)})})})}function v(e){let[t,s]=(0,i.useState)(""),[o,l]=(0,i.useState)([]),[c,d]=(0,i.useState)(!1),[u,m]=(0,i.useState)(null),g=(0,i.useRef)(null),x=e.setQueryToProcess,p=e.streamedMessages,f=e.isMobileWidth?"w-full":"w-4/6";return((0,i.useEffect)(()=>{if(o.length>0){let t=o.map(e=>encodeURIComponent(e));e.setImages(t)}},[o,e.setImages]),(0,i.useEffect)(()=>{t&&(d(!0),x(t))},[t,x]),(0,i.useEffect)(()=>{p&&p.length>0&&p[p.length-1].completed?d(!1):s("")},[p]),e.publicConversationSlug||e.conversationId)?(0,a.jsx)("div",{className:"flex flex-row h-full w-full",children:(0,a.jsxs)("div",{className:"flex flex-col h-full w-full",children:[(0,a.jsx)("div",{className:n().chatBodyFull,children:(0,a.jsx)(r.Z,{publicConversationSlug:e.publicConversationSlug,conversationId:e.conversationId||"",setAgent:m,setTitle:e.setTitle,setIsOwner:e.setIsOwner,pendingMessage:c?t:"",incomingMessages:e.streamedMessages,customClassName:f})}),(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-2xl md:rounded-xl h-fit ").concat(f," mr-auto ml-auto mt-auto"),children:(0,a.jsx)(h.a,{isLoggedIn:e.isLoggedIn,sendMessage:e=>s(e),sendImage:e=>l(t=>[...t,e]),sendDisabled:c,chatOptionsData:e.chatOptionsData,conversationId:e.conversationId,agentColor:null==u?void 0:u.color,isMobileWidth:e.isMobileWidth,setUploadedFiles:e.setUploadedFiles,setTriggeredAbort:()=>{},ref:g})})]})}):(0,a.jsx)("div",{className:n().suggestions,children:"Whoops, nothing to see here!"})}function j(){let[e,t]=(0,i.useState)(null),[s,o]=(0,i.useState)(!0),[r,h]=(0,i.useState)("Khoj AI - Chat"),[p,f]=(0,i.useState)(void 0),[j,w]=(0,i.useState)([]),[N,I]=(0,i.useState)(""),[S,C]=(0,i.useState)(null),[b,y]=(0,i.useState)(void 0),[B,O]=(0,i.useState)([]),[k,E]=(0,i.useState)(!1),{data:T,error:M,isLoading:W}=(0,d.GW)(),F=(0,c.IC)();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,c.EK)(),y(window.location.pathname.split("/").pop()||"")},[]),(0,i.useEffect)(()=>{S&&localStorage.setItem("uploadedFiles",JSON.stringify(S))},[S]),(0,i.useEffect)(()=>{if(N&&!p){fetch("/api/chat/share/fork?public_conversation_slug=".concat(b),{method:"POST",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{f(e.conversation_id),localStorage.setItem("message",N),B.length>0&&localStorage.setItem("images",JSON.stringify(B)),window.location.href="/chat?conversationId=".concat(e.conversation_id)}).catch(e=>{console.error(e)});return}},[N,p,b]),s)?(0,a.jsx)(l.Z,{}):b?(0,a.jsxs)(u.Hn,{children:[(0,a.jsx)(m.S,{conversationId:p||""}),(0,a.jsxs)(u.kV,{children:[(0,a.jsxs)("header",{className:"flex h-16 shrink-0 items-center gap-2 border-b px-4",children:[(0,a.jsx)(u.vP,{className:"-ml-1"}),(0,a.jsx)(g.Z,{orientation:"vertical",className:"mr-2 h-4"}),b&&(0,a.jsx)("div",{className:"".concat(n().chatTitleWrapper," text-nowrap text-ellipsis overflow-hidden max-w-screen-md grid items-top font-bold mx-2 md:mr-8 col-auto h-fit"),children:F?(0,a.jsx)("a",{className:"p-0 no-underline",href:"/",children:(0,a.jsx)(x.VO,{className:"h-auto w-16"})}):r&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{className:"text-lg text-ellipsis whitespace-nowrap overflow-x-hidden mr-4",children:r}),k&&T&&(0,a.jsx)(_,{slug:b,className:"h-4 w-4 mt-1"})]})})]}),(0,a.jsxs)("div",{className:"".concat(n().main," ").concat(n().chatLayout),children:[(0,a.jsx)("title",{children:r}),(0,a.jsx)("div",{className:n().chatBox,children:(0,a.jsx)("div",{className:n().chatBoxBody,children:(0,a.jsx)(i.Suspense,{fallback:(0,a.jsx)(l.Z,{}),children:(0,a.jsx)(v,{conversationId:p,streamedMessages:j,setQueryToProcess:I,isLoggedIn:!!T,publicConversationSlug:b,chatOptionsData:e,setTitle:h,setUploadedFiles:C,isMobileWidth:F,setImages:O,setIsOwner:E})})})})]})]})]}):(0,a.jsx)("div",{className:n().suggestions,children:"Whoops, nothing to see here!"})}},22515: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",chatTitleWrapper:"sharedChat_chatTitleWrapper__rVdYj"}}},function(e){e.O(0,[9346,
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3111],{91955:function(e,t,s){Promise.resolve().then(s.bind(s,41694))},41694:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return j}});var a=s(57437),o=s(22515),n=s.n(o),i=s(2265),r=s(74986),l=s(14308);s(2446);var c=s(7436),d=s(56937),h=s(5477),u=s(60729),m=s(34124),g=s(6512),x=s(37104),p=s(62869),f=s(19841);function _(e){let{slug:t,className:s}=e,o=async()=>{try{(await fetch("/api/chat/share?public_conversation_slug=".concat(t),{method:"DELETE"})).redirected?window.location.reload():console.error("Failed to unshare conversation")}catch(e){console.error("Error unsharing conversation:",e)}};return(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsx)(p.z,{className:"p-0 text-sm h-auto text-rose-500 hover:text-rose-600",variant:"ghost",title:"Unshare conversation",onClick:o,children:(0,a.jsx)(f.r,{className:"".concat(s)})})})}function v(e){let[t,s]=(0,i.useState)(""),[o,l]=(0,i.useState)([]),[c,d]=(0,i.useState)(!1),[u,m]=(0,i.useState)(null),g=(0,i.useRef)(null),x=e.setQueryToProcess,p=e.streamedMessages,f=e.isMobileWidth?"w-full":"w-4/6";return((0,i.useEffect)(()=>{if(o.length>0){let t=o.map(e=>encodeURIComponent(e));e.setImages(t)}},[o,e.setImages]),(0,i.useEffect)(()=>{t&&(d(!0),x(t))},[t,x]),(0,i.useEffect)(()=>{p&&p.length>0&&p[p.length-1].completed?d(!1):s("")},[p]),e.publicConversationSlug||e.conversationId)?(0,a.jsx)("div",{className:"flex flex-row h-full w-full",children:(0,a.jsxs)("div",{className:"flex flex-col h-full w-full",children:[(0,a.jsx)("div",{className:n().chatBodyFull,children:(0,a.jsx)(r.Z,{publicConversationSlug:e.publicConversationSlug,conversationId:e.conversationId||"",setAgent:m,setTitle:e.setTitle,setIsOwner:e.setIsOwner,pendingMessage:c?t:"",incomingMessages:e.streamedMessages,customClassName:f})}),(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-2xl md:rounded-xl h-fit ").concat(f," mr-auto ml-auto mt-auto"),children:(0,a.jsx)(h.a,{isLoggedIn:e.isLoggedIn,sendMessage:e=>s(e),sendImage:e=>l(t=>[...t,e]),sendDisabled:c,chatOptionsData:e.chatOptionsData,conversationId:e.conversationId,agentColor:null==u?void 0:u.color,isMobileWidth:e.isMobileWidth,setUploadedFiles:e.setUploadedFiles,setTriggeredAbort:()=>{},ref:g})})]})}):(0,a.jsx)("div",{className:n().suggestions,children:"Whoops, nothing to see here!"})}function j(){let[e,t]=(0,i.useState)(null),[s,o]=(0,i.useState)(!0),[r,h]=(0,i.useState)("Khoj AI - Chat"),[p,f]=(0,i.useState)(void 0),[j,w]=(0,i.useState)([]),[N,I]=(0,i.useState)(""),[S,C]=(0,i.useState)(null),[b,y]=(0,i.useState)(void 0),[B,O]=(0,i.useState)([]),[k,E]=(0,i.useState)(!1),{data:T,error:M,isLoading:W}=(0,d.GW)(),F=(0,c.IC)();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,c.EK)(),y(window.location.pathname.split("/").pop()||"")},[]),(0,i.useEffect)(()=>{S&&localStorage.setItem("uploadedFiles",JSON.stringify(S))},[S]),(0,i.useEffect)(()=>{if(N&&!p){fetch("/api/chat/share/fork?public_conversation_slug=".concat(b),{method:"POST",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{f(e.conversation_id),localStorage.setItem("message",N),B.length>0&&localStorage.setItem("images",JSON.stringify(B)),window.location.href="/chat?conversationId=".concat(e.conversation_id)}).catch(e=>{console.error(e)});return}},[N,p,b]),s)?(0,a.jsx)(l.Z,{}):b?(0,a.jsxs)(u.Hn,{children:[(0,a.jsx)(m.S,{conversationId:p||""}),(0,a.jsxs)(u.kV,{children:[(0,a.jsxs)("header",{className:"flex h-16 shrink-0 items-center gap-2 border-b px-4",children:[(0,a.jsx)(u.vP,{className:"-ml-1"}),(0,a.jsx)(g.Z,{orientation:"vertical",className:"mr-2 h-4"}),b&&(0,a.jsx)("div",{className:"".concat(n().chatTitleWrapper," text-nowrap text-ellipsis overflow-hidden max-w-screen-md grid items-top font-bold mx-2 md:mr-8 col-auto h-fit"),children:F?(0,a.jsx)("a",{className:"p-0 no-underline",href:"/",children:(0,a.jsx)(x.VO,{className:"h-auto w-16"})}):r&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{className:"text-lg text-ellipsis whitespace-nowrap overflow-x-hidden mr-4",children:r}),k&&T&&(0,a.jsx)(_,{slug:b,className:"h-4 w-4 mt-1"})]})})]}),(0,a.jsxs)("div",{className:"".concat(n().main," ").concat(n().chatLayout),children:[(0,a.jsx)("title",{children:r}),(0,a.jsx)("div",{className:n().chatBox,children:(0,a.jsx)("div",{className:n().chatBoxBody,children:(0,a.jsx)(i.Suspense,{fallback:(0,a.jsx)(l.Z,{}),children:(0,a.jsx)(v,{conversationId:p,streamedMessages:j,setQueryToProcess:I,isLoggedIn:!!T,publicConversationSlug:b,chatOptionsData:e,setTitle:h,setUploadedFiles:C,isMobileWidth:F,setImages:O,setIsOwner:E})})})})]})]})]}):(0,a.jsx)("div",{className:n().suggestions,children:"Whoops, nothing to see here!"})}},22515: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",chatTitleWrapper:"sharedChat_chatTitleWrapper__rVdYj"}}},function(e){e.O(0,[9346,4842,2663,3954,1919,7200,9259,8667,4363,4357,8515,2327,5477,4986,2971,2117,1744],function(){return e(e.s=91955)}),_N_E=e.O()}]);
|
@@ -1 +1 @@
|
|
1
|
-
!function(){"use strict";var e,t,n,r,o,c,
|
1
|
+
!function(){"use strict";var e,t,n,r,o,a,c,f,u,i={},d={};function b(e){var t=d[e];if(void 0!==t)return t.exports;var n=d[e]={exports:{}},r=!0;try{i[e].call(n.exports,n,n.exports,b),r=!1}finally{r&&delete d[e]}return n.exports}b.m=i,e=[],b.O=function(t,n,r,o){if(n){o=o||0;for(var a=e.length;a>0&&e[a-1][2]>o;a--)e[a]=e[a-1];e[a]=[n,r,o];return}for(var c=1/0,a=0;a<e.length;a++){for(var n=e[a][0],r=e[a][1],o=e[a][2],f=!0,u=0;u<n.length;u++)c>=o&&Object.keys(b.O).every(function(e){return b.O[e](n[u])})?n.splice(u--,1):(f=!1,o<c&&(c=o));if(f){e.splice(a--,1);var i=r();void 0!==i&&(t=i)}}return t},b.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return b.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},b.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);b.r(o);var a={};t=t||[null,n({}),n([]),n(n)];for(var c=2&r&&e;"object"==typeof c&&!~t.indexOf(c);c=n(c))Object.getOwnPropertyNames(c).forEach(function(t){a[t]=function(){return e[t]}});return a.default=function(){return e},b.d(o,a),o},b.d=function(e,t){for(var n in t)b.o(t,n)&&!b.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},b.f={},b.e=function(e){return Promise.all(Object.keys(b.f).reduce(function(t,n){return b.f[n](e,t),t},[]))},b.u=function(e){return 4609===e?"static/chunks/4609-33aa487dff03a9fd.js":"static/chunks/"+(({1264:"90542734",6555:"964ecbae",7293:"94ca1967"})[e]||e)+"."+({58:"f4bd8a3c9d88f5fe",133:"392ae90c3b2a67f2",479:"a7e0c9cfc376a695",1243:"ea2826fb35adb15a",1264:"9e6e44b1b45b30fe",1592:"b069bdb7aaddd2eb",2069:"f060659791c0c484",2170:"45431769330fa5b7",3237:"c4754f02f1a388cb",3305:"1fc7297ba154ee95",3332:"6313db5217bb1b67",3451:"421db0b49fdbd881",3460:"39c2b9b6a3898384",4299:"2aaa569416cfc208",4327:"238d15c09a039b8b",4415:"e0c0da5eedae4dd7",4610:"a1e7f40a759ed2aa",4650:"41f041da0ad365ad",4872:"5422e8324272ab40",5061:"79a660faed0e16a9",5279:"85d537880b8041ae",5402:"b9460f1b16b57e92",5555:"f7cf9795d675de51",5978:"ddc72cd73130aadc",6434:"7afea9648e238ad5",6555:"d5be7c49c320d695",7140:"4be689873f6a2d1f",7293:"1b3402358e0e1255",7836:"86884157d53d23a1",7890:"f681eb1d1f83bea2",7953:"f6fc335a23efb959",8254:"3145a4fbdcfdca46",8400:"c95e4e79bcd79a56",8673:"be44c4d9e4f1d084",8698:"a088118fef40d302",9022:"33974a513a281fd2",9433:"b1b5f5d050c43e3c",9822:"34f293973c4e9b04"})[e]+".js"},b.miniCssF=function(e){},b.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),b.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},o="_N_E:",b.l=function(e,t,n,a){if(r[e]){r[e].push(t);return}if(void 0!==n)for(var c,f,u=document.getElementsByTagName("script"),i=0;i<u.length;i++){var d=u[i];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==o+n){c=d;break}}c||(f=!0,(c=document.createElement("script")).charset="utf-8",c.timeout=120,b.nc&&c.setAttribute("nonce",b.nc),c.setAttribute("data-webpack",o+n),c.src=b.tu(e)),r[e]=[t];var l=function(t,n){c.onerror=c.onload=null,clearTimeout(s);var o=r[e];if(delete r[e],c.parentNode&&c.parentNode.removeChild(c),o&&o.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=l.bind(null,c.onerror),c.onload=l.bind(null,c.onload),f&&document.head.appendChild(c)},b.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},b.tt=function(){return void 0===a&&(a={createScriptURL:function(e){return e}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(a=trustedTypes.createPolicy("nextjs#bundler",a))),a},b.tu=function(e){return b.tt().createScriptURL(e)},b.p="/_next/",c={2272:0,3254:0,3587:0,6250:0,4842:0,2663:0,2026:0,9346:0,6008:0},b.f.j=function(e,t){var n=b.o(c,e)?c[e]:void 0;if(0!==n){if(n)t.push(n[2]);else if(/^(2(026|272|663)|3254|3587|4842|6008|6250|9346)$/.test(e))c[e]=0;else{var r=new Promise(function(t,r){n=c[e]=[t,r]});t.push(n[2]=r);var o=b.p+b.u(e),a=Error();b.l(o,function(t){if(b.o(c,e)&&(0!==(n=c[e])&&(c[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;a.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",a.name="ChunkLoadError",a.type=r,a.request=o,n[1](a)}},"chunk-"+e,e)}}},b.O.j=function(e){return 0===c[e]},f=function(e,t){var n,r,o=t[0],a=t[1],f=t[2],u=0;if(o.some(function(e){return 0!==c[e]})){for(n in a)b.o(a,n)&&(b.m[n]=a[n]);if(f)var i=f(b)}for(e&&e(t);u<o.length;u++)r=o[u],b.o(c,r)&&c[r]&&c[r][0](),c[r]=0;return b.O(i)},(u=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(f.bind(null,0)),u.push=f.bind(null,u.push.bind(u)),b.nc=void 0}();
|
@@ -0,0 +1 @@
|
|
1
|
+
div.search_searchLayout__fP3m0{display:grid;grid-template-columns:1fr;gap:1rem;height:100%}@media screen and (max-width:768px){div.search_searchLayout__fP3m0{gap:0}}
|