@exulu/frontend 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/.next/BUILD_ID +1 -1
  2. package/dist/.next/app-build-manifest.json +81 -81
  3. package/dist/.next/app-path-routes-manifest.json +1 -1
  4. package/dist/.next/build-manifest.json +2 -2
  5. package/dist/.next/prerender-manifest.json +1 -1
  6. package/dist/.next/server/app/(application)/agents/edit/[id]/page.js +1 -1
  7. package/dist/.next/server/app/(application)/agents/edit/[id]/page.js.nft.json +1 -1
  8. package/dist/.next/server/app/(application)/agents/edit/[id]/page_client-reference-manifest.js +1 -1
  9. package/dist/.next/server/app/(application)/agents/page.js +2 -2
  10. package/dist/.next/server/app/(application)/agents/page.js.nft.json +1 -1
  11. package/dist/.next/server/app/(application)/agents/page_client-reference-manifest.js +1 -1
  12. package/dist/.next/server/app/(application)/chat/[agent]/[session]/page.js +2 -2
  13. package/dist/.next/server/app/(application)/chat/[agent]/[session]/page.js.nft.json +1 -1
  14. package/dist/.next/server/app/(application)/chat/[agent]/[session]/page_client-reference-manifest.js +1 -1
  15. package/dist/.next/server/app/(application)/chat/[agent]/page.js +1 -1
  16. package/dist/.next/server/app/(application)/chat/[agent]/page.js.nft.json +1 -1
  17. package/dist/.next/server/app/(application)/chat/[agent]/page_client-reference-manifest.js +1 -1
  18. package/dist/.next/server/app/(application)/chat/page.js +1 -1
  19. package/dist/.next/server/app/(application)/chat/page.js.nft.json +1 -1
  20. package/dist/.next/server/app/(application)/chat/page_client-reference-manifest.js +1 -1
  21. package/dist/.next/server/app/(application)/configuration/page.js +1 -1
  22. package/dist/.next/server/app/(application)/configuration/page.js.nft.json +1 -1
  23. package/dist/.next/server/app/(application)/configuration/page_client-reference-manifest.js +1 -1
  24. package/dist/.next/server/app/(application)/dashboard/page.js +1 -1
  25. package/dist/.next/server/app/(application)/dashboard/page.js.nft.json +1 -1
  26. package/dist/.next/server/app/(application)/dashboard/page_client-reference-manifest.js +1 -1
  27. package/dist/.next/server/app/(application)/data/[[...query]]/page.js +1 -1
  28. package/dist/.next/server/app/(application)/data/[[...query]]/page.js.nft.json +1 -1
  29. package/dist/.next/server/app/(application)/data/[[...query]]/page_client-reference-manifest.js +1 -1
  30. package/dist/.next/server/app/(application)/evals/[id]/page.js +1 -1
  31. package/dist/.next/server/app/(application)/evals/[id]/page.js.nft.json +1 -1
  32. package/dist/.next/server/app/(application)/evals/[id]/page_client-reference-manifest.js +1 -1
  33. package/dist/.next/server/app/(application)/evals/[id]/runs/page.js +1 -1
  34. package/dist/.next/server/app/(application)/evals/[id]/runs/page.js.nft.json +1 -1
  35. package/dist/.next/server/app/(application)/evals/[id]/runs/page_client-reference-manifest.js +1 -1
  36. package/dist/.next/server/app/(application)/evals/cases/page.js +1 -1
  37. package/dist/.next/server/app/(application)/evals/cases/page.js.nft.json +1 -1
  38. package/dist/.next/server/app/(application)/evals/cases/page_client-reference-manifest.js +1 -1
  39. package/dist/.next/server/app/(application)/evals/page.js +1 -1
  40. package/dist/.next/server/app/(application)/evals/page.js.nft.json +1 -1
  41. package/dist/.next/server/app/(application)/evals/page_client-reference-manifest.js +1 -1
  42. package/dist/.next/server/app/(application)/explorer/page.js +1 -1
  43. package/dist/.next/server/app/(application)/explorer/page.js.nft.json +1 -1
  44. package/dist/.next/server/app/(application)/explorer/page_client-reference-manifest.js +1 -1
  45. package/dist/.next/server/app/(application)/jobs/page.js +1 -1
  46. package/dist/.next/server/app/(application)/jobs/page.js.nft.json +1 -1
  47. package/dist/.next/server/app/(application)/jobs/page_client-reference-manifest.js +1 -1
  48. package/dist/.next/server/app/(application)/keys/page.js +1 -1
  49. package/dist/.next/server/app/(application)/keys/page.js.nft.json +1 -1
  50. package/dist/.next/server/app/(application)/keys/page_client-reference-manifest.js +1 -1
  51. package/dist/.next/server/app/(application)/page.js +1 -1
  52. package/dist/.next/server/app/(application)/page.js.nft.json +1 -1
  53. package/dist/.next/server/app/(application)/page_client-reference-manifest.js +1 -1
  54. package/dist/.next/server/app/(application)/projects/[project]/page.js +1 -1
  55. package/dist/.next/server/app/(application)/projects/[project]/page.js.nft.json +1 -1
  56. package/dist/.next/server/app/(application)/projects/[project]/page_client-reference-manifest.js +1 -1
  57. package/dist/.next/server/app/(application)/projects/page.js +1 -1
  58. package/dist/.next/server/app/(application)/projects/page.js.nft.json +1 -1
  59. package/dist/.next/server/app/(application)/projects/page_client-reference-manifest.js +1 -1
  60. package/dist/.next/server/app/(application)/roles/page.js +1 -1
  61. package/dist/.next/server/app/(application)/roles/page.js.nft.json +1 -1
  62. package/dist/.next/server/app/(application)/roles/page_client-reference-manifest.js +1 -1
  63. package/dist/.next/server/app/(application)/token/page.js +1 -1
  64. package/dist/.next/server/app/(application)/token/page.js.nft.json +1 -1
  65. package/dist/.next/server/app/(application)/token/page_client-reference-manifest.js +1 -1
  66. package/dist/.next/server/app/(application)/users/page.js +1 -1
  67. package/dist/.next/server/app/(application)/users/page.js.nft.json +1 -1
  68. package/dist/.next/server/app/(application)/users/page_client-reference-manifest.js +1 -1
  69. package/dist/.next/server/app/(application)/variables/create/page.js +1 -1
  70. package/dist/.next/server/app/(application)/variables/create/page.js.nft.json +1 -1
  71. package/dist/.next/server/app/(application)/variables/create/page_client-reference-manifest.js +1 -1
  72. package/dist/.next/server/app/(application)/variables/edit/[variable_id]/page.js +1 -1
  73. package/dist/.next/server/app/(application)/variables/edit/[variable_id]/page.js.nft.json +1 -1
  74. package/dist/.next/server/app/(application)/variables/edit/[variable_id]/page_client-reference-manifest.js +1 -1
  75. package/dist/.next/server/app/(application)/variables/page.js +1 -1
  76. package/dist/.next/server/app/(application)/variables/page.js.nft.json +1 -1
  77. package/dist/.next/server/app/(application)/variables/page_client-reference-manifest.js +1 -1
  78. package/dist/.next/server/app/(application)/variables/usage/[variable_id]/page.js +1 -1
  79. package/dist/.next/server/app/(application)/variables/usage/[variable_id]/page.js.nft.json +1 -1
  80. package/dist/.next/server/app/(application)/variables/usage/[variable_id]/page_client-reference-manifest.js +1 -1
  81. package/dist/.next/server/app/(application)/workflows/page.js +1 -1
  82. package/dist/.next/server/app/(application)/workflows/page.js.nft.json +1 -1
  83. package/dist/.next/server/app/(application)/workflows/page_client-reference-manifest.js +1 -1
  84. package/dist/.next/server/app/(authentication)/login/page.js +3 -3
  85. package/dist/.next/server/app/(authentication)/login/page.js.nft.json +1 -1
  86. package/dist/.next/server/app/(authentication)/login/page_client-reference-manifest.js +1 -1
  87. package/dist/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  88. package/dist/.next/server/app/_not-found.html +1 -1
  89. package/dist/.next/server/app/_not-found.rsc +1 -1
  90. package/dist/.next/server/app-paths-manifest.json +3 -3
  91. package/dist/.next/server/chunks/1051.js +48 -0
  92. package/dist/.next/server/chunks/7944.js +1 -1
  93. package/dist/.next/server/middleware-manifest.json +5 -5
  94. package/dist/.next/server/pages/404.html +1 -1
  95. package/dist/.next/server/pages/500.html +1 -1
  96. package/dist/.next/server/server-reference-manifest.json +1 -1
  97. package/dist/.next/static/chunks/{3832-cfd7197465448e35.js → 3832-bfe8bd2edace90f9.js} +2 -2
  98. package/dist/.next/static/chunks/3832-bfe8bd2edace90f9.js.map +1 -0
  99. package/dist/.next/static/chunks/app/(application)/agents/page-499ac3bd1044306c.js +2 -0
  100. package/dist/.next/static/chunks/app/(application)/agents/page-499ac3bd1044306c.js.map +1 -0
  101. package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-b600c0b270eedb7f.js +2 -0
  102. package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-b600c0b270eedb7f.js.map +1 -0
  103. package/dist/.next/static/chunks/app/(application)/evals/[id]/page-2238f1fb73d93328.js +2 -0
  104. package/dist/.next/static/chunks/app/(application)/evals/[id]/page-2238f1fb73d93328.js.map +1 -0
  105. package/dist/.next/static/chunks/app/(authentication)/layout-0f416e1b9326e03a.js +2 -0
  106. package/dist/.next/static/chunks/app/(authentication)/layout-0f416e1b9326e03a.js.map +1 -0
  107. package/dist/.next/static/css/{175d6535ea9efb2c.css → 7b99daf4eb75ddb9.css} +2 -2
  108. package/dist/.next/static/css/{175d6535ea9efb2c.css.map → 7b99daf4eb75ddb9.css.map} +1 -1
  109. package/dist/.next/static/css/e3f2a16ab7676b05.css.map +1 -1
  110. package/package.json +1 -1
  111. package/dist/.next/server/chunks/7223.js +0 -48
  112. package/dist/.next/static/chunks/3832-cfd7197465448e35.js.map +0 -1
  113. package/dist/.next/static/chunks/app/(application)/agents/page-4137487b76f09235.js +0 -2
  114. package/dist/.next/static/chunks/app/(application)/agents/page-4137487b76f09235.js.map +0 -1
  115. package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-0f729a6df64d730e.js +0 -2
  116. package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-0f729a6df64d730e.js.map +0 -1
  117. package/dist/.next/static/chunks/app/(application)/evals/[id]/page-b2de62f11946627f.js +0 -2
  118. package/dist/.next/static/chunks/app/(application)/evals/[id]/page-b2de62f11946627f.js.map +0 -1
  119. package/dist/.next/static/chunks/app/(authentication)/layout-2dfa18ea6e6dc5cd.js +0 -2
  120. package/dist/.next/static/chunks/app/(authentication)/layout-2dfa18ea6e6dc5cd.js.map +0 -1
  121. /package/dist/.next/static/{_G7TS_eJB-KA5rdSZzdGX → ilyTh3roMkVIbl9q2AwIk}/_buildManifest.js +0 -0
  122. /package/dist/.next/static/{_G7TS_eJB-KA5rdSZzdGX → ilyTh3roMkVIbl9q2AwIk}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (()=>{var e={};e.id=6050,e.ids=[6050],e.modules={57343:e=>{"use strict";e.exports=require("graphql")},72934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},54580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},45869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},20399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},27790:e=>{"use strict";e.exports=require("assert")},78893:e=>{"use strict";e.exports=require("buffer")},61282:e=>{"use strict";e.exports=require("child_process")},84770:e=>{"use strict";e.exports=require("crypto")},80665:e=>{"use strict";e.exports=require("dns")},17702:e=>{"use strict";e.exports=require("events")},92048:e=>{"use strict";e.exports=require("fs")},32615:e=>{"use strict";e.exports=require("http")},35240:e=>{"use strict";e.exports=require("https")},98216:e=>{"use strict";e.exports=require("net")},19801:e=>{"use strict";e.exports=require("os")},55315:e=>{"use strict";e.exports=require("path")},86624:e=>{"use strict";e.exports=require("querystring")},76162:e=>{"use strict";e.exports=require("stream")},82452:e=>{"use strict";e.exports=require("tls")},17360:e=>{"use strict";e.exports=require("url")},21764:e=>{"use strict";e.exports=require("util")},71568:e=>{"use strict";e.exports=require("zlib")},8678:e=>{"use strict";e.exports=import("pg")},48644:e=>{"use strict";e.exports=import("prettier/plugins/babel")},93801:e=>{"use strict";e.exports=import("prettier/plugins/estree")},45747:e=>{"use strict";e.exports=import("prettier/standalone")},49411:e=>{"use strict";e.exports=require("node:path")},97742:e=>{"use strict";e.exports=require("node:process")},41041:e=>{"use strict";e.exports=require("node:url")},39701:(e,t,s)=>{"use strict";s.a(e,async(e,a)=>{try{s.r(t),s.d(t,{GlobalError:()=>d.a,__next_app__:()=>p,originalPathname:()=>h,pages:()=>x,routeModule:()=>g,tree:()=>m}),s(21114),s(76738);var l=s(71197);s(35866);var n=s(23191),r=s(88716),i=s(37922),d=s.n(i),o=s(95231),c={};for(let e in o)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(c[e]=()=>o[e]);s.d(t,c);var u=e([l]);l=(u.then?(await u)():u)[0];let m=["",{children:["(application)",{children:["data",{children:["[[...query]]",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(s.bind(s,21114)),"/home/runner/work/exulu-frontend/exulu-frontend/app/(application)/data/[[...query]]/page.tsx"]}]},{layout:[()=>Promise.resolve().then(s.bind(s,76738)),"/home/runner/work/exulu-frontend/exulu-frontend/app/(application)/data/[[...query]]/layout.tsx"]}]},{}]},{layout:[()=>Promise.resolve().then(s.bind(s,71197)),"/home/runner/work/exulu-frontend/exulu-frontend/app/(application)/layout.tsx"],"not-found":[()=>Promise.resolve().then(s.t.bind(s,35866,23)),"next/dist/client/components/not-found-error"]}]},{"not-found":[()=>Promise.resolve().then(s.t.bind(s,35866,23)),"next/dist/client/components/not-found-error"]}],x=["/home/runner/work/exulu-frontend/exulu-frontend/app/(application)/data/[[...query]]/page.tsx"],h="/(application)/data/[[...query]]/page",p={require:s,loadChunk:()=>Promise.resolve()},g=new n.AppPageRouteModule({definition:{kind:r.x.APP_PAGE,page:"/(application)/data/[[...query]]/page",pathname:"/data/[[...query]]",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:m}});a()}catch(e){a(e)}})},71580:(e,t,s)=>{Promise.resolve().then(s.bind(s,63978))},82736:(e,t,s)=>{Promise.resolve().then(s.bind(s,26533))},63978:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>eU});var a=s(10326),l=s(17577),n=s(76812),r=s(39167),i=s(18753),d=s(86508),o=s(11798),c=s(83855),u=s(23015),m=s(98091),x=s(40900),h=s(35047),p=s(15211),g=s(90772),f=s(53313),j=s(37859),v=s(65685),y=s(65304),b=s(15940),N=s(34789),w=s(77863),k=s(98181);let C=[{id:"select",header:({table:e})=>a.jsx(f.X,{checked:e.getIsAllPageRowsSelected()||e.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:t=>e.toggleAllPageRowsSelected(!!t),"aria-label":"Select all",className:"translate-y-[2px]"}),cell:({row:e})=>a.jsx(f.X,{checked:e.getIsSelected(),onCheckedChange:t=>e.toggleSelected(!!t),"aria-label":"Select row",className:"translate-y-[2px] max-w-[50px]"}),enableSorting:!1,enableHiding:!1},{accessorKey:"Description",cell:({row:e})=>(console.log("original",e.original),(0,a.jsxs)("div",{className:"flex flex-column grid grid-cols-1",children:[a.jsx("span",{className:"max-w-[500px] truncate font-medium w-full",children:e.original.name?e.original.name:e.original.text.slice(0,200)||"Untitled"}),a.jsx("small",{className:"mt-1",children:(0,k.WU)(new Date(e.original.createdAt),"PP")})]}))}];var z=s(43273),S=s(88307),E=s(94019),R=s(54432);function P({onSearch:e=e=>console.log(`Search query: ${e}`),placeholder:t="Search...",className:s=""}){let[n,r]=(0,l.useState)("");return a.jsx("form",{onSubmit:t=>{t.preventDefault(),e(n)},className:`relative ${s}`,children:(0,a.jsxs)("div",{className:"relative flex items-center w-full",children:[a.jsx(S.Z,{className:"absolute left-3 h-4 w-4 text-muted-foreground"}),a.jsx(R.I,{type:"text",placeholder:t,value:n,onChange:e=>r(e.target.value),className:"pl-10 pr-10","aria-label":"Search input"}),n&&(0,a.jsxs)(a.Fragment,{children:[a.jsx("span",{className:"absolute right-10 text-xs text-muted-foreground",children:"Press Enter ↵"}),a.jsx(g.z,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 h-full rounded-l-none",onClick:()=>{r(""),e("")},"aria-label":"Clear search",children:a.jsx(E.Z,{className:"h-4 w-4"})})]})]})})}var I=s(42270);function Z({activeFolder:e,activeItem:t,archived:s}){let k=(0,h.usePathname)(),S=(0,h.useSearchParams)(),[E,R]=(0,l.useState)(S.get("page")?parseInt(S.get("page")):1),Z=S.get("search"),{user:_}=(0,l.useContext)(p.S),{toast:D}=(0,N.pm)(),[M,q]=(0,l.useState)({..._.company}),A=(0,h.useRouter)(),[L,T]=l.useState({}),[$,F]=l.useState({}),[O,G]=l.useState([]),[V,J]=l.useState([]),{loading:B,data:U,refetch:W,previousData:X,error:H}=(0,r.aM)((0,I.P3)(e,[]),{fetchPolicy:"no-cache",nextFetchPolicy:"network-only",variables:{context:e,page:E??1,limit:10,sort:{field:"updatedAt",direction:"DESC"},filters:{archived:{eq:s},...Z?{name:{contains:`${Z}`}}:{}}}}),Y=U?.[e+I.Md],K=X?.[e+I.Md],[Q,ee]=(0,i.D)((0,I.ty)(e),{onCompleted:()=>{W()}}),[et,es]=(0,i.D)((0,I.mN)(e,[]),{onCompleted:()=>{W()}}),ea=l.useMemo(()=>[],[]),{limit:el,onPaginationChange:en,skip:er,pagination:ei}=function(){let[e,t]=(0,l.useState)({pageSize:5,pageIndex:0}),{pageSize:s,pageIndex:a}=e;return{limit:s,onPaginationChange:t,pagination:e,skip:s*a}}(),ed=(0,d.b7)({data:B&&K?.items?K.items:Y?.items??ea,pageCount:Y?.pageInfo?.pageCount??-1,columns:C,state:{sorting:V,columnVisibility:$,rowSelection:L,columnFilters:O},enableRowSelection:!0,onRowSelectionChange:T,onSortingChange:J,onColumnFiltersChange:G,onColumnVisibilityChange:F,getCoreRowModel:(0,o.sC)(),getFilteredRowModel:(0,o.vL)(),getPaginationRowModel:(0,o.G_)(),getSortedRowModel:(0,o.tj)(),getFacetedRowModel:(0,o.o6)(),getFacetedUniqueValues:(0,o.JG)(),manualPagination:!0,onPaginationChange:en}),[eo,ec]=(0,i.D)((0,I.tO)(e),{onCompleted:t=>{console.log("data",t);let s=t?t[e+I.Wc]?.item?.id:void 0;s&&A.push(`/data/${e}/${s}`),W()}}),eu=({page:e,search:t})=>{R(e??1);let s=new URLSearchParams;e&&s.set("page",e.toString()),t&&s.set("search",t),A.push(`${k}?${s.toString()}`)},em=t=>{s?A.push(`/data/${e}/archived/${t}?${S.toString()}`):A.push(`/data/${e}/${t}?${S.toString()}`)};return H?(0,a.jsxs)(z.bZ,{className:"p-4",variant:"destructive",children:[a.jsx(n.LPM,{className:"size-4"}),a.jsx(z.Cd,{children:"Error"}),a.jsx(z.X,{children:H?.message||": unknown"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"grid grid-flow-col grid-cols-[auto_minmax(0,1fr)] grid-rows-1 bg-background/95 p-4 backdrop-blur gap-2 supports-[backdrop-filter]:bg-background/60",children:[a.jsx(f.X,{checked:ed.getIsAllPageRowsSelected()||ed.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:e=>ed.toggleAllPageRowsSelected(!!e),"aria-label":"Select all",className:"my-auto mr-3 translate-y-[2px]"}),a.jsx("div",{className:"relative",children:a.jsx(P,{onSearch:e=>{eu({page:1,search:e})}})}),a.jsx(g.z,{onClick:()=>{eo({variables:{input:{name:"New item",source:"manual",textlength:0,company:M.id}}})},disabled:ec.loading||s,className:"ml-2 ml-auto lg:flex",children:ec.loading?a.jsx(j.g,{}):a.jsx(c.Z,{size:18})})]}),ed.getIsSomeRowsSelected()||ed.getIsAllRowsSelected()?a.jsx("div",{className:"flex px-4 pb-4",children:s?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(g.z,{className:"ml-2",onClick:()=>{let e=[];ed.getSelectedRowModel().rows.forEach(t=>{e.push(Q({variables:{id:t.original.id,input:{archived:!1}}}))}),Promise.all(e).then(()=>{ed.resetRowSelection(),D({title:"Unarchived items",description:"We unarchived "+e.length+" items."})})},variant:"secondary",disabled:ee.loading,children:[ee.loading?a.jsx(j.g,{}):a.jsx(u.Z,{className:"size-4"}),a.jsx("span",{className:"ml-2",children:"Unarchive selected"})]}),(0,a.jsxs)(g.z,{className:"ml-2",onClick:()=>{let t=[];ed.getSelectedRowModel().rows.forEach(s=>{t.push(et({variables:{context:e,id:s.original.id}}))}),Promise.all(t).then(()=>{ed.resetRowSelection(),D({title:"Deleted items",description:"We deleted "+t.length+" items."})})},variant:"secondary",disabled:es.loading,children:[es.loading?a.jsx(j.g,{}):a.jsx(m.Z,{className:"size-4"}),a.jsx("span",{className:"ml-2",children:"Delete selected"})]})]}):(0,a.jsxs)(g.z,{className:"ml-2",onClick:()=>{let e=[];ed.getSelectedRowModel().rows.forEach(t=>{e.push(Q({variables:{id:t.original?.id,input:{archived:!0}}}))}),Promise.all(e).then(()=>{ed.resetRowSelection(),D({title:"Archived items",description:"We archived "+e.length+" items."})})},variant:"secondary",disabled:ee.loading,children:[ee.loading?a.jsx(j.g,{}):a.jsx(x.Z,{className:"size-4"}),a.jsx("span",{className:"ml-2",children:"Archive selected"})]})}):null,B?a.jsx(v.x,{className:"h-screen",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2 p-4 pt-0",children:[a.jsx(y.O,{className:"mb-2 h-[100px] w-full rounded-lg"}),a.jsx(y.O,{className:"mb-2 h-[100px] w-full rounded-lg"}),a.jsx(y.O,{className:"mb-2 h-[100px] w-full rounded-lg"}),a.jsx(y.O,{className:"mb-2 h-[100px] w-full rounded-lg"}),a.jsx(y.O,{className:"mb-2 h-[100px] w-full rounded-lg"}),a.jsx(y.O,{className:"h-[100px] w-full rounded-lg"})]})}):(0,a.jsxs)("div",{className:"flex max-h-[75vh] flex-col",children:[a.jsx(v.x,{className:"h-screen grow",children:a.jsx("div",{className:"space-y-4",children:a.jsx("div",{className:"border-y",children:a.jsx(b.iA,{children:a.jsx(b.RM,{children:ed.getRowModel().rows?.length?ed.getRowModel().rows.map(e=>a.jsx(b.SC,{className:(0,w.cn)(t===e.original.id?"bg-secondary dark:text-white":""),"data-state":e.getIsSelected()&&"selected",children:e.getVisibleCells().map((t,s)=>s>0?a.jsx(b.pj,{className:"cursor-pointer",onClick:()=>{em(e.original.id)},children:(0,d.ie)(t.column.columnDef.cell,t.getContext())},t.id):a.jsx(b.pj,{children:(0,d.ie)(t.column.columnDef.cell,t.getContext())},t.id))},e.id)):a.jsx(b.SC,{children:a.jsx(b.pj,{colSpan:C.length,className:"h-24 text-center",children:"No results."})})})})})})}),(0,a.jsxs)("div",{className:"flex items-center justify-between px-2 pb-2",children:[(0,a.jsxs)("div",{className:"flex-1 text-sm text-muted-foreground",children:[ed.getFilteredSelectedRowModel().rows.length," of"," ",ed.getFilteredRowModel().rows.length," row(s) selected (total"," ",Y?.pageInfo.itemCount," items)."]}),a.jsx("div",{className:"flex items-center space-x-6 lg:space-x-8",children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsxs)(g.z,{variant:"outline",className:"hidden size-8 p-0 lg:flex",onClick:()=>{eu({page:1,search:Z??void 0})},disabled:!Y?.pageInfo.hasPreviousPage,children:[a.jsx("span",{className:"sr-only",children:"Go to first page"}),a.jsx(n.kRt,{className:"size-4"})]}),(0,a.jsxs)(g.z,{variant:"outline",className:"size-8 p-0",onClick:()=>{console.log("itemsData.data?.pageInfo.hasPreviousPage",Y?.pageInfo.hasPreviousPage),eu({page:Y?.pageInfo.hasPreviousPage?E-1:void 0,search:Z??void 0})},disabled:!Y?.pageInfo.hasPreviousPage||B,children:[a.jsx("span",{className:"sr-only",children:"Go to previous page"}),a.jsx(n.wyc,{className:"size-4"})]}),(0,a.jsxs)(g.z,{variant:"outline",className:"size-8 p-0",onClick:()=>{eu({page:Y?.pageInfo.hasNextPage?E+1:void 0,search:Z??void 0})},disabled:!Y?.pageInfo.hasNextPage||B,children:[a.jsx("span",{className:"sr-only",children:"Go to next page"}),a.jsx(n.XCv,{className:"size-4"})]})]})})]})]})]})}var _=s(567),D=s(76557);let M=(0,D.Z)("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),{createElement:q,createContext:A,createRef:L,forwardRef:T,useCallback:$,useContext:F,useEffect:O,useImperativeHandle:G,useLayoutEffect:V,useMemo:J,useRef:B,useState:U}=l,W=l["useId".toString()],X=A(null);X.displayName="PanelGroupContext";let H="function"==typeof W?W:()=>null,Y=0;function K(e=null){let t=H(),s=B(e||t||null);return null===s.current&&(s.current=""+Y++),null!=e?e:s.current}function Q({children:e,className:t="",collapsedSize:s,collapsible:a,defaultSize:l,forwardedRef:n,id:r,maxSize:i,minSize:d,onCollapse:o,onExpand:c,onResize:u,order:m,style:x,tagName:h="div",...p}){let g=F(X);if(null===g)throw Error("Panel components must be rendered within a PanelGroup container");let{collapsePanel:f,expandPanel:j,getPanelSize:v,getPanelStyle:y,groupId:b,isPanelCollapsed:N,reevaluatePanelConstraints:w,registerPanel:k,resizePanel:C,unregisterPanel:z}=g,S=K(r),E=B({callbacks:{onCollapse:o,onExpand:c,onResize:u},constraints:{collapsedSize:s,collapsible:a,defaultSize:l,maxSize:i,minSize:d},id:S,idIsFromProps:void 0!==r,order:m});B({didLogMissingDefaultSizeWarning:!1}),G(n,()=>({collapse:()=>{f(E.current)},expand:()=>{j(E.current)},getId:()=>S,getSize:()=>v(E.current),isCollapsed:()=>N(E.current),isExpanded:()=>!N(E.current),resize:e=>{C(E.current,e)}}),[f,j,v,N,S,C]);let R=y(E.current,l);return q(h,{...p,children:e,className:t,style:{...R,...x},"data-panel":"","data-panel-id":S,"data-panel-group-id":b,"data-panel-collapsible":void 0,"data-panel-size":void 0})}let ee=T((e,t)=>q(Q,{...e,forwardedRef:t}));function et(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}function es(e,t,s=10){let a=(e=parseFloat(e.toFixed(s)))-(t=parseFloat(t.toFixed(s)));return 0===a?0:a>0?1:-1}function ea(e,t,s){return 0===es(e,t,s)}function el({panelConstraints:e,panelIndex:t,size:s}){let a=e[t];et(null!=a);let{collapsedSize:l=0,collapsible:n,maxSize:r=100,minSize:i=0}=a;return 0>es(s,i)&&(s=n&&0>es(s,(l+i)/2)?l:i),s=parseFloat((s=Math.min(r,s)).toFixed(10))}function en({delta:e,layout:t,panelConstraints:s,pivotIndices:a,trigger:l}){if(ea(e,0))return t;let n=[...t],[r,i]=a;et(null!=r),et(null!=i);let d=0;if("keyboard"===l){{let a=e<0?i:r,l=s[a];if(et(l),l.collapsible){let l=t[a];et(null!=l);let n=s[a];et(n);let{collapsedSize:r=0,minSize:i=0}=n;if(ea(l,r)){let t=i-l;es(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let a=e<0?r:i,l=s[a];et(l);let{collapsible:n}=l;if(n){let l=t[a];et(null!=l);let n=s[a];et(n);let{collapsedSize:r=0,minSize:i=0}=n;if(ea(l,i)){let t=l-r;es(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}}{let a=e<0?1:-1,l=e<0?i:r,n=0;for(;;){let e=t[l];if(et(null!=e),n+=el({panelConstraints:s,panelIndex:l,size:100})-e,(l+=a)<0||l>=s.length)break}let d=Math.min(Math.abs(e),Math.abs(n));e=e<0?0-d:d}{let a=e<0?r:i;for(;a>=0&&a<s.length;){let l=Math.abs(e)-Math.abs(d),r=t[a];et(null!=r);let i=el({panelConstraints:s,panelIndex:a,size:r-l});if(!ea(r,i)&&(d+=r-i,n[a]=i,d.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?a--:a++}}if(ea(d,0))return t;{let a=e<0?i:r,l=t[a];et(null!=l);let o=l+d,c=el({panelConstraints:s,panelIndex:a,size:o});if(n[a]=c,!ea(c,o)){let t=o-c,a=e<0?i:r;for(;a>=0&&a<s.length;){let l=n[a];et(null!=l);let r=el({panelConstraints:s,panelIndex:a,size:l+t});if(ea(l,r)||(t-=r-l,n[a]=r),ea(t,0))break;e>0?a--:a++}}}return ea(n.reduce((e,t)=>t+e,0),100)?n:t}function er(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function ei(e,t,s=document){let a=er(e,s).findIndex(e=>e.getAttribute("data-panel-resize-handle-id")===t);return null!=a?a:null}function ed(e,t,s){let a=ei(e,t,s);return null!=a?[a,a+1]:[-1,-1]}function eo(e,t=document){var s;return t instanceof HTMLElement&&(null==t?void 0:null===(s=t.dataset)||void 0===s?void 0:s.panelGroupId)==e?t:t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`)||null}function ec(e,t=document){return t.querySelector(`[data-panel-resize-handle-id="${e}"]`)||null}function eu(e){return"keydown"===e.type}function em(e){return e.type.startsWith("mouse")}function ex(e){return e.type.startsWith("touch")}function eh(e,t){let s="horizontal"===e;if(em(t))return s?t.clientX:t.clientY;if(ex(t)){let e=t.touches[0];return et(e),s?e.screenX:e.screenY}throw Error(`Unsupported event type "${t.type}"`)}function ep(e,t,s){t.forEach((t,a)=>{let l=e[a];et(l);let{callbacks:n,constraints:r,id:i}=l,{collapsedSize:d=0,collapsible:o}=r,c=s[i];if(null==c||t!==c){s[i]=t;let{onCollapse:e,onExpand:a,onResize:l}=n;l&&l(t,c),o&&(e||a)&&(a&&(null==c||c===d)&&t!==d&&a(),e&&(null==c||c!==d)&&t===d&&e())}})}function eg(e,t){if(e.length!==t.length)return!1;for(let s=0;s<e.length;s++)if(e[s]!=t[s])return!1;return!0}Q.displayName="Panel",ee.displayName="forwardRef(Panel)";let ef=null,ej=null;function ev(e){switch(e){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function ey(e){if(ef===e)return;ef=e;let t=ev(e);null===ej&&(ej=document.createElement("style"),document.head.appendChild(ej)),ej.innerHTML=`*{cursor: ${t}!important;}`}function eb(e){try{if("undefined"!=typeof localStorage)e.getItem=e=>localStorage.getItem(e),e.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function eN(e){return`react-resizable-panels:${e}`}function ew(e,t,s,a,l){var n;let r=eN(e),i=t.map(e=>{let{constraints:t,id:s,idIsFromProps:a,order:l}=e;return a?s:l?`${l}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(","),d=null!==(n=function(e,t){try{let s=eN(e),a=t.getItem(s);if(a){let e=JSON.parse(a);if("object"==typeof e&&null!=e)return e}}catch(e){}return null}(e,l))&&void 0!==n?n:{};d[i]={expandToSizes:Object.fromEntries(s.entries()),layout:a};try{l.setItem(r,JSON.stringify(d))}catch(e){console.error(e)}}let ek={getItem:e=>(eb(ek),ek.getItem(e)),setItem:(e,t)=>{eb(ek),ek.setItem(e,t)}},eC={};function ez({autoSaveId:e=null,children:t,className:s="",direction:a,forwardedRef:l,id:n=null,onLayout:r=null,keyboardResizeBy:i=null,storage:d=ek,style:o,tagName:c="div",...u}){let m=K(n),x=B(null),[h,p]=U(null),[g,f]=U([]),j=B({}),v=B(new Map),y=B(0),b=B({autoSaveId:e,direction:a,dragState:h,id:m,keyboardResizeBy:i,onLayout:r,storage:d}),N=B({layout:g,panelDataArray:[],panelDataArrayChanged:!1});B({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),G(l,()=>({getId:()=>b.current.id,getLayout:()=>{let{layout:e}=N.current;return e},setLayout:e=>{let{onLayout:t}=b.current,{layout:s,panelDataArray:a}=N.current,l=function({layout:e,panelConstraints:t}){let s=[...e],a=s.reduce((e,t)=>e+t,0);if(s.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${s.map(e=>`${e}%`).join(", ")}`);if(!ea(a,100))for(let e=0;e<t.length;e++){let t=s[e];et(null!=t);let l=100/a*t;s[e]=l}let l=0;for(let e=0;e<t.length;e++){let a=s[e];et(null!=a);let n=el({panelConstraints:t,panelIndex:e,size:a});a!=n&&(l+=a-n,s[e]=n)}if(!ea(l,0))for(let e=0;e<t.length;e++){let a=s[e];et(null!=a);let n=el({panelConstraints:t,panelIndex:e,size:a+l});if(a!==n&&(l-=n-a,s[e]=n,ea(l,0)))break}return s}({layout:e,panelConstraints:a.map(e=>e.constraints)});!function(e,t){if(e.length!==t.length)return!1;for(let s=0;s<e.length;s++)if(e[s]!==t[s])return!1;return!0}(s,l)&&(f(l),N.current.layout=l,t&&t(l),ep(a,l,j.current))}}),[]),function({committedValuesRef:e,eagerValuesRef:t,groupId:s,layout:a,panelDataArray:l,panelGroupElement:n,setLayout:r}){B({didWarnAboutMissingResizeHandle:!1}),O(()=>{if(!n)return;let e=t.current;et(e);let{panelDataArray:l}=e;et(null!=eo(s,n),`No group found for id "${s}"`);let i=er(s,n);et(i);let d=i.map(e=>{let t=e.getAttribute("data-panel-resize-handle-id");et(t);let[i,d]=function(e,t,s,a=document){var l,n,r,i;let d=ec(t,a),o=er(e,a),c=d?o.indexOf(d):-1;return[null!==(l=null===(n=s[c])||void 0===n?void 0:n.id)&&void 0!==l?l:null,null!==(r=null===(i=s[c+1])||void 0===i?void 0:i.id)&&void 0!==r?r:null]}(s,t,l,n);if(null==i||null==d)return()=>{};let o=e=>{if(!e.defaultPrevented&&"Enter"===e.key){e.preventDefault();let d=l.findIndex(e=>e.id===i);if(d>=0){let e=l[d];et(e);let i=a[d],{collapsedSize:o=0,collapsible:c,minSize:u=0}=e.constraints;if(null!=i&&c){let e=en({delta:ea(i,o)?u-o:o-i,layout:a,panelConstraints:l.map(e=>e.constraints),pivotIndices:ed(s,t,n),trigger:"keyboard"});a!==e&&r(e)}}}};return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}});return()=>{d.forEach(e=>e())}},[n,e,t,s,a,l,r])}({committedValuesRef:b,eagerValuesRef:N,groupId:m,layout:g,panelDataArray:N.current.panelDataArray,setLayout:f,panelGroupElement:x.current}),O(()=>{let{panelDataArray:t}=N.current;if(e){if(0===g.length||g.length!==t.length)return;let s=eC[e];null==s&&(s=function(e,t=10){let s=null;return(...a)=>{null!==s&&clearTimeout(s),s=setTimeout(()=>{e(...a)},t)}}(ew,100),eC[e]=s),s(e,[...t],new Map(v.current),g,d)}},[e,g,d]),O(()=>{});let w=$(e=>{let{onLayout:t}=b.current,{layout:s,panelDataArray:a}=N.current;if(e.constraints.collapsible){let l=a.map(e=>e.constraints),{collapsedSize:n=0,panelSize:r,pivotIndices:i}=eR(a,e,s);if(et(null!=r),r!==n){v.current.set(e.id,r);let d=en({delta:eE(a,e)===a.length-1?r-n:n-r,layout:s,panelConstraints:l,pivotIndices:i,trigger:"imperative-api"});eg(s,d)||(f(d),N.current.layout=d,t&&t(d),ep(a,d,j.current))}}},[]),k=$(e=>{let{onLayout:t}=b.current,{layout:s,panelDataArray:a}=N.current;if(e.constraints.collapsible){let l=a.map(e=>e.constraints),{collapsedSize:n=0,panelSize:r,minSize:i=0,pivotIndices:d}=eR(a,e,s);if(r===n){let n=v.current.get(e.id),o=null!=n&&n>=i?n:i,c=en({delta:eE(a,e)===a.length-1?r-o:o-r,layout:s,panelConstraints:l,pivotIndices:d,trigger:"imperative-api"});eg(s,c)||(f(c),N.current.layout=c,t&&t(c),ep(a,c,j.current))}}},[]),C=$(e=>{let{layout:t,panelDataArray:s}=N.current,{panelSize:a}=eR(s,e,t);return et(null!=a),a},[]),z=$((e,t)=>{let{panelDataArray:s}=N.current,a=eE(s,e);return function({defaultSize:e,dragState:t,layout:s,panelData:a,panelIndex:l,precision:n=3}){let r=s[l];return{flexBasis:0,flexGrow:null==r?null!=e?e:"1":1===a.length?"1":r.toPrecision(n),flexShrink:1,overflow:"hidden",pointerEvents:null!==t?"none":void 0}}({defaultSize:t,dragState:h,layout:g,panelData:s,panelIndex:a})},[h,g]),S=$(e=>{let{layout:t,panelDataArray:s}=N.current,{collapsedSize:a=0,collapsible:l,panelSize:n}=eR(s,e,t);return!0===l&&n===a},[]),E=$(e=>{let{layout:t,panelDataArray:s}=N.current,{collapsedSize:a=0,collapsible:l,panelSize:n}=eR(s,e,t);return et(null!=n),!l||n>a},[]),R=$(e=>{let{panelDataArray:t}=N.current;t.push(e),t.sort((e,t)=>{let s=e.order,a=t.order;return null==s&&null==a?0:null==s?-1:null==a?1:s-a}),N.current.panelDataArrayChanged=!0},[]),P=$(e=>function(t){t.preventDefault();let s=x.current;if(!s)return()=>null;let{direction:a,dragState:l,id:n,keyboardResizeBy:r,onLayout:i}=b.current,{layout:d,panelDataArray:o}=N.current,{initialLayout:c}=null!=l?l:{},u=ed(n,e,s),m=function(e,t,s,a,l,n){if(eu(e)){let t="horizontal"===s,a=0;a=e.shiftKey?100:null!=l?l:10;let n=0;switch(e.key){case"ArrowDown":n=t?0:a;break;case"ArrowLeft":n=t?-a:0;break;case"ArrowRight":n=t?a:0;break;case"ArrowUp":n=t?0:-a;break;case"End":n=100;break;case"Home":n=-100}return n}return null==a?0:function(e,t,s,a,l){let n="horizontal"===s,r=ec(t,l);et(r);let i=r.getAttribute("data-panel-group-id");et(i);let{initialCursorPosition:d}=a,o=eh(s,e),c=eo(i,l);et(c);let u=c.getBoundingClientRect();return(o-d)/(n?u.width:u.height)*100}(e,t,s,a,n)}(t,e,a,l,r,s);if(0===m)return;let h="horizontal"===a;"rtl"===document.dir&&h&&(m=-m);let p=en({delta:m,layout:null!=c?c:d,panelConstraints:o.map(e=>e.constraints),pivotIndices:u,trigger:eu(t)?"keyboard":"mouse-or-touch"}),g=!eg(d,p);(em(t)||ex(t))&&y.current!=m&&(y.current=m,g?ey(h?"horizontal":"vertical"):h?ey(m<0?"horizontal-min":"horizontal-max"):ey(m<0?"vertical-min":"vertical-max")),g&&(f(p),N.current.layout=p,i&&i(p),ep(o,p,j.current))},[]),I=$((e,t)=>{let{onLayout:s}=b.current,{layout:a,panelDataArray:l}=N.current,n=l.map(e=>e.constraints),{panelSize:r,pivotIndices:i}=eR(l,e,a);et(null!=r);let d=en({delta:eE(l,e)===l.length-1?r-t:t-r,layout:a,panelConstraints:n,pivotIndices:i,trigger:"imperative-api"});eg(a,d)||(f(d),N.current.layout=d,s&&s(d),ep(l,d,j.current))},[]),Z=$((e,t)=>{let{layout:s,panelDataArray:a}=N.current,{collapsedSize:l=0,collapsible:n}=t,{collapsedSize:r=0,collapsible:i,maxSize:d=100,minSize:o=0}=e.constraints,{panelSize:c}=eR(a,e,s);et(null!=c),n&&i&&c===l?l!==r&&I(e,r):c<o?I(e,o):c>d&&I(e,d)},[I]),_=$((e,t)=>{let{direction:s}=b.current,{layout:a}=N.current;if(!x.current)return;let l=ec(e,x.current);et(l);let n=eh(s,t);p({dragHandleId:e,dragHandleRect:l.getBoundingClientRect(),initialCursorPosition:n,initialLayout:a})},[]),D=$(()=>{null!==ej&&(document.head.removeChild(ej),ef=null,ej=null),p(null)},[]),M=$(e=>{let{panelDataArray:t}=N.current,s=eE(t,e);s>=0&&(t.splice(s,1),delete j.current[e.id],N.current.panelDataArrayChanged=!0)},[]),A=J(()=>({collapsePanel:w,direction:a,dragState:h,expandPanel:k,getPanelSize:C,getPanelStyle:z,groupId:m,isPanelCollapsed:S,isPanelExpanded:E,reevaluatePanelConstraints:Z,registerPanel:R,registerResizeHandle:P,resizePanel:I,startDragging:_,stopDragging:D,unregisterPanel:M,panelGroupElement:x.current}),[w,h,a,k,C,z,m,S,E,Z,R,P,I,_,D,M]);return q(X.Provider,{value:A},q(c,{...u,children:t,className:s,style:{display:"flex",flexDirection:"horizontal"===a?"row":"column",height:"100%",overflow:"hidden",width:"100%",...o},ref:x,"data-panel-group":"","data-panel-group-direction":a,"data-panel-group-id":m}))}let eS=T((e,t)=>q(ez,{...e,forwardedRef:t}));function eE(e,t){return e.findIndex(e=>e===t||e.id===t.id)}function eR(e,t,s){let a=eE(e,t),l=a===e.length-1,n=s[a];return{...t.constraints,panelSize:n,pivotIndices:l?[a-1,a]:[a,a+1]}}function eP({children:e=null,className:t="",disabled:s=!1,id:a,onDragging:l,style:n={},tabIndex:r=0,tagName:i="div",...d}){let o=B(null),c=B({onDragging:l});O(()=>{c.current.onDragging=l});let u=F(X);if(null===u)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");let{direction:m,dragState:x,groupId:h,registerResizeHandle:p,startDragging:g,stopDragging:f,panelGroupElement:j}=u,v=K(a),y=(null==x?void 0:x.dragHandleId)===v,[b,N]=U(!1),[w,k]=U(null),C=$(()=>{let e=o.current;et(e),e.blur(),f();let{onDragging:t}=c.current;t&&t(!1)},[f]);O(()=>{if(s)k(null);else{let e=p(v);k(()=>e)}},[s,v,p]),O(()=>{if(s||null==w||!y)return;let e=e=>{w(e)},t=e=>{w(e)},a=o.current;et(a);let l=a.ownerDocument;return l.body.addEventListener("contextmenu",C),l.body.addEventListener("mousemove",e),l.body.addEventListener("touchmove",e),l.body.addEventListener("mouseleave",t),window.addEventListener("mouseup",C),window.addEventListener("touchend",C),()=>{l.body.removeEventListener("contextmenu",C),l.body.removeEventListener("mousemove",e),l.body.removeEventListener("touchmove",e),l.body.removeEventListener("mouseleave",t),window.removeEventListener("mouseup",C),window.removeEventListener("touchend",C)}},[m,s,y,w,C]),function({disabled:e,handleId:t,resizeHandler:s,panelGroupElement:a}){O(()=>{if(e||null==s||null==a)return;let l=ec(t,a);if(null==l)return;let n=e=>{if(!e.defaultPrevented)switch(e.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":e.preventDefault(),s(e);break;case"F6":{e.preventDefault();let s=l.getAttribute("data-panel-group-id");et(s);let n=er(s,a),r=ei(s,t,a);et(null!==r);let i=e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0;n[i].focus()}}};return l.addEventListener("keydown",n),()=>{l.removeEventListener("keydown",n)}},[a,e,t,s])}({disabled:s,handleId:v,resizeHandler:w,panelGroupElement:j});let z={cursor:ev(m),touchAction:"none",userSelect:"none"};return q(i,{...d,children:e,className:t,onBlur:()=>N(!1),onFocus:()=>N(!0),onMouseDown:e=>{g(v,e.nativeEvent);let t=c.current;et(t);let{onDragging:s}=t;s&&s(!0)},onMouseUp:C,onTouchCancel:C,onTouchEnd:C,onTouchStart:e=>{g(v,e.nativeEvent);let t=c.current;et(t);let{onDragging:s}=t;s&&s(!0)},ref:o,role:"separator",style:{...z,...n},tabIndex:r,"data-panel-group-direction":m,"data-panel-group-id":h,"data-resize-handle":"","data-resize-handle-active":y?"pointer":b?"keyboard":void 0,"data-panel-resize-handle-enabled":!s,"data-panel-resize-handle-id":v})}ez.displayName="PanelGroup",eS.displayName="forwardRef(PanelGroup)",eP.displayName="PanelResizeHandle";let eI=({className:e,...t})=>a.jsx(eS,{className:(0,w.cn)("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),eZ=({withHandle:e,className:t,...s})=>a.jsx(eP,{className:(0,w.cn)("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...s,children:e&&a.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:a.jsx(M,{className:"size-2.5"})})});var e_=s(8281),eD=s(79210),eM=s(68232),eq=s(44389),eA=s(86333),eL=s(3240),eT=s(65983),e$=s(42924);let eF=(0,D.Z)("ArchiveX",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"m9.5 17 5-5",key:"nakeu6"}],["path",{d:"m9.5 12 5 5",key:"1hccrj"}]]);var eO=s(88378),eG=s(75909),eV=s(90434);let eJ=({index:e,folder:t,edit:s,indented:l,children:n})=>(0,a.jsxs)("div",{className:"flex flex-col ",children:[(0,a.jsxs)("div",{className:(0,w.cn)((0,g.d)({variant:t.variant,size:"sm"}),l?"pl-5":null,t.active?"dark:bg-muted dark:text-white dark:hover:bg-muted dark:hover:text-white":null,"justify-start"),children:[(0,a.jsxs)(eV.default,{className:"flex",href:t.href||"",children:[a.jsx(t.icon,{className:"mr-2 size-4"}),!t.icon&&t.label,null!==t.icon&&a.jsx("span",{className:(0,w.cn)("ml-0 overflow-hidden text-ellipsis max-w-[170px]","default"===t.variant&&"text-background dark:text-white"),children:t.label})]},e),s&&a.jsx(eq.Z,{onClick:()=>{s()},className:"ml-auto size-4 opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer"})]}),a.jsx("div",{children:n})]}),eB=({activeFolder:e,activeArchived:t,activeSettings:s})=>{let{data:l,loading:n,error:r}=(0,eG.t)();return a.jsx(a.Fragment,{children:(0,a.jsxs)("div",{className:"group flex flex-col gap-4 py-2 data-[collapsed=true]:py-2 pb-5",children:[e?a.jsx("div",{className:"flex items-center gap-2",children:a.jsx(g.z,{variant:"link",size:"sm",asChild:!0,children:(0,a.jsxs)(eV.default,{href:"/data",children:[a.jsx(eA.Z,{className:"size-4"}),a.jsx("span",{className:"ml-2",children:"Back to dashboard"})]})})}):a.jsx("div",{className:"flex items-center gap-2",children:a.jsx("span",{className:"text-sm text-muted-foreground ml-5 pt-3",children:"Select a context:"})}),a.jsx("nav",{className:"grid gap-1 px-2 group-[[data-collapsed=true]]:justify-center group-[[data-collapsed=true]]:px-2",children:n?a.jsx(eJ,{index:111,folder:{label:"Loading...",active:!1,icon:eL.Z,variant:"ghost"}}):l?.contexts?.items.map((l,n)=>a.jsx(eJ,{index:n,folder:{label:`${l.name}`,icon:eT.Z,variant:"ghost",href:`/data/${l.id}`},children:e?.toLowerCase()===`${l.id}`.toLowerCase()&&a.jsxs(a.Fragment,{children:[a.jsx(eJ,{index:n,indented:!0,folder:{label:"Active data",active:e?.toLowerCase()===`${l.id}`.toLowerCase()&&!t&&!s,icon:e$.Z,variant:e?.toLowerCase()!==`${l.id}`.toLowerCase()||t||s?"ghost":"default",href:`/data/${l.id}`}}),a.jsx(eJ,{index:n+1e3,indented:!0,folder:{label:"Archived data",active:t,icon:eF,variant:t?"default":"ghost",href:`/data/${l.id}/archived`}}),a.jsx(eJ,{index:n+1e3,indented:!0,folder:{label:"Settings",active:s,icon:eO.Z,variant:s?"default":"ghost",href:`/data/${l.id}/settings`}})]})},l.id))})]},e+t+s)})};function eU({children:e,params:t}){let s=t.query&&"archived"===t.query[1],l=t.query&&"settings"===t.query[1],n=t.query&&t.query[0],r=null;return t.query&&s?r=t.query[2]||null:t.query&&!l&&(r=t.query[1]||null),a.jsx(eM.pn,{delayDuration:0,children:(0,a.jsxs)(eI,{direction:"horizontal",onLayout:e=>{document.cookie=`react-resizable-panels:layout=${JSON.stringify(e)}`},className:"h-full items-stretch",children:[(0,a.jsxs)(ee,{defaultSize:15,collapsedSize:4,collapsible:!0,minSize:15,maxSize:20,children:[a.jsx(e_.Z,{}),a.jsx(eB,{activeFolder:n,activeArchived:s,activeSettings:l}),a.jsx(e_.Z,{}),a.jsx("div",{className:"p-3 opacity-50",children:(0,a.jsxs)(z.bZ,{variant:"default",children:[a.jsx(_.C,{className:"mb-2",variant:"secondary",children:"coming soon"}),a.jsx(z.Cd,{children:"Custom views"}),a.jsx(z.X,{children:"Will enable you to store filter settings."})]})})]}),n&&!l&&(0,a.jsxs)(a.Fragment,{children:[a.jsx(eZ,{withHandle:!0}),a.jsx(ee,{defaultSize:20,minSize:20,children:(0,a.jsxs)(eD.mQ,{defaultValue:"all",children:[a.jsx("div",{className:"flex items-center px-4 py-2 h-full",children:a.jsx("h1",{className:"text-xl font-bold",children:"Items"})}),a.jsx(e_.Z,{}),a.jsx(Z,{activeFolder:n,activeItem:r??void 0,archived:s})]})})]}),a.jsx(eZ,{withHandle:!0}),a.jsx(ee,{defaultSize:65,children:a.jsx("div",{className:"max-h-full overflow-y-auto",children:e})})]})})}},26533:(e,t,s)=>{"use strict";s.a(e,async(e,a)=>{try{s.r(t),s.d(t,{default:()=>h});var l=s(10326),n=s(65063);s(17577);var r=s(69771),i=s(53951),d=s(39167),o=s(42270),c=s(43273),u=s(65304),m=s(76812),x=e([n]);function h({params:e}){let{data:t,loading:s,error:a}=(0,d.aM)(o.fV,{skip:!e?.query?.[0],variables:{id:e?.query?.[0]}});if(!e.query)return l.jsx("div",{className:"grow flex flex-col",children:l.jsx(r.Z,{})});let x=e.query[0]||null,h="archived"===e.query[1],p="settings"===e.query[1];if(p)return l.jsx(i.c,{expand:!0,actions:!0,context:x});let g=null;return(h?g=e.query[2]||null:p||(g=e.query[1]||null),s||!t?.contextById)?(0,l.jsxs)("div",{className:"p-8 text-center text-muted-foreground",children:[l.jsx(u.O,{className:"w-full h-[80px] rounded-md"}),l.jsx(u.O,{className:"w-full h-[50px] rounded-md mt-3"}),l.jsx(u.O,{className:"w-full h-[80px] rounded-md mt-3"}),l.jsx(u.O,{className:"w-full h-[80px] rounded-md mt-3"}),l.jsx(u.O,{className:"w-full h-[80px] rounded-md mt-3"}),l.jsx(u.O,{className:"w-full h-[80px] rounded-md mt-3"})]}):a?(0,l.jsxs)(c.bZ,{variant:"destructive",children:[l.jsx(m.LPM,{className:"size-4"}),l.jsx(c.Cd,{children:"Error"}),l.jsx(c.X,{children:a?.message||"Error loading item."})]}):l.jsx(n.H,{actions:!0,context:t?.contextById,itemId:g})}n=(x.then?(await x)():x)[0],a()}catch(e){a(e)}})},53951:(e,t,s)=>{"use strict";s.d(t,{c:()=>z});var a=s(10326),l=s(39167),n=s(18753),r=s(86333),i=s(231),d=s(35047),o=s(17577),c=s(567),u=s(90772),m=s(33071),x=s(8281),h=s(65685),p=s(32663),g=s(90434),f=s(65304),j=s(29718),v=s(42270);function y({contextId:e}){let t=(0,o.useRef)(new Date(Date.now()-18144e5).toISOString()),{loading:s,data:n,refetch:r,previousData:i,error:d}=(0,l.aM)((0,v.P3)(e,[]),{fetchPolicy:"no-cache",nextFetchPolicy:"network-only",variables:{context:e,page:1,limit:5,filters:[{embeddings_updated_at:{gte:t.current}}],sort:{field:"embeddings_updated_at",direction:"DESC"}}}),c=n?.[e+v.Md];return s?(0,a.jsxs)("div",{className:"flex flex-col gap-2 pt-0",children:[a.jsx(f.O,{className:"w-full h-[50px] rounded-lg mb-2"}),a.jsx(f.O,{className:"w-full h-[50px] rounded-lg mb-2"}),a.jsx(f.O,{className:"w-full h-[50px] rounded-lg"})]}):a.jsx("div",{className:"space-y-8",children:c?.items?.length?c?.items?.map((t,s)=>a.jsx("div",{className:"flex items-center",children:a.jsx("div",{className:"space-y-1",children:a.jsx("p",{className:"text-sm font-medium leading-none",children:a.jsxs(g.default,{className:"hover:dark:text-blue-500 hover:underline",href:"/data/"+e+"/"+t.id,children:[a.jsx(j.L,{text:t.name??"",length:50}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:["created at: ",t.embeddings_updated_at?p.Q(new Date(t.embeddings_updated_at),{addSuffix:!0}):"never","."]})]})})})},s)):a.jsx("div",{className:"flex flex-col gap-2 pt-0",children:a.jsx("p",{className:"text-sm font-medium leading-none",children:"No recent embeddings."})})})}var b=s(43273),N=s(76812),w=s(60097),k=s(99440),C=s(34789);function z(e){let[t,s]=(0,o.useState)(null),{toast:p}=(0,C.pm)(),{data:g,loading:j,error:z}=(0,l.aM)(v.fV,{variables:{id:e.context}}),S=g?.contextById,E=(0,d.useRouter)(),[R,P]=(0,n.D)((0,v.Eq)(e.context),{onCompleted:t=>{let s=t[e.context+"_itemsGenerateChunks"];if(s.jobs?.length>0){p({title:"Chunks generation started",description:"Jobs have been started in the background, depending on the size of the item this may take a while."});return}p({title:"Chunks generated",description:"Chunks generated successfully."})}}),[I,Z]=(0,n.D)((0,v.ps)(e.context),{onCompleted:t=>{let s=t[e.context+"_itemsDeleteChunks"];if(s.jobs?.length>0){p({title:"Chunks deletion started",description:"Jobs have been started in the background, depending on the size of the item this may take a while."});return}p({title:"Chunks deleted",description:"Chunks deleted successfully."})}});return j?(0,a.jsxs)("div",{className:"p-8 text-center text-muted-foreground",children:[a.jsx(f.O,{className:"w-full h-[80px] rounded-md"}),a.jsx(f.O,{className:"w-full h-[50px] rounded-md mt-3"}),a.jsx(f.O,{className:"w-full h-[80px] rounded-md mt-3"}),a.jsx(f.O,{className:"w-full h-[80px] rounded-md mt-3"}),a.jsx(f.O,{className:"w-full h-[80px] rounded-md mt-3"}),a.jsx(f.O,{className:"w-full h-[80px] rounded-md mt-3"})]}):z?(0,a.jsxs)(b.bZ,{variant:"destructive",children:[a.jsx(N.LPM,{className:"size-4"}),a.jsx(b.Cd,{children:"Error"}),a.jsx(b.X,{children:z?.message||"Error loading item."})]}):(0,a.jsxs)("div",{className:"flex h-full flex-col",children:[e.actions?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex p-2 justify-between",children:[a.jsx("div",{className:"flex items-center gap-2"}),(0,a.jsxs)(u.z,{onClick:()=>{E.push("/context")},variant:"ghost",size:"icon",children:[a.jsx(r.Z,{className:"size-4"}),a.jsx("span",{className:"sr-only",children:"Back"})]})]}),a.jsx(x.Z,{})]}):null,S?(0,a.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,a.jsxs)(m.Zb,{className:"border-0 rounded-none",children:[a.jsx(m.Ol,{children:a.jsx(m.ll,{className:"text-lg",children:"Settings"})}),a.jsx(m.aY,{className:"grid gap-4",children:a.jsx(h.x,{className:"max-h-[600px]",children:(0,a.jsxs)("div",{className:"space-y-6 pr-4",children:[(0,a.jsxs)("div",{children:[a.jsx("h2",{className:"text-xl font-bold",children:S.name}),a.jsx("p",{className:"text-muted-foreground mt-1",children:S.description}),(0,a.jsxs)("div",{className:"mt-3 flex items-center",children:[a.jsx("span",{className:"text-sm font-medium mr-2",children:"Embedder:"}),a.jsx(c.C,{variant:"outline",children:S.embedder||"None"})]})]}),(0,a.jsxs)("div",{children:[a.jsx("span",{className:"text-sm font-medium mr-2",children:"Calculate Vectors:"}),a.jsx(c.C,{variant:"secondary",children:S.configuration?.calculateVectors?S.configuration.calculateVectors.charAt(0).toUpperCase()+S.configuration.calculateVectors.slice(1):"Manual"}),(0,a.jsxs)("div",{className:"mt-2 text-xs text-muted-foreground",children:[(0,a.jsxs)("span",{className:"block",children:[a.jsx("b",{children:"Manual"}),": Vectors are only calculated when triggered manually."]}),(0,a.jsxs)("span",{className:"block",children:[a.jsx("b",{children:"On Update"}),": Vectors are recalculated whenever an item is updated."]}),(0,a.jsxs)("span",{className:"block",children:[a.jsx("b",{children:"On Insert"}),": Vectors are calculated when a new item is inserted."]}),(0,a.jsxs)("span",{className:"block",children:[a.jsx("b",{children:"Always"}),": Vectors are calculated on both insert and update operations."]})]})]}),(0,a.jsxs)("div",{children:[a.jsx("span",{className:"text-sm font-medium mr-2",children:"Default rights mode for new items in this context:"}),(0,a.jsxs)("div",{className:"mt-2 text-xs text-muted-foreground",children:[(0,a.jsxs)("span",{className:"block",children:[a.jsx("b",{children:"Private"}),": Only the user who created the item can view it."]}),(0,a.jsxs)("span",{className:"block",children:[a.jsx("b",{children:"Users"}),": Any user with access to the context can view the item."]}),(0,a.jsxs)("span",{className:"block",children:[a.jsx("b",{children:"Roles"}),": Any user with the role assigned to the context can view the item."]}),(0,a.jsxs)("span",{className:"block",children:[a.jsx("b",{children:"Public"}),": Any user can view the item."]})]})]}),a.jsx(x.Z,{})]})})})]}),(0,a.jsxs)(m.Zb,{className:"bg-none border-0 rounded-none",children:[a.jsx(m.Ol,{children:a.jsx(m.ll,{children:(0,a.jsxs)("div",{className:"flex items-center justify-between ml-4 mt-3 mr-4 mb-2",children:[a.jsx("h1",{className:"text-lg font-medium",children:"Embeddings"}),(0,a.jsxs)(w.h_,{children:[a.jsx(w.$F,{asChild:!0,children:(0,a.jsxs)(u.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:[a.jsx(i.Z,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Open menu"})]})}),(0,a.jsxs)(w.AW,{align:"end",children:[a.jsx(w.Xi,{onClick:()=>s("generate"),children:"Generate all embeddings"}),a.jsx(w.Xi,{onClick:()=>s("delete"),children:"Delete all embeddings"})]})]})]})})}),a.jsx(m.aY,{children:a.jsx(y,{contextId:S.id})})]})]}):a.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Context not found."}),a.jsx(k.aR,{open:"generate"===t,onOpenChange:e=>!e&&s(null),children:(0,a.jsxs)(k._T,{children:[(0,a.jsxs)(k.fY,{children:[a.jsx(k.f$,{children:"Generate Embeddings"}),a.jsx(k.yT,{children:"Are you sure you want to generate embeddings for this context? This will create new embedding vectors for every item in the context, this can take a long time, might cost money if you are using a paid service as your embedder, or require a lot of computational resources if your embedder is self hosted."})]}),(0,a.jsxs)(k.xo,{children:[a.jsx(k.le,{children:"Cancel"}),a.jsx(k.OL,{disabled:P.loading,onClick:()=>{s(null),R(),p({title:"Generating embeddings...",description:"Embeddings are being generated in the background, depending on the size of the item this may take a while."})},children:"Generate"})]})]})}),a.jsx(k.aR,{open:"delete"===t,onOpenChange:e=>!e&&s(null),children:(0,a.jsxs)(k._T,{children:[(0,a.jsxs)(k.fY,{children:[a.jsx(k.f$,{children:"Delete Embeddings"}),a.jsx(k.yT,{children:"Are you sure you want to delete all embeddings for this context? This action cannot be undone. Embeddings are used to search and filter items, deleting them will remove this functionality from the context, regenerating embeddings might take a long time, might cost money if you are using a paid service as your embedder, or require a lot of computational resources if your embedder is self hosted."})]}),(0,a.jsxs)(k.xo,{children:[a.jsx(k.le,{children:"Cancel"}),a.jsx(k.OL,{disabled:Z.loading,onClick:async()=>{s(null),I(),p({title:"Embeddings deleted",description:"All embeddings for this item have been deleted."})},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})}},69771:(e,t,s)=>{"use strict";s.d(t,{Z:()=>c});var a=s(10326),l=s(33519),n=s(17577),r=s(31051),i=s(42193),d=s(16923),o=s(22746);function c(){let[e,t]=(0,n.useState)("count"),[s,c]=(0,n.useState)({from:(0,l.k)(new Date,7),to:new Date}),[u,m]=(0,n.useState)("EMBEDDER_GENERATE"),[x,h]=(0,n.useState)("label");return(0,a.jsxs)("div",{className:"flex-1 flex flex-col p-8 pt-6 h-screen",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-8",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[a.jsx("h2",{className:"text-4xl font-bold tracking-tight bg-clip-text",children:"Contexts Dashboard"}),a.jsx("p",{className:"text-lg",children:"Monitor your contexts and their usage."})]}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsx(i.z,{dateRange:s,onDateRangeChange:c,maxDays:30})})]}),(0,a.jsxs)("div",{className:"flex-1 grid gap-6 md:grid-cols-3 min-h-0",children:[a.jsx("div",{className:"rounded-lg border md:col-span-2 p-6 flex flex-col",children:a.jsx(d.q,{dateRange:s,selectedType:u,onTypeChange:m,onUnitChange:t,unit:e,dataTypes:[r.h.CONTEXT_RETRIEVE,r.h.EMBEDDER_UPSERT,r.h.EMBEDDER_GENERATE,r.h.EMBEDDER_DELETE,r.h.CONTEXT_UPSERT]})}),a.jsx("div",{className:"rounded-lg border p-6 flex flex-col",children:a.jsx(o.Y,{groupByOptions:[],dateRange:s,selectedType:u,groupBy:x,onGroupByChange:h})})]})]})}},65063:(e,t,s)=>{"use strict";s.a(e,async(e,a)=>{try{s.d(t,{H:()=>X});var l=s(10326),n=s(39167),r=s(18753),i=s(74064),d=s(23015),o=s(98091),c=s(40900),u=s(35157),m=s(31215),x=s(69508),h=s(91470),p=s(24081),g=s(21986),f=s(47206),j=s(231),v=s(35047),y=s(17577),b=s(74723),N=s(770),w=s(57004),k=s(18615),C=s(567),z=s(90772),S=s(55632),E=s(54432),R=s(37859),P=s(8281),I=s(33261),Z=s(15940),_=s(87673),D=s(68232),M=s(62288),q=s(60097),A=s(99440),L=s(34789),T=s(77863),$=s(65304),F=s(43273),O=s(76812),G=s(42270),V=s(15286),J=s(24295),B=s(33071),U=s(77961),W=e([w]);function X(e){let[t,s]=(0,y.useState)(),{toast:a}=(0,L.pm)(),W=(0,v.useRouter)(),[X,H]=(0,y.useState)(),Y=e.context,K=e.context.fields.map(e=>e.name);console.log("fields",K),console.log("context",Y);let{loading:Q,error:ee,refetch:et}=(0,n.aM)((0,G.A1)(e.context.id,K,!0),{skip:!e.itemId||!e.context?.id,variables:{context:e.context.id,id:e.itemId},fetchPolicy:"no-cache",nextFetchPolicy:"network-only",onCompleted:t=>{let a=t[e.context.id+"_itemsById"];s({...a,tags:a.tags?a.tags.split(","):[]}),H({rights_mode:a.rights_mode,users:a.RBAC?.users,roles:a.RBAC?.roles,projects:a.RBAC?.projects})}}),[es,ea]=(0,r.D)((0,G.ty)(e.context.id),{onCompleted:()=>{a({title:"Item updated",description:"Item updated successfully."})},onError:e=>{a({title:"Error updating item",description:e.message})}}),[el,en]=(0,r.D)((0,G.mN)(e.context.id,[]),{onCompleted:()=>{a({title:"Item deleted",description:"Item deleted successfully."})},onError:e=>{a({title:"Error deleting item",description:e.message})}}),[er,ei]=(0,r.D)((0,G.Eq)(e.context.id),{onCompleted:t=>{let s=t[e.context.id+"_itemsGenerateChunks"];if(s.jobs?.length>0){a({title:"Chunks generation started",description:"Jobs have been started in the background, depending on the size of the item this may take a while."});return}a({title:"Chunks generated",description:"Chunks generated successfully."})}}),[ed,eo]=(0,r.D)((0,G.ps)(e.context.id),{onCompleted:t=>{let s=t[e.context.id+"_itemsDeleteChunks"];if(s.jobs?.length>0){a({title:"Chunks deletion started",description:"Jobs have been started in the background, depending on the size of the item this may take a while."});return}a({title:"Chunks deleted",description:"Chunks deleted successfully."})}}),[ec,eu]=(0,r.D)((0,G.dc)(e.context.id),{onCompleted:()=>{a({title:"Field processed",description:"Field processed successfully."})},onError:e=>{a({title:"Error processing field",description:e.message})}}),em=N.Ry({name:N.Z_().nullable().optional(),tags:N.Z_().nullable().optional(),external_id:N.Z_().nullable().optional(),description:N.Z_().min(2,{message:"Text must be at least 2 characters."}).max(1e4,{message:"Text must not be longer than 10.0000 characters."}),...Y?.fields?.reduce((e,t)=>({...e,[t.name]:N.Z_().nullable()}),{})??{}}),ex=(0,b.cI)({resolver:(0,i.F)(em),defaultValues:{description:t?.description},mode:"onChange"}),eh=e=>{if(e.target.value&&"Enter"===e.key){let a=t?.tags??[],l=[...Array.isArray(a)?[...a]:[]];l.push(e.target.value),console.log("tags",l),ex.setValue("tags",l.join(",")),s({...t,tags:l}),e.target.value=""}},[ep,eg]=(0,y.useState)(!1),[ef,ej]=(0,y.useState)(null),[ev,ey]=(0,y.useState)(null);return Q?(0,l.jsxs)("div",{className:"p-8 text-center text-muted-foreground",children:[l.jsx($.O,{className:"w-full h-[80px] rounded-md"}),l.jsx($.O,{className:"w-full h-[50px] rounded-md mt-3"}),l.jsx($.O,{className:"w-full h-[80px] rounded-md mt-3"}),l.jsx($.O,{className:"w-full h-[80px] rounded-md mt-3"}),l.jsx($.O,{className:"w-full h-[80px] rounded-md mt-3"}),l.jsx($.O,{className:"w-full h-[80px] rounded-md mt-3"})]}):ee?(0,l.jsxs)(F.bZ,{variant:"destructive",children:[l.jsx(O.LPM,{className:"size-4"}),l.jsx(F.Cd,{children:"Error"}),l.jsx(F.X,{children:ee?.message||"Error loading item."})]}):(0,l.jsxs)("div",{className:"flex h-full flex-col",children:[t?(0,l.jsxs)(l.Fragment,{children:[e.actions?(0,l.jsxs)(l.Fragment,{children:[l.jsx("div",{className:"flex items-center p-2",children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[t?.archived?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(D.u,{children:[l.jsx(D.aJ,{asChild:!0,children:(0,l.jsxs)(z.z,{onClick:async()=>{t.id&&(es({variables:{id:t.id,input:{archived:!1}}}),s({...t,archived:!1}),W.push("./"))},variant:"ghost",size:"icon",disabled:!t||ea.loading,children:[ea.loading?l.jsx(R.g,{}):l.jsx(d.Z,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Unarchive"})]})}),l.jsx(D._v,{children:"Unarchive"})]}),(0,l.jsxs)(D.u,{children:[l.jsx(D.aJ,{asChild:!0,children:(0,l.jsxs)(z.z,{onClick:async()=>{t.id&&(el({variables:{id:t.id}}),W.push("./"))},variant:"ghost",size:"icon",disabled:!t||en.loading,children:[en.loading?l.jsx(R.g,{}):l.jsx(o.Z,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Delete"})]})}),l.jsx(D._v,{children:"Delete"})]})]}):(0,l.jsxs)(D.u,{children:[l.jsx(D.aJ,{asChild:!0,children:(0,l.jsxs)(z.z,{onClick:async()=>{t?.id&&(es({variables:{id:t.id,input:{archived:!0}}}),s({...t,archived:!0}),W.push("./"))},variant:"ghost",size:"icon",disabled:!t||ea.loading,children:[ea.loading?l.jsx(R.g,{}):l.jsx(c.Z,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Archive"})]})}),l.jsx(D._v,{children:"Archive"})]}),ep?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(D.u,{children:[l.jsx(D.aJ,{asChild:!0,children:(0,l.jsxs)(z.z,{onClick:()=>{eg(!1)},variant:"ghost",size:"icon",children:[l.jsx(u.Z,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Cancel"})]})}),l.jsx(D._v,{children:"Cancel"})]}),(0,l.jsxs)(D.u,{children:[l.jsx(D.aJ,{asChild:!0,children:(0,l.jsxs)(z.z,{disabled:ea.loading,onClick:()=>{t?.id&&(es({variables:{id:t.id,input:{textlength:t?.text?.length,description:t?.description,name:t?.name,externalId:t?.externalId,tags:t?.tags?.join(","),source:t?.source,archived:t?.archived,rights_mode:X?.rights_mode,RBAC:{users:X?.users||[],roles:X?.roles||[],projects:X?.projects||[]},...Y?.fields?.reduce((e,s)=>({...e,[s.name]:t?.[s.name]}),{})??{}}}}),eg(!1))},variant:"ghost",size:"icon",children:[l.jsx(m.Z,{className:"size-4"}),(0,l.jsxs)("span",{className:"sr-only",children:["Save ",ea.loading??l.jsx(R.g,{})]})]})}),l.jsx(D._v,{children:"Save"})]})]}):(0,l.jsxs)(D.u,{children:[l.jsx(D.aJ,{asChild:!0,children:(0,l.jsxs)(z.z,{onClick:()=>{eg(!0)},variant:"ghost",size:"icon",disabled:!t||ea.loading,children:[l.jsx(x.Z,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Edit"})]})}),l.jsx(D._v,{children:"Edit"})]})]})}),l.jsx(P.Z,{})]}):null,l.jsx("div",{className:"flex flex-1 flex-col",children:(0,l.jsxs)("div",{className:(0,T.cn)("space-y-2"),children:[l.jsx("div",{className:"flex items-center justify-between space-x-4 px-4 bg-muted rounded",children:l.jsx("h3",{className:"text-lg p-5 font-semibold tracking-tight text-lg",children:"Fields"})}),(0,l.jsxs)("div",{className:"p-5",children:[l.jsx(S.l0,{...ex,children:l.jsx("form",{className:"space-y-8",children:(0,l.jsxs)("div",{children:[(0,l.jsxs)(Z.iA,{children:[l.jsx(Z.xD,{children:(0,l.jsxs)(Z.SC,{children:[l.jsx(Z.ss,{children:"Name"}),l.jsx(Z.ss,{children:"Value"})]})}),(0,l.jsxs)(Z.RM,{children:[(0,l.jsxs)(Z.SC,{children:[l.jsx(Z.pj,{className:"font-medium capitalize",children:"Name"}),l.jsx(Z.pj,{children:l.jsx(S.Wi,{control:ex.control,name:"name",render:({field:e})=>l.jsx(S.xJ,{children:ep?(0,l.jsxs)(l.Fragment,{children:[l.jsx(S.NI,{children:l.jsx(E.I,{type:"text",disabled:!ep,onChange:e=>{s({...t,name:e.target.value})},placeholder:"Item name",value:t.name??""})}),l.jsx(S.zG,{})]}):l.jsx("div",{onClick:async()=>{await navigator.clipboard.writeText(t.name??""),a({title:"Copied to clipboard"})},className:"flex-1 whitespace-pre-wrap text-sm cursor-copy",children:t.name&&t.name?.length>200?t.name?.slice(0,200)+"...":t.name})})})})]},"name"),(0,l.jsxs)(Z.SC,{children:[l.jsx(Z.pj,{className:"font-medium capitalize",children:"Tags"}),(0,l.jsxs)(Z.pj,{children:[ep?l.jsx("div",{className:"grid-row grid grid-flow-col gap-4 pt-2",children:l.jsx(S.Wi,{control:ex.control,name:"tags",render:({field:e})=>(0,l.jsxs)(S.xJ,{children:[l.jsx(S.NI,{children:l.jsx(E.I,{id:"includes",type:"text",onKeyUp:e=>eh(e),placeholder:"Type and press enter to add"})}),l.jsx(S.zG,{})]})})}):null,t?.tags?.length?l.jsx("div",{className:"gap-2 pt-2",children:t?.tags?.map((e,a)=>l.jsx(C.C,{variant:"secondary",className:"px-3 py-2 mr-2 mb-2",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"text-muted-foreground truncate max-w-[200px]",children:e}),ep?l.jsx("span",{className:"size-4 cursor-pointer text-muted-foreground",onClick:()=>{let e=[...t.tags??[]];e.splice(a,1),ex.setValue("tags",e.join(",")),s({...t,tags:e})},children:l.jsx(h.Z,{className:"ml-1",size:15})}):null]})},`tag-${a}`))}):null]})]},"tags"),(0,l.jsxs)(Z.SC,{children:[l.jsx(Z.pj,{className:"font-medium capitalize",children:"Description"}),l.jsx(Z.pj,{children:l.jsx(S.Wi,{control:ex.control,name:"description",render:({field:e})=>l.jsx(S.xJ,{children:ep?(0,l.jsxs)(l.Fragment,{children:[l.jsx(S.NI,{children:(0,l.jsxs)("div",{className:"relative",children:[l.jsx(_.g,{autoFocus:!0,disabled:!ep,onChange:e=>{s({...t,description:e.target.value})},placeholder:"Item text content",className:"resize-none",value:t.description??""}),(0,l.jsxs)(M.Vq,{children:[l.jsx(M.hg,{asChild:!0,children:(0,l.jsxs)(z.z,{type:"button",variant:"ghost",size:"sm",className:"absolute top-2 right-2 h-6 w-6 p-0",onClick:()=>ej({name:"description",value:t.description??"",disabled:!1}),children:[l.jsx(p.Z,{className:"h-3 w-3"}),l.jsx("span",{className:"sr-only",children:"Expand"})]})}),(0,l.jsxs)(M.cZ,{className:"max-w-4xl max-h-[80vh]",children:[l.jsx(M.fK,{children:l.jsx(M.$N,{children:"Edit Description"})}),l.jsx("div",{className:"mt-4",children:l.jsx(_.g,{rows:20,className:"min-h-[400px] resize-none",value:ef?.name==="description"?ef.value:t.description??"",onChange:e=>{let a=e.target.value;ej(e=>e?.name==="description"?{...e,value:a}:e),s({...t,description:a})}})})]})]})]})}),l.jsx(S.zG,{})]}):l.jsx("div",{onClick:async()=>{await navigator.clipboard.writeText(t.description??""),a({title:"Copied to clipboard"})},className:"flex-1 whitespace-pre-wrap text-sm cursor-copy",children:l.jsx(k.J,{text:t.description??""})})})})})]},19091),(0,l.jsxs)(Z.SC,{children:[l.jsx(Z.pj,{className:"font-medium capitalize",children:"External ID"}),l.jsx(Z.pj,{children:l.jsx(S.Wi,{control:ex.control,name:"external_id",render:({field:e})=>l.jsx(S.xJ,{children:ep?(0,l.jsxs)(l.Fragment,{children:[l.jsx(S.NI,{children:l.jsx(E.I,{type:"text",disabled:!ep,onChange:e=>{console.log("e",e),s({...t,external_id:e.target.value})},placeholder:"xxxx-xxxx-xxxx-xxxx",value:t.external_id??""})}),l.jsx(S.zG,{})]}):l.jsx("div",{onClick:async()=>{await navigator.clipboard.writeText(t.external_id??""),a({title:"Copied to clipboard"})},className:"flex-1 whitespace-pre-wrap text-sm cursor-copy",children:t.external_id??""})})})})]},"externalId"),Y?.fields?.length&&Y.fields.map((e,n)=>(0,l.jsxs)(Z.SC,{children:[(0,l.jsxs)(Z.pj,{className:"font-medium capitalize flex flex-col",children:[e.label,e.calculated&&l.jsx("span",{className:"text-sm text-muted-foreground",children:"Calculated"}),e.processor&&(0,l.jsxs)(D.u,{children:[l.jsx(D.aJ,{asChild:!0,children:(0,l.jsxs)(z.z,{variant:"secondary",size:"sm",className:"w-auto mt-2",onClick:()=>{ec({variables:{item:t?.id,field:e.name}})},disabled:eu.loading,children:[eu.loading?l.jsx(R.g,{}):l.jsx(g.Z,{className:"size-4"}),l.jsx("span",{className:"ml-2",children:"Process"})]})}),l.jsx(D._v,{className:"max-w-xs",children:e.processor.description})]})]}),ep?l.jsx(l.Fragment,{children:(0,l.jsxs)(Z.pj,{children:["code"===e.type||"json"===e.type||"text"===e.type||"longText"===e.type||"markdown"===e.type||"shortText"===e.type?l.jsx(S.Wi,{control:ex.control,name:e.name,render:({field:a})=>(0,l.jsxs)(S.xJ,{children:[l.jsx(S.NI,{children:(0,l.jsxs)("div",{className:"relative",children:[l.jsx(_.g,{id:e.name,rows:"shortText"===e.type?2:7,onChange:a=>{s({...t,[e.name]:a.target.value})},value:t[e.name]??""}),(0,l.jsxs)(M.Vq,{children:[l.jsx(M.hg,{asChild:!0,children:(0,l.jsxs)(z.z,{type:"button",variant:"ghost",size:"sm",className:"absolute top-2 right-2 h-6 w-6 p-0",onClick:()=>ej({name:e.name,disabled:!1,value:t[e.name]??""}),children:[l.jsx(p.Z,{className:"h-3 w-3"}),l.jsx("span",{className:"sr-only",children:"Expand"})]})}),(0,l.jsxs)(M.cZ,{className:"max-w-4xl max-h-[80vh]",children:[l.jsx(M.fK,{children:(0,l.jsxs)(M.$N,{children:["Edit ",e.name]})}),l.jsx("div",{className:"mt-4",children:l.jsx(_.g,{rows:20,className:"min-h-[400px] resize-none",value:ef?.name===e.name?ef.value:t[e.name]??"",onChange:a=>{let l=a.target.value;ej(t=>t?.name===e.name?{...t,value:l}:t),s({...t,[e.name]:l})}})})]})]})]})}),l.jsx(S.zG,{})]})}):null,"number"===e.type?l.jsx(S.Wi,{control:ex.control,name:e.name,render:({field:a})=>(0,l.jsxs)(S.xJ,{children:[l.jsx(S.NI,{children:l.jsx(E.I,{id:e.name,type:"number",onChange:a=>{s({...t,[e.name]:a.target.value})},value:t[e.name]??""})}),l.jsx(S.zG,{})]})}):null,"boolean"===e.type?l.jsx(S.Wi,{control:ex.control,name:e.name,render:({field:a})=>(0,l.jsxs)(S.xJ,{children:[l.jsx(S.NI,{children:l.jsx(I.r,{checked:!!a.value,onCheckedChange:a=>{s({...t,[e.name]:a})}})}),l.jsx(S.zG,{})]})}):null,"file"===e.type&&l.jsx("div",{children:l.jsx(U.jF,{s3key:t[e.name],children:l.jsx(U.ZP,{id:`item-${t.id}`,buttonText:"Select File",allowedFileTypes:e.allowedFileTypes,dependencies:[],selectionLimit:1,onConfirm:a=>{console.log("keys",a),s({...t,[e.name]:a[0]})}})})})]})}):l.jsx(Z.pj,{children:(0,l.jsxs)("span",{children:["code"===e.type&&l.jsx(w.G,{code:t[e.name]}),"json"===e.type&&l.jsx(w.G,{code:t[e.name]}),"shortText"===e.type&&l.jsx("p",{className:"cursor-copy",onClick:async()=>{await navigator.clipboard.writeText(t[e.name]),a({title:"Copied to clipboard"})},children:t[e.name]}),"longText"===e.type&&l.jsx(k.J,{text:t[e.name]}),"file"===e.type&&l.jsx(U.jF,{s3key:t[e.name]}),"markdown"===e.type&&l.jsx(k.J,{text:t[e.name]}),!e.type&&l.jsx(k.J,{text:t[e.name]}),"text"===e.type&&l.jsx(k.J,{text:t[e.name]}),"number"===e.type&&l.jsx("p",{className:"cursor-copy",onClick:async()=>{await navigator.clipboard.writeText(t[e.name]),a({title:"Copied to clipboard"})},children:t[e.name]}),"boolean"===e.type&&l.jsx("p",{className:"cursor-copy",onClick:async()=>{await navigator.clipboard.writeText(t[e.name]),a({title:"Copied to clipboard"})},children:t[e.name]??""})]})})]},n))]})]}),l.jsx(P.Z,{className:"my-4"})]})})}),l.jsx(B.Zb,{className:"bg-transparent",children:(0,l.jsxs)(J.zF,{children:[l.jsx(B.Ol,{className:"p-4",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex flex-col",children:[l.jsx("p",{className:"text-base",children:"Access Control"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-0",children:"Control access to this item."})]}),l.jsx(J.wy,{asChild:!0,children:(0,l.jsxs)(z.z,{variant:"ghost",size:"icon",className:"size-8",children:[l.jsx(f.Z,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Toggle"})]})})]})}),l.jsx(J.Fw,{className:"mt-5",children:l.jsx(B.aY,{className:"space-y-4",children:l.jsx(V.P,{initialRightsMode:t.rights_mode,initialUsers:t.RBAC?.users,initialRoles:t.RBAC?.roles,initialProjects:t.RBAC?.projects,onChange:(e,t,s,a)=>{H({rights_mode:e,users:t,roles:s,projects:a})}})})})]})}),(0,l.jsxs)("div",{className:"mt-4 border border p-3 pb-5 rounded",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between ml-4 mt-3 mr-4 mb-2",children:[l.jsx("h1",{className:"text-lg font-medium",children:"Embeddings"}),(0,l.jsxs)(q.h_,{children:[l.jsx(q.$F,{asChild:!0,children:(0,l.jsxs)(z.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:[l.jsx(j.Z,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Open menu"})]})}),(0,l.jsxs)(q.AW,{align:"end",children:[l.jsx(q.Xi,{onClick:()=>ey("generate"),children:"Generate embeddings"}),l.jsx(q.Xi,{onClick:()=>ey("delete"),children:"Delete embeddings"})]})]})]}),(0,l.jsxs)(Z.iA,{children:[l.jsx(Z.Rn,{children:t?.chunks?.length?"A list of all embeddings for this item.":"No embeddings found."}),l.jsx(Z.xD,{children:(0,l.jsxs)(Z.SC,{children:[l.jsx(Z.ss,{children:"Index"}),l.jsx(Z.ss,{children:"Content"}),l.jsx(Z.ss,{children:"Dimensions"}),l.jsx(Z.ss,{children:"Created At"}),l.jsx(Z.ss,{children:"Updated At"})]})}),l.jsx(Z.RM,{children:t?.chunks?.length?t?.chunks?.length&&t.chunks.map(e=>(0,l.jsxs)(Z.SC,{children:[l.jsx(Z.pj,{className:"font-medium capitalize",children:e.chunk_index+1}),l.jsx(Z.pj,{children:l.jsx(k.J,{text:e.content})}),l.jsx(Z.pj,{children:e.embedding_size||0}),l.jsx(Z.pj,{children:new Date(e.chunk_created_at).toLocaleString()}),l.jsx(Z.pj,{children:new Date(e.chunk_updated_at).toLocaleString()})]},e.id)):null})]})]})]})]})})]}):(0,l.jsxs)(l.Fragment,{children:[" ",!t&&e.itemId?l.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Item not found."}):l.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"No item selected."})]}),l.jsx(A.aR,{open:"generate"===ev,onOpenChange:e=>!e&&ey(null),children:(0,l.jsxs)(A._T,{children:[(0,l.jsxs)(A.fY,{children:[l.jsx(A.f$,{children:"Generate Embeddings"}),l.jsx(A.yT,{children:"Are you sure you want to generate embeddings for this item? This will create new embedding vectors for the content."})]}),(0,l.jsxs)(A.xo,{children:[l.jsx(A.le,{children:"Cancel"}),l.jsx(A.OL,{disabled:ei.loading,onClick:()=>{t?.id&&(console.log("Generate embeddings for item:",t?.id),ey(null),er({variables:{where:{id:{eq:t?.id}}}}))},children:"Generate"})]})]})}),l.jsx(A.aR,{open:"delete"===ev,onOpenChange:e=>!e&&ey(null),children:(0,l.jsxs)(A._T,{children:[(0,l.jsxs)(A.fY,{children:[l.jsx(A.f$,{children:"Delete Embeddings"}),l.jsx(A.yT,{children:"Are you sure you want to delete all embeddings for this item? This action cannot be undone."})]}),(0,l.jsxs)(A.xo,{children:[l.jsx(A.le,{children:"Cancel"}),l.jsx(A.OL,{disabled:eo.loading,onClick:async()=>{t?.id&&(console.log("Delete embeddings for item:",t?.id),ey(null),ed({variables:{where:{id:{eq:t?.id}}}}))},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})}w=(W.then?(await W)():W)[0],a()}catch(e){a(e)}})},51602:(e,t,s)=>{"use strict";s.d(t,{d:()=>x,f:()=>h});var a=s(10326),l=s(90772),n=s(77863),r=s(32933),i=s(43810),d=s(17577),o=s(54390),c=s(35057),u=s(48818);let m=(0,d.createContext)({code:""}),x=({code:e,language:t,showLineNumbers:s=!1,className:l,children:r,...i})=>a.jsx(m.Provider,{value:{code:e},children:a.jsx("div",{className:(0,n.cn)("relative w-full overflow-hidden rounded-md border bg-background text-foreground",l),...i,children:(0,a.jsxs)("div",{className:"relative",children:[a.jsx(o.Z,{className:"overflow-hidden dark:hidden",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:s,style:c.Z,children:e}),a.jsx(o.Z,{className:"hidden overflow-hidden dark:block",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:s,style:u.Z,children:e}),r&&a.jsx("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:r})]})})}),h=({onCopy:e,onError:t,timeout:s=2e3,children:o,className:c,...u})=>{let[x,h]=(0,d.useState)(!1),{code:p}=(0,d.useContext)(m),g=async()=>{t?.(Error("Clipboard API not available"))},f=x?r.Z:i.Z;return a.jsx(l.z,{className:(0,n.cn)("shrink-0",c),onClick:g,size:"icon",variant:"ghost",...u,children:o??a.jsx(f,{size:14})})}},36931:(e,t,s)=>{"use strict";s.d(t,{H:()=>x});var a=s(10326),l=s(77863),n=s(17577),r=s(16476),i=s(79283),d=s(70285),o=s(7833),c=s(51602);s(32289);let u=(0,s(39499).Z)(r.UG),m={ol:({node:e,children:t,className:s,...n})=>a.jsx("ol",{className:(0,l.cn)("ml-4 list-outside list-decimal",s),...n,children:t}),li:({node:e,children:t,className:s,...n})=>a.jsx("li",{className:(0,l.cn)("py-1",s),...n,children:t}),ul:({node:e,children:t,className:s,...n})=>a.jsx("ul",{className:(0,l.cn)("ml-4 list-outside list-disc",s),...n,children:t}),hr:({node:e,className:t,...s})=>a.jsx("hr",{className:(0,l.cn)("my-6 border-border",t),...s}),strong:({node:e,children:t,className:s,...n})=>a.jsx("span",{className:(0,l.cn)("font-semibold",s),...n,children:t}),a:({node:e,children:t,className:s,...n})=>a.jsx("a",{className:(0,l.cn)("font-medium text-primary underline",s),rel:"noreferrer",target:"_blank",...n,children:t}),h1:({node:e,children:t,className:s,...n})=>a.jsx("h1",{className:(0,l.cn)("mt-6 mb-2 font-semibold text-3xl",s),...n,children:t}),h2:({node:e,children:t,className:s,...n})=>a.jsx("h2",{className:(0,l.cn)("mt-6 mb-2 font-semibold text-2xl",s),...n,children:t}),h3:({node:e,children:t,className:s,...n})=>a.jsx("h3",{className:(0,l.cn)("mt-6 mb-2 font-semibold text-xl",s),...n,children:t}),h4:({node:e,children:t,className:s,...n})=>a.jsx("h4",{className:(0,l.cn)("mt-6 mb-2 font-semibold text-lg",s),...n,children:t}),h5:({node:e,children:t,className:s,...n})=>a.jsx("h5",{className:(0,l.cn)("mt-6 mb-2 font-semibold text-base",s),...n,children:t}),h6:({node:e,children:t,className:s,...n})=>a.jsx("h6",{className:(0,l.cn)("mt-6 mb-2 font-semibold text-sm",s),...n,children:t}),table:({node:e,children:t,className:s,...n})=>a.jsx("div",{className:"my-4 overflow-x-auto",children:a.jsx("table",{className:(0,l.cn)("w-full border-collapse border border-border",s),...n,children:t})}),thead:({node:e,children:t,className:s,...n})=>a.jsx("thead",{className:(0,l.cn)("bg-muted/50",s),...n,children:t}),tbody:({node:e,children:t,className:s,...n})=>a.jsx("tbody",{className:(0,l.cn)("divide-y divide-border",s),...n,children:t}),tr:({node:e,children:t,className:s,...n})=>a.jsx("tr",{className:(0,l.cn)("border-border border-b",s),...n,children:t}),th:({node:e,children:t,className:s,...n})=>a.jsx("th",{className:(0,l.cn)("px-4 py-2 text-left font-semibold text-sm",s),...n,children:t}),td:({node:e,children:t,className:s,...n})=>a.jsx("td",{className:(0,l.cn)("px-4 py-2 text-sm",s),...n,children:t}),blockquote:({node:e,children:t,className:s,...n})=>a.jsx("blockquote",{className:(0,l.cn)("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",s),...n,children:t}),code:({node:e,className:t,...s})=>e?.position?.start.line!==e?.position?.end.line?a.jsx("code",{className:t,...s}):a.jsx("code",{className:(0,l.cn)("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),...s}),pre:({node:e,className:t,children:s})=>{let r="javascript";"string"==typeof e?.properties?.className&&(r=e.properties.className.replace("language-",""));let i="";return(0,n.isValidElement)(s)&&s.props&&"string"==typeof s.props.children?i=s.props.children:"string"==typeof s&&(i=s),a.jsx(c.d,{className:(0,l.cn)("my-4 h-auto",t),code:i,language:r,children:a.jsx(c.f,{onCopy:()=>console.log("Copied code to clipboard"),onError:()=>console.error("Failed to copy code to clipboard")})})}},x=(0,n.memo)(({className:e,options:t,children:s,allowedImagePrefixes:n,allowedLinkPrefixes:r,defaultOrigin:c,parseIncompleteMarkdown:x=!0,...h})=>{let p="string"==typeof s&&x?function(e){if(!e||"string"!=typeof e)return e;let t=e,s=t.match(/(!?\[)([^\]]*?)$/);if(s){let e=t.lastIndexOf(s[1]);t=t.substring(0,e)}if(t.match(/(\*\*)([^*]*?)$/)&&(t.match(/\*\*/g)||[]).length%2==1&&(t=`${t}**`),t.match(/(__)([^_]*?)$/)&&(t.match(/__/g)||[]).length%2==1&&(t=`${t}__`),t.match(/(\*)([^*]*?)$/)&&t.split("").reduce((e,s,a)=>{if("*"===s){let s=t[a-1],l=t[a+1];if("*"!==s&&"*"!==l)return e+1}return e},0)%2==1&&(t=`${t}*`),t.match(/(_)([^_]*?)$/)&&t.split("").reduce((e,s,a)=>{if("_"===s){let s=t[a-1],l=t[a+1];if("_"!==s&&"_"!==l)return e+1}return e},0)%2==1&&(t=`${t}_`),t.match(/(`)([^`]*?)$/)&&(t.includes("```"),(t.match(/```[\s\S]*?```/g)||[]).length,(t.match(/```/g)||[]).length%2!=1)){let e=0;for(let s=0;s<t.length;s++)if("`"===t[s]){let a="```"===t.substring(s,s+3),l=s>0&&"```"===t.substring(s-1,s+2),n=s>1&&"```"===t.substring(s-2,s+1);!(a||l||n)&&e++}e%2==1&&(t=`${t}\``)}return t.match(/(~~)([^~]*?)$/)&&(t.match(/~~/g)||[]).length%2==1&&(t=`${t}~~`),t}(s):s;return a.jsx("div",{className:(0,l.cn)("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...h,children:a.jsx(u,{allowedImagePrefixes:n??["*"],allowedLinkPrefixes:r??["*"],components:m,defaultOrigin:c,rehypePlugins:[i.Z],remarkPlugins:[d.Z,o.Z],...t,children:p})})},(e,t)=>e.children===t.children);x.displayName="Response"},57004:(e,t,s)=>{"use strict";s.a(e,async(e,a)=>{try{s.d(t,{G:()=>f});var l=s(10326),n=s(48644),r=s(93801),i=s(45747),d=s(17577),o=s(94966),c=s(12533),u=s(12428),m=s(47355),x=s(62288),h=s(34789),p=s(77863),g=e([n,r,i]);function f({className:e=null,code:t,language:s,slice:a=200}){let{toast:n}=(0,h.pm)(),[r,i]=(0,d.useState)(null);return(0,l.jsxs)(x.Vq,{children:[l.jsx(x.hg,{asChild:!0,children:r?.length&&l.jsx(o.Z,{className:(0,p.cn)("cursor-pointer",e),showLineNumbers:!0,wrapLines:!0,lineProps:{style:{wordBreak:"break-all",whiteSpace:"pre-wrap"}},language:s||"plaintext",style:m.Z,children:`${r?.slice(0,a||200)} ${t?.length>(a||200)?"...":""}`})}),l.jsx(x.cZ,{className:"sm:max-w-[800px] overflow-hidden max-h-[500px] overflow-y-scroll",children:(0,l.jsxs)(x.fK,{children:[l.jsx(x.$N,{children:"Code"}),l.jsx("div",{className:"cursor-copy",onClick:async()=>{await navigator.clipboard.writeText(r??""),n({title:"Copied to clipboard"})},children:l.jsx(o.Z,{className:(0,p.cn)(e),showLineNumbers:!0,wrapLines:!0,lineProps:{style:{wordBreak:"break-all",whiteSpace:"pre-wrap"}},language:s||"plaintext",style:m.Z,children:r??""})})]})})]})}[n,r,i]=g.then?(await g)():g,o.Z.registerLanguage("json",u.Z),o.Z.registerLanguage("javascript",c.Z),a()}catch(e){a(e)}})},18615:(e,t,s)=>{"use strict";s.d(t,{J:()=>g});var a=s(10326);s(17577);var l=s(62288),n=s(34789),r=s(36931),i=s(90772),d=s(68232),o=s(77863);let c=({className:e,...t})=>a.jsx("div",{className:(0,o.cn)("flex flex-col overflow-hidden rounded-lg border bg-background shadow-sm",e),...t}),u=({className:e,...t})=>a.jsx("div",{className:(0,o.cn)("flex items-center justify-between border-b bg-muted/50 px-4 py-3",e),...t}),m=({className:e,...t})=>a.jsx("div",{className:(0,o.cn)("flex items-center gap-1",e),...t}),x=({tooltip:e,label:t,icon:s,children:l,className:n,size:r="sm",variant:c="ghost",...u})=>{let m=(0,a.jsxs)(i.z,{className:(0,o.cn)("size-8 p-0 text-muted-foreground hover:text-foreground",n),size:r,type:"button",variant:c,...u,children:[s?a.jsx(s,{className:"size-4"}):l,a.jsx("span",{className:"sr-only",children:t||e})]});return e?a.jsx(d.pn,{children:(0,a.jsxs)(d.u,{children:[a.jsx(d.aJ,{asChild:!0,children:m}),a.jsx(d._v,{children:a.jsx("p",{children:e})})]})}):m},h=({className:e,...t})=>a.jsx("div",{className:(0,o.cn)("flex-1 overflow-auto p-4",e),...t});var p=s(43810);function g({text:e,sliceLength:t}){let{toast:s}=(0,n.pm)();return(0,a.jsxs)(l.Vq,{children:[a.jsx(l.hg,{asChild:!0,children:(0,a.jsxs)("p",{className:"cursor-pointer text-sm text-base",children:[e?.slice(0,t??200),t&&e.length>t?"...":""]})}),a.jsx(l.cZ,{className:"sm:max-w-[800px] max-h-[500px] overflow-y-scroll",children:(0,a.jsxs)(c,{children:[a.jsx(u,{children:a.jsx(m,{children:a.jsx(x,{icon:p.Z,label:"Copy",tooltip:"Copy to clipboard",onClick:async()=>{await navigator.clipboard.writeText(e),s({title:"Copied to clipboard"})}})})}),a.jsx(h,{children:a.jsx(r.H,{children:e})})]})})]})}},29718:(e,t,s)=>{"use strict";s.d(t,{L:()=>l});var a=s(10326);function l({text:e,length:t}){return e.length>t?(0,a.jsxs)(a.Fragment,{children:[e.slice(0,t),"..."]}):a.jsx(a.Fragment,{children:e})}},99440:(e,t,s)=>{"use strict";s.d(t,{OL:()=>g,_T:()=>u,aR:()=>d,f$:()=>h,fY:()=>m,le:()=>f,xo:()=>x,yT:()=>p});var a=s(10326),l=s(12194),n=s(17577),r=s(90772),i=s(77863);let d=l.fC;l.xz;let o=l.h_,c=n.forwardRef(({className:e,...t},s)=>a.jsx(l.aV,{className:(0,i.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:s}));c.displayName=l.aV.displayName;let u=n.forwardRef(({className:e,...t},s)=>(0,a.jsxs)(o,{children:[a.jsx(c,{}),a.jsx(l.VY,{ref:s,className:(0,i.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));u.displayName=l.VY.displayName;let m=({className:e,...t})=>a.jsx("div",{className:(0,i.cn)("flex flex-col space-y-2 text-center sm:text-left",e),...t});m.displayName="AlertDialogHeader";let x=({className:e,...t})=>a.jsx("div",{className:(0,i.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});x.displayName="AlertDialogFooter";let h=n.forwardRef(({className:e,...t},s)=>a.jsx(l.Dx,{ref:s,className:(0,i.cn)("text-lg font-semibold",e),...t}));h.displayName=l.Dx.displayName;let p=n.forwardRef(({className:e,...t},s)=>a.jsx(l.dk,{ref:s,className:(0,i.cn)("text-sm text-muted-foreground",e),...t}));p.displayName=l.dk.displayName;let g=n.forwardRef(({className:e,...t},s)=>a.jsx(l.aU,{ref:s,className:(0,i.cn)((0,r.d)(),e),...t}));g.displayName=l.aU.displayName;let f=n.forwardRef(({className:e,...t},s)=>a.jsx(l.$j,{ref:s,className:(0,i.cn)((0,r.d)({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));f.displayName=l.$j.displayName},53313:(e,t,s)=>{"use strict";s.d(t,{X:()=>d});var a=s(10326),l=s(13635),n=s(32933),r=s(17577),i=s(77863);let d=r.forwardRef(({className:e,...t},s)=>a.jsx(l.fC,{ref:s,className:(0,i.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:a.jsx(l.z$,{className:(0,i.cn)("flex items-center justify-center text-current"),children:a.jsx(n.Z,{className:"size-4"})})}));d.displayName=l.fC.displayName},24295:(e,t,s)=>{"use strict";s.d(t,{Fw:()=>r,wy:()=>n,zF:()=>l});var a=s(35663);let l=a.fC,n=a.wy,r=a.Fw},55632:(e,t,s)=>{"use strict";s.d(t,{NI:()=>g,Wi:()=>u,l0:()=>o,lX:()=>p,pf:()=>f,xJ:()=>h,zG:()=>j});var a=s(10326),l=s(34214),n=s(17577),r=s(74723),i=s(31048),d=s(77863);let o=r.RV,c=n.createContext({}),u=({...e})=>a.jsx(c.Provider,{value:{name:e.name},children:a.jsx(r.Qr,{...e})}),m=()=>{let e=n.useContext(c),t=n.useContext(x),{getFieldState:s,formState:a}=(0,r.Gc)(),l=s(e.name,a);if(!e)throw Error("useFormField should be used within <FormField>");let{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...l}},x=n.createContext({}),h=n.forwardRef(({className:e,...t},s)=>{let l=n.useId();return a.jsx(x.Provider,{value:{id:l},children:a.jsx("div",{ref:s,className:(0,d.cn)("space-y-2",e),...t})})});h.displayName="FormItem";let p=n.forwardRef(({className:e,...t},s)=>{let{error:l,formItemId:n}=m();return a.jsx(i._,{ref:s,className:(0,d.cn)(l&&"text-destructive",e),htmlFor:n,...t})});p.displayName="FormLabel";let g=n.forwardRef(({...e},t)=>{let{error:s,formItemId:n,formDescriptionId:r,formMessageId:i}=m();return a.jsx(l.g7,{ref:t,id:n,"aria-describedby":s?`${r} ${i}`:`${r}`,"aria-invalid":!!s,...e})});g.displayName="FormControl";let f=n.forwardRef(({className:e,...t},s)=>{let{formDescriptionId:l}=m();return a.jsx("p",{ref:s,id:l,className:(0,d.cn)("text-sm text-muted-foreground",e),...t})});f.displayName="FormDescription";let j=n.forwardRef(({className:e,children:t,...s},l)=>{let{error:n,formMessageId:r}=m(),i=n?String(n?.message):t;return i?a.jsx("p",{ref:l,id:r,className:(0,d.cn)("text-sm font-medium text-destructive",e),...s,children:i}):null});j.displayName="FormMessage"},33261:(e,t,s)=>{"use strict";s.d(t,{r:()=>i});var a=s(10326),l=s(41959),n=s(17577),r=s(77863);let i=n.forwardRef(({className:e,...t},s)=>a.jsx(l.fC,{className:(0,r.cn)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:s,children:a.jsx(l.bU,{className:(0,r.cn)("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));i.displayName=l.fC.displayName},15940:(e,t,s)=>{"use strict";s.d(t,{RM:()=>d,Rn:()=>m,SC:()=>o,iA:()=>r,pj:()=>u,ss:()=>c,xD:()=>i});var a=s(10326),l=s(17577),n=s(77863);let r=l.forwardRef(({className:e,...t},s)=>a.jsx("div",{className:"relative w-full overflow-auto",children:a.jsx("table",{ref:s,className:(0,n.cn)("w-full caption-bottom text-sm",e),...t})}));r.displayName="Table";let i=l.forwardRef(({className:e,...t},s)=>a.jsx("thead",{ref:s,className:(0,n.cn)("[&_tr]:border-b",e),...t}));i.displayName="TableHeader";let d=l.forwardRef(({className:e,...t},s)=>a.jsx("tbody",{ref:s,className:(0,n.cn)("[&_tr:last-child]:border-0",e),...t}));d.displayName="TableBody",l.forwardRef(({className:e,...t},s)=>a.jsx("tfoot",{ref:s,className:(0,n.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t})).displayName="TableFooter";let o=l.forwardRef(({className:e,...t},s)=>a.jsx("tr",{ref:s,className:(0,n.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));o.displayName="TableRow";let c=l.forwardRef(({className:e,...t},s)=>a.jsx("th",{ref:s,className:(0,n.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&:has([role=checkbox])]:w-[40px]",e),...t}));c.displayName="TableHead";let u=l.forwardRef(({className:e,...t},s)=>a.jsx("td",{ref:s,className:(0,n.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0 [&:has([role=checkbox])]:w-[40px]",e),...t}));u.displayName="TableCell";let m=l.forwardRef(({className:e,...t},s)=>a.jsx("caption",{ref:s,className:(0,n.cn)("mt-4 text-sm text-muted-foreground",e),...t}));m.displayName="TableCaption"},79210:(e,t,s)=>{"use strict";s.d(t,{SP:()=>o,dr:()=>d,mQ:()=>i,nU:()=>c});var a=s(10326),l=s(28407),n=s(17577),r=s(77863);let i=l.fC,d=n.forwardRef(({className:e,...t},s)=>a.jsx(l.aV,{ref:s,className:(0,r.cn)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));d.displayName=l.aV.displayName;let o=n.forwardRef(({className:e,...t},s)=>a.jsx(l.xz,{ref:s,className:(0,r.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));o.displayName=l.xz.displayName;let c=n.forwardRef(({className:e,...t},s)=>a.jsx(l.VY,{ref:s,className:(0,r.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));c.displayName=l.VY.displayName},75909:(e,t,s)=>{"use strict";s.d(t,{t:()=>n});var a=s(42270),l=s(39167);let n=()=>(0,l.aM)(a.uw,{variables:{limit:20}})},40900:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(76557).Z)("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]])},47206:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(76557).Z)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},24081:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(76557).Z)("Expand",[["path",{d:"m21 21-6-6m6 6v-4.8m0 4.8h-4.8",key:"1c15vz"}],["path",{d:"M3 16.2V21m0 0h4.8M3 21l6-6",key:"1fsnz2"}],["path",{d:"M21 7.8V3m0 0h-4.8M21 3l-6 6",key:"hawz9i"}],["path",{d:"M3 7.8V3m0 0h4.8M3 3l6 6",key:"u9ee12"}]])},65983:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(76557).Z)("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]])},54014:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(76557).Z)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},42924:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(76557).Z)("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]])},9015:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(76557).Z)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},21986:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(76557).Z)("MessageCirclePlus",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]])},23015:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(76557).Z)("PackageOpen",[["path",{d:"M20.91 8.84 8.56 2.23a1.93 1.93 0 0 0-1.81 0L3.1 4.13a2.12 2.12 0 0 0-.05 3.69l12.22 6.93a2 2 0 0 0 1.94 0L21 12.51a2.12 2.12 0 0 0-.09-3.67Z",key:"1vy178"}],["path",{d:"m3.09 8.84 12.35-6.61a1.93 1.93 0 0 1 1.81 0l3.65 1.9a2.12 2.12 0 0 1 .1 3.69L8.73 14.75a2 2 0 0 1-1.94 0L3 12.51a2.12 2.12 0 0 1 .09-3.67Z",key:"s3bv25"}],["line",{x1:"12",x2:"12",y1:"22",y2:"13",key:"1o4xyi"}],["path",{d:"M20 13.5v3.37a2.06 2.06 0 0 1-1.11 1.83l-6 3.08a1.93 1.93 0 0 1-1.78 0l-6-3.08A2.06 2.06 0 0 1 4 16.87V13.5",key:"1na2nq"}]])},44389:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(76557).Z)("Pencil",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},31215:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(76557).Z)("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]])},35157:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(76557).Z)("XSquare",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},76738:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>a});let a=(0,s(68570).createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/app/(application)/data/[[...query]]/layout.tsx#default`)},21114:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>a});let a=(0,s(68570).createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/app/(application)/data/[[...query]]/page.tsx#default`)},41959:(e,t,s)=>{"use strict";s.d(t,{bU:()=>w,fC:()=>N});var a=s(17577),l=s(82561),n=s(48051),r=s(93095),i=s(52067),d=s(53405),o=s(2566),c=s(45226),u=s(10326),m="Switch",[x,h]=(0,r.b)(m),[p,g]=x(m),f=a.forwardRef((e,t)=>{let{__scopeSwitch:s,name:r,checked:d,defaultChecked:o,required:x,disabled:h,value:g="on",onCheckedChange:f,form:j,...v}=e,[N,w]=a.useState(null),k=(0,n.e)(t,e=>w(e)),C=a.useRef(!1),z=!N||j||!!N.closest("form"),[S,E]=(0,i.T)({prop:d,defaultProp:o??!1,onChange:f,caller:m});return(0,u.jsxs)(p,{scope:s,checked:S,disabled:h,children:[(0,u.jsx)(c.WV.button,{type:"button",role:"switch","aria-checked":S,"aria-required":x,"data-state":b(S),"data-disabled":h?"":void 0,disabled:h,value:g,...v,ref:k,onClick:(0,l.M)(e.onClick,e=>{E(e=>!e),z&&(C.current=e.isPropagationStopped(),C.current||e.stopPropagation())})}),z&&(0,u.jsx)(y,{control:N,bubbles:!C.current,name:r,value:g,checked:S,required:x,disabled:h,form:j,style:{transform:"translateX(-100%)"}})]})});f.displayName=m;var j="SwitchThumb",v=a.forwardRef((e,t)=>{let{__scopeSwitch:s,...a}=e,l=g(j,s);return(0,u.jsx)(c.WV.span,{"data-state":b(l.checked),"data-disabled":l.disabled?"":void 0,...a,ref:t})});v.displayName=j;var y=a.forwardRef(({__scopeSwitch:e,control:t,checked:s,bubbles:l=!0,...r},i)=>{let c=a.useRef(null),m=(0,n.e)(c,i),x=(0,d.D)(s),h=(0,o.t)(t);return a.useEffect(()=>{let e=c.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(x!==s&&t){let a=new Event("click",{bubbles:l});t.call(e,s),e.dispatchEvent(a)}},[x,s,l]),(0,u.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s,...r,tabIndex:-1,ref:m,style:{...r.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function b(e){return e?"checked":"unchecked"}y.displayName="SwitchBubbleInput";var N=f,w=v}};var t=require("../../../../webpack-runtime.js");t.C(e);var s=e=>t(t.s=e),a=t.X(0,[9276,3543,9049,590,7598,931,6812,7344,1729,7141,2578,6508,2663,108,2194,7544,2721,8181,770,7471,3743,3393,7223,7944,2270,4680,466,7203],()=>s(39701));module.exports=a})();
1
+ (()=>{var e={};e.id=6050,e.ids=[6050],e.modules={57343:e=>{"use strict";e.exports=require("graphql")},72934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},54580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},45869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},20399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},27790:e=>{"use strict";e.exports=require("assert")},78893:e=>{"use strict";e.exports=require("buffer")},61282:e=>{"use strict";e.exports=require("child_process")},84770:e=>{"use strict";e.exports=require("crypto")},80665:e=>{"use strict";e.exports=require("dns")},17702:e=>{"use strict";e.exports=require("events")},92048:e=>{"use strict";e.exports=require("fs")},32615:e=>{"use strict";e.exports=require("http")},35240:e=>{"use strict";e.exports=require("https")},98216:e=>{"use strict";e.exports=require("net")},19801:e=>{"use strict";e.exports=require("os")},55315:e=>{"use strict";e.exports=require("path")},86624:e=>{"use strict";e.exports=require("querystring")},76162:e=>{"use strict";e.exports=require("stream")},82452:e=>{"use strict";e.exports=require("tls")},17360:e=>{"use strict";e.exports=require("url")},21764:e=>{"use strict";e.exports=require("util")},71568:e=>{"use strict";e.exports=require("zlib")},8678:e=>{"use strict";e.exports=import("pg")},48644:e=>{"use strict";e.exports=import("prettier/plugins/babel")},93801:e=>{"use strict";e.exports=import("prettier/plugins/estree")},45747:e=>{"use strict";e.exports=import("prettier/standalone")},49411:e=>{"use strict";e.exports=require("node:path")},97742:e=>{"use strict";e.exports=require("node:process")},41041:e=>{"use strict";e.exports=require("node:url")},39701:(e,t,s)=>{"use strict";s.a(e,async(e,a)=>{try{s.r(t),s.d(t,{GlobalError:()=>d.a,__next_app__:()=>p,originalPathname:()=>h,pages:()=>x,routeModule:()=>g,tree:()=>m}),s(21114),s(76738);var l=s(71197);s(35866);var n=s(23191),r=s(88716),i=s(37922),d=s.n(i),o=s(95231),c={};for(let e in o)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(c[e]=()=>o[e]);s.d(t,c);var u=e([l]);l=(u.then?(await u)():u)[0];let m=["",{children:["(application)",{children:["data",{children:["[[...query]]",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(s.bind(s,21114)),"/home/runner/work/exulu-frontend/exulu-frontend/app/(application)/data/[[...query]]/page.tsx"]}]},{layout:[()=>Promise.resolve().then(s.bind(s,76738)),"/home/runner/work/exulu-frontend/exulu-frontend/app/(application)/data/[[...query]]/layout.tsx"]}]},{}]},{layout:[()=>Promise.resolve().then(s.bind(s,71197)),"/home/runner/work/exulu-frontend/exulu-frontend/app/(application)/layout.tsx"],"not-found":[()=>Promise.resolve().then(s.t.bind(s,35866,23)),"next/dist/client/components/not-found-error"]}]},{"not-found":[()=>Promise.resolve().then(s.t.bind(s,35866,23)),"next/dist/client/components/not-found-error"]}],x=["/home/runner/work/exulu-frontend/exulu-frontend/app/(application)/data/[[...query]]/page.tsx"],h="/(application)/data/[[...query]]/page",p={require:s,loadChunk:()=>Promise.resolve()},g=new n.AppPageRouteModule({definition:{kind:r.x.APP_PAGE,page:"/(application)/data/[[...query]]/page",pathname:"/data/[[...query]]",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:m}});a()}catch(e){a(e)}})},71580:(e,t,s)=>{Promise.resolve().then(s.bind(s,63978))},82736:(e,t,s)=>{Promise.resolve().then(s.bind(s,26533))},63978:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>eU});var a=s(10326),l=s(17577),n=s(76812),r=s(39167),i=s(18753),d=s(86508),o=s(11798),c=s(83855),u=s(23015),m=s(98091),x=s(40900),h=s(35047),p=s(15211),g=s(90772),f=s(53313),j=s(37859),v=s(65685),y=s(65304),b=s(15940),N=s(34789),w=s(77863),k=s(98181);let C=[{id:"select",header:({table:e})=>a.jsx(f.X,{checked:e.getIsAllPageRowsSelected()||e.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:t=>e.toggleAllPageRowsSelected(!!t),"aria-label":"Select all",className:"translate-y-[2px]"}),cell:({row:e})=>a.jsx(f.X,{checked:e.getIsSelected(),onCheckedChange:t=>e.toggleSelected(!!t),"aria-label":"Select row",className:"translate-y-[2px] max-w-[50px]"}),enableSorting:!1,enableHiding:!1},{accessorKey:"Description",cell:({row:e})=>(console.log("original",e.original),(0,a.jsxs)("div",{className:"flex flex-column grid grid-cols-1",children:[a.jsx("span",{className:"max-w-[500px] truncate font-medium w-full",children:e.original.name?e.original.name:e.original.text.slice(0,200)||"Untitled"}),a.jsx("small",{className:"mt-1",children:(0,k.WU)(new Date(e.original.createdAt),"PP")})]}))}];var z=s(43273),S=s(88307),E=s(94019),R=s(54432);function P({onSearch:e=e=>console.log(`Search query: ${e}`),placeholder:t="Search...",className:s=""}){let[n,r]=(0,l.useState)("");return a.jsx("form",{onSubmit:t=>{t.preventDefault(),e(n)},className:`relative ${s}`,children:(0,a.jsxs)("div",{className:"relative flex items-center w-full",children:[a.jsx(S.Z,{className:"absolute left-3 h-4 w-4 text-muted-foreground"}),a.jsx(R.I,{type:"text",placeholder:t,value:n,onChange:e=>r(e.target.value),className:"pl-10 pr-10","aria-label":"Search input"}),n&&(0,a.jsxs)(a.Fragment,{children:[a.jsx("span",{className:"absolute right-10 text-xs text-muted-foreground",children:"Press Enter ↵"}),a.jsx(g.z,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 h-full rounded-l-none",onClick:()=>{r(""),e("")},"aria-label":"Clear search",children:a.jsx(E.Z,{className:"h-4 w-4"})})]})]})})}var I=s(42270);function Z({activeFolder:e,activeItem:t,archived:s}){let k=(0,h.usePathname)(),S=(0,h.useSearchParams)(),[E,R]=(0,l.useState)(S.get("page")?parseInt(S.get("page")):1),Z=S.get("search"),{user:_}=(0,l.useContext)(p.S),{toast:D}=(0,N.pm)(),[M,q]=(0,l.useState)({..._.company}),A=(0,h.useRouter)(),[L,T]=l.useState({}),[$,F]=l.useState({}),[O,G]=l.useState([]),[V,J]=l.useState([]),{loading:B,data:U,refetch:W,previousData:X,error:H}=(0,r.aM)((0,I.P3)(e,[]),{fetchPolicy:"no-cache",nextFetchPolicy:"network-only",variables:{context:e,page:E??1,limit:10,sort:{field:"updatedAt",direction:"DESC"},filters:{archived:{eq:s},...Z?{name:{contains:`${Z}`}}:{}}}}),Y=U?.[e+I.Md],K=X?.[e+I.Md],[Q,ee]=(0,i.D)((0,I.ty)(e),{onCompleted:()=>{W()}}),[et,es]=(0,i.D)((0,I.mN)(e,[]),{onCompleted:()=>{W()}}),ea=l.useMemo(()=>[],[]),{limit:el,onPaginationChange:en,skip:er,pagination:ei}=function(){let[e,t]=(0,l.useState)({pageSize:5,pageIndex:0}),{pageSize:s,pageIndex:a}=e;return{limit:s,onPaginationChange:t,pagination:e,skip:s*a}}(),ed=(0,d.b7)({data:B&&K?.items?K.items:Y?.items??ea,pageCount:Y?.pageInfo?.pageCount??-1,columns:C,state:{sorting:V,columnVisibility:$,rowSelection:L,columnFilters:O},enableRowSelection:!0,onRowSelectionChange:T,onSortingChange:J,onColumnFiltersChange:G,onColumnVisibilityChange:F,getCoreRowModel:(0,o.sC)(),getFilteredRowModel:(0,o.vL)(),getPaginationRowModel:(0,o.G_)(),getSortedRowModel:(0,o.tj)(),getFacetedRowModel:(0,o.o6)(),getFacetedUniqueValues:(0,o.JG)(),manualPagination:!0,onPaginationChange:en}),[eo,ec]=(0,i.D)((0,I.tO)(e),{onCompleted:t=>{console.log("data",t);let s=t?t[e+I.Wc]?.item?.id:void 0;s&&A.push(`/data/${e}/${s}`),W()}}),eu=({page:e,search:t})=>{R(e??1);let s=new URLSearchParams;e&&s.set("page",e.toString()),t&&s.set("search",t),A.push(`${k}?${s.toString()}`)},em=t=>{s?A.push(`/data/${e}/archived/${t}?${S.toString()}`):A.push(`/data/${e}/${t}?${S.toString()}`)};return H?(0,a.jsxs)(z.bZ,{className:"p-4",variant:"destructive",children:[a.jsx(n.LPM,{className:"size-4"}),a.jsx(z.Cd,{children:"Error"}),a.jsx(z.X,{children:H?.message||": unknown"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"grid grid-flow-col grid-cols-[auto_minmax(0,1fr)] grid-rows-1 bg-background/95 p-4 backdrop-blur gap-2 supports-[backdrop-filter]:bg-background/60",children:[a.jsx(f.X,{checked:ed.getIsAllPageRowsSelected()||ed.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:e=>ed.toggleAllPageRowsSelected(!!e),"aria-label":"Select all",className:"my-auto mr-3 translate-y-[2px]"}),a.jsx("div",{className:"relative",children:a.jsx(P,{onSearch:e=>{eu({page:1,search:e})}})}),a.jsx(g.z,{onClick:()=>{eo({variables:{input:{name:"New item",source:"manual",textlength:0,company:M.id}}})},disabled:ec.loading||s,className:"ml-2 ml-auto lg:flex",children:ec.loading?a.jsx(j.g,{}):a.jsx(c.Z,{size:18})})]}),ed.getIsSomeRowsSelected()||ed.getIsAllRowsSelected()?a.jsx("div",{className:"flex px-4 pb-4",children:s?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(g.z,{className:"ml-2",onClick:()=>{let e=[];ed.getSelectedRowModel().rows.forEach(t=>{e.push(Q({variables:{id:t.original.id,input:{archived:!1}}}))}),Promise.all(e).then(()=>{ed.resetRowSelection(),D({title:"Unarchived items",description:"We unarchived "+e.length+" items."})})},variant:"secondary",disabled:ee.loading,children:[ee.loading?a.jsx(j.g,{}):a.jsx(u.Z,{className:"size-4"}),a.jsx("span",{className:"ml-2",children:"Unarchive selected"})]}),(0,a.jsxs)(g.z,{className:"ml-2",onClick:()=>{let t=[];ed.getSelectedRowModel().rows.forEach(s=>{t.push(et({variables:{context:e,id:s.original.id}}))}),Promise.all(t).then(()=>{ed.resetRowSelection(),D({title:"Deleted items",description:"We deleted "+t.length+" items."})})},variant:"secondary",disabled:es.loading,children:[es.loading?a.jsx(j.g,{}):a.jsx(m.Z,{className:"size-4"}),a.jsx("span",{className:"ml-2",children:"Delete selected"})]})]}):(0,a.jsxs)(g.z,{className:"ml-2",onClick:()=>{let e=[];ed.getSelectedRowModel().rows.forEach(t=>{e.push(Q({variables:{id:t.original?.id,input:{archived:!0}}}))}),Promise.all(e).then(()=>{ed.resetRowSelection(),D({title:"Archived items",description:"We archived "+e.length+" items."})})},variant:"secondary",disabled:ee.loading,children:[ee.loading?a.jsx(j.g,{}):a.jsx(x.Z,{className:"size-4"}),a.jsx("span",{className:"ml-2",children:"Archive selected"})]})}):null,B?a.jsx(v.x,{className:"h-screen",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2 p-4 pt-0",children:[a.jsx(y.O,{className:"mb-2 h-[100px] w-full rounded-lg"}),a.jsx(y.O,{className:"mb-2 h-[100px] w-full rounded-lg"}),a.jsx(y.O,{className:"mb-2 h-[100px] w-full rounded-lg"}),a.jsx(y.O,{className:"mb-2 h-[100px] w-full rounded-lg"}),a.jsx(y.O,{className:"mb-2 h-[100px] w-full rounded-lg"}),a.jsx(y.O,{className:"h-[100px] w-full rounded-lg"})]})}):(0,a.jsxs)("div",{className:"flex max-h-[75vh] flex-col",children:[a.jsx(v.x,{className:"h-screen grow",children:a.jsx("div",{className:"space-y-4",children:a.jsx("div",{className:"border-y",children:a.jsx(b.iA,{children:a.jsx(b.RM,{children:ed.getRowModel().rows?.length?ed.getRowModel().rows.map(e=>a.jsx(b.SC,{className:(0,w.cn)(t===e.original.id?"bg-secondary dark:text-white":""),"data-state":e.getIsSelected()&&"selected",children:e.getVisibleCells().map((t,s)=>s>0?a.jsx(b.pj,{className:"cursor-pointer",onClick:()=>{em(e.original.id)},children:(0,d.ie)(t.column.columnDef.cell,t.getContext())},t.id):a.jsx(b.pj,{children:(0,d.ie)(t.column.columnDef.cell,t.getContext())},t.id))},e.id)):a.jsx(b.SC,{children:a.jsx(b.pj,{colSpan:C.length,className:"h-24 text-center",children:"No results."})})})})})})}),(0,a.jsxs)("div",{className:"flex items-center justify-between px-2 pb-2",children:[(0,a.jsxs)("div",{className:"flex-1 text-sm text-muted-foreground",children:[ed.getFilteredSelectedRowModel().rows.length," of"," ",ed.getFilteredRowModel().rows.length," row(s) selected (total"," ",Y?.pageInfo.itemCount," items)."]}),a.jsx("div",{className:"flex items-center space-x-6 lg:space-x-8",children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsxs)(g.z,{variant:"outline",className:"hidden size-8 p-0 lg:flex",onClick:()=>{eu({page:1,search:Z??void 0})},disabled:!Y?.pageInfo.hasPreviousPage,children:[a.jsx("span",{className:"sr-only",children:"Go to first page"}),a.jsx(n.kRt,{className:"size-4"})]}),(0,a.jsxs)(g.z,{variant:"outline",className:"size-8 p-0",onClick:()=>{console.log("itemsData.data?.pageInfo.hasPreviousPage",Y?.pageInfo.hasPreviousPage),eu({page:Y?.pageInfo.hasPreviousPage?E-1:void 0,search:Z??void 0})},disabled:!Y?.pageInfo.hasPreviousPage||B,children:[a.jsx("span",{className:"sr-only",children:"Go to previous page"}),a.jsx(n.wyc,{className:"size-4"})]}),(0,a.jsxs)(g.z,{variant:"outline",className:"size-8 p-0",onClick:()=>{eu({page:Y?.pageInfo.hasNextPage?E+1:void 0,search:Z??void 0})},disabled:!Y?.pageInfo.hasNextPage||B,children:[a.jsx("span",{className:"sr-only",children:"Go to next page"}),a.jsx(n.XCv,{className:"size-4"})]})]})})]})]})]})}var _=s(567),D=s(76557);let M=(0,D.Z)("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),{createElement:q,createContext:A,createRef:L,forwardRef:T,useCallback:$,useContext:F,useEffect:O,useImperativeHandle:G,useLayoutEffect:V,useMemo:J,useRef:B,useState:U}=l,W=l["useId".toString()],X=A(null);X.displayName="PanelGroupContext";let H="function"==typeof W?W:()=>null,Y=0;function K(e=null){let t=H(),s=B(e||t||null);return null===s.current&&(s.current=""+Y++),null!=e?e:s.current}function Q({children:e,className:t="",collapsedSize:s,collapsible:a,defaultSize:l,forwardedRef:n,id:r,maxSize:i,minSize:d,onCollapse:o,onExpand:c,onResize:u,order:m,style:x,tagName:h="div",...p}){let g=F(X);if(null===g)throw Error("Panel components must be rendered within a PanelGroup container");let{collapsePanel:f,expandPanel:j,getPanelSize:v,getPanelStyle:y,groupId:b,isPanelCollapsed:N,reevaluatePanelConstraints:w,registerPanel:k,resizePanel:C,unregisterPanel:z}=g,S=K(r),E=B({callbacks:{onCollapse:o,onExpand:c,onResize:u},constraints:{collapsedSize:s,collapsible:a,defaultSize:l,maxSize:i,minSize:d},id:S,idIsFromProps:void 0!==r,order:m});B({didLogMissingDefaultSizeWarning:!1}),G(n,()=>({collapse:()=>{f(E.current)},expand:()=>{j(E.current)},getId:()=>S,getSize:()=>v(E.current),isCollapsed:()=>N(E.current),isExpanded:()=>!N(E.current),resize:e=>{C(E.current,e)}}),[f,j,v,N,S,C]);let R=y(E.current,l);return q(h,{...p,children:e,className:t,style:{...R,...x},"data-panel":"","data-panel-id":S,"data-panel-group-id":b,"data-panel-collapsible":void 0,"data-panel-size":void 0})}let ee=T((e,t)=>q(Q,{...e,forwardedRef:t}));function et(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}function es(e,t,s=10){let a=(e=parseFloat(e.toFixed(s)))-(t=parseFloat(t.toFixed(s)));return 0===a?0:a>0?1:-1}function ea(e,t,s){return 0===es(e,t,s)}function el({panelConstraints:e,panelIndex:t,size:s}){let a=e[t];et(null!=a);let{collapsedSize:l=0,collapsible:n,maxSize:r=100,minSize:i=0}=a;return 0>es(s,i)&&(s=n&&0>es(s,(l+i)/2)?l:i),s=parseFloat((s=Math.min(r,s)).toFixed(10))}function en({delta:e,layout:t,panelConstraints:s,pivotIndices:a,trigger:l}){if(ea(e,0))return t;let n=[...t],[r,i]=a;et(null!=r),et(null!=i);let d=0;if("keyboard"===l){{let a=e<0?i:r,l=s[a];if(et(l),l.collapsible){let l=t[a];et(null!=l);let n=s[a];et(n);let{collapsedSize:r=0,minSize:i=0}=n;if(ea(l,r)){let t=i-l;es(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let a=e<0?r:i,l=s[a];et(l);let{collapsible:n}=l;if(n){let l=t[a];et(null!=l);let n=s[a];et(n);let{collapsedSize:r=0,minSize:i=0}=n;if(ea(l,i)){let t=l-r;es(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}}{let a=e<0?1:-1,l=e<0?i:r,n=0;for(;;){let e=t[l];if(et(null!=e),n+=el({panelConstraints:s,panelIndex:l,size:100})-e,(l+=a)<0||l>=s.length)break}let d=Math.min(Math.abs(e),Math.abs(n));e=e<0?0-d:d}{let a=e<0?r:i;for(;a>=0&&a<s.length;){let l=Math.abs(e)-Math.abs(d),r=t[a];et(null!=r);let i=el({panelConstraints:s,panelIndex:a,size:r-l});if(!ea(r,i)&&(d+=r-i,n[a]=i,d.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?a--:a++}}if(ea(d,0))return t;{let a=e<0?i:r,l=t[a];et(null!=l);let o=l+d,c=el({panelConstraints:s,panelIndex:a,size:o});if(n[a]=c,!ea(c,o)){let t=o-c,a=e<0?i:r;for(;a>=0&&a<s.length;){let l=n[a];et(null!=l);let r=el({panelConstraints:s,panelIndex:a,size:l+t});if(ea(l,r)||(t-=r-l,n[a]=r),ea(t,0))break;e>0?a--:a++}}}return ea(n.reduce((e,t)=>t+e,0),100)?n:t}function er(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function ei(e,t,s=document){let a=er(e,s).findIndex(e=>e.getAttribute("data-panel-resize-handle-id")===t);return null!=a?a:null}function ed(e,t,s){let a=ei(e,t,s);return null!=a?[a,a+1]:[-1,-1]}function eo(e,t=document){var s;return t instanceof HTMLElement&&(null==t?void 0:null===(s=t.dataset)||void 0===s?void 0:s.panelGroupId)==e?t:t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`)||null}function ec(e,t=document){return t.querySelector(`[data-panel-resize-handle-id="${e}"]`)||null}function eu(e){return"keydown"===e.type}function em(e){return e.type.startsWith("mouse")}function ex(e){return e.type.startsWith("touch")}function eh(e,t){let s="horizontal"===e;if(em(t))return s?t.clientX:t.clientY;if(ex(t)){let e=t.touches[0];return et(e),s?e.screenX:e.screenY}throw Error(`Unsupported event type "${t.type}"`)}function ep(e,t,s){t.forEach((t,a)=>{let l=e[a];et(l);let{callbacks:n,constraints:r,id:i}=l,{collapsedSize:d=0,collapsible:o}=r,c=s[i];if(null==c||t!==c){s[i]=t;let{onCollapse:e,onExpand:a,onResize:l}=n;l&&l(t,c),o&&(e||a)&&(a&&(null==c||c===d)&&t!==d&&a(),e&&(null==c||c!==d)&&t===d&&e())}})}function eg(e,t){if(e.length!==t.length)return!1;for(let s=0;s<e.length;s++)if(e[s]!=t[s])return!1;return!0}Q.displayName="Panel",ee.displayName="forwardRef(Panel)";let ef=null,ej=null;function ev(e){switch(e){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function ey(e){if(ef===e)return;ef=e;let t=ev(e);null===ej&&(ej=document.createElement("style"),document.head.appendChild(ej)),ej.innerHTML=`*{cursor: ${t}!important;}`}function eb(e){try{if("undefined"!=typeof localStorage)e.getItem=e=>localStorage.getItem(e),e.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function eN(e){return`react-resizable-panels:${e}`}function ew(e,t,s,a,l){var n;let r=eN(e),i=t.map(e=>{let{constraints:t,id:s,idIsFromProps:a,order:l}=e;return a?s:l?`${l}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(","),d=null!==(n=function(e,t){try{let s=eN(e),a=t.getItem(s);if(a){let e=JSON.parse(a);if("object"==typeof e&&null!=e)return e}}catch(e){}return null}(e,l))&&void 0!==n?n:{};d[i]={expandToSizes:Object.fromEntries(s.entries()),layout:a};try{l.setItem(r,JSON.stringify(d))}catch(e){console.error(e)}}let ek={getItem:e=>(eb(ek),ek.getItem(e)),setItem:(e,t)=>{eb(ek),ek.setItem(e,t)}},eC={};function ez({autoSaveId:e=null,children:t,className:s="",direction:a,forwardedRef:l,id:n=null,onLayout:r=null,keyboardResizeBy:i=null,storage:d=ek,style:o,tagName:c="div",...u}){let m=K(n),x=B(null),[h,p]=U(null),[g,f]=U([]),j=B({}),v=B(new Map),y=B(0),b=B({autoSaveId:e,direction:a,dragState:h,id:m,keyboardResizeBy:i,onLayout:r,storage:d}),N=B({layout:g,panelDataArray:[],panelDataArrayChanged:!1});B({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),G(l,()=>({getId:()=>b.current.id,getLayout:()=>{let{layout:e}=N.current;return e},setLayout:e=>{let{onLayout:t}=b.current,{layout:s,panelDataArray:a}=N.current,l=function({layout:e,panelConstraints:t}){let s=[...e],a=s.reduce((e,t)=>e+t,0);if(s.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${s.map(e=>`${e}%`).join(", ")}`);if(!ea(a,100))for(let e=0;e<t.length;e++){let t=s[e];et(null!=t);let l=100/a*t;s[e]=l}let l=0;for(let e=0;e<t.length;e++){let a=s[e];et(null!=a);let n=el({panelConstraints:t,panelIndex:e,size:a});a!=n&&(l+=a-n,s[e]=n)}if(!ea(l,0))for(let e=0;e<t.length;e++){let a=s[e];et(null!=a);let n=el({panelConstraints:t,panelIndex:e,size:a+l});if(a!==n&&(l-=n-a,s[e]=n,ea(l,0)))break}return s}({layout:e,panelConstraints:a.map(e=>e.constraints)});!function(e,t){if(e.length!==t.length)return!1;for(let s=0;s<e.length;s++)if(e[s]!==t[s])return!1;return!0}(s,l)&&(f(l),N.current.layout=l,t&&t(l),ep(a,l,j.current))}}),[]),function({committedValuesRef:e,eagerValuesRef:t,groupId:s,layout:a,panelDataArray:l,panelGroupElement:n,setLayout:r}){B({didWarnAboutMissingResizeHandle:!1}),O(()=>{if(!n)return;let e=t.current;et(e);let{panelDataArray:l}=e;et(null!=eo(s,n),`No group found for id "${s}"`);let i=er(s,n);et(i);let d=i.map(e=>{let t=e.getAttribute("data-panel-resize-handle-id");et(t);let[i,d]=function(e,t,s,a=document){var l,n,r,i;let d=ec(t,a),o=er(e,a),c=d?o.indexOf(d):-1;return[null!==(l=null===(n=s[c])||void 0===n?void 0:n.id)&&void 0!==l?l:null,null!==(r=null===(i=s[c+1])||void 0===i?void 0:i.id)&&void 0!==r?r:null]}(s,t,l,n);if(null==i||null==d)return()=>{};let o=e=>{if(!e.defaultPrevented&&"Enter"===e.key){e.preventDefault();let d=l.findIndex(e=>e.id===i);if(d>=0){let e=l[d];et(e);let i=a[d],{collapsedSize:o=0,collapsible:c,minSize:u=0}=e.constraints;if(null!=i&&c){let e=en({delta:ea(i,o)?u-o:o-i,layout:a,panelConstraints:l.map(e=>e.constraints),pivotIndices:ed(s,t,n),trigger:"keyboard"});a!==e&&r(e)}}}};return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}});return()=>{d.forEach(e=>e())}},[n,e,t,s,a,l,r])}({committedValuesRef:b,eagerValuesRef:N,groupId:m,layout:g,panelDataArray:N.current.panelDataArray,setLayout:f,panelGroupElement:x.current}),O(()=>{let{panelDataArray:t}=N.current;if(e){if(0===g.length||g.length!==t.length)return;let s=eC[e];null==s&&(s=function(e,t=10){let s=null;return(...a)=>{null!==s&&clearTimeout(s),s=setTimeout(()=>{e(...a)},t)}}(ew,100),eC[e]=s),s(e,[...t],new Map(v.current),g,d)}},[e,g,d]),O(()=>{});let w=$(e=>{let{onLayout:t}=b.current,{layout:s,panelDataArray:a}=N.current;if(e.constraints.collapsible){let l=a.map(e=>e.constraints),{collapsedSize:n=0,panelSize:r,pivotIndices:i}=eR(a,e,s);if(et(null!=r),r!==n){v.current.set(e.id,r);let d=en({delta:eE(a,e)===a.length-1?r-n:n-r,layout:s,panelConstraints:l,pivotIndices:i,trigger:"imperative-api"});eg(s,d)||(f(d),N.current.layout=d,t&&t(d),ep(a,d,j.current))}}},[]),k=$(e=>{let{onLayout:t}=b.current,{layout:s,panelDataArray:a}=N.current;if(e.constraints.collapsible){let l=a.map(e=>e.constraints),{collapsedSize:n=0,panelSize:r,minSize:i=0,pivotIndices:d}=eR(a,e,s);if(r===n){let n=v.current.get(e.id),o=null!=n&&n>=i?n:i,c=en({delta:eE(a,e)===a.length-1?r-o:o-r,layout:s,panelConstraints:l,pivotIndices:d,trigger:"imperative-api"});eg(s,c)||(f(c),N.current.layout=c,t&&t(c),ep(a,c,j.current))}}},[]),C=$(e=>{let{layout:t,panelDataArray:s}=N.current,{panelSize:a}=eR(s,e,t);return et(null!=a),a},[]),z=$((e,t)=>{let{panelDataArray:s}=N.current,a=eE(s,e);return function({defaultSize:e,dragState:t,layout:s,panelData:a,panelIndex:l,precision:n=3}){let r=s[l];return{flexBasis:0,flexGrow:null==r?null!=e?e:"1":1===a.length?"1":r.toPrecision(n),flexShrink:1,overflow:"hidden",pointerEvents:null!==t?"none":void 0}}({defaultSize:t,dragState:h,layout:g,panelData:s,panelIndex:a})},[h,g]),S=$(e=>{let{layout:t,panelDataArray:s}=N.current,{collapsedSize:a=0,collapsible:l,panelSize:n}=eR(s,e,t);return!0===l&&n===a},[]),E=$(e=>{let{layout:t,panelDataArray:s}=N.current,{collapsedSize:a=0,collapsible:l,panelSize:n}=eR(s,e,t);return et(null!=n),!l||n>a},[]),R=$(e=>{let{panelDataArray:t}=N.current;t.push(e),t.sort((e,t)=>{let s=e.order,a=t.order;return null==s&&null==a?0:null==s?-1:null==a?1:s-a}),N.current.panelDataArrayChanged=!0},[]),P=$(e=>function(t){t.preventDefault();let s=x.current;if(!s)return()=>null;let{direction:a,dragState:l,id:n,keyboardResizeBy:r,onLayout:i}=b.current,{layout:d,panelDataArray:o}=N.current,{initialLayout:c}=null!=l?l:{},u=ed(n,e,s),m=function(e,t,s,a,l,n){if(eu(e)){let t="horizontal"===s,a=0;a=e.shiftKey?100:null!=l?l:10;let n=0;switch(e.key){case"ArrowDown":n=t?0:a;break;case"ArrowLeft":n=t?-a:0;break;case"ArrowRight":n=t?a:0;break;case"ArrowUp":n=t?0:-a;break;case"End":n=100;break;case"Home":n=-100}return n}return null==a?0:function(e,t,s,a,l){let n="horizontal"===s,r=ec(t,l);et(r);let i=r.getAttribute("data-panel-group-id");et(i);let{initialCursorPosition:d}=a,o=eh(s,e),c=eo(i,l);et(c);let u=c.getBoundingClientRect();return(o-d)/(n?u.width:u.height)*100}(e,t,s,a,n)}(t,e,a,l,r,s);if(0===m)return;let h="horizontal"===a;"rtl"===document.dir&&h&&(m=-m);let p=en({delta:m,layout:null!=c?c:d,panelConstraints:o.map(e=>e.constraints),pivotIndices:u,trigger:eu(t)?"keyboard":"mouse-or-touch"}),g=!eg(d,p);(em(t)||ex(t))&&y.current!=m&&(y.current=m,g?ey(h?"horizontal":"vertical"):h?ey(m<0?"horizontal-min":"horizontal-max"):ey(m<0?"vertical-min":"vertical-max")),g&&(f(p),N.current.layout=p,i&&i(p),ep(o,p,j.current))},[]),I=$((e,t)=>{let{onLayout:s}=b.current,{layout:a,panelDataArray:l}=N.current,n=l.map(e=>e.constraints),{panelSize:r,pivotIndices:i}=eR(l,e,a);et(null!=r);let d=en({delta:eE(l,e)===l.length-1?r-t:t-r,layout:a,panelConstraints:n,pivotIndices:i,trigger:"imperative-api"});eg(a,d)||(f(d),N.current.layout=d,s&&s(d),ep(l,d,j.current))},[]),Z=$((e,t)=>{let{layout:s,panelDataArray:a}=N.current,{collapsedSize:l=0,collapsible:n}=t,{collapsedSize:r=0,collapsible:i,maxSize:d=100,minSize:o=0}=e.constraints,{panelSize:c}=eR(a,e,s);et(null!=c),n&&i&&c===l?l!==r&&I(e,r):c<o?I(e,o):c>d&&I(e,d)},[I]),_=$((e,t)=>{let{direction:s}=b.current,{layout:a}=N.current;if(!x.current)return;let l=ec(e,x.current);et(l);let n=eh(s,t);p({dragHandleId:e,dragHandleRect:l.getBoundingClientRect(),initialCursorPosition:n,initialLayout:a})},[]),D=$(()=>{null!==ej&&(document.head.removeChild(ej),ef=null,ej=null),p(null)},[]),M=$(e=>{let{panelDataArray:t}=N.current,s=eE(t,e);s>=0&&(t.splice(s,1),delete j.current[e.id],N.current.panelDataArrayChanged=!0)},[]),A=J(()=>({collapsePanel:w,direction:a,dragState:h,expandPanel:k,getPanelSize:C,getPanelStyle:z,groupId:m,isPanelCollapsed:S,isPanelExpanded:E,reevaluatePanelConstraints:Z,registerPanel:R,registerResizeHandle:P,resizePanel:I,startDragging:_,stopDragging:D,unregisterPanel:M,panelGroupElement:x.current}),[w,h,a,k,C,z,m,S,E,Z,R,P,I,_,D,M]);return q(X.Provider,{value:A},q(c,{...u,children:t,className:s,style:{display:"flex",flexDirection:"horizontal"===a?"row":"column",height:"100%",overflow:"hidden",width:"100%",...o},ref:x,"data-panel-group":"","data-panel-group-direction":a,"data-panel-group-id":m}))}let eS=T((e,t)=>q(ez,{...e,forwardedRef:t}));function eE(e,t){return e.findIndex(e=>e===t||e.id===t.id)}function eR(e,t,s){let a=eE(e,t),l=a===e.length-1,n=s[a];return{...t.constraints,panelSize:n,pivotIndices:l?[a-1,a]:[a,a+1]}}function eP({children:e=null,className:t="",disabled:s=!1,id:a,onDragging:l,style:n={},tabIndex:r=0,tagName:i="div",...d}){let o=B(null),c=B({onDragging:l});O(()=>{c.current.onDragging=l});let u=F(X);if(null===u)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");let{direction:m,dragState:x,groupId:h,registerResizeHandle:p,startDragging:g,stopDragging:f,panelGroupElement:j}=u,v=K(a),y=(null==x?void 0:x.dragHandleId)===v,[b,N]=U(!1),[w,k]=U(null),C=$(()=>{let e=o.current;et(e),e.blur(),f();let{onDragging:t}=c.current;t&&t(!1)},[f]);O(()=>{if(s)k(null);else{let e=p(v);k(()=>e)}},[s,v,p]),O(()=>{if(s||null==w||!y)return;let e=e=>{w(e)},t=e=>{w(e)},a=o.current;et(a);let l=a.ownerDocument;return l.body.addEventListener("contextmenu",C),l.body.addEventListener("mousemove",e),l.body.addEventListener("touchmove",e),l.body.addEventListener("mouseleave",t),window.addEventListener("mouseup",C),window.addEventListener("touchend",C),()=>{l.body.removeEventListener("contextmenu",C),l.body.removeEventListener("mousemove",e),l.body.removeEventListener("touchmove",e),l.body.removeEventListener("mouseleave",t),window.removeEventListener("mouseup",C),window.removeEventListener("touchend",C)}},[m,s,y,w,C]),function({disabled:e,handleId:t,resizeHandler:s,panelGroupElement:a}){O(()=>{if(e||null==s||null==a)return;let l=ec(t,a);if(null==l)return;let n=e=>{if(!e.defaultPrevented)switch(e.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":e.preventDefault(),s(e);break;case"F6":{e.preventDefault();let s=l.getAttribute("data-panel-group-id");et(s);let n=er(s,a),r=ei(s,t,a);et(null!==r);let i=e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0;n[i].focus()}}};return l.addEventListener("keydown",n),()=>{l.removeEventListener("keydown",n)}},[a,e,t,s])}({disabled:s,handleId:v,resizeHandler:w,panelGroupElement:j});let z={cursor:ev(m),touchAction:"none",userSelect:"none"};return q(i,{...d,children:e,className:t,onBlur:()=>N(!1),onFocus:()=>N(!0),onMouseDown:e=>{g(v,e.nativeEvent);let t=c.current;et(t);let{onDragging:s}=t;s&&s(!0)},onMouseUp:C,onTouchCancel:C,onTouchEnd:C,onTouchStart:e=>{g(v,e.nativeEvent);let t=c.current;et(t);let{onDragging:s}=t;s&&s(!0)},ref:o,role:"separator",style:{...z,...n},tabIndex:r,"data-panel-group-direction":m,"data-panel-group-id":h,"data-resize-handle":"","data-resize-handle-active":y?"pointer":b?"keyboard":void 0,"data-panel-resize-handle-enabled":!s,"data-panel-resize-handle-id":v})}ez.displayName="PanelGroup",eS.displayName="forwardRef(PanelGroup)",eP.displayName="PanelResizeHandle";let eI=({className:e,...t})=>a.jsx(eS,{className:(0,w.cn)("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),eZ=({withHandle:e,className:t,...s})=>a.jsx(eP,{className:(0,w.cn)("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...s,children:e&&a.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:a.jsx(M,{className:"size-2.5"})})});var e_=s(8281),eD=s(79210),eM=s(68232),eq=s(44389),eA=s(86333),eL=s(3240),eT=s(65983),e$=s(42924);let eF=(0,D.Z)("ArchiveX",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"m9.5 17 5-5",key:"nakeu6"}],["path",{d:"m9.5 12 5 5",key:"1hccrj"}]]);var eO=s(88378),eG=s(75909),eV=s(90434);let eJ=({index:e,folder:t,edit:s,indented:l,children:n})=>(0,a.jsxs)("div",{className:"flex flex-col ",children:[(0,a.jsxs)("div",{className:(0,w.cn)((0,g.d)({variant:t.variant,size:"sm"}),l?"pl-5":null,t.active?"dark:bg-muted dark:text-white dark:hover:bg-muted dark:hover:text-white":null,"justify-start"),children:[(0,a.jsxs)(eV.default,{className:"flex",href:t.href||"",children:[a.jsx(t.icon,{className:"mr-2 size-4"}),!t.icon&&t.label,null!==t.icon&&a.jsx("span",{className:(0,w.cn)("ml-0 overflow-hidden text-ellipsis max-w-[170px]","default"===t.variant&&"text-background dark:text-white"),children:t.label})]},e),s&&a.jsx(eq.Z,{onClick:()=>{s()},className:"ml-auto size-4 opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer"})]}),a.jsx("div",{children:n})]}),eB=({activeFolder:e,activeArchived:t,activeSettings:s})=>{let{data:l,loading:n,error:r}=(0,eG.t)();return a.jsx(a.Fragment,{children:(0,a.jsxs)("div",{className:"group flex flex-col gap-4 py-2 data-[collapsed=true]:py-2 pb-5",children:[e?a.jsx("div",{className:"flex items-center gap-2",children:a.jsx(g.z,{variant:"link",size:"sm",asChild:!0,children:(0,a.jsxs)(eV.default,{href:"/data",children:[a.jsx(eA.Z,{className:"size-4"}),a.jsx("span",{className:"ml-2",children:"Back to dashboard"})]})})}):a.jsx("div",{className:"flex items-center gap-2",children:a.jsx("span",{className:"text-sm text-muted-foreground ml-5 pt-3",children:"Select a context:"})}),a.jsx("nav",{className:"grid gap-1 px-2 group-[[data-collapsed=true]]:justify-center group-[[data-collapsed=true]]:px-2",children:n?a.jsx(eJ,{index:111,folder:{label:"Loading...",active:!1,icon:eL.Z,variant:"ghost"}}):l?.contexts?.items.map((l,n)=>a.jsx(eJ,{index:n,folder:{label:`${l.name}`,icon:eT.Z,variant:"ghost",href:`/data/${l.id}`},children:e?.toLowerCase()===`${l.id}`.toLowerCase()&&a.jsxs(a.Fragment,{children:[a.jsx(eJ,{index:n,indented:!0,folder:{label:"Active data",active:e?.toLowerCase()===`${l.id}`.toLowerCase()&&!t&&!s,icon:e$.Z,variant:e?.toLowerCase()!==`${l.id}`.toLowerCase()||t||s?"ghost":"default",href:`/data/${l.id}`}}),a.jsx(eJ,{index:n+1e3,indented:!0,folder:{label:"Archived data",active:t,icon:eF,variant:t?"default":"ghost",href:`/data/${l.id}/archived`}}),a.jsx(eJ,{index:n+1e3,indented:!0,folder:{label:"Settings",active:s,icon:eO.Z,variant:s?"default":"ghost",href:`/data/${l.id}/settings`}})]})},l.id))})]},e+t+s)})};function eU({children:e,params:t}){let s=t.query&&"archived"===t.query[1],l=t.query&&"settings"===t.query[1],n=t.query&&t.query[0],r=null;return t.query&&s?r=t.query[2]||null:t.query&&!l&&(r=t.query[1]||null),a.jsx(eM.pn,{delayDuration:0,children:(0,a.jsxs)(eI,{direction:"horizontal",onLayout:e=>{document.cookie=`react-resizable-panels:layout=${JSON.stringify(e)}`},className:"h-full items-stretch",children:[(0,a.jsxs)(ee,{defaultSize:15,collapsedSize:4,collapsible:!0,minSize:15,maxSize:20,children:[a.jsx(e_.Z,{}),a.jsx(eB,{activeFolder:n,activeArchived:s,activeSettings:l}),a.jsx(e_.Z,{}),a.jsx("div",{className:"p-3 opacity-50",children:(0,a.jsxs)(z.bZ,{variant:"default",children:[a.jsx(_.C,{className:"mb-2",variant:"secondary",children:"coming soon"}),a.jsx(z.Cd,{children:"Custom views"}),a.jsx(z.X,{children:"Will enable you to store filter settings."})]})})]}),n&&!l&&(0,a.jsxs)(a.Fragment,{children:[a.jsx(eZ,{withHandle:!0}),a.jsx(ee,{defaultSize:20,minSize:20,children:(0,a.jsxs)(eD.mQ,{defaultValue:"all",children:[a.jsx("div",{className:"flex items-center px-4 py-2 h-full",children:a.jsx("h1",{className:"text-xl font-bold",children:"Items"})}),a.jsx(e_.Z,{}),a.jsx(Z,{activeFolder:n,activeItem:r??void 0,archived:s})]})})]}),a.jsx(eZ,{withHandle:!0}),a.jsx(ee,{defaultSize:65,children:a.jsx("div",{className:"max-h-full overflow-y-auto",children:e})})]})})}},26533:(e,t,s)=>{"use strict";s.a(e,async(e,a)=>{try{s.r(t),s.d(t,{default:()=>h});var l=s(10326),n=s(65063);s(17577);var r=s(69771),i=s(53951),d=s(39167),o=s(42270),c=s(43273),u=s(65304),m=s(76812),x=e([n]);function h({params:e}){let{data:t,loading:s,error:a}=(0,d.aM)(o.fV,{skip:!e?.query?.[0],variables:{id:e?.query?.[0]}});if(!e.query)return l.jsx("div",{className:"grow flex flex-col",children:l.jsx(r.Z,{})});let x=e.query[0]||null,h="archived"===e.query[1],p="settings"===e.query[1];if(p)return l.jsx(i.c,{expand:!0,actions:!0,context:x});let g=null;return(h?g=e.query[2]||null:p||(g=e.query[1]||null),s||!t?.contextById)?(0,l.jsxs)("div",{className:"p-8 text-center text-muted-foreground",children:[l.jsx(u.O,{className:"w-full h-[80px] rounded-md"}),l.jsx(u.O,{className:"w-full h-[50px] rounded-md mt-3"}),l.jsx(u.O,{className:"w-full h-[80px] rounded-md mt-3"}),l.jsx(u.O,{className:"w-full h-[80px] rounded-md mt-3"}),l.jsx(u.O,{className:"w-full h-[80px] rounded-md mt-3"}),l.jsx(u.O,{className:"w-full h-[80px] rounded-md mt-3"})]}):a?(0,l.jsxs)(c.bZ,{variant:"destructive",children:[l.jsx(m.LPM,{className:"size-4"}),l.jsx(c.Cd,{children:"Error"}),l.jsx(c.X,{children:a?.message||"Error loading item."})]}):l.jsx(n.H,{actions:!0,context:t?.contextById,itemId:g})}n=(x.then?(await x)():x)[0],a()}catch(e){a(e)}})},53951:(e,t,s)=>{"use strict";s.d(t,{c:()=>z});var a=s(10326),l=s(39167),n=s(18753),r=s(86333),i=s(231),d=s(35047),o=s(17577),c=s(567),u=s(90772),m=s(33071),x=s(8281),h=s(65685),p=s(32663),g=s(90434),f=s(65304),j=s(29718),v=s(42270);function y({contextId:e}){let t=(0,o.useRef)(new Date(Date.now()-18144e5).toISOString()),{loading:s,data:n,refetch:r,previousData:i,error:d}=(0,l.aM)((0,v.P3)(e,[]),{fetchPolicy:"no-cache",nextFetchPolicy:"network-only",variables:{context:e,page:1,limit:5,filters:[{embeddings_updated_at:{gte:t.current}}],sort:{field:"embeddings_updated_at",direction:"DESC"}}}),c=n?.[e+v.Md];return s?(0,a.jsxs)("div",{className:"flex flex-col gap-2 pt-0",children:[a.jsx(f.O,{className:"w-full h-[50px] rounded-lg mb-2"}),a.jsx(f.O,{className:"w-full h-[50px] rounded-lg mb-2"}),a.jsx(f.O,{className:"w-full h-[50px] rounded-lg"})]}):a.jsx("div",{className:"space-y-8",children:c?.items?.length?c?.items?.map((t,s)=>a.jsx("div",{className:"flex items-center",children:a.jsx("div",{className:"space-y-1",children:a.jsx("p",{className:"text-sm font-medium leading-none",children:a.jsxs(g.default,{className:"hover:dark:text-blue-500 hover:underline",href:"/data/"+e+"/"+t.id,children:[a.jsx(j.L,{text:t.name??"",length:50}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:["created at: ",t.embeddings_updated_at?p.Q(new Date(t.embeddings_updated_at),{addSuffix:!0}):"never","."]})]})})})},s)):a.jsx("div",{className:"flex flex-col gap-2 pt-0",children:a.jsx("p",{className:"text-sm font-medium leading-none",children:"No recent embeddings."})})})}var b=s(43273),N=s(76812),w=s(60097),k=s(99440),C=s(34789);function z(e){let[t,s]=(0,o.useState)(null),{toast:p}=(0,C.pm)(),{data:g,loading:j,error:z}=(0,l.aM)(v.fV,{variables:{id:e.context}}),S=g?.contextById,E=(0,d.useRouter)(),[R,P]=(0,n.D)((0,v.Eq)(e.context),{onCompleted:t=>{let s=t[e.context+"_itemsGenerateChunks"];if(s.jobs?.length>0){p({title:"Chunks generation started",description:"Jobs have been started in the background, depending on the size of the item this may take a while."});return}p({title:"Chunks generated",description:"Chunks generated successfully."})}}),[I,Z]=(0,n.D)((0,v.ps)(e.context),{onCompleted:t=>{let s=t[e.context+"_itemsDeleteChunks"];if(s.jobs?.length>0){p({title:"Chunks deletion started",description:"Jobs have been started in the background, depending on the size of the item this may take a while."});return}p({title:"Chunks deleted",description:"Chunks deleted successfully."})}});return j?(0,a.jsxs)("div",{className:"p-8 text-center text-muted-foreground",children:[a.jsx(f.O,{className:"w-full h-[80px] rounded-md"}),a.jsx(f.O,{className:"w-full h-[50px] rounded-md mt-3"}),a.jsx(f.O,{className:"w-full h-[80px] rounded-md mt-3"}),a.jsx(f.O,{className:"w-full h-[80px] rounded-md mt-3"}),a.jsx(f.O,{className:"w-full h-[80px] rounded-md mt-3"}),a.jsx(f.O,{className:"w-full h-[80px] rounded-md mt-3"})]}):z?(0,a.jsxs)(b.bZ,{variant:"destructive",children:[a.jsx(N.LPM,{className:"size-4"}),a.jsx(b.Cd,{children:"Error"}),a.jsx(b.X,{children:z?.message||"Error loading item."})]}):(0,a.jsxs)("div",{className:"flex h-full flex-col",children:[e.actions?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex p-2 justify-between",children:[a.jsx("div",{className:"flex items-center gap-2"}),(0,a.jsxs)(u.z,{onClick:()=>{E.push("/context")},variant:"ghost",size:"icon",children:[a.jsx(r.Z,{className:"size-4"}),a.jsx("span",{className:"sr-only",children:"Back"})]})]}),a.jsx(x.Z,{})]}):null,S?(0,a.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,a.jsxs)(m.Zb,{className:"border-0 rounded-none",children:[a.jsx(m.Ol,{children:a.jsx(m.ll,{className:"text-lg",children:"Settings"})}),a.jsx(m.aY,{className:"grid gap-4",children:a.jsx(h.x,{className:"max-h-[600px]",children:(0,a.jsxs)("div",{className:"space-y-6 pr-4",children:[(0,a.jsxs)("div",{children:[a.jsx("h2",{className:"text-xl font-bold",children:S.name}),a.jsx("p",{className:"text-muted-foreground mt-1",children:S.description}),(0,a.jsxs)("div",{className:"mt-3 flex items-center",children:[a.jsx("span",{className:"text-sm font-medium mr-2",children:"Embedder:"}),a.jsx(c.C,{variant:"outline",children:S.embedder||"None"})]})]}),(0,a.jsxs)("div",{children:[a.jsx("span",{className:"text-sm font-medium mr-2",children:"Calculate Vectors:"}),a.jsx(c.C,{variant:"secondary",children:S.configuration?.calculateVectors?S.configuration.calculateVectors.charAt(0).toUpperCase()+S.configuration.calculateVectors.slice(1):"Manual"}),(0,a.jsxs)("div",{className:"mt-2 text-xs text-muted-foreground",children:[(0,a.jsxs)("span",{className:"block",children:[a.jsx("b",{children:"Manual"}),": Vectors are only calculated when triggered manually."]}),(0,a.jsxs)("span",{className:"block",children:[a.jsx("b",{children:"On Update"}),": Vectors are recalculated whenever an item is updated."]}),(0,a.jsxs)("span",{className:"block",children:[a.jsx("b",{children:"On Insert"}),": Vectors are calculated when a new item is inserted."]}),(0,a.jsxs)("span",{className:"block",children:[a.jsx("b",{children:"Always"}),": Vectors are calculated on both insert and update operations."]})]})]}),(0,a.jsxs)("div",{children:[a.jsx("span",{className:"text-sm font-medium mr-2",children:"Default rights mode for new items in this context:"}),(0,a.jsxs)("div",{className:"mt-2 text-xs text-muted-foreground",children:[(0,a.jsxs)("span",{className:"block",children:[a.jsx("b",{children:"Private"}),": Only the user who created the item can view it."]}),(0,a.jsxs)("span",{className:"block",children:[a.jsx("b",{children:"Users"}),": Any user with access to the context can view the item."]}),(0,a.jsxs)("span",{className:"block",children:[a.jsx("b",{children:"Roles"}),": Any user with the role assigned to the context can view the item."]}),(0,a.jsxs)("span",{className:"block",children:[a.jsx("b",{children:"Public"}),": Any user can view the item."]})]})]}),a.jsx(x.Z,{})]})})})]}),(0,a.jsxs)(m.Zb,{className:"bg-none border-0 rounded-none",children:[a.jsx(m.Ol,{children:a.jsx(m.ll,{children:(0,a.jsxs)("div",{className:"flex items-center justify-between ml-4 mt-3 mr-4 mb-2",children:[a.jsx("h1",{className:"text-lg font-medium",children:"Embeddings"}),(0,a.jsxs)(w.h_,{children:[a.jsx(w.$F,{asChild:!0,children:(0,a.jsxs)(u.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:[a.jsx(i.Z,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Open menu"})]})}),(0,a.jsxs)(w.AW,{align:"end",children:[a.jsx(w.Xi,{onClick:()=>s("generate"),children:"Generate all embeddings"}),a.jsx(w.Xi,{onClick:()=>s("delete"),children:"Delete all embeddings"})]})]})]})})}),a.jsx(m.aY,{children:a.jsx(y,{contextId:S.id})})]})]}):a.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Context not found."}),a.jsx(k.aR,{open:"generate"===t,onOpenChange:e=>!e&&s(null),children:(0,a.jsxs)(k._T,{children:[(0,a.jsxs)(k.fY,{children:[a.jsx(k.f$,{children:"Generate Embeddings"}),a.jsx(k.yT,{children:"Are you sure you want to generate embeddings for this context? This will create new embedding vectors for every item in the context, this can take a long time, might cost money if you are using a paid service as your embedder, or require a lot of computational resources if your embedder is self hosted."})]}),(0,a.jsxs)(k.xo,{children:[a.jsx(k.le,{children:"Cancel"}),a.jsx(k.OL,{disabled:P.loading,onClick:()=>{s(null),R(),p({title:"Generating embeddings...",description:"Embeddings are being generated in the background, depending on the size of the item this may take a while."})},children:"Generate"})]})]})}),a.jsx(k.aR,{open:"delete"===t,onOpenChange:e=>!e&&s(null),children:(0,a.jsxs)(k._T,{children:[(0,a.jsxs)(k.fY,{children:[a.jsx(k.f$,{children:"Delete Embeddings"}),a.jsx(k.yT,{children:"Are you sure you want to delete all embeddings for this context? This action cannot be undone. Embeddings are used to search and filter items, deleting them will remove this functionality from the context, regenerating embeddings might take a long time, might cost money if you are using a paid service as your embedder, or require a lot of computational resources if your embedder is self hosted."})]}),(0,a.jsxs)(k.xo,{children:[a.jsx(k.le,{children:"Cancel"}),a.jsx(k.OL,{disabled:Z.loading,onClick:async()=>{s(null),I(),p({title:"Embeddings deleted",description:"All embeddings for this item have been deleted."})},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})}},69771:(e,t,s)=>{"use strict";s.d(t,{Z:()=>c});var a=s(10326),l=s(33519),n=s(17577),r=s(31051),i=s(42193),d=s(16923),o=s(22746);function c(){let[e,t]=(0,n.useState)("count"),[s,c]=(0,n.useState)({from:(0,l.k)(new Date,7),to:new Date}),[u,m]=(0,n.useState)("EMBEDDER_GENERATE"),[x,h]=(0,n.useState)("label");return(0,a.jsxs)("div",{className:"flex-1 flex flex-col p-8 pt-6 h-screen",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-8",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[a.jsx("h2",{className:"text-4xl font-bold tracking-tight bg-clip-text",children:"Contexts Dashboard"}),a.jsx("p",{className:"text-lg",children:"Monitor your contexts and their usage."})]}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsx(i.z,{dateRange:s,onDateRangeChange:c,maxDays:30})})]}),(0,a.jsxs)("div",{className:"flex-1 grid gap-6 md:grid-cols-3 min-h-0",children:[a.jsx("div",{className:"rounded-lg border md:col-span-2 p-6 flex flex-col",children:a.jsx(d.q,{dateRange:s,selectedType:u,onTypeChange:m,onUnitChange:t,unit:e,dataTypes:[r.h.CONTEXT_RETRIEVE,r.h.EMBEDDER_UPSERT,r.h.EMBEDDER_GENERATE,r.h.EMBEDDER_DELETE,r.h.CONTEXT_UPSERT]})}),a.jsx("div",{className:"rounded-lg border p-6 flex flex-col",children:a.jsx(o.Y,{groupByOptions:[],dateRange:s,selectedType:u,groupBy:x,onGroupByChange:h})})]})]})}},65063:(e,t,s)=>{"use strict";s.a(e,async(e,a)=>{try{s.d(t,{H:()=>X});var l=s(10326),n=s(39167),r=s(18753),i=s(74064),d=s(23015),o=s(98091),c=s(40900),u=s(35157),m=s(31215),x=s(69508),h=s(91470),p=s(24081),g=s(21986),f=s(47206),j=s(231),v=s(35047),y=s(17577),b=s(74723),N=s(770),w=s(57004),k=s(18615),C=s(567),z=s(90772),S=s(55632),E=s(54432),R=s(37859),P=s(8281),I=s(33261),Z=s(15940),_=s(87673),D=s(68232),M=s(62288),q=s(60097),A=s(99440),L=s(34789),T=s(77863),$=s(65304),F=s(43273),O=s(76812),G=s(42270),V=s(15286),J=s(24295),B=s(33071),U=s(77961),W=e([w]);function X(e){let[t,s]=(0,y.useState)(),{toast:a}=(0,L.pm)(),W=(0,v.useRouter)(),[X,H]=(0,y.useState)(),Y=e.context,K=e.context.fields.map(e=>e.name);console.log("fields",K),console.log("context",Y);let{loading:Q,error:ee,refetch:et}=(0,n.aM)((0,G.A1)(e.context.id,K,!0),{skip:!e.itemId||!e.context?.id,variables:{context:e.context.id,id:e.itemId},fetchPolicy:"no-cache",nextFetchPolicy:"network-only",onCompleted:t=>{let a=t[e.context.id+"_itemsById"];s({...a,tags:a.tags?a.tags.split(","):[]}),H({rights_mode:a.rights_mode,users:a.RBAC?.users,roles:a.RBAC?.roles,projects:a.RBAC?.projects})}}),[es,ea]=(0,r.D)((0,G.ty)(e.context.id),{onCompleted:()=>{a({title:"Item updated",description:"Item updated successfully."})},onError:e=>{a({title:"Error updating item",description:e.message})}}),[el,en]=(0,r.D)((0,G.mN)(e.context.id,[]),{onCompleted:()=>{a({title:"Item deleted",description:"Item deleted successfully."})},onError:e=>{a({title:"Error deleting item",description:e.message})}}),[er,ei]=(0,r.D)((0,G.Eq)(e.context.id),{onCompleted:t=>{let s=t[e.context.id+"_itemsGenerateChunks"];if(s.jobs?.length>0){a({title:"Chunks generation started",description:"Jobs have been started in the background, depending on the size of the item this may take a while."});return}a({title:"Chunks generated",description:"Chunks generated successfully."})}}),[ed,eo]=(0,r.D)((0,G.ps)(e.context.id),{onCompleted:t=>{let s=t[e.context.id+"_itemsDeleteChunks"];if(s.jobs?.length>0){a({title:"Chunks deletion started",description:"Jobs have been started in the background, depending on the size of the item this may take a while."});return}a({title:"Chunks deleted",description:"Chunks deleted successfully."})}}),[ec,eu]=(0,r.D)((0,G.dc)(e.context.id),{onCompleted:()=>{a({title:"Field processed",description:"Field processed successfully."})},onError:e=>{a({title:"Error processing field",description:e.message})}}),em=N.Ry({name:N.Z_().nullable().optional(),tags:N.Z_().nullable().optional(),external_id:N.Z_().nullable().optional(),description:N.Z_().min(2,{message:"Text must be at least 2 characters."}).max(1e4,{message:"Text must not be longer than 10.0000 characters."}),...Y?.fields?.reduce((e,t)=>({...e,[t.name]:N.Z_().nullable()}),{})??{}}),ex=(0,b.cI)({resolver:(0,i.F)(em),defaultValues:{description:t?.description},mode:"onChange"}),eh=e=>{if(e.target.value&&"Enter"===e.key){let a=t?.tags??[],l=[...Array.isArray(a)?[...a]:[]];l.push(e.target.value),console.log("tags",l),ex.setValue("tags",l.join(",")),s({...t,tags:l}),e.target.value=""}},[ep,eg]=(0,y.useState)(!1),[ef,ej]=(0,y.useState)(null),[ev,ey]=(0,y.useState)(null);return Q?(0,l.jsxs)("div",{className:"p-8 text-center text-muted-foreground",children:[l.jsx($.O,{className:"w-full h-[80px] rounded-md"}),l.jsx($.O,{className:"w-full h-[50px] rounded-md mt-3"}),l.jsx($.O,{className:"w-full h-[80px] rounded-md mt-3"}),l.jsx($.O,{className:"w-full h-[80px] rounded-md mt-3"}),l.jsx($.O,{className:"w-full h-[80px] rounded-md mt-3"}),l.jsx($.O,{className:"w-full h-[80px] rounded-md mt-3"})]}):ee?(0,l.jsxs)(F.bZ,{variant:"destructive",children:[l.jsx(O.LPM,{className:"size-4"}),l.jsx(F.Cd,{children:"Error"}),l.jsx(F.X,{children:ee?.message||"Error loading item."})]}):(0,l.jsxs)("div",{className:"flex h-full flex-col",children:[t?(0,l.jsxs)(l.Fragment,{children:[e.actions?(0,l.jsxs)(l.Fragment,{children:[l.jsx("div",{className:"flex items-center p-2",children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[t?.archived?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(D.u,{children:[l.jsx(D.aJ,{asChild:!0,children:(0,l.jsxs)(z.z,{onClick:async()=>{t.id&&(es({variables:{id:t.id,input:{archived:!1}}}),s({...t,archived:!1}),W.push("./"))},variant:"ghost",size:"icon",disabled:!t||ea.loading,children:[ea.loading?l.jsx(R.g,{}):l.jsx(d.Z,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Unarchive"})]})}),l.jsx(D._v,{children:"Unarchive"})]}),(0,l.jsxs)(D.u,{children:[l.jsx(D.aJ,{asChild:!0,children:(0,l.jsxs)(z.z,{onClick:async()=>{t.id&&(el({variables:{id:t.id}}),W.push("./"))},variant:"ghost",size:"icon",disabled:!t||en.loading,children:[en.loading?l.jsx(R.g,{}):l.jsx(o.Z,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Delete"})]})}),l.jsx(D._v,{children:"Delete"})]})]}):(0,l.jsxs)(D.u,{children:[l.jsx(D.aJ,{asChild:!0,children:(0,l.jsxs)(z.z,{onClick:async()=>{t?.id&&(es({variables:{id:t.id,input:{archived:!0}}}),s({...t,archived:!0}),W.push("./"))},variant:"ghost",size:"icon",disabled:!t||ea.loading,children:[ea.loading?l.jsx(R.g,{}):l.jsx(c.Z,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Archive"})]})}),l.jsx(D._v,{children:"Archive"})]}),ep?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(D.u,{children:[l.jsx(D.aJ,{asChild:!0,children:(0,l.jsxs)(z.z,{onClick:()=>{eg(!1)},variant:"ghost",size:"icon",children:[l.jsx(u.Z,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Cancel"})]})}),l.jsx(D._v,{children:"Cancel"})]}),(0,l.jsxs)(D.u,{children:[l.jsx(D.aJ,{asChild:!0,children:(0,l.jsxs)(z.z,{disabled:ea.loading,onClick:()=>{t?.id&&(es({variables:{id:t.id,input:{textlength:t?.text?.length,description:t?.description,name:t?.name,externalId:t?.externalId,tags:t?.tags?.join(","),source:t?.source,archived:t?.archived,rights_mode:X?.rights_mode,RBAC:{users:X?.users||[],roles:X?.roles||[],projects:X?.projects||[]},...Y?.fields?.reduce((e,s)=>({...e,[s.name]:t?.[s.name]}),{})??{}}}}),eg(!1))},variant:"ghost",size:"icon",children:[l.jsx(m.Z,{className:"size-4"}),(0,l.jsxs)("span",{className:"sr-only",children:["Save ",ea.loading??l.jsx(R.g,{})]})]})}),l.jsx(D._v,{children:"Save"})]})]}):(0,l.jsxs)(D.u,{children:[l.jsx(D.aJ,{asChild:!0,children:(0,l.jsxs)(z.z,{onClick:()=>{eg(!0)},variant:"ghost",size:"icon",disabled:!t||ea.loading,children:[l.jsx(x.Z,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Edit"})]})}),l.jsx(D._v,{children:"Edit"})]})]})}),l.jsx(P.Z,{})]}):null,l.jsx("div",{className:"flex flex-1 flex-col",children:(0,l.jsxs)("div",{className:(0,T.cn)("space-y-2"),children:[l.jsx("div",{className:"flex items-center justify-between space-x-4 px-4 bg-muted rounded",children:l.jsx("h3",{className:"text-lg p-5 font-semibold tracking-tight text-lg",children:"Fields"})}),(0,l.jsxs)("div",{className:"p-5",children:[l.jsx(S.l0,{...ex,children:l.jsx("form",{className:"space-y-8",children:(0,l.jsxs)("div",{children:[(0,l.jsxs)(Z.iA,{children:[l.jsx(Z.xD,{children:(0,l.jsxs)(Z.SC,{children:[l.jsx(Z.ss,{children:"Name"}),l.jsx(Z.ss,{children:"Value"})]})}),(0,l.jsxs)(Z.RM,{children:[(0,l.jsxs)(Z.SC,{children:[l.jsx(Z.pj,{className:"font-medium capitalize",children:"Name"}),l.jsx(Z.pj,{children:l.jsx(S.Wi,{control:ex.control,name:"name",render:({field:e})=>l.jsx(S.xJ,{children:ep?(0,l.jsxs)(l.Fragment,{children:[l.jsx(S.NI,{children:l.jsx(E.I,{type:"text",disabled:!ep,onChange:e=>{s({...t,name:e.target.value})},placeholder:"Item name",value:t.name??""})}),l.jsx(S.zG,{})]}):l.jsx("div",{onClick:async()=>{await navigator.clipboard.writeText(t.name??""),a({title:"Copied to clipboard"})},className:"flex-1 whitespace-pre-wrap text-sm cursor-copy",children:t.name&&t.name?.length>200?t.name?.slice(0,200)+"...":t.name})})})})]},"name"),(0,l.jsxs)(Z.SC,{children:[l.jsx(Z.pj,{className:"font-medium capitalize",children:"Tags"}),(0,l.jsxs)(Z.pj,{children:[ep?l.jsx("div",{className:"grid-row grid grid-flow-col gap-4 pt-2",children:l.jsx(S.Wi,{control:ex.control,name:"tags",render:({field:e})=>(0,l.jsxs)(S.xJ,{children:[l.jsx(S.NI,{children:l.jsx(E.I,{id:"includes",type:"text",onKeyUp:e=>eh(e),placeholder:"Type and press enter to add"})}),l.jsx(S.zG,{})]})})}):null,t?.tags?.length?l.jsx("div",{className:"gap-2 pt-2",children:t?.tags?.map((e,a)=>l.jsx(C.C,{variant:"secondary",className:"px-3 py-2 mr-2 mb-2",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"text-muted-foreground truncate max-w-[200px]",children:e}),ep?l.jsx("span",{className:"size-4 cursor-pointer text-muted-foreground",onClick:()=>{let e=[...t.tags??[]];e.splice(a,1),ex.setValue("tags",e.join(",")),s({...t,tags:e})},children:l.jsx(h.Z,{className:"ml-1",size:15})}):null]})},`tag-${a}`))}):null]})]},"tags"),(0,l.jsxs)(Z.SC,{children:[l.jsx(Z.pj,{className:"font-medium capitalize",children:"Description"}),l.jsx(Z.pj,{children:l.jsx(S.Wi,{control:ex.control,name:"description",render:({field:e})=>l.jsx(S.xJ,{children:ep?(0,l.jsxs)(l.Fragment,{children:[l.jsx(S.NI,{children:(0,l.jsxs)("div",{className:"relative",children:[l.jsx(_.g,{autoFocus:!0,disabled:!ep,onChange:e=>{s({...t,description:e.target.value})},placeholder:"Item text content",className:"resize-none",value:t.description??""}),(0,l.jsxs)(M.Vq,{children:[l.jsx(M.hg,{asChild:!0,children:(0,l.jsxs)(z.z,{type:"button",variant:"ghost",size:"sm",className:"absolute top-2 right-2 h-6 w-6 p-0",onClick:()=>ej({name:"description",value:t.description??"",disabled:!1}),children:[l.jsx(p.Z,{className:"h-3 w-3"}),l.jsx("span",{className:"sr-only",children:"Expand"})]})}),(0,l.jsxs)(M.cZ,{className:"max-w-4xl max-h-[80vh]",children:[l.jsx(M.fK,{children:l.jsx(M.$N,{children:"Edit Description"})}),l.jsx("div",{className:"mt-4",children:l.jsx(_.g,{rows:20,className:"min-h-[400px] resize-none",value:ef?.name==="description"?ef.value:t.description??"",onChange:e=>{let a=e.target.value;ej(e=>e?.name==="description"?{...e,value:a}:e),s({...t,description:a})}})})]})]})]})}),l.jsx(S.zG,{})]}):l.jsx("div",{onClick:async()=>{await navigator.clipboard.writeText(t.description??""),a({title:"Copied to clipboard"})},className:"flex-1 whitespace-pre-wrap text-sm cursor-copy",children:l.jsx(k.J,{text:t.description??""})})})})})]},19091),(0,l.jsxs)(Z.SC,{children:[l.jsx(Z.pj,{className:"font-medium capitalize",children:"External ID"}),l.jsx(Z.pj,{children:l.jsx(S.Wi,{control:ex.control,name:"external_id",render:({field:e})=>l.jsx(S.xJ,{children:ep?(0,l.jsxs)(l.Fragment,{children:[l.jsx(S.NI,{children:l.jsx(E.I,{type:"text",disabled:!ep,onChange:e=>{console.log("e",e),s({...t,external_id:e.target.value})},placeholder:"xxxx-xxxx-xxxx-xxxx",value:t.external_id??""})}),l.jsx(S.zG,{})]}):l.jsx("div",{onClick:async()=>{await navigator.clipboard.writeText(t.external_id??""),a({title:"Copied to clipboard"})},className:"flex-1 whitespace-pre-wrap text-sm cursor-copy",children:t.external_id??""})})})})]},"externalId"),Y?.fields?.length&&Y.fields.map((e,n)=>(0,l.jsxs)(Z.SC,{children:[(0,l.jsxs)(Z.pj,{className:"font-medium capitalize flex flex-col",children:[e.label,e.calculated&&l.jsx("span",{className:"text-sm text-muted-foreground",children:"Calculated"}),e.processor&&(0,l.jsxs)(D.u,{children:[l.jsx(D.aJ,{asChild:!0,children:(0,l.jsxs)(z.z,{variant:"secondary",size:"sm",className:"w-auto mt-2",onClick:()=>{ec({variables:{item:t?.id,field:e.name}})},disabled:eu.loading,children:[eu.loading?l.jsx(R.g,{}):l.jsx(g.Z,{className:"size-4"}),l.jsx("span",{className:"ml-2",children:"Process"})]})}),l.jsx(D._v,{className:"max-w-xs",children:e.processor.description})]})]}),ep?l.jsx(l.Fragment,{children:(0,l.jsxs)(Z.pj,{children:["code"===e.type||"json"===e.type||"text"===e.type||"longText"===e.type||"markdown"===e.type||"shortText"===e.type?l.jsx(S.Wi,{control:ex.control,name:e.name,render:({field:a})=>(0,l.jsxs)(S.xJ,{children:[l.jsx(S.NI,{children:(0,l.jsxs)("div",{className:"relative",children:[l.jsx(_.g,{id:e.name,rows:"shortText"===e.type?2:7,onChange:a=>{s({...t,[e.name]:a.target.value})},value:t[e.name]??""}),(0,l.jsxs)(M.Vq,{children:[l.jsx(M.hg,{asChild:!0,children:(0,l.jsxs)(z.z,{type:"button",variant:"ghost",size:"sm",className:"absolute top-2 right-2 h-6 w-6 p-0",onClick:()=>ej({name:e.name,disabled:!1,value:t[e.name]??""}),children:[l.jsx(p.Z,{className:"h-3 w-3"}),l.jsx("span",{className:"sr-only",children:"Expand"})]})}),(0,l.jsxs)(M.cZ,{className:"max-w-4xl max-h-[80vh]",children:[l.jsx(M.fK,{children:(0,l.jsxs)(M.$N,{children:["Edit ",e.name]})}),l.jsx("div",{className:"mt-4",children:l.jsx(_.g,{rows:20,className:"min-h-[400px] resize-none",value:ef?.name===e.name?ef.value:t[e.name]??"",onChange:a=>{let l=a.target.value;ej(t=>t?.name===e.name?{...t,value:l}:t),s({...t,[e.name]:l})}})})]})]})]})}),l.jsx(S.zG,{})]})}):null,"number"===e.type?l.jsx(S.Wi,{control:ex.control,name:e.name,render:({field:a})=>(0,l.jsxs)(S.xJ,{children:[l.jsx(S.NI,{children:l.jsx(E.I,{id:e.name,type:"number",onChange:a=>{s({...t,[e.name]:a.target.value})},value:t[e.name]??""})}),l.jsx(S.zG,{})]})}):null,"boolean"===e.type?l.jsx(S.Wi,{control:ex.control,name:e.name,render:({field:a})=>(0,l.jsxs)(S.xJ,{children:[l.jsx(S.NI,{children:l.jsx(I.r,{checked:!!a.value,onCheckedChange:a=>{s({...t,[e.name]:a})}})}),l.jsx(S.zG,{})]})}):null,"file"===e.type&&l.jsx("div",{children:l.jsx(U.jF,{s3key:t[e.name],children:l.jsx(U.ZP,{id:`item-${t.id}`,buttonText:"Select File",allowedFileTypes:e.allowedFileTypes,dependencies:[],selectionLimit:1,onConfirm:a=>{console.log("keys",a),s({...t,[e.name]:a[0]})}})})})]})}):l.jsx(Z.pj,{children:(0,l.jsxs)("span",{children:["code"===e.type&&l.jsx(w.G,{code:t[e.name]}),"json"===e.type&&l.jsx(w.G,{code:t[e.name]}),"shortText"===e.type&&l.jsx("p",{className:"cursor-copy",onClick:async()=>{await navigator.clipboard.writeText(t[e.name]),a({title:"Copied to clipboard"})},children:t[e.name]}),"longText"===e.type&&l.jsx(k.J,{text:t[e.name]}),"file"===e.type&&l.jsx(U.jF,{s3key:t[e.name]}),"markdown"===e.type&&l.jsx(k.J,{text:t[e.name]}),!e.type&&l.jsx(k.J,{text:t[e.name]}),"text"===e.type&&l.jsx(k.J,{text:t[e.name]}),"number"===e.type&&l.jsx("p",{className:"cursor-copy",onClick:async()=>{await navigator.clipboard.writeText(t[e.name]),a({title:"Copied to clipboard"})},children:t[e.name]}),"boolean"===e.type&&l.jsx("p",{className:"cursor-copy",onClick:async()=>{await navigator.clipboard.writeText(t[e.name]),a({title:"Copied to clipboard"})},children:t[e.name]??""})]})})]},n))]})]}),l.jsx(P.Z,{className:"my-4"})]})})}),l.jsx(B.Zb,{className:"bg-transparent",children:(0,l.jsxs)(J.zF,{children:[l.jsx(B.Ol,{className:"p-4",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex flex-col",children:[l.jsx("p",{className:"text-base",children:"Access Control"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-0",children:"Control access to this item."})]}),l.jsx(J.wy,{asChild:!0,children:(0,l.jsxs)(z.z,{variant:"ghost",size:"icon",className:"size-8",children:[l.jsx(f.Z,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Toggle"})]})})]})}),l.jsx(J.Fw,{className:"mt-5",children:l.jsx(B.aY,{className:"space-y-4",children:l.jsx(V.P,{initialRightsMode:t.rights_mode,initialUsers:t.RBAC?.users,initialRoles:t.RBAC?.roles,initialProjects:t.RBAC?.projects,onChange:(e,t,s,a)=>{H({rights_mode:e,users:t,roles:s,projects:a})}})})})]})}),(0,l.jsxs)("div",{className:"mt-4 border border p-3 pb-5 rounded",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between ml-4 mt-3 mr-4 mb-2",children:[l.jsx("h1",{className:"text-lg font-medium",children:"Embeddings"}),(0,l.jsxs)(q.h_,{children:[l.jsx(q.$F,{asChild:!0,children:(0,l.jsxs)(z.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:[l.jsx(j.Z,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Open menu"})]})}),(0,l.jsxs)(q.AW,{align:"end",children:[l.jsx(q.Xi,{onClick:()=>ey("generate"),children:"Generate embeddings"}),l.jsx(q.Xi,{onClick:()=>ey("delete"),children:"Delete embeddings"})]})]})]}),(0,l.jsxs)(Z.iA,{children:[l.jsx(Z.Rn,{children:t?.chunks?.length?"A list of all embeddings for this item.":"No embeddings found."}),l.jsx(Z.xD,{children:(0,l.jsxs)(Z.SC,{children:[l.jsx(Z.ss,{children:"Index"}),l.jsx(Z.ss,{children:"Content"}),l.jsx(Z.ss,{children:"Dimensions"}),l.jsx(Z.ss,{children:"Created At"}),l.jsx(Z.ss,{children:"Updated At"})]})}),l.jsx(Z.RM,{children:t?.chunks?.length?t?.chunks?.length&&t.chunks.map(e=>(0,l.jsxs)(Z.SC,{children:[l.jsx(Z.pj,{className:"font-medium capitalize",children:e.chunk_index+1}),l.jsx(Z.pj,{children:l.jsx(k.J,{text:e.content})}),l.jsx(Z.pj,{children:e.embedding_size||0}),l.jsx(Z.pj,{children:new Date(e.chunk_created_at).toLocaleString()}),l.jsx(Z.pj,{children:new Date(e.chunk_updated_at).toLocaleString()})]},e.id)):null})]})]})]})]})})]}):(0,l.jsxs)(l.Fragment,{children:[" ",!t&&e.itemId?l.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Item not found."}):l.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"No item selected."})]}),l.jsx(A.aR,{open:"generate"===ev,onOpenChange:e=>!e&&ey(null),children:(0,l.jsxs)(A._T,{children:[(0,l.jsxs)(A.fY,{children:[l.jsx(A.f$,{children:"Generate Embeddings"}),l.jsx(A.yT,{children:"Are you sure you want to generate embeddings for this item? This will create new embedding vectors for the content."})]}),(0,l.jsxs)(A.xo,{children:[l.jsx(A.le,{children:"Cancel"}),l.jsx(A.OL,{disabled:ei.loading,onClick:()=>{t?.id&&(console.log("Generate embeddings for item:",t?.id),ey(null),er({variables:{where:{id:{eq:t?.id}}}}))},children:"Generate"})]})]})}),l.jsx(A.aR,{open:"delete"===ev,onOpenChange:e=>!e&&ey(null),children:(0,l.jsxs)(A._T,{children:[(0,l.jsxs)(A.fY,{children:[l.jsx(A.f$,{children:"Delete Embeddings"}),l.jsx(A.yT,{children:"Are you sure you want to delete all embeddings for this item? This action cannot be undone."})]}),(0,l.jsxs)(A.xo,{children:[l.jsx(A.le,{children:"Cancel"}),l.jsx(A.OL,{disabled:eo.loading,onClick:async()=>{t?.id&&(console.log("Delete embeddings for item:",t?.id),ey(null),ed({variables:{where:{id:{eq:t?.id}}}}))},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})}w=(W.then?(await W)():W)[0],a()}catch(e){a(e)}})},51602:(e,t,s)=>{"use strict";s.d(t,{d:()=>x,f:()=>h});var a=s(10326),l=s(90772),n=s(77863),r=s(32933),i=s(43810),d=s(17577),o=s(54390),c=s(35057),u=s(48818);let m=(0,d.createContext)({code:""}),x=({code:e,language:t,showLineNumbers:s=!1,className:l,children:r,...i})=>a.jsx(m.Provider,{value:{code:e},children:a.jsx("div",{className:(0,n.cn)("relative w-full overflow-hidden rounded-md border bg-background text-foreground",l),...i,children:(0,a.jsxs)("div",{className:"relative",children:[a.jsx(o.Z,{className:"overflow-hidden dark:hidden",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:s,style:c.Z,children:e}),a.jsx(o.Z,{className:"hidden overflow-hidden dark:block",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:s,style:u.Z,children:e}),r&&a.jsx("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:r})]})})}),h=({onCopy:e,onError:t,timeout:s=2e3,children:o,className:c,...u})=>{let[x,h]=(0,d.useState)(!1),{code:p}=(0,d.useContext)(m),g=async()=>{t?.(Error("Clipboard API not available"))},f=x?r.Z:i.Z;return a.jsx(l.z,{className:(0,n.cn)("shrink-0",c),onClick:g,size:"icon",variant:"ghost",...u,children:o??a.jsx(f,{size:14})})}},36931:(e,t,s)=>{"use strict";s.d(t,{H:()=>x});var a=s(10326),l=s(77863),n=s(17577),r=s(16476),i=s(79283),d=s(70285),o=s(7833),c=s(51602);s(32289);let u=(0,s(39499).Z)(r.UG),m={ol:({node:e,children:t,className:s,...n})=>a.jsx("ol",{className:(0,l.cn)("ml-4 list-outside list-decimal",s),...n,children:t}),li:({node:e,children:t,className:s,...n})=>a.jsx("li",{className:(0,l.cn)("py-1",s),...n,children:t}),ul:({node:e,children:t,className:s,...n})=>a.jsx("ul",{className:(0,l.cn)("ml-4 list-outside list-disc",s),...n,children:t}),hr:({node:e,className:t,...s})=>a.jsx("hr",{className:(0,l.cn)("my-6 border-border",t),...s}),strong:({node:e,children:t,className:s,...n})=>a.jsx("span",{className:(0,l.cn)("font-semibold",s),...n,children:t}),a:({node:e,children:t,className:s,...n})=>a.jsx("a",{className:(0,l.cn)("font-medium text-primary underline",s),rel:"noreferrer",target:"_blank",...n,children:t}),h1:({node:e,children:t,className:s,...n})=>a.jsx("h1",{className:(0,l.cn)("mt-6 mb-2 font-semibold text-3xl",s),...n,children:t}),h2:({node:e,children:t,className:s,...n})=>a.jsx("h2",{className:(0,l.cn)("mt-6 mb-2 font-semibold text-2xl",s),...n,children:t}),h3:({node:e,children:t,className:s,...n})=>a.jsx("h3",{className:(0,l.cn)("mt-6 mb-2 font-semibold text-xl",s),...n,children:t}),h4:({node:e,children:t,className:s,...n})=>a.jsx("h4",{className:(0,l.cn)("mt-6 mb-2 font-semibold text-lg",s),...n,children:t}),h5:({node:e,children:t,className:s,...n})=>a.jsx("h5",{className:(0,l.cn)("mt-6 mb-2 font-semibold text-base",s),...n,children:t}),h6:({node:e,children:t,className:s,...n})=>a.jsx("h6",{className:(0,l.cn)("mt-6 mb-2 font-semibold text-sm",s),...n,children:t}),table:({node:e,children:t,className:s,...n})=>a.jsx("div",{className:"my-4 overflow-x-auto",children:a.jsx("table",{className:(0,l.cn)("w-full border-collapse border border-border",s),...n,children:t})}),thead:({node:e,children:t,className:s,...n})=>a.jsx("thead",{className:(0,l.cn)("bg-muted/50",s),...n,children:t}),tbody:({node:e,children:t,className:s,...n})=>a.jsx("tbody",{className:(0,l.cn)("divide-y divide-border",s),...n,children:t}),tr:({node:e,children:t,className:s,...n})=>a.jsx("tr",{className:(0,l.cn)("border-border border-b",s),...n,children:t}),th:({node:e,children:t,className:s,...n})=>a.jsx("th",{className:(0,l.cn)("px-4 py-2 text-left font-semibold text-sm",s),...n,children:t}),td:({node:e,children:t,className:s,...n})=>a.jsx("td",{className:(0,l.cn)("px-4 py-2 text-sm",s),...n,children:t}),blockquote:({node:e,children:t,className:s,...n})=>a.jsx("blockquote",{className:(0,l.cn)("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",s),...n,children:t}),code:({node:e,className:t,...s})=>e?.position?.start.line!==e?.position?.end.line?a.jsx("code",{className:t,...s}):a.jsx("code",{className:(0,l.cn)("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),...s}),pre:({node:e,className:t,children:s})=>{let r="javascript";"string"==typeof e?.properties?.className&&(r=e.properties.className.replace("language-",""));let i="";return(0,n.isValidElement)(s)&&s.props&&"string"==typeof s.props.children?i=s.props.children:"string"==typeof s&&(i=s),a.jsx(c.d,{className:(0,l.cn)("my-4 h-auto",t),code:i,language:r,children:a.jsx(c.f,{onCopy:()=>console.log("Copied code to clipboard"),onError:()=>console.error("Failed to copy code to clipboard")})})}},x=(0,n.memo)(({className:e,options:t,children:s,allowedImagePrefixes:n,allowedLinkPrefixes:r,defaultOrigin:c,parseIncompleteMarkdown:x=!0,...h})=>{let p="string"==typeof s&&x?function(e){if(!e||"string"!=typeof e)return e;let t=e,s=t.match(/(!?\[)([^\]]*?)$/);if(s){let e=t.lastIndexOf(s[1]);t=t.substring(0,e)}if(t.match(/(\*\*)([^*]*?)$/)&&(t.match(/\*\*/g)||[]).length%2==1&&(t=`${t}**`),t.match(/(__)([^_]*?)$/)&&(t.match(/__/g)||[]).length%2==1&&(t=`${t}__`),t.match(/(\*)([^*]*?)$/)&&t.split("").reduce((e,s,a)=>{if("*"===s){let s=t[a-1],l=t[a+1];if("*"!==s&&"*"!==l)return e+1}return e},0)%2==1&&(t=`${t}*`),t.match(/(_)([^_]*?)$/)&&t.split("").reduce((e,s,a)=>{if("_"===s){let s=t[a-1],l=t[a+1];if("_"!==s&&"_"!==l)return e+1}return e},0)%2==1&&(t=`${t}_`),t.match(/(`)([^`]*?)$/)&&(t.includes("```"),(t.match(/```[\s\S]*?```/g)||[]).length,(t.match(/```/g)||[]).length%2!=1)){let e=0;for(let s=0;s<t.length;s++)if("`"===t[s]){let a="```"===t.substring(s,s+3),l=s>0&&"```"===t.substring(s-1,s+2),n=s>1&&"```"===t.substring(s-2,s+1);!(a||l||n)&&e++}e%2==1&&(t=`${t}\``)}return t.match(/(~~)([^~]*?)$/)&&(t.match(/~~/g)||[]).length%2==1&&(t=`${t}~~`),t}(s):s;return a.jsx("div",{className:(0,l.cn)("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...h,children:a.jsx(u,{allowedImagePrefixes:n??["*"],allowedLinkPrefixes:r??["*"],components:m,defaultOrigin:c,rehypePlugins:[i.Z],remarkPlugins:[d.Z,o.Z],...t,children:p})})},(e,t)=>e.children===t.children);x.displayName="Response"},57004:(e,t,s)=>{"use strict";s.a(e,async(e,a)=>{try{s.d(t,{G:()=>f});var l=s(10326),n=s(48644),r=s(93801),i=s(45747),d=s(17577),o=s(94966),c=s(12533),u=s(12428),m=s(47355),x=s(62288),h=s(34789),p=s(77863),g=e([n,r,i]);function f({className:e=null,code:t,language:s,slice:a=200}){let{toast:n}=(0,h.pm)(),[r,i]=(0,d.useState)(null);return(0,l.jsxs)(x.Vq,{children:[l.jsx(x.hg,{asChild:!0,children:r?.length&&l.jsx(o.Z,{className:(0,p.cn)("cursor-pointer",e),showLineNumbers:!0,wrapLines:!0,lineProps:{style:{wordBreak:"break-all",whiteSpace:"pre-wrap"}},language:s||"plaintext",style:m.Z,children:`${r?.slice(0,a||200)} ${t?.length>(a||200)?"...":""}`})}),l.jsx(x.cZ,{className:"sm:max-w-[800px] overflow-hidden max-h-[500px] overflow-y-scroll",children:(0,l.jsxs)(x.fK,{children:[l.jsx(x.$N,{children:"Code"}),l.jsx("div",{className:"cursor-copy",onClick:async()=>{await navigator.clipboard.writeText(r??""),n({title:"Copied to clipboard"})},children:l.jsx(o.Z,{className:(0,p.cn)(e),showLineNumbers:!0,wrapLines:!0,lineProps:{style:{wordBreak:"break-all",whiteSpace:"pre-wrap"}},language:s||"plaintext",style:m.Z,children:r??""})})]})})]})}[n,r,i]=g.then?(await g)():g,o.Z.registerLanguage("json",u.Z),o.Z.registerLanguage("javascript",c.Z),a()}catch(e){a(e)}})},18615:(e,t,s)=>{"use strict";s.d(t,{J:()=>g});var a=s(10326);s(17577);var l=s(62288),n=s(34789),r=s(36931),i=s(90772),d=s(68232),o=s(77863);let c=({className:e,...t})=>a.jsx("div",{className:(0,o.cn)("flex flex-col overflow-hidden rounded-lg border bg-background shadow-sm",e),...t}),u=({className:e,...t})=>a.jsx("div",{className:(0,o.cn)("flex items-center justify-between border-b bg-muted/50 px-4 py-3",e),...t}),m=({className:e,...t})=>a.jsx("div",{className:(0,o.cn)("flex items-center gap-1",e),...t}),x=({tooltip:e,label:t,icon:s,children:l,className:n,size:r="sm",variant:c="ghost",...u})=>{let m=(0,a.jsxs)(i.z,{className:(0,o.cn)("size-8 p-0 text-muted-foreground hover:text-foreground",n),size:r,type:"button",variant:c,...u,children:[s?a.jsx(s,{className:"size-4"}):l,a.jsx("span",{className:"sr-only",children:t||e})]});return e?a.jsx(d.pn,{children:(0,a.jsxs)(d.u,{children:[a.jsx(d.aJ,{asChild:!0,children:m}),a.jsx(d._v,{children:a.jsx("p",{children:e})})]})}):m},h=({className:e,...t})=>a.jsx("div",{className:(0,o.cn)("flex-1 overflow-auto p-4",e),...t});var p=s(43810);function g({text:e,sliceLength:t}){let{toast:s}=(0,n.pm)();return(0,a.jsxs)(l.Vq,{children:[a.jsx(l.hg,{asChild:!0,children:(0,a.jsxs)("p",{className:"cursor-pointer text-sm text-base",children:[e?.slice(0,t??200),t&&e.length>t?"...":""]})}),a.jsx(l.cZ,{className:"sm:max-w-[800px] max-h-[500px] overflow-y-scroll",children:(0,a.jsxs)(c,{children:[a.jsx(u,{children:a.jsx(m,{children:a.jsx(x,{icon:p.Z,label:"Copy",tooltip:"Copy to clipboard",onClick:async()=>{await navigator.clipboard.writeText(e),s({title:"Copied to clipboard"})}})})}),a.jsx(h,{children:a.jsx(r.H,{children:e})})]})})]})}},29718:(e,t,s)=>{"use strict";s.d(t,{L:()=>l});var a=s(10326);function l({text:e,length:t}){return e.length>t?(0,a.jsxs)(a.Fragment,{children:[e.slice(0,t),"..."]}):a.jsx(a.Fragment,{children:e})}},99440:(e,t,s)=>{"use strict";s.d(t,{OL:()=>g,_T:()=>u,aR:()=>d,f$:()=>h,fY:()=>m,le:()=>f,xo:()=>x,yT:()=>p});var a=s(10326),l=s(12194),n=s(17577),r=s(90772),i=s(77863);let d=l.fC;l.xz;let o=l.h_,c=n.forwardRef(({className:e,...t},s)=>a.jsx(l.aV,{className:(0,i.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:s}));c.displayName=l.aV.displayName;let u=n.forwardRef(({className:e,...t},s)=>(0,a.jsxs)(o,{children:[a.jsx(c,{}),a.jsx(l.VY,{ref:s,className:(0,i.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));u.displayName=l.VY.displayName;let m=({className:e,...t})=>a.jsx("div",{className:(0,i.cn)("flex flex-col space-y-2 text-center sm:text-left",e),...t});m.displayName="AlertDialogHeader";let x=({className:e,...t})=>a.jsx("div",{className:(0,i.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});x.displayName="AlertDialogFooter";let h=n.forwardRef(({className:e,...t},s)=>a.jsx(l.Dx,{ref:s,className:(0,i.cn)("text-lg font-semibold",e),...t}));h.displayName=l.Dx.displayName;let p=n.forwardRef(({className:e,...t},s)=>a.jsx(l.dk,{ref:s,className:(0,i.cn)("text-sm text-muted-foreground",e),...t}));p.displayName=l.dk.displayName;let g=n.forwardRef(({className:e,...t},s)=>a.jsx(l.aU,{ref:s,className:(0,i.cn)((0,r.d)(),e),...t}));g.displayName=l.aU.displayName;let f=n.forwardRef(({className:e,...t},s)=>a.jsx(l.$j,{ref:s,className:(0,i.cn)((0,r.d)({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));f.displayName=l.$j.displayName},53313:(e,t,s)=>{"use strict";s.d(t,{X:()=>d});var a=s(10326),l=s(13635),n=s(32933),r=s(17577),i=s(77863);let d=r.forwardRef(({className:e,...t},s)=>a.jsx(l.fC,{ref:s,className:(0,i.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:a.jsx(l.z$,{className:(0,i.cn)("flex items-center justify-center text-current"),children:a.jsx(n.Z,{className:"size-4"})})}));d.displayName=l.fC.displayName},24295:(e,t,s)=>{"use strict";s.d(t,{Fw:()=>r,wy:()=>n,zF:()=>l});var a=s(35663);let l=a.fC,n=a.wy,r=a.Fw},55632:(e,t,s)=>{"use strict";s.d(t,{NI:()=>g,Wi:()=>u,l0:()=>o,lX:()=>p,pf:()=>f,xJ:()=>h,zG:()=>j});var a=s(10326),l=s(34214),n=s(17577),r=s(74723),i=s(31048),d=s(77863);let o=r.RV,c=n.createContext({}),u=({...e})=>a.jsx(c.Provider,{value:{name:e.name},children:a.jsx(r.Qr,{...e})}),m=()=>{let e=n.useContext(c),t=n.useContext(x),{getFieldState:s,formState:a}=(0,r.Gc)(),l=s(e.name,a);if(!e)throw Error("useFormField should be used within <FormField>");let{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...l}},x=n.createContext({}),h=n.forwardRef(({className:e,...t},s)=>{let l=n.useId();return a.jsx(x.Provider,{value:{id:l},children:a.jsx("div",{ref:s,className:(0,d.cn)("space-y-2",e),...t})})});h.displayName="FormItem";let p=n.forwardRef(({className:e,...t},s)=>{let{error:l,formItemId:n}=m();return a.jsx(i._,{ref:s,className:(0,d.cn)(l&&"text-destructive",e),htmlFor:n,...t})});p.displayName="FormLabel";let g=n.forwardRef(({...e},t)=>{let{error:s,formItemId:n,formDescriptionId:r,formMessageId:i}=m();return a.jsx(l.g7,{ref:t,id:n,"aria-describedby":s?`${r} ${i}`:`${r}`,"aria-invalid":!!s,...e})});g.displayName="FormControl";let f=n.forwardRef(({className:e,...t},s)=>{let{formDescriptionId:l}=m();return a.jsx("p",{ref:s,id:l,className:(0,d.cn)("text-sm text-muted-foreground",e),...t})});f.displayName="FormDescription";let j=n.forwardRef(({className:e,children:t,...s},l)=>{let{error:n,formMessageId:r}=m(),i=n?String(n?.message):t;return i?a.jsx("p",{ref:l,id:r,className:(0,d.cn)("text-sm font-medium text-destructive",e),...s,children:i}):null});j.displayName="FormMessage"},33261:(e,t,s)=>{"use strict";s.d(t,{r:()=>i});var a=s(10326),l=s(41959),n=s(17577),r=s(77863);let i=n.forwardRef(({className:e,...t},s)=>a.jsx(l.fC,{className:(0,r.cn)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:s,children:a.jsx(l.bU,{className:(0,r.cn)("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));i.displayName=l.fC.displayName},15940:(e,t,s)=>{"use strict";s.d(t,{RM:()=>d,Rn:()=>m,SC:()=>o,iA:()=>r,pj:()=>u,ss:()=>c,xD:()=>i});var a=s(10326),l=s(17577),n=s(77863);let r=l.forwardRef(({className:e,...t},s)=>a.jsx("div",{className:"relative w-full overflow-auto",children:a.jsx("table",{ref:s,className:(0,n.cn)("w-full caption-bottom text-sm",e),...t})}));r.displayName="Table";let i=l.forwardRef(({className:e,...t},s)=>a.jsx("thead",{ref:s,className:(0,n.cn)("[&_tr]:border-b",e),...t}));i.displayName="TableHeader";let d=l.forwardRef(({className:e,...t},s)=>a.jsx("tbody",{ref:s,className:(0,n.cn)("[&_tr:last-child]:border-0",e),...t}));d.displayName="TableBody",l.forwardRef(({className:e,...t},s)=>a.jsx("tfoot",{ref:s,className:(0,n.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t})).displayName="TableFooter";let o=l.forwardRef(({className:e,...t},s)=>a.jsx("tr",{ref:s,className:(0,n.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));o.displayName="TableRow";let c=l.forwardRef(({className:e,...t},s)=>a.jsx("th",{ref:s,className:(0,n.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&:has([role=checkbox])]:w-[40px]",e),...t}));c.displayName="TableHead";let u=l.forwardRef(({className:e,...t},s)=>a.jsx("td",{ref:s,className:(0,n.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0 [&:has([role=checkbox])]:w-[40px]",e),...t}));u.displayName="TableCell";let m=l.forwardRef(({className:e,...t},s)=>a.jsx("caption",{ref:s,className:(0,n.cn)("mt-4 text-sm text-muted-foreground",e),...t}));m.displayName="TableCaption"},79210:(e,t,s)=>{"use strict";s.d(t,{SP:()=>o,dr:()=>d,mQ:()=>i,nU:()=>c});var a=s(10326),l=s(28407),n=s(17577),r=s(77863);let i=l.fC,d=n.forwardRef(({className:e,...t},s)=>a.jsx(l.aV,{ref:s,className:(0,r.cn)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));d.displayName=l.aV.displayName;let o=n.forwardRef(({className:e,...t},s)=>a.jsx(l.xz,{ref:s,className:(0,r.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));o.displayName=l.xz.displayName;let c=n.forwardRef(({className:e,...t},s)=>a.jsx(l.VY,{ref:s,className:(0,r.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));c.displayName=l.VY.displayName},75909:(e,t,s)=>{"use strict";s.d(t,{t:()=>n});var a=s(42270),l=s(39167);let n=()=>(0,l.aM)(a.uw,{variables:{limit:20}})},40900:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(76557).Z)("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]])},47206:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(76557).Z)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},24081:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(76557).Z)("Expand",[["path",{d:"m21 21-6-6m6 6v-4.8m0 4.8h-4.8",key:"1c15vz"}],["path",{d:"M3 16.2V21m0 0h4.8M3 21l6-6",key:"1fsnz2"}],["path",{d:"M21 7.8V3m0 0h-4.8M21 3l-6 6",key:"hawz9i"}],["path",{d:"M3 7.8V3m0 0h4.8M3 3l6 6",key:"u9ee12"}]])},65983:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(76557).Z)("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]])},54014:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(76557).Z)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},42924:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(76557).Z)("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]])},9015:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(76557).Z)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},21986:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(76557).Z)("MessageCirclePlus",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]])},23015:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(76557).Z)("PackageOpen",[["path",{d:"M20.91 8.84 8.56 2.23a1.93 1.93 0 0 0-1.81 0L3.1 4.13a2.12 2.12 0 0 0-.05 3.69l12.22 6.93a2 2 0 0 0 1.94 0L21 12.51a2.12 2.12 0 0 0-.09-3.67Z",key:"1vy178"}],["path",{d:"m3.09 8.84 12.35-6.61a1.93 1.93 0 0 1 1.81 0l3.65 1.9a2.12 2.12 0 0 1 .1 3.69L8.73 14.75a2 2 0 0 1-1.94 0L3 12.51a2.12 2.12 0 0 1 .09-3.67Z",key:"s3bv25"}],["line",{x1:"12",x2:"12",y1:"22",y2:"13",key:"1o4xyi"}],["path",{d:"M20 13.5v3.37a2.06 2.06 0 0 1-1.11 1.83l-6 3.08a1.93 1.93 0 0 1-1.78 0l-6-3.08A2.06 2.06 0 0 1 4 16.87V13.5",key:"1na2nq"}]])},44389:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(76557).Z)("Pencil",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},31215:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(76557).Z)("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]])},35157:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(76557).Z)("XSquare",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},76738:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>a});let a=(0,s(68570).createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/app/(application)/data/[[...query]]/layout.tsx#default`)},21114:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>a});let a=(0,s(68570).createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/app/(application)/data/[[...query]]/page.tsx#default`)},41959:(e,t,s)=>{"use strict";s.d(t,{bU:()=>w,fC:()=>N});var a=s(17577),l=s(82561),n=s(48051),r=s(93095),i=s(52067),d=s(53405),o=s(2566),c=s(45226),u=s(10326),m="Switch",[x,h]=(0,r.b)(m),[p,g]=x(m),f=a.forwardRef((e,t)=>{let{__scopeSwitch:s,name:r,checked:d,defaultChecked:o,required:x,disabled:h,value:g="on",onCheckedChange:f,form:j,...v}=e,[N,w]=a.useState(null),k=(0,n.e)(t,e=>w(e)),C=a.useRef(!1),z=!N||j||!!N.closest("form"),[S,E]=(0,i.T)({prop:d,defaultProp:o??!1,onChange:f,caller:m});return(0,u.jsxs)(p,{scope:s,checked:S,disabled:h,children:[(0,u.jsx)(c.WV.button,{type:"button",role:"switch","aria-checked":S,"aria-required":x,"data-state":b(S),"data-disabled":h?"":void 0,disabled:h,value:g,...v,ref:k,onClick:(0,l.M)(e.onClick,e=>{E(e=>!e),z&&(C.current=e.isPropagationStopped(),C.current||e.stopPropagation())})}),z&&(0,u.jsx)(y,{control:N,bubbles:!C.current,name:r,value:g,checked:S,required:x,disabled:h,form:j,style:{transform:"translateX(-100%)"}})]})});f.displayName=m;var j="SwitchThumb",v=a.forwardRef((e,t)=>{let{__scopeSwitch:s,...a}=e,l=g(j,s);return(0,u.jsx)(c.WV.span,{"data-state":b(l.checked),"data-disabled":l.disabled?"":void 0,...a,ref:t})});v.displayName=j;var y=a.forwardRef(({__scopeSwitch:e,control:t,checked:s,bubbles:l=!0,...r},i)=>{let c=a.useRef(null),m=(0,n.e)(c,i),x=(0,d.D)(s),h=(0,o.t)(t);return a.useEffect(()=>{let e=c.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(x!==s&&t){let a=new Event("click",{bubbles:l});t.call(e,s),e.dispatchEvent(a)}},[x,s,l]),(0,u.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s,...r,tabIndex:-1,ref:m,style:{...r.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function b(e){return e?"checked":"unchecked"}y.displayName="SwitchBubbleInput";var N=f,w=v}};var t=require("../../../../webpack-runtime.js");t.C(e);var s=e=>t(t.s=e),a=t.X(0,[9276,3543,9049,590,7598,931,6812,7344,1729,7141,2578,6508,2663,108,2194,7544,2721,8181,770,7471,3743,3393,1051,7944,2270,4680,466,7203],()=>s(39701));module.exports=a})();