PageSourceSearch

https://alpie.ai/assets/index-DeZA5ltY.js

js alpie.ai collected 2026-10-05 11:48:59 UTC 10,675 bytes, 9 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sidebarDrawer-DYb-UVcw.js","assets/index-DBW684cp.js","assets/mui-4hztunbl.js","assets/echarts-DxIfvtYu.js","assets/radix-DZ7Ka9l8.js","assets/index-CJ0NEkbg.css","assets/useChatSwitch-BALniBIV.js","assets/avatar-CV_M-hLb.js","assets/dropdown-menu-BumbUODp.js","assets/chevron-right-BJZ87ycE.js","assets/check-BkCPRGyi.js","assets/ellipsis-vertical-CbG_jMA8.js","assets/settings-xMZuRUb6.js","assets/chevron-left-D-gkMYPQ.js","assets/monitor-DDcXDry6.js","assets/search-Dbye4VON.js","assets/Share-DO8Z4h8D.js","assets/share.service-DZfsnBRP.js","assets/copy-DXkFCHLA.js","assets/pencil-CS7Kk8nw.js","assets/user.service-DlqNpLyt.js","assets/FilesCard-CDAY6s4G.js","assets/card-C1INtz2O.js","assets/collaboration.service-D_5KY3W5.js","assets/resource.service-Q1ok16FO.js","assets/GenericDocumentIcon-CxTdPz6-.js","assets/LazyPreview-D7goGoIv.js","assets/sanitizeDocxForPreview-QJWczi4l.js","assets/download-BabINkA7.js","assets/trash-BTRBbAzY.js"])))=>i.map(i=>d[i]);
2import{b as Re,c as ze,d as y,bt as Be,e as He,ap as Ge,s as Ve,T as Xe,u as Qe,j as $e,M as x,g as n,f as k,r as qe,_ as oe,i as Je}from"./index-DBW684cp.js";import{u as h,j as e,D as Ke}from"./mui-4hztunbl.js";import{r as t}from"./echarts-DxIfvtYu.js";import{u as We,D as Ye,g as Ze}from"./collaboration.service-D_5KY3W5.js";import{g as es,b as ss,s as ts}from"./resource.service-Q1ok16FO.js";import{P as as}from"./ProjectModals-Vuooj3Ij.js";import rs from"./index-D7Ae8hfl.js";import{u as os}from"./useDocumentTitle-CPxEWDji.js";import"./radix-DZ7Ka9l8.js";import"./useChatSwitch-BALniBIV.js";import"./avatar-CV_M-hLb.js";import"./dropdown-menu-BumbUODp.js";import"./chevron-right-BJZ87ycE.js";import"./check-BkCPRGyi.js";import"./ellipsis-vertical-CbG_jMA8.js";import"./settings-xMZuRUb6.js";import"./chevron-left-D-gkMYPQ.js";import"./monitor-DDcXDry6.js";import"./search-Dbye4VON.js";import"./Share-DO8Z4h8D.js";import"./share.service-DZfsnBRP.js";import"./copy-DXkFCHLA.js";import"./pencil-CS7Kk8nw.js";import"./user.service-DlqNpLyt.js";const ls=t.lazy(()=>oe(()=>import("./sidebarDrawer-DYb-UVcw.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),ns=t.lazy(()=>oe(()=>import("./FilesCard-CDAY6s4G.js"),__vite__mapDeps([21,2,3,1,4,5,22,8,9,10,23,24,25,26,27,11,28,29]))),re=80,Ts=()=>{const le=Re(),u=ze(),ne=y(Be),ce=y(He),ie=y(Ge),de=y(Ve),{projects:c,setProjects:f,nextPageUrl:O,isLoadingMore:R,hasMore:z,fetchProjectsData:B}=We({projTrigger:de}),[v,P]=t.useState(!1),[p,C]=t.useState(""),[pe,H]=t.useState([]),[me,cs]=t.useState(!0),[D,ge]=t.useState(!1),[I,xe]=t.useState(null),[he,ue]=t.useState(""),[fe,M]=t.useState(!1),[be,je]=t.useState(()=>()=>{}),[we,Se]=t.useState(()=>()=>{}),[G,V]=t.useState({}),[ye,X]=t.useState(!1),[ke,Q]=t.useState(null),[ve,$]=t.useState(null),[Pe,q]=t.useState(!1),[J,N]=t.useState([]),[E,_]=t.useState(!1),Ce={selectedMedia:ke,setSelectedMedia:Q,isOpenFile:ye,setIsOpenFile:X,selectedImage:ve,setSelectedImage:$,openImagePreview:Pe,setOpenImagePreview:q},[T,K]=t.useState("/resources/page/"),[m,W]=t.useState(!1),[b,F]=t.useState(!0),L=t.useRef(null),{theme:Y}=t.useContext(Xe),U=Y==="dark",A=h("(max-width: 1024px)"),De=h("(min-width: 640px) and (max-width: 1023px)"),Ie=h("(min-width: 1024px) and (max-width: 1279px)"),Me=h("(min-width: 1280px) and (max-width: 1535px)"),Ne=h("(min-width: 1536px)"),Ee=De||Ie?4:Me?3:Ne?4:3,_e=()=>{ge(s=>!s),C("")},{t:j}=Qe();os("Files"),t.useEffect(()=>{if(!$e()){V({});return}if(!(c!=null&&c.length))return;(async()=>{const r={};await Promise.all(c.map(async a=>{try{const o=await Ze(a.id);r[a.id]=o||[]}catch{r[a.id]=[]}})),V(r)})()},[c]);const Z=(s,r,a,o)=>{xe(s);const l=c.find(d=>d.id===s);l&&ue(l.name),(l==null?void 0:l.name)!=="New Chat"&&(je(()=>r),Se(()=>o||(()=>{})),M(!0),u(k(!1)),a==null||a())},Te=async()=>{try{await Je(I),ie===I&&be(),f(s=>s.filter(r=>r.id!==I)),M(!1),we()}catch(s){console.error("Error deleting project:",s)}},ee=async(s,r)=>{try{await qe(s,r),f(a=>a.map(o=>o.id===s?{...o,name:r}:o))}catch(a){console.error("Update failed",a),x("Failed to rename chat. Please try again.")}},se=t.useCallback(async s=>{var r,a;if(!(m||!s||!b)){W(!0);try{const o=await es(s,{page_size:20}),{results:l,next:d}=o;H(w=>{const g=w||[],Ue=l.filter(Ae=>!g.some(Oe=>
2Oe.id===Ae.id)),S=[...g,...Ue];return S.length>re?S.slice(S.length-re):S}),K(d),F(!!d)}catch(o){console.error("Failed to fetch media files:",o),x(((a=(r=o==null?void 0:o.response)==null?void 0:r.data)==null?void 0:a.message)||(o==null?void 0:o.message)||j("toast.manageFiles.fetchMediaError"),"error"),F(!1)}finally{W(!1)}}},[m,b,x]),te=t.useCallback(async()=>{var s,r;P(!0);try{const a=await ss({page_size:20}),{results:o,next:l}=a;H(o||[]),K(l),F(!!l),P(!1)}catch(a){x(((r=(s=a==null?void 0:a.response)==null?void 0:s.data)==null?void 0:r.message)||(a==null?void 0:a.message)||j("toast.manageFiles.loadFilesError"),"error"),P(!1)}},[x]),ae=t.useCallback(async s=>{const r=s.trim();if(!r){N([]),_(!1);return}_(!0);try{const a=await ts(r);N(a||[])}catch(a){console.error("Search failed:",a),N([])}finally{_(!1)}},[]);t.useEffect(()=>{const s=setTimeout(()=>{ae(p)},300);return()=>clearTimeout(s)},[p,ae]);const i=p.trim()&&J.length>0?J:p.trim()?[]:pe,Fe=s=>r=>{r.type==="keydown"&&(r.key==="Tab"||r.key==="Shift")||u(k(s))},Le=t.useCallback(()=>{if(L.current){const{scrollTop:s,scrollHeight:r,clientHeight:a}=L.current;r-s-a<100&&T&&b&&!m&&se(T)}},[T,b,m,se]);return t.useEffect(()=>{te()},[me]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex w-full h-screen",children:[!A&&e.jsx(rs,{projects:c,setProjects:f,projectUsersMap:G,onDeleteClick:Z,updateProjTitle:ee,nextPageUrl:O,isLoadingMore:R,hasMore:z,fetchProjectsData:B}),e.jsxs("header",{className:"w-full h-[48px] z-[50] justify-between flex-col place-items-center fixed top-0 dark:bg-[#0C0E12] bg-[#FDFDFD] lg:hidden",children:[e.jsx("div",{className:"flex items-center justify-between w-full max-w-full h-[48px] px-4 py-3 border-b dark:border-[#161616] border-[#E9EAEB]",children:e.jsxs("div",{className:"flex items-center justify-center gap-4",children:[e.jsx("span",{onClick:()=>{u(k(!0))},children:e.jsx("img",{src:Y=="dark"?n("menu_dark_icon.svg"):n("menu_light_icon.svg"),alt:"menu",className:"w-6 h-6"})}),e.jsx("span",{onClick:()=>{u(k(!0))},children:e.jsx("img",{src:n("alpieIcon.svg"),alt:"Alpie",className:"w-6 h-6"})})]})}),e.jsx("div",{className:"flex items-center justify-between w-full mt-1 space-x-2 bg-background dark:bg-gray-100"})]}),A&&e.jsx(Ke,{anchor:"left",open:ce,onClose:Fe(!1),children:e.jsx(t.Suspense,{fallback:null,children:e.jsx(ls,{projects:c,setProjects:f,onDeleteClick:Z,projectUsersMap:G,updateProjTitle:ee,nextPageUrl:O,isLoadingMore:R,hasMore:z,fetchProjectsData:B})})}),e.jsxs("div",{className:`flex flex-col flex-1 h-screen transition-colors duration-100 ease-linear mobile:px-4 mobile:gap-4 ${A?"mt-[40px]":""}`,children:[e.jsx("div",{className:"w-full flex justify-end items-center py-[1.5rem] pb-4 md:pb-6 sticky top-0 mobile:mt-[30px] mobile:p-0  z-20",children:e.jsxs("div",{className:"sticky z-10 flex items-center w-full px-10 text-left mobile:p-0",children:[e.jsx("img",{onClick:()=>le(-1),src:U?n("darkBackIcon.svg"):n("lightBackIcon.svg"),alt:"Go back",className:"w-[20px] h-[20px] cursor-pointer mr-4"}),e.jsx("span",{className:"font-inter font-normal text-[16px] mobile:text-[14px] leading-[100%] tracking-[0%] align-middle",children:j("dashboard.recentFiles")}),e.jsx("div",{className:"flex-1 mr-[1rem] mobile:mr-0 mobile:hidden",children:e.jsxs("div",{className:"relative w-full h-[36px] flex items-center justify-end",children:[D&&e.jsx("input",{type:"text",value:p,placeholder:j("dashboard.search.projects"),className:"w-[96%] h-[36px] px-4 pr-10 text-black dark:text-white border border-[#E9EAEB] dark:border-[#373A41] rounded-2xl text-[14px] outline-none bg-transparent",onChange:s=>C(s.target.value)}),e.jsx("img",{src:U?D?n("darkCloseIcon.svg"):n("newSearchIcon_dark.svg"):D?n("lightCloseIcon.svg"):n("newSearchIcon_light.svg"),alt:"searchIcon",width:20,height:20,className:"absolute -translate-y-1/2 cursor-pointer right-3 top-1/2",onClick:_e})]})})]})}),e.jsxs("div",{className:"w-[98%] h-[39px] flex items-center relative sm:hidden md:hidden lg:hidden xl:hidden",children:[e.jsx("span",{className:"absolute text-gray-400 left-3 dark:text-gray-300",children:e.jsx("img",{src:U?n("newSearchIcon_dark.svg"):n("newSearchIcon_light.svg"),alt:"search"})}),e.jsx("input",{type:"text",value:p,placeholder:"Search for files",className:"w-full h-[39px] pl-10 pr-4 text-black dark:text-white border border-[#
2E9EAEB] dark:border-[#373A41] rounded-[6px] text-[14px] outline-none bg-transparent",onChange:s=>C(s.target.value)})]}),e.jsxs("main",{ref:L,onScroll:Le,className:"flex-1 py-6 pl-0 overflow-x-hidden overflow-y-auto md:px-12 mobile:py-0 scrollbar-hide",children:[(v||E)&&e.jsx("div",{className:`grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-5 lg:gap-8
3               mobile:flex-nowrap mobile:overflow-x-auto mobile:gap-[16px] mobile:gap-y-4 no-scrollbar`,children:new Array(Ee).fill(0).map((s,r)=>e.jsx("div",{className:`
4          rounded-[16px] p-4 snap-start flex flex-col justify-between
5          border border-[#E9EAEB] dark:border-[#22262F] dark:bg-[#13161B]
6          bg-zinc-700 animate-pulse cursor-pointer
7          mobile:min-h-[178px]
8          min-h-[214px]`},r))}),!v&&!E&&(i==null?void 0:i.length)>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-5 lg:gap-8
9               mobile:flex-nowrap mobile:overflow-x-auto mobile:gap-[16px] no-scrollbar mobile:place-items-center mobile:pb-3`,children:i.map((s,r)=>e.jsx(e.Fragment,{children:ne&&e.jsx(t.Suspense,{fallback:null,children:(()=>{var d,w,g;const a=["png","jpg","jpeg","svg","webp","gif"],o=(w=(d=s==null?void 0:s.resource_name)==null?void 0:d.split(".").pop())==null?void 0:w.toLowerCase(),l=a.includes(o)||a.includes((g=s==null?void 0:s.resource_type)==null?void 0:g.toLowerCase());return e.jsx(ns,{media:s,fetchMedia:te,setSelectedMedia:l?$:Q,setIsOpenFile:l?q:X}
9)})()},r)}))}),m&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx("div",{className:"w-6 h-6 border-2 rounded-full border-primary border-t-transparent animate-spin"})})]}),!v&&!E&&(i==null?void 0:i.length)===0&&e.jsx("p",{className:"text-muted-foreground",children:"No files found. Upload and get started!"})]})]})]}),e.jsx(as,{previewState:Ce,collaborationState:{},modalState:{}}),e.jsx(Ye,{open:fe,onOpenChange:M,onConfirm:Te,projectTitle:he})]})};export{Ts as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.